var w=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var x=(n,d)=>{var i={};for(var t in n)N.call(n,t)&&d.indexOf(t)<0&&(i[t]=n[t]);if(n!=null&&w)for(var t of w(n))d.indexOf(t)<0&&P.call(n,t)&&(i[t]=n[t]);return i};import{l as $,o as j,j as H,_ as I}from"./index.js";import{u as O,B as E}from"./useTable-e949a6b7.js";import{T as V}from"./useForm-baba730a.js";import{j as _}from"./antd-0679333d.js";import{r as F,s as K,c as U,a as y}from"./schema-0004c8eb.js";import{u as z}from"./index-679d8a0a.js";import{_ as G}from"./drawer.vue_vue_type_script_setup_true_lang-5ec4ab70.js";import{d as W,a6 as Z,Z as D,_ as q,k as b,a5 as h,G as J,a4 as L,u as m,a8 as Q}from"./vue-72a104e4.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";const X=W({name:"AUTH_SYSTEM_CONSTANT",__name:"index",setup(n){$();const d=j(),[i,{openDrawer:t}]=z(),[S,{reload:g,setSelectedRowKeys:ee}]=O({title:"常量表",api:e=>K(T(e)),columns:U,formConfig:{labelWidth:120,schemas:y,showAdvancedButton:!1},useSearchForm:!0,showTableSetting:!1,bordered:!1,showIndexColumn:!1,canResize:!1,rowKey:e=>e.id,actionColumn:{width:170,title:"操作",dataIndex:"action",fixed:"right"}}),T=e=>{const C=e,{pageNum:l,pageSize:p,field:u="id",order:c="descend"}=C,B=x(C,["pageNum","pageSize","field","order"]),s={pageNum:l,pageSize:p,orderByClause:`${u} ${c==="descend"?"desc":"asc"}`};return Object.keys(B).forEach(f=>{const r=y.find(M=>M.field===f),o=e[f],a=f;r?o!==void 0&&o!==""&&(r.component==="Input"?s[a]=`%${o.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(r.component)?s[a]=H(o)?o.value:o:r.component==="RangePicker"?(s[`${a}From`]=_(o[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),s[`${a}To`]=_(o[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):r.component==="DatePicker"?s[a]=_(o).format(r.componentProps.format||"YYYY-MM-DD"):s[a]=o):s[a]=o}),s},Y=()=>{t(!0,{isUpdate:!1})},v=e=>{t(!0,{record:e,isUpdate:!0})},k=e=>{F(e.id).then(l=>{g()})},A=()=>{g()},R=e=>{d("/system/constant/detail/"+e.id)};return(e,l)=>{const p=Z("a-button");return D(),q("div",null,[b(m(E),{onRegister:m(S)},{toolbar:h(()=>[b(p,{type:"primary",onClick:Y},{default:h(()=>l[0]||(l[0]=[J(" 新增")])),_:1})]),bodyCell:h(({column:u,record:c})=>[u.dataIndex==="action"?(D(),L(m(V),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:v.bind(null,c),divider:!0},{label:"详情",icon:"ant-design:eye-outlined",onClick:R.bind(null,c),divider:!0}],dropDownActions:[{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:k.bind(null,c),placement:"topRight"}}]},null,8,["actions","dropDownActions"])):Q("",!0)]),_:1},8,["onRegister"]),b(G,{onRegister:m(i),onSuccess:A},null,8,["onRegister"])])}}});const _e=I(X,[["__scopeId","data-v-db988f1b"]]);export{_e as default};
