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