1
0

refactor: 重构任务执行

This commit is contained in:
2025-09-24 22:34:16 +08:00
parent 8011a4f2cb
commit 01690bbcd6
35 changed files with 610 additions and 1137 deletions

View File

@@ -1,5 +1,14 @@
import React from 'react'
import {amisRender, commonInfo, crudCommonOptions, paginationTemplate, remoteMappings, time} from '../../util/amis.tsx'
import {
amisRender,
commonInfo,
crudCommonOptions,
horizontalFormOptions,
paginationTemplate,
remoteMappings,
remoteOptions,
time,
} from '../../util/amis.tsx'
import {useNavigate} from 'react-router'
function TaskList() {
@@ -25,7 +34,41 @@ function TaskList() {
},
interval: 30000,
...crudCommonOptions(),
...paginationTemplate(15),
...paginationTemplate(
15,
undefined,
[
{
type: 'action',
label: '',
icon: 'fa fa-plus',
actionType: 'dialog',
dialog: {
title: '创建任务',
body: {
type: 'form',
api: {
method: 'post',
url: `${commonInfo.baseUrl}/task/execute`,
data: {
templateId: '${templateId|default:undefined}',
},
},
...horizontalFormOptions(),
body: [
{
name: 'templateId',
label: '名称',
required: true,
selectFirst: true,
...remoteOptions('select', 'task_template_id'),
},
],
},
},
},
],
),
columns: [
{
name: 'name',
@@ -44,10 +87,10 @@ function TaskList() {
...remoteMappings('task_status', 'status'),
},
{
name: 'step',
label: '进度',
type: 'progress',
width: 200,
value: '${ROUND(step * 100, 0)}',
},
{
label: '耗时',