diff --git a/io.sc.platform.core.frontend/package.json b/io.sc.platform.core.frontend/package.json index 024f74ca..026f5032 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.2.60", + "version": "8.2.64", "description": "前端核心包,用于快速构建前端的脚手架", "//main": "库的主文件", "main": "dist/platform-core.js", diff --git a/io.sc.platform.core.frontend/src/platform/components/checkbox/WCheckbox.vue b/io.sc.platform.core.frontend/src/platform/components/checkbox/WCheckbox.vue index 6e38083f..43c3430a 100644 --- a/io.sc.platform.core.frontend/src/platform/components/checkbox/WCheckbox.vue +++ b/io.sc.platform.core.frontend/src/platform/components/checkbox/WCheckbox.vue @@ -25,6 +25,10 @@ @update:model-value="fieldMethodsClass.updateValue" > + diff --git a/io.sc.platform.core.frontend/src/platform/components/form/ts/Constant.ts b/io.sc.platform.core.frontend/src/platform/components/form/ts/Constant.ts index fb9b171c..0c23bfe3 100644 --- a/io.sc.platform.core.frontend/src/platform/components/form/ts/Constant.ts +++ b/io.sc.platform.core.frontend/src/platform/components/form/ts/Constant.ts @@ -1,3 +1,14 @@ +class FormGroupMode { + /** + * 卡片模式,可以配置 `icon` 与 `label` + */ + static CARD = 'card'; + /** + * 容器模式,无任何额外样式,仅在 `fields` 元素集外层嵌套一个 `div` + */ + static CONTAINER = 'container'; +} + /** * 常量 */ @@ -8,7 +19,12 @@ export class Constant { static STATUS_ADD = 'add'; /** - * 用于分组的字段类型 + * 用于分组的类型 */ static GROUP_TYPE = 'w-form-group'; + + /** + * `w-form-group`组件的模式 + */ + static FORM_GROUP_MODE = FormGroupMode; } diff --git a/io.sc.platform.core.frontend/src/platform/components/form/ts/Form.ts b/io.sc.platform.core.frontend/src/platform/components/form/ts/Form.ts index f41353b8..cc908e51 100644 --- a/io.sc.platform.core.frontend/src/platform/components/form/ts/Form.ts +++ b/io.sc.platform.core.frontend/src/platform/components/form/ts/Form.ts @@ -102,7 +102,7 @@ export class Form { } else { if (field.colSpan === 'full') { // col-span-${screenColsNumComputed.value} - style['grid-column'] = `span ${screenColsNum} / span ${screenColsNum}`; + style['grid-column'] = `1 / -1`; } else { if (field.colSpan && screenColsNum >= field.colSpan) { // col-span-${field.colSpan} diff --git a/io.sc.platform.core.frontend/src/platform/components/grid/TdContent.vue b/io.sc.platform.core.frontend/src/platform/components/grid/TdContent.vue index 75b327e5..1d3d4979 100644 --- a/io.sc.platform.core.frontend/src/platform/components/grid/TdContent.vue +++ b/io.sc.platform.core.frontend/src/platform/components/grid/TdContent.vue @@ -22,10 +22,8 @@ import { Constant, GridTools } from './ts/index'; const tools = inject('tools'); const props = defineProps({ value: { - type: [Object, String, Number], - default: () => { - return ''; - }, + type: null, + default: '', }, col: { type: Object, 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 4e307a9b..72cd5992 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 @@ -108,6 +108,15 @@ watch( }, ); +// 按钮监听,当按钮发生变化后重新设置props +watch( + () => props.toolbarActions, + (newVal, oldVal) => { + tools.props = props; + getTopRef()?.handleToolbarActions(); + }, +); + eventBus.on('onLocaleChanged', (local) => { nextTick(() => { topRef.value?.handleQueryFormShowField(); diff --git a/io.sc.platform.core.frontend/src/platform/components/grid/extra/Editor.vue b/io.sc.platform.core.frontend/src/platform/components/grid/extra/Editor.vue index 4f672945..356a15d5 100644 --- a/io.sc.platform.core.frontend/src/platform/components/grid/extra/Editor.vue +++ b/io.sc.platform.core.frontend/src/platform/components/grid/extra/Editor.vue @@ -105,8 +105,6 @@ const addData = (dialogFormData) => { } else { tools.apiFM.localMode.addLocalData(dialogFormData, undefined); } - //事件触发 - tools.em.afterEditorDataSubmit({ grid: tools.instance, data: dialogFormData }); }; const updateData = (dialogFormData) => { const selected = tools.apiFM.getData.getSelectedRow(); @@ -121,8 +119,6 @@ const updateData = (dialogFormData) => { dialogFormData['children'] = selected['children']; } tools.apiFM.localMode.updateLocalData(dialogFormData); - //事件触发 - tools.em.afterEditorDataSubmit({ grid: tools.instance, data: dialogFormData }); }; const localModeSave = (dialogFormData: any, formStatus: string, closeDialog: boolean) => { @@ -132,6 +128,8 @@ const localModeSave = (dialogFormData: any, formStatus: string, closeDialog: boo updateData(dialogFormData); } saveLoading.value = false; + //事件触发 + tools.em.afterEditorDataSubmit(dialogFormData); if (closeDialog) { dialogRef.value.hide(); } diff --git a/io.sc.platform.core.frontend/src/platform/components/grid/ts/function/RequestApi.ts b/io.sc.platform.core.frontend/src/platform/components/grid/ts/function/RequestApi.ts index fb7c3907..c30a30d0 100644 --- a/io.sc.platform.core.frontend/src/platform/components/grid/ts/function/RequestApi.ts +++ b/io.sc.platform.core.frontend/src/platform/components/grid/ts/function/RequestApi.ts @@ -130,7 +130,7 @@ export class RequestApi extends Base { callback(resp); } NotifyManager.info($t('tip.operationSuccess') || ''); - this.tools?.em.afterEditorDataSubmit({ grid: this.instance, data: resp.data }); + this.tools?.em.afterEditorDataSubmit(resp.data); }) .catch((error) => { if (error?.code === 1001) { diff --git a/io.sc.platform.core.frontend/src/platform/components/grid/ts/types/PropsType.ts b/io.sc.platform.core.frontend/src/platform/components/grid/ts/types/PropsType.ts index df5c7498..09c1dc5d 100644 --- a/io.sc.platform.core.frontend/src/platform/components/grid/ts/types/PropsType.ts +++ b/io.sc.platform.core.frontend/src/platform/components/grid/ts/types/PropsType.ts @@ -58,7 +58,7 @@ export type PropsType = { /** * 自定义获取数据函数,若表格内置的查询参数或方式(GET、POST)等不满足使用场景,可使用该函数自定义进行查询,只需返回的结果结构与内置查询一致即可。 */ - customFetch: Function | undefined, + customFetch?: Function | undefined, /** * 表格整体紧凑模式 */ @@ -170,7 +170,7 @@ export type PropsType = { /** * 分组显示内容,仅 alone 模式有效,支持字符串 `format` 使用分组字段列定义中配置的format进行内容显示处理,函数支持自定义显示内容 */ - groupByTitle: string | Function, + groupByTitle?: string | Function, /** * 表格追加行,添加到当前表格数据行尾,可添加多行,支持跨行跨列配置,用于添加合计或者额外信息。 */ diff --git a/io.sc.platform.core.frontend/src/platform/components/icon/WIcon.vue b/io.sc.platform.core.frontend/src/platform/components/icon/WIcon.vue index fcfc0872..08697062 100644 --- a/io.sc.platform.core.frontend/src/platform/components/icon/WIcon.vue +++ b/io.sc.platform.core.frontend/src/platform/components/icon/WIcon.vue @@ -88,11 +88,15 @@ @click="restoreDefaultValue" > +