import{O as B,F as N,G as F,h as v}from"./elementPlus.CSBdF9Zt.js";import{u as O}from"./useResponse.DqThFJSa.js";import{j as S}from"./api.Dg5Q_G4P.js";import{d as T,aJ as y,aK as U,r as j,ai as i,o as c,M as K,O as s,a as u,U as r,u as o,T as d,S as k,c as m,a8 as L,F as R,R as q}from"./vue.1RczIYhx.js";import{_ as G}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.K_MFulpu.js";const I={class:"title"},J={class:"pl-2"},$={key:0,class:"error-message"},z=T({__name:"DownloadError",props:y({errorMsg:{type:Object,required:!0}},{modelValue:{default:!1},modelModifiers:{}}),emits:y(["refresh"],["update:modelValue"]),setup(f,{emit:V}){const a=U(f,"modelValue"),p=j(!1),M=f,{errorMsg:n}=M,h=n.slice(0,3),w=V;async function x(){try{const t=await O(S,{alarm_sku:n},p);t&&t.code==2e3&&(a.value=!1,v.success("同步成功"),w("refresh"))}catch(t){console.log(t),v.error("同步失败")}finally{a.value=!1}}function C(){a.value=!1}return(t,e)=>{const E=i("el-icon"),D=i("el-divider"),_=i("el-button"),b=i("el-dialog");return c(),K(b,{ref:"noticeDialog",modelValue:a.value,"onUpdate:modelValue":e[1]||(e[1]=l=>a.value=l),"close-on-click-modal":!1,"close-on-press-escape":!1,class:"notice-dialog",width:"35%"},{title:s(()=>[u("div",I,[r(E,{style:{color:"orange"}},{default:s(()=>[r(o(B))]),_:1}),u("span",J,"导入失败 "+d(o(n).length)+" 条",1)])]),footer:s(()=>[r(D,{style:{margin:"12px 0 20px 0"}}),r(_,{icon:o(N),onClick:C},{default:s(()=>e[2]||(e[2]=[k("取 消")])),_:1},8,["icon"]),r(_,{icon:o(F),loading:o(p),type:"primary",onClick:e[0]||(e[0]=l=>x())},{default:s(()=>e[3]||(e[3]=[k("同步至群消息")])),_:1},8,["icon","loading"])]),default:s(()=>[u("div",null,[(c(!0),m(R,null,L(o(h),(l,g)=>(c(),m("div",{key:g,class:"error-message"},d(g+1)+". SKU: "+d(l.sku)+" 在 "+d(l.country_code)+" 地区不存在 ",1))),128))]),o(n).length>3?(c(),m("div",$,"...")):q("",!0)]),_:1},8,["modelValue"])}}}),Y=G(z,[["__scopeId","data-v-9dc87a13"]]);export{Y as default};
