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

2 lines
13 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{a as J,u as K,d as M,f as A,l as j}from"./definition-CHRXcxuP.js";import{_ as E,j as a,H as P,c as C,o as p,F as g,e as l,R as D,w as o,l as H,m as s,h as f,f as m,B as F,i as w,I as G,J as W,a2 as Y,d as Z}from"./index-CrAWI0wi.js";import{b as $,l as ee,g as le}from"./form-BgAHKV8_.js";import{B as te}from"./index-CTXhDomq.js";import oe from"./model-ODwtVrzi.js";import"./vue-treeselect-DSnm48_Q.js";import"./listener-CWhCQe_g.js";import"./StrUtil-DZsLURBF.js";import"./index-CSt_GYBb.js";import"./user-Bxl06CMk.js";import"./role-pNEACQin.js";import"./expression-CrMDRPjM.js";const ne={name:"Definition",setup(){const{proxy:i}=Z(),{sys_process_category:e}=i.useDict("sys_process_category");return{sys_process_category:e}},components:{BpmnViewer:te,Model:oe},data(){return{loading:!0,dialogVisible:!1,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,definitionList:[],title:"",open:!1,formConfOpen:!1,formTitle:"",formDeployOpen:!1,formDeployTitle:"",formList:[],formTotal:0,formData:{},readImage:{open:!1,src:""},upload:{open:!1,title:"",isUploading:!1,name:null,category:null,headers:{Authorization:"Bearer "+Y()},url:"/prod-api/flowable/definition/import"},queryParams:{pageNum:1,pageSize:10,name:null,category:null,key:null,tenantId:null,deployTime:null,derivedFrom:null,derivedFromRoot:null,parentDeploymentId:null,engineVersion:null},formQueryParams:{pageNum:1,pageSize:10},formDeployParam:{formId:null,deployId:null},deployId:"",currentRow:null,flowData:{},form:{},rules:{}}},created(){this.getList()},activated(){this.$route.query.t!=null&&this.getList()},methods:{getList(){this.loading=!0,j(this.queryParams).then(i=>{this.definitionList=i.rows,this.total=i.total,this.loading=!1})},handleClose(i){this.$confirm("确定要关闭吗?关闭未保存的修改都会丢失?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{i()}).catch(()=>{})},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()},handleSelectionChange(i){this.ids=i.map(e=>e.deploymentId),this.single=i.length!==1,this.multiple=!i.length},handleLoadXml(i){this.$router.push({path:"/flowable/definition/model",query:{deployId:i.deploymentId}})},handleReadImage(i){this.readImage.title="流程图",this.readImage.open=!0,A({deployId:i}).then(e=>{this.flowData=e.data})},handleForm(i){le(i).then(e=>{this.formTitle="表单详情",this.formConfOpen=!0,this.$nextTick(()=>{this.$refs.vFormRef.setFormJson(JSON.parse(e.data.formSchema)),this.$nextTick(()=>{this.$refs.vFormRef.disableForm()})})})},handleDefinitionStart(i){M(i.id).then(e=>{this.$modal.msgSuccess(e.msg)})},handleAddForm(i){this.formDeployParam.deployId=i.deploymentId,this.ListFormDeploy()},ListFormDeploy(){ee(this.formQueryParams).then(i=>{this.formList=i.rows,this.formTotal=i.total,this.formDeployOpen=!0,this.formDeployTitle="挂载表单"})},submitFormDeploy(i){this.formDeployParam.formId=i.formId,$(this.formDeployParam).then(e=>{this.$modal.msgSuccess(e.msg),this.formDeployOpen=!1,this.getList()})},handleCurrentChange(i){i&&this.$nextTick(()=>{this.$refs.vFormCurrentRowRef.setFormJson(JSON.parse(i.formSchema)),this.$nextTick(()=>{this.$refs.vFormCurrentRowRef.disableForm()})})},handleUpdateSuspensionState(i){let e=1;i.suspensionState===1&&(e=2);const h={deployId:i.deploymentId,state:e};K(h).then(k=>{this.$modal.msgSuccess(k.msg),this.getList()})},handleDelete(i){const e=i.deploymentId||this.ids;this.$confirm('是否确认删除流程定义编号为"'+e+'"的数据项?',"警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){return J(e)}).then(()=>{this.getList(),this.$modal.msgSuccess("删除成功")})},handleImport(){this.upload.title="bpmn20.xml文件导入",this.upload.open=!0},handleFileUploadProgress(i,e,h){this.upload.isUploading=!0},handleFileSuccess(i,e,h){this.upload.open=!1,this.upload.isUploading=!1,this.$refs.upload.clearFiles(),this.$message(i.msg),this.getList()},submitFileForm(){this.$refs.upload.submit()}}},ie={class:"app-container"},re={key:1},ae={class:"dialog-footer"},se={class:"test-form"},me={class:"test-form"};function de(i,e,h,k,t,r){const S=a("el-input"),v=a("el-form-item"),U=a("el-date-picker"),d=a("el-button"),R=a("el-form"),c=a("el-col"),q=a("right-toolbar"),I=a("el-row"),N=a("el-alert"),u=a("el-table-column"),b=a("el-tag"),V=a("el-table"),T=a("pagination"),z=a("el-option"),B=a("el-select"),Q=a("el-upload"),_=a("el-dialog"),O=a("bpmn-viewer"),x=a("v-form-render"),L=P("hasPermi"),X=P("loading");return p(),C("div",ie,[g(l(R,{model:t.queryParams,ref:"queryForm",inline:!0,"label-width":"68px"},{default:o(()=>[l(v,{label:"名称",prop:"name"},{default:o(()=>[l(S,{modelValue:t.queryParams.name,"onUpdate:modelValue":e[0]||(e[0]=n=>t.queryParams.name=n),placeholder:"请输入名称",clearable:"",size:"small",onKeyup:H(r.handleQuery,["enter","native"])},null,8,["modelValue","onKeyup"])]),_:1}),l(v,{label:"开始时间",prop:"deployTime"},{default:o(()=>[l(U,{clearable:"",size:"small",modelValue:t.queryParams.deployTime,"onUpdate:modelValue":e[1]||(e[1]=n=>t.queryParams.deployTime=n),type:"date","value-format":"yyyy-MM-dd",placeholder:"选择时间"},null,8,["modelValue"])]),_:1}),l(v,null,{default:o(()=>[l(d,{type:"primary",icon:"search",size:"small",onClick:r.handleQuery},{default:o(()=>e[9]||(e[9]=[s("搜索")])),_:1},8,["onClick"]),l(d,{icon:"refresh",size:"small",onClick:r.resetQuery},{default:o(()=>e[10]||(e[10]=[s("重置")])),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),[[D,t.showSearch]]),l(I,{gutter:10,class:"mb8"},{default:o(()=>[l(c,{span:1.5},{default:o(()=>[l(d,{type:"success",plain:"",icon:"plus",size:"small",onClick:r.handleLoadXml},{default:o(()=>e[11]||(e[11]=[s("新增")])),_:1},8,["onClick"])]),_:1}),l(c,{span:1.5},{default:o(()=>[g((p(),f(d,{type:"danger",plain:"",icon:"delete",size:"small",disabled:t.multiple,onClick:r.handleDelete},{default:o(()=>e[12]||(e[12]=[s("删除")])),_:1},8,["disabled","onClick"])),[[L,["system:deployment:remove"]]])]),_:1}),l(q,{showSearch:t.showSearch,onQueryTable:r.getList},null,8,["showSearch","onQueryTable"])]),_:1}),l(N,{title:"流程设计说明",type:"success"},{title:o(()=>e[13]||(e[13]=[m("p",null,"流程设计说明:",-1),m("div",null,"1、XML文件中的流程定义id属性用作流程定义的key参数。",-1),m("div",null,"2、XML文件中的流程定义name属性用作流程定义的name参数。如果未给定name属性会使用id作为name。",-1),m("div",null,"3、当每个唯一key的流程第一次部署时指定版本为1。对其后所有使用相同key的流程定义部署时版本会在该key当前已部署的最高版本号基础上加1。key参数用于区分流程定义。",-1),m("div",null," 4、id参数设置为{processDefinitionKey}:{processDefinitionVersion}:{generated-id}其中generated-id是一个唯一数字用以保证在集群环境下流程定义缓存中流程id的唯一性。 ",-1)])),_:1}),g((p(),f(V,{fit:"",data:t.definitionList,border:"",onSelectionChange:r.handleSelectionChange},{default:o(()=>[l(u,{type:"selection",width:"55",align:"center"}),l(u,{label:"流程编号",align:"center",prop:"deploymentId","show-overflow-tooltip":!0}),l(u,{label:"流程标识",align:"center",prop:"flowKey","show-overflow-tooltip":!0}),l(u,{label:"流程分类",align:"center",prop:"category"}),l(u,{label:"流程名称",align:"center",width:"120","show-overflow-tooltip":!0},{default:o(n=>[l(d,{link:"",type:"primary",onClick:y=>r.handleReadImage(n.row.deploymentId)},{default:o(()=>[m("span",null,F(n.row.name),1)]),_:2},1032,["onClick"])]),_:1}),l(u,{label:"业务表单",align:"center","show-overflow-tooltip":!0},{default:o(n=>[n.row.formId?(p(),f(d,{key:0,link:"",type:"primary",onClick:y=>r.handleForm(n.row.formId)},{default:o(()=>[m("span",null,F(n.row.formName),1)]),_:2},1032,["onClick"])):(p(),C("label",re,"暂无表单"))]),_:1}),l(u,{label:"流程版本",align:"center"},{default:o(n=>[l(b,{size:"default"},{default:o(()=>[s("v"+F(n.row.version),1)]),_:2},1024)]),_:1}),l(u,{label:"状态",align:"center",width:"150"},{default:o(n=>[n.row.suspensionState===1?(p(),f(b,{key:0,type:"success"},{default:o(()=>e[14]||(e[14]=[s("激活")])),_:1})):w("",!0),n.row.suspensionState===2?(p(),f(b,{key:1,type:"warning"},{default:o(()=>e[15]||(e[15]=[s("挂起")])),_:1})):w("",!0)]),_:1}),l(u,{label:"部署时间",align:"center",prop:"deploymentTime",width:"180"}),l(u,{label:"操作",align:"center",width:"350",fixed:"right","class-name":"small-padding fixed-width"},{default:o(n=>[l(d,{link:"",onClick:y=>r.handleLoadXml(n.row),icon:"edit",type:"primary"},{default:o(()=>e[16]||(e[16]=[s("设计")])),_:2},1032,["onClick"]),l(d,{link:"",onClick:y=>r.handleAddForm(n.row),icon:"promotion",type:"primary"},{default:o(()=>e[17]||(e[17]=[s("配置主表单")])),_:2},1032,["onClick"]),n.row.suspensionState===1?(p(),f(d,{key:0,link:"",onClick:y=>r.handleUpdateSuspensionState(n.row),icon:"video-pause",type:"warning"},{default:o(()=>e[18]||(e[18]=[s("挂起")])),_:2},1032,["onClick"])):w("",!0),n.row.suspensionState===2?(p(),f(d,{key:1,link:"",onClick:y=>r.handleUpdateSuspensionState(n.row),icon:"video-play",type:"success"},{default:o(()=>e[19]||(e[19]=[s("激活")])),_:2},1032,["onClick"])):w("",!0),g((p(),f(d,{link:"",onClick:y=>r.handleDelete(n.row),icon:"delete",type:"danger"},{default:o(()=>e[20]||(e[20]=[s("删除")])),_:2},1032,["onClick"])),[[L,["system:deployment:remove"]]])]),_:1})]),_:1},8,["data","onSelectionChange"])),[[X,t.loading]]),g(l(T,{total:t.total,page:t.queryParams.pageNum,limit:t.queryParams.pageSize,onPagination:r.getList},null,8,["total","page","limit","onPagination"]),[[D,t.total>0]]),l(_,{title:t.upload.title,modelValue:t.upload.open,"onUpdate:modelValue":e[5]||(e[5]=n=>t.upload.open=n),width:"400px","append-to-body":""},{footer:o(()=>[m("div",ae,[l(d,{type:"primary",onClick:r.submitFileForm},{default:o(()=>e[26]||(e[26]=[s("确 定")])),_:1},8,["onClick"]),l(d,{onClick:e[4]||(e[4]=n=>t.upload.open=!1)},{default:o(()=>e[27]||(e[27]=[s("取 消")])),_:1})])]),default:o(()=>[l(Q,{ref:"upload",limit:1,accept:".xml",headers:t.upload.headers,action:t.upload.url+"?name="+t.upload.name+"&category="+t.upload.category,disabled:t.upload.isUploading,"on-progress":r.handleFileUploadProgress,"on-success":r.handleFileSuccess,"auto-upload":!1,drag:""},{tip:o(()=>[e[21]||(e[21]=s(" 流程名称:")),l(S,{modelValue:t.upload.name,"onUpdate:modelValue":e[2]||(e[2]=n=>t.upload.name=n)},null,8,["modelValue"]),e[22]||(e[22]=s(" 流程分类: ")),m("div",null,[l(B,{modelValue:t.upload.category,"onUpdate:modelValue":e[3]||(e[3]=n=>t.upload.category=n),placeholder:"请选择流程分类"},{default:o(()=>[(p(!0),C(G,null,W(k.sys_process_category,n=>(p(),f(z,{key:n.value,label:n.label,value:n.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e[23]||(e[23]=m("span",{style:{color:"red"}}," 提示仅允许导入“bpmn20.xml”格式文件 ",-1))]),default:o(()=>[e[24]||(e[24]=m("i",{class:"el-icon-upload"},null,-1)),e[25]||(e[25]=m("div",{class:"el-upload__text"},[s(" 将文件拖到此处,或 "),m("em",null,"点击上传")],-1))]),_:1},8,["headers","action","disabled","on-progress","on-success"])]),_:1},8,["title","modelValue"]),l(_,{title:t.readImage.title,modelValue:t.readImage.open,"onUpdate:modelValue":e[6]||(e[6]=n=>t.readImage.open=n),width:"70%","append-to-body":""},{default:o(()=>[l(O,{flowData:t.flowData},null,8,["flowData"])]),_:1},8,["title","modelValue"]),l(_,{title:t.formTitle,modelValue:t.formConfOpen,"onUpdate:modelValue":e[7]||(e[7]=n=>t.formConfOpen=n),width:"50%","append-to-body":""},{default:o(()=>[m("div",se,[l(x,{"form-data":t.formData,ref:"vFormRef"},null,8,["form-data"])])]),_:1},8,["title","modelValue"]),l(_,{title:t.formDeployTitle,modelValue:t.formDeployOpen,"onUpdate:modelValue":e[8]||(e[8]=n=>t.formDeployOpen=n),width:"60%","append-to-body":""},{default:o(()=>[l(I,{gutter:24},{default:o(()=>[l(c,{span:10,xs:24},{default:o(()=>[l(V,{ref:"singleTable",data:t.formList,border:"","highlight-current-row":"",onCurrentChange:r.handleCurrentChange,style:{width:"100%"}},{default:o(()=>[l(u,{label:"表单编号",align:"center",prop:"formId"}),l(u,{label:"表单名称",align:"center",prop:"formName"}),l(u,{label:"操作",align:"center","class-name":"small-padding fixed-width"},{default:o(n=>[l(d,{link:"",type:"primary",onClick:y=>r.submitFormDeploy(n.row)},{default:o(()=>e[28]||(e[28]=[s("确定")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data","onCurrentChange"]),g(l(T,{small:"",layout:"prev, pager, next",total:t.formTotal,page:t.formQueryParams.pageNum,limit:t.formQueryParams.pageSize,onPagination:r.ListFormDeploy},null,8,["total","page","limit","onPagination"]),[[D,t.formTotal>0]])]),_:1}),l(c,{span:14,xs:24},{default:o(()=>[m("div",me,[l(x,{"form-data":t.formData,ref:"vFormCurrentRowRef"},null,8,["form-data"])])]),_:1})]),_:1})]),_:1},8,["title","modelValue"])])}const Ce=E(ne,[["render",de]]);export{Ce as default};