fix: 修改部分bugs

This commit is contained in:
xinxin.wu 2024-04-22 15:46:53 +08:00 committed by 刘瑞斌
parent d117e72f1f
commit 3bf668e8f1
16 changed files with 106 additions and 49 deletions

View File

@ -34,15 +34,15 @@
<template #name="{ record }"> <template #name="{ record }">
<div class="flex items-center"> <div class="flex items-center">
<a-tooltip :content="record.name"> <a-tooltip :content="record.name">
<div class="one-line-text max-w-[200px] cursor-pointer text-[rgb(var(--primary-5))]">{{ record.name }}</div> <div class="one-line-text max-w-[200px] cursor-pointer text-[rgb(var(--primary-5))]">{{
characterLimit(record.name)
}}</div>
</a-tooltip> </a-tooltip>
<a-popover :title="record.name" position="bottom"> <a-popover :title="record.name" position="bottom">
<a-button type="text" class="ml-2 px-0"> {{ t('project.commonScript.preview') }}</a-button> <a-button type="text" class="ml-2 px-0"> {{ t('project.commonScript.preview') }}</a-button>
<template #title> <template #title>
<div class="w-[436px] bg-[var(--color-bg-3)] px-2 pb-2"> <div class="w-[436px] bg-[var(--color-bg-3)] px-2 pb-2">
<span style="word-break: break-all"> <span style="word-break: break-all"> {{ characterLimit(record.name) }} </span>
{{ record.name }}
</span>
</div> </div>
</template> </template>
<template #content> <template #content>
@ -169,6 +169,7 @@
} from '@/api/modules/project-management/commonScript'; } from '@/api/modules/project-management/commonScript';
import { useI18n } from '@/hooks/useI18n'; import { useI18n } from '@/hooks/useI18n';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
import { characterLimit } from '@/utils';
import { hasAnyPermission } from '@/utils/permission'; import { hasAnyPermission } from '@/utils/permission';
import { BugOptionItem } from '@/models/bug-management'; import { BugOptionItem } from '@/models/bug-management';
@ -253,6 +254,7 @@
isTag: true, isTag: true,
width: 440, width: 440,
showDrag: true, showDrag: true,
tagPosition: 'tr',
}, },
{ {
title: 'project.commonScript.createUser', title: 'project.commonScript.createUser',

View File

@ -62,7 +62,7 @@
:no-more-data="noMoreData" :no-more-data="noMoreData"
raggable raggable
:virtual-list-props="{ :virtual-list-props="{
height: 'calc(100vh - 160px)', height: 'calc(100vh - 136px)',
}" }"
@reach-bottom="handleReachBottom" @reach-bottom="handleReachBottom"
> >

View File

@ -129,6 +129,7 @@
:tag-list="record[item.dataIndex as string]" :tag-list="record[item.dataIndex as string]"
type="primary" type="primary"
theme="outline" theme="outline"
:tag-position="item.tagPosition"
/> />
</template> </template>
<template v-else-if="item.slotName === SpecialColumnEnum.OPERATION"> <template v-else-if="item.slotName === SpecialColumnEnum.OPERATION">

View File

@ -1,28 +1,11 @@
<template> <template>
<div v-if="props.actionConfig" ref="refWrapper" class="flex flex-row flex-nowrap"> <div v-if="props.actionConfig" ref="refWrapper" class="flex flex-row flex-nowrap">
<div class="title">{{ t('msTable.batch.selected', { count: props.selectRowCount }) }}</div> <div class="title one-line-text">{{ t('msTable.batch.selected', { count: props.selectRowCount }) }}</div>
<template v-for="(element, idx) in baseAction" :key="element.label"> <div>
<a-divider v-if="element.isDivider" class="divider mx-0 my-[6px]" /> <template v-for="(element, idx) in baseAction" :key="element.label">
<a-button <a-divider v-if="element.isDivider" class="divider mx-0 my-[6px]" />
v-if="!element.isDivider && !element.children && hasAllPermission(element.permission as string[]) && hasAnyPermission(element.anyPermission as string[])"
class="ml-[12px]"
:class="{
'arco-btn-outline--danger': element.danger,
'ml-[8px]': idx === 0,
}"
type="outline"
:size="props.size"
@click="handleSelect(element)"
>{{ t(element.label as string) }}</a-button
>
<!-- baseAction多菜单选择 -->
<a-dropdown
v-if="!element.isDivider && element.children && hasAllPermission(element.permission as string[]) && hasAnyPermission(element.anyPermission as string[])"
position="tr"
:size="props.size"
@select="handleSelect"
>
<a-button <a-button
v-if="!element.isDivider && !element.children && hasAllPermission(element.permission as string[]) && hasAnyPermission(element.anyPermission as string[])"
class="ml-[12px]" class="ml-[12px]"
:class="{ :class="{
'arco-btn-outline--danger': element.danger, 'arco-btn-outline--danger': element.danger,
@ -30,20 +13,39 @@
}" }"
type="outline" type="outline"
:size="props.size" :size="props.size"
@click="handleSelect" @click="handleSelect(element)"
>{{ t(element.label as string) }}</a-button >{{ t(element.label as string) }}</a-button
> >
<template #content> <!-- baseAction多菜单选择 -->
<template v-for="item in element.children" :key="item.label"> <a-dropdown
<a-divider v-if="element.isDivider" margin="4px" /> v-if="!element.isDivider && element.children && hasAllPermission(element.permission as string[]) && hasAnyPermission(element.anyPermission as string[])"
<a-doption v-else :value="item" :class="{ delete: item.danger }"> position="tr"
{{ t(item.label as string) }} :size="props.size"
</a-doption> @select="handleSelect"
>
<a-button
class="ml-[12px]"
:class="{
'arco-btn-outline--danger': element.danger,
'ml-[8px]': idx === 0,
}"
type="outline"
:size="props.size"
@click="handleSelect"
>{{ t(element.label as string) }}</a-button
>
<template #content>
<template v-for="item in element.children" :key="item.label">
<a-divider v-if="element.isDivider" margin="4px" />
<a-doption v-else :value="item" :class="{ delete: item.danger }">
{{ t(item.label as string) }}
</a-doption>
</template>
</template> </template>
</template> </a-dropdown>
</a-dropdown> <!-- baseAction多菜单选择 -->
<!-- baseAction多菜单选择 --> </template>
</template> </div>
<div v-if="moreActionLength > 0" class="drop-down relative ml-[8px] inline-block"> <div v-if="moreActionLength > 0" class="drop-down relative ml-[8px] inline-block">
<a-dropdown position="tr" @select="handleSelect"> <a-dropdown position="tr" @select="handleSelect">
<a-button type="outline" :size="props.size"><MsIcon type="icon-icon_more_outlined" /></a-button> <a-button type="outline" :size="props.size"><MsIcon type="icon-icon_more_outlined" /></a-button>
@ -209,7 +211,7 @@
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100px; max-width: 400px;
color: var(--color-text-2); color: var(--color-text-2);
} }
.delete { .delete {

View File

@ -1,5 +1,5 @@
<template> <template>
<a-tooltip :content="tagsTooltip"> <a-tooltip :content="tagsTooltip" :position="props.tagPosition" :mouse-enter-delay="300">
<div class="flex max-w-[440px] flex-row" @click="emit('click')"> <div class="flex max-w-[440px] flex-row" @click="emit('click')">
<MsTag v-for="tag of showTagList" :key="tag.id" :width="getTagWidth(tag)" :size="props.size" v-bind="attrs"> <MsTag v-for="tag of showTagList" :key="tag.id" :width="getTagWidth(tag)" :size="props.size" v-bind="attrs">
{{ props.isStringTag ? tag : tag[props.nameKey] }} {{ props.isStringTag ? tag : tag[props.nameKey] }}
@ -23,11 +23,26 @@
nameKey?: string; nameKey?: string;
isStringTag?: boolean; // isStringTag?: boolean; //
size?: Size; size?: Size;
tagPosition?:
| 'top'
| 'tl'
| 'tr'
| 'bottom'
| 'bl'
| 'br'
| 'left'
| 'lt'
| 'lb'
| 'right'
| 'rt'
| 'rb'
| undefined; //
}>(), }>(),
{ {
showNum: 2, showNum: 2,
nameKey: 'name', nameKey: 'name',
size: 'medium', size: 'medium',
tagPosition: 'top',
} }
); );
const emit = defineEmits<{ const emit = defineEmits<{

View File

@ -423,7 +423,7 @@
<template #operationPre="{ record }"> <template #operationPre="{ record }">
<a-popover <a-popover
v-model:popupVisible="record.moreSettingPopoverVisible" v-model:popupVisible="record.moreSettingPopoverVisible"
position="tl" position="tr"
trigger="click" trigger="click"
:title="t('common.setting')" :title="t('common.setting')"
:content-style="{ width: '480px' }" :content-style="{ width: '480px' }"

View File

@ -485,7 +485,8 @@
}, },
onBeforeOk: async () => { onBeforeOk: async () => {
try { try {
await batchCleanOutDefinition(await getBatchParams()); console.log(getBatchParams(), ' getBatchParams() getBatchParams()');
// await batchCleanOutDefinition(await getBatchParams());
Message.success(t('common.deleteSuccess')); Message.success(t('common.deleteSuccess'));
resetSelector(); resetSelector();
loadApiList(true); loadApiList(true);

View File

@ -588,6 +588,14 @@
getTime(); getTime();
}); });
onBeforeUnmount(() => {
if (route.query.type === 'API_SCENARIO') {
showDetailDrawer.value = false;
} else {
showCaseDetailDrawer.value = false;
}
});
watch( watch(
() => props.moduleType, () => props.moduleType,
(val) => { (val) => {

View File

@ -900,6 +900,10 @@
} }
}); });
onBeforeUnmount(() => {
detailVisible.value = false;
});
onUnmounted(() => { onUnmounted(() => {
// //
pause(); pause();

View File

@ -1141,6 +1141,7 @@
}; };
if (isMove.value) { if (isMove.value) {
await batchMoveToModules(params); await batchMoveToModules(params);
groupKeyword.value = '';
Message.success(t('caseManagement.featureCase.batchMoveSuccess')); Message.success(t('caseManagement.featureCase.batchMoveSuccess'));
} else { } else {
await batchCopyToModules(params); await batchCopyToModules(params);
@ -1160,6 +1161,7 @@
function handleMoveCaseModalCancel() { function handleMoveCaseModalCancel() {
showBatchMoveDrawer.value = false; showBatchMoveDrawer.value = false;
selectedModuleKeys.value = []; selectedModuleKeys.value = [];
groupKeyword.value = '';
} }
function caseNodeSelect(keys: string[]) { function caseNodeSelect(keys: string[]) {
@ -1686,6 +1688,10 @@
} }
); );
onBeforeUnmount(() => {
showDetailDrawer.value = false;
});
defineExpose({ defineExpose({
emitTableParams, emitTableParams,
initData, initData,

View File

@ -88,6 +88,7 @@
class="w-[152px]" class="w-[152px]"
mode="button" mode="button"
:step="100" :step="100"
:precision="0"
:min="0" :min="0"
:default-value="1000" :default-value="1000"
:max="600000" :max="600000"

View File

@ -26,7 +26,7 @@
<div <div
v-if="!record.integrated" v-if="!record.integrated"
type="text" type="text"
class="one-line-text flex w-full" class="one-line-text w-full"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record.resourceId)"
>{{ record.resourceNum }} >{{ record.resourceNum }}
@ -35,8 +35,7 @@
<template #resourceName="{ record }"> <template #resourceName="{ record }">
<div <div
v-if="!record.integrated" v-if="!record.integrated"
type="text" class="one-line-text max-w-[300px]"
class="one-line-text flex max-w-[300px]"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record.resourceId)"
>{{ record.resourceName }} >{{ record.resourceName }}
@ -642,6 +641,14 @@
} }
} }
onBeforeUnmount(() => {
if (props.moduleType === 'API_CASE') {
showCaseDetailDrawer.value = false;
} else {
showDetailDrawer.value = false;
}
});
await tableStore.initColumn(groupColumnsMap[props.group].key, groupColumnsMap[props.group].columns, 'drawer', true); await tableStore.initColumn(groupColumnsMap[props.group].key, groupColumnsMap[props.group].columns, 'drawer', true);
</script> </script>

View File

@ -29,7 +29,7 @@
<div <div
v-if="props.moduleType === TaskCenterEnum.API_SCENARIO" v-if="props.moduleType === TaskCenterEnum.API_SCENARIO"
type="text" type="text"
class="one-line-text flex w-full" class="one-line-text w-full"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record.resourceId)"
>{{ record.resourceNum }} >{{ record.resourceNum }}
@ -38,8 +38,7 @@
<template #resourceName="{ record }"> <template #resourceName="{ record }">
<div <div
v-if="props.moduleType === TaskCenterEnum.API_SCENARIO" v-if="props.moduleType === TaskCenterEnum.API_SCENARIO"
type="text" class="one-line-text max-w-[300px]"
class="one-line-text flex max-w-[300px]"
:class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']" :class="[hasJumpPermission ? 'text-[rgb(var(--primary-5))]' : '']"
@click="showDetail(record.resourceId)" @click="showDetail(record.resourceId)"
>{{ record.resourceName }} >{{ record.resourceName }}

View File

@ -417,6 +417,10 @@
} }
}); });
onBeforeUnmount(() => {
showDetailVisible.value = false;
});
onMounted(() => { onMounted(() => {
fetchData(); fetchData();
updateColumns(); updateColumns();

View File

@ -18,11 +18,15 @@
<span class="operation hover:text-[rgb(var(--primary-5))]"> <span class="operation hover:text-[rgb(var(--primary-5))]">
<span @click="templateManagement">{{ t('system.orgTemplate.TemplateManagementList') }}</span> <span @click="templateManagement">{{ t('system.orgTemplate.TemplateManagementList') }}</span>
<a-divider <a-divider
v-if="(hasEnablePermission && isEnableProject) || props.cardItem.key === 'BUG'" v-if="hasEnablePermission && isEnableProject && props.cardItem.key === 'BUG'"
direction="vertical" direction="vertical"
/> />
</span> </span>
<span v-if="props.cardItem.key === 'BUG'" class="operation hover:text-[rgb(var(--primary-5))]"> <span v-if="props.cardItem.key === 'BUG'" class="operation hover:text-[rgb(var(--primary-5))]">
<a-divider
v-if="!(hasEnablePermission && isEnableProject) && props.cardItem.key === 'BUG'"
direction="vertical"
/>
<span @click="workflowSetup">{{ t('system.orgTemplate.workflowSetup') }}</span> <span @click="workflowSetup">{{ t('system.orgTemplate.workflowSetup') }}</span>
<a-divider <a-divider
v-if="hasEnablePermission && props.mode === 'organization' && isEnableProject" v-if="hasEnablePermission && props.mode === 'organization' && isEnableProject"

View File

@ -551,6 +551,9 @@
} }
function handleNameClick(record: LogItem) { function handleNameClick(record: LogItem) {
if (record.type === 'DELETE') {
return;
}
const routeQuery: Record<string, any> = { const routeQuery: Record<string, any> = {
orgId: record.organizationId, orgId: record.organizationId,
pId: record.projectId, pId: record.projectId,