Przeglądaj źródła

feat(alarm): modify the alarm content for manual power operation

Casper Dai 2 lat temu
rodzic
commit
e1337a1bb0

+ 1 - 1
src/api/device.js

@@ -458,7 +458,7 @@ function getTag (status) {
 }
 
 export function getUsersByInform ({ messageId }) {
-  return send({
+  return request({
     url: '/deviceException/user/list',
     method: 'GET',
     params: { messageId }

+ 7 - 10
src/views/device/detail/components/DeviceInvoke/MultifunctionCardPowerSwitch.vue

@@ -127,7 +127,7 @@ import {
   savePowerLogger,
   sendDeviceAlarm
 } from '@/api/platform'
-import baseMixin from './mixins/base'
+import baseMixin from './mixins/base.js'
 
 const ErrorMessage = {
   TIMEOUT: '暂未获取到操作反馈,请回读查看',
@@ -577,16 +577,15 @@ export default {
           type: 'warning'
         }
       ).then(() => {
-        const target = `手动${this.actionInfo[targetAction]} 设备【${this.device.name}】 ${type} 端口${powerIndex}`
         savePowerLogger({
-          description: target,
+          description: `手动${this.actionInfo[targetAction]} 设备【${this.device.name}】 ${type} 端口${powerIndex}`,
           method: `${this.actionInfo[targetAction]}电源`,
           params: `${this.device.id} ${this.device.name}`
         })
         sendDeviceAlarm({
           deviceId: this.device.id,
           errorEnumId: targetAction ? 36 : 37,
-          message: `用户: ${this.account} ${target}`
+          message: `用户【${this.account}】 手动${this.actionInfo[targetAction]} ${type} 端口${powerIndex}`
         })
         this.onSwitchPowerSingle(power)
       })
@@ -602,16 +601,15 @@ export default {
           type: 'warning'
         }
       ).then(() => {
-        const target = `手动${this.actionInfo[targetAction]} 设备【${this.device.name}】 ${type}`
         savePowerLogger({
-          description: target,
+          description: `手动${this.actionInfo[targetAction]} 设备【${this.device.name}】 ${type}`,
           method: `${this.actionInfo[targetAction]}电源`,
           params: `${this.device.id} ${this.device.name}`
         })
         sendDeviceAlarm({
           deviceId: this.device.id,
           errorEnumId: targetAction ? 36 : 37,
-          message: `用户: ${this.account} ${target}`
+          message: `用户【${this.account}】 手动${this.actionInfo[targetAction]} ${type}`
         })
         if (portIndex === RELAY_KEY) {
           this.onSwitchPowerSingle(power)
@@ -696,16 +694,15 @@ export default {
           type: 'warning'
         }
       ).then(() => {
-        const target = `手动${this.actionInfo[action]} 设备【${this.device.name}】 所有电源`
         savePowerLogger({
-          description: target,
+          description: `手动${this.actionInfo[action]} 设备【${this.device.name}】 所有电源`,
           method: `${this.actionInfo[action]}电源`,
           params: `${this.device.id} ${this.device.name}`
         })
         sendDeviceAlarm({
           deviceId: this.device.id,
           errorEnumId: action ? 36 : 37,
-          message: `用户: ${this.account} ${target}`
+          message: `用户【${this.account}】 手动${this.actionInfo[action]} 所有电源`
         })
         if (!this.$useUnified && this.$hasRelay) {
           this.onSwitchPowerSingle(this.$powers[0].powers[0])