Commit de6465fb6de3b7889fc8ab33207c2c8ff2caf098

Authored by fengwotao
1 parent 398ecbe0

fix: DEFECT-1278 修复产品配置的转换函数禁用后,编辑产品,脚本回显为ID问题

... ... @@ -167,9 +167,8 @@
167 167 },
168 168 });
169 169 };
170   - const updateDisabled = async (e) => {
  170 + const updateDisabled = async () => {
171 171 await nextTick();
172   - tcpRef.value?.updateDisabled(e);
173 172 };
174 173 defineExpose({
175 174 getFormData,
... ...
... ... @@ -106,10 +106,18 @@
106 106 emits('change', value);
107 107 };
108 108
109   - const setValue = (value) => {
110   - scriptId.value = value;
  109 + const getValue = () => {
  110 + return scriptId.value;
  111 + };
  112 +
  113 + const setValue = async (value) => {
  114 + const scriptOption = await getAllScriptType(props.scriptType);
  115 + if (!scriptOption.map((item) => item.value).includes(value)) {
  116 + scriptId.value = null;
  117 + } else scriptId.value = value;
111 118 };
112 119 defineExpose({
113 120 setValue,
  121 + getValue,
114 122 });
115 123 </script>
... ...
... ... @@ -58,6 +58,8 @@
58 58 const scriptSelectItemUpRef = ref<InstanceType<typeof ScriptSelectItem>>();
59 59
60 60 const getFormData = async () => {
  61 + scriptForm.authScriptId = scriptSelectItemAuthRef.value?.getValue();
  62 + scriptForm.upScriptId = scriptSelectItemUpRef.value?.getValue();
61 63 //业务 网关子设备没有鉴权脚本
62 64 if (props.deviceTypeStr === TypeEnum.SENSOR) Reflect.deleteProperty(scriptForm, 'authScriptId');
63 65 if (Object.values(scriptForm).some((item) => !item)) {
... ...