Browse Source

电力监控属性更新

learshaw 4 days ago
parent
commit
56458a598f

File diff suppressed because it is too large
+ 612 - 355
ems-ui-cloud/src/views/adapter/dljk/index.vue


+ 13 - 13
ems-ui-cloud/src/views/adapter/zm/index.vue

@@ -210,8 +210,8 @@
                               {{ getConcentratorAttr(props.row.deviceCode, 'deviceModelId', 'Base') || '-' }}
                             </el-descriptions-item>
                             <el-descriptions-item label="设备状态">
-                              <el-tag size="small" :type="getConcentratorAttr(props.row.deviceCode, 'abnormal', 'Base') === '0' ? 'success' : 'danger'">
-                                {{ getConcentratorAttr(props.row.deviceCode, 'abnormal', 'Base') === '0' ? '正常' : '异常' }}
+                              <el-tag size="small" :type="getConcentratorAttr(props.row.deviceCode, 'deviceStatus', 'Base') === '0' ? 'success' : 'danger'">
+                                {{ getConcentratorAttr(props.row.deviceCode, 'deviceStatus', 'Base') === '0' ? '正常' : '异常' }}
                               </el-tag>
                             </el-descriptions-item>
                             <el-descriptions-item label="信号强度">
@@ -719,16 +719,16 @@
                       </el-table-column>
                       <el-table-column label="开关状态" width="100" align="center">
                         <template slot-scope="scope">
-                          <el-tag size="small" :type="getLampGroupAttrValue(scope.row.deviceCode, 'lampOnOff') === '1' ? 'success' : 'info'">
-                            <i :class="getLampGroupAttrValue(scope.row.deviceCode, 'lampOnOff') === '1' ? 'el-icon-sunny' : 'el-icon-moon'"></i>
-                            {{ getLampGroupAttrValue(scope.row.deviceCode, 'lampOnOff') === '1' ? '开启' : '关闭' }}
+                          <el-tag size="small" :type="getLampGroupAttrValue(scope.row.deviceCode, 'Switch') === '1' ? 'success' : 'info'">
+                            <i :class="getLampGroupAttrValue(scope.row.deviceCode, 'Switch') === '1' ? 'el-icon-sunny' : 'el-icon-moon'"></i>
+                            {{ getLampGroupAttrValue(scope.row.deviceCode, 'Switch') === '1' ? '开启' : '关闭' }}
                           </el-tag>
                         </template>
                       </el-table-column>
                       <el-table-column label="设备状态" width="100" align="center">
                         <template slot-scope="scope">
-                          <el-tag size="small" :type="getLampGroupAttrValue(scope.row.deviceCode, 'abnormal') === '0' ? 'success' : 'danger'">
-                            {{ getLampGroupAttrValue(scope.row.deviceCode, 'abnormal') === '0' ? '正常' : '异常' }}
+                          <el-tag size="small" :type="getLampGroupAttrValue(scope.row.deviceCode, 'deviceStatus') === '0' ? 'success' : 'danger'">
+                            {{ getLampGroupAttrValue(scope.row.deviceCode, 'deviceStatus') === '0' ? '正常' : '异常' }}
                           </el-tag>
                         </template>
                       </el-table-column>
@@ -1347,7 +1347,7 @@ export default {
 
     // 获取开关控制按钮的类型(根据当前状态)
     getLightControlButtonType(deviceCode, optionValue) {
-      const currentState = this.getLampGroupAttrValue(deviceCode, 'lampOnOff')
+      const currentState = this.getLampGroupAttrValue(deviceCode, 'Switch')
 
       // 关灯状态(0):开灯按钮绿色,关灯按钮灰色
       // 开灯状态(1):关灯按钮绿色,开灯按钮灰色
@@ -2077,8 +2077,8 @@ export default {
     getOnlineLampGroupCount(poleCode) {
       const lampGroups = this.getLampGroupList(poleCode)
       return lampGroups.filter(lamp => {
-        const abnormal = this.getLampGroupAttrValue(lamp.deviceCode, 'abnormal')
-        return abnormal === '0'
+        const deviceStatus = this.getLampGroupAttrValue(lamp.deviceCode, 'deviceStatus')
+        return deviceStatus === '0'
       }).length
     },
 
@@ -2086,15 +2086,15 @@ export default {
     calculateLampGroupStats() {
       this.totalLampCount = this.lampGroupList.length
       this.onlineLampCount = this.lampGroupList.filter(lamp => {
-        const abnormal = this.getLampGroupAttrValue(lamp.deviceCode, 'abnormal')
-        return abnormal === '0'
+        const deviceStatus = this.getLampGroupAttrValue(lamp.deviceCode, 'deviceStatus')
+        return deviceStatus === '0'
       }).length
 
       // 统计开启的灯组和总功率
       let onCount = 0
       let totalPower = 0
       this.lampGroupList.forEach(lamp => {
-        const lampOnOff = this.getLampGroupAttrValue(lamp.deviceCode, 'lampOnOff')
+        const lampOnOff = this.getLampGroupAttrValue(lamp.deviceCode, 'Switch')
         if (lampOnOff === '1') {
           onCount++
           const power = parseFloat(this.getLampGroupAttrValue(lamp.deviceCode, 'power')) || 0

+ 14 - 14
ems-ui-cloud/src/views/basecfg/device/index.vue

@@ -687,20 +687,20 @@
                     </template>
                   </el-table-column>
 
-                  <el-table-column prop="deviceCode" label="设备代码" min-width="180"></el-table-column>
-
-                  <el-table-column label="设备SN" width="120">
+                  <el-table-column  label="设备名称" min-width="80">
                     <template slot-scope="scope">
-                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'deviceUid') || '-' }}
+                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'deviceName') }}
                     </template>
                   </el-table-column>
 
+                  <el-table-column prop="deviceCode" label="设备代码" min-width="180"></el-table-column>
+
                   <el-table-column label="设备状态" width="100" align="center">
                     <template slot-scope="scope">
                       <el-tag size="small"
-                              :type="getSubDeviceAttrValue(scope.row.deviceCode, 'abnormal') === '0' ? 'success' : 'danger'"
+                              :type="getSubDeviceAttrValue(scope.row.deviceCode, 'deviceStatus') === '0' ? 'success' : 'danger'"
                       >
-                        {{ getSubDeviceAttrValue(scope.row.deviceCode, 'abnormal') === '0' ? '正常' : '异常' }}
+                        {{ getSubDeviceAttrValue(scope.row.deviceCode, 'deviceStatus') === '0' ? '正常' : '异常' }}
                       </el-tag>
                     </template>
                   </el-table-column>
@@ -708,31 +708,31 @@
                   <el-table-column label="开关状态" width="100" align="center">
                     <template slot-scope="scope">
                       <el-tag size="small"
-                              :type="getSubDeviceAttrValue(scope.row.deviceCode, 'lampOnOff') === '1' ? 'success' : 'info'"
+                              :type="getSubDeviceAttrValue(scope.row.deviceCode, 'Switch') === '1' ? 'success' : 'info'"
                       >
                         <i
-                          :class="getSubDeviceAttrValue(scope.row.deviceCode, 'lampOnOff') === '1' ? 'el-icon-sunny' : 'el-icon-moon'"
+                          :class="getSubDeviceAttrValue(scope.row.deviceCode, 'Switch') === '1' ? 'el-icon-sunny' : 'el-icon-moon'"
                         ></i>
-                        {{ getSubDeviceAttrValue(scope.row.deviceCode, 'lampOnOff') === '1' ? '开启' : '关闭' }}
+                        {{ getSubDeviceAttrValue(scope.row.deviceCode, 'Switch') === '1' ? '开启' : '关闭' }}
                       </el-tag>
                     </template>
                   </el-table-column>
 
                   <el-table-column label="功率" width="90" align="center">
                     <template slot-scope="scope">
-                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'power') || '0' }}W
+                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'power') || '-' }}W
                     </template>
                   </el-table-column>
 
                   <el-table-column label="电压" width="90" align="center">
                     <template slot-scope="scope">
-                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'voltage') || '0' }}V
+                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'voltage') || '-' }}V
                     </template>
                   </el-table-column>
 
                   <el-table-column label="电流" width="90" align="center">
                     <template slot-scope="scope">
-                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'current') || '0' }}A
+                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'current') || '-' }}A
                     </template>
                   </el-table-column>
                 </el-table>
@@ -1416,8 +1416,8 @@ export default {
      */
     getOnlineSubDeviceCount() {
       return this.subDeviceList.filter(device => {
-        const abnormal = this.getSubDeviceAttrValue(device.deviceCode, 'abnormal')
-        return abnormal === '0'
+        const deviceStatus = this.getSubDeviceAttrValue(device.deviceCode, 'deviceStatus')
+        return deviceStatus === '0'
       }).length
     },
 

+ 14 - 14
ems-ui-cloud/src/views/devmgr/device/index.vue

@@ -428,46 +428,46 @@
                     </template>
                   </el-table-column>
 
-                  <el-table-column prop="deviceCode" label="设备代码" min-width="180"></el-table-column>
-
-                  <el-table-column label="设备SN" width="120">
+                  <el-table-column  label="设备名称" min-width="80">
                     <template slot-scope="scope">
-                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'deviceUid') || '-' }}
+                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'deviceName') }}
                     </template>
                   </el-table-column>
 
+                  <el-table-column prop="deviceCode" label="设备代码" min-width="100"></el-table-column>
+
                   <el-table-column label="设备状态" width="100" align="center">
                     <template slot-scope="scope">
-                      <el-tag size="small" :type="getSubDeviceAttrValue(scope.row.deviceCode, 'abnormal') === '0' ? 'success' : 'danger'">
-                        {{ getSubDeviceAttrValue(scope.row.deviceCode, 'abnormal') === '0' ? '正常' : '异常' }}
+                      <el-tag size="small" :type="getSubDeviceAttrValue(scope.row.deviceCode, 'deviceStatus') === '0' ? 'success' : 'danger'">
+                        {{ getSubDeviceAttrValue(scope.row.deviceCode, 'deviceStatus') === '0' ? '正常' : '异常' }}
                       </el-tag>
                     </template>
                   </el-table-column>
 
                   <el-table-column label="开关状态" width="100" align="center">
                     <template slot-scope="scope">
-                      <el-tag size="small" :type="getSubDeviceAttrValue(scope.row.deviceCode, 'lampOnOff') === '1' ? 'success' : 'info'">
-                        <i :class="getSubDeviceAttrValue(scope.row.deviceCode, 'lampOnOff') === '1' ? 'el-icon-sunny' : 'el-icon-moon'"></i>
-                        {{ getSubDeviceAttrValue(scope.row.deviceCode, 'lampOnOff') === '1' ? '开启' : '关闭' }}
+                      <el-tag size="small" :type="getSubDeviceAttrValue(scope.row.deviceCode, 'Switch') === '1' ? 'success' : 'info'">
+                        <i :class="getSubDeviceAttrValue(scope.row.deviceCode, 'Switch') === '1' ? 'el-icon-sunny' : 'el-icon-moon'"></i>
+                        {{ getSubDeviceAttrValue(scope.row.deviceCode, 'Switch') === '1' ? '开启' : '关闭' }}
                       </el-tag>
                     </template>
                   </el-table-column>
 
                   <el-table-column label="功率" width="90" align="center">
                     <template slot-scope="scope">
-                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'power') || '0' }}W
+                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'power') || '-' }}W
                     </template>
                   </el-table-column>
 
                   <el-table-column label="电压" width="90" align="center">
                     <template slot-scope="scope">
-                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'voltage') || '0' }}V
+                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'voltage') || '-' }}V
                     </template>
                   </el-table-column>
 
                   <el-table-column label="电流" width="90" align="center">
                     <template slot-scope="scope">
-                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'current') || '0' }}A
+                      {{ getSubDeviceAttrValue(scope.row.deviceCode, 'current') || '-' }}A
                     </template>
                   </el-table-column>
                 </el-table>
@@ -1009,8 +1009,8 @@ export default {
 
     getOnlineSubDeviceCount() {
       return this.subDeviceList.filter(device => {
-        const abnormal = this.getSubDeviceAttrValue(device.deviceCode, 'abnormal')
-        return abnormal === '0'
+        const deviceStatus = this.getSubDeviceAttrValue(device.deviceCode, 'deviceStatus')
+        return deviceStatus === '0'
       }).length
     },
 

Some files were not shown because too many files changed in this diff