2 lines
13 KiB
JavaScript
Raw Normal View History

2025-06-02 21:34:56 +08:00
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("删除成功")}))},handleIm