fix(全局): bug 修复

This commit is contained in:
baiqi 2024-04-25 17:08:04 +08:00 committed by 刘瑞斌
parent 38eac2826a
commit c50b7ead9c
13 changed files with 38 additions and 28 deletions

View File

@ -120,7 +120,7 @@
(visible) => {
if (visible) {
initModuleOptions();
saveFileForm.value.name = props.savingFile?.name || '';
saveFileForm.value.name = props.savingFile?.name?.split('.').shift() || '';
}
},
{
@ -153,7 +153,7 @@
local: true,
moduleId: saveFileForm.value.moduleId,
fileName: saveFileForm.value.name,
originalName: props.savingFile.name || '',
originalName: props.savingFile.name || props.savingFile.fileName || '',
});
emit('finish', res, `${saveFileForm.value.name}.${props.savingFile.name?.split('.').pop()}`);
Message.success(t('ms.add.attachment.saveAsSuccess'));

View File

@ -858,10 +858,10 @@
parent.rowSpan = parent.rowSpan ? parent.rowSpan + 1 : 2;
} else {
//
const fisrtChildNode = findFirstByGroupId(condition.value.documentAssertion.jsonAssertion, record.groupId);
if (fisrtChildNode) {
fisrtChildNode.rowSpan = fisrtChildNode.rowSpan
? fisrtChildNode.rowSpan + 1
const firstChildNode = findFirstByGroupId(condition.value.documentAssertion.jsonAssertion, record.groupId);
if (firstChildNode) {
firstChildNode.rowSpan = firstChildNode.rowSpan
? firstChildNode.rowSpan + 1
: countNodesByGroupId(condition.value.documentAssertion.jsonAssertion, record.groupId) + 1;
}
}

View File

@ -17,7 +17,7 @@
import useLicenseStore from '@/store/modules/setting/license';
import { openWindow, regexUrl } from '@/utils';
import { scrollIntoView } from '@/utils/dom';
import { getFisrtRouterNameByCurrentRoute } from '@/utils/permission';
import { getFirstRouterNameByCurrentRoute } from '@/utils/permission';
import { listenerRouteChange } from '@/utils/route-listener';
import { ProjectManagementRouteEnum, SettingRouteEnum } from '@/enums/routeEnum';
@ -66,7 +66,7 @@
}
if (item.meta?.hideChildrenInMenu) {
//
const childName = getFisrtRouterNameByCurrentRoute(item.name as string);
const childName = getFirstRouterNameByCurrentRoute(item.name as string);
router.push({
name: childName,
});

View File

@ -20,6 +20,10 @@ export default function useMenuTree() {
if (!_routes) return null;
const collector = _routes.map((element) => {
if (element.meta?.hideInMenu === true) {
return null;
}
// 权限校验不通过
if (!permission.accessRouter(element)) {
return null;
@ -41,7 +45,7 @@ export default function useMenuTree() {
element.children = subItem as RouteRecordRaw[];
return element;
}
// the else logic
if (layer > 1) {
element.children = subItem as RouteRecordRaw[];
return element;

View File

@ -15,6 +15,7 @@ export interface ModuleCount {
export interface FileItem {
id: string;
name: string;
originalName: string; // 原文件名
fileType: string; // 文件类型
tags: string[]; // 标签
description: string;

View File

@ -1,4 +1,4 @@
import { ApiTestRouteEnum, SettingRouteEnum } from '@/enums/routeEnum';
import { ApiTestRouteEnum } from '@/enums/routeEnum';
import { DEFAULT_LAYOUT } from '../base';
import type { AppRouteRecordRaw } from '../types';

View File

@ -138,7 +138,7 @@ export function findRouteByName(name: string) {
}
// 找到当前路由下 第一个由权限的子路由
export function getFisrtRouterNameByCurrentRoute(parentName: string) {
export function getFirstRouterNameByCurrentRoute(parentName: string) {
const currentRoute = findRouteByName(parentName);
if (currentRoute) {
const hasAuthChildrenRouter = currentRoute.children.find((item) => hasAnyPermission(item.meta?.roles || []));

View File

@ -990,12 +990,16 @@
});
const saveModalFormRef = ref<FormInstance>();
const saveLoading = ref(false);
const selectTree = computed(() =>
filterTree(cloneDeep(props.moduleTree || []), (e) => {
const selectTree = computed(() => {
if (saveModalVisible.value || (!props.isCase && props.isDefinition && saveModalVisible.value)) {
// TODO:worker线
return filterTree(cloneDeep(props.moduleTree || []), (e) => {
e.draggable = false;
return e.type === 'MODULE';
})
);
});
}
return [];
});
watch(
() => saveModalVisible.value,

View File

@ -100,9 +100,9 @@
const managementRef = ref<InstanceType<typeof management>>();
function handleModuleInit(tree: ModuleTreeNode[], _protocol: string, pathMap: Record<string, any>) {
folderTree.value = tree;
// folderTree.value = tree;
protocol.value = _protocol;
folderTreePathMap.value = pathMap;
// folderTreePathMap.value = pathMap;
}
function newApi() {

View File

@ -317,13 +317,7 @@
import useUserStore from '@/store/modules/user';
import { hasAnyPermission } from '@/utils/permission';
import {
ReviewCaseItem,
ReviewItem,
ReviewPassRule,
ReviewResult,
ReviewStatus,
} from '@/models/caseManagement/caseReview';
import { ReviewCaseItem, ReviewItem, ReviewPassRule, ReviewResult } from '@/models/caseManagement/caseReview';
import { BatchApiParams, ModuleTreeNode } from '@/models/common';
import { CaseManagementRouteEnum } from '@/enums/routeEnum';
import { TableKeyEnum } from '@/enums/tableEnum';

View File

@ -562,6 +562,11 @@
value: detail.name,
key: 'name',
},
{
label: t('project.fileManagement.originName'),
value: detail.originalName,
key: 'originalName',
},
{
label: t('project.fileManagement.desc'),
value: detail.description,

View File

@ -71,7 +71,8 @@ export default {
'project.fileManagement.cancelTipContent':
'After cancellation, files that have not been successfully uploaded will not be saved, so please operate with caution!',
'project.fileManagement.cancelConfirm': 'Cancel upload',
'project.fileManagement.name': 'File name',
'project.fileManagement.name': 'File alias',
'project.fileManagement.originName': 'File original name',
'project.fileManagement.type': 'Format',
'project.fileManagement.fileNamePlaceholder': 'Please enter the file name and press Enter to save',
'project.fileManagement.desc': 'Description',

View File

@ -67,7 +67,8 @@ export default {
'project.fileManagement.cancelTipTitle': '确认取消正在上传的文件吗?',
'project.fileManagement.cancelTipContent': '取消后,未上传成功的文件不会被保存,请谨慎操作!',
'project.fileManagement.cancelConfirm': '取消上传',
'project.fileManagement.name': '文件名称',
'project.fileManagement.name': '文件别名',
'project.fileManagement.originName': '文件原名',
'project.fileManagement.fileNamePlaceholder': '请输入文件名称,按回车键保存',
'project.fileManagement.desc': '文件描述',
'project.fileManagement.updateDesc': '更新描述',