From 0ae83a895e80a4b9777a27f613d721a7e5e2ac18 Mon Sep 17 00:00:00 2001 From: ali <ali9696@163.com> Date: 星期二, 03 九月 2024 10:18:27 +0800 Subject: [PATCH] 整体样式修改 --- energy_management_ui/src/views/equipmentMonitor/realTimeMonitoring/parametersTable.vue | 251 ++++++++++++++++++++++++++----------------------- 1 files changed, 132 insertions(+), 119 deletions(-) diff --git a/energy_management_ui/src/views/equipmentMonitor/realTimeMonitoring/parametersTable.vue b/energy_management_ui/src/views/equipmentMonitor/realTimeMonitoring/parametersTable.vue index 8255d1d..4482382 100644 --- a/energy_management_ui/src/views/equipmentMonitor/realTimeMonitoring/parametersTable.vue +++ b/energy_management_ui/src/views/equipmentMonitor/realTimeMonitoring/parametersTable.vue @@ -1,52 +1,66 @@ <template> <div class="app-container" style="padding: 0"> <div style="margin-bottom:10px;"> - <span>{{currentNode?currentNode.label:''}}娴嬬偣鍙傛暟鍒楄〃</span> + <span>{{ currentNode ? currentNode.label : "" }}娴嬬偣鍙傛暟鍒楄〃</span> </div> <el-table :data="parameterTableData" border style="width: 100%" - @cell-click="openDialog"> - <el-table-column - prop="code" - label="鎸囨爣缂栫爜" - width="180" - align="center"> + @cell-click="openDialog" + > + <el-table-column prop="code" label="鎸囨爣缂栫爜" width="180" align="center"> </el-table-column> - <el-table-column - prop="indexName" - label="鎸囨爣鍚嶇О" - align="center"> + <el-table-column prop="indexName" label="鎸囨爣鍚嶇О" align="center"> <template slot-scope="scope"> - <div style="color:blue;text-decoration:underline;cursor:pointer">{{scope.row.indexName}}</div> + <div style="color:blue;text-decoration:underline;cursor:pointer"> + {{ scope.row.indexName }} + </div> </template> </el-table-column> <el-table-column prop="indexUnit" label="鎸囨爣鍗曚綅" align="center" - :formatter="unitFormat"> + :formatter="unitFormat" + > </el-table-column> - <el-table-column - prop="value" - label="鎸囨爣鍊�(瀹炴椂鍊�)" - align="center"> + <el-table-column prop="value" label="鎸囨爣鍊�(瀹炴椂鍊�)" align="center"> </el-table-column> </el-table> <!--鏇茬嚎鍥句笌琛ㄦ牸--> - <el-dialog :title="title" :visible.sync="open" width="1000px" :close-on-click-modal="false" @close="closeDialog"> - <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> - <el-tabs v-model="activeName" @tab-click="handleClick" > + <el-dialog + :title="title" + :visible.sync="open" + width="1000px" + :close-on-click-modal="false" + @close="closeDialog" + > + <el-row style="padding:16px 16px 0;margin-bottom:32px;"> + <el-tabs v-model="activeName" @tab-click="handleClick"> <el-tab-pane label="瀹炴椂鏁版嵁鏇茬嚎鍥�" name="first"> - <live-alarm-view ref="liveAlarmView" :code="code" :activeName="activeName"></live-alarm-view> + <live-alarm-view + ref="liveAlarmView" + :code="code" + :activeName="activeName" + ></live-alarm-view> </el-tab-pane> <el-tab-pane label="鍘嗗彶鏁版嵁鏇茬嚎鍥�" name="second"> - <history-alarm-view ref="historyAlarmView" :code="code" :activeName="activeName"></history-alarm-view> + <history-alarm-view + ref="historyAlarmView" + :code="code" + :activeName="activeName" + ></history-alarm-view> </el-tab-pane> <el-tab-pane label="鍘嗗彶鏁版嵁鏌ヨ" name="third"> - <history-alarm-table ref="historyAlarmTable" :code="code" :indexName="indexName" :activeName="activeName" :indexUnit="indexUnit"></history-alarm-table> + <history-alarm-table + ref="historyAlarmTable" + :code="code" + :indexName="indexName" + :activeName="activeName" + :indexUnit="indexUnit" + ></history-alarm-table> </el-tab-pane> </el-tabs> </el-row> @@ -58,103 +72,102 @@ </template> <script> - import {getSettingIndex} from "@/api/equipmentMonitor/realTimeMonitoring/realTimeMonitoring"; - import liveAlarmView from "../../energyAlarm/realTimeAlarm/liveAlarmView"; - import historyAlarmView from "../../energyAlarm/realTimeAlarm/historyAlarmView"; - import historyAlarmTable from "../../energyAlarm/realTimeAlarm/historyAlarmTable"; - export default { - name: "parametersTable", - components: {liveAlarmView,historyAlarmView,historyAlarmTable}, - data(){ - return{ - parameterTableData:[], - currentNode:undefined, - unitOptions:undefined, - intervalTime:undefined, - timer:undefined, - //寮瑰嚭灞� - activeName:undefined, - title:"瀹炴椂鏁版嵁", - open:false, - code:undefined, - indexName:undefined, - indexUnit:undefined, - deviceCategory:undefined, - queryParams:{ - nodeId:undefined, - //鎸囨爣index - indexType:"COLLECT", - } - } - }, - created() { - this.getDicts("sys_unit").then(response => { - this.unitOptions = response.data; - }); - }, - mounted() - { - this.getConfigKey("equipmentMonitor.realTimeMonitoring.intervalTime").then(response => { - this.intervalTime = response.msg; - this.timer = setInterval(this.getList, this.intervalTime); - }); - }, - beforeDestroy() { - //椤甸潰閿�姣佹椂 瑕佸仠姝㈣鏃跺櫒锛屽惁鍒欓�夐」鍗″垏鎹㈣鏃跺櫒涓嶅仠姝紝浼氳秺鏉ヨ秺蹇紝澶氫釜绾跨▼ - if(this.timer) { - clearInterval(this.timer); - } - }, - methods:{ - modelNodeChange(modelNode,deviceCategory) { - if (modelNode) { - this.queryParams.nodeId = modelNode.id; - this.deviceCategory = deviceCategory; - if("5"===this.deviceCategory){ - this.getList(); - }else { - this.parameterTableData = []; - } - } - }, - getList(){ - getSettingIndex(this.queryParams).then(response => { - this.parameterTableData = []; - this.parameterTableData = response.data; - }); - }, - // 鍗曚綅瀛楀吀缈昏瘧 - unitFormat(row, column) { - return this.selectDictLabel(this.unitOptions, row.indexUnit); - }, - //鏇茬嚎寮瑰嚭 - openDialog(row,column,event,cell){ - if("indexName"===column.property){ - this.open = true; - this.code = row.code; - this.indexName = row.indexName; - this.indexId = row.indexId; - this.activeName = "first"; - this.indexUnit = this.selectDictLabel(this.unitOptions, row.indexUnit); - } - }, - //鍏抽棴 - closeDialog(){ - this.activeName = ""; - this.$refs.historyAlarmTable.cleanTable(); - }, - //鍙栨秷 - cancelDialog(){ - this.open = false; - this.$refs.historyAlarmTable.cleanTable(); - }, - handleClick(tab, event){ - this.activeName = tab.name; - }, +import { getSettingIndex } from "@/api/equipmentMonitor/realTimeMonitoring/realTimeMonitoring"; +import liveAlarmView from "../../energyAlarm/realTimeAlarm/liveAlarmView"; +import historyAlarmView from "../../energyAlarm/realTimeAlarm/historyAlarmView"; +import historyAlarmTable from "../../energyAlarm/realTimeAlarm/historyAlarmTable"; +export default { + name: "parametersTable", + components: { liveAlarmView, historyAlarmView, historyAlarmTable }, + data() { + return { + parameterTableData: [], + currentNode: undefined, + unitOptions: undefined, + intervalTime: undefined, + timer: undefined, + //寮瑰嚭灞� + activeName: undefined, + title: "瀹炴椂鏁版嵁", + open: false, + code: undefined, + indexName: undefined, + indexUnit: undefined, + deviceCategory: undefined, + queryParams: { + nodeId: undefined, + //鎸囨爣index + indexType: "COLLECT" } + }; + }, + created() { + this.getDicts("sys_unit").then(response => { + this.unitOptions = response.data; + }); + }, + mounted() { + this.getConfigKey("equipmentMonitor.realTimeMonitoring.intervalTime").then( + response => { + this.intervalTime = response.msg; + this.timer = setInterval(this.getList, this.intervalTime); + } + ); + }, + beforeDestroy() { + //椤甸潰閿�姣佹椂 瑕佸仠姝㈣鏃跺櫒锛屽惁鍒欓�夐」鍗″垏鎹㈣鏃跺櫒涓嶅仠姝紝浼氳秺鏉ヨ秺蹇紝澶氫釜绾跨▼ + if (this.timer) { + clearInterval(this.timer); } + }, + methods: { + modelNodeChange(modelNode, deviceCategory) { + if (modelNode) { + this.queryParams.nodeId = modelNode.id; + this.deviceCategory = deviceCategory; + if ("5" === this.deviceCategory) { + this.getList(); + } else { + this.parameterTableData = []; + } + } + }, + getList() { + getSettingIndex(this.queryParams).then(response => { + this.parameterTableData = []; + this.parameterTableData = response.data; + }); + }, + // 鍗曚綅瀛楀吀缈昏瘧 + unitFormat(row, column) { + return this.selectDictLabel(this.unitOptions, row.indexUnit); + }, + //鏇茬嚎寮瑰嚭 + openDialog(row, column, event, cell) { + if ("indexName" === column.property) { + this.open = true; + this.code = row.code; + this.indexName = row.indexName; + this.indexId = row.indexId; + this.activeName = "first"; + this.indexUnit = this.selectDictLabel(this.unitOptions, row.indexUnit); + } + }, + //鍏抽棴 + closeDialog() { + this.activeName = ""; + this.$refs.historyAlarmTable.cleanTable(); + }, + //鍙栨秷 + cancelDialog() { + this.open = false; + this.$refs.historyAlarmTable.cleanTable(); + }, + handleClick(tab, event) { + this.activeName = tab.name; + } + } +}; </script> -<style scoped> - -</style> +<style scoped></style> -- Gitblit v1.9.3