feat: 添加表格排序

bak
elseif 1 year ago
parent 709026b6bf
commit 9828399197

@ -13,6 +13,7 @@ import { isBoolean } from '@/utils/is'
import { useUser } from '@/store/modules/user' import { useUser } from '@/store/modules/user'
import type { ApprovalParam } from '/#/api' import type { ApprovalParam } from '/#/api'
import { audit } from '@/api/task/task' import { audit } from '@/api/task/task'
import SvgIcon from '@/components/Icon/SvgIcon.vue'
const columns: DataTableColumns<RowData> = [ const columns: DataTableColumns<RowData> = [
{ {
@ -30,7 +31,7 @@ const columns: DataTableColumns<RowData> = [
title: '任务名称', title: '任务名称',
key: 'fromtaskname', key: 'fromtaskname',
fixed: 'left', fixed: 'left',
width: 200, width: 150,
}, },
{ {
title: '审批节点', title: '审批节点',
@ -41,16 +42,43 @@ const columns: DataTableColumns<RowData> = [
title: '审批状态', title: '审批状态',
key: 'states', key: 'states',
width: 100, width: 100,
sorter: 'default',
renderSorterIcon: ({ order }) => {
if (order === false)
return h(SvgIcon, { name: 'sort-2' })
if (order === 'ascend')
return h(SvgIcon, { name: 'sort-1' })
if (order === 'descend')
return h(SvgIcon, { name: 'sort-3' })
},
}, },
{ {
title: '图片相似度', title: '图片相似度',
key: 'similarity', key: 'similarity',
width: 100, width: 150,
sorter: 'default',
renderSorterIcon: ({ order }) => {
if (order === false)
return h(SvgIcon, { name: 'sort-2' })
if (order === 'ascend')
return h(SvgIcon, { name: 'sort-1' })
if (order === 'descend')
return h(SvgIcon, { name: 'sort-3' })
},
}, },
{ {
title: '提报时间', title: '提报时间',
key: 'fromuptime', key: 'fromuptime',
width: 200, width: 200,
sorter: 'default',
renderSorterIcon: ({ order }) => {
if (order === false)
return h(SvgIcon, { name: 'sort-2' })
if (order === 'ascend')
return h(SvgIcon, { name: 'sort-1' })
if (order === 'descend')
return h(SvgIcon, { name: 'sort-3' })
},
}, },
{ {
title: '更新时间', title: '更新时间',

Loading…
Cancel
Save