diff --git a/src/views/itOperation/index.vue b/src/views/itOperation/index.vue index 8eb9a04..0a6b165 100644 --- a/src/views/itOperation/index.vue +++ b/src/views/itOperation/index.vue @@ -127,16 +127,15 @@ @@ -403,6 +402,8 @@ export default { pageSize: 20, // 每页数量 total: 0, //总条数 loading: false, + //全选 + isCheckedAll: false, }; }, watch: { @@ -453,6 +454,8 @@ export default { card2caaid: true, }; } + //添加check + this.getAdd(this.tableData); }, methods: { //获取电压信息 @@ -502,9 +505,46 @@ export default { this.pageSize = 20; //this.terminalList(); }, - handleClick(row) { - console.log(row); + //给每条数据添加checkbox + getAdd(arr) { + console.log(arr); + var that = this; + arr.forEach(function (item, index, array) { + that.$set(arr[index], "isheartCheck", false); + }); + console.log(arr); + return arr; }, + //快心跳全选 + handleCheckAllChange(val) { + console.log(val); + if (val) { + console.log("我全选了"); + let mutCheck = []; + this.tableData.forEach((item) => { + item.isheartCheck = true; + mutCheck.push(item.cmdID); + }); + console.log(mutCheck); + this.$message({ + message: "全选了快心跳" + mutCheck, + type: "success", + }); + } else { + console.log("我全部取消"); + this.tableData.forEach((item) => { + item.isheartCheck = false; + }); + } + // this.checkedCities = val ? cityOptions : []; + // this.isIndeterminate = false; + }, + //快心跳单选 + handleheartChange(val) { + console.log(val); + }, + + //设置列的显示隐藏 showColumnOption() { this.isShowColumn = true; }, diff --git a/src/views/stritl/index.vue b/src/views/stritl/index.vue index 9aff94f..9881282 100644 --- a/src/views/stritl/index.vue +++ b/src/views/stritl/index.vue @@ -10,19 +10,33 @@

装置总数 - {{ termDataNum.totalNum }} + {{ termDataNum.totalNum ? termDataNum.totalNum : 0 }}

在线数量 - {{ termDataNum.onlineNum }} + {{ + termDataNum.onlineNum ? termDataNum.onlineNum : 0 + }}

离线率 - {{ (termDataNum.offlinePercent * 100).toFixed(2) }}% + {{ + termDataNum.offlinePercent + ? (termDataNum.offlinePercent * 100).toFixed(2) + : 0 + }}%

在线率 - {{ (termDataNum.onlinePercent * 100).toFixed(2) }}% + {{ + termDataNum.onlinePercent + ? (termDataNum.onlinePercent * 100).toFixed(2) + : 0 + }}%