2024-04-29 09:02:06 +08:00
|
|
|
<!--流程模型表单页面-->
|
|
|
|
|
<template>
|
2024-05-06 13:57:06 +08:00
|
|
|
<div class='default-main'>
|
|
|
|
|
<TableHeader>
|
|
|
|
|
<template v-slot:select>
|
|
|
|
|
<el-form-item label='模型名称'>
|
|
|
|
|
<el-input
|
|
|
|
|
v-model='tableStore.table.params.searchKey'
|
|
|
|
|
clearable
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label='流程类别'>
|
|
|
|
|
<el-select v-model='tableStore.table.params.category' clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for='item in categoryList'
|
|
|
|
|
:key='item.id'
|
|
|
|
|
:label='item.name'
|
|
|
|
|
:value='item.code'
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:operation>
|
|
|
|
|
<el-button type='primary' class='ml10' :icon='Plus' @click='add'>新增</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</TableHeader>
|
|
|
|
|
<!--表格-->
|
|
|
|
|
<Table ref='tableRef' isGroup></Table>
|
|
|
|
|
<model-popup ref='modelPopup' />
|
|
|
|
|
</div>
|
2024-04-29 09:02:06 +08:00
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<script lang='ts' setup>
|
|
|
|
|
import { Plus } from '@element-plus/icons-vue'
|
|
|
|
|
import TableHeader from '@/components/table/header/index.vue'
|
|
|
|
|
import Table from '@/components/table/index.vue'
|
|
|
|
|
import TableStore from '@/utils/tableStore'
|
|
|
|
|
import { deleteWFForm, getFormById } from '@/api/process-boot/workflow/form'
|
|
|
|
|
import { nextTick, onMounted, provide, reactive, ref } from 'vue'
|
|
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
|
import { useDictData } from '@/stores/dictData'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import ModelPopup from '@/views/system/workflow/model/modelPopup.vue'
|
|
|
|
|
|
|
|
|
|
const { push } = useRouter()
|
|
|
|
|
const dictData = useDictData()
|
|
|
|
|
const categoryList = dictData.getBasicData('flow_category')
|
|
|
|
|
const modelPopup = ref()
|
2024-05-06 13:57:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-29 09:02:06 +08:00
|
|
|
const tableStore = new TableStore({
|
2024-05-06 13:57:06 +08:00
|
|
|
url: '/workflow-boot/flw/model/page',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
column: [
|
|
|
|
|
{ title: '序号', type: 'seq', width: 80 },
|
|
|
|
|
{ title: '流程名称', minWidth: '160', field: 'name' },
|
|
|
|
|
{
|
|
|
|
|
title: '流程分类', minWidth: '160', field: 'category',
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return categoryList.filter(item => item.code === row.cellValue)[0].name
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '模型版本', minWidth: '120', field: 'versionCode', type: 'html',
|
|
|
|
|
formatter: (obj: any) => {
|
|
|
|
|
const val = obj.row.versionCode
|
|
|
|
|
if (val) {
|
|
|
|
|
return `<a href='javascript:void(0);' style='color: #409EFF;text-decoration: none'>V${val}</a>`
|
|
|
|
|
} else {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '表单类型', minWidth: '160', field: 'formType',
|
|
|
|
|
formatter: (obj: any) => {
|
|
|
|
|
const val = obj.row.formType
|
|
|
|
|
if (val == 'DESIGN') {
|
|
|
|
|
return '系统表单'
|
|
|
|
|
} else {
|
|
|
|
|
return ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ title: '排序码', minWidth: '160', field: 'sortCode' },
|
|
|
|
|
{ title: '状态', minWidth: '160', field: 'modelStatus' },
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
align: 'center',
|
|
|
|
|
render: 'buttons',
|
|
|
|
|
minWidth: '230',
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
buttons: [
|
2024-04-29 09:02:06 +08:00
|
|
|
{
|
2024-05-06 13:57:06 +08:00
|
|
|
name: 'view',
|
|
|
|
|
title: '编辑',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
click: row => {
|
|
|
|
|
modelPopup.value.open('修改模型', row)
|
|
|
|
|
}
|
2024-04-29 09:02:06 +08:00
|
|
|
},
|
|
|
|
|
{
|
2024-05-06 13:57:06 +08:00
|
|
|
name: 'update',
|
|
|
|
|
title: '设计',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
click: row => {
|
|
|
|
|
push(`/admin/model/configSteps?id=${row.id}`)
|
|
|
|
|
}
|
2024-04-29 09:02:06 +08:00
|
|
|
},
|
|
|
|
|
{
|
2024-05-06 13:57:06 +08:00
|
|
|
name: 'deploy',
|
|
|
|
|
title: '部署',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
click: row => {
|
|
|
|
|
push(`/admin/form/formDesigner?id=${row.id}`)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'deploy',
|
|
|
|
|
title: '预览流程',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
click: row => {
|
|
|
|
|
push(`/admin/form/formDesigner?id=${row.id}`)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'deploy',
|
|
|
|
|
title: '历史版本',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
click: row => {
|
|
|
|
|
push(`/admin/form/formDesigner?id=${row.id}`)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'update',
|
|
|
|
|
title: '删除',
|
|
|
|
|
type: 'danger',
|
|
|
|
|
icon: 'el-icon-Delete',
|
|
|
|
|
render: 'confirmButton',
|
|
|
|
|
popconfirm: {
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
confirmButtonType: 'danger',
|
|
|
|
|
title: '确定删除吗?'
|
|
|
|
|
},
|
|
|
|
|
click: row => {
|
|
|
|
|
deleteWFForm(row.id).then(res => {
|
|
|
|
|
ElMessage.success('删除成功')
|
|
|
|
|
tableStore.index()
|
|
|
|
|
})
|
|
|
|
|
}
|
2024-04-29 09:02:06 +08:00
|
|
|
}
|
2024-05-06 13:57:06 +08:00
|
|
|
]
|
2024-04-29 09:02:06 +08:00
|
|
|
}
|
2024-05-06 13:57:06 +08:00
|
|
|
],
|
|
|
|
|
beforeSearchFun: () => {
|
|
|
|
|
for (let key in tableStore.table.params) {
|
|
|
|
|
if (tableStore.table.params[key] === '') {
|
|
|
|
|
delete tableStore.table.params[key]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2024-04-29 09:02:06 +08:00
|
|
|
})
|
|
|
|
|
//新增表单
|
|
|
|
|
const add = () => {
|
2024-05-06 13:57:06 +08:00
|
|
|
modelPopup.value.open('新增模型')
|
2024-04-29 09:02:06 +08:00
|
|
|
}
|
|
|
|
|
|
2024-05-06 13:57:06 +08:00
|
|
|
tableStore.table.params.searchKey = ''
|
|
|
|
|
tableStore.table.params.category = ''
|
2024-04-29 09:02:06 +08:00
|
|
|
provide('tableStore', tableStore)
|
|
|
|
|
onMounted(() => {
|
2024-05-06 13:57:06 +08:00
|
|
|
// 加载数据
|
|
|
|
|
tableStore.index()
|
2024-04-29 09:02:06 +08:00
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
</style>
|