fix: 修改任务中心隔离筛选条件&报告筛选错误&脚本样式微调
This commit is contained in:
parent
dfe1d66e62
commit
09f7bea6cf
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-row justify-between">
|
<div class="flex flex-row items-center justify-between">
|
||||||
<slot name="left"></slot>
|
<slot name="left"></slot>
|
||||||
<div class="flex flex-row gap-[8px]">
|
<div class="flex flex-row gap-[8px]">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
|
|
|
@ -98,8 +98,9 @@
|
||||||
const result: ScenarioItemType[] = [];
|
const result: ScenarioItemType[] = [];
|
||||||
_data.forEach((item) => {
|
_data.forEach((item) => {
|
||||||
if (
|
if (
|
||||||
(stepType.includes(item.stepType) && item.status && item.status.includes(stepTypeStatus)) ||
|
stepType.includes(item.stepType) &&
|
||||||
(stepTypeStatus && stepTypeStatus.includes('scriptIdentifier') && item.scriptIdentifier)
|
((item.status && item.status === stepTypeStatus && stepTypeStatus !== 'scriptIdentifier') ||
|
||||||
|
(stepTypeStatus.includes('scriptIdentifier') && item.scriptIdentifier))
|
||||||
) {
|
) {
|
||||||
result.push({ ...item, expanded: true });
|
result.push({ ...item, expanded: true });
|
||||||
} else if (item.children) {
|
} else if (item.children) {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
<span class="text-[var(--color-text-4)]"> ({{ props.modulesCount[props.activeFolder] || 0 }})</span>
|
<span class="text-[var(--color-text-4)]"> ({{ props.modulesCount[props.activeFolder] || 0 }})</span>
|
||||||
</div>
|
</div>
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="text-[14px] font-medium text-[var(--color-text-1)]">
|
<div class="max-w-[400px] text-[14px] font-medium text-[var(--color-text-1)]">
|
||||||
{{ moduleNamePath }}
|
{{ moduleNamePath }}
|
||||||
<span class="text-[var(--color-text-4)]">({{ props.modulesCount[props.activeFolder] || 0 }})</span>
|
<span class="text-[var(--color-text-4)]">({{ props.modulesCount[props.activeFolder] || 0 }})</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
</MsButton>
|
</MsButton>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<a-radio-group v-model="showType" type="button" size="small">
|
<a-radio-group v-model="showType" type="button">
|
||||||
<a-radio value="detail">{{ t('project.commonScript.detail') }}</a-radio>
|
<a-radio value="detail">{{ t('project.commonScript.detail') }}</a-radio>
|
||||||
<a-radio value="changeHistory">{{ t('project.commonScript.changeHistory') }}</a-radio>
|
<a-radio value="changeHistory">{{ t('project.commonScript.changeHistory') }}</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="label">{{ t('project.commonScript.tags') }}</span>
|
<span class="label">{{ t('project.commonScript.tags') }}</span>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
<MsTag v-for="tag of form.tags" :key="tag" theme="outline">{{ tag }}</MsTag>
|
<MsTag v-for="tag of form.tags" :key="tag" class="mb-2" theme="outline">{{ tag }}</MsTag>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -381,7 +381,7 @@
|
||||||
.label {
|
.label {
|
||||||
width: 56px;
|
width: 56px;
|
||||||
color: var(--color-text-3);
|
color: var(--color-text-3);
|
||||||
@apply mr-2;
|
@apply mr-2 flex-shrink-0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
v-on="propsEvent"
|
v-on="propsEvent"
|
||||||
@batch-action="handleTableBatch"
|
@batch-action="handleTableBatch"
|
||||||
>
|
>
|
||||||
|
<template #resourceId="{ record }">
|
||||||
|
<div type="text" class="one-line-text flex w-full">{{ record.resourceId }}</div>
|
||||||
|
</template>
|
||||||
<template #statusFilter="{ columnConfig }">
|
<template #statusFilter="{ columnConfig }">
|
||||||
<a-trigger
|
<a-trigger
|
||||||
v-model:popup-visible="statusFilterVisible"
|
v-model:popup-visible="statusFilterVisible"
|
||||||
|
@ -34,12 +37,24 @@
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="arco-table-filters-content">
|
<div class="arco-table-filters-content">
|
||||||
<div class="flex items-center justify-center px-[6px] py-[2px]">
|
<div class="flex items-center justify-center px-[6px] py-[2px]">
|
||||||
<a-checkbox-group v-model:model-value="statusListFilters" direction="vertical" size="small">
|
<a-checkbox-group
|
||||||
|
v-model:model-value="statusFiltersMap[props.moduleType]"
|
||||||
|
direction="vertical"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<a-checkbox v-for="key of statusFilters" :key="key" :value="key">
|
<a-checkbox v-for="key of statusFilters" :key="key" :value="key">
|
||||||
<ExecutionStatus :module-type="props.moduleType" :status="key" />
|
<ExecutionStatus :module-type="props.moduleType" :status="key" />
|
||||||
</a-checkbox>
|
</a-checkbox>
|
||||||
</a-checkbox-group>
|
</a-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="arco-table-filters-bottom">
|
||||||
|
<a-button size="mini" type="secondary" @click="handleFilterReset">
|
||||||
|
{{ t('common.reset') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button size="mini" type="primary" @click="handleFilterSubmit()">
|
||||||
|
{{ t('common.confirm') }}
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</a-trigger>
|
</a-trigger>
|
||||||
|
@ -50,6 +65,19 @@
|
||||||
<template #triggerMode="{ record }">
|
<template #triggerMode="{ record }">
|
||||||
<span>{{ t(ExecutionMethodsLabel[record.triggerMode]) }}</span>
|
<span>{{ t(ExecutionMethodsLabel[record.triggerMode]) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #triggerModeFilter="{ columnConfig }">
|
||||||
|
<TableFilter
|
||||||
|
v-model:visible="triggerModeVisible"
|
||||||
|
v-model:status-filters="triggerModeFiltersMap[props.moduleType]"
|
||||||
|
:title="(columnConfig.title as string)"
|
||||||
|
:list="triggerModeList"
|
||||||
|
@search="initData()"
|
||||||
|
>
|
||||||
|
<template #item="{ item }">
|
||||||
|
{{ item.label }}
|
||||||
|
</template>
|
||||||
|
</TableFilter>
|
||||||
|
</template>
|
||||||
<template #operationTime="{ record }">
|
<template #operationTime="{ record }">
|
||||||
<span>{{ dayjs(record.operationTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
<span>{{ dayjs(record.operationTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -91,6 +119,7 @@
|
||||||
import ExecutionStatus from './executionStatus.vue';
|
import ExecutionStatus from './executionStatus.vue';
|
||||||
import caseAndScenarioReportDrawer from '@/views/api-test/components/caseAndScenarioReportDrawer.vue';
|
import caseAndScenarioReportDrawer from '@/views/api-test/components/caseAndScenarioReportDrawer.vue';
|
||||||
import ReportDetailDrawer from '@/views/api-test/report/component/reportDetailDrawer.vue';
|
import ReportDetailDrawer from '@/views/api-test/report/component/reportDetailDrawer.vue';
|
||||||
|
import TableFilter from '@/views/case-management/caseManagementFeature/components/tableFilter.vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
batchStopRealOrdApi,
|
batchStopRealOrdApi,
|
||||||
|
@ -105,16 +134,19 @@
|
||||||
} from '@/api/modules/project-management/taskCenter';
|
} from '@/api/modules/project-management/taskCenter';
|
||||||
import { useI18n } from '@/hooks/useI18n';
|
import { useI18n } from '@/hooks/useI18n';
|
||||||
import useModal from '@/hooks/useModal';
|
import useModal from '@/hooks/useModal';
|
||||||
|
import useOpenNewPage from '@/hooks/useOpenNewPage';
|
||||||
import { useTableStore } from '@/store';
|
import { useTableStore } from '@/store';
|
||||||
import { characterLimit } from '@/utils';
|
import { characterLimit } from '@/utils';
|
||||||
import { hasAnyPermission } from '@/utils/permission';
|
import { hasAnyPermission } from '@/utils/permission';
|
||||||
|
|
||||||
import { BatchApiParams } from '@/models/common';
|
import { BatchApiParams } from '@/models/common';
|
||||||
|
import { RouteEnum } from '@/enums/routeEnum';
|
||||||
import { TableKeyEnum } from '@/enums/tableEnum';
|
import { TableKeyEnum } from '@/enums/tableEnum';
|
||||||
import { ExecutionMethodsLabel, TaskCenterEnum } from '@/enums/taskCenter';
|
import { ExecutionMethodsLabel, TaskCenterEnum } from '@/enums/taskCenter';
|
||||||
|
|
||||||
import { TaskStatus } from './utils';
|
import { TaskStatus } from './utils';
|
||||||
|
|
||||||
|
const { openNewPage } = useOpenNewPage();
|
||||||
const tableStore = useTableStore();
|
const tableStore = useTableStore();
|
||||||
|
|
||||||
const { openModal } = useModal();
|
const { openModal } = useModal();
|
||||||
|
@ -127,7 +159,6 @@
|
||||||
}>();
|
}>();
|
||||||
const keyword = ref<string>('');
|
const keyword = ref<string>('');
|
||||||
const statusFilterVisible = ref(false);
|
const statusFilterVisible = ref(false);
|
||||||
const statusListFilters = ref<string[]>([]);
|
|
||||||
|
|
||||||
const permissionsMap = {
|
const permissionsMap = {
|
||||||
organization: {
|
organization: {
|
||||||
|
@ -165,15 +196,15 @@
|
||||||
dataIndex: 'resourceId',
|
dataIndex: 'resourceId',
|
||||||
slotName: 'resourceId',
|
slotName: 'resourceId',
|
||||||
width: 200,
|
width: 200,
|
||||||
showInTable: true,
|
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
|
showDrag: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'project.taskCenter.resourceName',
|
title: 'project.taskCenter.resourceName',
|
||||||
slotName: 'resourceName',
|
slotName: 'resourceName',
|
||||||
dataIndex: 'resourceName',
|
dataIndex: 'resourceName',
|
||||||
width: 300,
|
width: 300,
|
||||||
showDrag: true,
|
showDrag: false,
|
||||||
showTooltip: true,
|
showTooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -181,6 +212,10 @@
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
slotName: 'status',
|
slotName: 'status',
|
||||||
titleSlotName: 'statusFilter',
|
titleSlotName: 'statusFilter',
|
||||||
|
sortable: {
|
||||||
|
sortDirections: ['ascend', 'descend'],
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
showInTable: true,
|
showInTable: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
showDrag: true,
|
showDrag: true,
|
||||||
|
@ -189,6 +224,7 @@
|
||||||
title: 'project.taskCenter.executionMode',
|
title: 'project.taskCenter.executionMode',
|
||||||
dataIndex: 'triggerMode',
|
dataIndex: 'triggerMode',
|
||||||
slotName: 'triggerMode',
|
slotName: 'triggerMode',
|
||||||
|
titleSlotName: 'triggerModeFilter',
|
||||||
showInTable: true,
|
showInTable: true,
|
||||||
width: 150,
|
width: 150,
|
||||||
showDrag: true,
|
showDrag: true,
|
||||||
|
@ -238,16 +274,64 @@
|
||||||
showSelectAll: true,
|
showSelectAll: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
const triggerModeList = ref([
|
||||||
|
{
|
||||||
|
value: 'SCHEDULE',
|
||||||
|
label: t('project.taskCenter.scheduledTask'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'MANUAL',
|
||||||
|
label: t('project.taskCenter.manualExecution'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'API',
|
||||||
|
label: t('project.taskCenter.interfaceCall'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'BATCH',
|
||||||
|
label: t('project.taskCenter.batchExecution'),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const triggerModeVisible = ref<boolean>(false);
|
||||||
|
const triggerModeApiCase = ref([]);
|
||||||
|
const triggerModeApiScenario = ref([]);
|
||||||
|
|
||||||
|
const triggerModeFiltersMap = ref<Record<string, string[]>>({
|
||||||
|
API_CASE: triggerModeApiCase.value,
|
||||||
|
API_SCENARIO: triggerModeApiScenario.value,
|
||||||
|
});
|
||||||
|
|
||||||
|
const statusFilterApiCase = ref([]);
|
||||||
|
const statusFilterApiScenario = ref([]);
|
||||||
|
|
||||||
|
const statusFiltersMap = ref<Record<string, string[]>>({
|
||||||
|
API_CASE: statusFilterApiCase.value,
|
||||||
|
API_SCENARIO: statusFilterApiScenario.value,
|
||||||
|
});
|
||||||
|
|
||||||
function initData() {
|
function initData() {
|
||||||
setLoadListParams({
|
setLoadListParams({
|
||||||
keyword: keyword.value,
|
keyword: keyword.value,
|
||||||
moduleType: props.moduleType,
|
moduleType: props.moduleType,
|
||||||
filter: { status: statusListFilters.value },
|
filter: {
|
||||||
|
status: statusFiltersMap.value[props.moduleType],
|
||||||
|
triggerMode: triggerModeFiltersMap.value[props.moduleType],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
loadList();
|
loadList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleFilterReset() {
|
||||||
|
statusFiltersMap.value[props.moduleType] = [];
|
||||||
|
statusFilterVisible.value = false;
|
||||||
|
initData();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleFilterSubmit() {
|
||||||
|
statusFilterVisible.value = false;
|
||||||
|
initData();
|
||||||
|
}
|
||||||
|
|
||||||
const tableBatchActions = {
|
const tableBatchActions = {
|
||||||
baseAction: [
|
baseAction: [
|
||||||
{
|
{
|
||||||
|
@ -374,6 +458,22 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
/**
|
||||||
|
* 跳转接口用例详情 TODO 后台要加字段 加了字段再处理
|
||||||
|
*/
|
||||||
|
|
||||||
|
function showDetail(id: string) {
|
||||||
|
if (props.moduleType === 'API_CASE') {
|
||||||
|
openNewPage(RouteEnum.API_TEST_MANAGEMENT, {
|
||||||
|
cId: id,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
openNewPage(RouteEnum.API_TEST_MANAGEMENT, {
|
||||||
|
dId: id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await tableStore.initColumn(TableKeyEnum.TASK_API_CASE, columns, 'drawer', true);
|
await tableStore.initColumn(TableKeyEnum.TASK_API_CASE, columns, 'drawer', true);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue