feat(任务中心): 任务中心操作接口调试
This commit is contained in:
parent
474d7e2930
commit
196037b7d4
|
@ -1,153 +0,0 @@
|
|||
import MSR from '@/api/http/index';
|
||||
import {
|
||||
organizationDeleteTaskUrl,
|
||||
organizationExecuteTaskDetailListUrl,
|
||||
organizationExecuteTaskListUrl,
|
||||
organizationExecuteTaskStatisticsUrl,
|
||||
organizationScheduleListUrl,
|
||||
organizationStopTaskUrl,
|
||||
organizationTaskCenterResourcePoolsUrl,
|
||||
projectDeleteTaskUrl,
|
||||
projectExecuteTaskDetailListUrl,
|
||||
projectExecuteTaskListUrl,
|
||||
projectExecuteTaskStatisticsUrl,
|
||||
projectScheduleTaskListUrl,
|
||||
projectStopTaskUrl,
|
||||
projectTaskCenterResourcePoolsUrl,
|
||||
scheduleProCenterListUrl,
|
||||
systemDeleteTaskUrl,
|
||||
systemExecuteTaskDetailListUrl,
|
||||
systemExecuteTaskListUrl,
|
||||
systemExecuteTaskStatisticsUrl,
|
||||
systemResourcePoolStatusUrl,
|
||||
systemScheduleListUrl,
|
||||
systemStopTaskUrl,
|
||||
systemTaskCenterResourcePoolsUrl,
|
||||
} from '@/api/requrls/taskCenter';
|
||||
|
||||
import type { CommonList, TableQueryParams } from '@/models/common';
|
||||
import type { TimingTaskCenterApiCaseItem } from '@/models/projectManagement/taskCenter';
|
||||
import type {
|
||||
TaskCenterResourcePoolItem,
|
||||
TaskCenterResourcePoolStatus,
|
||||
TaskCenterStatisticsItem,
|
||||
TaskCenterSystemTaskItem,
|
||||
TaskCenterTaskDetailItem,
|
||||
TaskCenterTaskDetailParams,
|
||||
TaskCenterTaskItem,
|
||||
} from '@/models/taskCenter';
|
||||
|
||||
// 项目任务-系统后台任务列表
|
||||
export function getProjectScheduleList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterSystemTaskItem>>({ url: projectScheduleTaskListUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-获取任务详情列表
|
||||
export function getProjectExecuteTaskDetailList(data: TaskCenterTaskDetailParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskDetailItem>>({ url: projectExecuteTaskDetailListUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-获取任务列表
|
||||
export function getProjectExecuteTaskList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskItem>>({ url: projectExecuteTaskListUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-获取任务统计
|
||||
export function getProjectExecuteTaskStatistics(data: string[]) {
|
||||
return MSR.post<TaskCenterStatisticsItem[]>({ url: projectExecuteTaskStatisticsUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-获取资源池列表
|
||||
export function getProjectTaskCenterResourcePools() {
|
||||
return MSR.get<TaskCenterResourcePoolItem[]>({ url: projectTaskCenterResourcePoolsUrl });
|
||||
}
|
||||
|
||||
// 项目任务-停止任务
|
||||
export function projectStopTask(id: string) {
|
||||
return MSR.get({ url: `${projectStopTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 项目任务-删除任务
|
||||
export function projectDeleteTask(id: string) {
|
||||
return MSR.get({ url: `${projectDeleteTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 接口测试-定时任务列表
|
||||
export function getScheduleProApiCaseList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TimingTaskCenterApiCaseItem>>({ url: scheduleProCenterListUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-系统后台任务列表
|
||||
export function getSystemScheduleList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterSystemTaskItem>>({ url: systemScheduleListUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-获取任务详情列表
|
||||
export function getSystemExecuteTaskDetailList(data: TaskCenterTaskDetailParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskDetailItem>>({ url: systemExecuteTaskDetailListUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-获取任务列表
|
||||
export function getSystemExecuteTaskList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskItem>>({ url: systemExecuteTaskListUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-获取任务统计
|
||||
export function getSystemExecuteTaskStatistics(data: string[]) {
|
||||
return MSR.post<TaskCenterStatisticsItem[]>({ url: systemExecuteTaskStatisticsUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-获取资源池列表
|
||||
export function getSystemTaskCenterResourcePools() {
|
||||
return MSR.get<TaskCenterResourcePoolItem[]>({ url: systemTaskCenterResourcePoolsUrl });
|
||||
}
|
||||
|
||||
// 系统任务-停止任务
|
||||
export function systemStopTask(id: string) {
|
||||
return MSR.get({ url: `${systemStopTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 系统任务-删除任务
|
||||
export function systemDeleteTask(id: string) {
|
||||
return MSR.get({ url: `${systemDeleteTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 任务中心-资源池状态
|
||||
export function getResourcePoolsStatus(data: string[]) {
|
||||
return MSR.post<TaskCenterResourcePoolStatus[]>({ url: systemResourcePoolStatusUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-系统后台任务列表
|
||||
export function getOrganizationScheduleList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterSystemTaskItem>>({ url: organizationScheduleListUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-获取任务详情列表
|
||||
export function getOrganizationExecuteTaskDetailList(data: TaskCenterTaskDetailParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskDetailItem>>({ url: organizationExecuteTaskDetailListUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-获取任务列表
|
||||
export function getOrganizationExecuteTaskList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskItem>>({ url: organizationExecuteTaskListUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-获取任务统计
|
||||
export function getOrganizationExecuteTaskStatistics(data: string[]) {
|
||||
return MSR.post<TaskCenterStatisticsItem[]>({ url: organizationExecuteTaskStatisticsUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-获取资源池列表
|
||||
export function getOrgTaskCenterResourcePools() {
|
||||
return MSR.get<TaskCenterResourcePoolItem[]>({ url: organizationTaskCenterResourcePoolsUrl });
|
||||
}
|
||||
|
||||
// 组织任务-停止任务
|
||||
export function organizationStopTask(id: string) {
|
||||
return MSR.get({ url: `${organizationStopTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 组织任务-删除任务
|
||||
export function organizationDeleteTask(id: string) {
|
||||
return MSR.get({ url: `${organizationDeleteTaskUrl}/${id}` });
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
import MSR from '@/api/http/index';
|
||||
import {
|
||||
organizationBatchCloseTaskUrl,
|
||||
organizationBatchDeleteTaskUrl,
|
||||
organizationBatchOpenTaskUrl,
|
||||
organizationBatchStopTaskDetailUrl,
|
||||
organizationBatchStopTaskUrl,
|
||||
organizationDeleteScheduleUrl,
|
||||
organizationDeleteTaskUrl,
|
||||
organizationExecuteTaskDetailListUrl,
|
||||
organizationExecuteTaskListUrl,
|
||||
organizationExecuteTaskStatisticsUrl,
|
||||
organizationScheduleListUrl,
|
||||
organizationScheduleSwitchUrl,
|
||||
organizationStopTaskDetailUrl,
|
||||
organizationStopTaskUrl,
|
||||
organizationTaskCenterResourcePoolsUrl,
|
||||
organizationTaskOrderUrl,
|
||||
} from '@/api/requrls/taskCenter';
|
||||
|
||||
import type { CommonList, TableQueryParams } from '@/models/common';
|
||||
import type {
|
||||
TaskCenterBatchParams,
|
||||
TaskCenterResourcePoolItem,
|
||||
TaskCenterStatisticsItem,
|
||||
TaskCenterSystemTaskItem,
|
||||
TaskCenterTaskDetailItem,
|
||||
TaskCenterTaskItem,
|
||||
} from '@/models/taskCenter';
|
||||
|
||||
// 组织任务-系统后台任务列表
|
||||
export function getOrganizationScheduleList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterSystemTaskItem>>({ url: organizationScheduleListUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-获取任务详情列表
|
||||
export function getOrganizationExecuteTaskDetailList(data: TaskCenterBatchParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskDetailItem>>({ url: organizationExecuteTaskDetailListUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-获取任务列表
|
||||
export function getOrganizationExecuteTaskList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskItem>>({ url: organizationExecuteTaskListUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-获取任务统计
|
||||
export function getOrganizationExecuteTaskStatistics(data: string[]) {
|
||||
return MSR.post<TaskCenterStatisticsItem[]>({ url: organizationExecuteTaskStatisticsUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-获取资源池列表
|
||||
export function getOrgTaskCenterResourcePools() {
|
||||
return MSR.get<TaskCenterResourcePoolItem[]>({ url: organizationTaskCenterResourcePoolsUrl });
|
||||
}
|
||||
|
||||
// 组织任务-停止任务
|
||||
export function organizationStopTask(id: string) {
|
||||
return MSR.get({ url: `${organizationStopTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 组织任务-删除任务
|
||||
export function organizationDeleteTask(id: string) {
|
||||
return MSR.get({ url: `${organizationDeleteTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 组织任务-开启/关闭任务
|
||||
export function organizationScheduleSwitch(id: string) {
|
||||
return MSR.get({ url: `${organizationScheduleSwitchUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 组织任务-任务排队信息
|
||||
export function organizationTaskOrder(data: string[]) {
|
||||
return MSR.post<Record<string, any>>({ url: organizationTaskOrderUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-批量停止任务
|
||||
export function organizationBatchStopTask(data: TaskCenterBatchParams) {
|
||||
return MSR.get({ url: organizationBatchStopTaskUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-用例任务详情-停止任务
|
||||
export function organizationStopTaskDetail(id: string) {
|
||||
return MSR.get({ url: `${organizationStopTaskDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 组织任务-用例任务详情-批量停止任务
|
||||
export function organizationBatchStopTaskDetail(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: organizationBatchStopTaskDetailUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-批量删除任务
|
||||
export function organizationBatchDeleteTask(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: organizationBatchDeleteTaskUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-删除后台任务
|
||||
export function organizationDeleteSchedule(id: string) {
|
||||
return MSR.get({ url: `${organizationDeleteScheduleUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 组织任务-批量开启后台任务
|
||||
export function organizationBatchOpenTask(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: organizationBatchOpenTaskUrl, data });
|
||||
}
|
||||
|
||||
// 组织任务-批量关闭后台任务
|
||||
export function organizationBatchCloseTask(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: organizationBatchCloseTaskUrl, data });
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
import MSR from '@/api/http/index';
|
||||
import {
|
||||
projectBatchCloseTaskUrl,
|
||||
projectBatchDeleteTaskUrl,
|
||||
projectBatchOpenTaskUrl,
|
||||
projectBatchStopTaskDetailUrl,
|
||||
projectBatchStopTaskUrl,
|
||||
projectDeleteScheduleUrl,
|
||||
projectDeleteTaskUrl,
|
||||
projectExecuteTaskDetailListUrl,
|
||||
projectExecuteTaskListUrl,
|
||||
projectExecuteTaskStatisticsUrl,
|
||||
projectScheduleSwitchUrl,
|
||||
projectScheduleTaskListUrl,
|
||||
projectStopTaskDetailUrl,
|
||||
projectStopTaskUrl,
|
||||
projectTaskCenterResourcePoolsUrl,
|
||||
projectTaskOrderUrl,
|
||||
scheduleProCenterListUrl,
|
||||
} from '@/api/requrls/taskCenter';
|
||||
|
||||
import type { CommonList, TableQueryParams } from '@/models/common';
|
||||
import type { TimingTaskCenterApiCaseItem } from '@/models/projectManagement/taskCenter';
|
||||
import type {
|
||||
TaskCenterBatchParams,
|
||||
TaskCenterResourcePoolItem,
|
||||
TaskCenterStatisticsItem,
|
||||
TaskCenterSystemTaskItem,
|
||||
TaskCenterTaskDetailItem,
|
||||
TaskCenterTaskItem,
|
||||
} from '@/models/taskCenter';
|
||||
|
||||
// 项目任务-系统后台任务列表
|
||||
export function getProjectScheduleList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterSystemTaskItem>>({ url: projectScheduleTaskListUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-获取任务详情列表
|
||||
export function getProjectExecuteTaskDetailList(data: TaskCenterBatchParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskDetailItem>>({ url: projectExecuteTaskDetailListUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-获取任务列表
|
||||
export function getProjectExecuteTaskList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskItem>>({ url: projectExecuteTaskListUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-获取任务统计
|
||||
export function getProjectExecuteTaskStatistics(data: string[]) {
|
||||
return MSR.post<TaskCenterStatisticsItem[]>({ url: projectExecuteTaskStatisticsUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-获取资源池列表
|
||||
export function getProjectTaskCenterResourcePools() {
|
||||
return MSR.get<TaskCenterResourcePoolItem[]>({ url: projectTaskCenterResourcePoolsUrl });
|
||||
}
|
||||
|
||||
// 项目任务-停止任务
|
||||
export function projectStopTask(id: string) {
|
||||
return MSR.get({ url: `${projectStopTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 项目任务-删除任务
|
||||
export function projectDeleteTask(id: string) {
|
||||
return MSR.get({ url: `${projectDeleteTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 接口测试-定时任务列表
|
||||
export function getScheduleProApiCaseList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TimingTaskCenterApiCaseItem>>({ url: scheduleProCenterListUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-开启/关闭任务
|
||||
export function projectScheduleSwitch(id: string) {
|
||||
return MSR.get({ url: `${projectScheduleSwitchUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 项目任务-任务排队信息
|
||||
export function projectTaskOrder(data: string[]) {
|
||||
return MSR.post<Record<string, any>>({ url: projectTaskOrderUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-批量停止任务
|
||||
export function projectBatchStopTask(data: TaskCenterBatchParams) {
|
||||
return MSR.get({ url: projectBatchStopTaskUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-用例任务详情-停止任务
|
||||
export function projectStopTaskDetail(id: string) {
|
||||
return MSR.get({ url: `${projectStopTaskDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 项目任务-用例任务详情-批量停止任务
|
||||
export function projectBatchStopTaskDetail(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: projectBatchStopTaskDetailUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-批量删除任务
|
||||
export function projectBatchDeleteTask(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: projectBatchDeleteTaskUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-删除后台任务
|
||||
export function projectDeleteSchedule(id: string) {
|
||||
return MSR.get({ url: `${projectDeleteScheduleUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 项目任务-批量开启后台任务
|
||||
export function projectBatchOpenTask(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: projectBatchOpenTaskUrl, data });
|
||||
}
|
||||
|
||||
// 项目任务-批量关闭后台任务
|
||||
export function projectBatchCloseTask(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: projectBatchCloseTaskUrl, data });
|
||||
}
|
|
@ -0,0 +1,116 @@
|
|||
import MSR from '@/api/http/index';
|
||||
import {
|
||||
systemBatchCloseTaskUrl,
|
||||
systemBatchDeleteTaskUrl,
|
||||
systemBatchOpenTaskUrl,
|
||||
systemBatchStopTaskDetailUrl,
|
||||
systemBatchStopTaskUrl,
|
||||
systemDeleteScheduleUrl,
|
||||
systemDeleteTaskUrl,
|
||||
systemExecuteTaskDetailListUrl,
|
||||
systemExecuteTaskListUrl,
|
||||
systemExecuteTaskStatisticsUrl,
|
||||
systemResourcePoolStatusUrl,
|
||||
systemScheduleListUrl,
|
||||
systemScheduleSwitchUrl,
|
||||
systemStopTaskDetailUrl,
|
||||
systemStopTaskUrl,
|
||||
systemTaskCenterResourcePoolsUrl,
|
||||
systemTaskOrderUrl,
|
||||
} from '@/api/requrls/taskCenter';
|
||||
|
||||
import type { CommonList, TableQueryParams } from '@/models/common';
|
||||
import type {
|
||||
TaskCenterBatchParams,
|
||||
TaskCenterResourcePoolItem,
|
||||
TaskCenterResourcePoolStatus,
|
||||
TaskCenterStatisticsItem,
|
||||
TaskCenterSystemTaskItem,
|
||||
TaskCenterTaskDetailItem,
|
||||
TaskCenterTaskItem,
|
||||
} from '@/models/taskCenter';
|
||||
|
||||
// 系统任务-系统后台任务列表
|
||||
export function getSystemScheduleList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterSystemTaskItem>>({ url: systemScheduleListUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-开启/关闭任务
|
||||
export function systemScheduleSwitch(id: string) {
|
||||
return MSR.get({ url: `${systemScheduleSwitchUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 系统任务-获取任务详情列表
|
||||
export function getSystemExecuteTaskDetailList(data: TaskCenterBatchParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskDetailItem>>({ url: systemExecuteTaskDetailListUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-获取任务列表
|
||||
export function getSystemExecuteTaskList(data: TableQueryParams) {
|
||||
return MSR.post<CommonList<TaskCenterTaskItem>>({ url: systemExecuteTaskListUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-获取任务统计
|
||||
export function getSystemExecuteTaskStatistics(data: string[]) {
|
||||
return MSR.post<TaskCenterStatisticsItem[]>({ url: systemExecuteTaskStatisticsUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-获取资源池列表
|
||||
export function getSystemTaskCenterResourcePools() {
|
||||
return MSR.get<TaskCenterResourcePoolItem[]>({ url: systemTaskCenterResourcePoolsUrl });
|
||||
}
|
||||
|
||||
// 系统任务-任务排队信息
|
||||
export function systemTaskOrder(data: string[]) {
|
||||
return MSR.post<Record<string, any>>({ url: systemTaskOrderUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-停止任务
|
||||
export function systemStopTask(id: string) {
|
||||
return MSR.get({ url: `${systemStopTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 系统任务-批量停止任务
|
||||
export function systemBatchStopTask(data: TaskCenterBatchParams) {
|
||||
return MSR.get({ url: systemBatchStopTaskUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-用例任务详情-停止任务
|
||||
export function systemStopTaskDetail(id: string) {
|
||||
return MSR.get({ url: `${systemStopTaskDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 系统任务-用例任务详情-批量停止任务
|
||||
export function systemBatchStopTaskDetail(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: systemBatchStopTaskDetailUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-删除任务
|
||||
export function systemDeleteTask(id: string) {
|
||||
return MSR.get({ url: `${systemDeleteTaskUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 系统任务-批量删除任务
|
||||
export function systemBatchDeleteTask(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: systemBatchDeleteTaskUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-删除后台任务
|
||||
export function systemDeleteSchedule(id: string) {
|
||||
return MSR.get({ url: `${systemDeleteScheduleUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 任务中心-资源池状态
|
||||
export function getResourcePoolsStatus(data: string[]) {
|
||||
return MSR.post<TaskCenterResourcePoolStatus[]>({ url: systemResourcePoolStatusUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-批量开启后台任务
|
||||
export function systemBatchOpenTask(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: systemBatchOpenTaskUrl, data });
|
||||
}
|
||||
|
||||
// 系统任务-批量关闭后台任务
|
||||
export function systemBatchCloseTask(data: TaskCenterBatchParams) {
|
||||
return MSR.post({ url: systemBatchCloseTaskUrl, data });
|
||||
}
|
|
@ -4,22 +4,49 @@ export const projectExecuteTaskListUrl = '/project/task-center/exec-task/page';
|
|||
export const projectExecuteTaskDetailListUrl = '/project/task-center/exec-task/item/page'; // 项目任务-任务详情列表
|
||||
export const scheduleProCenterListUrl = '/task/center/project/schedule/page'; // 项目-任务中心-定时任务列表
|
||||
export const projectTaskCenterResourcePoolsUrl = '/project/task-center/resource-pool/options'; // 项目-任务中心-获取资源池列表
|
||||
export const projectTaskOrderUrl = '/project/task-center/exec-task/item/order'; // 项目-任务中心-排队信息
|
||||
export const projectStopTaskDetailUrl = '/project/task-center/exec-task/item/stop'; // 系统任务-用例任务详情-停止任务
|
||||
export const projectBatchStopTaskDetailUrl = '/project/task-center/exec-task/item/batch-stop'; // 项目-任务中心-用例任务详情-批量停止任务
|
||||
export const projectStopTaskUrl = '/project/task-center/exec-task/stop'; // 项目-任务中心-停止任务
|
||||
export const projectBatchStopTaskUrl = '/project/task-center/exec-task/batch-stop'; // 项目-任务中心-用例任务-批量停止任务
|
||||
export const projectDeleteTaskUrl = '/project/task-center/exec-task/delete'; // 项目-任务中心-删除任务
|
||||
export const projectBatchDeleteTaskUrl = '/project/task-center/exec-task/batch-delete'; // 项目-任务中心-用例任务-批量删除任务
|
||||
export const projectScheduleSwitchUrl = '/project/task-center/schedule/switch'; // 项目-任务中心-开启/关闭后台任务
|
||||
export const projectDeleteScheduleUrl = '/project/task-center/schedule/delete'; // 项目-任务中心-删除后台任务
|
||||
export const projectBatchOpenTaskUrl = '/project/task-center/schedule/batch-enable'; // 项目-任务中心-系统后台任务-批量开启任务
|
||||
export const projectBatchCloseTaskUrl = '/project/task-center/schedule/batch-disable'; // 项目-任务中心-系统后台任务-批量关闭任务
|
||||
|
||||
export const systemScheduleListUrl = '/system/task-center/schedule/page'; // 系统任务-系统后台任务列表
|
||||
export const systemExecuteTaskListUrl = '/system/task-center/exec-task/page'; // 系统任务-执行任务列表
|
||||
export const systemExecuteTaskDetailListUrl = '/system/task-center/exec-task/item/page'; // 系统任务-执行任务详情列表
|
||||
export const systemExecuteTaskStatisticsUrl = '/system/task-center/exec-task/statistics'; // 系统任务-获取任务统计
|
||||
export const systemTaskCenterResourcePoolsUrl = '/system/task-center/resource-pool/options'; // 系统任务-获取资源池列表
|
||||
export const systemStopTaskUrl = '/system/task-center/exec-task/stop'; // 系统任务-停止任务
|
||||
export const systemDeleteTaskUrl = '/system/task-center/exec-task/delete'; // 系统任务-删除任务
|
||||
export const systemResourcePoolStatusUrl = '/system/task-center/resource-pool/status'; // 系统任务-资源池状态
|
||||
export const systemTaskOrderUrl = '/system/task-center/exec-task/item/order'; // 系统任务-排队信息
|
||||
export const systemStopTaskUrl = '/system/task-center/exec-task/stop'; // 系统任务-停止任务
|
||||
export const systemStopTaskDetailUrl = '/system/task-center/exec-task/item/stop'; // 系统任务-用例任务详情-停止任务
|
||||
export const systemBatchStopTaskDetailUrl = '/system/task-center/exec-task/item/batch-stop'; // 系统任务-用例任务详情-批量停止任务
|
||||
export const systemBatchStopTaskUrl = '/system/task-center/exec-task/batch-stop'; // 系统任务-用例任务-批量停止任务
|
||||
export const systemBatchDeleteTaskUrl = '/system/task-center/exec-task/batch-delete'; // 系统任务-用例任务-批量删除任务
|
||||
export const systemDeleteTaskUrl = '/system/task-center/exec-task/delete'; // 系统任务-用例任务-删除任务
|
||||
export const systemDeleteScheduleUrl = '/system/task-center/schedule/delete'; // 系统任务-删除后台任务
|
||||
export const systemScheduleSwitchUrl = '/system/task-center/schedule/switch'; // 系统任务-开启/关闭后台任务
|
||||
export const systemBatchOpenTaskUrl = '/system/task-center/schedule/batch-enable'; // 系统任务-系统后台任务-批量开启任务
|
||||
export const systemBatchCloseTaskUrl = '/system/task-center/schedule/batch-disable'; // 系统任务-系统后台任务-批量关闭任务
|
||||
|
||||
export const organizationScheduleListUrl = '/organization/task-center/schedule/page'; // 组织任务-系统后台任务列表
|
||||
export const organizationExecuteTaskListUrl = '/organization/task-center/exec-task/page'; // 组织任务-执行任务列表
|
||||
export const organizationExecuteTaskDetailListUrl = '/organization/task-center/exec-task/item/page'; // 组织任务-执行任务详情列表
|
||||
export const organizationExecuteTaskStatisticsUrl = '/organization/task-center/exec-task/statistics'; // 组织任务-获取任务统计
|
||||
export const organizationTaskCenterResourcePoolsUrl = '/organization/task-center/resource-pool/options'; // 组织任务-获取资源池列表
|
||||
export const organizationTaskOrderUrl = '/organization/task-center/exec-task/item/order'; // 组织任务-排队信息
|
||||
export const organizationStopTaskUrl = '/organization/task-center/exec-task/stop'; // 组织任务-停止任务
|
||||
export const organizationBatchStopTaskUrl = '/organization/task-center/exec-task/batch-stop'; // 组织任务-批量停止任务
|
||||
export const organizationDeleteTaskUrl = '/organization/task-center/exec-task/delete'; // 组织任务-删除任务
|
||||
export const organizationBatchDeleteTaskUrl = '/organization/task-center/exec-task/batch-delete'; // 组织任务-批量删除任务
|
||||
export const organizationStopTaskDetailUrl = '/organization/task-center/exec-task/item/stop/{id}'; // 系统任务-用例任务详情-停止任务
|
||||
export const organizationBatchStopTaskDetailUrl = '/organization/task-center/exec-task/item/batch-stop'; // 组织任务-用例任务详情-批量停止任务
|
||||
export const organizationScheduleSwitchUrl = '/organization/task-center/schedule/switch'; // 组织任务-开启/关闭后台任务
|
||||
export const organizationDeleteScheduleUrl = '/organization/task-center/schedule/delete'; // 组织任务-删除后台任务
|
||||
export const organizationBatchOpenTaskUrl = '/organization/task-center/schedule/batch-enable'; // 组织任务-系统后台任务-批量开启任务
|
||||
export const organizationBatchCloseTaskUrl = '/organization/task-center/schedule/batch-disable'; // 组织任务-系统后台任务-批量关闭任务
|
||||
|
|
|
@ -19,11 +19,13 @@ export interface TaskCenterSystemTaskItem {
|
|||
createUserId: string;
|
||||
createUserName: string;
|
||||
createTime: number;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface TaskCenterTaskDetailParams extends TableQueryParams {
|
||||
taskId: string;
|
||||
resourcePoolId: string;
|
||||
export interface TaskCenterBatchParams extends TableQueryParams {
|
||||
taskId?: string;
|
||||
resourcePoolIds?: string[];
|
||||
resourcePoolNodes?: string[];
|
||||
}
|
||||
|
||||
export interface TaskCenterTaskItem {
|
||||
|
@ -71,7 +73,7 @@ export interface TaskCenterTaskDetailItem {
|
|||
userName: string;
|
||||
resourcePoolName: string;
|
||||
triggerMode: string; // 触发方式
|
||||
lineNum: number;
|
||||
lineNum: number | string;
|
||||
}
|
||||
|
||||
export interface TaskCenterStatisticsItem {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
import useTable from '@/components/pure/ms-table/useTable';
|
||||
|
||||
import { switchDefinitionSchedule } from '@/api/modules/api-test/management';
|
||||
import { getScheduleProApiCaseList } from '@/api/modules/taskCenter';
|
||||
import { getScheduleProApiCaseList, projectDeleteSchedule } from '@/api/modules/taskCenter/project';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
|
||||
import { TimingTaskCenterApiCaseItem } from '@/models/projectManagement/taskCenter';
|
||||
|
@ -139,6 +139,9 @@
|
|||
if (value) {
|
||||
loadTaskList();
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -158,7 +161,7 @@
|
|||
|
||||
async function deleteTask(record: TimingTaskCenterApiCaseItem) {
|
||||
try {
|
||||
// await switchDefinitionSchedule(record.id);
|
||||
await projectDeleteSchedule(record.id);
|
||||
Message.success(t('common.deleteSuccess'));
|
||||
loadTaskList();
|
||||
} catch (error) {
|
||||
|
|
|
@ -62,16 +62,13 @@
|
|||
>
|
||||
{{ t('common.stop') }}
|
||||
</MsButton>
|
||||
<MsButton v-else v-permission="['SYSTEM_USER:READ+DELETE']" @click="deleteTask(record)">
|
||||
{{ t('common.delete') }}
|
||||
</MsButton>
|
||||
<MsButton
|
||||
<!-- <MsButton
|
||||
v-if="record.status === ExecuteStatusEnum.COMPLETED && record.result === ExecuteResultEnum.ERROR"
|
||||
v-permission="['SYSTEM_USER:READ+DELETE']"
|
||||
@click="rerunTask(record)"
|
||||
>
|
||||
{{ t('ms.taskCenter.rerun') }}
|
||||
</MsButton>
|
||||
</MsButton> -->
|
||||
<MsButton
|
||||
v-if="record.status === ExecuteStatusEnum.COMPLETED"
|
||||
v-permission="['SYSTEM_USER:READ+DELETE']"
|
||||
|
@ -104,12 +101,25 @@
|
|||
import {
|
||||
getOrganizationExecuteTaskDetailList,
|
||||
getOrgTaskCenterResourcePools,
|
||||
organizationBatchStopTaskDetail,
|
||||
organizationStopTaskDetail,
|
||||
organizationTaskOrder,
|
||||
} from '@/api/modules/taskCenter/organization';
|
||||
import {
|
||||
getProjectExecuteTaskDetailList,
|
||||
getProjectTaskCenterResourcePools,
|
||||
projectBatchStopTaskDetail,
|
||||
projectStopTaskDetail,
|
||||
projectTaskOrder,
|
||||
} from '@/api/modules/taskCenter/project';
|
||||
import {
|
||||
getResourcePoolsStatus,
|
||||
getSystemExecuteTaskDetailList,
|
||||
getSystemTaskCenterResourcePools,
|
||||
} from '@/api/modules/taskCenter';
|
||||
systemBatchStopTaskDetail,
|
||||
systemStopTaskDetail,
|
||||
systemTaskOrder,
|
||||
} from '@/api/modules/taskCenter/system';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useModal from '@/hooks/useModal';
|
||||
import useTableStore from '@/hooks/useTableStore';
|
||||
|
@ -219,7 +229,7 @@
|
|||
},
|
||||
{
|
||||
title: 'ms.taskCenter.startExecuteTime',
|
||||
dataIndex: 'startExecuteTime',
|
||||
dataIndex: 'startTime',
|
||||
width: 170,
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
|
@ -228,7 +238,7 @@
|
|||
},
|
||||
{
|
||||
title: 'ms.taskCenter.endExecuteTime',
|
||||
dataIndex: 'endExecuteTime',
|
||||
dataIndex: 'endTime',
|
||||
width: 170,
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
|
@ -246,7 +256,7 @@
|
|||
slotName: 'action',
|
||||
dataIndex: 'operation',
|
||||
fixed: 'right',
|
||||
width: 180,
|
||||
width: 150,
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -282,14 +292,10 @@
|
|||
label: 'common.stop',
|
||||
eventTag: 'stop',
|
||||
},
|
||||
{
|
||||
label: 'ms.taskCenter.rerun',
|
||||
eventTag: 'rerun',
|
||||
},
|
||||
{
|
||||
label: 'common.delete',
|
||||
eventTag: 'delete',
|
||||
},
|
||||
// {
|
||||
// label: 'ms.taskCenter.rerun',
|
||||
// eventTag: 'rerun',
|
||||
// },
|
||||
],
|
||||
};
|
||||
|
||||
|
@ -299,7 +305,7 @@
|
|||
org: getOrganizationExecuteTaskDetailList,
|
||||
}[props.type];
|
||||
|
||||
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable(
|
||||
const { propsRes, propsEvent, loadList, setLoadListParams, getTableQueryParams, resetSelector } = useTable(
|
||||
currentExecuteTaskDetailList,
|
||||
{
|
||||
tableKey: TableKeyEnum.TASK_CENTER_CASE_TASK_DETAIL,
|
||||
|
@ -313,8 +319,8 @@
|
|||
return {
|
||||
...item,
|
||||
resourcePoolName: [item.resourcePoolName],
|
||||
startExecuteTime: item.startExecuteTime ? dayjs(item.startExecuteTime).format('YYYY-MM-DD HH:mm:ss') : '-',
|
||||
endExecuteTime: item.endExecuteTime ? dayjs(item.endExecuteTime).format('YYYY-MM-DD HH:mm:ss') : '-',
|
||||
startTime: item.startTime ? dayjs(item.startTime).format('YYYY-MM-DD HH:mm:ss') : '-',
|
||||
endTime: item.endTime ? dayjs(item.endTime).format('YYYY-MM-DD HH:mm:ss') : '-',
|
||||
};
|
||||
}
|
||||
);
|
||||
|
@ -324,47 +330,17 @@
|
|||
loadList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*/
|
||||
function deleteTask(record?: TaskCenterTaskDetailItem, isBatch?: boolean, params?: BatchActionQueryParams) {
|
||||
let title = t('ms.taskCenter.deleteTaskTitle', { name: characterLimit(record?.taskName) });
|
||||
let selectIds = [record?.id || ''];
|
||||
if (isBatch) {
|
||||
title = t('ms.taskCenter.deleteCaseTaskTitle', {
|
||||
count: params?.currentSelectCount || tableSelected.value.length,
|
||||
});
|
||||
selectIds = tableSelected.value as string[];
|
||||
}
|
||||
openModal({
|
||||
type: 'error',
|
||||
title,
|
||||
content: t('ms.taskCenter.deleteCaseTaskTip'),
|
||||
okText: t('common.confirmDelete'),
|
||||
cancelText: t('common.cancel'),
|
||||
okButtonProps: {
|
||||
status: 'danger',
|
||||
},
|
||||
maskClosable: false,
|
||||
onBeforeOk: async () => {
|
||||
try {
|
||||
// await deleteUserInfo({
|
||||
// selectIds,
|
||||
// selectAll: !!params?.selectAll,
|
||||
// excludeIds: params?.excludeIds || [],
|
||||
// condition: { keyword: keyword.value },
|
||||
// });
|
||||
Message.success(t('common.deleteSuccess'));
|
||||
resetSelector();
|
||||
loadList();
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
hideCancel: false,
|
||||
});
|
||||
}
|
||||
const currentStopTask = {
|
||||
system: systemStopTaskDetail,
|
||||
project: projectStopTaskDetail,
|
||||
org: organizationStopTaskDetail,
|
||||
}[props.type];
|
||||
|
||||
const currentBatchStopTask = {
|
||||
system: systemBatchStopTaskDetail,
|
||||
project: projectBatchStopTaskDetail,
|
||||
org: organizationBatchStopTaskDetail,
|
||||
}[props.type];
|
||||
|
||||
function stopTask(record?: TaskCenterTaskDetailItem, isBatch?: boolean, params?: BatchActionQueryParams) {
|
||||
let title = t('ms.taskCenter.stopTaskTitle', { name: characterLimit(record?.taskName) });
|
||||
|
@ -387,12 +363,16 @@
|
|||
maskClosable: false,
|
||||
onBeforeOk: async () => {
|
||||
try {
|
||||
// await deleteUserInfo({
|
||||
// selectIds,
|
||||
// selectAll: !!params?.selectAll,
|
||||
// excludeIds: params?.excludeIds || [],
|
||||
// condition: { keyword: keyword.value },
|
||||
// });
|
||||
if (isBatch) {
|
||||
await currentBatchStopTask({
|
||||
selectIds,
|
||||
selectAll: !!params?.selectAll,
|
||||
excludeIds: params?.excludeIds || [],
|
||||
...getTableQueryParams(),
|
||||
});
|
||||
} else {
|
||||
await currentStopTask(record?.id || '');
|
||||
}
|
||||
Message.success(t('common.stopped'));
|
||||
resetSelector();
|
||||
loadList();
|
||||
|
@ -412,9 +392,6 @@
|
|||
function handleTableBatch(event: BatchActionParams, params: BatchActionQueryParams) {
|
||||
batchModalParams.value = params;
|
||||
switch (event.eventTag) {
|
||||
case 'delete':
|
||||
deleteTask(undefined, true, params);
|
||||
break;
|
||||
case 'stop':
|
||||
stopTask(undefined, true, params);
|
||||
break;
|
||||
|
@ -451,6 +428,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化当前页所有任务的资源池状态
|
||||
*/
|
||||
async function initCurrentPageResourcePoolsStatus() {
|
||||
const ids = propsRes.value.data.map((item) => item.id);
|
||||
if (ids.length === 0) {
|
||||
|
@ -470,31 +450,74 @@
|
|||
}
|
||||
}
|
||||
|
||||
async function rerunTask(record: TaskCenterTaskDetailItem) {
|
||||
const currentQueueRequest = {
|
||||
system: systemTaskOrder,
|
||||
project: projectTaskOrder,
|
||||
org: organizationTaskOrder,
|
||||
}[props.type];
|
||||
|
||||
/**
|
||||
* 初始化当前页所有任务的排队状态
|
||||
*/
|
||||
async function initCurrentPageQueue() {
|
||||
const ids = propsRes.value.data.map((item) => item.id);
|
||||
if (ids.length === 0) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
// await deleteUserInfo({
|
||||
// selectIds,
|
||||
// selectAll: !!params?.selectAll,
|
||||
// excludeIds: params?.excludeIds || [],
|
||||
// condition: { keyword: keyword.value },
|
||||
// });
|
||||
Message.success(t('common.executionSuccess'));
|
||||
resetSelector();
|
||||
await loadList();
|
||||
initCurrentPageResourcePoolsStatus();
|
||||
const res = await currentQueueRequest(ids);
|
||||
propsRes.value.data.forEach((item) => {
|
||||
const queue = res[item.id];
|
||||
if (queue) {
|
||||
item.lineNum = queue;
|
||||
} else {
|
||||
item.lineNum = t('ms.taskCenter.waitQueue');
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// async function rerunTask(record: TaskCenterTaskDetailItem) {
|
||||
// try {
|
||||
// // await deleteUserInfo({
|
||||
// // selectIds,
|
||||
// // selectAll: !!params?.selectAll,
|
||||
// // excludeIds: params?.excludeIds || [],
|
||||
// // condition: { keyword: keyword.value },
|
||||
// // });
|
||||
// Message.success(t('common.executionSuccess'));
|
||||
// resetSelector();
|
||||
// await loadList();
|
||||
// initCurrentPageResourcePoolsStatus();
|
||||
// } catch (error) {
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log(error);
|
||||
// }
|
||||
// }
|
||||
|
||||
watch(
|
||||
() => propsRes.value.data,
|
||||
() => {
|
||||
initCurrentPageResourcePoolsStatus();
|
||||
initCurrentPageQueue();
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
if (props.id) {
|
||||
keyword.value = props.id;
|
||||
setLoadListParams({ keyword: props.id });
|
||||
}
|
||||
initResourcePools();
|
||||
await loadList();
|
||||
initCurrentPageResourcePoolsStatus();
|
||||
initCurrentPageQueue();
|
||||
});
|
||||
|
||||
await tableStore.initColumn(TableKeyEnum.TASK_CENTER_CASE_TASK_DETAIL, columns, 'drawer');
|
||||
|
|
|
@ -113,19 +113,19 @@
|
|||
<MsButton v-else v-permission="['SYSTEM_USER:READ+DELETE']" @click="deleteTask(record)">
|
||||
{{ t('common.delete') }}
|
||||
</MsButton>
|
||||
<MsButton
|
||||
<!-- <MsButton
|
||||
v-if="record.status === ExecuteStatusEnum.COMPLETED && record.result === ExecuteResultEnum.ERROR"
|
||||
v-permission="['SYSTEM_USER:READ+DELETE']"
|
||||
@click="rerunTask(record)"
|
||||
>
|
||||
{{ t('ms.taskCenter.rerun') }}
|
||||
</MsButton>
|
||||
</MsButton> -->
|
||||
<MsButton
|
||||
v-if="record.status === ExecuteStatusEnum.COMPLETED"
|
||||
v-permission="['SYSTEM_USER:READ+DELETE']"
|
||||
@click="checkReport(record)"
|
||||
>
|
||||
{{ t('ms.taskCenter.executeResult') }}
|
||||
{{ t('ms.taskCenter.checkReport') }}
|
||||
</MsButton>
|
||||
</template>
|
||||
</ms-base-table>
|
||||
|
@ -178,17 +178,27 @@
|
|||
import {
|
||||
getOrganizationExecuteTaskList,
|
||||
getOrganizationExecuteTaskStatistics,
|
||||
getProjectExecuteTaskList,
|
||||
getProjectExecuteTaskStatistics,
|
||||
getSystemExecuteTaskList,
|
||||
getSystemExecuteTaskStatistics,
|
||||
organizationBatchDeleteTask,
|
||||
organizationBatchStopTask,
|
||||
organizationDeleteTask,
|
||||
organizationStopTask,
|
||||
} from '@/api/modules/taskCenter/organization';
|
||||
import {
|
||||
getProjectExecuteTaskList,
|
||||
getProjectExecuteTaskStatistics,
|
||||
projectBatchDeleteTask,
|
||||
projectBatchStopTask,
|
||||
projectDeleteTask,
|
||||
projectStopTask,
|
||||
} from '@/api/modules/taskCenter/project';
|
||||
import {
|
||||
getSystemExecuteTaskList,
|
||||
getSystemExecuteTaskStatistics,
|
||||
systemBatchDeleteTask,
|
||||
systemBatchStopTask,
|
||||
systemDeleteTask,
|
||||
systemStopTask,
|
||||
} from '@/api/modules/taskCenter';
|
||||
} from '@/api/modules/taskCenter/system';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useModal from '@/hooks/useModal';
|
||||
import useOpenNewPage from '@/hooks/useOpenNewPage';
|
||||
|
@ -202,7 +212,7 @@
|
|||
import { TestPlanRouteEnum } from '@/enums/routeEnum';
|
||||
import { TableKeyEnum } from '@/enums/tableEnum';
|
||||
import { FilterSlotNameEnum } from '@/enums/tableFilterEnum';
|
||||
import { ExecuteResultEnum, ExecuteStatusEnum, ExecuteTaskType, SystemTaskType } from '@/enums/taskCenter';
|
||||
import { ExecuteStatusEnum, ExecuteTaskType } from '@/enums/taskCenter';
|
||||
|
||||
import { executeFinishedRateMap, executeMethodMap, executeResultMap, executeStatusMap } from './config';
|
||||
|
||||
|
@ -211,6 +221,7 @@
|
|||
}>();
|
||||
const emit = defineEmits<{
|
||||
(e: 'goDetail', id: string): void;
|
||||
(e: 'init'): void;
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
|
@ -369,35 +380,23 @@
|
|||
org: getOrganizationExecuteTaskStatistics,
|
||||
}[props.type];
|
||||
|
||||
const currentStopTask = {
|
||||
system: projectStopTask,
|
||||
project: organizationStopTask,
|
||||
org: systemStopTask,
|
||||
}[props.type];
|
||||
|
||||
const currentDeleteTask = {
|
||||
system: projectDeleteTask,
|
||||
project: organizationDeleteTask,
|
||||
org: systemDeleteTask,
|
||||
}[props.type];
|
||||
|
||||
const tableBatchActions = {
|
||||
baseAction: [
|
||||
{
|
||||
label: 'common.stop',
|
||||
eventTag: 'stop',
|
||||
},
|
||||
{
|
||||
label: 'ms.taskCenter.rerun',
|
||||
eventTag: 'rerun',
|
||||
},
|
||||
// {
|
||||
// label: 'ms.taskCenter.rerun',
|
||||
// eventTag: 'rerun',
|
||||
// },
|
||||
{
|
||||
label: 'common.delete',
|
||||
eventTag: 'delete',
|
||||
},
|
||||
],
|
||||
};
|
||||
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable(
|
||||
const { propsRes, propsEvent, loadList, setLoadListParams, getTableQueryParams, resetSelector } = useTable(
|
||||
currentExecuteTaskList,
|
||||
{
|
||||
tableKey: TableKeyEnum.TASK_CENTER_CASE_TASK,
|
||||
|
@ -475,6 +474,18 @@
|
|||
emit('goDetail', id);
|
||||
}
|
||||
|
||||
const currentDeleteTask = {
|
||||
system: systemDeleteTask,
|
||||
project: projectDeleteTask,
|
||||
org: organizationDeleteTask,
|
||||
}[props.type];
|
||||
|
||||
const currentBatchDeleteTask = {
|
||||
system: systemBatchDeleteTask,
|
||||
project: projectBatchDeleteTask,
|
||||
org: organizationBatchDeleteTask,
|
||||
}[props.type];
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*/
|
||||
|
@ -500,12 +511,12 @@
|
|||
onBeforeOk: async () => {
|
||||
try {
|
||||
if (isBatch) {
|
||||
// await deleteUserInfo({
|
||||
// selectIds,
|
||||
// selectAll: !!params?.selectAll,
|
||||
// excludeIds: params?.excludeIds || [],
|
||||
// condition: { keyword: keyword.value },
|
||||
// });
|
||||
await currentBatchDeleteTask({
|
||||
selectIds,
|
||||
selectAll: !!params?.selectAll,
|
||||
excludeIds: params?.excludeIds || [],
|
||||
...getTableQueryParams(),
|
||||
});
|
||||
} else {
|
||||
await currentDeleteTask(record?.id || '');
|
||||
}
|
||||
|
@ -521,6 +532,21 @@
|
|||
});
|
||||
}
|
||||
|
||||
const currentStopTask = {
|
||||
system: projectStopTask,
|
||||
project: organizationStopTask,
|
||||
org: systemStopTask,
|
||||
}[props.type];
|
||||
|
||||
const currentBatchStopTask = {
|
||||
system: projectBatchStopTask,
|
||||
project: organizationBatchStopTask,
|
||||
org: systemBatchStopTask,
|
||||
}[props.type];
|
||||
|
||||
/**
|
||||
* 停止任务
|
||||
*/
|
||||
function stopTask(record?: TaskCenterTaskItem, isBatch?: boolean, params?: BatchActionQueryParams) {
|
||||
let title = t('ms.taskCenter.stopTaskTitle', { name: characterLimit(record?.taskName) });
|
||||
let selectIds = [record?.id || ''];
|
||||
|
@ -540,12 +566,12 @@
|
|||
onBeforeOk: async () => {
|
||||
try {
|
||||
if (isBatch) {
|
||||
// await deleteUserInfo({
|
||||
// selectIds,
|
||||
// selectAll: !!params?.selectAll,
|
||||
// excludeIds: params?.excludeIds || [],
|
||||
// condition: { keyword: keyword.value },
|
||||
// });
|
||||
await currentBatchStopTask({
|
||||
selectIds,
|
||||
selectAll: !!params?.selectAll,
|
||||
excludeIds: params?.excludeIds || [],
|
||||
...getTableQueryParams(),
|
||||
});
|
||||
} else {
|
||||
await currentStopTask(record?.id || '');
|
||||
}
|
||||
|
@ -580,23 +606,23 @@
|
|||
}
|
||||
}
|
||||
|
||||
async function rerunTask(record: TaskCenterTaskItem) {
|
||||
try {
|
||||
// await deleteUserInfo({
|
||||
// selectIds,
|
||||
// selectAll: !!params?.selectAll,
|
||||
// excludeIds: params?.excludeIds || [],
|
||||
// condition: { keyword: keyword.value },
|
||||
// });
|
||||
Message.success(t('common.executionSuccess'));
|
||||
resetSelector();
|
||||
await loadList();
|
||||
initTaskStatistics();
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
// async function rerunTask(record: TaskCenterTaskItem) {
|
||||
// try {
|
||||
// // await deleteUserInfo({
|
||||
// // selectIds,
|
||||
// // selectAll: !!params?.selectAll,
|
||||
// // excludeIds: params?.excludeIds || [],
|
||||
// // condition: { keyword: keyword.value },
|
||||
// // });
|
||||
// Message.success(t('common.executionSuccess'));
|
||||
// resetSelector();
|
||||
// await loadList();
|
||||
// initTaskStatistics();
|
||||
// } catch (error) {
|
||||
// // eslint-disable-next-line no-console
|
||||
// console.log(error);
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 报告详情 showReportDetail
|
||||
|
@ -664,6 +690,7 @@
|
|||
onMounted(async () => {
|
||||
searchTask();
|
||||
getTime();
|
||||
emit('init');
|
||||
});
|
||||
|
||||
watch(
|
||||
|
|
|
@ -74,7 +74,27 @@
|
|||
import useTable from '@/components/pure/ms-table/useTable';
|
||||
import MsTag from '@/components/pure/ms-tag/ms-tag.vue';
|
||||
|
||||
import { getOrganizationScheduleList, getProjectScheduleList, getSystemScheduleList } from '@/api/modules/taskCenter';
|
||||
import {
|
||||
getOrganizationScheduleList,
|
||||
organizationBatchCloseTask,
|
||||
organizationBatchOpenTask,
|
||||
organizationDeleteSchedule,
|
||||
organizationScheduleSwitch,
|
||||
} from '@/api/modules/taskCenter/organization';
|
||||
import {
|
||||
getProjectScheduleList,
|
||||
projectBatchCloseTask,
|
||||
projectBatchOpenTask,
|
||||
projectDeleteSchedule,
|
||||
projectScheduleSwitch,
|
||||
} from '@/api/modules/taskCenter/project';
|
||||
import {
|
||||
getSystemScheduleList,
|
||||
systemBatchCloseTask,
|
||||
systemBatchOpenTask,
|
||||
systemDeleteSchedule,
|
||||
systemScheduleSwitch,
|
||||
} from '@/api/modules/taskCenter/system';
|
||||
import { useI18n } from '@/hooks/useI18n';
|
||||
import useModal from '@/hooks/useModal';
|
||||
import useOpenNewPage from '@/hooks/useOpenNewPage';
|
||||
|
@ -82,6 +102,7 @@
|
|||
import { characterLimit } from '@/utils';
|
||||
import { hasAnyPermission } from '@/utils/permission';
|
||||
|
||||
import { TaskCenterSystemTaskItem } from '@/models/taskCenter';
|
||||
import { MenuEnum } from '@/enums/commonEnum';
|
||||
import { ApiTestRouteEnum, ProjectManagementRouteEnum, TestPlanRouteEnum } from '@/enums/routeEnum';
|
||||
import { TableKeyEnum } from '@/enums/tableEnum';
|
||||
|
@ -222,7 +243,7 @@
|
|||
project: getProjectScheduleList,
|
||||
}[props.type];
|
||||
|
||||
const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable(
|
||||
const { propsRes, propsEvent, loadList, setLoadListParams, getTableQueryParams, resetSelector } = useTable(
|
||||
currentScheduleList,
|
||||
{
|
||||
tableKey: TableKeyEnum.TASK_CENTER_SYSTEM_TASK,
|
||||
|
@ -248,18 +269,17 @@
|
|||
loadList();
|
||||
}
|
||||
|
||||
const currentDeleteSchedule = {
|
||||
system: systemDeleteSchedule,
|
||||
org: organizationDeleteSchedule,
|
||||
project: projectDeleteSchedule,
|
||||
}[props.type];
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*/
|
||||
function deleteTask(record?: any, isBatch?: boolean, params?: BatchActionQueryParams) {
|
||||
let title = t('ms.taskCenter.deleteTaskTitle', { name: characterLimit(record?.taskName) });
|
||||
let selectIds = [record?.id || ''];
|
||||
if (isBatch) {
|
||||
title = t('ms.taskCenter.deleteTimeTaskTitle', {
|
||||
count: params?.currentSelectCount || tableSelected.value.length,
|
||||
});
|
||||
selectIds = tableSelected.value as string[];
|
||||
}
|
||||
function deleteTask(record: TaskCenterSystemTaskItem) {
|
||||
const title = t('ms.taskCenter.deleteTaskTitle', { name: characterLimit(record?.taskName) });
|
||||
openModal({
|
||||
type: 'error',
|
||||
title,
|
||||
|
@ -272,12 +292,7 @@
|
|||
maskClosable: false,
|
||||
onBeforeOk: async () => {
|
||||
try {
|
||||
// await deleteUserInfo({
|
||||
// selectIds,
|
||||
// selectAll: !!params?.selectAll,
|
||||
// excludeIds: params?.excludeIds || [],
|
||||
// condition: { keyword: keyword.value },
|
||||
// });
|
||||
await currentDeleteSchedule(record?.id || '');
|
||||
Message.success(t('common.deleteSuccess'));
|
||||
resetSelector();
|
||||
loadList();
|
||||
|
@ -290,14 +305,19 @@
|
|||
});
|
||||
}
|
||||
|
||||
function openTask(params?: BatchActionQueryParams) {
|
||||
const currentBatchOpenSchedule = {
|
||||
system: systemBatchOpenTask,
|
||||
org: organizationBatchOpenTask,
|
||||
project: projectBatchOpenTask,
|
||||
}[props.type];
|
||||
async function openTask(params?: BatchActionQueryParams) {
|
||||
try {
|
||||
// await deleteUserInfo({
|
||||
// selectIds,
|
||||
// selectAll: !!params?.selectAll,
|
||||
// excludeIds: params?.excludeIds || [],
|
||||
// condition: { keyword: keyword.value },
|
||||
// });
|
||||
await currentBatchOpenSchedule({
|
||||
selectIds: params?.selectIds || [],
|
||||
selectAll: !!params?.selectAll,
|
||||
excludeIds: params?.excludeIds || [],
|
||||
...getTableQueryParams(),
|
||||
});
|
||||
Message.success(t('ms.taskCenter.openTaskSuccess'));
|
||||
resetSelector();
|
||||
loadList();
|
||||
|
@ -307,14 +327,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
function closeTask(params?: BatchActionQueryParams) {
|
||||
const currentBatchCloseSchedule = {
|
||||
system: systemBatchCloseTask,
|
||||
org: organizationBatchCloseTask,
|
||||
project: projectBatchCloseTask,
|
||||
}[props.type];
|
||||
async function closeTask(params?: BatchActionQueryParams) {
|
||||
try {
|
||||
// await deleteUserInfo({
|
||||
// selectIds,
|
||||
// selectAll: !!params?.selectAll,
|
||||
// excludeIds: params?.excludeIds || [],
|
||||
// condition: { keyword: keyword.value },
|
||||
// });
|
||||
await currentBatchCloseSchedule({
|
||||
selectIds: params?.selectIds || [],
|
||||
selectAll: !!params?.selectAll,
|
||||
excludeIds: params?.excludeIds || [],
|
||||
...getTableQueryParams(),
|
||||
});
|
||||
Message.success(t('ms.taskCenter.closeTaskSuccess'));
|
||||
resetSelector();
|
||||
loadList();
|
||||
|
@ -324,7 +349,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
function checkDetail(record: any) {
|
||||
function checkDetail(record: TaskCenterSystemTaskItem) {
|
||||
switch (record.resourceType) {
|
||||
case SystemTaskType.API_IMPORT:
|
||||
openNewPage(ApiTestRouteEnum.API_TEST_MANAGEMENT, {
|
||||
|
@ -356,8 +381,17 @@
|
|||
}
|
||||
}
|
||||
|
||||
async function handleBeforeEnableChange(record: any) {
|
||||
const currentSwitchSchedule = {
|
||||
system: systemScheduleSwitch,
|
||||
org: organizationScheduleSwitch,
|
||||
project: projectScheduleSwitch,
|
||||
}[props.type];
|
||||
/**
|
||||
* 启用/关闭任务
|
||||
*/
|
||||
async function handleBeforeEnableChange(record: TaskCenterSystemTaskItem) {
|
||||
try {
|
||||
await currentSwitchSchedule(record.id);
|
||||
Message.success(t(record.enable ? 'ms.taskCenter.closeTaskSuccess' : 'ms.taskCenter.openTaskSuccess'));
|
||||
return true;
|
||||
} catch (error) {
|
||||
|
@ -387,7 +421,7 @@
|
|||
|
||||
async function handleRunRuleChange(
|
||||
val: string | number | boolean | Record<string, any> | (string | number | boolean | Record<string, any>)[],
|
||||
record: any
|
||||
record: TaskCenterSystemTaskItem
|
||||
) {
|
||||
try {
|
||||
record.runRuleLoading = true;
|
||||
|
|
|
@ -6,7 +6,12 @@
|
|||
<a-divider margin="0"></a-divider>
|
||||
<div class="ms-taskCenter-content">
|
||||
<Suspense>
|
||||
<caseTaskTable v-if="activeTab === TaskCenterEnum.CASE" :type="props.type" @go-detail="goTaskDetail" />
|
||||
<caseTaskTable
|
||||
v-if="activeTab === TaskCenterEnum.CASE"
|
||||
:type="props.type"
|
||||
@go-detail="goTaskDetail"
|
||||
@init="activeTaskId = ''"
|
||||
/>
|
||||
<caseTaskDetailTable v-else-if="activeTab === TaskCenterEnum.DETAIL" :id="activeTaskId" :type="props.type" />
|
||||
<systemTaskTable v-else-if="activeTab === TaskCenterEnum.BACKEND" :type="props.type" />
|
||||
</Suspense>
|
||||
|
|
|
@ -55,4 +55,5 @@ export default {
|
|||
'ms.taskCenter.thirdPartSync': 'Third-party sync',
|
||||
'ms.taskCenter.openTaskSuccess': 'Task started successfully',
|
||||
'ms.taskCenter.closeTaskSuccess': 'Task closed successfully',
|
||||
'ms.taskCenter.waitQueue': 'Waiting in line',
|
||||
};
|
||||
|
|
|
@ -55,4 +55,5 @@ export default {
|
|||
'ms.taskCenter.thirdPartSync': '第三方同步',
|
||||
'ms.taskCenter.openTaskSuccess': '任务开启成功',
|
||||
'ms.taskCenter.closeTaskSuccess': '任务关闭成功',
|
||||
'ms.taskCenter.waitQueue': '等待排队',
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue