模型表单优化
This commit is contained in:
@@ -35,6 +35,16 @@ export const getById = (id: string) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除模型
|
||||||
|
*/
|
||||||
|
export const deleteModel = (id: string) => {
|
||||||
|
return createAxios({
|
||||||
|
url: MAPPING_PATH + '/delete?id=' + id,
|
||||||
|
method: 'GET'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id部署模型
|
* 根据id部署模型
|
||||||
*/
|
*/
|
||||||
@@ -69,15 +79,3 @@ export const updateModel = (data: any) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除流程模型
|
|
||||||
*/
|
|
||||||
export const deleteModel = (data: any) => {
|
|
||||||
let ids = [data]
|
|
||||||
return createAxios({
|
|
||||||
url: MAPPING_PATH + '/delete',
|
|
||||||
method: 'POST',
|
|
||||||
data: ids
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -798,7 +798,7 @@ const defaultProps = {
|
|||||||
const nonlinearDeviceTypeList = ref('')
|
const nonlinearDeviceTypeList = ref('')
|
||||||
//获取登陆用户姓名和部门
|
//获取登陆用户姓名和部门
|
||||||
const adminInfo = useAdminInfo()
|
const adminInfo = useAdminInfo()
|
||||||
console.log(adminInfo.$state, '打印登陆用户新信息')
|
// console.log(adminInfo.$state, '打印登陆用户新信息')
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
form.value = {
|
form.value = {
|
||||||
reporter: '', //填报人 1
|
reporter: '', //填报人 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--流程模型管理界面-->
|
<!--流程模型管理界面-->
|
||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class='default-main'>
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<template v-slot:select>
|
<template v-slot:select>
|
||||||
<!-- <el-form-item label='用户'>-->
|
<!-- <el-form-item label='用户'>-->
|
||||||
@@ -15,20 +15,20 @@
|
|||||||
<!-- </el-form-item>-->
|
<!-- </el-form-item>-->
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:operation>
|
<template v-slot:operation>
|
||||||
<el-button type="primary" @click="add" class="ml10" :icon="Plus">新增模型</el-button>
|
<el-button type='primary' @click='add' class='ml10' :icon='Plus'>新增模型</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<!--表格-->
|
<!--表格-->
|
||||||
<Table ref="tableRef" isGroup></Table>
|
<Table ref='tableRef' isGroup></Table>
|
||||||
<model-popup ref="modelPopup" />
|
<model-popup ref='modelPopup' />
|
||||||
<!-- 弹窗:表单详情 -->
|
<!-- 弹窗:表单详情 -->
|
||||||
<el-dialog title="表单详情" v-model="formDetailVisible" width="800">
|
<el-dialog title='表单详情' v-model='formDetailVisible' width='800'>
|
||||||
<form-create :rule="formDetailPreview.rule" :option="formDetailPreview.option" />
|
<form-create :rule='formDetailPreview.rule' :option='formDetailPreview.option' />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang='ts'>
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
@@ -36,12 +36,11 @@ import Table from '@/components/table/index.vue'
|
|||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import { onMounted, provide, ref } from 'vue'
|
import { onMounted, provide, ref } from 'vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { sgUserList } from '@/api/advance-boot/sgGroven/sgUser'
|
|
||||||
import { deleteSgScheme } from '@/api/advance-boot/sgGroven/sgScheme'
|
|
||||||
import ModelPopup from '@/views/system/bpm/model/modelPopup.vue'
|
import ModelPopup from '@/views/system/bpm/model/modelPopup.vue'
|
||||||
import { deployModel } from '@/api/bpm-boot/model'
|
import { deleteModel, deployModel } from '@/api/bpm-boot/model'
|
||||||
import { getById } from '@/api/bpm-boot/form'
|
import { getById } from '@/api/bpm-boot/form'
|
||||||
import { setConfAndFields2 } from '@/utils/formCreate'
|
import { setConfAndFields2 } from '@/utils/formCreate'
|
||||||
|
import { getSignSimpleList } from '@/api/bpm-boot/sign'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'governSchemeHistory'
|
name: 'governSchemeHistory'
|
||||||
@@ -58,7 +57,17 @@ const tableStore = new TableStore({
|
|||||||
{ title: '模型标识', field: 'key', width: 160 },
|
{ title: '模型标识', field: 'key', width: 160 },
|
||||||
{ title: '模型名称', field: 'name', width: 160 },
|
{ title: '模型名称', field: 'name', width: 160 },
|
||||||
{ title: '流程分类', field: 'categoryName', width: 150 },
|
{ title: '流程分类', field: 'categoryName', width: 150 },
|
||||||
{ title: '表单信息', field: 'formName', width: 170, },
|
{
|
||||||
|
title: '表单信息', field: 'formName', width: 170,
|
||||||
|
formatter: (obj: any) => {
|
||||||
|
const formType = obj.row.formType
|
||||||
|
if (formType == 20) {
|
||||||
|
return getFormNameByViewPath(obj.row.formCustomViewPath)
|
||||||
|
} else {
|
||||||
|
return obj.row.formName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
field: 'createTime',
|
field: 'createTime',
|
||||||
@@ -67,26 +76,40 @@ const tableStore = new TableStore({
|
|||||||
{
|
{
|
||||||
title: '最新部署的流程定义',
|
title: '最新部署的流程定义',
|
||||||
children: [
|
children: [
|
||||||
{ title: '模型版本', width: '150', field: 'processDefinition.version' },
|
{
|
||||||
|
title: '模型版本',
|
||||||
|
width: '150',
|
||||||
|
field: 'processDefinition.version',
|
||||||
|
type: 'html',
|
||||||
|
formatter: (obj: any) => {
|
||||||
|
if (obj.row.processDefinition) {
|
||||||
|
const val = obj.row.processDefinition.version
|
||||||
|
return `<a href='javascript:void(0);' style='color: #409EFF;text-decoration: none'>v${val}</a>`
|
||||||
|
} else {
|
||||||
|
return '未部署'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '激活状态',
|
title: '激活状态',
|
||||||
width: '150',
|
width: '150',
|
||||||
field: 'processDefinition.suspensionState',
|
field: 'processDefinition.suspensionState',
|
||||||
render: 'switch',
|
// render: 'switch',
|
||||||
activeValue: '1',
|
// activeValue: '1',
|
||||||
inactiveValue: '0',
|
// inactiveValue: '0',
|
||||||
onChangeField: (row: any, value) => {
|
// onChangeField: (row: any, value) => {
|
||||||
console.log(row, 444123, value)
|
// console.log(row, 444123, value)
|
||||||
value == 0 ? (value = 1) : (value = 0)
|
// value == 0 ? (value = 1) : (value = 0)
|
||||||
}
|
|
||||||
// custom: {
|
|
||||||
// 2: 'danger',
|
|
||||||
// 1: 'success'
|
|
||||||
// },
|
|
||||||
// replaceValue: {
|
|
||||||
// 2: '关闭',
|
|
||||||
// 1: '开启'
|
|
||||||
// }
|
// }
|
||||||
|
render: 'tag',
|
||||||
|
custom: {
|
||||||
|
2: 'danger',
|
||||||
|
1: 'success'
|
||||||
|
},
|
||||||
|
replaceValue: {
|
||||||
|
2: '关闭',
|
||||||
|
1: '开启'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{ title: '部署时间', width: '150', field: 'processDefinition.deploymentTime' }
|
{ title: '部署时间', width: '150', field: 'processDefinition.deploymentTime' }
|
||||||
]
|
]
|
||||||
@@ -141,7 +164,7 @@ const tableStore = new TableStore({
|
|||||||
title: '确定删除吗?'
|
title: '确定删除吗?'
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
deleteSgScheme(row.id).then(res => {
|
deleteModel(row.id).then(res => {
|
||||||
ElMessage.success('删除成功')
|
ElMessage.success('删除成功')
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
@@ -161,15 +184,31 @@ const tableStore = new TableStore({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const flowInfo = ref()
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
// 加载数据
|
// 加载数据
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
|
//加载流程标识
|
||||||
|
await getSignSimpleList().then(res => {
|
||||||
|
flowInfo.value = res.data
|
||||||
|
})
|
||||||
})
|
})
|
||||||
tableStore.table.params.userId = ''
|
tableStore.table.params.userId = ''
|
||||||
|
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
|
|
||||||
|
|
||||||
|
//获取流程标识的名称
|
||||||
|
const getFormNameByViewPath = (viewPath: string) => {
|
||||||
|
const nameItem = flowInfo.value.filter(item => item.viewPath == viewPath)
|
||||||
|
if (nameItem.length > 0) {
|
||||||
|
return nameItem[0].name
|
||||||
|
} else {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//新增用户信息
|
//新增用户信息
|
||||||
const add = () => {
|
const add = () => {
|
||||||
modelPopup.value.open('新增流程模型')
|
modelPopup.value.open('新增流程模型')
|
||||||
@@ -194,12 +233,13 @@ const handleDeployConfirm = (rowId: string) => {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
draggable: true,
|
draggable: true,
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
}).then(() => {
|
||||||
.then(() => {
|
|
||||||
handleDeploy(rowId)
|
handleDeploy(rowId)
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {
|
||||||
} catch {}
|
})
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDeploy = async (rowId: string) => {
|
const handleDeploy = async (rowId: string) => {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-form :inline='false' :model='formData' label-width='120px' :rules='rules' ref='formRef'>
|
<el-form :inline='false' :model='formData' label-width='120px' :rules='rules' ref='formRef'>
|
||||||
|
|
||||||
<el-form-item label='表单类型' prop='formType'>
|
<el-form-item label='表单类型' prop='formType' >
|
||||||
<el-radio-group v-model='formData.formType'>
|
<el-radio-group v-model='formData.formType' :disabled='!!formData.id'>
|
||||||
<el-radio border label='20'>业务表单</el-radio>
|
<el-radio border label='20'>业务表单</el-radio>
|
||||||
<el-radio border label='10'>流程表单</el-radio>
|
<el-radio border label='10'>流程表单</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<!-- <UploadImg v-model='formData.icon' :limit='1' height='128px' width='128px' />-->
|
<!-- <UploadImg v-model='formData.icon' :limit='1' height='128px' width='128px' />-->
|
||||||
<!-- </el-form-item>-->
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
<el-form-item label='流程标识' prop='key'>
|
<el-form-item label='流程标识' prop='key' v-if='formData.formType == 20'>
|
||||||
<el-select v-model='formData.key' clearable style='width: 100%' @change='changeSign'>
|
<el-select v-model='formData.key' clearable style='width: 100%' @change='changeSign'>
|
||||||
<el-option
|
<el-option
|
||||||
v-for='item in flowInfo'
|
v-for='item in flowInfo'
|
||||||
@@ -50,10 +50,13 @@
|
|||||||
placeholder='请选择流程标识'
|
placeholder='请选择流程标识'
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label='流程表单' prop='formId' v-if='formData.formType == "10"'>
|
<el-form-item label='流程标识' prop='key' v-else>
|
||||||
|
<el-input v-model='formData.key' />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label='流程表单' prop='formId' v-if='formData.formType == 10'>
|
||||||
<el-select v-model='formData.formId' clearable style='width: 100%'>
|
<el-select v-model='formData.formId' clearable style='width: 100%'>
|
||||||
<el-option
|
<el-option
|
||||||
v-for='form in formList'
|
v-for='form in formList'
|
||||||
@@ -112,7 +115,7 @@ const formData = reactive({
|
|||||||
category: '',
|
category: '',
|
||||||
icon: '',
|
icon: '',
|
||||||
description: '',
|
description: '',
|
||||||
formType: '20',
|
formType: 20,
|
||||||
formCustomCreatePath: '',
|
formCustomCreatePath: '',
|
||||||
formCustomViewPath: '',
|
formCustomViewPath: '',
|
||||||
formId: ''
|
formId: ''
|
||||||
@@ -157,7 +160,7 @@ const open = async (text: string, data?: any) => {
|
|||||||
formData[key] = ''
|
formData[key] = ''
|
||||||
}
|
}
|
||||||
//随机一个key给该模型
|
//随机一个key给该模型
|
||||||
formData.formType = '20'
|
formData.formType = 20
|
||||||
}
|
}
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user