diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/components/ScopeTable.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/components/ScopeTable.vue index 53203322..e4c1e93a 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/components/ScopeTable.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/components/ScopeTable.vue @@ -275,17 +275,11 @@ export default { index: Number, tableInfo: { type: Object, - default: () => ({ ...defaultTableInfo }) + default: () => ({ ...defaultTableInfo }), } }, data() { return { - tableInfo: { - executeConfig: { - repeatTimes: 1, // 这里设置默认值为 1 - outVol: 1 // 这里设置默认值为 1 - } - }, isShowDialog: false, deviceOptions: planDeviceOptions, zyOptions: [ @@ -371,45 +365,19 @@ export default { watch: { 'tableInfo.deviceType': { async handler(newValue,oldValue) { - // console.log(newValue,oldValue) - // // console.log(this.tableInfo, newValue,oldValue) - // // if(this.tableInfo.isUnReset){ - // // this.tableInfo.isUnReset = false - // // return; - // // } - // if(oldValue !== undefined){ //更新信息后 - // this.tableInfo.devList = [] - // this.tableInfo.searchRule = 1; - // this.sbOptions = [] - // delete this.tableInfo.zx_operationType - // delete this.tableInfo.hf_operationType - // if(this.tableInfo.executeConfig && this.tableInfo.executeConfig.contentList){ - // this.tableInfo.executeConfig.contentList = [] - // } - // if(this.tableInfo.recoverConfig && this.tableInfo.recoverConfig.contentList){ - // this.tableInfo.recoverConfig.contentList = [] - // } - // if(this.tableInfo.deviceType === 2){ - // this.tableInfo.zx_operationType = 2; - // this.tableInfo.hf_operationType = 2; - // this.tableInfo.executeConfig = {operationType:2} - // this.tableInfo.recoverConfig = {operationType:2} - // } - // if(this.tableInfo.deviceType === 5){ - // this.tableInfo.zx_operationType = 2; - // this.tableInfo.executeConfig = {operationType:2} - // } - // // this.tableInfo = _.cloneDeep(this.tableInfo) - // } - // await this.loadData(newValue); - // this.$emit('check'); - }, immediate: true, } }, async mounted() { this.onDeviceTypeChange(this.tableInfo.deviceType,false) + // 确保 repeatTimes 默认值为 1 + if (!this.tableInfo.executeConfig || this.tableInfo.executeConfig.repeatTimes === undefined) { + this.$set(this.tableInfo.executeConfig, 'repeatTimes', 1) + } // 确保 outVol 默认值为 1 + if (!this.tableInfo.executeConfig || this.tableInfo.executeConfig.outVol === undefined) { + this.$set(this.tableInfo.executeConfig, 'outVol', 1) + } }, methods: { initData() { }, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/data.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/data.js index e54bd61e..f661793e 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/data.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/commandDispatch/Cards/DeviceControl/data.js @@ -8,4 +8,8 @@ export const defaultTableInfo = { zx_operationType: 2, hf_operationType: 2, sbOptions: [], + executeConfig:{ + repeatTimes: 1, // 这里设置默认值为 1 + outVol: 1 // 这里设置默认值为 1 + }, };