You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
6.4 KiB
JavaScript

var p=(R,d,n)=>new Promise((y,_)=>{var C=m=>{try{u(n.next(m))}catch(f){_(f)}},c=m=>{try{u(n.throw(m))}catch(f){_(f)}},u=m=>m.done?y(m.value):Promise.resolve(m.value).then(C,c);u((n=n.apply(R,d)).next())});import{P as q}from"./index-D9u9z1rb.js";import{_ as J}from"./index-C-9S90nC.js";import{b as Q,p as $,u as X,c as Y}from"./index-CYMWIJL7.js";import{a as Z}from"./index-5ko73cHm.js";import{u as ee,_ as te}from"./useTable-nv9giSxv.js";import{_ as b}from"./index-DduuDa4W.js";import{schemas as oe,columns as ae}from"./definition.data-DXXm1h-N.js";import{bu as ne,bh as ie,bv as se,u as le,I as v,h as re,_ as ce}from"./entry/index-DbrbbsCh-1723702159782.js";import{u as I}from"./index-DOVZCDDs.js";import{_ as me}from"./DeployModal.vue_vue_type_script_setup_true_lang-FK2kiurV.js";import pe from"./PreviewModal-d-ERhvN0.js";import{_ as de}from"./FormConfigModal.vue_vue_type_script_setup_true_lang-BRlYpwzG.js";import{ao as ue,ap as N,y as fe}from"./antd-BY-1PcYE.js";import{d as ge,f as P,r as ye,o as _e,aa as he,_ as g,a8 as h,a9 as r,k as s,u as t,ad as ke,ac as k,ak as we,al as Ce,G as w,a1 as S,$ as be,F as ve}from"./vue-aEZWZQSa.js";import"./useContentViewHeight-89PWWjum.js";import"./useWindowSizeFn-DE1eO4db.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./useForm-CWPDAxdO.js";import"./FormItem.vue_vue_type_script_lang-DQcDBttf.js";import"./componentMap-CVvNnVzI.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-Czt7G3zm.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./style-ZVTxFzof.js";import"./helper-nGdd1AW2.js";import"./BasicForm.vue_vue_type_style_index_0_lang-fWyk1YG7.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-CyjTTtzk.js";import"./download-BsJ55YCN.js";import"./useLoading-CZUdUDy4.js";import"./useRender-DWuk4S5z.js";import"./index-ByoXcKeN.js";import"./dict-Ci6HGAuf.js";import"./index-CYSPB-UY.js";import"./index-DeqOXDrL.js";import"./index-BO8zsSrl.js";const Ie=ge({name:"ProcessDefinition",__name:"index",setup(R){const d=P(""),n=ye({tree:[],selectId:[]}),y=P(!0);function _(){return p(this,null,function*(){yield c()})}_e(()=>p(this,null,function*(){const e=yield Z();let a=ne(e,{id:"id",pid:"parentId"});a=[{categoryName:"根目录",id:0,children:a}],ie(a,l=>{l.icon="flat-color-icons:folder"}),se(a,"categoryName"," / "),n.tree=a,y.value=!1}));const[C,{reload:c,selected:u,getSelectRows:m}]=ee({rowSelection:{type:"checkbox"},title:"流程定义列表",showIndexColumn:!1,api:Q,rowKey:"id",useSearchForm:!0,formConfig:{schemas:oe,baseColProps:{xs:24,sm:24,md:24,lg:6},labelWidth:80,resetFunc:()=>p(this,null,function*(){n.selectId=[],d.value=""})},columns:ae,beforeFetch(e){return n.selectId.length===1&&(e.categoryCode=n.selectId[0]),e},actionColumn:{width:220,title:"操作",key:"action",fixed:"right"}}),[f,{openModal:T}]=I(),[D,{openModal:F}]=I(),[B,{openModal:L}]=I();function x(e,a){T(!0,{type:e,id:a.id})}function E(e){L(!0,e)}const K=le();function V(e){K(`/workflow/definition/history/${e.key}`)}function O(e){return p(this,null,function*(){const{deploymentId:a,id:l}=e;yield $(a,l),yield c()})}const{createMessage:M,createConfirm:U}=re();function j(){if(n.selectId.length!==1){M.warning("请在左侧选择要上传的分类");return}if(n.selectId.length===1&&!n.selectId[0]){M.warning("不可上传到根目录, 请选择子目录上传");return}const e=n.selectId[0];F(!0,e)}function A(e){return p(this,null,function*(){yield X(e.id),yield c()})}function G(e){const a=e.suspensionState=="1"?"暂停":"启动",l=e.suspensionState=="1"?"不允许":"允许",i=e.suspensionState=="1"?"挂起":"激活";return`${a}后,此流程下的所有任务都${l}往后流转, 您确定${i}${e.name}】吗?`}function W(e){return p(this,null,function*(){yield Y(e.id),yield c()})}function z(){U({title:"提示",iconType:"warning",content:"确定要删除选中的流程定义吗?",okButtonProps:{type:"primary",danger:!0},onOk:()=>p(this,null,function*(){const e=m(),a=e.map(i=>i.deploymentId).join(","),l=e.map(i=>i.id).join(",");yield $(a,l),yield c()})})}return(e,a)=>{const l=he("a-button");return g(),h(t(q),{dense:""},{default:r(()=>[s(t(ue),null,{default:r(()=>[s(t(N),ke({xs:24,sm:24,md:24,lg:4},{class:"h-[calc(100vh-80px)]"}),{default:r(()=>[s(t(fe),{active:!0,paragraph:{rows:8},loading:y.value},{default:r(()=>[n.tree.length?(g(),h(t(J),{key:0,fieldNames:{title:"categoryName",key:"categoryCode"},"tree-data":n.tree,showLine:{showLeafIcon:!1},search:!0,searchValue:d.value,"onUpdate:searchValue":a[0]||(a[0]=i=>d.value=i),defaultExpandAll:"",onSelect:_,selectedKeys:n.selectId,"onUpdate:selectedKeys":a[1]||(a[1]=i=>n.selectId=i)},null,8,["tree-data","searchValue","selectedKeys"])):k("",!0)]),_:1},8,["loading"])]),_:1},16),s(t(N),we(Ce({xs:24,sm:24,md:24,lg:20})),{default:r(()=>[s(t(te),{onRegister:t(C)},{toolbar:r(()=>[s(l,{type:"primary",danger:"",disabled:!t(u),onClick:z},{default:r(()=>[w("删除")]),_:1},8,["disabled"]),s(l,{type:"primary",onClick:j},{default:r(()=>[w("部署")]),_:1})]),bodyCell:r(({column:i,record:o})=>[i&&o&&i.key==="resourceName"?(g(),h(l,{key:0,type:"link",onClick:H=>x("xml",o)},{default:r(()=>[w(S(o.resourceName),1)]),_:2},1032,["onClick"])):k("",!0),i&&o&&i.key==="diagramResourceName"?(g(),h(l,{key:1,type:"link",onClick:H=>x("image",o)},{default:r(()=>[w(S(o.diagramResourceName),1)]),_:2},1032,["onClick"])):k("",!0),i&&o&&i.key==="action"?(g(),be(ve,{key:2},[s(t(b),{stopButtonPropagation:"",actions:[{label:o.suspensionState==1?"挂起流程":"激活流程",icon:o.suspensionState==1?t(v).LOCK:t(v).UNLOCK,popConfirm:{placement:"left",title:G(o),confirm:A.bind(null,o)}},{label:"删除流程",icon:t(v).DELETE,danger:!0,popConfirm:{placement:"left",title:`是否确认删除[${o.name}] - [${o.key}]`,confirm:O.bind(null,o)}}]},null,8,["actions"]),s(t(b),{stopButtonPropagation:"",actions:[{label:"转换模型",icon:"lets-icons:transger",popConfirm:{placement:"left",title:`是否确认转换为模型[${o.name}] - [${o.key}]`,confirm:W.bind(null,o)}},{label:"历史版本",icon:"ic:sharp-history",onClick:V.bind(null,o)}]},null,8,["actions"]),s(t(b),{stopButtonPropagation:"",actions:[{label:"绑定业务",icon:"lets-icons:transger",onClick:E.bind(null,o)}]},null,8,["actions"])],64)):k("",!0)]),_:1},8,["onRegister"]),s(pe,{onRegister:t(f)},null,8,["onRegister"]),s(me,{onRegister:t(D),onReload:t(c)},null,8,["onRegister","onReload"]),s(de,{onRegister:t(B),onReload:t(c)},null,8,["onRegister","onReload"])]),_:1},16)]),_:1})]),_:1})}}}),lt=ce(Ie,[["__scopeId","data-v-5a49a81c"]]);export{lt as default};