From d796950ffca530cea3b6ce6f22e63c8fcc5786fc Mon Sep 17 00:00:00 2001 From: likunming Date: Wed, 26 Jun 2024 17:27:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E4=BC=98=E5=8C=96=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- io.sc.platform.core.frontend/package.json | 2 +- .../src/platform/components/form/WForm.vue | 79 +++++++++++-------- .../src/platform/components/grid/WGrid.vue | 4 + 3 files changed, 53 insertions(+), 32 deletions(-) diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json index 7b3c1527..11a407d5 100644 --- a/io.sc.platform.core.frontend/package.json +++ b/io.sc.platform.core.frontend/package.json @@ -1,6 +1,6 @@ { "name": "platform-core", - "version": "8.1.237", + "version": "8.1.238", "description": "前端核心包,用于快速构建前端的脚手架", "//main": "库的主文件", "main": "dist/platform-core.js", diff --git a/io.sc.platform.core.frontend/src/platform/components/form/WForm.vue b/io.sc.platform.core.frontend/src/platform/components/form/WForm.vue index e341d77b..0b17262d 100644 --- a/io.sc.platform.core.frontend/src/platform/components/form/WForm.vue +++ b/io.sc.platform.core.frontend/src/platform/components/form/WForm.vue @@ -3,37 +3,41 @@
@@ -49,6 +53,8 @@ import { PageStatusEnum } from '@/platform/components/utils'; const $q = useQuasar(); const attrs = useAttrs(); +const componentRef = ref({}); + const props = defineProps({ modelValue: { type: Object, @@ -207,6 +213,12 @@ const updateModelValue = (name, value) => { } }; +const setComponentRef = (el, fieldName) => { + if (el) { + componentRef.value[fieldName] = el; + } +}; + /** * 对外暴露方法-获取form所有数据 */ @@ -323,6 +335,10 @@ const getFields = () => { return formFields; }; +const getFieldComponent = (name) => { + return componentRef.value[name]; +}; + defineExpose({ getFields, getData, @@ -335,6 +351,7 @@ defineExpose({ getStatus, getColsNum, setValidationErrors, + getFieldComponent, }); const instance = getCurrentInstance(); diff --git a/io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue b/io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue index f5e28735..0b70b0ab 100644 --- a/io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue +++ b/io.sc.platform.core.frontend/src/platform/components/grid/WGrid.vue @@ -1743,6 +1743,9 @@ const wrapCsvValue = (val, formatFn, row) => { return `"${formatted}"`; }; +const getLocalData = () => { + return toRaw(table.rows); +}; // 替换全部行 const setLocalData = (rows: any) => { if (props.tree && props.treeRelationship === 'parent') { @@ -2596,6 +2599,7 @@ defineExpose({ getTickedRows, getRows, refresh, + getLocalData, setLocalData, replaceRow, removeRows,