fix(全局): 修复系统设置&用例管理全局bug

This commit is contained in:
xinxin.wu 2024-02-19 09:53:26 +08:00 committed by 刘瑞斌
parent bbfb7d146e
commit 7da17d5ec0
27 changed files with 77 additions and 49 deletions

View File

@ -87,7 +87,7 @@
return;
}
const res = await getProjectInfo(appStore.currentProjectId);
if (res.deleted) {
if (!res || res.deleted) {
//
router.push({
name: NO_PROJECT_ROUTE_NAME,

View File

@ -216,7 +216,7 @@
async (val) => {
if (val) {
personalMenus.value = [...copyPersonalMenus.value];
if (appStore.packageType === 'enterprise') {
if (appStore.packageType === 'enterprise' && licenseStore.hasLicense()) {
getOrgList();
}
} else {

View File

@ -37,7 +37,7 @@ export default {
'menu.caseManagement.featureCaseRecycle': 'Recycle',
'menu.caseManagement.featureCaseList': 'Case list',
'menu.caseManagement.featureCaseDetail': 'Create Case',
'menu.caseManagement.featureCaseEdit': 'Edit Case',
'menu.caseManagement.featureCaseEdit': 'Update Case',
'menu.caseManagement.featureCaseCreateSuccess': 'Create Success',
'menu.caseManagement.caseManagementReview': 'Feature Case Review',
'menu.caseManagement.caseManagementReviewCreate': 'Create Review',

View File

@ -43,7 +43,7 @@ export default {
'menu.caseManagement.featureCaseRecycle': '回收站',
'menu.caseManagement.featureCaseList': '用例列表',
'menu.caseManagement.featureCaseDetail': '创建用例',
'menu.caseManagement.featureCaseEdit': '编辑用例',
'menu.caseManagement.featureCaseEdit': '更新用例',
'menu.caseManagement.featureCaseCreateSuccess': '创建用例成功',
'menu.caseManagement.caseManagementReview': '用例评审',
'menu.caseManagement.caseManagementReviewCreate': '创建评审',

View File

@ -171,7 +171,7 @@ export interface CreateOrUpdateCase {
moduleId: string;
versionId: string;
tags: string[];
customFields: Record<string, any>; // 自定义字段集合
customFields?: Record<string, any>; // 自定义字段集合
relateFileMetaIds?: string[]; // 关联文件ID集合
deleteFileMetaIds?: string[]; // 删除本地上传的文件id
unLinkFilesIds?: string[]; // 取消关联的文件id
@ -209,7 +209,7 @@ export interface DetailCase {
expectedResult: string;
prerequisite: string;
description: string;
customFields: CustomAttributes[];
customFields?: Record<string, any>[];
attachments?: AttachFileInfo[];
followFlag?: boolean;
functionalPriority: string;

View File

@ -182,7 +182,7 @@ const ProjectManagement: AppRouteRecordRaw = {
component: () => import('@/views/project-management/template/components/proTemplateDetail.vue'),
meta: {
locale: 'menu.settings.organization.templateManagementDetail',
roles: ['PROJECT_TEMPLATE:READ+ADD'],
roles: ['PROJECT_TEMPLATE:READ+UPDATE', 'PROJECT_TEMPLATE:READ+ADD'],
breadcrumbs: [
{
name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE,
@ -209,7 +209,7 @@ const ProjectManagement: AppRouteRecordRaw = {
component: () => import('@/views/project-management/template/components/workFlowTableIndex.vue'),
meta: {
locale: 'menu.settings.organization.templateManagementWorkFlow',
roles: ['PROJECT_TEMPLATE:READ+ADD'],
roles: ['PROJECT_TEMPLATE:READ'],
breadcrumbs: [
{
name: ProjectManagementRouteEnum.PROJECT_MANAGEMENT_TEMPLATE,

View File

@ -298,7 +298,7 @@ const Setting: AppRouteRecordRaw = {
component: () => import('@/views/setting/organization/template/components/workFlowTableIndex.vue'),
meta: {
locale: 'menu.settings.organization.templateManagementWorkFlow',
roles: ['ORGANIZATION_TEMPLATE:READ+UPDATE'],
roles: ['ORGANIZATION_TEMPLATE:READ'],
breadcrumbs: [
{
name: SettingRouteEnum.SETTING_ORGANIZATION_TEMPLATE,

View File

@ -154,7 +154,7 @@
const { propsRes, propsEvent, setProps } = useTable(undefined, {
tableKey: TableKeyEnum.CASE_MANAGEMENT_DETAIL_TABLE,
columns: templateFieldColumns.value,
scroll: { x: '100%' },
scroll: { x: '100%', y: 400 },
selectable: false,
noDisable: true,
size: 'default',

View File

@ -28,7 +28,7 @@
:loading="editLoading"
@click="updateHandler('edit')"
>
<MsIcon type="icon-icon_edit_outlined" class="mr-1 font-[16px]" />
<MsIcon type="icon-icon_edit_outlined" class="mr-2 font-[16px]" />
{{ t('common.edit') }}
</MsButton>
<MsButton
@ -39,7 +39,7 @@
:loading="shareLoading"
@click="shareHandler"
>
<MsIcon type="icon-icon_share1" class="mr-1 font-[16px]" />
<MsIcon type="icon-icon_share1" class="mr-2 font-[16px]" />
{{ t('caseManagement.featureCase.share') }}
</MsButton>
<MsButton
@ -52,22 +52,23 @@
>
<MsIcon
:type="detailInfo.followFlag ? 'icon-icon_collect_filled' : 'icon-icon_collection_outlined'"
class="mr-1 font-[16px]"
class="mr-2 font-[16px]"
:class="[detailInfo.followFlag ? 'text-[rgb(var(--warning-6))]' : '']"
/>
{{ t('caseManagement.featureCase.follow') }}
</MsButton>
<MsButton type="icon" status="secondary" class="!rounded-[var(--border-radius-small)]">
<a-dropdown position="br" :hide-on-select="false">
<div>
<icon-more class="mr-1" />
<div class="flex items-center">
<icon-more class="mr-2" />
<span> {{ t('caseManagement.featureCase.more') }}</span>
</div>
<template #content>
<a-doption>
<!-- TOTO公共用例先不上 -->
<!-- <a-doption>
<a-switch class="mr-1" size="small" type="line" />{{ t('caseManagement.featureCase.addToPublic') }}
</a-doption>
</a-doption> -->
<a-doption @click="updateHandler('copy')">
<MsIcon type="icon-icon_copy_filled" class="font-[16px]" />{{ t('common.copy') }}</a-doption
>
@ -84,13 +85,13 @@
class="!rounded-[var(--border-radius-small)]"
@click="toggleFullScreen"
>
<MsIcon :type="isFullScreen ? 'icon-icon_off_screen' : 'icon-icon_full_screen_one'" class="mr-1" size="16" />
<MsIcon :type="isFullScreen ? 'icon-icon_off_screen' : 'icon-icon_full_screen_one'" class="mr-2" size="16" />
{{ t('caseManagement.featureCase.fullScreen') }}
</MsButton>
</div>
</template>
<template #default>
<div ref="wrapperRef" class="wrapperRef bg-white">
<div ref="wrapperRef" class="wrapperRef h-full bg-white">
<MsSplitBox
ref="wrapperRef"
:class="isFullScreen ? 'h-[100%]' : 'h-[calc(100% - 78px)]'"
@ -358,7 +359,7 @@
getCaseTree();
detailInfo.value = { ...detail };
setCount(detail);
customFields.value = detailInfo.value.customFields;
customFields.value = detailInfo.value?.customFields as CustomAttributes[];
caseLevels.value = getCaseLevels(customFields.value) as CaseLevel;
}

View File

@ -508,7 +508,7 @@
name: route.params.mode === 'copy' ? `${detailResult.name}_copy` : detailResult.name,
};
//
formRules.value = customFields.map((item: any) => {
formRules.value = (customFields || []).map((item: any) => {
const multipleType = ['MULTIPLE_SELECT', 'CHECKBOX', 'MULTIPLE_MEMBER', 'MULTIPLE_INPUT'];
const currentDefaultValue = multipleType.includes(item.type) ? JSON.parse(item.defaultValue) : item.defaultValue;
@ -750,6 +750,12 @@
function resetForm() {
form.value = { ...initForm, templateId: form.value.templateId };
form.value.customFields = formItem.value.map((item: any) => {
return {
fieldId: item.field,
value: Array.isArray(item.value) ? JSON.stringify(item.value) : item.value,
};
});
fileList.value = [];
caseFormRef.value?.resetFields();
}

View File

@ -106,6 +106,7 @@
//
function backCaseList() {
clearInterval(timer.value);
timer.value = null;
router.push({
name: CaseManagementRouteEnum.CASE_MANAGEMENT_CASE,
});
@ -114,6 +115,7 @@
//
function continueCreate() {
clearInterval(timer.value);
timer.value = null;
router.push({
name: CaseManagementRouteEnum.CASE_MANAGEMENT_CASE_DETAIL,
});
@ -137,6 +139,12 @@
onMounted(() => {
setCountdown();
});
onBeforeUnmount(() => {
clearInterval(timer.value);
timer.value = null;
countDown.value = 0;
});
</script>
<style scoped lang="less">

View File

@ -81,10 +81,7 @@
import AddDemandModal from './addDemandModal.vue';
import AssociatedDemandTable from './associatedDemandTable.vue';
import {
addDemandRequest,
getThirdDemandList
} from '@/api/modules/case-management/featureCase';
import { addDemandRequest, getThirdDemandList } from '@/api/modules/case-management/featureCase';
import { getCaseRelatedInfo } from '@/api/modules/project-management/menuManagement';
import { useI18n } from '@/hooks/useI18n';
import { useAppStore } from '@/store';
@ -220,6 +217,7 @@
fullColumns.value = [...columns, ...customFields.value];
tableRef.value.initColumn(fullColumns.value);
} catch (error) {
tableRef.value.initColumn(columns);
console.log(error);
}
}

View File

@ -126,7 +126,7 @@ export function convertToFile(fileInfo: AssociatedList): MsFileItem {
// 返回用例等级
export function getCaseLevels(customFields: CustomAttributes[]): CaseLevel {
const caseLevelItem = customFields.find((it: any) => it.internal && it.fieldName === '用例等级');
const caseLevelItem = (customFields || []).find((it: any) => it.internal && it.fieldName === '用例等级');
return (
(caseLevelItem?.options.find((it: any) => it.value === caseLevelItem.defaultValue)?.text as CaseLevel) ||
('P0' as CaseLevel)

View File

@ -172,7 +172,7 @@
slotName: 'operation',
fixed: 'right',
dataIndex: 'operation',
width: hasOperationPermission.value ? 100 : 50,
width: hasOperationPermission.value ? 120 : 50,
showDrag: false,
},
];
@ -182,12 +182,12 @@
{
label: 'project.member.batchActionAddUserGroup',
eventTag: 'batchAddUserGroup',
permission: ['PROJECT_USER:READ+ADD'],
permission: ['PROJECT_USER:READ+UPDATE'],
},
{
label: 'project.member.batchActionRemove',
eventTag: 'batchActionRemove',
permission: ['PROJECT_USER:READ+ADD'],
permission: ['PROJECT_USER:READ+DELETE'],
},
],
};
@ -202,7 +202,7 @@
getProjectMemberList,
{
tableKey: TableKeyEnum.PROJECT_MEMBER,
selectable: true,
selectable: !!hasAnyPermission(['PROJECT_USER:READ+DELETE', 'ORGANIZATION_MEMBER:READ+UPDATE']),
showSetting: true,
heightUsed: 288,
columns,

View File

@ -1,7 +1,7 @@
export default {
'project.member.addMember': '添加成员',
'project.member.updateMember': '更新成员',
'project.member.searchMember': '通过或邮箱搜索',
'project.member.searchMember': '通过名或邮箱搜索',
'project.member.remove': '移除',
'project.member.edit': '编辑',
'project.member.add': '添加',

View File

@ -146,7 +146,7 @@
const sceneType = computed(() => route.query.type);
const hasOperationPermission = computed(() =>
hasAnyPermission(['PROJECT_TEMPLATE:READ+UPDATE', 'PROJECT_TEMPLATE:READ+DELETE'])
hasAnyPermission(['PROJECT_TEMPLATE:READ+ADD', 'PROJECT_TEMPLATE:READ+UPDATE', 'PROJECT_TEMPLATE:READ+DELETE'])
);
const fieldColumns: MsTableColumn = [

View File

@ -239,7 +239,7 @@
{
tableKey: TableKeyEnum.ORGANIZATION_MEMBER,
scroll: { x: 1800 },
selectable: true,
selectable: !!hasAnyPermission(['ORGANIZATION_MEMBER:READ+ADD', 'ORGANIZATION_MEMBER:READ+ADD']),
heightUsed: 288,
showSetting: true,
size: 'default',

View File

@ -1,7 +1,7 @@
export default {
'organization.member.addMember': '添加成员',
'organization.member.updateMember': '更新成员({name}',
'organization.member.searchMember': '通过或邮箱搜索',
'organization.member.searchMember': '通过名或邮箱搜索',
'organization.member.remove': '移除',
'organization.member.edit': '编辑',
'organization.member.batchActionAddProject': '添加至项目',

View File

@ -91,7 +91,7 @@
<a-button
v-if="item.config"
v-permission="['SYSTEM_SERVICE_INTEGRATION:READ+RESET']"
v-permission="['SYSTEM_SERVICE_INTEGRATION:READ+DELETE']"
type="outline"
class="arco-btn-outline--secondary"
size="mini"
@ -145,7 +145,6 @@
import { hasAnyPermission } from '@/utils/permission';
import type { ServiceItem, ServiceList } from '@/models/setting/serviceIntegration';
import { SettingRouteEnum } from '@/enums/routeEnum';
import Message from '@arco-design/web-vue/es/message';
@ -277,9 +276,10 @@
border: 1px solid var(--color-text-n9);
}
.ms-enable {
font-size: 12px;
border-radius: var(--border-radius-small);
background: var(--color-text-n9);
@apply px-2 py-1 text-xs;
@apply px-2 py-1;
}
}
}

View File

@ -233,12 +233,12 @@
title.value = t('system.orgTemplate.copyTemplate');
getClassifyField();
} else if (isEdit.value) {
title.value = t('system.orgTemplate.createTemplateType', {
title.value = t('system.orgTemplate.editTemplateType', {
type: getTemplateName('organization', route.query.type as string),
});
getClassifyField();
} else {
title.value = t('menu.settings.organization.editTemplateType', {
title.value = t('system.orgTemplate.createTemplateType', {
type: getTemplateName('organization', route.query.type as string),
});
}

View File

@ -17,15 +17,21 @@
</span>
<span class="operation hover:text-[rgb(var(--primary-5))]">
<span @click="templateManagement">{{ t('system.orgTemplate.TemplateManagement') }}</span>
<a-divider v-if="isEnableProject || props.cardItem.key === 'BUG'" direction="vertical" />
<a-divider
v-if="(hasEnablePermission && isEnableProject) || props.cardItem.key === 'BUG'"
direction="vertical"
/>
</span>
<span v-if="props.cardItem.key === 'BUG'" class="operation hover:text-[rgb(var(--primary-5))]">
<span @click="workflowSetup">{{ t('system.orgTemplate.workflowSetup') }}</span>
<a-divider v-if="isEnableProject && props.cardItem.key === 'BUG'" direction="vertical" />
<a-divider
v-if="isEnableProject && props.cardItem.key === 'BUG'"
v-permission="['ORGANIZATION_TEMPLATE:READ+ENABLE']"
direction="vertical"
/>
</span>
<span
v-if="isEnableProject"
v-permission="['ORGANIZATION_TEMPLATE:READ+ENABLE']"
v-if="isEnableProject && hasEnablePermission"
class="rounded p-[2px] hover:bg-[rgb(var(--primary-9))]"
>
<MsTableMoreAction :list="moreActions" @select="handleMoreActionSelect"
@ -97,6 +103,7 @@
import { useI18n } from '@/hooks/useI18n';
import { useAppStore } from '@/store';
import useTemplateStore from '@/store/modules/setting/template';
import { hasAnyPermission } from '@/utils/permission';
const { t } = useI18n();
const appStore = useAppStore();
@ -196,6 +203,8 @@
{ deep: true }
);
const hasEnablePermission = computed(() => hasAnyPermission(['ORGANIZATION_TEMPLATE:READ+ENABLE']));
function cancelHandler() {
showEnableVisible.value = false;
validateKeyWord.value = '';

View File

@ -100,7 +100,11 @@
const currentOrd = computed(() => appStore.currentOrgId);
const hasOperationPermission = computed(() =>
hasAnyPermission(['ORGANIZATION_TEMPLATE:READ+UPDATE', 'ORGANIZATION_TEMPLATE:READ+DELETE'])
hasAnyPermission([
'ORGANIZATION_TEMPLATE:READ+ADD',
'ORGANIZATION_TEMPLATE:READ+UPDATE',
'ORGANIZATION_TEMPLATE:READ+DELETE',
])
);
const fieldColumns: MsTableColumn = [

View File

@ -108,7 +108,7 @@ export default {
'system.orgTemplate.apiFieldId': 'API field',
'system.orgTemplate.copyTemplate': 'copy{type}template',
'system.orgTemplate.createTemplateType': 'create{type}',
'system.orgTemplate.editTemplateType': 'edit{type}',
'system.orgTemplate.editTemplateType': 'update{type}',
'system.orgTemplate.workFlowTip':
'Change the properties or workflow configuration of the event will take effect immediately on the related project. Exercise caution when performing this operation',
'system.orgTemplate.workFlowToolTip':

View File

@ -108,7 +108,7 @@ export default {
'system.orgTemplate.apiFieldId': 'API 字段',
'system.orgTemplate.copyTemplate': '复制{type}模板',
'system.orgTemplate.createTemplateType': '创建{type}',
'system.orgTemplate.editTemplateType': '编辑{type}',
'system.orgTemplate.editTemplateType': '更新{type}',
'system.orgTemplate.workFlowTip': '更改事项的属性或工作流配置,会在相关项目立即生效,请谨慎操作',
'system.orgTemplate.workFlowToolTip': '列为缺陷所在状态,在列内“点击+”,可添加流转状态',
'system.orgTemplate.workFlowToolTipHover': 'hover 可更换初始状态,操作列可选择结束状态',

View File

@ -18,7 +18,9 @@
allow-clear
/>
<span class="absolute right-0 top-1 flex items-center">
<span class="float-left text-[rgb(var(--primary-5))]">{{ t('system.plugin.getPlugin') }}</span>
<span class="text-[rgb(var(--primary-5))]b float-left cursor-pointer" @click="openGithub">{{
t('system.plugin.getPlugin')
}}</span>
<a-tooltip position="bottom">
<span class="float-right ml-1 mt-[2px]">
<IconQuestionCircle

View File

@ -27,7 +27,7 @@ export default {
'system.plugin.defaultJarNameTip': 'The default is the package name',
'system.plugin.appOrganize': 'Application Organization',
'system.plugin.description': 'Description',
'system.plugin.tableColumnsJar': 'jar',
'system.plugin.tableColumnsJar': 'Jar packages',
'system.plugin.tableNoData': 'No data, please',
'system.plugin.pluginDescription': 'Please describe the plug-in',
'system.plugin.supportFormat': 'Only JAR format files are supported and the file size does not exceed 50M',

View File

@ -27,7 +27,7 @@ export default {
'system.plugin.defaultJarNameTip': '默认为包名',
'system.plugin.appOrganize': '应用组织',
'system.plugin.description': '描述',
'system.plugin.tableColumnsJar': 'jar',
'system.plugin.tableColumnsJar': 'jar',
'system.plugin.tableNoData': '暂无数据,请',
'system.plugin.pluginDescription': '请对该插件进行描述',
'system.plugin.supportFormat': '只支持JAR格式文件文件大小不超过50M',