清理工作流功能
This commit is contained in:
@@ -1,164 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="formData" label-position="right" label-width="80px">
|
||||
<el-form-item label="请假原因:">
|
||||
<el-input
|
||||
v-model="formData.cause"
|
||||
clearable
|
||||
placeholder="请输入"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="开始时间:">
|
||||
<el-date-picker
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
v-model="formData.startTime"
|
||||
clearable
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="结束时间:">
|
||||
<el-date-picker
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
v-model="formData.endTime"
|
||||
clearable
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="this.wf.clazz == 'start'" @click="start" type="primary"
|
||||
>启动</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="this.wf.clazz == 'userTask'"
|
||||
@click="complete('yes')"
|
||||
type="primary"
|
||||
>同意</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="this.wf.clazz == 'userTask'"
|
||||
@click="complete('no')"
|
||||
type="primary"
|
||||
>拒绝</el-button
|
||||
>
|
||||
<el-button @click="back" type="primary">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
startWorkflow,
|
||||
completeWorkflowMove
|
||||
} from "@/api/workflowProcess";
|
||||
import infoList from "@/mixins/infoList";
|
||||
import { mapGetters } from "vuex";
|
||||
export default {
|
||||
name: "ExaWfLeave",
|
||||
mixins: [infoList],
|
||||
props:{
|
||||
business:{
|
||||
type:Object,
|
||||
default:function(){return null}
|
||||
},
|
||||
wf:{
|
||||
type:Object,
|
||||
default:function(){return{}}
|
||||
},
|
||||
workflowMoveID:{
|
||||
type:Number,
|
||||
default:0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
cause:"",
|
||||
startTime:new Date(),
|
||||
endTime:new Date(),
|
||||
}
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
canShow(){
|
||||
if(this.wf.assignType == "user"){
|
||||
if(this.wf.assginValue.indexOf(","+this.userInfo.ID+",")>0){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}else if(this.wf.assign_type == "authority"){
|
||||
if(this.wf.assginValue.indexOf(","+this.userInfo.authorityId+",")>0){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
},
|
||||
...mapGetters("user", ["userInfo"])
|
||||
},
|
||||
methods: {
|
||||
async start() {
|
||||
const res = await startWorkflow({
|
||||
business:this.formData,
|
||||
wf:{
|
||||
workflowMoveID:this.workflowMoveID,
|
||||
businessId:0,
|
||||
businessType:"leave",
|
||||
workflowProcessID:this.wf.workflowProcessID,
|
||||
workflowNodeID:this.wf.id,
|
||||
promoterID:this.userInfo.ID,
|
||||
operatorID:this.userInfo.ID,
|
||||
action:"create",
|
||||
param:""
|
||||
}
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message({
|
||||
type:"success",
|
||||
message:"启动成功"
|
||||
})
|
||||
this.back()
|
||||
}
|
||||
},
|
||||
async complete(param){
|
||||
const res = await completeWorkflowMove({
|
||||
business:this.formData,
|
||||
wf:{
|
||||
workflowMoveID:this.workflowMoveID,
|
||||
businessID:this.formData.ID,
|
||||
businessType:"leave",
|
||||
workflowProcessID:this.wf.workflowProcessID,
|
||||
workflowNodeID:this.wf.id,
|
||||
promoterID:this.userInfo.ID,
|
||||
operatorID:this.userInfo.ID,
|
||||
action:"complete",
|
||||
param:param
|
||||
}
|
||||
})
|
||||
if(res.code == 0){
|
||||
this.$message({
|
||||
type:"success",
|
||||
message:"提交成功"
|
||||
})
|
||||
this.back()
|
||||
}
|
||||
},
|
||||
back(){
|
||||
this.$router.go(-1)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
if(this.business){
|
||||
this.formData = this.business
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -1,15 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<keep-alive>
|
||||
<router-view v-if="$route.meta.keepAlive"></router-view>
|
||||
</keep-alive>
|
||||
<router-view v-if="!$route.meta.keepAlive"></router-view>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Workflow",
|
||||
};
|
||||
</script>
|
||||
<style lang="scss"></style>
|
||||
@@ -1,96 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
ref="multipleTable"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
tooltip-effect="dark"
|
||||
>
|
||||
<el-table-column label="ID" prop="ID" width="60"></el-table-column>
|
||||
<el-table-column
|
||||
label="流程名称"
|
||||
prop="workflowProcess.label"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="发起人"
|
||||
prop="promoter.nickName"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column label="节点日期" width="180">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.CreatedAt | formatDate
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="业务代码"
|
||||
prop="businessType"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="当前节点"
|
||||
prop="workflowNode.label"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column label="流程状态" width="120">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
{{ scope.row.isActive ? '进行中' : '已结束' }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="详细介绍"
|
||||
prop="workflowProcess.description"
|
||||
min-width="200"
|
||||
></el-table-column>
|
||||
<el-table-column label="按钮组">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="handle(scope.row)">处理</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatTimeToStr } from '@/utils/date'
|
||||
import {getMyNeed} from "@/api/workflowProcess"
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
tableData:[]
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
handle(row){
|
||||
this.$router.push({
|
||||
name: "workflowUse",
|
||||
query: {
|
||||
workflowMoveID: row.ID
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created(){
|
||||
const res = await getMyNeed()
|
||||
if(res.code == 0){
|
||||
this.tableData = res.data.wfms
|
||||
}
|
||||
|
||||
},
|
||||
filters:{
|
||||
formatDate: function(time) {
|
||||
if (time != null && time != '') {
|
||||
var date = new Date(time)
|
||||
return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,102 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
ref="multipleTable"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
tooltip-effect="dark"
|
||||
>
|
||||
<el-table-column
|
||||
label="ID"
|
||||
prop="ID"
|
||||
width="60"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="流程名称"
|
||||
prop="workflowProcess.label"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="发起人"
|
||||
prop="promoter.nickName"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column label="节点日期" width="180">
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.CreatedAt | formatDate
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="业务代码"
|
||||
prop="businessType"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="当前节点"
|
||||
prop="workflowNode.label"
|
||||
width="120"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="流程状态"
|
||||
width="120"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
{{scope.row.isActive?"进行中":"已结束"}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="详细介绍"
|
||||
prop="workflowProcess.description"
|
||||
min-width="200"
|
||||
></el-table-column>
|
||||
<el-table-column label="按钮组">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="view(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { formatTimeToStr } from '@/utils/date'
|
||||
import {getMyStated} from "@/api/workflowProcess"
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
tableData:[]
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
view(row){
|
||||
this.$router.push({
|
||||
name: "workflowUse",
|
||||
query: {
|
||||
workflowMoveID: row.ID
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created(){
|
||||
const res = await getMyStated()
|
||||
if(res.code == 0){
|
||||
this.tableData = res.data.wfms
|
||||
}
|
||||
},
|
||||
filters:{
|
||||
formatDate: function(time) {
|
||||
if (time != null && time != '') {
|
||||
var date = new Date(time)
|
||||
return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,186 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<p style="text-align:center;padding-bottom:4px">当前版本为0.01试用版本,可满足最简单的流程功能,未完成功能,如脚本节点,邮件节点等目前暂时注释入口,期待大家PR</p>
|
||||
<el-button
|
||||
size="small"
|
||||
style="float: right; margin-top: 6px; margin-right: 6px"
|
||||
@click="saveXML"
|
||||
>导出XML</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
style="float: right; margin-top: 6px; margin-right: 6px"
|
||||
@click="saveImg"
|
||||
>导出图片</el-button
|
||||
>
|
||||
<el-popover placement="bottom" width="160" v-model="visible">
|
||||
<p>确认流程无误并保存吗</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="visible = false"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="save"
|
||||
:disabled="$route.query.type == 'view'"
|
||||
>确定</el-button
|
||||
>
|
||||
</div>
|
||||
<el-button
|
||||
size="small"
|
||||
slot="reference"
|
||||
style="float: right; margin-top: 6px; margin-right: 6px"
|
||||
>保存流程</el-button
|
||||
>
|
||||
</el-popover>
|
||||
|
||||
<gva-wfd
|
||||
ref="wfd"
|
||||
:data="demoData"
|
||||
v-if="done"
|
||||
:height="600"
|
||||
:users="users"
|
||||
:authorities="authorities"
|
||||
:groups="groups"
|
||||
:categorys="categorys"
|
||||
:lang="lang"
|
||||
:propProcessModel="processModel"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
findWorkflowProcess,
|
||||
createWorkflowProcess,
|
||||
updateWorkflowProcess
|
||||
} from "@/api/workflowProcess"; // 此处请自行替换地址
|
||||
import gvaWfd from "@/components/gva-wfd";
|
||||
import { getUserList } from "@/api/user";
|
||||
import { getAuthorityList } from "@/api/authority";
|
||||
export default {
|
||||
name: "Workflow",
|
||||
components: {
|
||||
gvaWfd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
lang: "zh",
|
||||
done:false,
|
||||
demoData: {
|
||||
nodes: [],
|
||||
edges: []
|
||||
},
|
||||
wkType:"create",
|
||||
users: [],
|
||||
authorities: [],
|
||||
processModel:{
|
||||
id: '',
|
||||
name: '',
|
||||
category: '',
|
||||
clazz: 'process',
|
||||
dataObjs: [],
|
||||
signalDefs: [],
|
||||
messageDefs: [],
|
||||
},
|
||||
groups: [],
|
||||
categorys: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async save() {
|
||||
this.visible = false;
|
||||
const obj = this.$refs["wfd"].graph.save()
|
||||
const processModel = this.$refs["wfd"].processModel
|
||||
processModel.edges = obj.edges
|
||||
processModel.nodes = JSON.parse(JSON.stringify(obj.nodes))
|
||||
processModel.nodes.map(item=>{
|
||||
if(item.assignValue){
|
||||
item.assignValue = ","+String(item.assignValue)+","
|
||||
}
|
||||
})
|
||||
if(!processModel.id){
|
||||
this.$message({
|
||||
type:"error",
|
||||
message:"流程id必填,点击空白处填写流程基本信息"
|
||||
})
|
||||
return
|
||||
}
|
||||
if(this.$route.query.type == 'edit'){
|
||||
const res = await updateWorkflowProcess(processModel)
|
||||
if(res.code == 0){
|
||||
this.$message({
|
||||
type:"success",
|
||||
message:"编辑成功"
|
||||
})
|
||||
}
|
||||
}else{
|
||||
const res = await createWorkflowProcess(processModel)
|
||||
if(res.code == 0){
|
||||
this.$message({
|
||||
type:"success",
|
||||
message:"创建成功"
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
saveXML() {
|
||||
console.log(this.$refs["wfd"].graph.saveXML());
|
||||
},
|
||||
saveImg() {
|
||||
console.log(this.$refs["wfd"].graph.saveImg());
|
||||
},
|
||||
fmtAuthority(authorityList,list){
|
||||
authorityList.map(item => {
|
||||
list.push({
|
||||
id: item.authorityId,
|
||||
name: item.authorityName
|
||||
});
|
||||
if(item.children){
|
||||
this.fmtAuthority(item.children,list)
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
const userRes = await getUserList({ page: 1, pageSize: 9999999 });
|
||||
if (userRes.code == 0) {
|
||||
userRes.data.list.map(item => {
|
||||
this.users.push({ id: item.ID, name: item.nickName });
|
||||
});
|
||||
}
|
||||
const authorityRes = await getAuthorityList({ page: 1, pageSize: 9999999 });
|
||||
if (authorityRes.code == 0) {
|
||||
this.fmtAuthority(authorityRes.data.list,this.authorities)
|
||||
}
|
||||
if(this.$route.query.id){
|
||||
const res = await findWorkflowProcess({ id: this.$route.query.id });
|
||||
this.disabled = this.$route.query.type == "view"
|
||||
if(res.code == 0){
|
||||
res.data.reworkflowProcess.nodes.map(item=>{
|
||||
if(item.assignValue){
|
||||
const watiUseArr =item.assignValue.substr(1,item.assignValue.length-2).split(",")
|
||||
if(item.assignType == 'user'){
|
||||
item.assignValue = []
|
||||
watiUseArr.map(i => {
|
||||
item.assignValue.push(Number(i))
|
||||
})
|
||||
}else{
|
||||
item.assignValue = watiUseArr
|
||||
}
|
||||
}
|
||||
})
|
||||
this.demoData.nodes = res.data.reworkflowProcess.nodes
|
||||
delete res.data.reworkflowProcess.nodes
|
||||
this.demoData.edges = res.data.reworkflowProcess.edges
|
||||
delete res.data.reworkflowProcess.edges
|
||||
this.processModel = res.data.reworkflowProcess
|
||||
}
|
||||
this.wkType = this.$route.query.type
|
||||
}
|
||||
this.done = true
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,217 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="search-term">
|
||||
<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
|
||||
<el-form-item label="流程名称">
|
||||
<el-input placeholder="搜索条件" v-model="searchInfo.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程标题">
|
||||
<el-input placeholder="搜索条件" v-model="searchInfo.label"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="onSubmit" type="primary">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-popover placement="top" v-model="deleteVisible" width="160">
|
||||
<p>确定要删除吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button @click="deleteVisible = false" size="mini" type="text">取消</el-button>
|
||||
<el-button @click="onDelete" size="mini" type="primary">确定</el-button>
|
||||
</div>
|
||||
<el-button icon="el-icon-delete" size="mini" slot="reference" type="danger">批量删除</el-button>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
@selection-change="handleSelectionChange"
|
||||
border
|
||||
ref="multipleTable"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
tooltip-effect="dark"
|
||||
>
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column label="日期" width="180">
|
||||
<template slot-scope="scope">{{scope.row.CreatedAt|formatDate}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程名称" prop="name" width="120"></el-table-column>
|
||||
|
||||
<el-table-column label="分类" prop="category" width="120"></el-table-column>
|
||||
|
||||
<el-table-column label="类型" prop="clazz" width="120"></el-table-column>
|
||||
|
||||
<el-table-column label="流程标题" prop="label" width="120"></el-table-column>
|
||||
|
||||
<el-table-column label="是否隐藏图标" prop="hideIcon" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{
|
||||
scope.row.hideIcon | formatBoolean
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="详细介绍" prop="description" width="120"></el-table-column>
|
||||
|
||||
<el-table-column label="按钮组">
|
||||
<template slot-scope="scope">
|
||||
<el-button class="table-button" @click="useWorkflowProcess(scope.row)" size="success">启动</el-button>
|
||||
<el-button
|
||||
class="table-button"
|
||||
@click="updateWorkflowProcess(scope.row)"
|
||||
size="small"
|
||||
type="primary"
|
||||
>变更</el-button>
|
||||
<el-button
|
||||
class="table-button"
|
||||
@click="viewWorkflowProcess(scope.row)"
|
||||
size="small"
|
||||
type="warning"
|
||||
>查看</el-button>
|
||||
<el-popover placement="top" width="160" v-model="scope.row.visible">
|
||||
<p>确定要删除吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
|
||||
<el-button type="primary" size="mini" @click="deleteWorkflowProcess(scope.row)">确定</el-button>
|
||||
</div>
|
||||
<el-button type="danger" icon="el-icon-delete" size="mini" slot="reference">删除</el-button>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-size="pageSize"
|
||||
:page-sizes="[10, 30, 50, 100]"
|
||||
:style="{ float: 'right', padding: '20px' }"
|
||||
:total="total"
|
||||
@current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
deleteWorkflowProcess,
|
||||
deleteWorkflowProcessByIds,
|
||||
getWorkflowProcessList
|
||||
} from "@/api/workflowProcess"; // 此处请自行替换地址
|
||||
import { formatTimeToStr } from "@/utils/date";
|
||||
import infoList from "@/mixins/infoList";
|
||||
|
||||
export default {
|
||||
name: "WorkflowProcess",
|
||||
mixins: [infoList],
|
||||
data() {
|
||||
return {
|
||||
listApi: getWorkflowProcessList,
|
||||
dialogFormVisible: false,
|
||||
deleteVisible: false,
|
||||
multipleSelection: []
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
formatDate: function(time) {
|
||||
if (time != null && time != "") {
|
||||
var date = new Date(time);
|
||||
return formatTimeToStr(date, "yyyy-MM-dd hh:mm:ss");
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
formatBoolean: function(bool) {
|
||||
if (bool != null) {
|
||||
return bool ? "是" : "否";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//条件搜索前端看此方法
|
||||
onSubmit() {
|
||||
this.page = 1;
|
||||
this.pageSize = 10;
|
||||
if (this.searchInfo.hideIcon == "") {
|
||||
this.searchInfo.hideIcon = null;
|
||||
}
|
||||
this.getTableData();
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
async onDelete() {
|
||||
const ids = [];
|
||||
this.multipleSelection &&
|
||||
this.multipleSelection.map(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
const res = await deleteWorkflowProcessByIds({ ids });
|
||||
if (res.code == 0) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功"
|
||||
});
|
||||
if (this.tableData.length == ids.length) {
|
||||
this.page--;
|
||||
}
|
||||
this.deleteVisible = false;
|
||||
this.getTableData();
|
||||
}
|
||||
},
|
||||
async updateWorkflowProcess(row) {
|
||||
this.$router.push({
|
||||
name: "workflowCreate",
|
||||
query: {
|
||||
id: row.id,
|
||||
type: "edit"
|
||||
}
|
||||
});
|
||||
},
|
||||
async useWorkflowProcess(row) {
|
||||
this.$router.push({
|
||||
name: "workflowUse",
|
||||
query: {
|
||||
workflowId: row.id
|
||||
}
|
||||
});
|
||||
},
|
||||
async viewWorkflowProcess(row) {
|
||||
this.$router.push({
|
||||
name: "workflowCreate",
|
||||
query: {
|
||||
id: row.id,
|
||||
type: "view"
|
||||
}
|
||||
});
|
||||
},
|
||||
async deleteWorkflowProcess(row) {
|
||||
row.visible = false;
|
||||
const res = await deleteWorkflowProcess({ id: row.id });
|
||||
if (res.code == 0) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功"
|
||||
});
|
||||
if (this.tableData.length == 1) {
|
||||
this.page--;
|
||||
}
|
||||
this.getTableData();
|
||||
}
|
||||
},
|
||||
openDialog() {
|
||||
this.dialogFormVisible = true;
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.getTableData();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -1,89 +0,0 @@
|
||||
<template>
|
||||
<div class="workflow-use">
|
||||
<div style="padding:10px 20px">
|
||||
<el-steps :active="moves.length-1" :process-status="processStatus" finish-status="finish" align-center>
|
||||
<el-step v-for="(item, key) in moves" :key="key">
|
||||
<div slot="title">{{ item.workflowNode.label }}</div>
|
||||
<div slot="description">
|
||||
<div>节点说明:{{ item.workflowNode.description }}</div>
|
||||
<div v-if="item.operator.nickName">操作人:{{ item.operator.nickName }}</div>
|
||||
<div>操作参数:{{ item.param||'无参数' }}</div>
|
||||
</div>
|
||||
</el-step>
|
||||
</el-steps>
|
||||
</div>
|
||||
<WorkflowInfo
|
||||
v-if="done"
|
||||
:wf="node"
|
||||
:business="business"
|
||||
:move="move"
|
||||
:workflowMoveID="$route.query.workflowMoveID"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {findWorkflowStep,getWorkflowMoveByID} from "@/api/workflowProcess.js"
|
||||
export default {
|
||||
name:"WorklowUse",
|
||||
data(){
|
||||
return{
|
||||
done:false,
|
||||
business:null,
|
||||
node:null,
|
||||
moves:[],
|
||||
move:null
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
processStatus(){
|
||||
const node = this.moves[this.moves.length-1]
|
||||
if(node&&node.workflowNode.clazz == "end"){
|
||||
if(node.workflowNode.success){
|
||||
return "success"
|
||||
}else{
|
||||
return "error"
|
||||
}
|
||||
}else{
|
||||
return "process"
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
createDone(){
|
||||
let path = ""
|
||||
if(this.node.view){
|
||||
path = this.node.view
|
||||
}else{
|
||||
path = this.workflow.view
|
||||
}
|
||||
this.$options.components.WorkflowInfo = ()=>import("@/"+path)
|
||||
this.done = true
|
||||
}
|
||||
},
|
||||
async created(){
|
||||
const workflowId = this.$route.query.workflowId
|
||||
const workflowMoveID = this.$route.query.workflowMoveID
|
||||
if(workflowId){
|
||||
const res = await findWorkflowStep({id:workflowId})
|
||||
if(res.code == 0){
|
||||
this.workflow = res.data.workflow
|
||||
this.node = res.data.workflow.nodes[0]
|
||||
this.createDone()
|
||||
}
|
||||
}else if(workflowMoveID){
|
||||
const res = await getWorkflowMoveByID({id:workflowMoveID})
|
||||
if(res.code == 0){
|
||||
this.business = res.data.business
|
||||
this.workflow = res.data.move.workflowProcess
|
||||
this.node = res.data.move.workflowNode
|
||||
this.move = res.data.move
|
||||
this.moves = res.data.moves
|
||||
this.createDone()
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeCreate(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user