1 |
- var c=(e,l,t)=>new Promise((d,r)=>{var p=o=>{try{i(t.next(o))}catch(s){r(s)}},a=o=>{try{i(t.throw(o))}catch(s){r(s)}},i=o=>o.done?d(o.value):Promise.resolve(o.value).then(p,a);i((t=t.apply(e,l)).next())});import{i as T}from"./index-B8miXP3d.js";import{B as S,u as v}from"./useTable-Ol_P-TxG.js";import{T as P}from"./index-BEZBHtc2.js";import{ao as I,v as R,_ as $}from"./entry/index-BOVpYCVt-1731915664217.js";import{u as E}from"./index-CwBw3p8r.js";import{P as F,c as A,s as M}from"./PositionDrawer-SAoX8MX_.js";import{g as N,d as g}from"./position-CvNNehu7.js";import{M as V}from"./antd-DXvsKA0x.js";import{d as L,f as y,k as f,a9 as m,_ as w,$ as O,a7 as u,a6 as k,G as _,a2 as B,a0 as D}from"./vue-B5pbXMv7.js";import"./ExclamationCircleOutlined-BaVgfZo1.js";import"./useForm-B-PbqzOc.js";import"./index-x2bUusKH.js";import"./tree-Nv0Zt4Ov.js";import"./copyTextToClipboard-7uPthhEV.js";import"./index-DKfaJplO.js";import"./index-EdNvCi60.js";import"./index-DTfAZuwl.js";import"./index-BcSUkfeU.js";import"./index-DaqRmjER.js";import"./useWindowSizeFn-CzjmevD7.js";import"./plugin-CRRssOeV.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-CRwDSVfI.js";const U=L({name:"PositionManagement",components:{BasicTable:S,PositionDrawer:F,TableAction:P,Button:I},setup(){const{t:e}=R.useI18n(),l=y(),t=y(!1),[d,{openDrawer:r}]=E(),[p,{reload:a}]=v({title:e("sys.position.positionList"),api:N,columns:A,formConfig:{labelWidth:120,schemas:M},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:30,title:e("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",onChange:(n,C)=>{l.value=n,t.value=n.length>0}}});function i(){r(!0,{isUpdate:!1})}function o(n){r(!0,{record:n,isUpdate:!0})}function s(n){return c(this,null,function*(){(yield g({ids:[n.id]})).code===0&&(yield a())})}function h(){return c(this,null,function*(){V.confirm({title:e("common.deleteConfirm"),icon:f(T.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){(yield g({ids:l.value})).code===0&&(t.value=!1,yield a())})},onCancel(){}})})}function b(){return c(this,null,function*(){yield a()})}return{t:e,registerTable:p,registerDrawer:d,handleCreate:i,handleEdit:o,handleDelete:s,handleSuccess:b,handleBatchDelete:h,showDeleteButton:t}}});function j(e,l,t,d,r,p){const a=m("Button"),i=m("a-button"),o=m("TableAction"),s=m("BasicTable"),h=m("PositionDrawer");return w(),O("div",null,[f(s,{onRegister:e.registerTable},{tableTitle:u(()=>[e.showDeleteButton?(w(),k(a,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:u(()=>[_(B(e.t("common.delete")),1)]),_:1},8,["onClick"])):D("",!0)]),toolbar:u(()=>[f(i,{type:"primary",onClick:e.handleCreate},{default:u(()=>[_(B(e.t("sys.position.addPosition")),1)]),_:1},8,["onClick"])]),bodyCell:u(({column:b,record:n})=>[b.key==="action"?(w(),k(o,{key:0,actions:[{label:"编辑",onClick:e.handleEdit.bind(null,n)},{label:"删除",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,n)}}]},null,8,["actions"])):D("",!0)]),_:1},8,["onRegister"]),f(h,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const fe=$(U,[["render",j]]);export{fe as default};
|