fix(全局): 问题修复
This commit is contained in:
parent
afd1704284
commit
e06854d8b1
|
@ -81,7 +81,7 @@ export class MSAxios {
|
|||
* @description: 文件上传
|
||||
*/
|
||||
uploadFile<T = any>(
|
||||
config: AxiosRequestConfig,
|
||||
config: AxiosRequestConfig & RequestOptions,
|
||||
params: UploadFileParams,
|
||||
customFileKey = '',
|
||||
isMultiple = false
|
||||
|
@ -110,7 +110,6 @@ export class MSAxios {
|
|||
const { requestOptions } = this.options;
|
||||
|
||||
const opt = { ...requestOptions, isTransformResponse: false };
|
||||
|
||||
const { transformRequestHook } = transform || {};
|
||||
return new Promise((resolve, reject) => {
|
||||
this.axiosInstance
|
||||
|
@ -120,8 +119,10 @@ export class MSAxios {
|
|||
data: formData,
|
||||
headers: {
|
||||
'Content-type': ContentTypeEnum.FORM_DATA,
|
||||
},
|
||||
// @ts-ignore
|
||||
'ignoreCancelToken': true, // 文件上传请求不需要添加到pending中,以免路由切换导致文件上传请求被取消
|
||||
requestOptions: {
|
||||
ignoreCancelToken: true, // 文件上传请求不需要添加到pending中,以免路由切换导致文件上传请求被取消
|
||||
},
|
||||
})
|
||||
.then((res: AxiosResponse<Result>) => {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<a-cascader
|
||||
v-if="props.mode === 'MS'"
|
||||
ref="cascader"
|
||||
v-model="innerValue"
|
||||
v-model:model-value="innerValue"
|
||||
class="ms-cascader"
|
||||
:options="props.options"
|
||||
:trigger-props="{ contentClass: `ms-cascader-popper ms-cascader-popper--${props.optionSize}` }"
|
||||
|
@ -14,7 +14,7 @@
|
|||
:placeholder="props.placeholder"
|
||||
:loading="props.loading"
|
||||
:value-key="props.valueKey"
|
||||
:path-mode="props.pathMode"
|
||||
:path-mode="false"
|
||||
@change="handleMsCascaderChange"
|
||||
@clear="clearValues"
|
||||
>
|
||||
|
@ -44,7 +44,7 @@
|
|||
<a-cascader
|
||||
v-else
|
||||
ref="cascader"
|
||||
v-model="innerValue"
|
||||
v-model:model-value="innerValue"
|
||||
class="ms-cascader"
|
||||
:options="props.options"
|
||||
:trigger-props="{ contentClass: `ms-cascader-popper ms-cascader-popper--${props.optionSize}` }"
|
||||
|
@ -56,7 +56,7 @@
|
|||
:virtual-list-props="props.virtualListProps"
|
||||
:loading="props.loading"
|
||||
:value-key="props.valueKey"
|
||||
:path-mode="props.pathMode"
|
||||
:path-mode="false"
|
||||
@change="(val) => emit('change', val)"
|
||||
>
|
||||
<template v-if="props.prefix" #prefix>
|
||||
|
@ -109,7 +109,8 @@
|
|||
placeholder?: string;
|
||||
loading?: boolean;
|
||||
optionSize?: 'small' | 'default';
|
||||
pathMode?: boolean; // 是否开启路径模式
|
||||
pathMode?: boolean; // 是否开启路径模式,TODO:目前 arco 组件库开启 pathmode 存在 BUG,不开启,实际上值也是 pathmode 格式的
|
||||
labelPathMode?: boolean; // 是否开启回显的 label 是路径模式
|
||||
valueKey?: string;
|
||||
labelKey?: string; // 传入自定义的 labelKey
|
||||
}
|
||||
|
@ -149,6 +150,7 @@
|
|||
typeof val[0] === 'string' &&
|
||||
props.levelTop?.includes(val[0])
|
||||
) {
|
||||
// 顶级选项,该级别为单选选项
|
||||
innerLevel.value = val[0] as string;
|
||||
}
|
||||
},
|
||||
|
@ -162,13 +164,16 @@
|
|||
(val) => {
|
||||
if (Array.isArray(val)) {
|
||||
// 选项变化时,清理一次已选的选项的label对象
|
||||
const tempObj: Record<string, any> = {};
|
||||
selectedLabelObj = {};
|
||||
for (let i = 0; i < val.length; i++) {
|
||||
if (selectedLabelObj[val[i]]) {
|
||||
tempObj[val[i]] = selectedLabelObj[val[i]];
|
||||
const item = val[i];
|
||||
const value = typeof item === 'object' ? item.value : item;
|
||||
if (!props.labelPathMode) {
|
||||
selectedLabelObj[value] = t((item.label || '').split('/').pop() || '');
|
||||
} else {
|
||||
selectedLabelObj[value] = t(item.label || '');
|
||||
}
|
||||
}
|
||||
selectedLabelObj = { ...tempObj };
|
||||
}
|
||||
emit('update:modelValue', val);
|
||||
if (val === '') {
|
||||
|
@ -211,21 +216,21 @@
|
|||
// TODO: 临时解决 arco-design 的 cascader 组件已选项的label只能是带路径‘/’的 path-mode 的问题
|
||||
function getInputLabel(data: CascaderOption) {
|
||||
const isTagCount = data[props.labelKey].includes('+');
|
||||
if (!props.pathMode) {
|
||||
return isTagCount ? data.label : t((data.label || '').split('/').pop() || ''); // 取路径最后一级
|
||||
if (isTagCount) {
|
||||
return data.label;
|
||||
}
|
||||
return isTagCount ? data.label || '' : t(data.label || '');
|
||||
if (!props.labelPathMode) {
|
||||
return t((data.label || '').split('/').pop() || ''); // 取路径最后一级
|
||||
}
|
||||
return t(data.label || '');
|
||||
}
|
||||
|
||||
function getInputLabelTooltip(data: CascaderOption) {
|
||||
const isTagCount = data[props.labelKey].includes('+');
|
||||
const label = getInputLabel(data);
|
||||
if (isTagCount && Array.isArray(innerValue.value)) {
|
||||
return Object.values(selectedLabelObj).join(',');
|
||||
}
|
||||
const label = getInputLabel(data);
|
||||
if (data.value && typeof data.value === 'string') {
|
||||
selectedLabelObj[data.value] = label;
|
||||
}
|
||||
return label;
|
||||
}
|
||||
|
||||
|
|
|
@ -208,10 +208,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="content-footer">
|
||||
<div class="mb-[12px] flex items-center">
|
||||
<div class="mb-[12px] flex items-center justify-between">
|
||||
<div class="font-medium text-[var(--color-text-1)]">
|
||||
{{ t('caseManagement.caseReview.startReview') }}
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<a-switch v-model:model-value="autoNext" class="mx-[8px]" size="small" type="line" />
|
||||
<div class="text-[var(--color-text-4)]">{{ t('caseManagement.caseReview.autoNext') }}</div>
|
||||
<a-tooltip position="right">
|
||||
|
@ -225,6 +226,7 @@
|
|||
/>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<reviewForm
|
||||
:review-id="reviewId"
|
||||
:case-id="activeCaseId"
|
||||
|
@ -334,7 +336,7 @@
|
|||
reviewId: reviewId.value,
|
||||
viewFlag: onlyMine.value,
|
||||
keyword: keyword.value,
|
||||
current: pageNation.value.current,
|
||||
current: pageNation.value.current || 1,
|
||||
pageSize: pageNation.value.pageSize,
|
||||
filter: type.value
|
||||
? {
|
||||
|
@ -355,7 +357,10 @@
|
|||
|
||||
watch(
|
||||
() => onlyMine.value,
|
||||
() => loadCaseList()
|
||||
() => {
|
||||
pageNation.value.current = 1;
|
||||
loadCaseList();
|
||||
}
|
||||
);
|
||||
|
||||
const activeCaseId = ref(route.query.caseId as string);
|
||||
|
@ -502,24 +507,30 @@
|
|||
);
|
||||
}
|
||||
|
||||
function reviewDone() {
|
||||
async function reviewDone() {
|
||||
if (autoNext.value) {
|
||||
// 自动下一个,更改激活的 id会刷新详情
|
||||
const index = caseList.value.findIndex((e) => e.caseId === activeCaseId.value);
|
||||
if (index < caseList.value.length - 1) {
|
||||
activeCaseId.value = caseList.value[index + 1].caseId;
|
||||
} else if (pageNation.value.current * pageNation.value.pageSize < pageNation.value.total) {
|
||||
// 当前页不是最后一页,则加载下一页并激活第一个用例
|
||||
pageNation.value.current += 1;
|
||||
await loadCaseList();
|
||||
activeCaseId.value = caseList.value[0].caseId;
|
||||
} else {
|
||||
// 当前是最后一个,刷新数据
|
||||
loadCaseDetail();
|
||||
initReviewHistoryList();
|
||||
loadCaseList();
|
||||
}
|
||||
} else {
|
||||
// 不自动下一个才请求详情
|
||||
loadCaseDetail();
|
||||
initReviewHistoryList();
|
||||
}
|
||||
loadCaseList();
|
||||
}
|
||||
}
|
||||
|
||||
const editCaseVisible = ref(false);
|
||||
const editCaseForm = ref<Record<string, any>>({});
|
||||
|
@ -552,7 +563,7 @@
|
|||
moduleIds,
|
||||
} = lastPageParams;
|
||||
pageNation.value = {
|
||||
total,
|
||||
total: total || 0,
|
||||
pageSize,
|
||||
current,
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
type="primary"
|
||||
class="mt-[12px]"
|
||||
:disabled="submitDisabled"
|
||||
:submit-review-loading="submitReviewLoading"
|
||||
:loading="submitReviewLoading"
|
||||
@click="submitReview"
|
||||
>
|
||||
{{ t('caseManagement.caseReview.submitReview') }}
|
||||
|
|
|
@ -1009,7 +1009,7 @@
|
|||
* @param type 文件类型
|
||||
*/
|
||||
function setAcceptType(type: UploadType) {
|
||||
if (isUploading.value) return;
|
||||
if (isUploading.value || acceptType.value === type) return;
|
||||
acceptType.value = type;
|
||||
fileList.value = [];
|
||||
}
|
||||
|
|
|
@ -26,7 +26,9 @@
|
|||
<div :key="index" class="storage" @click="setActiveFolder(item.id)">
|
||||
<div :class="props.activeFolder === item.id ? 'storage-text storage-text--active' : 'storage-text'">
|
||||
<MsIcon type="icon-icon_git" class="storage-icon" />
|
||||
<div class="storage-name">{{ item.name }}</div>
|
||||
<a-tooltip :content="item.name">
|
||||
<div class="storage-name one-line-text">{{ item.name }}</div>
|
||||
</a-tooltip>
|
||||
<div class="storage-count">({{ item.count }})</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -151,6 +153,7 @@
|
|||
import {
|
||||
addRepository,
|
||||
connectRepository,
|
||||
deleteModule,
|
||||
getRepositories,
|
||||
getRepositoryInfo,
|
||||
updateRepository,
|
||||
|
@ -264,7 +267,7 @@
|
|||
* 删除存储库
|
||||
* @param item 列表项信息
|
||||
*/
|
||||
function deleteStorage(item: any) {
|
||||
function deleteStorage(item: Repository) {
|
||||
openModal({
|
||||
type: 'error',
|
||||
title: t('project.fileManagement.deleteStorageTipTitle', { name: item.name }),
|
||||
|
@ -276,7 +279,9 @@
|
|||
maskClosable: false,
|
||||
onBeforeOk: async () => {
|
||||
try {
|
||||
await deleteModule(item.id);
|
||||
Message.success(t('project.fileManagement.deleteSuccess'));
|
||||
initRepositories();
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
|
@ -386,7 +391,7 @@
|
|||
storageFormRef.value?.validateField('url');
|
||||
}
|
||||
|
||||
function validatePlatformUrl(value: any, callback: (error?: string | undefined) => void) {
|
||||
function validatePlatformUrl(value: string, callback: (error?: string | undefined) => void) {
|
||||
if (!validateGitUrl(value)) {
|
||||
callback(t('project.fileManagement.storageUrlError'));
|
||||
}
|
||||
|
@ -394,7 +399,6 @@
|
|||
|
||||
function handleDrawerCancel() {
|
||||
showDrawer.value = false;
|
||||
storageFormRef.value?.resetFields();
|
||||
isEdit.value = false;
|
||||
}
|
||||
|
||||
|
@ -415,6 +419,7 @@
|
|||
projectId: appStore.currentProjectId,
|
||||
});
|
||||
}
|
||||
storageFormRef.value?.resetFields();
|
||||
if (!isContinue) {
|
||||
handleDrawerCancel();
|
||||
}
|
||||
|
@ -478,6 +483,7 @@
|
|||
color: var(--color-text-4);
|
||||
}
|
||||
.storage-name {
|
||||
max-width: 170px;
|
||||
color: var(--color-text-1);
|
||||
}
|
||||
.storage-count {
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
:level-top="[...MENU_LEVEL]"
|
||||
:virtual-list-props="{ height: 200 }"
|
||||
:loading="rangeLoading"
|
||||
path-mode
|
||||
label-path-mode
|
||||
class="filter-item"
|
||||
/>
|
||||
<a-select v-model:model-value="type" class="filter-item">
|
||||
|
@ -116,8 +116,12 @@
|
|||
{{ t(typeOptions.find((e) => e.value === record.type)?.label || '') }}
|
||||
</template>
|
||||
<template #content="{ record }">
|
||||
<div v-if="record.module === 'SYSTEM'">{{ record.content }}</div>
|
||||
<MsButton v-else @click="handleNameClick(record)">{{ record.content }}</MsButton>
|
||||
<div v-if="record.module === 'SYSTEM'" class="one-line-text">{{ record.content }}</div>
|
||||
<MsButton v-else @click="handleNameClick(record)">
|
||||
<div class="one-line-text">
|
||||
{{ record.content }}
|
||||
</div>
|
||||
</MsButton>
|
||||
</template>
|
||||
</ms-base-table>
|
||||
</div>
|
||||
|
@ -450,7 +454,6 @@
|
|||
title: 'system.log.operateName',
|
||||
dataIndex: 'content',
|
||||
slotName: 'content',
|
||||
showTooltip: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
:title="t('system.user.invite')"
|
||||
title-align="start"
|
||||
class="ms-modal-form ms-modal-medium"
|
||||
@close="cancelInvite"
|
||||
>
|
||||
<a-form ref="inviteFormRef" class="rounded-[4px]" :model="emailForm" layout="vertical">
|
||||
<a-form-item
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
:tag-list="record.userRoleList"
|
||||
type="primary"
|
||||
theme="outline"
|
||||
@click="record.selectUserGroupVisible = true"
|
||||
@click="handleTagClick(record)"
|
||||
/>
|
||||
<MsSelect
|
||||
v-else
|
||||
|
@ -61,7 +61,9 @@
|
|||
</template>
|
||||
<template #action="{ record }">
|
||||
<template v-if="!record.enable">
|
||||
<MsButton @click="enableUser(record)">{{ t('system.user.enable') }}</MsButton>
|
||||
<MsButton v-permission="['SYSTEM_USER:READ+UPDATE']" @click="enableUser(record)">
|
||||
{{ t('system.user.enable') }}
|
||||
</MsButton>
|
||||
<MsButton v-permission="['SYSTEM_USER:READ+DELETE']" @click="deleteUser(record)">
|
||||
{{ t('system.user.delete') }}
|
||||
</MsButton>
|
||||
|
@ -838,6 +840,12 @@
|
|||
loadList();
|
||||
}
|
||||
|
||||
function handleTagClick(record: UserListItem & Record<string, any>) {
|
||||
if (hasAnyPermission(['SYSTEM_USER:READ+UPDATE'])) {
|
||||
record.selectUserGroupVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 快捷修改用户组
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue