import{V as f,Z as m,ae as I,d as K,u as L,r as a,a as W,c as q,o as X,w as n,j as s,W as z,l as i,H as G,aI as H,p as M,A as U,B as Z,i as J,X as O}from"./index-9PRMimni.js";import{B as Q}from"./BasicForm-dL_oCSPM.js";import{B as Y}from"./Table-0PViRYCf.js";import{_ as ee}from"./TableAction.vue_vue_type_script_setup_true_lang-Bj_Y4LtN.js";import{d as oe,_ as te,p as ne}from"./CreateDrawer.vue_vue_type_script_setup_true_lang-ckhjDCoi.js";import{u as se}from"./useForm-CKmgcynv.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./SingleImageUpload-CNx4b9eC.js";import"./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";import"./componentSetting-DVhNDBTO.js";import"./ImageUpload-DUsnro3W.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";import"./tabsView-BXskTdVh.js";import"./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";import"./propTypes-CebMRUpe.js";import"./BasicSelect-C_uwzMkE.js";import"./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";import"./dictionary-BRse4lkf.js";import"./index-DkvzUEqh.js";import"./index-kKnqLkWM.js";import"./AutoComplete-Dv1Bqed4.js";import"./TreeSelect-BZh2DeCh.js";import"./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";import"./componentMap-CElCaWis.js";import"./format-DgF6KtHk.js";import"./omit-B2_8Y6O_.js";import"./_flatRest-DBrd2CHT.js";import"./flatten-DeoUZLdb.js";import"./print-CT_2hrjP.js";import"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import"./useModal-CO65vga3.js";import"./useTimeout-BxFilWvD.js";import"./usePageCache-DluHn7Yy.js";import"./Flex-CTSf12gq.js";const{t:h}=f(),ae=[{field:"name",component:"NInput",label:h("common.post.postName"),componentProps:{placeholder:h("permission.job.namePlaceholder")}}],{t:r}=f(),re=[{title:r("common.post.postCode"),key:"code"},{title:r("common.post.postName"),key:"name"},{title:r("common.post.sort"),key:"orderNum"},{title:r("common.post.state"),key:"isEnable",render(p){return m(I,{type:p.isEnable?"success":"error"},{default:()=>p.isEnable?"启用":"禁用"})}},{title:r("common.post.createTime"),key:"createTime"},{title:r("common.post.updateTime"),key:"updateTime"}],Xe=K({__name:"post",setup(p){const{t}=f(),w=L(),b=a(),k=a([]),T=a([]),g=a(),u=a(),d=a(""),v=a([]),[C,{getFieldsValue:D}]=se({gridProps:{cols:"4",xGap:"15"},labelWidth:80,schemas:ae,showAdvancedButton:!1}),x=W({width:150,title:t("common.optionsText"),key:"action",fixed:"right",align:"center",render(e){return m(ee,{style:"text",actions:[{label:t("common.delText"),labelShow:!1,icon:m("i",{class:"iconfont icon-Delete red"}),onPositiveClick:E.bind(null,e),isConfirm:!0,confirmContent:t("common.delPop.contRole")},{label:t("common.optionsEditText"),labelShow:!1,icon:m("i",{class:"iconfont icon-a-Frame28"}),onClick:j.bind(null,e)}]})}});function B(e){l()}function R(e){l()}const N=async(e,o)=>{const c=await ne({...e,...o});return g.value=c.list,c};function P(e){k.value=e,T.value=g.value.filter(o=>e.includes(o.id)).map(o=>o.username).join("，")}function l(){b.value.reload()}function S(){d.value=t("permission.job.add");const{openDrawer:e}=u.value;e()}function j(e){d.value=t("permission.job.edit");const{openDrawer:o}=u.value;console.log(e),o(e.id)}function E(e){oe(e.id).then(()=>{w.success(t("common.delPop.success")),l()})}return(e,o)=>{const c=Q,y=z,F=Z,V=H,$=G,A=O;return X(),q(A,null,{default:n(()=>[s(y,{bordered:!1,class:"mb-3 proCard"},{default:n(()=>[s(c,{onRegister:i(C),onSubmit:B,onReset:R},null,8,["onRegister"])]),_:1}),s(y,{bordered:!1,class:"proCard"},{default:n(()=>[s(i(Y),{columns:i(re),request:_=>N(_,i(D)()),"row-key":_=>_.id,ref_key:"basicTableRef",ref:b,actionColumn:x,"onUpdate:checkedRowKeys":P,autoScrollX:!0,"virtual-scroll":""},{tableTitle:n(()=>[s($,null,{default:n(()=>[s(V,{trigger:"hover"},{trigger:n(()=>[s(F,{type:"primary",strong:"",bordered:"",secondary:"",class:"size-7",onClick:S},{icon:n(()=>o[0]||(o[0]=[J("i",{class:"iconfont icon-ADD"},null,-1)])),_:1})]),default:n(()=>[M(" "+U(i(t)("common.addText")),1)]),_:1})]),_:1})]),_:1},8,["columns","request","row-key","actionColumn"])]),_:1}),s(te,{ref_key:"createDrawerRef",ref:u,title:d.value,roleList:v.value,onChange:l},null,8,["title","roleList"])]),_:1})}}});export{Xe as default};
