Commit 26d306148c124c3d2d9f481fad18b1d99b8c9874

Authored by ww
1 parent 825b3bee

fix: DEFECT-1163 切换控制组件后只重置属性选择框

... ... @@ -60,7 +60,8 @@
60 60 const resetFormFields = async () => {
61 61 const hasExistEl = Object.keys(dataSourceEl).filter((key) => dataSourceEl[key]);
62 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 16 list: Recordable[];
17 17 }
18 18 const props = defineProps<{
19   - value: string;
  19 + value?: string;
20 20 }>();
21 21 const emit = defineEmits(['update:value', 'change']);
22 22
... ...
... ... @@ -76,7 +76,7 @@
76 76 });
77 77
78 78 const getSharePageData = computed(() => {
79   - return props.value;
  79 + return props.value!;
80 80 });
81 81
82 82 const getIsSharePage = computed(() => {
... ... @@ -230,8 +230,9 @@
230 230 const getDataBoradDetail = async () => {
231 231 try {
232 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 238 const loading = ref(false);
... ...