Browse Source

行车诱导 修改

wangqin
Joe 10 months ago
parent
commit
dba48fa06b
  1. 8
      ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue
  2. 37
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue

8
ruoyi-ui/src/views/JiHeExpressway/components/FormConfig/index.vue

@ -86,9 +86,9 @@ export default {
return item => {
const result = item.visible ? item.visible(this.formData) : true;
if (!result) {
delete this.formData[item.key];
}
// if (!result) {
// delete this.formData[item.key];
// }
return result;
}
@ -97,6 +97,8 @@ export default {
methods: {
resolveListeners(callbacks) {
if (!callbacks) return;
const result = {};
for (const key in callbacks) {

37
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/DrivingGuidance/components/DeviceControlDialog.vue

@ -74,6 +74,22 @@ export default {
key: "controlType",
type: "RadioGroup",
default: "manual",
ons: {
input: (value, data) => {
const oldFormData = this.oldFormData;
if (!oldFormData) return;
switch (value) {
case "manual":
data.onWorkStatus = oldFormData.onWorkStatus;
data.inWorkStatus = oldFormData.inWorkStatus;
break;
case "automatic":
Array.isArray(oldFormData.displayTime) && (data.displayTime = [...oldFormData.displayTime]);
break;
}
},
},
options: {
type: 'circle',
options: [
@ -174,32 +190,33 @@ export default {
break;
}
this.oldFormData = cloneDeep(formData);
this.oldFormData = { ...formData };
})
},
handleSubmit() {
const result = cloneDeep(this.$refs.FormConfigRef?.formData);
const result = {}, formData = this.$refs.FormConfigRef?.formData;
let functionId = 51;
result.mode = result.controlType === 'manual' ? "00" : "01";
result.mode = formData.controlType === 'manual' ? "00" : "01";
delete result.controlType;
if (result.mode === '01') {
if (!result.displayTime?.length) return Message.error(`时间不能为空!`);
result.startDisplayTime = result.displayTime[0];
result.endDisplayTime = result.displayTime[1];
if (!formData.displayTime?.length) return Message.error(`时间不能为空!`);
result.startDisplayTime = formData.displayTime[0];
result.endDisplayTime = formData.displayTime[1];
delete result.displayTime;
} else {
if (!result.onWorkStatus || !result.inWorkStatus) return Message.error(`工作状态不能为空!`)
if (!formData.onWorkStatus || !formData.inWorkStatus) return Message.error(`工作状态不能为空!`);
result.onWorkStatus = formData.onWorkStatus
result.inWorkStatus = formData.inWorkStatus
}
this.submitting = true;
console.log(result);
// this.submitting = false;
// return;
@ -220,9 +237,7 @@ export default {
})
.finally(() => {
this.submitting = false;
console.log(this.submitting)
})
console.log(result)
}
},
}

Loading…
Cancel
Save