import{az as m,d as C,b as y,c as s,e as _,f as c,h as e,i as o,u as d,F as k,j as x,k as E,m as r,t as L,g as N,E as q,_ as z}from"./index.0308b213.js";const I=()=>m.get("addon/thirdDiscount.web.wikeyun_setting/getSetting"),M=g=>m.post("addon/thirdDiscount.web.wikeyun_setting/setSetting",g),T=()=>m.get("addon/thirdDiscount.web.wikeyun_setting/getStoreList"),$={class:"setting-form"},G=r("\u5F00"),H=r("\u5173"),J=r("\u6DFB\u52A0"),K={class:"operation-btn"},O=r("\u63D0\u4EA4"),P=C({setup(g){const t=y({is_open:0,app_key:"",appSecret:"",url:"",store_id:"",detail:[]}),f=y({list:[]}),F=()=>{t.detail.push({sid:"",store_code:"",price:""})},S=()=>{M(t).then(a=>{console.log(a),q.success("\u8BBE\u7F6E\u6210\u529F")})},w=()=>{I().then(a=>{console.log(a),t.is_open=a.data.is_open,t.app_key=a.data.app_key,t.appSecret=a.data.appSecret,t.url=a.data.url,t.store_id=a.data.store_id,t.detail=a.data.detail,console.log("setting",t)})};return(()=>{T().then(a=>{console.log(a),f.list=a})})(),w(),(a,n)=>{const V=s("el-radio"),h=s("el-radio-group"),i=s("el-form-item"),p=s("el-input"),B=s("el-option"),U=s("el-select"),v=s("el-link"),A=s("el-form"),b=s("el-card"),D=s("el-button");return _(),c("div",$,[e(b,{shadow:"always",style:{"margin-top":"20px"}},{default:o(()=>[e(A,{"label-width":"170px"},{default:o(()=>[e(i,{label:"\u5F00\u5173"},{default:o(()=>[e(h,{modelValue:d(t).is_open,"onUpdate:modelValue":n[0]||(n[0]=l=>d(t).is_open=l)},{default:o(()=>[e(V,{label:1},{default:o(()=>[G]),_:1}),e(V,{label:0},{default:o(()=>[H]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(i,{label:"app_key"},{default:o(()=>[e(p,{modelValue:d(t).app_key,"onUpdate:modelValue":n[1]||(n[1]=l=>d(t).app_key=l)},null,8,["modelValue"])]),_:1}),e(i,{label:"appSecret"},{default:o(()=>[e(p,{modelValue:d(t).appSecret,"onUpdate:modelValue":n[2]||(n[2]=l=>d(t).appSecret=l)},null,8,["modelValue"])]),_:1}),e(i,{label:"url"},{default:o(()=>[e(p,{modelValue:d(t).url,"onUpdate:modelValue":n[3]||(n[3]=l=>d(t).url=l)},null,8,["modelValue"])]),_:1}),e(i,{label:"\u95E8\u5E97id"},{default:o(()=>[e(p,{modelValue:d(t).store_id,"onUpdate:modelValue":n[4]||(n[4]=l=>d(t).store_id=l)},null,8,["modelValue"])]),_:1}),(_(!0),c(k,null,x(d(t).detail,l=>(_(),E(i,{label:"\u5546\u6237\u8BBE\u7F6E",prop:"setting.item.detail",key:l},{default:o(()=>[e(U,{class:"tn-el-form-item--item",placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",filterable:"",clearable:"",modelValue:l.sid,"onUpdate:modelValue":u=>l.sid=u},{default:o(()=>[(_(!0),c(k,null,x(d(f).list,(u,R)=>(_(),E(B,{value:u.id,label:u.title},{default:o(()=>[r(L(u.title),1)]),_:2},1032,["value","label"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"]),e(p,{modelValue:l.store_code,"onUpdate:modelValue":u=>l.store_code=u,style:{"margin-left":"10px",width:"200px"},placeholder:"\u8BF7\u8F93\u5165\u5FAE\u5BA2\u4E91\u96C6\u5546\u6237id"},null,8,["modelValue","onUpdate:modelValue"]),e(p,{modelValue:l.price,"onUpdate:modelValue":u=>l.price=u,style:{"margin-left":"10px",width:"200px"},placeholder:"\u8BF7\u8F93\u5165\u6DA8\u5E45"},null,8,["modelValue","onUpdate:modelValue"]),e(p,{modelValue:l.api_code,"onUpdate:modelValue":u=>l.api_code=u,style:{"margin-left":"10px",width:"200px"},placeholder:"\u8BF7\u8F93\u5165api_code"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024))),128)),e(i,{label:""},{default:o(()=>[e(v,{type:"primary",onClick:n[5]||(n[5]=l=>F())},{default:o(()=>[J]),_:1})]),_:1})]),_:1})]),_:1}),e(b,{shadow:"always",style:{"margin-top":"20px"}},{default:o(()=>[N("div",K,[e(D,{type:"primary",onClick:S},{default:o(()=>[O]),_:1})])]),_:1})])}}});const X=z(P,[["__scopeId","data-v-8bc8460d"]]);export{X as default};
