|
|
@@ -95,6 +95,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
import { parseTime } from '@/utils'
|
|
|
import { toDate } from '@/utils/event'
|
|
|
import {
|
|
|
@@ -118,6 +119,8 @@ const GET_RELAY_POWER_TIMING = 'GetRelayPowerPolicyAsync' // 9.29.1.6、获取
|
|
|
// const SET_RELAY_POWER_STATUS = 'SetRelayPowerStatusAsync' // 9.29.1.7、获取本板电源状态
|
|
|
// const SET_POWER_MODE = 'SetPowerModeAsync' // 9.29.2.1、设置终端电源模式
|
|
|
// const GET_POWER_MODE = 'GetPowerModeAsync' // 9.29.2.2、获取终端电源模式
|
|
|
+const LINK_MULTI = 'LinkMultiFunctionCard' // 开始上报
|
|
|
+const UNLINK_MULTI = 'ReleaseMultiFunctionCard' // 停止上报
|
|
|
|
|
|
const ErrorMessage = {
|
|
|
TIMEOUT: '暂未获取到操作反馈,请回读查看',
|
|
|
@@ -125,10 +128,10 @@ const ErrorMessage = {
|
|
|
DEFAULT: '操作异常,请稍后重试',
|
|
|
BUSY: '终端被他人占用',
|
|
|
PASSWORD: '登录密码错误,请联系管理员',
|
|
|
- [GET_POWER_STATUS]: '获取电源状态异常,请稍后重试',
|
|
|
- [GET_POWER_TIMING]: '获取定时数据异常,请回读查看',
|
|
|
- [GET_MULTI_POWER_TIMING]: '获取多功能卡定时数据异常,请回读查看',
|
|
|
- [GET_RELAY_POWER_TIMING]: '获取播控盒定时数据异常,请回读查看'
|
|
|
+ [GET_POWER_STATUS]: '获取电源状态超时,请稍后重试',
|
|
|
+ [GET_POWER_TIMING]: '获取定时数据超时,请回读查看',
|
|
|
+ [GET_MULTI_POWER_TIMING]: '获取定时任务超时,请回读查看',
|
|
|
+ [GET_RELAY_POWER_TIMING]: '获取定时任务超时,请回读查看'
|
|
|
}
|
|
|
|
|
|
const RELAY_KEY = -1
|
|
|
@@ -158,10 +161,12 @@ export default {
|
|
|
buttons: [
|
|
|
{ label: '一键开启', on: this.onSwitchOpen },
|
|
|
{ label: '一键关闭', on: this.onSwitchClose },
|
|
|
- { label: '回读', on: this.getPowerStatus }
|
|
|
+ { label: '回读', on: this.getPowerStatus },
|
|
|
+ { label: '开始上报', render: () => this.isSuperAdmin, on: this.onLink },
|
|
|
+ { label: '停止上报', render: () => this.isSuperAdmin, on: this.onUnlink }
|
|
|
],
|
|
|
cols: [
|
|
|
- { label: '设备', render: ({ portIndex }) => portIndex === RELAY_KEY ? '播控盒' : `多功能卡${portIndex}` },
|
|
|
+ { label: '设备', render: ({ portIndex }) => portIndex === RELAY_KEY ? '播控盒' : `控电设备${portIndex}` },
|
|
|
{ prop: 'powerIndex', label: '电源端口' },
|
|
|
{ prop: 'type', label: '电源类型' },
|
|
|
{ type: 'tag', render: ({ action }) => action
|
|
|
@@ -221,6 +226,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ ...mapGetters(['isSuperAdmin']),
|
|
|
loading () {
|
|
|
return this.active !== GET_POWER_STATUS && !this.timingStatus
|
|
|
},
|
|
|
@@ -472,7 +478,7 @@ export default {
|
|
|
this.tabs = [
|
|
|
{ key: GET_POWER_STATUS, name: '电源状态' },
|
|
|
// { key: GET_POWER_TIMING, name: '定时控制' },
|
|
|
- hasMulti ? { key: GET_MULTI_POWER_TIMING, name: '多功能卡定时控制' } : null,
|
|
|
+ hasMulti ? { key: GET_MULTI_POWER_TIMING, name: '定时控制' } : null,
|
|
|
hasRelay ? { key: GET_RELAY_POWER_TIMING, name: '播控盒定时控制' } : null
|
|
|
].filter(Boolean)
|
|
|
this.$hasMulti = hasMulti
|
|
|
@@ -495,7 +501,7 @@ export default {
|
|
|
const { portIndex, powerIndex, type, action } = power
|
|
|
const targetAction = action ^ 1
|
|
|
this.$confirm(
|
|
|
- `立即${this.actionInfo[targetAction]}电源 ${portIndex === RELAY_KEY ? '播控盒' : `多功能卡${portIndex} ${powerIndex}`} ${type}?`,
|
|
|
+ `立即${this.actionInfo[targetAction]}电源 ${portIndex === RELAY_KEY ? '播控盒' : `控电设备${portIndex} ${powerIndex}`} ${type}?`,
|
|
|
'操作确认',
|
|
|
{ type: 'warning' }
|
|
|
).then(() => {
|
|
|
@@ -506,7 +512,7 @@ export default {
|
|
|
const { portIndex, type, action } = power
|
|
|
const targetAction = action ^ 1
|
|
|
this.$confirm(
|
|
|
- `立即${this.actionInfo[targetAction]}电源 ${portIndex === RELAY_KEY ? '播控盒' : `多功能卡${portIndex}`} ${type}?`,
|
|
|
+ `立即${this.actionInfo[targetAction]}电源 ${portIndex === RELAY_KEY ? '播控盒' : `控电设备${portIndex}`} ${type}?`,
|
|
|
'操作确认',
|
|
|
{ type: 'warning' }
|
|
|
).then(() => {
|
|
|
@@ -977,6 +983,12 @@ export default {
|
|
|
this.hasChanged = true
|
|
|
this.$tasks.splice(index, 1)
|
|
|
this.$refs.table.pageTo()
|
|
|
+ },
|
|
|
+ onLink () {
|
|
|
+ this.sendTopic(LINK_MULTI)
|
|
|
+ },
|
|
|
+ onUnlink () {
|
|
|
+ this.sendTopic(UNLINK_MULTI)
|
|
|
}
|
|
|
}
|
|
|
}
|