var Y=Object.defineProperty;var V=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,tt=Object.prototype.propertyIsEnumerable;var N=(s,o,t)=>o in s?Y(s,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[o]=t,R=(s,o)=>{for(var t in o||(o={}))Z.call(o,t)&&N(s,t,o[t]);if(V)for(var t of V(o))tt.call(o,t)&&N(s,t,o[t]);return s};var C=(s,o,t)=>new Promise((m,h)=>{var w=r=>{try{y(t.next(r))}catch(c){h(c)}},D=r=>{try{y(t.throw(r))}catch(c){h(c)}},y=r=>r.done?m(r.value):Promise.resolve(r.value).then(w,D);y((t=t.apply(s,o)).next())});import{u as et,f as T,g as E}from"./index-2a45336b.js";import{a as $,b as l,o as g,k as j,e,w as a,u,V as at,E as k,c as q,i as b,F as P,G as z,aK as ot,bb as nt,W as it,a5 as lt,aa as st}from"./ant-design-vue-710243d9.js";import"./system-a01e8b88.js";import{u as rt}from"./usePagination-7442a465.js";import ct from"./EditDialog-62154f94.js";import{q as ut}from"./qrlogo-b7e811a6.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 Ot=Object.assign({name:"projectList"},{__name:"index",setup(s){$("");const o=$(""),t=$(!1),{t:m}=et(),h=[{title:"图片",dataIndex:"img",width:120,align:"center"},{title:"案场名称",dataIndex:"name",key:"title"},{title:"状态",dataIndex:"status",key:"introduce",width:100,align:"center"},{title:m("button.action"),key:"action",fixed:"right",width:150,align:"center"}],{listData:w,loading:D,showLoading:y,hideLoading:r,paginationState:c,resetPagination:dt,searchFormData:F}=rt(),Q=$();x();function x(){return C(this,null,function*(){try{y();const{pageSize:n,current:i}=c,{success:p,data:d,total:v}=yield T.project.getProjectList(R({pageSize:n,current:i},F.value)).catch(()=>{throw new Error});r(),E("http.code.success")===p&&(w.value=d,c.total=v)}catch(n){r()}})}function U({id:n}){lt.confirm({title:m("pages.system.user.delTip"),content:m("button.confirm"),okText:m("button.confirm"),onOk:()=>new Promise((i,p)=>{C(this,null,function*(){try{const{success:d}=yield T.project.delItem(n).catch(()=>{throw new Error});E("http.code.success")===d&&(i(),st.success(m("component.message.success.delete")),yield x())}catch(d){p()}})})})}function G({current:n,pageSize:i}){c.current=n,c.pageSize=i,x()}const J=n=>{const{name:i,areaId:p,id:d}=n,v={title:i,typer:"activity",pathUrl:"/pages/sceneDetail/index.vue",areaId:p,relationId:d,kvalue1:"",kvalue2:"",kvalue3:"",kvalue4:"",kvalue5:""};o.value=JSON.stringify(v),console.log(o.value),t.value=!0};function K(){return C(this,null,function*(){yield x()})}return(n,i)=>{const p=l("a-button"),d=l("x-action-bar"),v=l("a-image"),B=l("a-tag"),O=l("a-tooltip"),I=l("x-action-button"),M=l("a-table"),L=l("a-card"),W=l("a-col"),A=l("a-row"),H=l("x-qrCode"),X=l("a-modal");return g(),j(P,null,[e(A,{gutter:8,wrap:!1},{default:a(()=>[e(W,{flex:"auto"},{default:a(()=>[e(L,{type:"flex"},{default:a(()=>[e(d,{class:"mb-8-2"},{default:a(()=>[e(p,{type:"primary",onClick:i[0]||(i[0]=f=>n.$refs.editDialogRef.handleCreate())},{icon:a(()=>[e(u(at))]),default:a(()=>[k(" 新增案场 ")]),_:1})]),_:1}),e(M,{columns:h,"data-source":u(w),bordered:"true",loading:u(D),pagination:u(c),scroll:{x:1e3},onChange:G},{bodyCell:a(({column:f,record:_})=>[f.dataIndex==="img"?(g(),q(v,{key:0,width:60,src:u(E)("http.apiBasic")+_.img||n.$imageErr.imgErr},null,8,["src"])):b("",!0),f.dataIndex==="status"?(g(),j(P,{key:1},[_.status==="enabled"?(g(),q(B,{key:0,color:"green"},{default:a(()=>[k("启用")]),_:1})):b("",!0),_.status==="disabled"?(g(),q(B,{key:1,color:"red"},{default:a(()=>[k("停用")]),_:1})):b("",!0)],64)):b("",!0),f.key==="action"?(g(),j(P,{key:2},[e(I,{onClick:S=>n.$refs.editDialogRef.handleEdit(_)},{default:a(()=>[e(O,null,{title:a(()=>[k(z(n.$t("pages.system.user.edit")),1)]),default:a(()=>[e(u(ot))]),_:1})]),_:2},1032,["onClick"]),e(I,{onClick:S=>J(_)},{default:a(()=>[e(O,null,{title:a(()=>[k("二维码")]),default:a(()=>[e(u(nt))]),_:1})]),_:2},1032,["onClick"]),e(I,{onClick:S=>U(_)},{default:a(()=>[e(O,null,{title:a(()=>[k(z(n.$t("pages.system.delete")),1)]),default:a(()=>[e(u(it),{style:{color:"#ff4d4f"}})]),_:1})]),_:2},1032,["onClick"])],64)):b("",!0)]),_:1},8,["data-source","loading","pagination"])]),_:1})]),_:1})]),_:1}),e(X,{open:t.value,"onUpdate:open":i[1]||(i[1]=f=>t.value=f),title:"生成二维码",onOk:i[2]||(i[2]=f=>t.value=!1),footer:null},{default:a(()=>[e(L,{class:"mb-8-2",style:{display:"flex","align-items":"center","flex-direction":"column","justify-content":"center"}},{default:a(()=>[e(H,{value:o.value,icon:u(ut),iconBackgroundColor:"#ffffff",size:180},null,8,["value","icon"])]),_:1})]),_:1},8,["open"]),e(ct,{ref_key:"editDialogRef",ref:Q,onOk:K},null,512)],64)}}});export{Ot as default};
