setting-a823f418.js 6.8 KB

123456789
  1. /**
  2. * 由 Fantastic-admin 提供技术支持
  3. * Powered by Fantastic-admin
  4. * Gitee https://gitee.com/hooray/fantastic-admin
  5. * Github https://github.com/hooray/fantastic-admin
  6. */
  7. import{_ as P}from"./index-ac700926.js";import{_ as Q}from"./index.vue_vue_type_script_setup_true_name_SvgIcon_lang-9ad2d3e0.js";import{a as N,v as R}from"./runtime-dom.esm-bundler-e65f1c43.js";import{aU as z}from"./index-5cddd228.js";import{j as k,r as I,a3 as n,k as v,l as V,E as t,y as o,x as B,m as l,t as y,z as D,u as s,B as j,C as $,aJ as T,aK as K}from"./runtime-core.esm-bundler-5fc1c360.js";import{_ as O}from"./_plugin-vue_export-helper-c27b6911.js";import{b as L}from"./vue-router-8a13d09b.js";import{b as q}from"./route-block-83d24a4e.js";import"./iconify-3d8b277a.js";import"./_MapCache-1b613190.js";const A={class:"upload-container"},J={key:1,class:"image"},F={class:"mask"},G={class:"actions"},H=["onClick"],W=["onClick"],X={key:0,class:"el-upload__tip"},Y={style:{display:"inline-block"}},Z=k({name:"ImageUpload"}),ee=k({...Z,props:{action:{type:String,required:!0},headers:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}},name:{type:String,default:"file"},url:{type:String,default:""},size:{type:Number,default:2},width:{type:Number,default:150},height:{type:Number,default:150},placeholder:{type:String,default:""},notip:{type:Boolean,default:!1},ext:{type:Array,default:()=>["jpg","png","gif","bmp"]}},emits:["update:url","onSuccess"],setup(e,{emit:b}){const a=e,i=I({imageViewerVisible:!1,progress:{preview:"",percent:0}});function S(){i.value.imageViewerVisible=!0}function f(){i.value.imageViewerVisible=!1}function c(){b("update:url","")}const h=r=>{const _=r.name.split(".").at(-1),m=a.ext.includes(_),u=r.size/1024/1024<a.size;return m||z.error(`上传图片只支持 ${a.ext.join(" / ")} 格式!`),u||z.error(`上传图片大小不能超过 ${a.size}MB!`),m&&u&&(i.value.progress.preview=URL.createObjectURL(r)),m&&u},p=r=>{i.value.progress.percent=~~r.percent},g=r=>{i.value.progress.preview="",i.value.progress.percent=0,b("onSuccess",r)};return(r,x)=>{const _=Q,m=n("el-icon"),u=n("el-image"),C=n("el-progress"),U=n("el-upload"),d=n("el-alert"),M=n("el-image-viewer");return v(),V("div",A,[t(U,{"show-file-list":!1,headers:e.headers,action:e.action,data:e.data,name:e.name,"before-upload":h,"on-progress":p,"on-success":g,drag:"",class:"image-upload"},{default:o(()=>[e.url===""?(v(),B(u,{key:0,src:e.url===""?e.placeholder:e.url,style:y(`width:${e.width}px;height:${e.height}px;`),fit:"fill"},{error:o(()=>[l("div",{class:"image-slot",style:y(`width:${e.width}px;height:${e.height}px;`)},[t(m,null,{default:o(()=>[t(_,{name:"i-ep:plus"})]),_:1})],4)]),_:1},8,["src","style"])):(v(),V("div",J,[t(u,{src:e.url,style:y(`width:${e.width}px;height:${e.height}px;`),fit:"fill"},null,8,["src","style"]),l("div",F,[l("div",G,[l("span",{title:"预览",onClick:N(S,["stop"])},[t(m,null,{default:o(()=>[t(_,{name:"i-ep:zoom-in"})]),_:1})],8,H),l("span",{title:"移除",onClick:N(c,["stop"])},[t(m,null,{default:o(()=>[t(_,{name:"i-ep:delete"})]),_:1})],8,W)])])])),D(l("div",{class:"progress",style:y(`width:${e.width}px;height:${e.height}px;`)},[t(u,{src:s(i).progress.preview,style:y(`width:${e.width}px;height:${e.height}px;`),fit:"fill"},null,8,["src","style"]),t(C,{type:"circle",width:Math.min(e.width,e.height)*.8,percentage:s(i).progress.percent},null,8,["width","percentage"])],4),[[R,e.url===""&&s(i).progress.percent]])]),_:1},8,["headers","action","data","name"]),e.notip?j("",!0):(v(),V("div",X,[l("div",Y,[t(d,{title:`上传图片支持 ${e.ext.join(" / ")} 格式,且图片大小不超过 ${e.size}MB,建议图片尺寸为 ${e.width}*${e.height}`,type:"info","show-icon":"",closable:!1},null,8,["title"])])])),s(i).imageViewerVisible?(v(),B(M,{key:1,"url-list":[e.url],teleported:"",onClose:f},null,8,["url-list"])):j("",!0)])}}});const te=O(ee,[["__scopeId","data-v-c67648e2"]]),w=e=>(T("data-v-9ac9aedf"),e=e(),K(),e),le=w(()=>l("h2",null,"基本设置",-1)),oe=w(()=>l("h2",null,"安全设置",-1)),ae={class:"setting-list"},se={class:"item"},ne=w(()=>l("div",{class:"content"},[l("div",{class:"title"}," 账户密码 "),l("div",{class:"desc"}," 当前密码强度:强 ")],-1)),ie={class:"action"},ce={class:"item"},de=w(()=>l("div",{class:"content"},[l("div",{class:"title"}," 密保手机 "),l("div",{class:"desc"}," 已绑定手机:187****3441 ")],-1)),re={class:"action"},ue={class:"item"},me=w(()=>l("div",{class:"content"},[l("div",{class:"title"}," 备用邮箱 "),l("div",{class:"desc"}," 当前未绑定备用邮箱 ")],-1)),pe={class:"action"},_e=k({name:"PersonalSetting"}),E=k({..._e,setup(e){const b=L(),a=I({headimg:"",mobile:"",name:"",qq:"",wechat:""}),i=f=>{f.error===""?a.value.headimg=f.data.path:z.warning(f.error)},S=()=>{b.push({name:"personalEditPassword"})};return(f,c)=>{const h=n("el-input"),p=n("el-form-item"),g=n("el-button"),r=n("el-form"),x=n("el-col"),_=te,m=n("el-row"),u=n("el-tab-pane"),C=n("el-tabs"),U=P;return v(),V("div",null,[t(U,null,{default:o(()=>[t(C,{"tab-position":"left",style:{height:"600px"}},{default:o(()=>[t(u,{label:"基本设置",class:"basic"},{default:o(()=>[le,t(m,{gutter:20},{default:o(()=>[t(x,{span:16},{default:o(()=>[t(r,{ref:"formRef",model:s(a),"label-width":"120px","label-suffix":":"},{default:o(()=>[t(p,{label:"名 称"},{default:o(()=>[t(h,{modelValue:s(a).name,"onUpdate:modelValue":c[0]||(c[0]=d=>s(a).name=d),placeholder:"请输入你的名称"},null,8,["modelValue"])]),_:1}),t(p,{label:"手机号"},{default:o(()=>[t(h,{modelValue:s(a).mobile,"onUpdate:modelValue":c[1]||(c[1]=d=>s(a).mobile=d),placeholder:"请输入你的手机号"},null,8,["modelValue"])]),_:1}),t(p,{label:"QQ 号"},{default:o(()=>[t(h,{modelValue:s(a).qq,"onUpdate:modelValue":c[2]||(c[2]=d=>s(a).qq=d),placeholder:"请输入你的 QQ 号"},null,8,["modelValue"])]),_:1}),t(p,{label:"微信号"},{default:o(()=>[t(h,{modelValue:s(a).wechat,"onUpdate:modelValue":c[3]||(c[3]=d=>s(a).wechat=d),placeholder:"请输入你的微信号"},null,8,["modelValue"])]),_:1}),t(p,null,{default:o(()=>[t(g,{type:"primary"},{default:o(()=>[$(" 保存 ")]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),t(x,{span:8},{default:o(()=>[t(_,{url:s(a).headimg,"onUpdate:url":c[4]||(c[4]=d=>s(a).headimg=d),action:"http://scrm.1daas.com/api/upload/upload",name:"image",data:{token:"TKD628431923530324"},notip:"",class:"headimg-upload",onOnSuccess:i},null,8,["url"])]),_:1})]),_:1})]),_:1}),t(u,{label:"安全设置",class:"security"},{default:o(()=>[oe,l("div",ae,[l("div",se,[ne,l("div",ie,[t(g,{type:"primary",text:"",onClick:S},{default:o(()=>[$(" 修改 ")]),_:1})])]),l("div",ce,[de,l("div",re,[t(g,{type:"primary",text:""},{default:o(()=>[$(" 修改 ")]),_:1})])]),l("div",ue,[me,l("div",pe,[t(g,{type:"primary",text:""},{default:o(()=>[$(" 绑定 ")]),_:1})])])])]),_:1})]),_:1})]),_:1})])}}});typeof q=="function"&&q(E);const ke=O(E,[["__scopeId","data-v-9ac9aedf"]]);export{ke as default};