fix(功能用例): 补充遗落国际化和去掉域名

This commit is contained in:
xinxin.wu 2023-12-01 17:45:35 +08:00 committed by Craftsman
parent 0549a16d2b
commit 1721410efa
7 changed files with 53 additions and 7 deletions

View File

@ -12,8 +12,10 @@ import {
CreateCaseUrl, CreateCaseUrl,
DeleteCaseModuleTreeUrl, DeleteCaseModuleTreeUrl,
DeleteCaseUrl, DeleteCaseUrl,
deleteFileOrCancelAssociationUrl,
DeleteRecycleCaseListUrl, DeleteRecycleCaseListUrl,
DetailCaseUrl, DetailCaseUrl,
DownloadFileUrl,
FollowerCaseUrl, FollowerCaseUrl,
GetAssociatedFilePageUrl, GetAssociatedFilePageUrl,
GetCaseListUrl, GetCaseListUrl,
@ -25,11 +27,14 @@ import {
GetRecycleCaseModulesCountUrl, GetRecycleCaseModulesCountUrl,
GetTrashCaseModuleTreeUrl, GetTrashCaseModuleTreeUrl,
MoveCaseModuleTreeUrl, MoveCaseModuleTreeUrl,
PreviewFileUrl,
RecoverRecycleCaseListUrl, RecoverRecycleCaseListUrl,
RestoreCaseListUrl, RestoreCaseListUrl,
TransferFileUrl,
UpdateCaseModuleTreeUrl, UpdateCaseModuleTreeUrl,
UpdateCaseUrl, UpdateCaseUrl,
UpdateDemandUrl, UpdateDemandUrl,
UploadOrAssociationFileUrl,
} from '@/api/requrls/case-management/featureCase'; } from '@/api/requrls/case-management/featureCase';
import type { import type {
@ -45,6 +50,7 @@ import type {
DemandItem, DemandItem,
ModulesTreeType, ModulesTreeType,
MoveModules, MoveModules,
OperationFile,
UpdateModule, UpdateModule,
} from '@/models/caseManagement/featureCase'; } from '@/models/caseManagement/featureCase';
import type { CommonList, TableQueryParams } from '@/models/common'; import type { CommonList, TableQueryParams } from '@/models/common';
@ -185,4 +191,34 @@ export function cancelAssociationDemand(id: string) {
return MSR.get({ url: `${CancelAssociationDemandUrl}/${id}` }); return MSR.get({ url: `${CancelAssociationDemandUrl}/${id}` });
} }
// 附件
// 上传文件并关联用例
export function uploadOrAssociationFile(data: Record<string, any>) {
return MSR.uploadFile(
{ url: UploadOrAssociationFileUrl },
{ request: data.request, fileList: data.fileList },
'file'
);
}
// 转存文件
export function transferFile(data: OperationFile) {
return MSR.post({ url: TransferFileUrl, data });
}
// 预览文件
export function previewFile(data: OperationFile) {
return MSR.post({ url: PreviewFileUrl, data });
}
// 下载文件
export function downloadFile(data: OperationFile) {
return MSR.post({ url: DownloadFileUrl, data });
}
// 删除文件或取消关联用例文件
export function deleteFileOrCancelAssociation(data: any) {
return MSR.post({ url: DownloadFileUrl, data });
}
export default {}; export default {};

View File

@ -212,5 +212,12 @@ export interface CreateOrUpdateDemand {
demandList?: DemandFormList[]; demandList?: DemandFormList[];
[key: string]: any; [key: string]: any;
} }
// 转存文件
export interface OperationFile {
projectId: string;
caseId: string;
fileId: string; // 文件id
local: boolean; // 是否是本地
}
export type DemandList = DemandItem[]; export type DemandList = DemandItem[];

View File

@ -118,6 +118,8 @@
} else { } else {
title.value = t('caseManagement.featureCase.creatingCase'); title.value = t('caseManagement.featureCase.creatingCase');
} }
const gatewayAddress = `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;
console.log(gatewayAddress);
}); });
</script> </script>

View File

@ -2,14 +2,14 @@
<MsDrawer <MsDrawer
v-model:visible="showSettingVisible" v-model:visible="showSettingVisible"
:mask="false" :mask="false"
:title="t('caseManagement.featureCase.displaySetting')" :title="t('caseManagement.featureCase.detailDisplaySetting')"
:width="480" :width="480"
unmount-on-close unmount-on-close
:footer="false" :footer="false"
> >
<div class="header mb-1 flex h-[22px] items-center justify-between"> <div class="header mb-1 flex h-[22px] items-center justify-between">
<div class="flex items-center text-[var(--color-text-4)]" <div class="flex items-center text-[var(--color-text-4)]"
>{{ t('caseManagement.featureCase.displaySetting') }} >{{ t('caseManagement.featureCase.detailDisplaySetting') }}
<a-tooltip> <a-tooltip>
<template #content> <template #content>

View File

@ -99,6 +99,7 @@ export function getReviewStatusClass(status: keyof typeof StatusType) {
*/ */
export function convertToFile(fileInfo: AssociatedList): MsFileItem { export function convertToFile(fileInfo: AssociatedList): MsFileItem {
const gatewayAddress = `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;
const fileName = fileInfo.fileType ? `${fileInfo.name}.${fileInfo.fileType || ''}` : `${fileInfo.name}`; const fileName = fileInfo.fileType ? `${fileInfo.name}.${fileInfo.fileType || ''}` : `${fileInfo.name}`;
const type = fileName.split('.')[1]; const type = fileName.split('.')[1];
const file = new File([new Blob()], `${fileName}`, { const file = new File([new Blob()], `${fileName}`, {
@ -112,9 +113,8 @@ export function convertToFile(fileInfo: AssociatedList): MsFileItem {
percent: 0, percent: 0,
status: 'done', status: 'done',
uid: fileInfo.id, uid: fileInfo.id,
url: `http://172.16.200.18:8081/${fileInfo.filePath || ''}`, url: `${gatewayAddress}/${fileInfo.filePath || ''}`,
local: fileInfo.local, local: fileInfo.local,
}; };
} }
export default {}; export default {};

View File

@ -121,7 +121,7 @@ export default {
'caseManagement.featureCase.addDemand': '添加需求', 'caseManagement.featureCase.addDemand': '添加需求',
'caseManagement.featureCase.updateDemand': '更新需求 ({name})', 'caseManagement.featureCase.updateDemand': '更新需求 ({name})',
'caseManagement.featureCase.updateUser': '处理人', 'caseManagement.featureCase.updateUser': '处理人',
'caseManagement.featureCase.showSetting': '显示设置', 'caseManagement.featureCase.displaySetting': '显示设置',
'caseManagement.featureCase.tabShowSetting': 'tab 显示设置', 'caseManagement.featureCase.tabShowSetting': 'tab 显示设置',
'caseManagement.featureCase.closeModuleTab': '关闭: 在抽屉内不展示相关模块', 'caseManagement.featureCase.closeModuleTab': '关闭: 在抽屉内不展示相关模块',
'caseManagement.featureCase.enableModuleTab': '开启: 在抽屉内展示相关模块', 'caseManagement.featureCase.enableModuleTab': '开启: 在抽屉内展示相关模块',

View File

@ -25,7 +25,7 @@
<div v-for="item of filterList" :key="item.id" class="item"> <div v-for="item of filterList" :key="item.id" class="item">
<div class="flex"> <div class="flex">
<span class="icon float-left mr-2 h-[40px] w-[40px] rounded"> <span class="icon float-left mr-2 h-[40px] w-[40px] rounded">
<img class="rounded" :src="`http://172.16.200.18:8081${item.logo}`" alt="log" /> <img class="rounded" :src="`${gatewayAddress}${item.logo}`" alt="log" />
</span> </span>
<div class="flex flex-col justify-start"> <div class="flex flex-col justify-start">
<p> <p>
@ -94,7 +94,7 @@
</div> </div>
</div> </div>
</div> </div>
<a-empty v-if="filterList.length < 1" class="mt-20"> </a-empty> <a-empty v-if="filterList.length" class="mt-20"> </a-empty>
</a-scrollbar> </a-scrollbar>
</div> </div>
</div> </div>
@ -135,6 +135,7 @@
const filterList = ref<ServiceList>([]); const filterList = ref<ServiceList>([]);
const data = ref<ServiceList>([]); const data = ref<ServiceList>([]);
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
const gatewayAddress = `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;
// //
const loadList = async () => { const loadList = async () => {