import{P as v}from"./page.3b4d44cb.js";import{a as y,e as T,b as V}from"./tableType.fbccd912.js";import{a4 as B,b7 as h,b as f,ar as C,E as g,_ as E,c as d,e as R,k as $,i as l,g as _,h as a,m as k,R as L,S as w}from"./index.0308b213.js";const A={components:{Page:v},setup(){const e=B(),t=h(),u=Number(e.query.id),c=()=>{setTimeout(()=>{t.go(-1)},1e3)},m=[{required:!0,message:"\u6B64\u9879\u5FC5\u987B\u586B\u5199",trigger:"blur"}],r=f({loading:!1,btnLoading:!1,rules:{title:m,limit_price:m,reservation_price:m}}),o=f({title:"",limit_price:"",reservation_price:""});u&&(r.loading=!0,y({id:u}).then(s=>{console.log("\u7F16\u8F91\u4FE1\u606F\uFF1A",s);const p=s.data;o.title=p.title,o.limit_price=p.limit_price,o.reservation_price=p.reservation_price}).finally(()=>{r.loading=!1}));const i=()=>{r.btnLoading=!0,u?T({id:u,...o}).then(s=>{console.log("\u8BF7\u6C42\u7ED3\u679C\uFF1A",s),g.success("\u7F16\u8F91\u6210\u529F"),c()}).finally(()=>{r.btnLoading=!1}):V(o).then(s=>{console.log("\u8BF7\u6C42\u7ED3\u679C\uFF1A",s),g.success("\u63D0\u4EA4\u6210\u529F"),c()}).finally(()=>{r.btnLoading=!1})};return{...C(r),params:o,submit:i}}};const b=e=>(L("data-v-4ca46756"),e=e(),w(),e),I={class:"container"},N=b(()=>_("h2",{class:"title"},"\u7F16\u8F91\u684C\u53F0\u7C7B\u578B",-1)),P=b(()=>_("p",{class:"tips-text"},"\u4EC5\u9884\u8BA2\u8BA2\u5EA7\u65F6\u9700\u8981\u9884\u4ED8\u6B3E\u7684\u91D1\u989D",-1)),S=k("\u63D0\u4EA4");function D(e,t,u,c,m,r){const o=d("el-input"),i=d("el-form-item"),s=d("el-button"),p=d("el-form"),F=d("Page");return R(),$(F,{showBorder:!1},{main:l(()=>[_("div",I,[N,a(p,{ref:"ruleFormRef",model:e.params,rules:e.rules,"label-width":"150px",class:"form-container"},{default:l(()=>[a(i,{label:"\u540D\u5B57",prop:"title","inline-message":!0},{default:l(()=>[a(o,{modelValue:e.params.title,"onUpdate:modelValue":t[0]||(t[0]=n=>e.params.title=n)},null,8,["modelValue"])]),_:1}),a(i,{label:"\u6700\u4F4E\u6D88\u8D39",prop:"limit_price","inline-message":!0},{default:l(()=>[a(o,{modelValue:e.params.limit_price,"onUpdate:modelValue":t[1]||(t[1]=n=>e.params.limit_price=n),placeholder:"\u4F8B\u5982\uFF1A2",type:"number"},null,8,["modelValue"])]),_:1}),a(i,{label:"\u9884\u5B9A\u9884\u4ED8\u6B3E",prop:"reservation_price","inline-message":!0},{default:l(()=>[a(o,{modelValue:e.params.reservation_price,"onUpdate:modelValue":t[2]||(t[2]=n=>e.params.reservation_price=n),type:"number"},null,8,["modelValue"])]),_:1}),a(i,{class:"tips-box"},{default:l(()=>[P]),_:1}),a(i,null,{default:l(()=>[a(s,{type:"primary",loading:e.btnLoading,onClick:t[3]||(t[3]=n=>e.submit(e.ruleFormRef))},{default:l(()=>[S]),_:1},8,["loading"])]),_:1})]),_:1},8,["model","rules"])])]),_:1})}const M=E(A,[["render",D],["__scopeId","data-v-4ca46756"]]);export{M as default};
