From 1c8f0584ddf74efdf767813a2f426129bbc8c2a9 Mon Sep 17 00:00:00 2001 From: zds <49744633+zds-s@users.noreply.github.com> Date: Fri, 5 Jul 2024 23:50:45 +0800 Subject: [PATCH 1/3] Added component to FormDataType --- src/components/ma-crud/types/columns.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/ma-crud/types/columns.ts b/src/components/ma-crud/types/columns.ts index c6c40188..dde3c022 100644 --- a/src/components/ma-crud/types/columns.ts +++ b/src/components/ma-crud/types/columns.ts @@ -1,4 +1,4 @@ -import { VNodeChild } from "vue"; +import { VNodeChild,Ref } from "vue"; /** * 表单组件类型 @@ -30,7 +30,9 @@ export type FormDataType = | "user-info" | "city-linkage" | "form-group" - | "select-resource"; + | "select-resource" + | 'component'; + /** * 列字典 */ @@ -120,6 +122,7 @@ export interface BasicColumn { searchPlaceholder?: string; // 表格是否快捷编辑,只支持 input date select quickEdit?: boolean; + component?:Ref; //编辑|创建 通用规则 commonRules?: FieldRule | FieldRule[]; // 创建时规则 From 3b78fd11bf158caeead12138162bff282ce80e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=40=E9=95=BF=E4=B9=85=E5=90=8C=E5=AD=A6?= Date: Sun, 7 Jul 2024 23:31:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20ma-crud=20=E6=9A=B4=E9=9C=B2=20setT?= =?UTF-8?q?ableData=20=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ma-crud/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ma-crud/index.vue b/src/components/ma-crud/index.vue index aed41921..b387282c 100644 --- a/src/components/ma-crud/index.vue +++ b/src/components/ma-crud/index.vue @@ -859,12 +859,12 @@ const initSearchColumns = () => crudSearchRef.value.initSearchColumns() const getColumnService = (strictMode = true) => { return new ColumnService({ columns: columns.value, cascaders: cascaders.value, dicts: dicts.value }, strictMode ) } - +const setTableData = (data=[])=> tableData.value = data defineExpose({ refresh, requestData, addAction, editAction, getTableData, setSelecteds, getCurrentAction, getFormData, getFormColumns, getColumnService, getCurrentPage, getPageSize, getTotal, requestParams, isRecovery, tableRef, initSearchColumns, - crudFormRef, crudSearchRef, crudImportRef, crudSettingRef + crudFormRef, crudSearchRef, crudImportRef, crudSettingRef, setTableData }) From 6a7c0acfb7d154118bae34c0a9451d74872705d5 Mon Sep 17 00:00:00 2001 From: "X.Mo" Date: Tue, 9 Jul 2024 22:03:10 +0800 Subject: [PATCH 3/3] fix: setting redirect after refresh page router push bug --- src/layout/components/columns/ma-columns-menu.vue | 13 ++++++++++--- src/layout/components/mixed/index.vue | 12 +++++++++--- src/store/modules/keepAlive.js | 3 ++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/layout/components/columns/ma-columns-menu.vue b/src/layout/components/columns/ma-columns-menu.vue index 0be8a550..62d4056e 100644 --- a/src/layout/components/columns/ma-columns-menu.vue +++ b/src/layout/components/columns/ma-columns-menu.vue @@ -18,7 +18,10 @@ >
  • { + keepAliveStore.menuLoader = true initMenu(true) }) watch(() => route, v => { + keepAliveStore.menuLoader = false initMenu(false) }, { deep: true }) @@ -74,6 +80,7 @@ } else { current = 'home' } + console.log(current) if (userStore.routers && userStore.routers.length > 0) { userStore.routers.map((item, index) => { if (item.name == current) loadMenu(item, index, init) @@ -87,7 +94,7 @@ return } if (bigMenu.children.length > 0) { - if (bigMenu.redirect && isInit) { + if (bigMenu.redirect && isInit && !keepAliveStore.menuLoader) { router.push(bigMenu.redirect) } MaMenuRef.value.loadChildMenu(bigMenu) diff --git a/src/layout/components/mixed/index.vue b/src/layout/components/mixed/index.vue index 23867771..6aa469dc 100644 --- a/src/layout/components/mixed/index.vue +++ b/src/layout/components/mixed/index.vue @@ -15,7 +15,10 @@
    - +
    @@ -42,7 +45,7 @@