全局表格添加列配置功能

This commit is contained in:
guanj
2026-07-09 13:54:18 +08:00
parent 1a69be62a0
commit 855c569535
116 changed files with 1078 additions and 9806 deletions

View File

@@ -1,76 +1,76 @@
<template>
<div class='default-main'>
<TableHeader>
<template v-slot:select>
<el-form-item label='筛选数据'>
<el-input v-model='tableStore.table.params.name' clearable placeholder='筛选数据' />
</el-form-item>
</template>
<template v-slot:operation>
<el-button type='primary' @click='exportEvent' class='ml10' icon='el-icon-Download'>导出</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
</div>
</template>
<script setup lang='ts'>
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useDictData } from '@/stores/dictData'
defineOptions({
name: 'admin/flowTask/mytask'
})
const tableStore = new TableStore({
url: '/process-boot/flowable/task/todoList',
method: 'GET',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '流程名称', field: 'procDefName', width: 200 },
{ title: '流程类别', field: 'category', width: 200 },
{ title: '流程版本', field: 'procDefVersion' },
{ title: '提交时间', field: 'createTime' },
{
title: '流程状态', field: 'finishTime',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '进行中',
1: '已完成'
},
formatter(row: any) {
return row.finishTime == null ? '0' : '1'
}
},
{ title: '耗时', field: 'duration' },
{ title: '当前节点', field: 'taskName' },
{ title: '审核人', field: 'superiorsSubstation' }
],
beforeSearchFun: () => {
tableStore.table.params.beginTime = tableStore.table.params.startTime
tableStore.table.params.deptId = tableStore.table.params.deptIndex
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
</script>
<style lang="scss" scoped>
</style>
<template>
<div class='default-main'>
<TableHeader showCustomColumn>
<template v-slot:select>
<el-form-item label='筛选数据'>
<el-input v-model='tableStore.table.params.name' clearable placeholder='筛选数据' />
</el-form-item>
</template>
<template v-slot:operation>
<el-button type='primary' @click='exportEvent' class='ml10' icon='el-icon-Download'>导出</el-button>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef' :checkbox-config="checkboxConfig"></Table>
</div>
</template>
<script setup lang='ts'>
import { ElMessage } from 'element-plus'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref } from 'vue'
import { useDictData } from '@/stores/dictData'
defineOptions({
name: 'admin/flowTask/mytask'
})
const tableStore = new TableStore({
url: '/process-boot/flowable/task/todoList',
method: 'GET',
column: [
{ title: '序号', width: 80,formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} },
{ title: '流程名称', field: 'procDefName', width: 200 },
{ title: '流程类别', field: 'category', width: 200 },
{ title: '流程版本', field: 'procDefVersion' },
{ title: '提交时间', field: 'createTime' },
{
title: '流程状态', field: 'finishTime',
render: 'tag',
custom: {
0: 'warning',
1: 'success'
},
replaceValue: {
0: '进行中',
1: '已完成'
},
formatter(row: any) {
return row.finishTime == null ? '0' : '1'
}
},
{ title: '耗时', field: 'duration' },
{ title: '当前节点', field: 'taskName' },
{ title: '审核人', field: 'superiorsSubstation' }
],
beforeSearchFun: () => {
tableStore.table.params.beginTime = tableStore.table.params.startTime
tableStore.table.params.deptId = tableStore.table.params.deptIndex
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
</script>
<style lang="scss" scoped>
</style>

View File

@@ -1,7 +1,7 @@
<!--业务用户管理界面-->
<template>
<div class="default-main">
<TableHeader>
<TableHeader showCustomColumn>
<template v-slot:select>
<el-form-item label='流程名称'>
<el-input v-model='tableStore.table.params.name' clearable placeholder='流程名称' />