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

var T=(C,m,i)=>new Promise((u,d)=>{var k=a=>{try{l(i.next(a))}catch(p){d(p)}},f=a=>{try{l(i.throw(a))}catch(p){d(p)}},l=a=>a.done?u(a.value):Promise.resolve(a.value).then(k,f);l((i=i.apply(C,m)).next())});import{P as I}from"./index-D4Z9ODzF.js";import{u as N,_ as P}from"./useTable-BYZpzJPm.js";import{_ as B}from"./index-BRqXDmQx.js";import{a as F,e as L,f as M}from"./index-BasoqPP1.js";import{b as V}from"./download-Dzju1Gbo.js";import{f as G,c as K,_ as O}from"./CategoryModal.vue_vue_type_script_setup_true_lang-UJwf25TB.js";import{u as W}from"./index-COQSZY7c.js";import{b as j,bu as q,by as z,I as x}from"./entry/index-CT2bBVPU-1724922878694.js";import{d as H,aa as J,n as Q,_ as g,a8 as b,a9 as n,k as c,u as t,ae as U,G as w,m as A,ac as X,y as Y}from"./vue-aEZWZQSa.js";import{an as Z}from"./antd-BY-1PcYE.js";import"./useContentViewHeight-CLqhWZ1e.js";import"./useWindowSizeFn-BWwSyuoE.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./useForm-koea_hsc.js";import"./FormItem.vue_vue_type_script_lang-fyvFSOLP.js";import"./componentMap-CWMsMsGY.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-RC179q1_.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./style-Cslz80qp.js";import"./helper-BqaPddWo.js";import"./BasicForm.vue_vue_type_style_index_0_lang-CUDTou-T.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-CKONboZ0.js";import"./useLoading-CR9OIhwN.js";const Ee=H({name:"Category",__name:"index",setup(C){const m=j("category.read",!1),[i,{getRawDataSource:u,expandRows:d,collapseRows:k,expandAll:f,collapseAll:l,reload:a}]=N({title:"流程分类列表",isTreeTable:!0,showTableSetting:!0,api:F,pagination:!1,rowKey:"id",afterFetch(o){const e=q(o,{id:"id",pid:"parentId"});return z(e),e},useSearchForm:!0,formConfig:{schemas:G,baseColProps:{xs:24,sm:24,md:24,lg:6}},columns:K,actionColumn:{title:"操作",key:"action",fixed:"right"}});function p(){const o=u();o instanceof Array&&(o.forEach(e=>{e.expand=!0}),Y(f))}const[R,{openModal:h}]=W();function D(o){const{id:e}=o;h(!0,{id:e,update:!0})}function _(o){h(!0,{id:o,update:!1})}function S(o){return T(this,null,function*(){yield M([o]),yield a()})}function v(o){const e=u();if(e instanceof Array)switch(o){case"expandAll":e.forEach(r=>{r.expand=!0}),f();break;case"collapseAll":e.forEach(r=>{r.expand=!1}),l();break}}function $(o){const{id:e}=o;o.expand===!0?(k([e]),o.expand=!1):(d([e]),o.expand=!0)}return(o,e)=>{const r=J("a-button"),E=Q("auth");return g(),b(t(I),{dense:""},{default:n(()=>[c(t(P),{onRegister:t(i),onFetchSuccess:p,onRowDbClick:$},U({toolbar:n(()=>[c(r,{onClick:e[1]||(e[1]=s=>v("expandAll"))},{default:n(()=>[w("展开")]),_:1}),c(r,{onClick:e[2]||(e[2]=s=>v("collapseAll"))},{default:n(()=>[w("折叠")]),_:1}),A((g(),b(r,{onClick:e[3]||(e[3]=s=>t(V)(t(L),"流程分类"))},{default:n(()=>[w("导出")]),_:1})),[[E,"workflow:category:export"]]),A((g(),b(r,{type:"primary",onClick:e[4]||(e[4]=s=>_(0))},{default:n(()=>[w(" 新增 ")]),_:1})),[[E,"workflow:category:add"]])]),bodyCell:n(({column:s,record:y})=>[s.key==="action"?(g(),b(t(B),{key:0,stopButtonPropagation:"",actions:[{label:"修改",icon:t(x).EDIT,type:"primary",ghost:!0,auth:"workflow:category:edit",onClick:D.bind(null,y)},{label:"新增",icon:t(x).ADD,type:"primary",color:"success",ghost:!0,auth:"workflow:category:add",onClick:_.bind(null,y.id)},{label:"删除",icon:t(x).DELETE,type:"primary",danger:!0,ghost:!0,auth:"workflow:category:remove",popConfirm:{title:`是否删除分类[${y.categoryName}]`,placement:"left",confirm:S.bind(null,y.id)}}]},null,8,["actions"])):X("",!0)]),_:2},[t(m)?void 0:{name:"headerTop",fn:n(()=>[c(t(Z),{class:"h-30px",message:"提示: 双击行可展开/折叠内容",type:"info",banner:"",closable:"",onClose:e[0]||(e[0]=s=>m.value=!0)})]),key:"0"}]),1032,["onRegister"]),c(O,{onRegister:t(R),onReload:t(a)},null,8,["onRegister","onReload"])]),_:1})}}});export{Ee as default};