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
4.9 KiB
JavaScript

var m=(x,f,o)=>new Promise((_,h)=>{var b=n=>{try{c(o.next(n))}catch(y){h(y)}},d=n=>{try{c(o.throw(n))}catch(y){h(y)}},c=n=>n.done?_(n.value):Promise.resolve(n.value).then(b,d);c((o=o.apply(x,f)).next())});import{P as L}from"./index-D9u9z1rb.js";import{_ as z}from"./index-C-9S90nC.js";import{d as A,e as $,g as G,h as U}from"./index-Bn_IChT3.js";import{d as Z}from"./download-BsJ55YCN.js";import{a as W}from"./index-5ko73cHm.js";import{u as j,_ as q}from"./useTable-nv9giSxv.js";import{_ as I}from"./index-DduuDa4W.js";import{s as H,c as J,_ as O}from"./ModelModal.vue_vue_type_script_setup_true_lang-DEwh0lsR.js";import{bu as Q,bh as X,bv as Y,u as ee,I as D,_ as te}from"./entry/index-DbrbbsCh-1723702159782.js";import{u as ae}from"./index-DOVZCDDs.js";import{ao as oe,ap as R,y as le}from"./antd-BY-1PcYE.js";import{d as ne,f as T,r as se,o as ie,aa as re,n as de,_ as u,a8 as w,a9 as l,k as r,u as t,ad as me,ac as E,ak as ce,al as pe,m as k,G as v,$ as ue,F as fe}from"./vue-aEZWZQSa.js";import"./useContentViewHeight-89PWWjum.js";import"./useWindowSizeFn-DE1eO4db.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./useLoading-CZUdUDy4.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"./useRender-DWuk4S5z.js";import"./index-ByoXcKeN.js";import"./dict-Ci6HGAuf.js";const ye=ne({name:"Model",__name:"index",setup(x){const f=T(""),o=se({tree:[],selectId:[]}),_=T(!0);function h(){return m(this,null,function*(){yield d()})}ie(()=>m(this,null,function*(){const e=yield W();let a=Q(e,{id:"id",pid:"parentId"});a=[{categoryName:"根目录",id:0,children:a}],X(a,s=>{s.icon="flat-color-icons:folder"}),Y(a,"categoryName"," -> "),o.tree=a,_.value=!1}));const[b,{reload:d,selected:c,multipleRemove:n,getSelectRowKeys:y}]=j({rowSelection:{type:"checkbox"},title:"流程模型列表",showIndexColumn:!1,api:A,rowKey:"id",useSearchForm:!0,formConfig:{schemas:H,baseColProps:{xs:24,sm:24,md:24,lg:6},resetFunc:()=>m(this,null,function*(){o.selectId=[],f.value=""})},columns:J,beforeFetch(e){return o.selectId.length===1&&(e.categoryCode=o.selectId[0]),e},actionColumn:{width:180,title:"操作",key:"action",fixed:"right"}}),[M,{openModal:C}]=ae();function N(){C(!0,{update:!1})}function B(e){const{id:a}=e;C(!0,{update:!0,id:a})}function P(e){return m(this,null,function*(){yield G(e.id),yield d()})}function S(e){return m(this,null,function*(){let a=`模型导出-${new Date().getTime()}.zip`,s=y();e&&(a=`${e.name} - ${e.key}.zip`,s=[e.id]);const g=yield U(s);Z(g,a),yield d()})}function F(e){return m(this,null,function*(){yield $([e.id]),yield d()})}const V=ee();function K(e){V(`/workflow/design/${e.id}`)}return(e,a)=>{const s=re("a-button"),g=de("auth");return u(),w(t(L),{dense:""},{default:l(()=>[r(t(oe),null,{default:l(()=>[r(t(R),me({xs:24,sm:24,md:24,lg:4},{class:"h-[calc(100vh-80px)]"}),{default:l(()=>[r(t(le),{active:!0,paragraph:{rows:8},loading:_.value},{default:l(()=>[o.tree.length?(u(),w(t(z),{key:0,fieldNames:{title:"categoryName",key:"categoryCode"},"tree-data":o.tree,showLine:{showLeafIcon:!1},search:!0,searchValue:f.value,"onUpdate:searchValue":a[0]||(a[0]=p=>f.value=p),defaultExpandAll:"",onSelect:h,selectedKeys:o.selectId,"onUpdate:selectedKeys":a[1]||(a[1]=p=>o.selectId=p)},null,8,["tree-data","searchValue","selectedKeys"])):E("",!0)]),_:1},8,["loading"])]),_:1},16),r(t(R),ce(pe({xs:24,sm:24,md:24,lg:20})),{default:l(()=>[r(t(q),{onRegister:t(b)},{toolbar:l(()=>[k((u(),w(s,{onClick:S,disabled:!t(c)},{default:l(()=>[v("导出")]),_:1},8,["disabled"])),[[g,"workflow:model:export"]]),k((u(),w(s,{class:"<sm:hidden",type:"primary",danger:"",onClick:a[2]||(a[2]=p=>t(n)(t($))),disabled:!t(c)},{default:l(()=>[v("删除")]),_:1},8,["disabled"])),[[g,"workflow:model:remove"]]),k((u(),w(s,{type:"primary",onClick:N},{default:l(()=>[v("新增")]),_:1})),[[g,"workflow:model:add"]])]),bodyCell:l(({column:p,record:i})=>[p.key==="action"?(u(),ue(fe,{key:0},[r(t(I),{stopButtonPropagation:"",dropDownBtnDisplay:"",actions:[{label:"设计",icon:"streamline:text-flow-rows",onClick:K.bind(null,i)},{label:"修改",icon:t(D).EDIT,onClick:B.bind(null,i)}]},null,8,["actions"]),r(t(I),{stopButtonPropagation:"",actions:[{label:"部署",icon:"clarity:deploy-line",popConfirm:{placement:"left",title:`是否确认部署[${i.name}] - [${i.key}]`,confirm:P.bind(null,i)}},{label:"删除",icon:t(D).DELETE,danger:!0,popConfirm:{placement:"left",title:`是否确认删除[${i.name}] - [${i.key}]`,confirm:F.bind(null,i)}}]},null,8,["actions"])],64)):E("",!0)]),_:1},8,["onRegister"]),r(O,{onRegister:t(M),onReload:t(d)},null,8,["onRegister","onReload"])]),_:1},16)]),_:1})]),_:1})}}}),je=te(ye,[["__scopeId","data-v-e0c9a5bd"]]);export{je as default};