1
0

feat: 优化任务执行逻辑

This commit is contained in:
2025-09-06 15:14:41 +08:00
parent 0ad9d8239c
commit 2c889462c6
5 changed files with 29 additions and 63 deletions

View File

@@ -8,7 +8,6 @@ import Test from './pages/Test.tsx'
import StockList from './pages/stock/StockList.tsx'
import StockDetail from './pages/stock/StockDetail.tsx'
import TaskList from './pages/task/TaskList.tsx'
import TaskAdd from './pages/task/TaskAdd.tsx'
import TaskTemplateList from './pages/task/TaskTemplateList.tsx'
import TaskTemplateSave from './pages/task/TaskTemplateSave.tsx'
import TaskScheduleList from './pages/task/TaskScheduleList.tsx'
@@ -51,10 +50,6 @@ const routes: RouteObject[] = [
path: 'list',
Component: TaskList,
},
{
path: 'add',
Component: TaskAdd,
},
{
path: 'template',
children: [

View File

@@ -1,27 +0,0 @@
import React from 'react'
import {amisRender, commonInfo} from '../../util/amis.tsx'
function TaskAdd() {
return (
<div className="task-add">
{amisRender(
{
type: 'page',
title: '任务添加',
body: [
{
debug: commonInfo.debug,
type: 'form',
wrapWithPanel: false,
mode: 'horizontal',
labelAlign: 'left',
body: [],
},
],
},
)}
</div>
)
}
export default React.memo(TaskAdd)

View File

@@ -24,32 +24,7 @@ function TaskList() {
},
},
...crudCommonOptions(),
...paginationTemplate(
15,
undefined,
[
{
type: 'action',
label: '',
icon: 'fa fa-plus',
tooltip: '添加任务',
tooltipPlacement: 'top',
onEvent: {
click: {
actions: [
{
actionType: 'custom',
// @ts-ignore
script: (context, action, event) => {
navigate('/task/add')
},
},
],
},
},
},
],
),
...paginationTemplate(15),
columns: [
{
name: 'name',

View File

@@ -60,6 +60,23 @@ function TaskScheduleSave() {
label: '重置',
actionType: 'reset',
},
{
type: 'action',
label: '返回',
onEvent: {
click: {
actions: [
{
actionType: 'custom',
// @ts-ignore
script: (context, action, event) => {
navigate(-1)
},
},
],
},
},
}
],
},
],