Commit a12f394a4098fe1912715eb721f63af32585bc8b

Authored by ww
1 parent db46ea1c

fix: click update data component modal will happend data can not echo

... ... @@ -46,12 +46,18 @@
46 46 getAllDataSourceFieldValue: Fn<any, Recordable>;
47 47 }>();
48 48
  49 + const resetForm = () => {
  50 + isEdit.value = false;
  51 + frontId.value = '';
  52 + componentRecord.value = {} as unknown as DataBoardLayoutInfo;
  53 + componentDefaultConfig.value = {};
  54 + };
  55 +
49 56 const handleSubmit = () => {
50 57 const { getAllDataSourceFieldValue } = unref(basicConfigurationEl)!;
51 58 const value = getAllDataSourceFieldValue();
52 59 unref(isEdit) ? handleUpdateComponent(value) : handleAddComponent(value);
53   - isEdit.value = false;
54   - frontId.value = '';
  60 + resetForm();
55 61 };
56 62
57 63 const handleAddComponent = async (value: Recordable) => {
... ... @@ -111,6 +117,7 @@
111 117 width="70%"
112 118 :destroy-on-close="true"
113 119 @ok="handleSubmit"
  120 + @cancel="resetForm"
114 121 >
115 122 <section>
116 123 <Tabs type="card">
... ...
... ... @@ -350,9 +350,9 @@
350 350 </template>
351 351 <template #extra>
352 352 <Authority value="api:yt:data_component:add:post">
353   - <Button v-if="!getIsSharePage" type="primary" @click="handleOpenCreatePanel"
354   - >创建组件</Button
355   - >
  353 + <Button v-if="!getIsSharePage" type="primary" @click="handleOpenCreatePanel">
  354 + 创建组件
  355 + </Button>
356 356 </Authority>
357 357 </template>
358 358 <div>
... ...