2025-06-02 21:34:56 +08:00

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