Skip to content

Commit

Permalink
fix: 修改优先级中和低的bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
fit2cloudwxx authored and fit2-zhao committed May 24, 2024
1 parent 4e2b49a commit 5cca0ba
Show file tree
Hide file tree
Showing 21 changed files with 201 additions and 128 deletions.
17 changes: 16 additions & 1 deletion frontend/src/components/business/ms-case-associate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
no-disable
class="mt-[16px]"
v-on="propsEvent"
@filter-change="filterChange"
>
<template #num="{ record }">
<a-tooltip :content="`${record.num}`">
Expand All @@ -149,6 +150,10 @@
<ExecuteStatusTag v-if="record.lastExecuteResult" :execute-result="record.lastExecuteResult" />
<span v-else>-</span>
</template>
<!-- 用例等级 -->
<template #[FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL]="{ filterContent }">
<caseLevel :case-level="filterContent.value" />
</template>
<!-- 评审结果 -->
<template #reviewStatus="{ record }">
<MsIcon
Expand Down Expand Up @@ -219,6 +224,7 @@
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
import { initGetModuleCountFunc, type RequestModuleEnum } from './utils';
import { casePriorityOptions } from '@/views/api-test/components/config';
import { executionResultMap, statusIconMap } from '@/views/case-management/caseManagementFeature/components/utils';
const router = useRouter();
Expand Down Expand Up @@ -385,7 +391,11 @@
title: 'ms.case.associate.caseLevel',
dataIndex: 'caseLevel',
slotName: 'caseLevel',
width: 90,
width: 150,
filterConfig: {
options: casePriorityOptions,
filterSlotName: FilterSlotNameEnum.CASE_MANAGEMENT_CASE_LEVEL,
},
},
];
}
Expand Down Expand Up @@ -676,6 +686,7 @@
sourceType: caseType.value,
...props.tableParams,
...props.moduleCountParams,
filter: propsRes.value.filter,
};
modulesCount.value = await initGetModuleCountFunc(props.type, params);
} catch (error) {
Expand Down Expand Up @@ -814,6 +825,10 @@
}
);
function filterChange() {
initModuleCount();
}
defineExpose({
initModules,
});
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/pure/ms-table-more-action/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
<slot>
<div :class="['ms-more-action-trigger-content', visible ? 'ms-more-action-trigger-content--focus' : '']">
<MsButton type="text" size="mini" class="more-icon-btn" @click="visible = !visible">
<MsButton v-if="isHasAllPermission" type="text" size="mini" class="more-icon-btn" @click="visible = !visible">
<MsIcon type="icon-icon_more_outlined" size="16" class="text-[var(--color-text-4)]" />
</MsButton>
</div>
Expand Down Expand Up @@ -91,6 +91,11 @@
return result;
});
// 判断是否有所有权限
const isHasAllPermission = computed(() => {
return props.list.some((item: ActionsItem) => hasAnyPermission(item.permission || []));
});
function selectHandler(value: SelectedValue) {
const item = props.list.find((e: ActionsItem) => e.eventTag === value);
emit('select', item);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/router/routes/modules/testPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const TestPlan: AppRouteRecordRaw = {
},
{
name: TestPlanRouteEnum.TEST_PLAN_REPORT_DETAIL,
locale: 'menu.testPlan.testPlanDetail',
locale: 'menu.apiTest.reportDetail',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
@change="changeHandler"
@module-change="initData"
@cell-click="handleCellClick"
@filter-change="filterChange"
>
<template #num="{ record }">
<span type="text" class="one-line-text cursor-pointer px-0 text-[rgb(var(--primary-5))]">
Expand Down Expand Up @@ -885,6 +886,7 @@
...tableParams,
current: propsRes.value.msPagination?.current,
pageSize: propsRes.value.msPagination?.pageSize,
filter: propsRes.value.filter,
});
}
Expand Down Expand Up @@ -1466,6 +1468,10 @@
}
});
function filterChange() {
emitTableParams();
}
onMounted(async () => {
if (route.query.id) {
showCaseDetail(route.query.id as string, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<a-form ref="formRef" :model="form" layout="vertical">
<a-form-item
field="title"
asterisk-position="end"
:label="t('bugManagement.bugName')"
:rules="[{ required: true, message: t('bugManagement.edit.nameIsRequired') }]"
:placeholder="t('bugManagement.edit.pleaseInputBugName')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
<span type="text" class="one-line-text cursor-pointer px-0 text-[rgb(var(--primary-5))]">{{ record.num }}</span>
</template>
<template #name="{ record }">
<div class="one-line-text flex max-w-[150px] flex-nowrap items-center"> {{ characterLimit(record.name) }}</div>
<a-popover title="" position="right" style="width: 480px">
<div class="ml-1 text-[rgb(var(--primary-5))]">{{ t('caseManagement.featureCase.preview') }}</div>
<template #content>
<div v-dompurify-html="record.content" class="markdown-body" style="margin-left: 48px"> </div>
</template>
</a-popover>
<div class="flex flex-nowrap items-center">
<div class="one-line-text max-w-[200px] flex-auto items-center"> {{ characterLimit(record.name) }}</div>
<a-popover class="bug-content-popover" title="" position="right" style="width: 480px">
<span class="ml-1 text-[rgb(var(--primary-5))]">{{ t('caseManagement.featureCase.preview') }}</span>
<template #content>
<div v-dompurify-html="record.content" class="markdown-body bug-content"> </div>
</template>
</a-popover>
</div>
</template>
<template #statusName="{ record }">
<div class="one-line-text">{{ record.statusName || '-' }}</div>
Expand Down Expand Up @@ -149,4 +151,12 @@
});
</script>

<style scoped></style>
<style lang="less">
.bug-content-popover {
.arco-popover-content {
overflow: auto;
max-height: 400px;
.ms-scroll-bar();
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@
v-on="propsEvent"
>
<template #name="{ record }">
<span class="one-line-text max-w-[300px]"> {{ record.name }}</span>
<a-popover title="" position="right" style="width: 480px">
<span class="ml-1 text-[rgb(var(--primary-5))]">{{ t('caseManagement.featureCase.preview') }}</span>
<template #content>
<div v-dompurify-html="record.content" class="markdown-body" style="margin-left: 48px"> </div>
</template>
</a-popover>
<div class="flex flex-nowrap items-center">
<div class="one-line-text max-w-[200px] flex-auto items-center"> {{ characterLimit(record.name) }}</div>
<a-popover class="bug-content-popover" title="" position="right" style="width: 480px">
<div class="ml-1 flex-auto text-[rgb(var(--primary-5))]">{{
t('caseManagement.featureCase.preview')
}}</div>
<template #content>
<div v-dompurify-html="record.content" class="markdown-body"> </div>
</template>
</a-popover>
</div>
</template>
</ms-base-table>
</div>
Expand All @@ -62,6 +66,7 @@
import { getDrawerDebugPage } from '@/api/modules/case-management/featureCase';
import { useI18n } from '@/hooks/useI18n';
import { useAppStore } from '@/store';
import { characterLimit } from '@/utils';
import { TableKeyEnum } from '@/enums/tableEnum';
Expand All @@ -77,7 +82,7 @@
visible: boolean;
caseId: string;
drawerLoading: boolean;
showSelectorAll: boolean;
showSelectorAll?: boolean;
}>(),
{
showSelectorAll: true,
Expand All @@ -101,7 +106,7 @@
dataIndex: 'name',
showInTable: true,
showTooltip: true,
width: 200,
width: 300,
ellipsis: true,
showDrag: false,
},
Expand Down Expand Up @@ -157,6 +162,7 @@
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable(
getDrawerDebugPage,
{
scroll: { x: 'auto' },
columns,
tableKey: TableKeyEnum.CASE_MANAGEMENT_TAB_DEFECT,
selectable: true,
Expand Down Expand Up @@ -229,4 +235,12 @@
);
</script>

<style scoped></style>
<style lang="less">
.bug-content-popover {
.arco-popover-content {
overflow: auto;
max-height: 400px;
.ms-scroll-bar();
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
dataIndex: 'name',
showInTable: true,
showTooltip: false,
width: 250,
width: 300,
ellipsis: true,
showDrag: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
>
<div class="flex items-center justify-between">
<div
><span class="font-medium">{{ getPlatName() }}</span
><span class="font-medium">{{ platName }}</span
><span class="ml-1 text-[var(--color-text-4)]">({{ propsRes?.msPagination?.total || 0 }})</span></div
>
<a-input-search
Expand Down Expand Up @@ -126,6 +126,8 @@
import type { CreateOrUpdateDemand, DemandItem } from '@/models/caseManagement/featureCase';
import { TableKeyEnum } from '@/enums/tableEnum';

import { getPlatName } from '@/views/case-management/caseManagementFeature/components/utils';

const { t } = useI18n();
const appStore = useAppStore();
const currentProjectId = computed(() => appStore.currentProjectId);
Expand Down Expand Up @@ -207,7 +209,7 @@
scroll: { x: '100%' },
heightUsed: 290,
selectable: true,
showSelectorAll: true,
showSelectorAll: false,
showSetting: false,
});

Expand Down Expand Up @@ -411,32 +413,9 @@
initPlatform();
});

// watch(
// () => activeTab.value,
// async (val) => {
// if (val === 'requirement') {
// try {
// const result = await getCaseRelatedInfo(currentProjectId.value);
// if (result && result.platform_key) {
// platformInfo.value = { ...result };
// }
// } catch (error) {
// console.log(error);
// }
// }
// }
// );

function getPlatName() {
switch (platformInfo.value.platform_key) {
case 'zentao':
return t('caseManagement.featureCase.zentao');
case 'jira':
return t('caseManagement.featureCase.jira');
default:
break;
}
}
const platName = computed(() => {
return getPlatName(platformInfo.value.platform_key);
});
</script>

<style scoped></style>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
>
<div class="flex items-center justify-between">
<div
><span class="font-medium">{{ getPlatName() }}</span
><span class="font-medium">{{ platName }}</span
><span class="ml-1 text-[var(--color-text-4)]">({{ propsRes?.msPagination?.total || 0 }})</span></div
>
<a-input-search
Expand Down Expand Up @@ -58,6 +58,8 @@
import type { CreateOrUpdateDemand, DemandItem } from '@/models/caseManagement/featureCase';
import { TableKeyEnum } from '@/enums/tableEnum';

import { getPlatName } from '@/views/case-management/caseManagementFeature/components/utils';

const { t } = useI18n();
const appStore = useAppStore();
const currentProjectId = computed(() => appStore.currentProjectId);
Expand Down Expand Up @@ -138,16 +140,9 @@
return filteredData;
});

function getPlatName() {
switch (props.platformInfo.platform_key) {
case 'zentao':
return t('caseManagement.featureCase.zentao');
case 'jira':
return t('caseManagement.featureCase.jira');
default:
break;
}
}
const platName = computed(() => {
return getPlatName(props.platformInfo.value.platform_key);
});

async function handleDrawerConfirm() {
const demandList = tableSelected.value.map((item) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@
function getParams() {
const steps = stepData.value.map((item, index) => {
return {
id: item.id,
num: index,
desc: item.step,
result: item.expected,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,6 @@ export function initFormCreate(customFields: CustomAttributes[], permission: str
}

export function makeColumns(optionsMap: Record<string, any>, columnData: MsTableColumn) {
// const optionsMap: Record<string, any> = {
// status: statusFilterOptions.value,
// handleUser: handleUserFilterOptions.value,
// };
return columnData.map((e) => {
if (Object.prototype.hasOwnProperty.call(optionsMap, e.dataIndex as string)) {
return {
Expand All @@ -297,3 +293,14 @@ export function makeColumns(optionsMap: Record<string, any>, columnData: MsTable
return { ...e };
});
}

export function getPlatName(platformKey: string) {
switch (platformKey) {
case 'zentao':
return t('caseManagement.featureCase.zentao');
case 'jira':
return t('caseManagement.featureCase.jira');
default:
break;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export default {
'caseManagement.featureCase.sortSuccess': 'Sort successfully',
'caseManagement.featureCase.zentao': 'ZenTao',
'caseManagement.featureCase.jira': 'JIRA',
'caseManagement.featureCase.tapd': 'TAPD',
'caseManagement.featureCase.searchPlaceholder': 'Search by ID, name, or tag',
'caseManagement.featureCase.ModuleOwned': 'Module owned',
'caseManagement.featureCase.excelImportTip': 'Only xls/xlsx files are supported',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ export default {
'caseManagement.featureCase.sortSuccess': '排序成功',
'caseManagement.featureCase.zentao': '禅道',
'caseManagement.featureCase.jira': 'JIRA',
'caseManagement.featureCase.tapd': 'TAPD',
'caseManagement.featureCase.searchPlaceholder': '通过ID、名称或标签搜索',
'caseManagement.featureCase.ModuleOwned': '所属模块',
'caseManagement.featureCase.excelImportTip': '仅支持 xls/xlsx 格式的文件',
Expand Down

0 comments on commit 5cca0ba

Please sign in to comment.