查看导入日志
-
+
租户模式导入
@@ -51,6 +51,7 @@
import { useI18n } from '/@/hooks/web/useI18n';
import ImportSystemConfig from './ImportSystemConfig.vue';
import { getLogList,getLogDetails} from '/@/api/system/dataMigration';
+ import {getAppEnvConfig} from "/@/utils/env";
const { t } = useI18n();
diff --git a/src/views/workflow/task/components/processTasks/ToDoTasksV2.vue b/src/views/workflow/task/components/processTasks/ToDoTasksV2.vue
index baf259c..95b90ed 100644
--- a/src/views/workflow/task/components/processTasks/ToDoTasksV2.vue
+++ b/src/views/workflow/task/components/processTasks/ToDoTasksV2.vue
@@ -37,24 +37,13 @@
import { storeToRefs } from 'pinia';
import { useUserStore } from '/@/store/modules/user';
import {useMessage} from "/@/hooks/web/useMessage";
- import { changeTenant } from '/@/api/system/tenant';
- import {useAppStore} from "/@/store/modules/app";
- import {setupRouterGuard} from "/@/router/guard";
- import {usePermissionStore} from "/@/store/modules/permission";
- import {useTabs} from "/@/hooks/web/useTabs";
- import {useMenuSetting} from "/@/hooks/setting/useMenuSetting";
- import {useAppInject} from "/@/hooks/web/useAppInject";
+ import {useTenantManager} from "/@/utils/tenantManager";
const router = useRouter();
const { currentRoute } = router;
const { t } = useI18n();
- const appStore = useAppStore();
const userStore = useUserStore();
const { userInfo } = storeToRefs(userStore);
- const { closeOther } = useTabs(router);
- const permissionStore = usePermissionStore();
- const { getShowTopMenu } = useMenuSetting();
- const { getIsMobile } = useAppInject();
const configColumns: BasicColumn[] = [
@@ -135,6 +124,8 @@
}
});
+ const {toggleLocal}=useTenantManager();
+
onMounted(() => {
bus.on(FLOW_PROCESSED, onFlowProcessed);
});
@@ -151,7 +142,7 @@
);
const onRowDblClick = (record, index) => {
const {tenantId,tenantCode,tenantName} = record;
- let tenantEnabled=getAppEnvConfig().VITE_TENANT_ENABLED;
+ let tenantEnabled=getAppEnvConfig().VITE_GLOB_TENANT_ENABLED;
if(tenantEnabled =='true'&&tenantId){
let currentTenantId=userInfo.value.tenantId;
if(tenantId!=currentTenantId){
@@ -166,7 +157,7 @@
]),
width:'600px',
onOk: async () => {
- toggleLocale(tenantCode).then(()=>{
+ switchTenant(tenantCode).then(()=>{
openDetailPage(record,true);
})
@@ -206,19 +197,8 @@
reload();
}
- async function toggleLocale(tenantCode: string) {
- appStore.setPageLoadingAction(true);
- await changeTenant(tenantCode);
- permissionStore.setDynamicAddedRoute(false);
- await userStore.afterLoginAction(false);
- closeOther();
- await setupRouterGuard(router);
- await permissionStore.changeSubsystem(getShowTopMenu.value, getIsMobile.value);
- if(permissionStore.getSubSysList.length>0){
- permissionStore.setSubSystem(permissionStore.getSubSysList[0].id);
- }else{
- permissionStore.setSubSystem("");
- }
+ async function switchTenant(tenantCode: string) {
+ await toggleLocal({tenantCode:tenantCode, goHome:false,tabCloseAction:"closeOther"});
}
From de1c7b54e5b642c67d07bc42b64d3b2479a04f99 Mon Sep 17 00:00:00 2001
From: suguangxu <274928232@qq.com>
Date: Mon, 23 Jun 2025 15:02:05 +0800
Subject: [PATCH 14/14] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E4=B8=AA=E6=80=A7?=
=?UTF-8?q?=E5=8C=96=E9=85=8D=E7=BD=AE=EF=BC=9A=E9=97=AE=E9=A2=98=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/web/useFormConfig.ts | 24 ++++++++++++++++++------
src/utils/helper/generatorHelper.ts | 8 ++++----
2 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/src/hooks/web/useFormConfig.ts b/src/hooks/web/useFormConfig.ts
index d93b729..f0d5c65 100644
--- a/src/hooks/web/useFormConfig.ts
+++ b/src/hooks/web/useFormConfig.ts
@@ -11,12 +11,18 @@ const { t } = useI18n();
const { notification } = useMessage();
export function useFormConfig() {
- async function mergeFormSchemas(formSchema: FormSchema[],formPath:String){
+ async function mergeFormSchemas(obj:{formSchema: FormSchema[],formId:String,formPath:String}){
try{
- const formProps=await queryConfigByFormPath(formPath,'formProps');
+ let formProps;
+ if(obj.formId){
+ formProps=await queryConfig(obj.formId,'formProps');
+ }else{
+ formProps=await queryConfigByFormPath(obj.formPath,'formProps');
+ }
+
let fschemas=formProps?.schemas;
if(fschemas&&fschemas.length>0){
- return deepMerge(formSchema,fschemas);
+ return deepMerge(obj.formSchema,fschemas);
}else{
return formSchema;
}
@@ -25,10 +31,16 @@ export function useFormConfig() {
}
}
- async function mergeFormEventConfigs(formEventConfigs,componentPath:String){
+ async function mergeFormEventConfigs(obj:{formEventConfigs,formId:String,formPath:String}){
try{
- const fEConfigs=await queryConfigByFormPath(componentPath,'formEventConfigs');
- return deepMerge(formEventConfigs,fEConfigs);
+ let fEConfigs;
+ if(obj.formId){
+ fEConfigs=await queryConfig(obj.formId,'formEventConfigs');
+ }else{
+ fEConfigs=await queryConfigByFormPath(obj.formPath,'formEventConfigs');
+ }
+
+ return deepMerge(obj.formEventConfigs,fEConfigs);
}catch(e){
return {};
}
diff --git a/src/utils/helper/generatorHelper.ts b/src/utils/helper/generatorHelper.ts
index d06e09b..78635fa 100644
--- a/src/utils/helper/generatorHelper.ts
+++ b/src/utils/helper/generatorHelper.ts
@@ -1751,9 +1751,9 @@ export function buildSimpleFormCode(model: GeneratorConfig, _tableInfo: TableInf
if(props.fromPage !== FromPageType.FLOW){
let formPath=currentRoute.value.query.formPath;
//1.合并字段配置
- cloneProps.schemas=await mergeFormSchemas(cloneProps.schemas!,formPath);
+ cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formPath:formPath});
//2.合并表单事件配置
- fEventConfigs=await mergeFormEventConfigs(fEventConfigs,formPath);
+ fEventConfigs=await mergeFormEventConfigs({formEventConfigs:fEventConfigs,formPath:formPath});
}
}
data.formDataProps=cloneProps;
@@ -1842,8 +1842,8 @@ export function buildSimpleFormCode(model: GeneratorConfig, _tableInfo: TableInf
if (formConfig.useCustomConfig) {
const parts = obj.formConfigKey.split('_');
const formId=parts[1];
- cloneProps.schemas=await mergeFormSchemas(cloneProps.schemas!,formId);
- customFormEventConfigs=await mergeFormEventConfigs(customFormEventConfigs,formId);
+ cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formId:formId});
+ customFormEventConfigs=await mergeFormEventConfigs({formEventConfigs:customFormEventConfigs,formId:formId});
}
let flowData = changeWorkFlowForm(cloneProps, obj);