1 |
- var m=(e,r,o)=>new Promise((f,s)=>{var l=t=>{try{n(o.next(t))}catch(i){s(i)}},c=t=>{try{n(o.throw(t))}catch(i){s(i)}},n=t=>t.done?f(t.value):Promise.resolve(t.value).then(l,c);n((o=o.apply(e,r)).next())});import{i as v}from"./index-BQgPd3bX.js";import{B as I,u as A}from"./useTable-B6PunZL5.js";import{T as R}from"./index-BIj58_Cj.js";import{ao as $,v as E,u as F,_ as M}from"./entry/index-DJx93RYF-1731481145019.js";import{u as N}from"./index-CzIUqxsa.js";import{D as V,c as G,s as L}from"./DictionaryDrawer-DQpK66pd.js";import{g as O,d as w}from"./dictionary-D_lGTbqN.js";import{M as U}from"./antd-CBeLo_oO.js";import{d as j,f as g,k as h,a9 as u,_ as b,$ as W,a7 as p,a6 as k,G as B,a2 as T,a0 as _}from"./vue-B5pbXMv7.js";import"./ExclamationCircleOutlined-Ca0mYuiu.js";import"./useForm-pwHPrILC.js";import"./index-D_SNX-7K.js";import"./tree-BtJaOqz0.js";import"./copyTextToClipboard-Dngb1Nn3.js";import"./index-BDsRYE32.js";import"./index-wDJjh9Os.js";import"./index-BzfGKMh3.js";import"./index-DkGmfgEA.js";import"./index-Cuu0w1HY.js";import"./useWindowSizeFn-BxA6-zLj.js";import"./plugin-C2XGVjF6.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-lvT7rWOs.js";const q=j({name:"DictionaryManagement",components:{BasicTable:I,DictionaryDrawer:V,TableAction:R,Button:$},setup(){const{t:e}=E.useI18n(),r=g(),o=g(!1),f=F(),[s,{openDrawer:l}]=N(),[c,{reload:n}]=A({title:e("sys.dictionary.dictionaryList"),api:O,columns:G,formConfig:{labelWidth:120,schemas:L},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:(a,C)=>{r.value=a,o.value=a.length>0}}});function t(){l(!0,{isUpdate:!1})}function i(a){l(!0,{record:a,isUpdate:!0})}function y(a){return m(this,null,function*(){(yield w({ids:[a.id]})).code===0&&(yield n())})}function D(){return m(this,null,function*(){U.confirm({title:e("common.deleteConfirm"),icon:h(v.ExclamationCircleOutlined),onOk(){return m(this,null,function*(){(yield w({ids:r.value})).code===0&&(o.value=!1,yield n())})},onCancel(){}})})}function d(){return m(this,null,function*(){yield n()})}function S(a){f("/dictionary/detail/"+a.id)}return{t:e,registerTable:c,registerDrawer:s,handleCreate:t,handleEdit:i,handleDelete:y,handleSuccess:d,handleBatchDelete:D,showDeleteButton:o,handleAddDetail:S}}});function z(e,r,o,f,s,l){const c=u("Button"),n=u("a-button"),t=u("TableAction"),i=u("BasicTable"),y=u("DictionaryDrawer");return b(),W("div",null,[h(i,{onRegister:e.registerTable},{tableTitle:p(()=>[e.showDeleteButton?(b(),k(c,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:p(()=>[B(T(e.t("common.delete")),1)]),_:1},8,["onClick"])):_("",!0)]),toolbar:p(()=>[h(n,{type:"primary",onClick:e.handleCreate},{default:p(()=>[B(T(e.t("sys.dictionary.addDictionary")),1)]),_:1},8,["onClick"])]),bodyCell:p(({column:D,record:d})=>[D.key==="action"?(b(),k(t,{key:0,actions:[{icon:"ant-design:file-add-outlined",onClick:e.handleAddDetail.bind(null,d)},{label:"编辑",onClick:e.handleEdit.bind(null,d)},{label:"删除",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,d)}}]},null,8,["actions"])):_("",!0)]),_:1},8,["onRegister"]),h(y,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const De=M(q,[["render",z]]);export{De as default};
|