import{d as N,r,j as R,ai as l,o as T,c as F,U as e,O as a,K as M,u as v,S as _,P as O,V as j,a as b,T as q,F as A}from"./vue.adf17aba.js";import{B as K,b as z}from"./index.ad3efb29.js";import{E as g}from"./elementPlus.4833989a.js";import{createCrudOptions as G}from"./crud.4b85f482.js";import{u as H}from"./index.4ff1d6e6.js";import"./echarts.72dc8373.js";const I=b("p",null,"请复制下面的授权链接到店铺常用登入浏览器去授权：",-1),ee=N({__name:"index",setup(J){const{toClipboard:h}=H(),d=r(!1),o=r({region:1,custom_shop_name:""}),m=r(!1),s=r(""),i=r("ad"),V=(n,t)=>{i.value=n,n==="sp"?(o.value.custom_shop_name=t.custom_shop_name,o.value.region=t.region,m.value=!0):(o.value.custom_shop_name="",o.value.region=1,m.value=!1),s.value="",d.value=!0},y=async()=>{i.value==="ad"?s.value="广告授权":i.value==="sp"&&(s.value="SP授权")},x=async()=>{try{await h(s.value),g({message:"复制成功!",type:"success"})}catch(n){g.error(n)}},{crudBinding:k,crudRef:C,crudExpose:w}=K({createCrudOptions:G,context:{showDialog:V}});return R(()=>{w.doRefresh()}),(n,t)=>{const B=l("fs-crud"),D=l("el-input"),p=l("el-form-item"),c=l("el-option"),S=l("el-select"),E=l("el-form"),f=l("el-button"),P=l("el-divider"),U=l("el-text"),L=l("el-dialog");return T(),F(A,null,[e(v(z),{class:"fs-page-custom"},{default:a(()=>[e(B,M({ref_key:"crudRef",ref:C},v(k)),null,16)]),_:1}),e(L,{modelValue:d.value,"onUpdate:modelValue":t[2]||(t[2]=u=>d.value=u),title:i.value==="ad"?"广告授权":"SP授权",width:"45%","destroy-on-close":!0,center:""},{default:a(()=>[e(E,{model:o.value,"label-position":"right","label-width":"100px",disabled:m.value},{default:a(()=>[e(p,{label:"亚马逊店铺",prop:"custom_shop_name",rules:{required:!0,message:"必填项",trigger:"blur"}},{default:a(()=>[e(D,{modelValue:o.value.custom_shop_name,"onUpdate:modelValue":t[0]||(t[0]=u=>o.value.custom_shop_name=u)},null,8,["modelValue"])]),_:1}),e(p,{label:"区域"},{default:a(()=>[e(S,{modelValue:o.value.region,"onUpdate:modelValue":t[1]||(t[1]=u=>o.value.region=u)},{default:a(()=>[e(c,{label:"北美",value:1}),e(c,{label:"欧洲",value:2}),e(c,{label:"远东",value:3})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","disabled"]),e(f,{type:"primary",onClick:y,disabled:o.value.custom_shop_name===""},{default:a(()=>[_("生成授权链接")]),_:1},8,["disabled"]),O(b("div",null,[e(P),I,e(U,{truncated:""},{default:a(()=>[_(q(s.value),1)]),_:1}),e(f,{style:{display:"block"},onClick:x},{default:a(()=>[_("复制链接")]),_:1})],512),[[j,s.value]])]),_:1},8,["modelValue","title"])],64)}}});export{ee as default};
