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,