chunk-5b2210b2.f095553a.js 19 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5b2210b2","chunk-5b2210b2","chunk-2d0df437"],{"1d54":function(e,t,r){"use strict";r("60c5")},"418f":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("a-drawer",{staticStyle:{height:"calc(100% - 55px)",overflow:"auto","padding-bottom":"53px"},attrs:{title:e.title,maskClosable:!0,width:e.drawerWidth,placement:"right",closable:!0,visible:e.visible},on:{close:e.handleCancel}},[t("template",{slot:"title"},[t("div",{staticStyle:{width:"100%"}},[t("span",[e._v(e._s(e.title))]),t("span",{staticStyle:{display:"inline-block",width:"calc(100% - 51px)","padding-right":"10px","text-align":"right"}},[t("a-button",{staticStyle:{height:"20px",width:"20px",border:"0px"},attrs:{icon:"appstore"},on:{click:e.toggleScreen}})],1)])]),t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"用户账号",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator.trim",value:["name",e.validatorRules.name],expression:"[ 'name', validatorRules.name]",modifiers:{trim:!0}}],attrs:{placeholder:"请输入用户账号",readOnly:!!e.model.id}})],1),e.model.id?e._e():[t("a-form-item",{attrs:{label:"登陆密码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",e.validatorRules.password],expression:"[ 'password', validatorRules.password]"}],attrs:{type:"password",placeholder:"请输入登陆密码"}})],1),t("a-form-item",{attrs:{label:"确认密码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["confirmpassword",e.validatorRules.confirmpassword],expression:"[ 'confirmpassword', validatorRules.confirmpassword]"}],attrs:{type:"password",placeholder:"请重新输入登陆密码"},on:{blur:e.handleConfirmBlur}})],1)],t("a-form-item",{attrs:{label:"用户姓名",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator.trim",value:["realname",e.validatorRules.realname],expression:"[ 'realname', validatorRules.realname]",modifiers:{trim:!0}}],attrs:{placeholder:"请输入用户姓名"}})],1),t("a-form-item",{directives:[{name:"show",rawName:"v-show",value:!e.roleDisabled,expression:"!roleDisabled"}],attrs:{label:"角色分配",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-select",{staticStyle:{width:"100%"},attrs:{mode:"multiple",placeholder:"请选择用户角色",optionFilterProp:"children",getPopupContainer:function(e){return e.parentNode}},model:{value:e.selectedRole,callback:function(t){e.selectedRole=t},expression:"selectedRole"}},e._l(e.roleList,(function(r,a){return t("a-select-option",{key:a.toString(),attrs:{value:r.id}},[e._v("\n "+e._s(r.roleName)+"\n ")])})),1)],1),t("a-form-item",{attrs:{label:"头像",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("j-image-upload",{staticClass:"avatar-uploader",attrs:{text:"上传"},model:{value:e.fileList,callback:function(t){e.fileList=t},expression:"fileList"}})],1),t("a-form-item",{attrs:{label:"手机号码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["phone",e.validatorRules.phone],expression:"[ 'phone', validatorRules.phone]"}],attrs:{placeholder:"请输入手机号码",disabled:e.isDisabledAuth("user:form:phone")}})],1)],2)],1),t("depart-window",{ref:"departWindow",on:{ok:e.modalFormOk}}),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.disableSubmit,expression:"!disableSubmit"}],staticClass:"drawer-bootom-button"},[t("a-popconfirm",{attrs:{title:"确定放弃编辑?",okText:"确定",cancelText:"取消"},on:{confirm:e.handleCancel}},[t("a-button",{staticStyle:{"margin-right":".8rem"}},[e._v("取消")])],1),t("a-button",{attrs:{type:"primary",loading:e.confirmLoading},on:{click:e.handleSubmit}},[e._v("提交")])],1)],2)},s=[],i=r("88bc"),n=r.n(i),l=r("c1df"),o=r.n(l),d=r("2b0e"),c=r("c63ec"),u=r("61fc"),h=r("9fb0"),p=r("0fea"),f=r("4ec3");function m(e,t){var r="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=v(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var a=0,s=function(){};return{s:s,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return n=e.done,e},e:function(e){l=!0,i=e},f:function(){try{n||null==r.return||r.return()}finally{if(l)throw i}}}}function v(e,t){if(e){if("string"===typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function y(e,t){return!!g(e,t)||w(e)}function g(e,t){var r=[];try{if(!t)return!1;var a=t.permissionList;r=a.filter((function(e){return"2"==e.type}))}catch(u){}if(0==r.length)return!1;var s,i=[],n=m(r);try{for(n.s();!(s=n.n()).done;){var l=s.value;"2"==l.type&&i.push(l.action)}}catch(h){n.e(h)}finally{n.f()}if(!i.includes(e))return!1;var o,d=m(r);try{for(d.s();!(o=d.n()).done;){var c=o.value;if(e===c.action)return!0}}catch(h){d.e(h)}finally{d.f()}return!1}function w(e){var t=[],r=[],a=[];try{a=JSON.parse(sessionStorage.getItem(h["q"])||"[]")}catch(L){}var s,i=m(a);try{for(i.s();!(s=i.n()).done;){var n=s.value;"2"==n.type&&t.push(n)}}catch(S){i.e(S)}finally{i.f()}var l=[];try{l=JSON.parse(sessionStorage.getItem(h["o"])||"[]")}catch(x){}var o,d=m(l);try{for(d.s();!(o=d.n()).done;){var c=o.value;"2"==c.type&&r.push(c)}}catch(S){d.e(S)}finally{d.f()}var u=!1,p=!1;if(null!=r&&""!=r&&void 0!=r&&r.length>0){var f,v=m(r);try{for(v.s();!(f=v.n()).done;){var b=f.value;if(e===b.action){if("0"==b.status){p=!0;break}u=!0;break}}}catch(S){v.e(S)}finally{v.f()}}if(p)return!1;if(null===t||""===t||void 0===t||t.length<=0)return u;for(var y=[],g=0,w=t;g<w.length;g++){var k=w[g];"2"==k.type&&y.push(k.action)}if(y.includes(e)){var I,D=m(t);try{for(D.s();!(I=D.n()).done;){var C=I.value;e===C.action&&(u=!1)}}catch(S){D.e(S)}finally{D.f()}return u}return u}var k=r("e610"),I={name:"UserModal",components:{JImageUpload:k["default"],departWindow:c["default"],JSelectPosition:u["default"]},data:function(){return{departDisabled:!1,roleDisabled:!1,modalWidth:800,drawerWidth:700,modaltoggleFlag:!0,confirmDirty:!1,selectedDepartKeys:[],checkedDepartKeys:[],checkedDepartNames:[],checkedDepartNameString:"",resultDepartOptions:[],userId:"",disableSubmit:!1,userDepartModel:{userId:"",departIdList:[]},dateFormat:"YYYY-MM-DD",validatorRules:{name:{rules:[{required:!0,message:"请输入用户账号!"},{validator:this.validateUsername}]},password:{rules:[{required:!0,pattern:/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,message:"密码由8位数字、大小写字母和特殊符号组成!"},{validator:this.validateToNextPassword}]},confirmpassword:{rules:[{required:!0,message:"请重新输入登陆密码!"},{validator:this.compareToFirstPassword}]},realname:{rules:[{required:!0,message:"请输入用户名称!"}]},phone:{rules:[{validator:this.validatePhone}]},email:{rules:[{validator:this.validateEmail}]},roles:{},workNo:{rules:[{required:!0,message:"请输入工号"},{validator:this.validateWorkNo}]},telephone:{rules:[{pattern:/^0\d{2,3}-[1-9]\d{6,7}$/,message:"请输入正确的座机号码"}]}},departIdShow:!1,departIds:[],title:"操作",visible:!1,model:{},roleList:[],selectedRole:[],labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},uploadLoading:!1,confirmLoading:!1,headers:{},form:this.$form.createForm(this),picUrl:"",url:{fileUpload:window._CONFIG["domianURL"]+"/sys/common/upload",userWithDepart:"/sys/user/userDepartList",userId:"/sys/user/generateUserId",syncUserByUserName:"/process/extActProcess/doSyncUserByUserName"},identity:"1",fileList:[]}},created:function(){var e=d["default"].ls.get(h["a"]);this.headers={"X-Access-Token":e}},computed:{uploadAction:function(){return this.url.fileUpload}},methods:{isDisabledAuth:function(e){return y(e)},toggleScreen:function(){this.modaltoggleFlag?this.modalWidth=window.innerWidth:this.modalWidth=800,this.modaltoggleFlag=!this.modaltoggleFlag},initialRoleList:function(){var e=this;Object(f["P"])().then((function(t){t.success&&(e.roleList=t.result)}))},loadUserRoles:function(e){var t=this;Object(f["O"])({userid:e}).then((function(e){e.success&&(t.selectedRole=e.result)}))},refresh:function(){this.selectedDepartKeys=[],this.checkedDepartKeys=[],this.checkedDepartNames=[],this.checkedDepartNameString="",this.userId="",this.resultDepartOptions=[],this.departId=[],this.departIdShow=!1},add:function(){this.picUrl="",this.refresh(),this.edit({})},edit:function(e){var t=this;this.resetScreenSize();var r=this;r.initialRoleList(),r.checkedDepartNameString="",r.form.resetFields(),e.hasOwnProperty("id")&&(r.loadUserRoles(e.id),setTimeout((function(){t.fileList=e.avatar}),5)),r.userId=e.id,r.visible=!0,r.model=Object.assign({},e),r.$nextTick((function(){r.form.setFieldsValue(n()(t.model,"name","realname","phone","avatar"))})),"2"==this.model.userIdentity?(this.identity="2",this.departIdShow=!0):(this.identity="1",this.departIdShow=!1),r.checkedDepartKeys=[]},loadCheckedDeparts:function(){var e=this,t=this;t.userId&&Object(p["c"])(t.url.userWithDepart,{userId:t.userId}).then((function(r){if(t.checkedDepartNames=[],r.success){for(var a=[],s=[],i=0;i<r.result.length;i++)t.checkedDepartNames.push(r.result[i].title),e.checkedDepartNameString=e.checkedDepartNames.join(","),t.checkedDepartKeys.push(r.result[i].key),a.push({key:r.result[i].key,title:r.result[i].title}),s.push(r.result[i].key);t.resultDepartOptions=a,e.model.departIds?e.departIds=e.model.departIds.split(","):e.departIds=s,t.userDepartModel.departIdList=t.checkedDepartKeys}}))},close:function(){this.$emit("close"),this.visible=!1,this.disableSubmit=!1,this.selectedRole=[],this.userDepartModel={userId:"",departIdList:[]},this.checkedDepartNames=[],this.checkedDepartNameString="",this.checkedDepartKeys=[],this.selectedDepartKeys=[],this.resultDepartOptions=[],this.departIds=[],this.departIdShow=!1,this.identity="1",this.fileList=[]},moment:o.a,handleSubmit:function(){var e=this,t=this;this.form.validateFields((function(r,a){if(!r){t.confirmLoading=!0;var s,i=Object.assign(e.model,a);""!=t.fileList?i.avatar=t.fileList:i.avatar=null,i.selectedroles=e.selectedRole.length>0?e.selectedRole.join(","):"",e.model.id?s=Object(f["r"])(i):(i.id=e.userId,s=Object(f["e"])(i)),s.then((function(e){e.success?(t.$message.success(e.message),t.$emit("ok")):t.$message.warning(e.message)})).finally((function(){t.confirmLoading=!1,t.checkedDepartNames=[],t.userDepartModel.departIdList={userId:"",departIdList:[]},t.close()}))}}))},handleCancel:function(){this.close()},validateToNextPassword:function(e,t,r){var a=this.form,s=a.getFieldValue("confirmpassword");t&&s&&t!==s&&r("两次输入的密码不一样!"),t&&this.confirmDirty&&a.validateFields(["confirm"],{force:!0}),r()},compareToFirstPassword:function(e,t,r){var a=this.form;t&&t!==a.getFieldValue("password")?r("两次输入的密码不一样!"):r()},validatePhone:function(e,t,r){if(t)if(new RegExp(/^1[3|4|5|7|8|9][0-9]\d{8}$/).test(t)){var a={tableName:"admin_user",fieldName:"phone",fieldVal:t,dataId:this.userId};Object(f["m"])(a).then((function(e){e.success?r():r("手机号已存在!")}))}else r("请输入正确格式的手机号码!");else r()},validateEmail:function(e,t,r){if(t)if(new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(t)){var a={tableName:"admin_user",fieldName:"email",fieldVal:t,dataId:this.userId};Object(f["m"])(a).then((function(e){e.success?r():r("邮箱已存在!")}))}else r("请输入正确格式的邮箱!");else r()},validateUsername:function(e,t,r){var a={tableName:"admin_user",fieldName:"name",fieldVal:t,dataId:this.userId};Object(f["m"])(a).then((function(e){e.success?r():r("用户名已存在!")}))},validateWorkNo:function(e,t,r){var a={tableName:"sys_user",fieldName:"work_no",fieldVal:t,dataId:this.userId};Object(f["m"])(a).then((function(e){e.success?r():r("工号已存在!")}))},handleConfirmBlur:function(e){var t=e.target.value;this.confirmDirty=this.confirmDirty||!!t},normFile:function(e){return Array.isArray(e)?e:e&&e.fileList},beforeUpload:function(e){var t=e.type;if(t.indexOf("image")<0)return this.$message.warning("请上传图片"),!1},handleChange:function(e){if(this.picUrl="","uploading"!==e.file.status){if("done"===e.file.status){var t=e.file.response;this.uploadLoading=!1,t.success?(this.model.avatar=t.message,this.picUrl="Has no pic url yet"):this.$message.warning(t.message)}}else this.uploadLoading=!0},onSearch:function(){this.$refs.departWindow.add(this.checkedDepartKeys,this.userId)},modalFormOk:function(e){this.checkedDepartNames=[],this.selectedDepartKeys=[],this.checkedDepartNameString="",this.userId=e.userId,this.userDepartModel.userId=e.userId,this.departIds=[],this.resultDepartOptions=[];for(var t=[],r=0;r<e.departIdList.length;r++)this.selectedDepartKeys.push(e.departIdList[r].key),this.checkedDepartNames.push(e.departIdList[r].title),this.checkedDepartNameString=this.checkedDepartNames.join(","),t.push({key:e.departIdList[r].key,title:e.departIdList[r].title}),this.departIds.push(e.departIdList[r].key);this.resultDepartOptions=t,this.userDepartModel.departIdList=this.selectedDepartKeys,this.checkedDepartKeys=this.selectedDepartKeys},resetScreenSize:function(){var e=document.body.clientWidth;this.drawerWidth=e<500?e:700},identityChange:function(e){"1"===e.target.value?this.departIdShow=!1:this.departIdShow=!0}}},D=I,C=(r("f511"),r("2877")),L=Object(C["a"])(D,a,s,!1,null,"12c760e2",null);t["default"]=L.exports},"5cb7":function(e,t,r){},"60c5":function(e,t,r){},"88bc":function(e,t,r){(function(t){var r=1/0,a=9007199254740991,s="[object Arguments]",i="[object Function]",n="[object GeneratorFunction]",l="[object Symbol]",o="object"==typeof t&&t&&t.Object===Object&&t,d="object"==typeof self&&self&&self.Object===Object&&self,c=o||d||Function("return this")();function u(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function h(e,t){var r=-1,a=e?e.length:0,s=Array(a);while(++r<a)s[r]=t(e[r],r,e);return s}function p(e,t){var r=-1,a=t.length,s=e.length;while(++r<a)e[s+r]=t[r];return e}var f=Object.prototype,m=f.hasOwnProperty,v=f.toString,b=c.Symbol,y=f.propertyIsEnumerable,g=b?b.isConcatSpreadable:void 0,w=Math.max;function k(e,t,r,a,s){var i=-1,n=e.length;r||(r=L),s||(s=[]);while(++i<n){var l=e[i];t>0&&r(l)?t>1?k(l,t-1,r,a,s):p(s,l):a||(s[s.length]=l)}return s}function I(e,t){return e=Object(e),D(e,t,(function(t,r){return r in e}))}function D(e,t,r){var a=-1,s=t.length,i={};while(++a<s){var n=t[a],l=e[n];r(l,n)&&(i[n]=l)}return i}function C(e,t){return t=w(void 0===t?e.length-1:t,0),function(){var r=arguments,a=-1,s=w(r.length-t,0),i=Array(s);while(++a<s)i[a]=r[t+a];a=-1;var n=Array(t+1);while(++a<t)n[a]=r[a];return n[t]=i,u(e,this,n)}}function L(e){return N(e)||x(e)||!!(g&&e&&e[g])}function S(e){if("string"==typeof e||U(e))return e;var t=e+"";return"0"==t&&1/e==-r?"-0":t}function x(e){return j(e)&&m.call(e,"callee")&&(!y.call(e,"callee")||v.call(e)==s)}var N=Array.isArray;function O(e){return null!=e&&K(e.length)&&!F(e)}function j(e){return A(e)&&O(e)}function F(e){var t=R(e)?v.call(e):"";return t==i||t==n}function K(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function R(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function A(e){return!!e&&"object"==typeof e}function U(e){return"symbol"==typeof e||A(e)&&v.call(e)==l}var $=C((function(e,t){return null==e?{}:I(e,h(k(t,1),S))}));e.exports=$}).call(this,r("c8ba"))},c63ec:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{width:e.modalWidth,visible:e.visible,title:"部门搜索",confirmLoading:e.confirmLoading,cancelText:"关闭",wrapClassName:"ant-modal-cust-warp"},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"上级部门"}},[t("a-tree",{attrs:{multiple:"",treeCheckable:"tree",checkable:"",expandedKeys:e.expandedKeysss,checkedKeys:e.checkedKeys,allowClear:"true",checkStrictly:!0,dropdownStyle:{maxHeight:"200px",overflow:"auto"},treeData:e.departTree,placeholder:"请选择上级部门"},on:{expand:e.onExpand,check:e.onCheck}})],1)],1)]],2)},s=[],i=r("88bc"),n=r.n(i),l=r("0fea"),o=r("4ec3"),d=r("418f"),c={name:"DepartWindow",components:{userModal:d["default"]},data:function(){return{checkedKeys:[],expandedKeysss:[],userId:"",model:{},userDepartModel:{userId:"",departIdList:[]},departList:[],modalWidth:400,departTree:[],title:"操作",visible:!1,labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,headers:{},form:this.$form.createForm(this),url:{userId:"/sys/user/generateUserId"}}},methods:{add:function(e,t){this.checkedKeys=e,this.userId=t,this.edit({})},edit:function(e){var t=this;this.departList=[],this.queryDepartTree(),this.form.resetFields(),this.visible=!0,this.model=Object.assign({},e);var r=n()(this.model,"id","userId","departIdList");this.$nextTick((function(){t.form.setFieldsValue(r)}))},close:function(){this.$emit("close"),this.visible=!1,this.departList=[],this.checkedKeys=[]},handleSubmit:function(){var e=this,t=this;this.form.validateFields((function(r){if(!r)if(t.confirmLoading=!0,null==e.userId)Object(l["c"])(e.url.userId).then((function(r){if(r.success){var a={userId:r.result,departIdList:e.departList};t.$emit("ok",a)}})).finally((function(){t.departList=[],t.confirmLoading=!1,t.close()}));else{var a={userId:e.userId,departIdList:e.departList};t.departList=[],t.$emit("ok",a),t.confirmLoading=!1,t.close()}}))},handleCancel:function(){this.close()},onCheck:function(e,t){this.departList=[],this.checkedKeys=e.checked;for(var r=t.checkedNodes,a=0;a<r.length;a++){var s=r[a].data.props,i={key:"",value:"",title:""};i.key=s.value,i.value=s.value,i.title=s.title,this.departList.push(i)}},queryDepartTree:function(){var e=this;Object(o["F"])().then((function(t){if(t.success&&(e.departTree=t.result,e.checkedKeys&&e.checkedKeys.length>0)){var r=[],a=t.result;a&&a.length>0&&(a.forEach((function(e){r.push(e.key)})),e.expandedKeysss=r)}}))},onExpand:function(e){this.expandedKeysss=e},modalFormOk:function(){}}},u=c,h=(r("1d54"),r("2877")),p=Object(h["a"])(u,a,s,!1,null,"3a18028b",null);t["default"]=p.exports},f511:function(e,t,r){"use strict";r("5cb7")}}]);