| 1 |
- import{_ as e}from"./u-tabs.CYgabJiD.js";import{c2 as t,b as a,I as o,k as l,p as n,m as s,w as i,q as r,t as d,o as u,c3 as m,g as c,bT as p,c4 as f,c5 as h,c6 as g,s as y,a5 as b,a6 as _,X as D,B as x,C as w,F,z as V,E as v,N as C,D as S,v as k}from"./index-C9TJPork.js";import{r as T}from"./uni-app.es.CUt9gedF.js";import{_ as j}from"./u-input.cq_N7lcW.js";import{_ as O,a as U}from"./u-form.D7hQ6Wil.js";import{_ as I}from"./index.CdyKhOVe.js";import{_ as W}from"./index.D8pU8O9m.js";import{_ as N}from"./u-button.C_4h_wUh.js";import{u as L}from"./base.2x6xVo4W.js";import{_ as R}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{_ as P,a as J}from"./u-cell-group.BPfexNA1.js";import{_ as A}from"./u-icon.BNGPST4x.js";import{_ as $}from"./index.DnzbI5dt.js";import{_ as M}from"./u-action-sheet.BBR1EfIr.js";import{N as B}from"./index.BeMkBjFo.js";import{_ as z,a as E}from"./uni-swipe-action.CaA8KZcO.js";import{_ as q}from"./mescroll-uni.AlrM8mta.js";import{_ as K}from"./uni-popup-dialog.BhJnU-c6.js";import{_ as X}from"./uni-popup.DMKcDE3C.js";import{c as G,D as H,C as Q,U as Y}from"./commonWords.C3AuDPlG.js";import{M as Z}from"./mescroll-mixins.C2YUWJKd.js";import{r as ee}from"./resources.DEPsJg7u.js";import"./u-badge.BHkDpFBd.js";import"./emitter.DrjJCwnj.js";import"./index.ChsH6p4P.js";import"./u-search.DOsDiA_z.js";import"./u-checkbox.DJ2PERbW.js";import"./u-checkbox-group.DHs1JB4s.js";import"./u-radio-group.BjzEj90s.js";import"./u-popup.7vl_vYde.js";import"./index.CGKbu-GF.js";import"./renderjs.Cg3LvhxW.js";const te=L();function ae(e){return new Promise((function(t,a){if("object"==typeof window&&"document"in window){if("function"==typeof FileReader){var o=new XMLHttpRequest;return o.open("GET",e,!0),o.responseType="blob",o.onload=function(){if(200===this.status){let e=new FileReader;e.onload=function(e){t(e.target.result)},e.onerror=a,e.readAsDataURL(this.response)}},o.onerror=a,void o.send()}var l=document.createElement("canvas"),n=l.getContext("2d"),s=new Image;return s.onload=function(){l.width=s.width,l.height=s.height,n.drawImage(s,0,0),t(l.toDataURL()),l.height=l.width=0},s.onerror=a,void(s.src=e)}"object"!=typeof plus?"object"==typeof wx&&m("getFileSystemManager")?wx.getFileSystemManager().readFile({filePath:e,encoding:"base64",success:function(e){t("data:image/png;base64,"+e.data)},fail:function(e){a(e)}}):a(new Error("not support")):plus.io.resolveLocalFileSystemURL(function(e){if(0===e.indexOf("_www")||0===e.indexOf("_doc")||0===e.indexOf("_documents")||0===e.indexOf("_downloads"))return e;if(0===e.indexOf("file://"))return e;if(0===e.indexOf("/storage/emulated/0/"))return e;if(0===e.indexOf("/")){var t=plus.io.convertAbsoluteFileSystem(e);if(t!==e)return t;e=e.substr(1)}return"_www/"+e}(e),(function(e){e.file((function(e){var o=new plus.io.FileReader;o.onload=function(e){t(e.target.result)},o.onerror=function(e){a(e)},o.readAsDataURL(e)}),(function(e){a(e)}))}),(function(e){a(e)}))}))}const oe=R({components:{personalData:R({props:{personalData:{type:Object,default:()=>({})}},data:()=>({show:!1,props:{label:"fullName",value:"enCode"},dataForm:{birthday:null,certificatesNumber:"",certificatesType:"",education:"",email:"",gender:"",landline:"",mobilePhone:"",nation:"",nativePlace:"",postalAddress:"",realName:"",signature:null,telePhone:"",urgentContacts:"",urgentTelePhone:"",id:null},nationOptions:[],genderOptions:[],certificatesTypeOptions:[],educationOptions:[],rules:{realName:[{required:!0,message:"请输入姓名",trigger:["change","blur"]}]}}),computed:{baseURL(){return this.define.baseURL}},watch:{personalData:{handler(e){this.init()},deep:!0,immediate:!0}},mounted(){this.$refs.dataForm.setRules(this.rules)},methods:{init(){let e=JSON.parse(JSON.stringify(this.personalData));for(let t in e)for(let a in this.dataForm)t===a&&(this.dataForm[t]=e[t]);this.getOptions()},getOptions(){te.getDictionaryData({sort:"Education"}).then((e=>{this.educationOptions=JSON.parse(JSON.stringify(e)),te.getDictionaryData({sort:"certificateType"}).then((e=>{this.certificatesTypeOptions=JSON.parse(JSON.stringify(e))})),te.getDictionaryData({sort:"sex"}).then((e=>{this.genderOptions=JSON.parse(JSON.stringify(e))})),te.getDictionaryData({sort:"Nation"}).then((e=>{this.nationOptions=JSON.parse(JSON.stringify(e))}))})),this.show=!0},submit(){this.$refs.dataForm.validate((e=>{e&&t(this.dataForm).then((e=>{a({title:"保存成功",duration:800,icon:"none"}),setTimeout((()=>{o()}),1e3)}))}))}}},[["render",function(e,t,a,o,m,c){const p=T(l("u-input"),j),f=T(l("u-form-item"),O),h=T(l("JnpfSelect"),I),g=T(l("JnpfDatePicker"),W),y=T(l("u-form"),U),b=u,_=T(l("u-button"),N);return n(),s(b,{class:"jnpf-wrap personalData"},{default:i((()=>[r(b,{style:{"background-color":"#fff"},class:"u-p-l-20 u-p-r-20"},{default:i((()=>[r(y,{model:e.dataForm,errorType:["toast"],"label-position":"left","label-width":"150","label-align":"right",ref:"dataForm"},{default:i((()=>[r(f,{label:"姓名",prop:"realName",required:""},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.realName,"onUpdate:modelValue":t[0]||(t[0]=t=>e.dataForm.realName=t),placeholder:"请输入"},null,8,["modelValue"])])),_:1}),r(f,{label:"民族"},{default:i((()=>[r(h,{modelValue:e.dataForm.nation,"onUpdate:modelValue":t[1]||(t[1]=t=>e.dataForm.nation=t),placeholder:"请选择",options:e.nationOptions},null,8,["modelValue","options"])])),_:1}),r(f,{label:"性别"},{default:i((()=>[r(h,{modelValue:e.dataForm.gender,"onUpdate:modelValue":t[2]||(t[2]=t=>e.dataForm.gender=t),placeholder:"请选择",options:e.genderOptions,props:e.props},null,8,["modelValue","options","props"])])),_:1}),r(f,{label:"籍贯"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.nativePlace,"onUpdate:modelValue":t[3]||(t[3]=t=>e.dataForm.nativePlace=t),placeholder:"请输入"},null,8,["modelValue"])])),_:1}),r(f,{label:"证件类型"},{default:i((()=>[r(h,{modelValue:e.dataForm.certificatesType,"onUpdate:modelValue":t[4]||(t[4]=t=>e.dataForm.certificatesType=t),placeholder:"请选择",options:e.certificatesTypeOptions},null,8,["modelValue","options"])])),_:1}),r(f,{label:"证件号码"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.certificatesNumber,"onUpdate:modelValue":t[5]||(t[5]=t=>e.dataForm.certificatesNumber=t),placeholder:"请输入"},null,8,["modelValue"])])),_:1}),r(f,{label:"文化程度"},{default:i((()=>[r(h,{modelValue:e.dataForm.education,"onUpdate:modelValue":t[6]||(t[6]=t=>e.dataForm.education=t),placeholder:"请选择",options:e.educationOptions},null,8,["modelValue","options"])])),_:1}),r(f,{label:"出生年月"},{default:i((()=>[r(g,{modelValue:e.dataForm.birthday,"onUpdate:modelValue":t[7]||(t[7]=t=>e.dataForm.birthday=t),placeholder:"请选择"},null,8,["modelValue"])])),_:1}),r(f,{label:"办公电话"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.telePhone,"onUpdate:modelValue":t[8]||(t[8]=t=>e.dataForm.telePhone=t),placeholder:"请输入"},null,8,["modelValue"])])),_:1}),r(f,{label:"办公座机"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.landline,"onUpdate:modelValue":t[9]||(t[9]=t=>e.dataForm.landline=t),placeholder:"请输入"},null,8,["modelValue"])])),_:1}),r(f,{label:"手机号码"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.mobilePhone,"onUpdate:modelValue":t[10]||(t[10]=t=>e.dataForm.mobilePhone=t),placeholder:"请输"},null,8,["modelValue"])])),_:1}),r(f,{label:"电子邮箱"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.email,"onUpdate:modelValue":t[11]||(t[11]=t=>e.dataForm.email=t),placeholder:"请输入"},null,8,["modelValue"])])),_:1}),r(f,{label:"紧急联系"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.urgentContacts,"onUpdate:modelValue":t[12]||(t[12]=t=>e.dataForm.urgentContacts=t),placeholder:"请输入"},null,8,["modelValue"])])),_:1}),r(f,{label:"紧急电话"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.urgentTelePhone,"onUpdate:modelValue":t[13]||(t[13]=t=>e.dataForm.urgentTelePhone=t),placeholder:"请输入"},null,8,["modelValue"])])),_:1}),r(f,{label:"通讯地址"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.postalAddress,"onUpdate:modelValue":t[14]||(t[14]=t=>e.dataForm.postalAddress=t),placeholder:"请输入"},null,8,["modelValue"])])),_:1}),r(f,{label:"自我介绍"},{default:i((()=>[r(p,{"input-align":"right",modelValue:e.dataForm.signature,"onUpdate:modelValue":t[15]||(t[15]=t=>e.dataForm.signature=t),placeholder:"请输入",type:"textarea"},null,8,["modelValue"])])),_:1})])),_:1},8,["model"])])),_:1}),r(b,{class:"flowBefore-actions"},{default:i((()=>[r(_,{class:"buttom-btn",type:"primary",onClick:c.submit},{default:i((()=>[d("保存")])),_:1},8,["onClick"])])),_:1})])),_:1})}],["__scopeId","data-v-7412b3db"]]),accountData:R({props:{accountData:{type:Object,default:()=>({})}},data:()=>({titleStyle:{color:"#303133"}}),computed:{baseURL(){return this.define.baseURL},data(){let e={...this.accountData};return e.creatorTime=this.$u.timeFormat(e.creatorTime,"yyyy-mm-dd hh:MM")||"",e.prevLogTime=this.$u.timeFormat(e.prevLogTime,"yyyy-mm-dd hh:MM")||"",e.entryDate=this.$u.timeFormat(e.entryDate,"yyyy-mm-dd hh:MM")||"",e}}},[["render",function(e,t,a,o,d,m){const c=T(l("u-cell-item"),P),p=T(l("u-cell-group"),J),f=u;return n(),s(f,{class:"personalData-v"},{default:i((()=>[r(p,{class:"",style:{padding:"0 20rpx"},"border-bottom":!1,border:!1},{default:i((()=>[r(c,{title:"账户",value:m.data.account,arrow:!1,"title-style":d.titleStyle},null,8,["value","title-style"]),r(c,{title:"所属组织",value:m.data.organize,arrow:!1,"title-style":d.titleStyle},null,8,["value","title-style"]),r(c,{title:"直属主管",value:m.data.manager,arrow:!1,"title-style":d.titleStyle},null,8,["value","title-style"]),r(c,{title:"岗位",value:m.data.position,arrow:!1,"title-style":d.titleStyle},null,8,["value","title-style"]),r(c,{title:"职级",value:m.data.ranks,arrow:!1,"title-style":d.titleStyle},null,8,["value","title-style"]),r(c,{title:"角色",value:m.data.roleId,arrow:!1,"title-style":d.titleStyle},null,8,["value","title-style"]),r(c,{title:"注册时间",value:m.data.creatorTime,arrow:!1,"title-style":d.titleStyle},null,8,["value","title-style"]),r(c,{title:"上次登录",value:m.data.prevLogTime,arrow:!1,"title-style":d.titleStyle},null,8,["value","title-style"]),r(c,{title:"入职时间",value:m.data.entryDate,arrow:!1,"title-style":d.titleStyle,"border-bottom":!1},null,8,["value","title-style"])])),_:1})])),_:1})}],["__scopeId","data-v-b0d94a32"]]),signList:R({components:{NoData:B},data:()=>({value:"",show:!0,signImg:[],isSet:!1,showAction:!1,actionList:[{text:"在线签名",id:1},{text:"图片上传",id:2}]}),computed:{baseURL(){return this.define.comUploadUrl},token:()=>c("token")},mounted(){this.getSignImgList()},methods:{getSignImgList(){p().then((e=>{let t=JSON.parse(JSON.stringify(e.data))||[];this.show=t.length>0,this.signImg=t.map((e=>({isSet:!1,...e})))}))},signData(e){if(e){f({signImg:e,isDefault:0}).then((e=>{this.getSignImgList()}))}},handleTouchStart(e,t){this.signImg.map(((e,t)=>{e.isSet=!1})),e.isSet=!0},del(e,t){h(e).then((e=>{this.signImg.splice(t,1)}))},setDefault(e,t){let a=c("userInfo");g(e).then((e=>{this.signImg.map(((e,o)=>{e.isDefault=!1,t==o&&(e.isDefault=!0,e.isSet=!1,a.signImg=e.signImg,y("userInfo",a))}))}))},handleAction(e){0==e?this.$refs.signRef.addSign():b({count:1,sizeType:["original","compressed"],sourceType:["album"],success:e=>{let t=e.tempFilePaths[0];return new RegExp("image/*").test(e.tempFiles[0].type)?e.tempFiles[0].size/1024>500?this.$u.toast("操作失败,图片大小超出500K"):void ae(t).then((e=>{this.signData(e)})):this.$u.toast("请上传图片")}})},harmony(e){_({url:this.baseURL+"imgToBase64",filePath:e,name:"file",header:{Authorization:this.token},success:e=>{let t=JSON.parse(e.data);this.signData(t.data)},fail:e=>{}})}}},[["render",function(e,t,a,o,m,c){const p=S,f=u,h=T(l("u-icon"),A),g=T(l("u-button"),N),y=T(l("JnpfSign"),$),b=D("NoData"),_=T(l("u-action-sheet"),M);return n(),s(f,null,{default:i((()=>[r(f,{class:"page_v u-flex-col"},{default:i((()=>[r(f,null,{default:i((()=>[m.show?(n(!0),x(F,{key:0},w(m.signImg,((e,t)=>(n(),s(f,{key:t,class:v([e.isDefault?"active":"","lists_box"]),onLongpress:a=>c.handleTouchStart(e,t)},{default:i((()=>[r(f,{class:"signImgBox"},{default:i((()=>[r(p,{src:e.signImg,mode:"scaleToFill",class:"signImg"},null,8,["src"])])),_:2},1024),e.isDefault?(n(),s(f,{key:0,class:"icon-checked-box"},{default:i((()=>[r(f,{class:"icon-checked"},{default:i((()=>[r(h,{name:"checkbox-mark",color:"#fff",size:"28"})])),_:1})])),_:1})):V("",!0),!e.isDefault&&e.isSet?(n(),s(f,{key:1,class:"sign-mask",id:t},{default:i((()=>[r(f,{class:"sign-mask-btn"},{default:i((()=>[r(g,{onClick:C((a=>c.del(e.id,t)),["prevent"])},{default:i((()=>[d("删除")])),_:2},1032,["onClick"]),r(g,{type:"primary",onClick:C((a=>c.setDefault(e.id,t)),["prevent"])},{default:i((()=>[d("设为默认")])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1032,["id"])):V("",!0)])),_:2},1032,["class","onLongpress"])))),128)):V("",!0)])),_:1}),r(y,{ref:"signRef",onChange:c.signData,showBtn:!1},null,8,["onChange"]),m.show?V("",!0):(n(),s(b,{key:0,paddingTop:460}))])),_:1}),r(f,{class:"flowBefore-actions"},{default:i((()=>[r(g,{class:"buttom-btn",type:"primary",onClick:t[0]||(t[0]=e=>m.showAction=!0)},{default:i((()=>[d("添加签名")])),_:1})])),_:1}),r(_,{onClick:c.handleAction,list:m.actionList,tips:{text:"",color:"#000",fontSize:30},modelValue:m.showAction,"onUpdate:modelValue":t[1]||(t[1]=e=>m.showAction=e)},null,8,["onClick","list","modelValue"])])),_:1})}],["__scopeId","data-v-62ed4efc"]]),commonText:R({mixins:[Z],components:{NoData:B},props:{showCommonWords:{type:Boolean,default:!1}},data(){return{downOption:{use:!0,auto:!0},upOption:{page:{num:0,size:30,time:null},empty:{use:!0,icon:ee.message.nodata,tip:this.$t("common.noData"),fixed:!0,top:"360rpx"},textNoMore:this.$t("app.apply.noMoreData")},actionData:[{style:{backgroundColor:"#1890ff"},text:"编辑"},{style:{backgroundColor:"#F56C6C"},text:"删除"}],commonWordsText:"",commonWordsData:{},commonWordsList:[],showAdd:!1}},methods:{upCallback(e){const t={currentPage:e.num,pageSize:e.size,commonWordsType:1};G(t).then((t=>{const a=t.data.list||[];1==e.num&&(this.commonWordsList=[]),this.mescroll.endSuccess(t.data.list.length),this.commonWordsList=this.commonWordsList.concat(a)})).catch((()=>{this.mescroll.endErr()}))},bindClick(e,t){0==t.index&&this.editCommonWord(e),1==t.index&&this.delCommonWord(e)},editCommonWord(e){this.$refs.inputDialog.open();let t={commonWordsText:"",enabledMark:1,id:0,sortCode:0,systemIds:[],systemNames:[]};e.id?(this.commonWordsText=e.commonWordsText,this.commonWordsData={...e,systemIds:[],systemNames:[]}):(this.commonWordsText="",this.commonWordsData=t)},delCommonWord(e){H(e.id).then((e=>{this.$u.toast(e.msg),this.mescroll.resetUpScroll()}))},close(){this.$refs.inputDialog.close()},confirm(){if(this.commonWordsData.commonWordsText=this.commonWordsText,this.commonWordsData.commonWordsType=1,!this.commonWordsText)return this.$u.toast("审批常用语不能为空");(0===this.commonWordsData.id?Q:Y)(this.commonWordsData).then((e=>{this.close(),this.commonWordsText="",a({title:e.msg,icon:"none",complete:()=>{this.mescroll.resetUpScroll()}})})).catch((()=>{this.close(),this.mescroll.resetUpScroll()}))}}},[["render",function(e,t,a,o,m,c){const p=u,f=T(l("uni-swipe-action-item"),z),h=T(l("uni-swipe-action"),E),g=T(l("mescroll-uni"),q),y=T(l("u-button"),N),b=T(l("u-input"),j),_=T(l("uni-popup-dialog"),K),D=T(l("uni-popup"),X);return n(),x(F,null,[r(p,{class:"common_v"},{default:i((()=>[r(g,{ref:"mescrollRef",onInit:e.mescrollInit,onDown:e.downCallback,onUp:c.upCallback,up:m.upOption,bottombar:!1,top:"120"},{default:i((()=>[r(h,{ref:"swipeAction"},{default:i((()=>[(n(!0),x(F,null,w(m.commonWordsList,((e,t)=>(n(),s(f,{key:t,threshold:0,"right-options":m.actionData,"auto-close":!1,onClick:t=>c.bindClick(e,t)},{default:i((()=>[r(p,{class:"action-item"},{default:i((()=>[d(k(e.commonWordsText),1)])),_:2},1024)])),_:2},1032,["right-options","onClick"])))),128))])),_:1},512)])),_:1},8,["onInit","onDown","onUp","up"]),r(p,{class:"flowBefore-actions"},{default:i((()=>[r(y,{class:"buttom-btn",type:"primary",onClick:c.editCommonWord},{default:i((()=>[d("添加常用语")])),_:1},8,["onClick"])])),_:1})])),_:1}),r(D,{ref:"inputDialog",type:"dialog"},{default:i((()=>[r(_,{ref:"inputClose",onConfirm:c.confirm,mode:"input",class:"popup-dialog",borderRadius:"20px 20px 20px 20px",beforeClose:"",onClose:c.close,title:"审批常用语"},{default:i((()=>[r(b,{modelValue:m.commonWordsText,"onUpdate:modelValue":t[0]||(t[0]=e=>m.commonWordsText=e),type:"textarea",placeholder:"请输入内容","auto-height":!1,maxlength:"99999",height:"150"},null,8,["modelValue"])])),_:1},8,["onConfirm","onClose"])])),_:1},512)],64)}],["__scopeId","data-v-4ddecc3d"]])},data:()=>({tabBars:[{name:"账户信息"},{name:"个人资料"},{name:"个人签名"},{name:"审批常用语"}],current:0,baseInfo:{}}),onLoad(e){this.baseInfo=JSON.parse(decodeURIComponent(e.baseInfo))},methods:{tabChange(e){this.current=e}}},[["render",function(t,a,o,d,m,c){const p=T(l("u-tabs"),e),f=u,h=D("accountData"),g=D("personalData"),y=D("signList"),b=D("commonText");return n(),s(f,{class:"personalData-v"},{default:i((()=>[r(f,{class:"notice-warp"},{default:i((()=>[r(p,{list:m.tabBars,"is-scroll":!1,modelValue:m.current,"onUpdate:modelValue":a[0]||(a[0]=e=>m.current=e),onChange:c.tabChange,height:"100"},null,8,["list","modelValue","onChange"])])),_:1}),r(f,{class:"content"},{default:i((()=>[0==m.current?(n(),s(h,{key:0,ref:"accountData",accountData:m.baseInfo},null,8,["accountData"])):V("",!0),1==m.current?(n(),s(g,{key:1,ref:"personalData",personalData:m.baseInfo},null,8,["personalData"])):V("",!0),2==m.current?(n(),s(y,{key:2,ref:"signList"},null,512)):V("",!0),3==m.current?(n(),s(b,{key:3,ref:"commonText"},null,512)):V("",!0)])),_:1})])),_:1})}],["__scopeId","data-v-1cdf97ee"]]);export{oe as default};
|