1 |
- import{_ as E,__tla as H}from"./Dialog-bbfaf85c.js";import{d as L,r as n,o as M,v as P,w as s,f as i,a as r,n as c,O as y,g as _,bj as X,bk as q,j as G,ad as J,bl as K,C as N,_ as Q,__tla as T}from"./index-11e4820e.js";import{E as W,__tla as Y}from"./el-link-6cd4f1ac.js";import{i as Z,__tla as $}from"./index-add3c606.js";import{d as ee}from"./download-20922b56.js";import{u as ae,__tla as te}from"./useMessage-06ddf735.js";let V,le=Promise.all([(()=>{try{return H}catch{}})(),(()=>{try{return T}catch{}})(),(()=>{try{return Y}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return te}catch{}})()]).then(async()=>{let x,h,U,b;x=_("div",{class:"el-upload__text"},[c("\u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\uFF0C\u6216"),_("em",null,"\u70B9\u51FB\u4E0A\u4F20")],-1),h={class:"el-upload__tip text-center"},U={class:"el-upload__tip"},b=_("span",null,"\u4EC5\u5141\u8BB8\u5BFC\u5165 xls\u3001xlsx \u683C\u5F0F\u6587\u4EF6\u3002",-1),V=Q(L({name:"SystemUserImportForm",__name:"UserImportForm",emits:["success"],setup(se,{expose:w,emit:C}){const m=ae(),d=n(!1),o=n(!1),v=n(),g=n(),p=n([]),f=n(0);w({open:()=>{d.value=!0,O()}});const F=async()=>{p.value.length!=0?(g.value={Authorization:"Bearer "+X(),"tenant-id":q()},o.value=!0,v.value.submit()):m.error("\u8BF7\u4E0A\u4F20\u6587\u4EF6")},j=C,z=a=>{if(a.code!==0)return m.error(a.msg),void(o.value=!1);const e=a.data;let t="\u4E0A\u4F20\u6210\u529F\u6570\u91CF\uFF1A"+e.createUsernames.length+";";for(let l of e.createUsernames)t+="< "+l+" >";t+="\u66F4\u65B0\u6210\u529F\u6570\u91CF\uFF1A"+e.updateUsernames.length+";";for(const l of e.updateUsernames)t+="< "+l+" >";t+="\u66F4\u65B0\u5931\u8D25\u6570\u91CF\uFF1A"+Object.keys(e.failureUsernames).length+";";for(const l in e.failureUsernames)t+="< "+l+": "+e.failureUsernames[l]+" >";m.alert(t),j("success")},I=()=>{m.error("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u60A8\u91CD\u65B0\u4E0A\u4F20\uFF01"),o.value=!1},O=()=>{var a;o.value=!1,(a=v.value)==null||a.clearFiles()},R=()=>{m.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6\uFF01")},S=async()=>{const a=await Z();ee.excel(a,"\u7528\u6237\u5BFC\u5165\u6A21\u7248.xls")};return(a,e)=>{const t=G,l=J,A=W,B=K,k=N,D=E;return M(),P(D,{modelValue:r(d),"onUpdate:modelValue":e[3]||(e[3]=u=>y(d)?d.value=u:null),title:"\u7528\u6237\u5BFC\u5165",width:"400"},{footer:s(()=>[i(k,{disabled:r(o),type:"primary",onClick:F},{default:s(()=>[c("\u786E \u5B9A")]),_:1},8,["disabled"]),i(k,{onClick:e[2]||(e[2]=u=>d.value=!1)},{default:s(()=>[c("\u53D6 \u6D88")]),_:1})]),default:s(()=>[i(B,{ref_key:"uploadRef",ref:v,"file-list":r(p),"onUpdate:fileList":e[1]||(e[1]=u=>y(p)?p.value=u:null),action:"https://pt.letcgo.com/admin-api/system/user/import?updateSupport="+r(f),"auto-upload":!1,disabled:r(o),headers:r(g),limit:1,"on-error":I,"on-exceed":R,"on-success":z,accept:".xlsx, .xls",drag:""},{tip:s(()=>[_("div",h,[_("div",U,[i(l,{modelValue:r(f),"onUpdate:modelValue":e[0]||(e[0]=u=>y(f)?f.value=u:null)},null,8,["modelValue"]),c(" \u662F\u5426\u66F4\u65B0\u5DF2\u7ECF\u5B58\u5728\u7684\u7528\u6237\u6570\u636E ")]),b,i(A,{underline:!1,style:{"font-size":"12px","vertical-align":"baseline"},type:"primary",onClick:S},{default:s(()=>[c(" \u4E0B\u8F7D\u6A21\u677F ")]),_:1})])]),default:s(()=>[i(t,{icon:"ep:upload"}),x]),_:1},8,["file-list","action","disabled","headers"])]),_:1},8,["modelValue"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/system/user/UserImportForm.vue"]])});export{le as __tla,V as default};
|