diff --git a/frontend/src/api/modules/project-management/taskCenter.ts b/frontend/src/api/modules/project-management/taskCenter.ts index 85f7da61c7..7361f41428 100644 --- a/frontend/src/api/modules/project-management/taskCenter.ts +++ b/frontend/src/api/modules/project-management/taskCenter.ts @@ -14,6 +14,7 @@ import { taskOrgRealCenterListUrl, taskProRealCenterListUrl, taskSysRealCenterListUrl, + updateRunRulesUrl, } from '@/api/requrls/project-management/taskCenter'; import type { CommonList, TableQueryParams } from '@/models/common'; @@ -75,4 +76,7 @@ export function deleteScheduleSysTask(id: string) { export function switchSchedule(id: string) { return MSR.get({ url: `${enableSchedule}/${id}` }); } +export function updateRunRules(id: string, data: string) { + return MSR.get({ url: `${updateRunRulesUrl}/${id}`, data }); +} export default {}; diff --git a/frontend/src/api/requrls/project-management/taskCenter.ts b/frontend/src/api/requrls/project-management/taskCenter.ts index bcea69da22..8c84725f31 100644 --- a/frontend/src/api/requrls/project-management/taskCenter.ts +++ b/frontend/src/api/requrls/project-management/taskCenter.ts @@ -36,3 +36,5 @@ export const stopRealSysApiUrl = '/task/center/api/system/stop'; export const stopRealOrdApiUrl = '/task/center/api/org/stop'; // 停止单个任务(项目) export const stopRealProjectApiUrl = '/task/center/api/project/stop'; +// 更新定时任务运行规则 +export const updateRunRulesUrl = '/task/center/schedule/update'; diff --git a/frontend/src/views/api-test/management/components/import.vue b/frontend/src/views/api-test/management/components/import.vue index 3e3e0fcc3d..fbf35c2ce6 100644 --- a/frontend/src/views/api-test/management/components/import.vue +++ b/frontend/src/views/api-test/management/components/import.vue @@ -432,7 +432,7 @@ }); const moduleTree = computed(() => mapTree(props.moduleTree, (node) => ({ ...node, draggable: false }))); const syncFrequencyOptions = [ - { label: t('apiTestManagement.timeTaskHour'), value: '0 0 0/1 * * ? ' }, + { label: t('apiTestManagement.timeTaskHour'), value: '0 0 0/1 * * ?' }, { label: t('apiTestManagement.timeTaskSixHour'), value: '0 0 0/6 * * ?' }, { label: t('apiTestManagement.timeTaskTwelveHour'), value: '0 0 0/12 * * ?' }, { label: t('apiTestManagement.timeTaskDay'), value: '0 0 0 * * ?' }, diff --git a/frontend/src/views/api-test/report/component/step/stepTree.vue b/frontend/src/views/api-test/report/component/step/stepTree.vue index 4e0e46d9ab..46ea0db669 100644 --- a/frontend/src/views/api-test/report/component/step/stepTree.vue +++ b/frontend/src/views/api-test/report/component/step/stepTree.vue @@ -49,10 +49,7 @@ v-if="!(step.children && step.children.length && showApiType.includes(step.stepType))" class="flex cursor-pointer items-center gap-[2px] text-[var(--color-text-4)]" > - + {{ step.children?.length || 0 }} diff --git a/frontend/src/views/api-test/report/component/tiledList.vue b/frontend/src/views/api-test/report/component/tiledList.vue index 139b082579..d034e74920 100644 --- a/frontend/src/views/api-test/report/component/tiledList.vue +++ b/frontend/src/views/api-test/report/component/tiledList.vue @@ -40,6 +40,7 @@ import StepTree from './step/stepTree.vue'; import type { ReportDetail, ScenarioItemType } from '@/models/apiTest/report'; + import { ScenarioStepType } from '@/enums/apiEnum'; import { addFoldField } from '../utils'; @@ -89,6 +90,12 @@ }, { deep: true, immediate: true } ); + const showApiType = ref([ + ScenarioStepType.API, + ScenarioStepType.API_CASE, + ScenarioStepType.CUSTOM_REQUEST, + ScenarioStepType.SCRIPT, + ]); function searchStep() { const splitLevel = props.keyWords.split('-'); @@ -97,20 +104,32 @@ const search = (_data: ScenarioItemType[]) => { const result: ScenarioItemType[] = []; _data.forEach((item) => { + const isStepChildren = item.children && item?.children.length && showApiType.value.includes(item.stepType); if ( stepType.includes(item.stepType) && ((item.status && item.status === stepTypeStatus && stepTypeStatus !== 'scriptIdentifier') || (stepTypeStatus.includes('scriptIdentifier') && item.scriptIdentifier)) ) { - result.push({ ...item, expanded: true }); + const resItem = { + ...item, + expanded: false, + stepChildren: isStepChildren ? cloneDeep(item.children) : [], + children: isStepChildren ? [] : item.children, + }; + result.push(resItem); } else if (item.children) { const filterData = search(item.children); if (filterData.length) { - result.push({ + const filterItem = { ...item, - expanded: true, + expanded: false, children: filterData, - }); + }; + if (isStepChildren) { + filterItem.stepChildren = cloneDeep(item.children); + filterItem.children = []; + } + result.push(filterItem); } } }); diff --git a/frontend/src/views/api-test/scenario/components/scenarioTable.vue b/frontend/src/views/api-test/scenario/components/scenarioTable.vue index 2789d7ec52..fec2fc8c5e 100644 --- a/frontend/src/views/api-test/scenario/components/scenarioTable.vue +++ b/frontend/src/views/api-test/scenario/components/scenarioTable.vue @@ -1126,7 +1126,7 @@ const showScheduleModal = ref(false); const syncFrequencyOptions = [ - { label: t('apiTestManagement.timeTaskHour'), value: '0 0 0/1 * * ? ' }, + { label: t('apiTestManagement.timeTaskHour'), value: '0 0 0/1 * * ?' }, { label: t('apiTestManagement.timeTaskSixHour'), value: '0 0 0/6 * * ?' }, { label: t('apiTestManagement.timeTaskTwelveHour'), value: '0 0 0/12 * * ?' }, { label: t('apiTestManagement.timeTaskDay'), value: '0 0 0 * * ?' }, diff --git a/frontend/src/views/project-management/taskCenter/component/apiCase.vue b/frontend/src/views/project-management/taskCenter/component/apiCase.vue index ccb0ee10b2..f96270b379 100644 --- a/frontend/src/views/project-management/taskCenter/component/apiCase.vue +++ b/frontend/src/views/project-management/taskCenter/component/apiCase.vue @@ -4,7 +4,7 @@ {{ t('project.taskCenter.apiCaseList', { type: props.name }) }} - - {{ record.resourceId }} + + {{ record.resourceNum }} {{ t('project.taskCenter.viewReport') }} - --> - {{ record.resourceNum }} + {{ record.resourceNum }} - {{ record.resourceName }} + {{ record.resourceName }} + + + {{ t(resourceTypeMap[record.resourceType].label) }} + + + changeRunRules(record)" + > + + {{ item.value }} + {{ item.label }} + + + - + diff --git a/frontend/src/views/project-management/taskCenter/component/utils.ts b/frontend/src/views/project-management/taskCenter/component/utils.ts index 42825d34c4..221d0522c5 100644 --- a/frontend/src/views/project-management/taskCenter/component/utils.ts +++ b/frontend/src/views/project-management/taskCenter/component/utils.ts @@ -146,4 +146,27 @@ export const TaskStatus = { }, }; +export const resourceTypeMap = { + [TaskCenterEnum.API_CASE]: { + value: TaskCenterEnum.API_CASE, + label: 'project.taskCenter.interfaceCase', + }, + [TaskCenterEnum.API_SCENARIO]: { + value: TaskCenterEnum.API_SCENARIO, + label: 'project.taskCenter.apiScenario', + }, + [TaskCenterEnum.UI_TEST]: { + value: TaskCenterEnum.UI_TEST, + label: 'project.taskCenter.uiDefaultFile', + }, + [TaskCenterEnum.LOAD_TEST]: { + value: TaskCenterEnum.LOAD_TEST, + label: 'project.taskCenter.performanceTest', + }, + [TaskCenterEnum.TEST_PLAN]: { + value: TaskCenterEnum.TEST_PLAN, + label: 'project.taskCenter.testPlan', + }, +}; + export default {};