import{d as P,r,j as R,a9 as l,o as U,c as j,M as e,G as a,B as F,u as v,K as _,H as T,N as q,a as b,L as A,F as G}from"./vue.65d9dadc.js";import{B as H,b as K}from"./index.373e4c1e.js";import{j as g}from"./elementPlus.c5b0e04f.js";import{createCrudOptions as O}from"./crud.6dc127f4.js";import{u as z}from"./index.88f2b4f2.js";import"./echarts.72dc8373.js";const I=b("p",null,"请复制下面的授权链接到店铺常用登入浏览器去授权：",-1),ee=P({__name:"index",setup(J){const{toClipboard:h}=z(),i=r(!1),o=r({region:1,custom_shop_name:""}),m=r(!1),s=r(""),d=r("ad"),V=(n,t)=>{d.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="",i.value=!0},y=async()=>{d.value==="ad"?s.value="广告授权":d.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:B}=H({createCrudOptions:O,context:{showDialog:V}});return R(()=>{B.doRefresh()}),(n,t)=>{const w=l("fs-crud"),D=l("el-input"),p=l("el-form-item"),c=l("el-option"),L=l("el-select"),N=l("el-form"),f=l("el-button"),S=l("el-divider"),E=l("el-text"),M=l("el-dialog");return U(),j(G,null,[e(v(K),{class:"fs-page-custom"},{default:a(()=>[e(w,F({ref_key:"crudRef",ref:C},v(k)),null,16)]),_:1}),e(M,{modelValue:i.value,"onUpdate:modelValue":t[2]||(t[2]=u=>i.value=u),title:d.value==="ad"?"广告授权":"SP授权",width:"45%","destroy-on-close":!0,center:""},{default:a(()=>[e(N,{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(L,{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"]),T(b("div",null,[e(S),I,e(E,{truncated:""},{default:a(()=>[_(A(s.value),1)]),_:1}),e(f,{style:{display:"block"},onClick:x},{default:a(()=>[_("复制链接")]),_:1})],512),[[q,s.value]])]),_:1},8,["modelValue","title"])],64)}}});export{ee as default};
