2 lines
13 KiB
JavaScript
Raw Normal View History

2025-05-29 15:03:59 +08:00
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},han