|
@@ -2,7 +2,7 @@ import AnimateContent from '@/components/AnimateContent'
|
|
|
import consts from '@/utils/consts'
|
|
|
import { PageContainer } from '@ant-design/pro-layout'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
-import { Button, message, Popconfirm } from 'antd'
|
|
|
+import { Button, message, Modal } from 'antd'
|
|
|
import { useRef, useState } from 'react'
|
|
|
import { useRequest } from 'umi'
|
|
|
import { addApproval, delApproval, getApprovalList, saveApproval } from '@/services/api/project'
|
|
@@ -63,6 +63,23 @@ const FlowList = () => {
|
|
|
tRef.current?.reload()
|
|
|
}
|
|
|
})
|
|
|
+
|
|
|
+ const handleDelFlow = (ID: string) => {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '删除模板',
|
|
|
+ content: (
|
|
|
+ <div>
|
|
|
+ <div>确认删除该流程模板?</div>
|
|
|
+ <div>删除后,数据无法恢复,请谨慎操作。</div>
|
|
|
+ </div>
|
|
|
+ ),
|
|
|
+ okButtonProps: {
|
|
|
+ danger: true
|
|
|
+ },
|
|
|
+ onOk: () => tryDel({ ID })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
const columns: ProColumnType = [
|
|
|
{
|
|
|
dataIndex: 'name',
|
|
@@ -135,20 +152,16 @@ const FlowList = () => {
|
|
|
}}>
|
|
|
配置流程
|
|
|
</span>
|
|
|
- <Popconfirm
|
|
|
- disabled={!record?.canDel}
|
|
|
- title="是否删除此流程模板?"
|
|
|
- okText="确定"
|
|
|
- cancelText="取消"
|
|
|
- onConfirm={() => tryDel({ ID: record.ID })}>
|
|
|
- <span
|
|
|
- className={classNames(
|
|
|
- 'pl-2',
|
|
|
- record?.canDel ? 'text-red-500 cursor-pointer hover:text-red-600' : 'text-gray-500'
|
|
|
- )}>
|
|
|
- 删除
|
|
|
- </span>
|
|
|
- </Popconfirm>
|
|
|
+ <span
|
|
|
+ className={classNames(
|
|
|
+ 'pl-2',
|
|
|
+ record?.canDel ? 'text-red-500 cursor-pointer hover:text-red-600' : 'text-gray-500'
|
|
|
+ )}
|
|
|
+ onClick={() => {
|
|
|
+ record?.canDel && handleDelFlow(record.ID)
|
|
|
+ }}>
|
|
|
+ 删除
|
|
|
+ </span>
|
|
|
</div>
|
|
|
)
|
|
|
}
|