样式优化,查看显示原图

hn2.0
fanluyan 2 years ago
parent 2f32262879
commit 6bd229588d

@ -55,7 +55,7 @@ export default {
items: [
{
icon: "el-icon-s-home",
index: "/videoHistory",
index: "/stritl",
title: "首页",
},
{

@ -7,6 +7,14 @@ export function loginJoggle(data) {
data,
});
}
//获取装置总数图表
export function getTermStatistics(data) {
return request({
url: "/api/getTermStatistics",
method: "get",
params: data,
});
}
//获取所有杆塔下的图片列表,实时监控
export function getTowerAndPhotoList(data) {

@ -445,7 +445,10 @@ export default {
var y = e.pageY - img.offsetTop;
//
personBox.addEventListener("mousemove", move);
console.log(personBox.addEventListener("mousemove", move));
console.log(personBox.style);
function move(e) {
console.log(personBox.style.left);
personBox.style.left = e.pageX - x + "px";
personBox.style.top = e.pageY - y + "px";
}
@ -995,8 +998,8 @@ export default {
cursor: pointer;
.picboxI {
position: relative;
width: 1366px;
height: 768px;
width: 1538px;
height: 865px;
margin: auto;
animation-name: scaleDraw;
/*关键帧名称*/
@ -1009,8 +1012,9 @@ export default {
align-items: center;
justify-content: center;
img {
max-width: 1366px;
max-height: 768px;
max-width: 1538px;
max-height: 865px;
margin: auto;
position: absolute;
cursor: grab;

@ -16,7 +16,12 @@
:style="'backgroundImage:url(' + bigPicPath + ')'"
></div>
<div class="bigimgView" v-viewer="OptionssalseImg">
<img ref="picJpg" class="animImg" :src="bigPicPath" />
<img
ref="picJpg"
class="animImg"
:src="bigPicPath.substring(0, bigPicPath.length - 9)"
:data-source="bigPicPath"
/>
</div>
<canvas id="myCanvas" class="myCanvas" ref="myCanvas"></canvas>

@ -116,7 +116,7 @@
class="bigpic"
v-if="item.path.indexOf('videos') == -1"
>
<img :src="item.path + '!1366x768'" />
<img :src="item.path" :data-source="item.path + '!1366x768'" />
<!-- <el-image :src="item.path" lazy></el-image> -->
@ -284,7 +284,11 @@ export default {
this.dyOptions = this.dyOptions.concat(res.data.list);
console.log(this.dyOptions);
//this.formdata.dyid = this.dyOptions[0].id;
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.dyid = this.dyOptions[0].id;
} else {
this.formdata.dyid = Number(this.$route.query.dyId);
}
// this.$set(this.formdata, 'dyid', this.dyOptions[0].id)
this.getSearchxl();
@ -298,7 +302,12 @@ export default {
this.xlOptions = [{ id: -1, name: "全部" }];
this.xlOptions = this.xlOptions.concat(res.data.list);
// this.formdata.lineid = this.xlOptions[0].id;
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.lineid = this.xlOptions[0].id;
} else {
this.formdata.lineid = Number(this.$route.query.lineId);
}
this.getSearchgt();
})
.catch((err) => {});
@ -310,7 +319,12 @@ export default {
this.gtOptions = [{ id: -1, name: "全部" }];
this.gtOptions = this.gtOptions.concat(res.data.list);
// this.formdata.towerid = this.gtOptions[0].id;
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.towerid = this.gtOptions[0].id;
} else {
this.formdata.towerid = Number(this.$route.query.towerId);
}
this.getSearchzz();
})
.catch((err) => {});
@ -322,7 +336,12 @@ export default {
this.zzOptions = [{ id: -1, name: "全部" }];
this.zzOptions = this.zzOptions.concat(res.data.list);
// this.formdata.termid = this.zzOptions[0].id;
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.termid = this.zzOptions[0].id;
} else {
this.formdata.termid = Number(this.$route.query.termId);
}
this.getSearchtd();
})
.catch((err) => {});
@ -334,7 +353,12 @@ export default {
this.tdOptions = [{ id: -1, name: "全部", alias: null }];
this.tdOptions = this.tdOptions.concat(res.data.list);
//this.formdata.channelid = this.tdOptions[0].id;
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.channelid = this.tdOptions[0].id;
} else {
this.formdata.channelid = Number(this.$route.query.channelId);
}
// if (this.signtype == 0) {
// this.getPicData();
// }

@ -1,13 +1,360 @@
<template>
<div class="stritlBox">首页</div>
<div class="stritleEchartsPage">
<div class="echart-top">
<el-card class="box-card">
<h3>装置数量统计</h3>
<div class="bottomM">
<div class="infoBox">
<p>
<span>装置总数</span>
<span>1</span>
</p>
<p>
<span>在线数量</span>
<span>2</span>
</p>
<p>
<span>杆塔覆盖率</span>
<span>3%</span>
</p>
<p>
<span>在线率</span>
<span>4%</span>
</p>
</div>
</div>
<!-- <div id="echart1" style="width: 100%; height: 100%"></div> -->
</el-card>
<el-card class="box-card">
<h3>装置在线统计</h3>
<div id="echart2" style="width: 100%; height: 100%"></div>
</el-card>
</div>
<div class="echart-top">
<el-card class="box-card">
<h3>隐患数量统计</h3>
<div class="dateBox">
<el-date-picker
v-model="value1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="morepickerOptions"
>
</el-date-picker>
</div>
<div id="echart3" style="width: 100%; height: 100%"></div>
</el-card>
<el-card class="box-card">
<h3>隐患分类统计</h3>
<div class="dateBox">
<el-date-picker
v-model="value2"
align="right"
type="date"
placeholder="选择日期"
:picker-options="singpickerOptions"
>
</el-date-picker>
</div>
<div id="echart4" style="width: 100%; height: 100%"></div>
</el-card>
</div>
</div>
</template>
<script>
import { getTermStatistics } from "@/utils/api/index";
export default {
name: "",
data() {
return {
termDataNum: "",
value1: "",
value2: "",
morepickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
],
},
singpickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
},
myChart2: "",
myChart3: "",
myChart4: "",
};
},
mounted() {
this.getTermData();
this.init();
},
watch: {
"$store.state.collapse"(val) {
console.log(val);
setTimeout(() => {
//echarts
this.myChart1.resize();
this.myChart2.resize();
this.myChart3.resize();
this.myChart4.resize();
}, 300);
},
},
methods: {
getTermData() {
getTermStatistics()
.then((res) => {
console.log(res);
this.termDataNum = res.data;
})
.catch((err) => {});
},
init() {
this.getEchart2();
this.getEchart3();
this.getEchart4();
},
<script></script>
getEchart2() {
this.$nextTick(() => {
this.$echarts.init(document.getElementById("echart2")).dispose();
this.myChart2 = this.$echarts.init(document.getElementById("echart2"));
let option = {
// title: {
// text: "线",
// },
tooltip: {
trigger: "item",
},
legend: {
top: "5%",
left: "center",
},
series: [
{
type: "pie",
radius: ["40%", "70%"],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: "#fff",
borderWidth: 2,
},
label: {
show: true,
fontSize: 16,
fontWeight: "bold",
formatter: "{b}\n{d}%",
},
emphasis: {
label: {
show: true,
fontSize: 26,
fontWeight: "bold",
formatter: "{b}\n{d}%",
},
},
labelLine: {
show: true,
},
data: [
{ value: 1048, name: "在线" },
{ value: 735, name: "离线" },
],
},
],
};
this.myChart2.setOption(option);
window.addEventListener("resize", () => {
this.myChart2.resize();
});
});
},
getEchart3() {
this.$nextTick(() => {
this.$echarts.init(document.getElementById("echart3")).dispose();
this.myChart3 = this.$echarts.init(document.getElementById("echart3"));
let option = {
// title: {
// text: "",
// },
xAxis: {
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
},
yAxis: { type: "value" },
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: "bar",
showBackground: true,
backgroundStyle: { color: "rgba(180, 180, 180, 0.2)" },
},
],
};
this.myChart3.setOption(option);
window.addEventListener("resize", () => {
this.myChart3.resize();
});
});
},
getEchart4() {
this.$nextTick(() => {
this.$echarts.init(document.getElementById("echart4")).dispose();
this.myChart4 = this.$echarts.init(document.getElementById("echart4"));
let option = {
// title: {
// text: "",
// },
xAxis: {
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
},
yAxis: { type: "value" },
series: [
{
data: [120, 200, 150, 80, 70, 110, 130],
type: "bar",
showBackground: true,
backgroundStyle: { color: "rgba(180, 180, 180, 0.2)" },
},
],
};
this.myChart4.setOption(option);
window.addEventListener("resize", () => {
this.myChart4.resize();
});
});
},
},
};
</script>
<style lang="less">
.stritlBox {
width: 100%;
.stritleEchartsPage {
height: calc(100% - 32px);
padding: 16px;
display: flex;
flex-direction: column;
justify-content: space-around;
.echart-top {
display: flex;
height: 48%;
justify-content: space-between;
.el-card {
width: 49%;
height: 100%;
.el-card__body {
height: calc(100% - 40px);
position: relative;
}
}
.box-card {
h3 {
font-size: 18px;
color: #333;
line-height: 32px;
}
.bottomM {
.infoBox {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin-top: 32px;
p {
width: 40%;
height: 88px;
text-align: center;
margin: 28px;
display: flex;
flex-direction: column;
justify-content: space-around;
span {
color: #333;
font-size: 16px;
&:last-child {
font-size: 20px;
margin-top: 5px;
font-weight: bold;
}
}
&:first-child {
//background: url("../../assets/img/border-blue.png");
background: linear-gradient(
to bottom,
rgb(22, 158, 140, 0.3) 0%,
rgba(255, 255, 255, 0.1) 30%,
rgba(255, 255, 255, 0.1) 40%,
rgba(255, 255, 255, 0.1) 50%,
rgba(255, 255, 255, 0.1) 60%,
rgba(255, 255, 255, 0.1) 70%,
rgb(22, 158, 140, 0.3) 100%
);
}
&:nth-child(2) {
background: url("../../assets/img/border-green.png");
background: linear-gradient(
to bottom,
rgb(0, 234, 27, 0.3) 0%,
rgba(255, 255, 255, 0.1) 30%,
rgba(255, 255, 255, 0.1) 40%,
rgba(255, 255, 255, 0.1) 50%,
rgba(255, 255, 255, 0.1) 60%,
rgba(255, 255, 255, 0.1) 70%,
rgb(0, 234, 27, 0.3) 100%
);
}
&:nth-child(3) {
background: url("../../assets/img/border-yellow.png");
background: linear-gradient(
to bottom,
rgb(207, 222, 44, 0.3) 0%,
rgba(255, 255, 255, 0.1) 30%,
rgba(255, 255, 255, 0.1) 40%,
rgba(255, 255, 255, 0.1) 50%,
rgba(255, 255, 255, 0.1) 60%,
rgba(255, 255, 255, 0.1) 70%,
rgb(207, 222, 44, 0.3) 100%
);
}
&:nth-child(4) {
background: url("../../assets/img/border-gray.png");
background: linear-gradient(
to bottom,
rgb(84, 112, 198, 0.3) 0%,
rgba(255, 255, 255, 0.1) 30%,
rgba(255, 255, 255, 0.1) 40%,
rgba(255, 255, 255, 0.1) 50%,
rgba(255, 255, 255, 0.1) 60%,
rgba(255, 255, 255, 0.1) 70%,
rgb(84, 112, 198, 0.3) 100%
);
}
}
}
}
.dateBox {
position: absolute;
top: 20px;
right: 20px;
}
}
}
}
</style>

Loading…
Cancel
Save