fix: 修改全局bug树模快悬浮样式&缺陷管理bug&脚本菜单style

This commit is contained in:
xinxin.wu 2024-04-17 21:20:52 +08:00 committed by 刘瑞斌
parent 1e87d23c0c
commit cd03ccead9
26 changed files with 115 additions and 58 deletions

View File

@ -78,7 +78,7 @@
<template #title="nodeData"> <template #title="nodeData">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div>
</div> </div>
</template> </template>
</MsTree> </MsTree>

View File

@ -53,7 +53,7 @@
<template #title="nodeData"> <template #title="nodeData">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div>
</div> </div>
</template> </template>
</MsTree> </MsTree>

View File

@ -2,7 +2,8 @@
<MsDrawer <MsDrawer
v-model:visible="showScriptDrawer" v-model:visible="showScriptDrawer"
:title="form.id ? t('project.commonScript.editPublicScript') : t('project.commonScript.addPublicScript')" :title="form.id ? t('project.commonScript.editPublicScript') : t('project.commonScript.addPublicScript')"
:width="768" :width="900"
min-width="900px"
:footer="true" :footer="true"
unmount-on-close unmount-on-close
:ok-loading="props.confirmLoading" :ok-loading="props.confirmLoading"

View File

@ -1,6 +1,6 @@
<template> <template>
<div v-if="!innerExpand" class="w-[32%] min-w-[30%] max-w-[42%] bg-white p-3 pl-0"> <div v-if="!innerExpand" class="w-[32%] min-w-[260px] max-w-[42%] flex-1 bg-white p-3 pl-0">
<div class="mb-2 flex items-center justify-between"> <div class="mb-2 flex w-full items-center justify-between">
<div class="flex items-center"> <div class="flex items-center">
<span v-if="innerExpand" class="collapsebtn mr-1 flex items-center justify-center" @click="expandedHandler"> <span v-if="innerExpand" class="collapsebtn mr-1 flex items-center justify-center" @click="expandedHandler">
<icon-right class="text-[12px] text-[var(--color-text-4)]" /> <icon-right class="text-[12px] text-[var(--color-text-4)]" />
@ -8,22 +8,23 @@
<span v-else class="expand mr-1 flex items-center justify-center" @click="expandedHandler"> <span v-else class="expand mr-1 flex items-center justify-center" @click="expandedHandler">
<icon-down class="text-[12px] text-[rgb(var(--primary-6))]" /> <icon-down class="text-[12px] text-[rgb(var(--primary-6))]" />
</span> </span>
<div class="font-medium">{{ t('project.commonScript.codeSnippet') }}</div> <div class="one-line-text font-medium">{{ t('project.commonScript.codeSnippet') }}</div>
</div> </div>
<a-select <div class="ml-[24px] flex-1">
v-model="innerLanguageType" <a-select
:disabled="props.disabled" v-model="innerLanguageType"
class="max-w-[50%]" :disabled="props.disabled"
:placeholder="t('project.commonScript.pleaseSelected')" :placeholder="t('project.commonScript.pleaseSelected')"
@change="changeHandler" @change="changeHandler"
> >
<a-option v-for="item of languages" :key="item.value" :value="item.value"> <a-option v-for="item of languages" :key="item.value" :value="item.value">
<a-tooltip :content="item.text"> <a-tooltip :content="item.text">
{{ item.text }} {{ item.text }}
</a-tooltip> </a-tooltip>
</a-option> </a-option>
</a-select> </a-select>
</div>
</div> </div>
<div class="p-[12px] pt-0"> <div class="p-[12px] pt-0">
<div v-for="item of SCRIPT_MENU" :key="item.value" class="menuItem px-1" @click="handleClick(item)"> <div v-for="item of SCRIPT_MENU" :key="item.value" class="menuItem px-1" @click="handleClick(item)">

View File

@ -33,7 +33,7 @@
nodeData.name nodeData.name
}}</div }}</div
> >
<div class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div>
</div> </div>
</template> </template>
</MsTree> </MsTree>

View File

@ -405,7 +405,7 @@
@apply h-full; @apply h-full;
.ms-tree { .ms-tree {
.ms-scroll-bar(); .ms-scroll-bar();
@apply h-full; @apply h-full overflow-auto;
.arco-tree-node { .arco-tree-node {
border-radius: var(--border-radius-small); border-radius: var(--border-radius-small);
&:hover { &:hover {
@ -418,6 +418,9 @@
} }
} }
} }
.ms-tree-node-count {
@apply hidden;
}
.ms-tree-node-extra { .ms-tree-node-extra {
@apply visible w-auto; @apply visible w-auto;
} }

View File

@ -252,6 +252,10 @@
} }
} }
} }
//
function getEncodingCode() {
return editor.getValue();
}
const init = () => { const init = () => {
// TODO: // TODO:
@ -351,6 +355,7 @@
undo, undo,
redo, redo,
format, format,
getEncodingCode,
}; };
}, },
}); });

View File

@ -265,6 +265,12 @@
function goMessageCenter() { function goMessageCenter() {
messageCenterVisible.value = true; messageCenterVisible.value = true;
} }
onMounted(() => {
if (route.query.task) {
goTaskCenter();
}
});
</script> </script>
<style scoped lang="less"> <style scoped lang="less">

View File

@ -734,6 +734,9 @@ export const pathMap: PathMapItem[] = [
key: 'PROJECT_MANAGEMENT_TASK_CENTER', // 项目管理-任务中心 key: 'PROJECT_MANAGEMENT_TASK_CENTER', // 项目管理-任务中心
locale: 'menu.projectManagement.taskCenter', locale: 'menu.projectManagement.taskCenter',
route: '', route: '',
routeQuery: {
task: 'projectTask',
},
permission: [], permission: [],
level: MENU_LEVEL[2], level: MENU_LEVEL[2],
}, },

View File

@ -4,7 +4,12 @@
<a-tab-pane v-for="item of responseCompositionTabList" :key="item.value" :title="item.label" /> <a-tab-pane v-for="item of responseCompositionTabList" :key="item.value" :title="item.label" />
</a-tabs> </a-tabs>
<div class="response-container"> <div class="response-container">
<ResBody v-if="activeTab === ResponseComposition.BODY" :request-result="props.requestResult" @copy="copyScript" /> <ResBody
v-if="activeTab === ResponseComposition.BODY"
ref="resBodyRef"
:request-result="props.requestResult"
@copy="copyScript"
/>
<ResConsole v-else-if="activeTab === ResponseComposition.CONSOLE" :console="props.console?.trim()" /> <ResConsole v-else-if="activeTab === ResponseComposition.CONSOLE" :console="props.console?.trim()" />
<ResValueScript <ResValueScript
v-else-if=" v-else-if="
@ -116,10 +121,11 @@
}); });
const { copy, isSupported } = useClipboard({ legacy: true }); const { copy, isSupported } = useClipboard({ legacy: true });
const resBodyRef = ref();
function copyScript() { function copyScript() {
const encodingFormatValue = resBodyRef.value.responseEditorRef.getEncodingCode();
if (isSupported) { if (isSupported) {
copy(props.requestResult?.responseResult.body || ''); copy(encodingFormatValue || '');
Message.success(t('common.copySuccess')); Message.success(t('common.copySuccess'));
} else { } else {
Message.warning(t('apiTestDebug.copyNotSupport')); Message.warning(t('apiTestDebug.copyNotSupport'));

View File

@ -95,6 +95,11 @@
downloadUrlFile(imageUrl.value, `response.${props.requestResult?.responseResult.contentType.split('/')[1]}`); downloadUrlFile(imageUrl.value, `response.${props.requestResult?.responseResult.contentType.split('/')[1]}`);
} }
} }
const responseEditorRef = ref();
defineExpose({
responseEditorRef,
});
</script> </script>
<style scoped></style> <style scoped></style>

View File

@ -105,7 +105,7 @@
</div> </div>
<div v-else class="inline-flex w-full"> <div v-else class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div>
</div> </div>
</template> </template>
<template #extra="nodeData"> <template #extra="nodeData">

View File

@ -50,12 +50,20 @@
dataIndex: 'num', dataIndex: 'num',
slotName: 'num', slotName: 'num',
width: 150, width: 150,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
}, },
{ {
title: 'apiTestManagement.resourceName', title: 'apiTestManagement.resourceName',
dataIndex: 'resourceName', dataIndex: 'resourceName',
showTooltip: true, showTooltip: true,
width: 150, width: 150,
sortable: {
sortDirections: ['ascend', 'descend'],
sorter: true,
},
}, },
{ {
title: 'apiTestManagement.resourceType', title: 'apiTestManagement.resourceType',
@ -87,6 +95,7 @@
scroll: { x: '100%' }, scroll: { x: '100%' },
selectable: false, selectable: false,
heightUsed: 374, heightUsed: 374,
showJumpMethod: true,
}, },
(item) => ({ (item) => ({
...item, ...item,

View File

@ -130,7 +130,7 @@
</div> </div>
<div v-else :id="nodeData.id" class="inline-flex w-full"> <div v-else :id="nodeData.id" class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div v-if="!props.isModal" class="ml-[4px] text-[var(--color-text-4)]" <div v-if="!props.isModal" class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]"
>({{ modulesCount[nodeData.id] || 0 }})</div >({{ modulesCount[nodeData.id] || 0 }})</div
> >
</div> </div>

View File

@ -48,7 +48,9 @@
<template #title="nodeData"> <template #title="nodeData">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div class="ml-[4px] text-[var(--color-text-4)]">({{ moduleCountMap[nodeData.id] || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]"
>({{ moduleCountMap[nodeData.id] || 0 }})</div
>
</div> </div>
</template> </template>
</MsTree> </MsTree>

View File

@ -30,7 +30,7 @@
<template #title="nodeData"> <template #title="nodeData">
<div :id="nodeData.id" class="inline-flex w-full"> <div :id="nodeData.id" class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div>
</div> </div>
</template> </template>
</MsTree> </MsTree>

View File

@ -46,7 +46,7 @@
<template #title="nodeData"> <template #title="nodeData">
<div :id="nodeData.id" class="inline-flex w-full"> <div :id="nodeData.id" class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div>
</div> </div>
</template> </template>
</MsTree> </MsTree>

View File

@ -445,25 +445,32 @@
emit('submit'); emit('submit');
} }
const tabList = [
{
value: 'detail',
label: t('bugManagement.detail.detail'),
},
{
value: 'case',
label: t('bugManagement.detail.case'),
},
{
value: 'comment',
label: t('bugManagement.detail.comment'),
},
{
value: 'history',
label: t('bugManagement.detail.changeHistory'),
},
];
/**
* 如果模块没有开启用例管理
*/
const contentTabList = computed(() => { const contentTabList = computed(() => {
return [ return appStore.currentMenuConfig.includes('caseManagement')
{ ? tabList
value: 'detail', : tabList.filter((item) => item.value !== 'case');
label: t('bugManagement.detail.detail'),
},
{
value: 'case',
label: t('bugManagement.detail.case'),
},
{
value: 'comment',
label: t('bugManagement.detail.comment'),
},
{
value: 'history',
label: t('bugManagement.detail.changeHistory'),
},
];
}); });
function updateHandler() { function updateHandler() {
@ -784,7 +791,6 @@
// width: 100%; // width: 100%;
// word-wrap: break-word; // word-wrap: break-word;
//} //}
:deep(.arco-form-item-content) { :deep(.arco-form-item-content) {
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }

View File

@ -1,5 +1,5 @@
<template> <template>
<a-spin class="w-full" :style="{ height: `calc(100vh - 346px)` }" :loading="loading"> <a-spin class="min-h-[400px] w-full" :loading="loading">
<MsTree <MsTree
v-model:focus-node-key="focusNodeKey" v-model:focus-node-key="focusNodeKey"
:selected-keys="props.selectedKeys" :selected-keys="props.selectedKeys"
@ -26,7 +26,9 @@
<template #title="nodeData"> <template #title="nodeData">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div v-if="!props.isModal" class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div v-if="!props.isModal" class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]"
>({{ nodeData.count || 0 }})</div
>
</div> </div>
</template> </template>
<template v-if="!props.isModal" #extra="nodeData"> <template v-if="!props.isModal" #extra="nodeData">
@ -343,7 +345,7 @@
}; };
} }
return { return {
height: 'calc(100vh - 325px)', height: 'calc(100vh - 335px)',
threshold: 200, threshold: 200,
fixedSize: true, fixedSize: true,
buffer: 15, buffer: 15,

View File

@ -52,7 +52,9 @@
<template #title="nodeData"> <template #title="nodeData">
<div class="inline-flex w-full" @click="setFocusKey(nodeData)"> <div class="inline-flex w-full" @click="setFocusKey(nodeData)">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]"
>({{ nodeData.count || 0 }})</div
>
</div> </div>
</template> </template>
</MsTree> </MsTree>

View File

@ -50,7 +50,7 @@
@click="setFocusKey(nodeData)" @click="setFocusKey(nodeData)"
>{{ nodeData.name }}</div >{{ nodeData.name }}</div
> >
<div class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div>
</div> </div>
</template> </template>
</MsTree> </MsTree>

View File

@ -78,7 +78,7 @@
</div> </div>
<div class="flex-1"> <div class="flex-1">
<a-divider class="!my-0 !mb-0" /> <a-divider class="!my-0 !mb-0" />
<div class="case"> <div class="case mt-2">
<div <div
class="flex items-center px-[20px]" class="flex items-center px-[20px]"
:class="getActiveClass('recycle')" :class="getActiveClass('recycle')"

View File

@ -38,7 +38,7 @@
<template #title="nodeData"> <template #title="nodeData">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div>
</div> </div>
</template> </template>
</MsTree> </MsTree>

View File

@ -59,7 +59,9 @@
<template #title="nodeData"> <template #title="nodeData">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div v-if="!props.isModal" class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div v-if="!props.isModal" class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]"
>({{ nodeData.count || 0 }})</div
>
</div> </div>
</template> </template>
<template v-if="!props.isModal" #extra="nodeData"> <template v-if="!props.isModal" #extra="nodeData">

View File

@ -33,7 +33,9 @@
<template #title="nodeData"> <template #title="nodeData">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<div class="one-line-text text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div v-if="!props.isModal" class="ml-auto text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div v-if="!props.isModal" class="ms-tree-node-count ml-auto text-[var(--color-text-4)]"
>({{ nodeData.count || 0 }})</div
>
</div> </div>
</template> </template>
<template v-if="!props.isModal" #extra="nodeData"> <template v-if="!props.isModal" #extra="nodeData">

View File

@ -32,7 +32,9 @@
<template #title="nodeData"> <template #title="nodeData">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div> <div class="one-line-text w-[calc(100%-32px)] text-[var(--color-text-1)]">{{ nodeData.name }}</div>
<div v-if="!props.isModal" class="ml-[4px] text-[var(--color-text-4)]">({{ nodeData.count || 0 }})</div> <div v-if="!props.isModal" class="ms-tree-node-count ml-[4px] text-[var(--color-text-4)]"
>({{ nodeData.count || 0 }})</div
>
</div> </div>
</template> </template>
<template v-if="!props.isModal" #extra="nodeData"> <template v-if="!props.isModal" #extra="nodeData">