Showing
3 changed files
with
7 additions
and
5 deletions
@@ -60,7 +60,8 @@ | @@ -60,7 +60,8 @@ | ||
60 | const resetFormFields = async () => { | 60 | const resetFormFields = async () => { |
61 | const hasExistEl = Object.keys(dataSourceEl).filter((key) => dataSourceEl[key]); | 61 | const hasExistEl = Object.keys(dataSourceEl).filter((key) => dataSourceEl[key]); |
62 | for (const id of hasExistEl) { | 62 | for (const id of hasExistEl) { |
63 | - await dataSourceEl[id]?.resetFields(); | 63 | + const oldValues = dataSourceEl[id]?.getFieldsValue(); |
64 | + dataSourceEl[id]?.setFieldsValue({ ...oldValues, [DataSourceField.ATTRIBUTE]: null }); | ||
64 | } | 65 | } |
65 | }; | 66 | }; |
66 | 67 |
@@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
16 | list: Recordable[]; | 16 | list: Recordable[]; |
17 | } | 17 | } |
18 | const props = defineProps<{ | 18 | const props = defineProps<{ |
19 | - value: string; | 19 | + value?: string; |
20 | }>(); | 20 | }>(); |
21 | const emit = defineEmits(['update:value', 'change']); | 21 | const emit = defineEmits(['update:value', 'change']); |
22 | 22 |
@@ -76,7 +76,7 @@ | @@ -76,7 +76,7 @@ | ||
76 | }); | 76 | }); |
77 | 77 | ||
78 | const getSharePageData = computed(() => { | 78 | const getSharePageData = computed(() => { |
79 | - return props.value; | 79 | + return props.value!; |
80 | }); | 80 | }); |
81 | 81 | ||
82 | const getIsSharePage = computed(() => { | 82 | const getIsSharePage = computed(() => { |
@@ -230,8 +230,9 @@ | @@ -230,8 +230,9 @@ | ||
230 | const getDataBoradDetail = async () => { | 230 | const getDataBoradDetail = async () => { |
231 | try { | 231 | try { |
232 | return unref(getIsSharePage) ? unref(getSharePageData) : await getBasePageComponentData(); | 232 | return unref(getIsSharePage) ? unref(getSharePageData) : await getBasePageComponentData(); |
233 | - } catch (error) {} | ||
234 | - return {} as ComponentInfoDetail; | 233 | + } catch (error) { |
234 | + return {} as ComponentInfoDetail; | ||
235 | + } | ||
235 | }; | 236 | }; |
236 | 237 | ||
237 | const loading = ref(false); | 238 | const loading = ref(false); |