index-DMQqG64D.js 3.3 KB

1
  1. var c=(e,l,t)=>new Promise((u,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?u(o.value):Promise.resolve(o.value).then(p,a);i((t=t.apply(e,l)).next())});import{i as T}from"./index-BSYd2hxY.js";import{B as S,u as v}from"./useTable-C16d97Pc.js";import{T as P}from"./index-CX4KF_X2.js";import{ao as I,v as R,_ as $}from"./entry/index-aWM9ONEg-1721905115166.js";import{u as E}from"./index-DsWc2dai.js";import{P as A,c as M,s as N}from"./PositionDrawer-MMwnGRyP.js";import{g as V,d as g}from"./position-hfEgYW6Z.js";import{M as F}from"./antd-c1uHJHtu.js";import{d as L,f as y,k as f,a7 as m,_ as w,$ as O,a9 as d,a8 as k,G as _,a1 as B,ab as D}from"./vue-YAQxJ0SI.js";import"./ExclamationCircleOutlined-CqKW4VDE.js";import"./useForm-BUs7QBU2.js";import"./index-CbXq8_QU.js";import"./tree-BeOocfO0.js";import"./copyTextToClipboard-BoCUzXqE.js";import"./index-BzTU6kMb.js";import"./index-AVXO_uSC.js";import"./index-BLu-LcKy.js";import"./index-D8KFrDWL.js";import"./index-CWChM6mK.js";import"./useWindowSizeFn-Ca3SEPFY.js";import"./plugin-BtkwVqDc.js";import"./onMountedOrActivated-9LbCg5GM.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-2hwmyCqe.js";const U=L({name:"PositionManagement",components:{BasicTable:S,PositionDrawer:A,TableAction:P,Button:I},setup(){const{t:e}=R.useI18n(),l=y(),t=y(!1),[u,{openDrawer:r}]=E(),[p,{reload:a}]=v({title:e("sys.position.positionList"),api:V,columns:M,formConfig:{labelWidth:120,schemas:N},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*(){F.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:u,handleCreate:i,handleEdit:o,handleDelete:s,handleSuccess:b,handleBatchDelete:h,showDeleteButton:t}}});function j(e,l,t,u,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:d(()=>[e.showDeleteButton?(w(),k(a,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:d(()=>[_(B(e.t("common.delete")),1)]),_:1},8,["onClick"])):D("",!0)]),toolbar:d(()=>[f(i,{type:"primary",onClick:e.handleCreate},{default:d(()=>[_(B(e.t("sys.position.addPosition")),1)]),_:1},8,["onClick"])]),bodyCell:d(({column:b,record:n})=>[b.key==="action"?(w(),k(o,{key:0,actions:[{icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,n)},{icon:"ant-design:delete-outlined",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 pe=$(U,[["render",j]]);export{pe as default};