--添加测试模块

This commit is contained in:
2025-10-13 11:53:54 +08:00
parent c3c93fe308
commit e1326c7ce8
146 changed files with 11171 additions and 807 deletions

View File

@ -2,10 +2,11 @@ import type { RouteLocationRaw, Router } from 'vue-router';
import { PageEnum } from '/@/enums/pageEnum';
import { isString } from '/@/utils/is';
import { unref } from 'vue';
import { unref, nextTick } from 'vue';
import { useRouter } from 'vue-router';
import { REDIRECT_NAME } from '/@/router/constant';
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
export type RouteLocationRawEx = Omit<RouteLocationRaw, 'path'> & { path: PageEnum };
@ -13,6 +14,8 @@ function handleError(e: Error) {
console.error(e);
}
const specialRouterName = ['CreateFlow', 'ApproveFlow', 'viewForm', 'ProcessMonitoring', 'updateForm', 'createForm']
// page switch
export function useGo(_router?: Router) {
let router;
@ -39,11 +42,12 @@ export function useGo(_router?: Router) {
/**
* @description: redo current page
*/
export const useRedo = (_router?: Router) => {
export const useRedo = (_router?: Router) => {
const tabStore = useMultipleTabStore();
const { push, currentRoute } = _router || useRouter();
const { query, params = {}, name, fullPath } = unref(currentRoute.value);
function redo(): Promise<boolean> {
return new Promise((resolve) => {
const { query, params = {}, name, fullPath, path } = unref(currentRoute.value);
function redo(): Promise<boolean> {
return new Promise(async(resolve) => {
if (name === REDIRECT_NAME) {
resolve(false);
return;
@ -55,7 +59,14 @@ export const useRedo = (_router?: Router) => {
params['_redirect_type'] = 'path';
params['path'] = fullPath;
}
push({ name: REDIRECT_NAME, params, query }).then(() => resolve(true));
if(specialRouterName.includes(name)){
await tabStore.closeTab(currentRoute.value, _router || useRouter())
nextTick(() => {
push({ path: path, params, query }).then(() => resolve(true));
})
} else {
push({ name: REDIRECT_NAME, params, query }).then(() => resolve(true));
}
});
}
return redo;

View File

@ -60,6 +60,14 @@ export function usePermission() {
closeAll();
}
function hasAllPermission(value?: RoleEnum | RoleEnum[] | string | string[], def = true): boolean {
if (!value) {
return def;
}
const allPerm = permissionStore.getAllButtonPermCodeList
return allPerm.includes(value as string)
}
/**
* Determine whether there is permission
*/
@ -269,6 +277,7 @@ export function usePermission() {
return {
changeRole,
hasPermission,
hasAllPermission,
togglePermissionMode,
refreshMenu,
changeMenu,

View File

@ -245,6 +245,8 @@ function getSchemePermissionItem(
if (isViewProcess) {
schema.dynamicDisabled = true;
}
} else if(schema.componentProps?.alwaysShow===true){
schema.show=true;
} else {
schema.show = false;
schema.dynamicDisabled = true;