{amisRender(
@@ -13,43 +11,10 @@ function TaskTemplateList() {
body: [
{
type: 'crud',
- api: {
- method: 'post',
- url: `${commonInfo.baseUrl}/task_template/list`,
- data: {
- page: {
- index: '${page}',
- size: '${perPage}',
- },
- },
- },
+ api: `get:${commonInfo.baseUrl}/task/template/list`,
...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/template/save/-1')
- },
- },
- ],
- },
- },
- },
- ],
- ),
+ ...paginationTemplate(15),
+ loadOnce: true,
columns: [
{
name: 'name',
@@ -63,7 +28,7 @@ function TaskTemplateList() {
{
type: 'operation',
label: '操作',
- width: 150,
+ width: 100,
buttons: [
{
type: 'action',
@@ -78,35 +43,7 @@ function TaskTemplateList() {
},
},
confirmText: '确认执行模板
${name}?',
- confirmTitle: '删除',
- },
- {
- type: 'action',
- label: '详情',
- level: 'link',
- onEvent: {
- click: {
- actions: [
- {
- actionType: 'custom',
- // @ts-ignore
- script: (context, action, event) => {
- navigate(`/task/template/save/${context.props.data['id']}`)
- },
- },
- ],
- },
- },
- },
- {
- className: 'text-danger btn-deleted',
- type: 'action',
- label: '删除',
- level: 'link',
- actionType: 'ajax',
- api: `get:${commonInfo.baseUrl}/task_template/remove/\${id}`,
- confirmText: '确认删除模板
${name}?',
- confirmTitle: '删除',
+ confirmTitle: '执行',
},
],
},
diff --git a/leopard-web/src/pages/task/TaskTemplateSave.tsx b/leopard-web/src/pages/task/TaskTemplateSave.tsx
deleted file mode 100644
index ae7ff80..0000000
--- a/leopard-web/src/pages/task/TaskTemplateSave.tsx
+++ /dev/null
@@ -1,105 +0,0 @@
-import React from 'react'
-import {amisRender, commonInfo} from '../../util/amis.tsx'
-import {useNavigate, useParams} from 'react-router'
-
-function TaskTemplateSave() {
- const navigate = useNavigate()
- const {id} = useParams()
- return (
-
- {amisRender(
- {
- type: 'page',
- title: '任务模板添加',
- body: [
- {
- debug: commonInfo.debug,
- type: 'form',
- api: `post:${commonInfo.baseUrl}/task_template/save`,
- initApi: `get:${commonInfo.baseUrl}/task_template/detail/${id}`,
- initFetchOn: `${id} !== -1`,
- wrapWithPanel: false,
- mode: 'horizontal',
- labelAlign: 'left',
- onEvent: {
- submitSucc: {
- actions: [
- {
- actionType: 'custom',
- // @ts-ignore
- script: (context, action, event) => {
- navigate(-1)
- },
- },
- ],
- },
- },
- body: [
- {
- type: 'hidden',
- name: 'id',
- },
- {
- type: 'input-text',
- name: 'name',
- label: '名称',
- required: true,
- clearable: true,
- },
- {
- type: 'textarea',
- name: 'description',
- label: '描述',
- required: true,
- clearable: true,
- },
- {
- type: 'input-text',
- name: 'expression',
- label: 'EL表达式',
- required: true,
- clearable: true,
- },
- {
- type: 'button-toolbar',
- buttons: [
- {
- type: 'action',
- label: '提交',
- actionType: 'submit',
- level: 'primary',
- },
- {
- type: 'action',
- label: '重置',
- actionType: 'reset',
- },
- {
- type: 'action',
- label: '返回',
- onEvent: {
- click: {
- actions: [
- {
- actionType: 'custom',
- // @ts-ignore
- script: (context, action, event) => {
- navigate(-1)
- },
- },
- ],
- },
- },
- },
- ],
- },
- ],
- },
- ],
- },
- )}
-
- )
-}
-
-export default React.memo(TaskTemplateSave)
\ No newline at end of file