import{P as E}from"./page.3b4d44cb.js";import{a4 as j,b7 as w,b as C,jg as I,ar as P,jh as R,ji as N,E as U,_ as $,c as d,e as p,k as g,i as n,g as h,h as u,f as F,j as V,F as T,m as D,R as S,S as q}from"./index.0308b213.js";import{g as O}from"./tableType.fbccd912.js";import{g as M}from"./tableArea.5d4d6780.js";const z={components:{Page:E},setup(){const e=j(),t=w(),m=Number(e.query.id),f=Number(e.query.tableTypeId),b=[{required:!0,message:"\u6B64\u9879\u5FC5\u987B\u586B\u5199",trigger:"blur"}],i=C({btnLoading:!1,rules:{title:b,guest_num:b,tableType:b,tableArea:b},categoryList:[],tableTypeList:[]}),o=C({title:"",guest_num:"",cid:"",table_area_id:"",displayorder:""}),r=()=>{setTimeout(()=>{t.go(-1)},1e3)};O({page:1,limit:200,status:-1,keyword:""}).then(s=>{console.log("\u684C\u53F0\u7C7B\u578B:",s),i.categoryList=s.list,f&&(o.cid=f)}),M({page:1,limit:20,status:-1,keyword:""}).then(s=>{console.log("\u684C\u53F0\u533A\u57DF:",s),i.tableTypeList=s.lists.map(l=>({id:l.id,title:l.title,child:l.child.map(_=>({id:_.id,title:_.title}))}))}),m&&I({id:m}).then(s=>{console.log("\u7F16\u8F91\u4FE1\u606F",s);const l=s.data;!l||(o.title=l.title,o.guest_num=l.guest_num,o.cid=l.cid,o.table_area_id=l.table_area_id,o.displayorder=l.displayorder)});const c=()=>{console.log("\u53C2\u6570",o),i.btnLoading=!0;const s=l=>{U.success(l)};m?R(Object.assign({id:m,...o})).then(l=>{console.log("\u8BF7\u6C42\u7ED3\u679C\uFF1A",l),s("\u7F16\u8F91\u6210\u529F"),r()}).finally(()=>{i.btnLoading=!1}):N(o).then(l=>{console.log("\u8BF7\u6C42\u7ED3\u679C\uFF1A",l),s("\u63D0\u4EA4\u6210\u529F"),r()}).finally(()=>{i.btnLoading=!1})};return{...P(i),params:o,submit:c}}};const v=e=>(S("data-v-5bd34dad"),e=e(),q(),e),G={class:"container"},H=v(()=>h("h2",{class:"title"},"\u9910\u684C\u7BA1\u7406",-1)),J=v(()=>h("p",{class:"tips-text"},"\u4F8B\u5982\uFF1AC001",-1)),K=D("\u63D0\u4EA4");function Q(e,t,m,f,b,i){const o=d("el-input"),r=d("el-form-item"),c=d("el-option"),s=d("el-select"),l=d("el-option-group"),_=d("el-button"),A=d("el-form"),L=d("Page");return p(),g(L,{showBorder:!1},{main:n(()=>[h("div",G,[H,u(A,{ref:"ruleFormRef",model:e.params,rules:e.rules,"label-width":"150px",class:"form-container"},{default:n(()=>[u(r,{label:"\u540D\u5B57(\u684C\u53F0\u53F7)",prop:"title","inline-message":!0},{default:n(()=>[u(o,{modelValue:e.params.title,"onUpdate:modelValue":t[0]||(t[0]=a=>e.params.title=a)},null,8,["modelValue"])]),_:1}),u(r,{class:"tips-box"},{default:n(()=>[J]),_:1}),u(r,{label:"\u53EF\u4F9B\u5C31\u9910\u4EBA\u6570",prop:"guest_num","inline-message":!0},{default:n(()=>[u(o,{modelValue:e.params.guest_num,"onUpdate:modelValue":t[1]||(t[1]=a=>e.params.guest_num=a),type:"number",placeholder:"\u4F8B\u5982\uFF1A2"},null,8,["modelValue"])]),_:1}),u(r,{label:"\u684C\u53F0\u7C7B\u578B",prop:"tableType","inline-message":!0},{default:n(()=>[u(s,{modelValue:e.params.cid,"onUpdate:modelValue":t[2]||(t[2]=a=>e.params.cid=a),clearable:"",placeholder:"\u9009\u62E9\u684C\u53F0\u7C7B\u578B"},{default:n(()=>[(p(!0),F(T,null,V(e.categoryList,(a,y)=>(p(),g(c,{key:y,label:a.title,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(r,{label:"\u684C\u53F0\u533A\u57DF",prop:"tableArea","inline-message":!0},{default:n(()=>[u(s,{modelValue:e.params.table_area_id,"onUpdate:modelValue":t[3]||(t[3]=a=>e.params.table_area_id=a),clearable:"",placeholder:"\u9009\u62E9\u684C\u53F0\u7C7B\u578B"},{default:n(()=>[(p(!0),F(T,null,V(e.tableTypeList,(a,y)=>(p(),g(l,{key:y,label:a.title},{default:n(()=>[(p(!0),F(T,null,V(a.child,(B,k)=>(p(),g(c,{key:k,label:B.title,value:B.id},null,8,["label","value"]))),128))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(r,{label:"\u6392\u5E8F",prop:"displayorder"},{default:n(()=>[u(o,{modelValue:e.params.displayorder,"onUpdate:modelValue":t[4]||(t[4]=a=>e.params.displayorder=a),type:"number",placeholder:"\u4F8B\u5982\uFF1A2"},null,8,["modelValue"])]),_:1}),u(r,null,{default:n(()=>[u(_,{type:"primary",loading:e.btnLoading,onClick:t[5]||(t[5]=a=>e.submit(e.ruleFormRef))},{default:n(()=>[K]),_:1},8,["loading"])]),_:1})]),_:1},8,["model","rules"])])]),_:1})}const x=$(z,[["render",Q],["__scopeId","data-v-5bd34dad"]]);export{x as default};
