var y=(D,w,c)=>new Promise((k,p)=>{var g=n=>{try{_(c.next(n))}catch(m){p(m)}},s=n=>{try{_(c.throw(n))}catch(m){p(m)}},_=n=>n.done?k(n.value):Promise.resolve(n.value).then(g,s);_((c=c.apply(D,w)).next())});import{f as E,g as O}from"./index-2a45336b.js";import{u as A}from"./usePagination-7442a465.js";import H from"./EditDialog-43164f72.js";import J from"./Dict-5b011d26.js";import{a as V,b as o,o as L,k as N,e as t,w as e,u as d,K as R,G as S,E as x,V as Q,F as B,i as W,a5 as X,aa as Y}from"./ant-design-vue-710243d9.js";import"./tinymce-3184e0f1.js";import"./echarts-ca5d9323.js";import"./cropper-47c8e461.js";import"./lodash-es-7cb071db.js";import"./qrcode-bec2257a.js";import"./jschardet-bd496279.js";import"./useForm-269e95cd.js";import"./EditDictDialog-a8309254.js";const Z={class:"fs-14 fw-400 ml-8-2"},ft=Object.assign({name:"systemDict"},{__name:"index",setup(D){const w=[{title:"名称",dataIndex:"title",fixed:"left"},{title:"唯一值",dataIndex:"key",width:160},{title:"状态",dataIndex:"status",width:160},{title:"操作",key:"action",fixed:"right",width:120}],{listData:c,loading:k,showLoading:p,hideLoading:g,paginationState:s,resetPagination:_,searchFormData:n}=A(),m=V(),b=V(null);function h(){return y(this,null,function*(){try{p();const{pageSize:a,current:i}=s,{code:l,data:r}=yield E.common.getPageList({pageSize:a,current:i}).catch(()=>{throw new Error});if(g(),O("http.code.success")===l){const{records:C,pagination:v}=r;c.value=C,s.total=v.total}}catch(a){g()}})}function F({id:a}){X.confirm({title:"删除提示",content:"确认删除？",okText:"确认",onOk:()=>new Promise((i,l)=>{y(this,null,function*(){try{const{code:r}=yield E.common.del(a).catch(()=>{throw new Error});O("http.code.success")===r&&(i(),Y.success("删除成功"),yield h())}catch(r){l()}})})})}function I({current:a,pageSize:i}){s.current=a,s.pageSize=i,h()}function T(a){b.value=a,console.log(a),_(),h()}function z(){return y(this,null,function*(){yield h()})}return(a,i)=>{const l=o("a-col"),r=o("a-button"),C=o("a-input"),v=o("a-form-item"),$=o("a-row"),j=o("a-form"),G=o("x-search-bar"),K=o("x-action-bar"),P=o("x-action-button"),M=o("a-table"),U=o("a-card");return L(),N(B,null,[t($,{gutter:8,wrap:!1},{default:e(()=>[t(l,{flex:"0 0 280px"},{default:e(()=>[t(J,{value:d(n).role,"onUpdate:value":i[0]||(i[0]=u=>d(n).role=u),onChange:T},null,8,["value"])]),_:1}),t(l,{flex:"auto"},{default:e(()=>[t(U,{type:"flex"},{title:e(()=>{var u,f;return[R("span",null,S((u=b.value)==null?void 0:u.title),1),R("span",Z,S((f=b.value)==null?void 0:f.key),1)]}),default:e(()=>[t(K,{class:"mb-8-2"},{extra:e(()=>[t(G,{"body-style":{padding:0},bordered:!1},{default:e(()=>[t(j,{layout:"inline"},{default:e(()=>[t($,{gutter:12,type:"flex"},{default:e(()=>[t(l,null,{default:e(()=>[t(v,null,{default:e(()=>[t(C)]),_:1})]),_:1}),t(l,null,{default:e(()=>[t(r,{ghost:"",type:"primary"},{default:e(()=>[x("搜索 ")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),default:e(()=>[t(r,{type:"primary",onClick:i[1]||(i[1]=u=>a.$refs.editDialogRef.handleCreate())},{icon:e(()=>[t(d(Q))]),default:e(()=>[x(" 新建项 ")]),_:1})]),_:1}),t(M,{columns:w,"data-source":d(c),loading:d(k),pagination:d(s),onChange:I},{bodyCell:e(({column:u,record:f})=>[u.key==="action"?(L(),N(B,{key:0},[t(P,{onClick:q=>a.$refs.editDialogRef.handleEdit(f)},{default:e(()=>[x("编辑")]),_:2},1032,["onClick"]),t(P,{onClick:q=>F(f)},{default:e(()=>[x("删除")]),_:2},1032,["onClick"])],64)):W("",!0)]),_:1},8,["data-source","loading","pagination"])]),_:1})]),_:1})]),_:1}),t(H,{ref_key:"editDialogRef",ref:m,onOk:z},null,512)],64)}}});export{ft as default};
