Commit a50efc3db0d380778841bc6fd9004ff19fdae255

Authored by xp.Huang
2 parents 54dd5e3a 6c08bd8b

Merge branch 'ft' into 'main_dev'

fix: DEFECT-1643 编辑默认的租户配置后默认状态没了

See merge request yunteng/thingskit-front!919
... ... @@ -35,6 +35,7 @@
35 35 const { proxy } = getCurrentInstance() as any;
36 36 const getChildData = ref(null);
37 37 const editGetId: any = ref('');
  38 + const isDefault = ref(false);
38 39 const createTime = ref<string>('');
39 40 const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({
40 41 schemas: formSchema,
... ... @@ -55,6 +56,7 @@
55 56 parentSetData.value = { ...data.record.profileData.configuration };
56 57 proxy.$refs.getChildData.setFieldsValueFunc(parentSetData.value);
57 58 editGetId.value = data.record.id;
  59 + isDefault.value = data.record.default;
58 60 await setFieldsValue({
59 61 ...data.record,
60 62 });
... ... @@ -95,6 +97,10 @@
95 97 const createTime1 = {
96 98 createdTime: isUpdate ? unref(createTime) : Date.now(),
97 99 };
  100 +
  101 + const defaultInfo = {
  102 + default: unref(isUpdate) ? isDefault.value : false,
  103 + };
98 104 Object.assign(
99 105 postAllData,
100 106 {
... ... @@ -102,7 +108,8 @@
102 108 },
103 109 getValuesFormData,
104 110 id,
105   - createTime1
  111 + createTime1,
  112 + defaultInfo
106 113 );
107 114 if (!unref(isUpdate)) {
108 115 delete postAllData.id;
... ...