var H=Object.defineProperty;var N=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var R=(i,t,e)=>t in i?H(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,S=(i,t)=>{for(var e in t||(t={}))J.call(t,e)&&R(i,e,t[e]);if(N)for(var e of N(t))Q.call(t,e)&&R(i,e,t[e]);return i};var C=(i,t,e)=>new Promise((k,b)=>{var $=r=>{try{c(e.next(r))}catch(_){b(_)}},w=r=>{try{c(e.throw(r))}catch(_){b(_)}},c=r=>r.done?k(r.value):Promise.resolve(r.value).then($,w);c((e=e.apply(i,t)).next())});import{u as U,f as T,g as O}from"./index-2a45336b.js";import{a as X,b as s,o as d,k as v,e as n,w as a,u as m,V as Y,E as h,c as D,i as g,K as Z,G as B,F as P,aK as tt,W as et,a5 as at,aa as nt}from"./ant-design-vue-710243d9.js";import"./system-a01e8b88.js";import{u as ot}from"./usePagination-7442a465.js";import it from"./EditDialog-0894717d.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"./useEnum-4e87ed86.js";import"./useForm-269e95cd.js";const bt=Object.assign({name:"banner"},{__name:"index",setup(i){const{t}=U(),e=[{title:"图片",dataIndex:"img",width:100,align:"center"},{title:"名称",dataIndex:"name",key:"name"},{title:"状态",dataIndex:"status",width:120,align:"center"},{title:"顺序",dataIndex:"sequence",width:100,align:"center"},{title:t("button.action"),key:"action",fixed:"right",width:100,align:"center"}],{listData:k,loading:b,showLoading:$,hideLoading:w,paginationState:c,resetPagination:r,searchFormData:_}=ot(),F=X();x();function x(){return C(this,null,function*(){try{$();const{pageSize:o,current:l}=c,{success:f,data:p,total:E}=yield T.imgmgt.getDataList(S({pageSize:o,current:l},_.value)).catch(()=>{throw new Error});w(),O("http.code.success")===f&&(k.value=p,c.total=E)}catch(o){w()}})}function z({id:o}){at.confirm({title:t("pages.system.user.delTip"),content:t("button.confirm"),okText:t("button.confirm"),onOk:()=>new Promise((l,f)=>{C(this,null,function*(){try{const{success:p}=yield T.imgmgt.delMenu(o).catch(()=>{throw new Error});O("http.code.success")===p&&(l(),nt.success(t("component.message.success.delete")),yield x())}catch(p){f()}})})})}function K({current:o,pageSize:l}){c.current=o,c.pageSize=l,x()}function M(){return C(this,null,function*(){yield x()})}return(o,l)=>{const f=s("a-button"),p=s("x-action-bar"),E=s("a-image"),I=s("a-tooltip"),V=s("a-tag"),L=s("x-action-button"),j=s("a-table"),q=s("a-card"),G=s("a-col"),W=s("a-row");return d(),v(P,null,[n(W,{gutter:8,wrap:!1},{default:a(()=>[n(G,{flex:"auto"},{default:a(()=>[n(q,{type:"flex"},{default:a(()=>[n(p,{class:"mb-8-2"},{default:a(()=>[n(f,{type:"primary",onClick:l[0]||(l[0]=y=>o.$refs.editDialogRef.handleCreate())},{icon:a(()=>[n(m(Y))]),default:a(()=>[h(" 新增 ")]),_:1})]),_:1}),n(j,{columns:e,"data-source":m(k),bordered:"true",loading:m(b),pagination:m(c),scroll:{x:1e3},onChange:K},{bodyCell:a(({column:y,record:u})=>[y.dataIndex==="img"?(d(),D(E,{key:0,width:60,src:m(O)("http.apiBasic")+u.img||o.$imageErr.imgErr},null,8,["src"])):g("",!0),y.dataIndex==="name"?(d(),D(I,{key:1,title:u.name},{default:a(()=>[Z("span",null,B(u.name),1)]),_:2},1032,["title"])):g("",!0),y.dataIndex==="status"?(d(),v(P,{key:2},[u.status==="enabled"?(d(),D(V,{key:0,color:"green"},{default:a(()=>[h("启用")]),_:1})):g("",!0),u.status==="disabled"?(d(),D(V,{key:1,color:"red"},{default:a(()=>[h("停用")]),_:1})):g("",!0)],64)):g("",!0),y.key==="action"?(d(),v(P,{key:3},[n(L,{onClick:A=>o.$refs.editDialogRef.handleEdit(u)},{default:a(()=>[n(I,null,{title:a(()=>[h(B(o.$t("pages.system.user.edit")),1)]),default:a(()=>[n(m(tt))]),_:1})]),_:2},1032,["onClick"]),n(L,{onClick:A=>z(u)},{default:a(()=>[n(I,null,{title:a(()=>[h(B(o.$t("pages.system.delete")),1)]),default:a(()=>[n(m(et),{style:{color:"#ff4d4f"}})]),_:1})]),_:2},1032,["onClick"])],64)):g("",!0)]),_:1},8,["data-source","loading","pagination"])]),_:1})]),_:1})]),_:1}),n(it,{ref_key:"editDialogRef",ref:F,onOk:M},null,512)],64)}}});export{bt as default};
