Commit 97e7ffd0482ccf306707b417487b5565cd364ab8
Merge branch 'fix/DEFECT-1531' into 'main_dev'
fix: 修改租户配置每编辑一次,创建时间就会更改一次 See merge request yunteng/thingskit-front!866
Showing
1 changed file
with
7 additions
and
6 deletions
| ... | ... | @@ -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 createTime = ref<string>(''); | |
| 38 | 39 | const [registerForm, { validate, resetFields, setFieldsValue, updateSchema }] = useForm({ |
| 39 | 40 | schemas: formSchema, |
| 40 | 41 | showActionButtonGroup: false, |
| ... | ... | @@ -57,6 +58,7 @@ |
| 57 | 58 | await setFieldsValue({ |
| 58 | 59 | ...data.record, |
| 59 | 60 | }); |
| 61 | + createTime.value = data.record.createdTime; | |
| 60 | 62 | updateStatusSchema(true); |
| 61 | 63 | } |
| 62 | 64 | }); |
| ... | ... | @@ -79,7 +81,7 @@ |
| 79 | 81 | ]); |
| 80 | 82 | }; |
| 81 | 83 | |
| 82 | - const getAllFieldsFunc = async () => { | |
| 84 | + const getAllFieldsFunc = async (isUpdate?: boolean) => { | |
| 83 | 85 | getValuesFormData = await validate(); |
| 84 | 86 | if (!getValuesFormData) return; |
| 85 | 87 | let getChildValues = proxy.$refs.getChildData.getAllFields(); |
| ... | ... | @@ -90,10 +92,9 @@ |
| 90 | 92 | id: unref(isUpdate) ? editGetId.value : '', |
| 91 | 93 | }; |
| 92 | 94 | |
| 93 | - const createTime = { | |
| 94 | - createdTime: Date.now(), | |
| 95 | + const createTime1 = { | |
| 96 | + createdTime: isUpdate ? unref(createTime) : Date.now(), | |
| 95 | 97 | }; |
| 96 | - | |
| 97 | 98 | Object.assign( |
| 98 | 99 | postAllData, |
| 99 | 100 | { |
| ... | ... | @@ -101,7 +102,7 @@ |
| 101 | 102 | }, |
| 102 | 103 | getValuesFormData, |
| 103 | 104 | id, |
| 104 | - createTime | |
| 105 | + createTime1 | |
| 105 | 106 | ); |
| 106 | 107 | if (!unref(isUpdate)) { |
| 107 | 108 | delete postAllData.id; |
| ... | ... | @@ -119,7 +120,7 @@ |
| 119 | 120 | emit('success'); |
| 120 | 121 | resetFields(); |
| 121 | 122 | } else { |
| 122 | - await getAllFieldsFunc(); | |
| 123 | + await getAllFieldsFunc(true); | |
| 123 | 124 | await saveTenantProfileApi(postAllData); |
| 124 | 125 | createMessage.success('租户配置编辑成功'); |
| 125 | 126 | closeDrawer(); | ... | ... |