Commit 24fb4a583674c42b947ec860dcd3c07e3deaf9fd

Authored by ww
1 parent 75faa9b4

fix: DEFECT-1209 修复看板管理编辑回显不正常

1 <script lang="ts" setup> 1 <script lang="ts" setup>
2 - import { ref, onMounted, unref, computed } from 'vue'; 2 + import { ref, computed } from 'vue';
3 import { FrontComponent } from '../../../const/const'; 3 import { FrontComponent } from '../../../const/const';
4 - import { DataSourceField, dataSourceSchema } from '../../config/basicConfiguration';  
5 - import { DeviceTypeEnum } from '/@/api/device/model/deviceModel'; 4 + import { dataSourceSchema } from '../../config/basicConfiguration';
6 import { FormActionType } from '/@/components/Form'; 5 import { FormActionType } from '/@/components/Form';
7 import BasicForm from '/@/components/Form/src/BasicForm.vue'; 6 import BasicForm from '/@/components/Form/src/BasicForm.vue';
8 const formEl = ref<Nullable<FormActionType>>(null); 7 const formEl = ref<Nullable<FormActionType>>(null);
@@ -19,10 +18,6 @@ @@ -19,10 +18,6 @@
19 if (!frontId) return []; 18 if (!frontId) return [];
20 return dataSourceSchema(isEdit, frontId); 19 return dataSourceSchema(isEdit, frontId);
21 }); 20 });
22 -  
23 - onMounted(() => {  
24 - unref(formEl)?.setFieldsValue({ [DataSourceField.DEVICE_TYPE]: DeviceTypeEnum.SENSOR });  
25 - });  
26 </script> 21 </script>
27 22
28 <template> 23 <template>
@@ -128,7 +128,6 @@ export const dataSourceSchema = (isEdit: boolean, frontId?: FrontComponent): For @@ -128,7 +128,6 @@ export const dataSourceSchema = (isEdit: boolean, frontId?: FrontComponent): For
128 label: '设备类型', 128 label: '设备类型',
129 colProps: { span: 8 }, 129 colProps: { span: 8 },
130 rules: [{ message: '请选择设备类型', required: true }], 130 rules: [{ message: '请选择设备类型', required: true }],
131 - // defaultValue: DeviceTypeEnum.SENSOR,  
132 componentProps: ({ formActionType }) => { 131 componentProps: ({ formActionType }) => {
133 const { setFieldsValue } = formActionType; 132 const { setFieldsValue } = formActionType;
134 return { 133 return {