| | |
| | | logo: { |
| | | label: "平台logo", |
| | | des: "显示平台logo状态", |
| | | fileName: "szdt", // gjdw, nfdw, gjdx, qwh, gdnr, szdt |
| | | fileName: "gjdw", // gjdw, nfdw, gjdx, qwh, gdnr, szdt |
| | | value: false, |
| | | }, |
| | | uKey: { |
| | |
| | | * 重庆定制: 'cqdz' |
| | | */ |
| | | // name: "", |
| | | name: "cqdz", |
| | | // name: "sxty", // 请查看alarmPopup是否开启,logo是否开启且为gjdw |
| | | // name: "cqdz", |
| | | name: "sxty", // 请查看alarmPopup是否开启,logo是否开启且为gjdw |
| | | // name: "tydc", |
| | | // name: 'szdt', |
| | | // name: 'njck', |
| | | name: "ynkm", // 云南昆明定制了设备实时告警和设备历史告警名称 打包时注意设置为isChangeAlarm=true,其他设置为false |
| | | // name: "ynkm", // 云南昆明定制了设备实时告警和设备历史告警名称 打包时注意设置为isChangeAlarm=true,其他设置为false |
| | | //value: false, |
| | | isChangeAlarm: false, |
| | | }, |
| | |
| | | alarmPopup: { |
| | | label: "告警弹出框", |
| | | des: "登录平台后,右下方告警弹出框提示", |
| | | value: false, |
| | | // value: true, |
| | | // value: false, |
| | | value: true, |
| | | }, |
| | | WHYC: { |
| | | label: "自用", |
| | |
| | | width="50" |
| | | align="center" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-checkbox :disabled="!isRowSelectable(row)" :value=isSelected(row) @change="handleSelectChange(row, $event)"></el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="编号" type="index" width="50"> |
| | | </el-table-column> |
| | |
| | | }, |
| | | detailsVisible: false, |
| | | selectedRows: [], |
| | | selectNums: [], |
| | | backupSelectedNums: [], |
| | | }; |
| | | }, |
| | | components: { |
| | |
| | | ][idx - 1]; |
| | | export_json_to_excel(tHeader, excelData, fileName); |
| | | }, |
| | | isRowSelectable(row, index) { |
| | | isRowSelectable(row) { |
| | | return row.alarmLevel != 1; |
| | | }, |
| | | toggleRowSelection(row, selected) { |
| | | if (selected) { |
| | | this.selectedRows.push(row); |
| | | } else { |
| | | this.selectedRows = this.selectedRows.filter(r => r !== row); |
| | | } |
| | | updateSelectionState() { |
| | | // console.log('updateSelectionState ?', '============='); |
| | | this.$nextTick(() => { |
| | | // console.log('updateSelectionState', JSON.stringify(this.backupSelectedNums), '============='); |
| | | |
| | | this.backupSelectedNums.forEach(num => { |
| | | const row = this.table1.datas.find(item => item.num === num); |
| | | if (row) this.$refs.unconfirmTable.toggleRowSelection(row, true); |
| | | }); |
| | | }); |
| | | |
| | | }, |
| | | |
| | | isSelected(row) { |
| | | return this.backupSelectedNums.includes(row.num); |
| | | }, |
| | | handleSelectChange(row, checked) { |
| | | // console.log('handleSelectChange?', '============='); |
| | | |
| | | if (row.alarmLevel == 1) return; // 禁用行直接返回 |
| | | const index = this.selectNums.indexOf(row.num); |
| | | if (checked && index === -1) { |
| | | this.selectNums.push(row.num); |
| | | } else if (!checked && index > -1) { |
| | | this.selectNums.splice(index, 1); |
| | | } |
| | | |
| | | }, |
| | | handleSelect(data) { |
| | | // console.log('handleSelect', data, '============='); |
| | | this.selectedRows = data; |
| | | // console.log('handleSelect ?', data, '============='); |
| | | let nums = []; |
| | | let selectedRows = []; |
| | | // console.log('handleSelect ', data, '============='); |
| | | for (let i = 0, len = data.length; i < len; i++) { |
| | | if (data[i].alarmLevel != 1) { |
| | | nums.push(data[i].num); |
| | | selectedRows.push(data[i]); |
| | | } else { |
| | | this.$refs.unconfirmTable.toggleRowSelection(data[i], false); |
| | | } |
| | | } |
| | | // console.log('nums', nums, 'selectedRows', selectedRows, '============='); |
| | | |
| | | this.selectNums = nums; |
| | | // this.backupSelectedNums = nums; |
| | | // this.selectedRows = data.filter(row => row.alarmLevel != 1); |
| | | this.selectedRows = selectedRows; |
| | | |
| | | |
| | | }, |
| | | // 批量确认 |
| | |
| | | if (isExportFile) { |
| | | this.exportFile(list, 1); |
| | | } else { |
| | | // console.log('update tabledata', JSON.stringify(this.selectNums), '============='); |
| | | |
| | | this.backupSelectedNums = [...this.selectNums]; |
| | | this.table1.datas = list; |
| | | // this.updateSelectionState(); |
| | | this.updateSelectionState(); |
| | | } |
| | | } else { |
| | | this.total1 = 0; |