/*! * build: Hopaheal * copyright: Mead * time: 2023-3-13 15:21:04 */ (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-533698db"],{2449:function(t,e,r){"use strict";r("c411")},2715:function(t,e,r){var i=r("74e7"),a=r("de0e"),n=r("4640"),s=r("981e"),o=r("9252"),u=s("IE_PROTO"),c=Object,l=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=n(t);if(i(e,u))return e[u];var r=e.constructor;return a(r)&&e instanceof r?r.prototype:e instanceof c?l:null}},"4fa1":function(t,e,r){"use strict";var i=r("7c9d"),a=r("3d0a"),n=r("dd4a"),s=i.aTypedArray,o=i.exportTypedArrayMethod;o("at",(function(t){var e=s(this),r=a(e),i=n(t),o=i>=0?i:r+i;return o<0||o>=r?void 0:e[o]}))},"5b93":function(t,e,r){"use strict";r.r(e);var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"container"},[r("div",{staticClass:"title"},[t._v("个人中心")]),r("el-form",{ref:"current_user",attrs:{"label-width":"120px",model:t.current_user,rules:t.rules}},[r("el-form-item",{attrs:{label:"工号(账号)",prop:"username"}},[r("el-input",{attrs:{disabled:!0},model:{value:t.current_user.username,callback:function(e){t.$set(t.current_user,"username",e)},expression:"current_user.username"}})],1),r("el-form-item",{attrs:{label:"姓名",prop:"name"}},[r("el-input",{model:{value:t.current_user.name,callback:function(e){t.$set(t.current_user,"name",e)},expression:"current_user.name"}})],1),r("el-form-item",{attrs:{label:"手机号",prop:"mobile"}},[r("el-input",{model:{value:t.current_user.mobile,callback:function(e){t.$set(t.current_user,"mobile",e)},expression:"current_user.mobile"}})],1),r("el-form-item",{attrs:{label:"邮箱",prop:"email"}},[r("el-input",{model:{value:t.current_user.email,callback:function(e){t.$set(t.current_user,"email",e)},expression:"current_user.email"}})],1)],1),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:t.do_reset}},[t._v("保存信息")])],1),r("div",{staticClass:"title",staticStyle:{"margin-top":"30px"}},[t._v("我的签章")]),r("el-form",{attrs:{"label-width":"120px"}},[r("el-form-item",{attrs:{label:"上传签章",prop:"path"}},[r("el-upload",{staticClass:"avatar-uploader",attrs:{accept:".png,.jpg",action:t.action,data:t.uploadData,limit:t.limit,"on-success":t.handleAvatarSuccess,"show-file-list":!1}},[t.imageUrl?r("img",{staticClass:"avatar",attrs:{src:t.imageUrl}}):r("i",{staticClass:"el-icon-plus avatar-uploader-icon"}),r("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[r("div",[t._v("只能上传jpg/png文件,建议尺寸为(宽:335*高:165)")]),r("div",[t._v(" 点击图片或加号可重新上传签章/或者点击 "),r("el-button",{attrs:{type:"text"},on:{click:function(e){t.is_reset=!0}}},[t._v(" 绘制签章 ")])],1)])]),r("span")],1),t.is_reset?r("el-form-item",{attrs:{label:"绘制签章"}},[r("div",{staticClass:"esignTest"},[r("div",{staticClass:"design-set"},[r("vue-esign",{ref:"esign",attrs:{"bg-color":t.bgColor,height:300,"is-crop":t.isCrop,"line-color":t.lineColor,"line-width":t.lineWidth,width:600},on:{"update:bgColor":function(e){t.bgColor=e},"update:bg-color":function(e){t.bgColor=e}}})],1),r("div",{staticClass:"button"},[r("el-button",{on:{click:t.cancelCanvan}},[t._v("取消绘制")]),r("el-button",{on:{click:t.handleReset}},[t._v("清空画板")]),r("el-button",{attrs:{type:"primary"},on:{click:t.handleGenerate}},[t._v(" 生成签章 ")])],1)])]):t._e()],1),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"primary"},on:{click:t.saveSign}},[t._v("保存签章")])],1)],1)},a=[],n=(r("9e01"),r("4fa1"),r("a5e3"),r("5e54"),r("794d"),r("7736")),s=r("d2c9"),o=r("f121"),u={data(){return{action:"",uploadData:{file_type:"img",type:"signature"},limit:1,imageUrl:"",lineWidth:6,lineColor:"#000000",bgColor:"",resultImg:"",isCrop:!1,current_user:{},rules:{truename:[{required:!0,trigger:"blur",message:"请输入姓名"}],class:[{required:!0,trigger:"blur",message:"请输入班级"}],email:[{required:!0,trigger:"blur",message:"请输入邮箱"}],account:[{required:!0,trigger:"blur",message:"请输入账号"}],mobile:[{required:!0,trigger:"blur",message:"请输入手机号"}],path:[{required:!0,trigger:"blur",message:"请上传签章"}]},tea_type:0,my_sign:[],sign_path:"",is_reset:!1}},computed:{...Object(n["c"])({role_id:"user/role_id",type_id:"user/type_id",type:"user/type",is_test:"user/is_test"})},async created(){this.type.type&&(this.tea_type=this.type.type),this.action=o["baseURL"]+"/common/upload",this.fileList=[],this.mySign(),await this.getUser()},methods:{...Object(n["b"])({setAvatar:"user/setAvatar"}),async mySign(){const{data:t}=await Object(s["mySign"])();console.log(t,"pppp"),this.my_sign=t.list,t.list.length>0&&(this.imageUrl=t.list[0].path_url,this.sign_path=t.list[0].path)},handleAvatarSuccess(t){this.sign_path=t.data.path,this.imageUrl=t.data.url,this.$refs["form"].clearValidate("path")},clearFile(){console.log("上传之前"),this.imageUrl=""},async getUser(){this.listLoading=!0;const{data:t}=await Object(s["getUser"])();console.log(t,"user"),this.current_user=t,this.current_user.department_id=t.department.id,console.log(this.current_user,"this.current_user"),this.listLoading=!1},do_reset(){if(this.is_test)this.$message.warning("游客模式,暂无权限!");else{let t=/^[1][3,4,5,7,8,9][0-9]{9}$/;if(!t.test(this.current_user.mobile))return void this.$message.error("您输入的手机号有误,请检查");this.$refs["current_user"].validate(async t=>{if(t){const{message:t}=await Object(s["doEdit"])(this.current_user);this.$baseMessage(t,"success",!1,"vab-hey-message-success"),this.setAvatar(this.current_user.headimg),this.imageUrl="",this.$router.push("/")}})}},close(t){this.$nextTick(()=>{void 0!==this.$refs[t]&&this.$refs[t].resetFields()}),this.current_user=this.$options.data().form,this.fileList=[],this.imageUrl="",this.dialogFormVisible=!1},async saveSign(){if(0==this.my_sign.length){if(!this.sign_path)return void this.$message.warning("请上传或者绘制签章!");await Object(s["doAddSign"])({admin_id:this.current_user.id,path:this.sign_path,status:1}),this.$message.success("签章上传成功")}else await Object(s["doEditSign"])({admin_id:this.my_sign[0].admin.id,path:this.sign_path,status:1,id:this.my_sign[0].id}),this.$message.success("签章修改成功");this.is_reset=!1,await this.mySign()},handleReset(){this.$refs.esign.reset(),this.my_sign.length>0?(this.sign_path=this.my_sign[0].path,this.imageUrl=this.my_sign[0].path_url):(this.sign_path="",this.imageUrl="")},handleGenerate(){this.$refs.esign.generate().then(t=>{console.log(t,"pppppp");let e="logo.png",r=this.dataURLtoFile(t,e);console.log(typeof r,"imgFile");const i=new FormData;i.append("file",r),i.append("file_type","img"),i.append("type","signature"),this.uploadLogo(i)}).catch(t=>{alert(t)})},dataURLtoFile(t,e){var r=t.split(","),i=r[0].match(/:(.*?);/)[1],a=window.atob?atob(r[1]):this.atob(r[1]),n=a.length,s=new Uint8Array(n);while(n--)s[n]=a.charCodeAt(n);try{return new File([s],e||"123."+i.split("/")[1],{type:i})}catch(u){var o=new Blob([s],{type:i});return o.lastModifiedDate=new Date,o.lastModified=Date.now(),o.name=e||"123."+i.split("/")[1],o}},atob:function(t){t=t.replace(/\s|=/g,"");var e,r,i,a=0,n=[],s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";while(a>4));break;case 2:n.push(String.fromCharCode((15&r)<<4|e>>2));break;case 3:n.push(String.fromCharCode((3&r)<<6|e));break}r=e,a++}return n.join("")},async uploadLogo(t){const e=await Object(s["uploadLogo"])(t);this.sign_path=e.data.path,this.imageUrl=e.data.url},cancelCanvan(){this.is_reset=!1,this.my_sign.length>0?(this.sign_path=this.my_sign[0].path,this.imageUrl=this.my_sign[0].path_url):(this.sign_path="",this.imageUrl="")}}},c=u,l=(r("2449"),r("0b56")),d=Object(l["a"])(c,i,a,!1,null,"6fd24c2c",null);e["default"]=d.exports},"5bfe":function(t,e,r){"use strict";var i=r("7c9d"),a=r("5cd1").findLast,n=i.aTypedArray,s=i.exportTypedArrayMethod;s("findLast",(function(t){return a(n(this),t,arguments.length>1?arguments[1]:void 0)}))},"5cd1":function(t,e,r){var i=r("889a"),a=r("d57c"),n=r("4640"),s=r("3d0a"),o=function(t){var e=1==t;return function(r,o,u){var c,l,d=n(r),p=a(d),h=i(o,u),f=s(p);while(f-- >0)if(c=p[f],l=h(c,f,d),l)switch(t){case 0:return c;case 1:return f}return e?-1:void 0}};t.exports={findLast:o(0),findLastIndex:o(1)}},"5cf9":function(t,e){t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},"5e54":function(t,e,r){r("5bfe")},"794d":function(t,e,r){r("d515")},"7a42":function(t,e,r){var i=r("8033"),a=RangeError;t.exports=function(t,e){var r=i(t);if(r%e)throw a("Wrong offset");return r}},"7c9d":function(t,e,r){"use strict";var i,a,n,s=r("5cf9"),o=r("581a"),u=r("9f37"),c=r("de0e"),l=r("2cc9"),d=r("74e7"),p=r("5b32"),h=r("697d"),f=r("5086"),g=r("94ef"),y=r("b6b0").f,m=r("ac9e"),_=r("2715"),b=r("f1bf"),v=r("e59d"),A=r("b548"),w=r("c958"),C=w.enforce,T=w.get,U=u.Int8Array,x=U&&U.prototype,O=u.Uint8ClampedArray,j=O&&O.prototype,S=U&&_(U),$=x&&_(x),R=Object.prototype,k=u.TypeError,E=v("toStringTag"),L=A("TYPED_ARRAY_TAG"),I="TypedArrayConstructor",F=s&&!!b&&"Opera"!==p(u.opera),D=!1,M={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},V={BigInt64Array:8,BigUint64Array:8},P=function(t){if(!l(t))return!1;var e=p(t);return"DataView"===e||d(M,e)||d(V,e)},q=function(t){var e=_(t);if(l(e)){var r=T(e);return r&&d(r,I)?r[I]:q(e)}},B=function(t){if(!l(t))return!1;var e=p(t);return d(M,e)||d(V,e)},W=function(t){if(B(t))return t;throw k("Target is not a typed array")},Y=function(t){if(c(t)&&(!b||m(S,t)))return t;throw k(h(t)+" is not a typed array constructor")},G=function(t,e,r,i){if(o){if(r)for(var a in M){var n=u[a];if(n&&d(n.prototype,t))try{delete n.prototype[t]}catch(s){try{n.prototype[t]=e}catch(c){}}}$[t]&&!r||g($,t,r?e:F&&x[t]||e,i)}},J=function(t,e,r){var i,a;if(o){if(b){if(r)for(i in M)if(a=u[i],a&&d(a,t))try{delete a[t]}catch(n){}if(S[t]&&!r)return;try{return g(S,t,r?e:F&&S[t]||e)}catch(n){}}for(i in M)a=u[i],!a||a[t]&&!r||g(a,t,e)}};for(i in M)a=u[i],n=a&&a.prototype,n?C(n)[I]=a:F=!1;for(i in V)a=u[i],n=a&&a.prototype,n&&(C(n)[I]=a);if((!F||!c(S)||S===Function.prototype)&&(S=function(){throw k("Incorrect invocation")},F))for(i in M)u[i]&&b(u[i],S);if((!F||!$||$===R)&&($=S.prototype,F))for(i in M)u[i]&&b(u[i].prototype,$);if(F&&_(j)!==$&&b(j,$),o&&!d($,E))for(i in D=!0,y($,E,{get:function(){return l(this)?this[L]:void 0}}),M)u[i]&&f(u[i],L,i);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:F,TYPED_ARRAY_TAG:D&&L,aTypedArray:W,aTypedArrayConstructor:Y,exportTypedArrayMethod:G,exportTypedArrayStaticMethod:J,getTypedArrayConstructor:q,isView:P,isTypedArray:B,TypedArray:S,TypedArrayPrototype:$}},8033:function(t,e,r){var i=r("dd4a"),a=RangeError;t.exports=function(t){var e=i(t);if(e<0)throw a("The argument can't be less than 0");return e}},"889a":function(t,e,r){var i=r("74b0"),a=r("c5a9"),n=r("9477"),s=i(i.bind);t.exports=function(t,e){return a(t),void 0===e?t:n?s(t,e):function(){return t.apply(e,arguments)}}},9252:function(t,e,r){var i=r("2dc4");t.exports=!i((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},a5e3:function(t,e,r){"use strict";var i=r("9f37"),a=r("36c3"),n=r("7c9d"),s=r("3d0a"),o=r("7a42"),u=r("4640"),c=r("2dc4"),l=i.RangeError,d=i.Int8Array,p=d&&d.prototype,h=p&&p.set,f=n.aTypedArray,g=n.exportTypedArrayMethod,y=!c((function(){var t=new Uint8ClampedArray(2);return a(h,t,{length:1,0:3},1),3!==t[1]})),m=y&&n.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new d(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));g("set",(function(t){f(this);var e=o(arguments.length>1?arguments[1]:void 0,1),r=u(t);if(y)return a(h,this,r,e);var i=this.length,n=s(r),c=0;if(n+e>i)throw l("Wrong length");while(c1?arguments[1]:void 0)}))}}]);