细节优化

hn2.0
fanluyan 2 years ago
parent 2f6e140501
commit 812c2f4c61

@ -97,6 +97,8 @@ export default {
let formArr = [];
formArr.push(this.formdata);
console.log(this.formdata);
console.log(this.formdata.name.replace(/——/g, "-"));
this.formdata.name = this.formdata.name.replace(/——/g, "-");
addTowerApi({ list: formArr })
.then((res) => {
this.isShow = false;

@ -52,6 +52,9 @@ export default {
this.isShow = true;
console.log(data);
this.deviceData = data;
if (data.photoTime == null) {
data.photoTime = new Date().getTime();
}
this.getTerminalPhotoList(data.channelid, data.photoTime, data.termid);
},
//

@ -8,21 +8,35 @@
> -->
<div class="bottomM">
<div class="infoBox">
<p @click="handleLook">
<p @click="handleLook(-1)">
<span>装置总数</span>
<span>{{ termDataNum.totalNum }}</span>
<span>{{ termDataNum.totalNum ? termDataNum.totalNum : 0 }}</span>
</p>
<p>
<p @click="handleLook(1)">
<span>在线数量</span>
<span>{{ termDataNum.onlineNum }}</span>
<span>{{
termDataNum.onlineNum ? termDataNum.onlineNum : 0
}}</span>
</p>
<p>
<p @click="handleLook(0)">
<span>离线率</span>
<span>{{ (termDataNum.offlinePercent * 100).toFixed(2) }}%</span>
<span
>{{
termDataNum.offlinePercent
? (termDataNum.offlinePercent * 100).toFixed(2)
: 0
}}%</span
>
</p>
<p>
<span>在线率</span>
<span>{{ (termDataNum.onlinePercent * 100).toFixed(2) }}%</span>
<span @click="handleLook(0)">线</span>
<span
>{{
termDataNum.onlinePercent
? (termDataNum.onlinePercent * 100).toFixed(2)
: 0
}}%</span
>
</p>
</div>
</div>
@ -156,10 +170,13 @@ export default {
},
methods: {
//线
handleLook() {
handleLook(val) {
console.log(val);
this.dialogTableVisible = true;
this.exportLoading = true;
getOnlineTerminalList()
getOnlineTerminalList({
type: val,
})
.then((res) => {
console.log(res);
this.onLineData = res.data;
@ -234,8 +251,9 @@ export default {
getEchart2() {
this.$nextTick(() => {
console.log(this.termDataNum);
this.$echarts.init(document.getElementById("echart2")).dispose();
this.myChart2 = this.$echarts.init(document.getElementById("echart2"));
let that = this;
that.$echarts.init(document.getElementById("echart2")).dispose();
that.myChart2 = this.$echarts.init(document.getElementById("echart2"));
let option = {
// title: {
// text: "线",
@ -280,15 +298,23 @@ export default {
show: true,
},
data: [
{ value: this.termDataNum.onlineNum, name: "在线" },
{ value: this.termDataNum.offlineNum, name: "离线" },
{ value: that.termDataNum.onlineNum, name: "在线" },
{ value: that.termDataNum.offlineNum, name: "离线" },
],
},
],
};
this.myChart2.setOption(option);
that.myChart2.setOption(option);
window.addEventListener("resize", () => {
this.myChart2.resize();
that.myChart2.resize();
});
that.myChart2.on("click", function (params) {
console.log(params);
if (params.name == "在线") {
that.handleLook(1);
} else {
that.handleLook(0);
}
});
});
},
@ -491,6 +517,9 @@ export default {
flex-direction: column;
justify-content: space-around;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
&:hover {
cursor: pointer;
}
&:first-child {
&:hover {
cursor: pointer;

Loading…
Cancel
Save