Commit 7e31d3aa33c50f23922a90c9bc472446d26bd0ea
Merge branch 'ww' into 'main'
fix: DEFECT-981 update product profile happend error See merge request huang/yun-teng-iot-front!442
Showing
4 changed files
with
11 additions
and
7 deletions
... | ... | @@ -162,10 +162,10 @@ |
162 | 162 | ...postSubmitFormData.deviceConfData, |
163 | 163 | ...{ transportType: !isEmptyObj ? transportTypeStr.value : 'DEFAULT' }, |
164 | 164 | ...{ profileData: !isEmptyObj ? transportConfData.profileData : null }, |
165 | - ...{ id: isUpdate.value ? null : isEditId.value }, | |
166 | - ...{ createTime: isUpdate.value ? null : isEditCreatTime.value }, | |
165 | + ...{ id: isUpdate.value ? isEditId.value : null }, | |
166 | + ...{ createTime: isUpdate.value ? isEditCreatTime.value : null }, | |
167 | 167 | }); |
168 | - createMessage.success(isUpdate.value ? `新增成功` : `编辑成功`); | |
168 | + createMessage.success(isUpdate.value ? `编辑成功` : `新增成功`); | |
169 | 169 | handleCancel(); |
170 | 170 | emits('success'); |
171 | 171 | }; | ... | ... |
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 { | ... | ... |