Commit e7a8ff3a8f703585be7b9829afc284c2c0378089
1 parent
8cc19c9e
fix: DEFECT-982 checkout checked component dashboard bind device type happend change
Showing
2 changed files
with
7 additions
and
3 deletions
1 | 1 | <script lang="ts" setup> |
2 | - import { ref } from 'vue'; | |
2 | + import { ref, onMounted, unref } from 'vue'; | |
3 | 3 | import { FrontComponent } from '../../../const/const'; |
4 | - import { dataSourceSchema } from '../../config/basicConfiguration'; | |
4 | + import { DataSourceField, dataSourceSchema } from '../../config/basicConfiguration'; | |
5 | + import { DeviceTypeEnum } from '/@/api/device/model/deviceModel'; | |
5 | 6 | import { FormActionType } from '/@/components/Form'; |
6 | 7 | import BasicForm from '/@/components/Form/src/BasicForm.vue'; |
7 | 8 | const formEl = ref<Nullable<FormActionType>>(null); |
... | ... | @@ -11,6 +12,10 @@ |
11 | 12 | }>(); |
12 | 13 | |
13 | 14 | defineExpose({ formActionType: formEl }); |
15 | + | |
16 | + onMounted(() => { | |
17 | + unref(formEl)?.setFieldsValue({ [DataSourceField.DEVICE_TYPE]: DeviceTypeEnum.SENSOR }); | |
18 | + }); | |
14 | 19 | </script> |
15 | 20 | |
16 | 21 | <template> | ... | ... |
... | ... | @@ -117,7 +117,6 @@ export const dataSourceSchema = (frontId?: FrontComponent): FormSchema[] => { |
117 | 117 | component: 'ApiSelect', |
118 | 118 | label: '设备类型', |
119 | 119 | colProps: { span: 8 }, |
120 | - defaultValue: DeviceTypeEnum.SENSOR, | |
121 | 120 | componentProps: ({ formActionType }) => { |
122 | 121 | const { setFieldsValue } = formActionType; |
123 | 122 | return { | ... | ... |