| | |
| | | statusText: record['status$'] || '-', |
| | | updateTimeText: record['updateTime$'] || record.updateTime || '-', |
| | | createTimeText: record['createTime$'] || record.createTime || '-', |
| | | canComplete: record.canComplete === true |
| | | canComplete: record.canComplete === true, |
| | | canCancel: record.canCancel === true |
| | | } |
| | | } |
| | | |
| | |
| | | return Number(row.taskStatus) === 199 && Number(row.taskType) === 103 |
| | | } |
| | | |
| | | export function canTopTask(row = {}) { |
| | | const taskStatus = Number(row.taskStatus) |
| | | const taskType = Number(row.taskType) |
| | | const allowedStatuses = [1, 101] |
| | | const allowedTypes = [1, 101, 10, 103, 11] |
| | | return allowedStatuses.includes(taskStatus) && allowedTypes.includes(taskType) |
| | | } |
| | | |
| | | export function getTaskActionList(row = {}) { |
| | | return [ |
| | | { |
| | | key: 'view', |
| | | label: '查看详情', |
| | | icon: 'ri:eye-line' |
| | | }, |
| | | { |
| | | key: 'flowStep', |
| | | label: '流程步骤', |
| | | icon: 'ri:node-tree' |
| | | }, |
| | | ...(row.canComplete |
| | | ? [ |
| | |
| | | } |
| | | ] |
| | | : []), |
| | | { |
| | | key: 'top', |
| | | label: '任务置顶', |
| | | icon: 'ri:pushpin-line', |
| | | auth: 'update' |
| | | }, |
| | | { |
| | | key: 'remove', |
| | | label: '取消任务', |
| | | icon: 'ri:close-circle-line', |
| | | color: '#f56c6c', |
| | | auth: 'delete' |
| | | } |
| | | ...(canTopTask(row) |
| | | ? [ |
| | | { |
| | | key: 'top', |
| | | label: '任务置顶', |
| | | icon: 'ri:pushpin-line', |
| | | auth: 'update' |
| | | } |
| | | ] |
| | | : []), |
| | | ...(row.canCancel |
| | | ? [ |
| | | { |
| | | key: 'remove', |
| | | label: '取消任务', |
| | | icon: 'ri:close-circle-line', |
| | | color: '#f56c6c', |
| | | auth: 'delete' |
| | | } |
| | | ] |
| | | : []) |
| | | ] |
| | | } |
| | | |