Commit a50efc3db0d380778841bc6fd9004ff19fdae255
Merge branch 'ft' into 'main_dev'
fix: DEFECT-1643 编辑默认的租户配置后默认状态没了 See merge request yunteng/thingskit-front!919
Showing
1 changed file
with
8 additions
and
1 deletions
@@ -35,6 +35,7 @@ | @@ -35,6 +35,7 @@ | ||
35 | const { proxy } = getCurrentInstance() as any; | 35 | const { proxy } = getCurrentInstance() as any; |
36 | const getChildData = ref(null); | 36 | const getChildData = ref(null); |
37 | const editGetId: any = ref(''); | 37 | const editGetId: any = ref(''); |
38 | + const isDefault = ref(false); | ||
38 | const createTime = ref<string>(''); | 39 | const createTime = ref<string>(''); |
39 | const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({ | 40 | const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({ |
40 | schemas: formSchema, | 41 | schemas: formSchema, |
@@ -55,6 +56,7 @@ | @@ -55,6 +56,7 @@ | ||
55 | parentSetData.value = { ...data.record.profileData.configuration }; | 56 | parentSetData.value = { ...data.record.profileData.configuration }; |
56 | proxy.$refs.getChildData.setFieldsValueFunc(parentSetData.value); | 57 | proxy.$refs.getChildData.setFieldsValueFunc(parentSetData.value); |
57 | editGetId.value = data.record.id; | 58 | editGetId.value = data.record.id; |
59 | + isDefault.value = data.record.default; | ||
58 | await setFieldsValue({ | 60 | await setFieldsValue({ |
59 | ...data.record, | 61 | ...data.record, |
60 | }); | 62 | }); |
@@ -95,6 +97,10 @@ | @@ -95,6 +97,10 @@ | ||
95 | const createTime1 = { | 97 | const createTime1 = { |
96 | createdTime: isUpdate ? unref(createTime) : Date.now(), | 98 | createdTime: isUpdate ? unref(createTime) : Date.now(), |
97 | }; | 99 | }; |
100 | + | ||
101 | + const defaultInfo = { | ||
102 | + default: unref(isUpdate) ? isDefault.value : false, | ||
103 | + }; | ||
98 | Object.assign( | 104 | Object.assign( |
99 | postAllData, | 105 | postAllData, |
100 | { | 106 | { |
@@ -102,7 +108,8 @@ | @@ -102,7 +108,8 @@ | ||
102 | }, | 108 | }, |
103 | getValuesFormData, | 109 | getValuesFormData, |
104 | id, | 110 | id, |
105 | - createTime1 | 111 | + createTime1, |
112 | + defaultInfo | ||
106 | ); | 113 | ); |
107 | if (!unref(isUpdate)) { | 114 | if (!unref(isUpdate)) { |
108 | delete postAllData.id; | 115 | delete postAllData.id; |