增加流程配置

This commit is contained in:
zhoulingpo
2023-04-19 16:31:51 +08:00
parent 53068704a9
commit fddd1fd95f
5 changed files with 799 additions and 22 deletions
+2 -1
View File
@@ -16,5 +16,6 @@ export default {
method: 'get',
params: data
})
}
},
//
}
+29 -21
View File
@@ -1,22 +1,30 @@
const routes = [
// 用户中心管理
{
path: '/userCenter',
name: 'userCenter',
component: () => import('../../views/Layout.vue'),
children: [
// 流程中心
{
path: 'processCenter',
name: 'processCenter',
component: () => import('../../views/userCenter/processCenter.vue'),
meta: {
crumb: ['流程中心']
}
},
]
}
]
export default routes
// 用户中心管理
{
path: '/userCenter',
name: 'userCenter',
component: () => import('../../views/Layout.vue'),
children: [
// 流程中心
{
path: 'processCenter',
name: 'processCenter',
component: () => import('../../views/userCenter/processCenter.vue'),
meta: {
crumb: ['流程中心']
}
},
// 流程配置
{
path: 'processConfig',
name: 'processConfig',
component: () => import('../../views/userCenter/processConfig/index.vue'),
meta: {
crumb: ['流程配置']
}
}
]
}
]
export default routes
@@ -0,0 +1,125 @@
<template>
<el-dialog :close-on-click-modal="false"
:visible="visible"
:title="title"
@close="closeDialog"
width="400px"
>
<div>
<el-form
ref="form"
:model="formData"
:rules="formRules"
class="label-input-form"
label-width="100px"
inline
>
<el-form-item label="流程类型" prop="category" class="add-form-item">
<el-select v-model="formData.category" placeholder="请选择流程类型" clearable>
<el-option v-for="opt in typeList" :value="opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<div slot="footer">
<el-button round class="common-button-default" icon="el-icon-close" @click="closeDialog">{{$t('m.cancel')}}</el-button>
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="confirmDialog">{{$t('m.confirm')}}</el-button>
</div>
</el-dialog>
</template>
<script>
const formData = {
category: '',
}
export default {
name: 'EditProcessClassification',
props: ['data', 'visible'],
data() {
return {
formData: {},
formRules: {},
typeList: [] // 类型下拉框
}
},
computed: {
title() {
return !!this.data ? '编辑' : '新增'
}
},
watch: {
data(newValue) {
this.formData = newValue || {...formData}
},
visible(newValue) {
this.formData = this.data || {...formData}
}
},
mounted() {
this.formData = this.data || {...formData}
},
created() {
this.queryTablePage()
},
methods: {
// 查询、加载表格
queryTablePage () {
const formData = {
// page: this.pageNo,
// pageSize: this.$store.getters.userInfo.configContent,
// standNumber: this.searchForm.standardKey
}
this.$http.get('lawss/activiti/categoryList',
formData,
{
_this: this,
loading: 'tableDataLoading'
},
res => {
this.typeList = res.result.map(item => {
return {
label: item.type,
value: item.objectId
}
})
// this.total = res.data.count
}, e => {})
},
closeDialog() {
// this.visible = false
this.$emit('close')
this.formData = {}
},
confirmDialog() {
const url = !this.data ? 'lawss/activiti/addCategory' : 'lawss/activiti/updatModel'
const formData = {
modelId: this.formData.id,
categoryId: this.formData.category
}
this.$http.get(url, formData, {
_this: this
}, res => {
if (res.success) {
console.log('新增/编辑成功')
this.$emit('success')
this.$emit('close')
}
}, e => {
})
}
}
}
</script>
<style lang="" scoped>
</style>
@@ -0,0 +1,103 @@
<template>
<el-dialog :close-on-click-modal="false"
:visible="visible"
:title="title"
:before-close="closeDialog"
width="400px"
>
<div>
<el-form
ref="formData"
:model="formData"
:rules="formRules"
class="label-input-form"
label-width="100px"
inline
>
<el-form-item label="流程类型名称" prop="type" class="add-form-item">
<el-input v-model="formData.type" placeholder="请输入流程类型名称" ></el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer">
<el-button round class="common-button-default" icon="el-icon-close" @click="closeDialog">{{$t('m.cancel')}}</el-button>
<el-button round class="common-button-primary" icon="el-icon-check" type="primary" @click="confirmDialog">{{$t('m.confirm')}}</el-button>
</div>
</el-dialog>
</template>
<script>
const formData = {
type: '',
}
export default {
name: 'EditProcessClassification',
props: ['data', 'visible'],
data() {
return {
formData: {},
formRules: {
type: [
{ required: true, message: '请输入流程类型名称', trigger: 'change' }
]
}
}
},
computed: {
title() {
return !!this.data ? '编辑' : '新增'
}
},
watch: {
data(newValue) {
this.formData = newValue || {...formData}
this.$refs['formData'].resetFields()
},
visible(newValue) {
this.formData = this.data || {...formData}
}
},
mounted() {
this.formData = this.data || {...formData}
},
methods: {
closeDialog() {
// this.visible = false
this.$refs['formData'].resetFields()
this.$emit('close')
this.formData = {}
},
confirmDialog() {
const url = !this.data ? 'lawss/activiti/addCategory' : 'lawss/activiti/editCategory'
const formData = {
objectId: this.formData.objectId,
type: this.formData.type
}
this.$refs['formData'].validate((valid) => {
if (valid) {
this.$http.postData(url, formData, {
_this: this
}, res => {
if (res.success) {
console.log('新增/编辑成功')
this.$emit('success')
this.$emit('close')
}
}, e => {
})
}
})
}
}
}
</script>
<style lang="" scoped>
</style>
@@ -0,0 +1,540 @@
<template>
<div style="height: 100%;background-color: #fff;position: relative;overflow: hidden;">
<div style="height:50px;margin-top: 20px;overflow:hidden;">
<el-form class="hight_form label-input-form" :modal="processForm" :inline="true"
label-width="103px" @keyup.enter.native="queryTablePage()">
<el-col :xl="6" :lg="8" >
<el-form-item label="流程名称:" prop="name" class="search-item search-item-last">
<el-input :maxlength='100' v-model="processForm.name"
placeholder="请输入流程名称"
clearable/>
</el-form-item>
</el-col>
<el-col :xl=" 6" :lg="8">
<el-form-item class="btn-box">
<el-button size="small" type="primary"
class="common-button-primary img-button"
@click="queryTablePage()">查询
</el-button>
<el-button size="small" class="common-button-default img-button"
@click="clearAllSearchs('standCommonlySearch')">
重置
</el-button>
</el-form-item>
</el-col>
</el-form>
</div>
<div class="action-bar" style="text-align: left;width:100%;">
<el-button
size="small"
type="primary"
class="common-button-primary img-button"
@click="addRow"
>新增
</el-button>
</div>
<div style="height: 100%;">
<!--<table-tools-bar>-->
<!-- <div slot="left">-->
<!-- <div class="search-area">-->
<!-- <el-form :model="searchForm" inline class="label-input-form">-->
<!-- <el-form-item :label="$t('m.standardNumAndName')" prop="standardKey" class="search-item">-->
<!-- <el-input-->
<!-- v-model="searchForm.standardKey"-->
<!-- :placeholder="$t('m.standardNumAndNameTips')"-->
<!-- clearable-->
<!-- :maxlength="100"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item class="search-item btn-box">-->
<!-- <el-button-->
<!-- icon="el-icon-search"-->
<!-- type="primary"-->
<!-- class="common-button-primary"-->
<!-- round-->
<!-- @click="searchBtn"-->
<!-- ></el-button>-->
<!-- </el-form-item>-->
<!-- <el-form-item class="search-item btn-box">-->
<!-- <el-button-->
<!-- class="common-button-default"-->
<!-- icon="el-icon-refresh-left"-->
<!-- round-->
<!-- @click="resetSearchForm">{{$t('m.clearQuery')}}</el-button>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
<!-- </div>-->
<!-- </div>-->
<!--</table-tools-bar>-->
<!-- v-btn-permission="'XBRKH5BP5K'"-->
<div class="content">
<loading :loading="tableDataLoading">加载中...</loading>
<el-table
border
ref="selection"
:data="tableList"
tooltip-effect="dark"
style="width: 100%;"
height="100%"
@sort-change="sortChange($event, 'queryTablePage')"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
row-key="id"
>
<el-table-column
type="index"
width="55"
label="序号"
align="center">
</el-table-column>
<el-table-column
prop="name"
label="流程名称"
>
</el-table-column>
<el-table-column
prop="categoryName"
label="流程类型"
>
</el-table-column>
<el-table-column
prop="createTime" sortable="custom"
label="创建时间">
<template slot-scope="scope">
<span>{{$moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss')}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="60" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<el-button type="text" class="text" style="padding: 0">更多</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-btn-permission="'B44TL4SB6RRC6MNLBYMS'" :command="[scope.row, '编辑']">
编辑
</el-dropdown-item>
<el-dropdown-item v-btn-permission="'THJ77DKLPVHP9FHU7BQ6'" :command="[scope.row, '部署']">
部署
</el-dropdown-item>
<el-dropdown-item v-btn-permission="'HHD8BQ2DM4T3MFY73GXL'" :command="[scope.row, '复制']">
复制
</el-dropdown-item>
<el-dropdown-item v-btn-permission="'CK8WF2ESAS7XV7MSFW5X'" :command="[scope.row, '删除']">
删除
</el-dropdown-item>
<el-dropdown-item v-btn-permission="'7U5RD92APKFDYQ8YWQ2S'" :command="[scope.row, '流程']">
流程人员配置
</el-dropdown-item>
<el-dropdown-item v-btn-permission="'SQHZVHRSX69SD96XRBSQ'" :command="[scope.row, '预设']" v-if="processId.indexOf(scope.row.id)>-1">
预设人员配置
</el-dropdown-item>
<el-dropdown-item v-btn-permission="'HVTVWZ32Y32XT7XXDYF9'" :command="[scope.row, '提示']">
提示语配置
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :total="total" :page="pageNo" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
<edit-process
:visible="editRowDialogVisible"
:data="editRowDialogData"
@close="handleEditRowDialogClose"
@success="handleEditRowDialogSuccess"
></edit-process>
<el-dialog :close-on-click-modal="false"
:visible="visible"
:title="title"
@close="closeDialog"
width="400px"
>
<el-form
ref="form"
:model="formData"
class="label-input-form"
label-width="100px"
inline
>
<el-form-item label="流程类型" prop="category" class="add-form-item">
<el-select v-model="formData.category" placeholder="请选择流程类型" clearable>
<el-option v-for="opt in typeList" :value="opt.value" :key="opt.value" :label="opt.label">{{
opt.label}}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="模型名称" class="add-form-item">
<el-input
v-model="formData.name"
placeholder="请输入模型名称"
clearable
:maxlength="100"></el-input>
</el-form-item>
<el-form-item label="模型描述" class="add-form-item">
<el-input
v-model="formData.desc"
placeholder="请输入模型描述"
clearable
:maxlength="100"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button size="small" class="common-button-default" @click="closeDialog">
取消
</el-button>
<el-button size="small" class="common-button-primary" type="primary"
@click="confirmDialog">确认
</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import EditProcess from './components/EditProcess'
export default {
name: 'ProcessClassification',
components: { EditProcess },
data () {
return {
tableDataLoading: false,
total: 0,
visible: false,
formData: {},
title: '添加流程',
selectRoleId: '',
typeList: [],
searchForm: {
standardKey: ''
},
pageNo: this.$route.params.page ? (+this.$route.params.page) : 1,
pageSize: 10,
tableList: [],
editRowDialogVisible: false,
editRowDialogData: undefined, // 新增时为 undefined null 或者 false 即可
nowOrder: 'prder',
processId: ['6450334', '6465017', '6482501', '6482508', '6485001', '6482515'],
processForm: {
name: ''
}
}
},
methods: {
// 表格排序
sortChange (sortObj, tableName) {
console.log(sortObj)
if (sortObj.order === 'ascending') {
this.nowOrder = 'asc'
} else if (sortObj.order === 'descending') {
this.nowOrder = 'desc'
} else {
this.nowOrder = 'prder'
}
this[tableName]()
},
// 根据条件查询信息
searchBtn () {
this.resetPageNo()
this.queryTablePage()
},
closeDialog () {
this.visible = false
},
confirmDialog () {
const formData = {
category: this.formData.category,
desc: this.formData.desc,
name: this.formData.name
}
this.$http.get('lawss/activiti/createModel',
formData,
{
_this: this,
loading: 'tableDataLoading'
},
res => {
if (res.success) {
this.$message.warning(res.message)
this.visible = false
this.queryTablePage()
}
}, e => {
})
},
/**
* 重置搜索表单并重新加载表格数据
*/
resetSearchForm () {
this.searchForm.standardKey = ''
// this.resetSearchForm()
this.queryTablePage()
},
pageChange (page) {
this.pageNo = page
this.queryTablePage()
},
pageSizeChange () {
this.queryTablePage()
},
resetPageNo () {
this.pageNo = 1
},
querytypeList () {
const formData = {
...this.processForm
// page: this.pageNo,
// pageSize: this.$store.getters.userInfo.configContent,
// standNumber: this.searchForm.standardKey
}
this.$http.get('lawss/activiti/categoryList',
formData,
{
_this: this,
loading: 'tableDataLoading'
},
res => {
this.typeList = res.result.map(item => {
return {
label: item.type,
value: item.objectId
}
})
// this.total = res.data.count
}, e => {
})
},
// 查询、加载表格
queryTablePage () {
const formData = {
current: this.pageNo,
size: this.$store.getters.userInfo.configContent,
order: this.nowOrder,
...this.processForm
// standNumber: this.searchForm.standardKey
}
this.$http.get('lawss/activiti/modelListPage',
formData,
{
_this: this,
loading: 'tableDataLoading'
},
res => {
if (res.success) {
this.tableList = res.result.records
this.total = res.result.total
} else {
this.tableList = []
this.total = 0
this.$message.warning(res.message)
}
}, e => {
})
},
clearAllSearchs () {
this.processForm = { name: '' }
this.queryTablePage()
},
// 点击查看
handlePreview (item) {
console.log('item', item)
const routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.id,
pageType: 'INLAND_STAND'
}
})
window.open(routeUrl.href, '_blank')
},
// 表格行 - 点击更多 事件
handleCommand (command) {
switch (command[1]) {
case '编辑':
this.$router.push({
path: '/ProcessMapping',
query: { id: command[0].id }
})
// this.editRow(command[0])
break
case '删除':
this.deleteRow(command[0])
break
case '复制':
this.copyModel(command[0].id)
break
case '部署':
this.deploy(command[0].id)
break
case '流程':
this.nodeConfiguration(command[0])
break
case '预设':
this.preSet(command[0])
break
case '提示':
this.showTip(command[0])
break
}
},
deploy (modelId) {
this.$confirm('确认部署该条数据?', '确认部署', {
confirmButtonText: '确定',
cancelButtonText: '取消',
confirmButtonClass: 'common-button-primary',
type: 'warning'
}).then(() => {
this.$http.get('lawss/activiti/deploy', {
modelId: modelId
}, {
_this: this
}, res => {
if (res.success) {
this.$message.warning(res.message)
this.queryTablePage()
}
}, e => {
})
}).catch(() => {
})
},
copyModel (modelId) {
this.$confirm('确认复制该条数据?', '确认复制', {
confirmButtonText: '确定',
cancelButtonText: '取消',
confirmButtonClass: 'common-button-primary',
type: 'warning'
}).then(() => {
this.$http.get('/lawss/activiti/copyModel', {
modelId: modelId
}, {
_this: this
}, res => {
if (res.success) {
this.$router.push({
path: '/ProcessMapping',
query: { id: res.result }
})
}
}, e => {
})
}).catch(() => {
})
},
// 删除
deleteRow (row) {
this.$confirm('确认删除该条数据?', '确认删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
confirmButtonClass: 'common-button-primary',
type: 'warning'
}).then(() => {
const id = row.id
const oDate1 = new Date('2021-09-22 15:00:00')
const oDate2 = new Date(row.createTime)
if (oDate1.getTime() > oDate2.getTime()) {
this.$message.warning('原始流程不可以删除')
} else {
this.$http.get('/lawss/activiti/deleteModel', {
modelId: id
}, {
_this: this
}, res => {
this.$message.success(res.message)
this.queryTablePage()
}, e => {
})
}
}).catch(() => {
})
},
preSet (row) {
row.page = this.pageNo
this.$router.push({
path: '/presetPersonnel',
query: { id: row.id }
})
},
nodeConfiguration (row) {
row.page = this.pageNo
this.$router.push({
path: '/nodeConfiguration',
query: row
})
},
showTip (row) {
row.page = this.pageNo
this.$router.push({
path: '/promptConfiguration',
query: row
})
},
editRow (row) {
this.editRowDialogData = { ...row }
this.editRowDialogVisible = true
},
handleEditRowDialogClose () {
this.editRowDialogVisible = false
},
handleEditRowDialogSuccess () {
this.queryTablePage()
},
addRow () {
this.visible = true
// this.$router.push({
// path: '/ProcessMapping',
// query:{id:0}
// })
// this.editRowDialogData = undefined
// this.editRowDialogVisible = true
}
},
created () {
// this.queryTablePage()
// this.querytypeList()
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 0 10px;
height: 100px;
}
::v-deep .label-input-form .el-input__inner{
border-radius: 20px;
}
.el-divider-low {
margin: 15px 0;
}
.search-area {
padding: 0;
}
.btn-group {
position: absolute;
bottom: 20px;
right: 20px;
background: #ffffff;
z-index: 999;
}
</style>