2025-05-29 15:03:59 +08:00

2 lines
8.1 KiB
JavaScript

import{d as Q}from"./finished-5kawINlN.js";import{s as z,m as B}from"./process-DnLyt1wg.js";import{l as R}from"./definition-CHRXcxuP.js";import{_ as K,j as d,H as D,c as V,o as m,F as p,e,R as f,w as t,l as T,m as a,h as c,B as g,i as w}from"./index-CrAWI0wi.js";const U={name:"Deploy",components:{},data(){return{loading:!0,processLoading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,processTotal:0,myProcessList:[],title:"",open:!1,src:"",definitionList:[],queryParams:{pageNum:1,pageSize:10,name:null,category:null,key:null,tenantId:null,deployTime:null,derivedFrom:null,derivedFromRoot:null,parentDeploymentId:null,engineVersion:null},queryProcessParams:{pageNum:1,pageSize:10,name:null,category:null,key:null,tenantId:null,deployTime:null,derivedFrom:null,derivedFromRoot:null,parentDeploymentId:null,engineVersion:null},form:{},rules:{}}},created(){this.getList()},methods:{getList(){this.loading=!0,B(this.queryParams).then(r=>{this.myProcessList=r.rows,this.total=r.total,this.loading=!1})},cancel(){this.open=!1,this.reset()},reset(){this.form={id:null,name:null,category:null,key:null,tenantId:null,deployTime:null,derivedFrom:null,derivedFromRoot:null,parentDeploymentId:null,engineVersion:null},this.resetForm("form")},handleQuery(){this.queryParams.pageNum=1,this.getList()},resetQuery(){this.resetForm("queryForm"),this.handleQuery()},handleProcessQuery(){this.queryProcessParams.pageNum=1,this.listDefinition()},resetProcessQuery(){this.resetForm("queryProcessForm"),this.handleProcessQuery()},handleSelectionChange(r){this.ids=r.map(l=>l.procInsId),this.single=r.length!==1,this.multiple=!r.length},handleAdd(){this.open=!0,this.title="发起流程",this.listDefinition()},listDefinition(){R(this.queryProcessParams).then(r=>{this.definitionList=r.rows,this.processTotal=r.total,this.processLoading=!1})},handleStartProcess(r){this.$router.push({path:"/flowable/task/myProcess/send/index",query:{deployId:r.deploymentId,procDefId:r.id}})},handleStop(r){const l={instanceId:r.procInsId};z(l).then(b=>{this.$modal.msgSuccess(b.msg),this.getList()})},handleFlowRecord(r){this.$router.push({path:"/flowable/task/myProcess/detail/index",query:{procInsId:r.procInsId,deployId:r.deployId,taskId:r.taskId}})},handleDelete(r){const l=r.procInsId||this.ids;this.$confirm('是否确认删除流程定义编号为"'+l+'"的数据项?',"警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>Q(l)).then(()=>{this.getList(),this.$modal.msgSuccess("删除成功")})}}},A={class:"app-container"},M={key:0};function j(r,l,b,E,n,i){const k=d("el-input"),y=d("el-form-item"),x=d("el-date-picker"),u=d("el-button"),v=d("el-form"),C=d("el-col"),L=d("right-toolbar"),F=d("el-row"),s=d("el-table-column"),h=d("el-tag"),I=d("el-table"),q=d("pagination"),N=d("el-dialog"),_=D("hasPermi"),S=D("loading");return m(),V("div",A,[p(e(v,{model:n.queryParams,ref:"queryForm",inline:!0,"label-width":"68px"},{default:t(()=>[e(y,{label:"名称",prop:"name"},{default:t(()=>[e(k,{modelValue:n.queryParams.name,"onUpdate:modelValue":l[0]||(l[0]=o=>n.queryParams.name=o),placeholder:"请输入名称",clearable:"",onKeyup:T(i.handleQuery,["enter","native"])},null,8,["modelValue","onKeyup"])]),_:1}),e(y,{label:"开始时间",prop:"deployTime"},{default:t(()=>[e(x,{clearable:"",modelValue:n.queryParams.deployTime,"onUpdate:modelValue":l[1]||(l[1]=o=>n.queryParams.deployTime=o),type:"date","value-format":"yyyy-MM-dd",placeholder:"选择时间"},null,8,["modelValue"])]),_:1}),e(y,null,{default:t(()=>[e(u,{type:"primary",icon:"search",onClick:i.handleQuery},{default:t(()=>l[4]||(l[4]=[a("搜索")])),_:1},8,["onClick"]),e(u,{icon:"refresh",onClick:i.resetQuery},{default:t(()=>l[5]||(l[5]=[a("重置")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),[[f,n.showSearch]]),e(F,{gutter:10,class:"mb8"},{default:t(()=>[e(C,{span:1.5},{default:t(()=>[p((m(),c(u,{type:"primary",plain:"",icon:"plus",onClick:i.handleAdd},{default:t(()=>l[6]||(l[6]=[a("新增流程")])),_:1},8,["onClick"])),[[_,["system:deployment:add"]]])]),_:1}),e(C,{span:1.5},{default:t(()=>[p((m(),c(u,{type:"danger",plain:"",icon:"delete",disabled:n.multiple,onClick:i.handleDelete},{default:t(()=>l[7]||(l[7]=[a("删除")])),_:1},8,["disabled","onClick"])),[[_,["system:deployment:remove"]]])]),_:1}),e(L,{showSearch:n.showSearch,onQueryTable:i.getList},null,8,["showSearch","onQueryTable"])]),_:1}),p((m(),c(I,{data:n.myProcessList,border:"",onSelectionChange:i.handleSelectionChange},{default:t(()=>[e(s,{type:"selection",width:"55",align:"center"}),e(s,{label:"流程编号",align:"center",prop:"procInsId","show-overflow-tooltip":!0}),e(s,{label:"流程名称",align:"center",prop:"procDefName","show-overflow-tooltip":!0}),e(s,{label:"流程类别",align:"center",prop:"category",width:"100px"}),e(s,{label:"流程版本",align:"center",width:"80px"},{default:t(o=>[e(h,{size:"default"},{default:t(()=>[a("v"+g(o.row.procDefVersion),1)]),_:2},1024)]),_:1}),e(s,{label:"提交时间",align:"center",prop:"createTime",width:"180"}),e(s,{label:"流程状态",align:"center",width:"100"},{default:t(o=>[o.row.finishTime==null?(m(),c(h,{key:0,size:"small"},{default:t(()=>l[8]||(l[8]=[a("进行中")])),_:1})):w("",!0),o.row.finishTime!=null?(m(),c(h,{key:1,type:"success",size:"small"},{default:t(()=>l[9]||(l[9]=[a("已完成")])),_:1})):w("",!0)]),_:1}),e(s,{label:"耗时",align:"center",prop:"duration",width:"180"}),e(s,{label:"当前节点",align:"center",prop:"taskName"}),e(s,{label:"办理人",align:"center"},{default:t(o=>[o.row.assigneeName?(m(),V("label",M,[a(g(o.row.assigneeName)+" ",1),e(h,{type:"info",size:"small"},{default:t(()=>[a(g(o.row.assigneeDeptName),1)]),_:2},1024)])):w("",!0)]),_:1}),e(s,{label:"操作",width:"150",fixed:"right","class-name":"small-padding fixed-width"},{default:t(o=>[e(u,{onClick:P=>i.handleFlowRecord(o.row),type:"primary",link:""},{default:t(()=>l[10]||(l[10]=[a("详情")])),_:2},1032,["onClick"]),e(u,{onClick:P=>i.handleStop(o.row),type:"primary",link:""},{default:t(()=>l[11]||(l[11]=[a("取消申请")])),_:2},1032,["onClick"]),p((m(),c(u,{onClick:P=>i.handleDelete(o.row),type:"primary",link:""},{default:t(()=>l[12]||(l[12]=[a("删除")])),_:2},1032,["onClick"])),[[_,["system:deployment:remove"]]])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[S,n.loading]]),p(e(q,{total:n.total,page:n.queryParams.pageNum,limit:n.queryParams.pageSize,onPagination:i.getList},null,8,["total","page","limit","onPagination"]),[[f,n.total>0]]),e(N,{title:n.title,modelValue:n.open,"onUpdate:modelValue":l[3]||(l[3]=o=>n.open=o),width:"60%","append-to-body":""},{default:t(()=>[p(e(v,{model:n.queryProcessParams,ref:"queryProcessForm",inline:!0,"label-width":"68px"},{default:t(()=>[e(y,{label:"名称",prop:"name"},{default:t(()=>[e(k,{modelValue:n.queryProcessParams.name,"onUpdate:modelValue":l[2]||(l[2]=o=>n.queryProcessParams.name=o),placeholder:"请输入名称",clearable:"",size:"small",onKeyup:T(i.handleQuery,["enter","native"])},null,8,["modelValue","onKeyup"])]),_:1}),e(y,null,{default:t(()=>[e(u,{type:"primary",icon:"search",size:"small",onClick:i.handleProcessQuery},{default:t(()=>l[13]||(l[13]=[a("搜索")])),_:1},8,["onClick"]),e(u,{icon:"refresh",size:"small",onClick:i.resetProcessQuery},{default:t(()=>l[14]||(l[14]=[a("重置")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),[[f,n.showSearch]]),p((m(),c(I,{fit:"",data:n.definitionList,border:""},{default:t(()=>[e(s,{label:"流程名称",align:"center",prop:"name"}),e(s,{label:"流程版本",align:"center"},{default:t(o=>[e(h,{size:"default"},{default:t(()=>[a("v"+g(o.row.version),1)]),_:2},1024)]),_:1}),e(s,{label:"流程分类",align:"center",prop:"category"}),e(s,{label:"操作",align:"center",width:"300","class-name":"small-padding fixed-width"},{default:t(o=>[e(u,{type:"primary",link:"",icon:"edit",onClick:P=>i.handleStartProcess(o.row)},{default:t(()=>l[15]||(l[15]=[a("发起流程")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[S,n.processLoading]]),p(e(q,{total:n.processTotal,page:n.queryProcessParams.pageNum,limit:n.queryProcessParams.pageSize,onPagination:i.listDefinition},null,8,["total","page","limit","onPagination"]),[[f,n.processTotal>0]])]),_:1},8,["title","modelValue"])])}const W=K(U,[["render",j]]);export{W as default};