import{b7 as v,b as h,ar as E,jj as D,jk as S,E as T,_ as $,c,e as f,f as C,g as m,h as o,i as n,F,m as p,t as w,j,k as L}from"./index.0308b213.js";import{t as A}from"./index.d8f9fa2a.js";const V={props:{tableData:{type:Array,default:[]}},emits:["updateList"],setup(t,s){console.log("props\uFF1A",t);const y=v(),d=h({showDialog:!1,dialogText:"",selectIds:[]}),k=e=>e.id,b=h({store_id:"",table_id:""}),r=e=>{let l=[{title:"\u7F16\u8F91",val:"edit"},{title:"\u5220\u9664",val:"del"}];return e.wx_url&&l.splice(0,1),l};let i;const u=(e,l)=>{i={type:e,id:l.id},e=="qrcode"||e=="del"?(d.showDialog=!0,b.store_id=l.sid,b.table_id=l.cid,d.dialogText=e=="qrcode"?"\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5417?":"\u786E\u5B9A\u5220\u9664\u5417?"):y.push({path:"/store/storeInside/addTable",query:{id:l.id}})},_=()=>{d.showDialog=!1,i.type=="qrcode"?D(b).then(e=>{console.log("\u751F\u6210\u4E8C\u7EF4\u7801\u6210\u529F",e)}):i.type=="del"&&a([i.id])},g=e=>{d.selectIds=e.map(l=>l.id)},a=e=>{S({ids:e}).then(l=>{T.success("\u5220\u9664\u6210\u529F"),s.emit("updateList")})};return{...E(d),getRowKeys:k,btnList:r,btnClick:u,dialogConfirm:_,tableSelects:g,del:a,tableStatusObj:A}}};const B={class:"container"},I=p("\u6279\u91CF\u5220\u9664"),q={class:"dialog-footer"},R=p("\u53D6\u6D88"),N=p("\u786E\u5B9A");function O(t,s,y,d,k,b){const r=c("el-table-column"),i=c("el-tag"),u=c("el-button"),_=c("el-table"),g=c("el-dialog");return f(),C(F,null,[m("div",B,[o(_,{data:t.tableData,border:"",style:{width:"100%"},"row-key":t.getRowKeys,"default-expand-all":!0,onSelectionChange:t.tableSelects},{default:n(()=>[o(r,{type:"selection"}),o(r,{label:"\u684C\u53F0\u53F7",prop:"title",align:"center"}),o(r,{label:"\u684C\u53F0\u7C7B\u578B",prop:"c_title",align:"center"}),o(r,{label:"\u53EF\u4F9B\u5C31\u9910\u4EBA\u6570",prop:"guest_num",align:"center"}),o(r,{label:"\u6392\u5E8F",prop:"displayorder",align:"center"}),o(r,{label:"\u72B6\u6001",prop:"status",align:"center"},{default:n(a=>{var e;return[o(i,{type:(e=t.tableStatusObj(a.row.status))==null?void 0:e.type,effect:"dark"},{default:n(()=>{var l;return[p(w((l=t.tableStatusObj(a.row.status))==null?void 0:l.name),1)]}),_:2},1032,["type"])]}),_:1}),o(r,{label:"\u64CD\u4F5C",width:"300px",align:"center"},{default:n(a=>[(f(!0),C(F,null,j(t.btnList(a.row),(e,l)=>(f(),L(u,{key:l,onClick:K=>t.btnClick(e.val,a.row)},{default:n(()=>[p(w(e.title),1)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1},8,["data","row-key","onSelectionChange"]),o(u,{class:"del-btn",type:"danger",onClick:s[0]||(s[0]=a=>t.del(t.selectIds))},{default:n(()=>[I]),_:1})]),o(g,{modelValue:t.showDialog,"onUpdate:modelValue":s[3]||(s[3]=a=>t.showDialog=a),title:"\u63D0\u793A",width:"30%"},{footer:n(()=>[m("span",q,[o(u,{onClick:s[1]||(s[1]=a=>t.showDialog=!1)},{default:n(()=>[R]),_:1}),o(u,{type:"primary",onClick:s[2]||(s[2]=a=>t.dialogConfirm())},{default:n(()=>[N]),_:1})])]),default:n(()=>[m("span",null,w(t.dialogText),1)]),_:1},8,["modelValue"])],64)}const Q=$(V,[["render",O],["__scopeId","data-v-9631b14d"]]);export{Q as default};
