(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2ee61c3a"],{"0078":function(e,t,n){"use strict";n("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",[t("a-input",{attrs:{"select-model":"single",readOnly:""},on:{click:e.showSelectUser},model:{value:e.showValue,callback:function(t){e.showValue=t},expression:"showValue"}},[t("a-icon",{attrs:{slot:"suffix",type:"user-add"},slot:"suffix"})],1),t("ant-modal",{attrs:{visible:e.open,"modal-title":e.title,"adjust-size":!1,modalHeight:"480",modalWidth:"800",dialogClass:"personSelect"},on:{cancel:e.cancel}},[t("a-row",{attrs:{slot:"content"},slot:"content"},[t("a-spin",{attrs:{spinning:e.spinning,delay:e.delayTime,tip:"Loading..."}},[t("a-col",{staticClass:"treeBox treeborder",attrs:{span:12}},[t("a-input-search",{attrs:{placeholder:"请输入用户信息"},on:{search:e.filterNode}}),t("div",{staticClass:"personSelectTree"},["multi"==e.selectModel?t("a-tree",{attrs:{checkable:"",replaceFields:e.replaceFields,"default-expanded-keys":e.expandedKeys,"expanded-keys":e.expandedKeys,"auto-expand-parent":e.autoExpandParent,"selected-keys":e.selectedKeys,"tree-data":e.deptOptions,"load-data":e.onLoadData,showIcon:""},on:{expand:e.onExpand,check:e.checkNode},scopedSlots:e._u([{key:"title",fn:function(n){var s=n.title,a=n.attributes;return[s.indexOf(e.searchValue)>-1?t("span",[e._v(" "+e._s(s.substr(0,s.indexOf(e.searchValue)))+" "),t("span",{staticStyle:{color:"#f50"}},[e._v(e._s(e.searchValue))]),e._v(" "+e._s(s.substr(s.indexOf(e.searchValue)+e.searchValue.length))+" ")]):a.deptPinyin.indexOf(e.searchValue)>-1?t("span",[t("span",{staticStyle:{color:"#f50"}},[e._v(e._s(s))])]):t("span",[e._v(e._s(s))])]}}],null,!1,322713610),model:{value:e.checkedKeys,callback:function(t){e.checkedKeys=t},expression:"checkedKeys"}},[t("a-icon",{staticClass:"depIcon",attrs:{slot:"org",type:"",component:e.allIcon.companyFillIcon},slot:"org"}),t("a-icon",{staticClass:"depIcon",attrs:{slot:"company",type:"",component:e.allIcon.companyIcon},slot:"company"}),t("a-icon",{staticClass:"depIcon",attrs:{slot:"dept",type:"",component:e.allIcon.connectionsIcon},slot:"dept"}),t("a-icon",{staticClass:"depIcon",attrs:{slot:"user",type:"user"},slot:"user"})],1):e._e(),"single"==e.selectModel?t("a-tree",{attrs:{replaceFields:e.replaceFields,"default-expanded-keys":e.expandedKeys,"expanded-keys":e.expandedKeys,"auto-expand-parent":e.autoExpandParent,"selected-keys":e.selectedKeys,"tree-data":e.deptOptions,"load-data":e.onLoadData,showIcon:""},on:{expand:e.onExpand,select:e.selectNode},scopedSlots:e._u([{key:"title",fn:function(n){var s=n.title,a=n.attributes;return[s.indexOf(e.searchValue)>-1?t("span",[e._v(" "+e._s(s.substr(0,s.indexOf(e.searchValue)))+" "),t("span",{staticStyle:{color:"#f50"}},[e._v(e._s(e.searchValue))]),e._v(" "+e._s(s.substr(s.indexOf(e.searchValue)+e.searchValue.length))+" ")]):a.deptPinyin.indexOf(e.searchValue)>-1?t("span",[t("span",{staticStyle:{color:"#f50"}},[e._v(e._s(s))])]):t("span",[e._v(e._s(s))])]}}],null,!1,322713610)},[t("a-icon",{staticClass:"depIcon",attrs:{slot:"org",type:"",component:e.allIcon.companyFillIcon},slot:"org"}),t("a-icon",{staticClass:"depIcon",attrs:{slot:"company",type:"",component:e.allIcon.companyIcon},slot:"company"}),t("a-icon",{staticClass:"depIcon",attrs:{slot:"dept",type:"",component:e.allIcon.connectionsIcon},slot:"dept"}),t("a-icon",{staticClass:"depIcon",attrs:{slot:"user",type:"user"},slot:"user"})],1):e._e()],1)],1),t("a-col",{attrs:{span:12}},[t("div",{staticClass:"contentBox"},[t("div",{style:{padding:"10px 20px"}},[t("a-checkbox",{attrs:{indeterminate:e.indeterminate,checked:e.checkAll},on:{change:e.onCheckAllChange}},[e._v(" 已选（"+e._s(e.selectCount)+"）")]),t("a-icon",{style:{float:"right"},attrs:{type:"delete"},on:{click:e.deleteSelectUser}})],1),t("a-checkbox-group",{on:{change:e.onChange},model:{value:e.userCheckedList,callback:function(t){e.userCheckedList=t},expression:"userCheckedList"}},[t("a-list",{ref:"editTable",attrs:{"item-layout":"horizontal","data-source":e.userdata},scopedSlots:e._u([{key:"renderItem",fn:function(n){return t("a-list-item",{},[t("a-checkbox",{attrs:{value:n.id},on:{change:e.checkBoxOnChange}}),t("a-list-item-meta",[t("template",{slot:"title"},[t("span",{staticClass:"title-name"},[e._v(e._s(n.name))]),t("span",{staticClass:"title-dept"},[e._v("("+e._s(n.subtitle)+")")])]),t("a-avatar",{attrs:{slot:"avatar",icon:n.icon},slot:"avatar"})],2),t("template",{slot:"actions"},["multi"===e.selectModel?t("a-icon",{staticClass:"dragIconClass",attrs:{type:"drag"}}):e._e(),t("a-icon",{attrs:{type:"close-circle"},on:{click:function(t){return e.deletSelectUserByParentIds(n.id,n.parentIds)}}})],1)],2)}}])})],1)],1)])],1)],1),t("template",{slot:"footer"},[t("a-button",{on:{click:e.cancel}},[e._v("取消")]),t("a-button",{attrs:{type:"primary"},on:{click:e.saveSelectUser}},[e._v("保存")])],1)],2)],1)},a=[],r=(n("4de4"),n("a434"),n("4ec9"),n("a9e3"),n("d3b7"),n("3ca3"),n("498a"),n("159b"),n("ddb0"),n("04b3")),c=n("fcb7"),i=n("c0c7"),o=n("2dd7"),d=n("aa47"),u={props:{title:{type:String,default:"人员选择"},defaultValue:{required:!1,default:null},value:{required:!1},selectModel:{type:String,required:!1,default:"single"},maxSelect:{type:Number,required:!1,default:0}},data:function(){return{showValue:"",oldValue:"",indeterminate:!1,checkAll:!1,userCheckedList:[],spinning:!1,delayTime:200,allIcon:r["a"],sortable:void 0,replaceFields:{children:"children",key:"id",value:"id"},open:!1,expandedKeys:[],autoExpandParent:!0,checkedKeys:[],selectedKeys:[],deptOptions:[],deptNodes:[],oldDeptOptions:[],oldExpandedKeys:[],expandSonData:[],select:{ids:"",names:""},searchValue:"",userdata:[],checkedUser:[],selectCount:0}},components:{AntModal:o["a"],allIcon:r["a"]},created:function(){this.getTreeselect()},mounted:function(){},watch:{checkedKeys:function(e){},checkedUser:{immediate:!0,handler:function(e){this.userCheckedList=e}},userdata:{immediate:!0,handler:function(e){this.selectCount=e.length,"multi"===this.selectModel&&e.length>0&&void 0===this.sortable&&this.rowDrop()}},select:{immediate:!0,handler:function(e){this.oldValue=this.select&&this.select.names?this.select.names:"",this.showValue=this.oldValue}},value:{immediate:!0,handler:function(e){this.select=e||{ids:"",names:""}}}},methods:{getSelectUserInfo:function(){var e=this;if(void 0!==this.select.ids&&"undefined"!==this.select.ids&&""!==this.select.ids){var t={userIds:this.select.ids};Object(i["i"])(t).then((function(t){e.userdata=t.data,e.selectedKeys=[],e.checkedKeys=[],e.userdata.forEach((function(t){e.selectedKeys.push(t.id),e.checkedKeys.push(t.id)}))}))}},checkBoxOnChange:function(e){e.target.checked?this.checkedUser.push(e.target.value):this.checkedUser=this.checkedUser.filter((function(t){return t!==e.target.value}))},onChange:function(e){this.indeterminate=!!this.checkedUser.length&&this.checkedUser.length<this.userdata.length,this.checkAll=this.checkedUser.length===this.userdata.length},onCheckAllChange:function(e){Object.assign(this,{userCheckedList:e.target.checked?this.selectedKeys:[],checkedUser:e.target.checked?this.selectedKeys:[],indeterminate:!1,checkAll:e.target.checked})},deleteSelectUser:function(){var e=this;this.checkAll?(this.userdata.forEach((function(t){e.checkedKeys=e.checkedKeys.filter((function(e){return t.parentIds.indexOf(e)<0}))})),this.userdata=[],this.userCheckedList=[],this.checkAll=!1):this.userCheckedList.forEach((function(t){e.userdata.some((function(n,s){n.id===t&&(e.userdata.splice(s,1),e.checkedKeys=e.checkedKeys.filter((function(e){return n.parentIds.indexOf(e)<0})))}))}))},deletSelectUserByParentIds:function(e,t){var n=this;this.checkedKeys=this.checkedKeys.filter((function(e){return t.indexOf(e)<0})),this.userdata.some((function(t,s){t.id===e&&(n.userdata.splice(s,1),n.checkedKeys=n.checkedKeys.filter((function(e){return t.parentIds.indexOf(e)<0})))}))},resetSelectUserInfo:function(){this.checkedKeys=[],this.userdata=[]},getTreeselect:function(){var e=this;Object(c["p"])("0",3).then((function(t){e.deptOptions=t.data,e.getExpandedKeys(e.deptOptions,3),Object.assign(e,{expandedKeys:e.expandedKeys,searchValue:"",autoExpandParent:!0})}))},getExpandedKeys:function(e,t){var n=this;t>1&&e.forEach((function(e){return n.expandedKeys.push(e.id),t-=1,n.getExpandedKeys(e.children,t)}))},getExpandedAllKeys:function(e){var t=this;if(!e||0===e.length)return[];e.forEach((function(e){return t.deptNodes.push(e.id),t.getExpandedAllKeys(e.children)}))},onLoadData:function(e){var t=this;return new Promise((function(n){e.dataRef.children?n():(t.spinning=!t.spinning,Object(c["p"])(e.dataRef.id,1).then((function(s){e.dataRef.children=s.data,t.expandSonData=s.data,e.checked?t.setSelectUserInfoByNodes(s.data):t.checkedKeys=t.selectedKeys,t.spinning=!t.spinning,n()})))}))},showSelectUser:function(){this.getSelectUserInfo(),this.open=!0,this.resetSelectUserInfo()},filterNode:function(e,t){var n=this;if(0===this.oldDeptOptions.length&&(this.oldDeptOptions=this.deptOptions,this.oldExpandedKeys=this.expandedKeys),""===e.trim())this.deptOptions=this.oldDeptOptions,Object.assign(this,{expandedKeys:this.oldExpandedKeys,searchValue:e,autoExpandParent:!0});else{var s={searchText:e};Object(c["m"])(s).then((function(t){n.deptOptions=t.data,n.getExpandedAllKeys(t.data),Object.assign(n,{expandedKeys:n.deptNodes,searchValue:e,autoExpandParent:!0}),n.deptNodes=[]}))}},callback:function(e){},cancel:function(e){this.$emit("close"),this.open=!1},onExpand:function(e){this.expandedKeys=e,this.autoExpandParent=!1},onCheck:function(e){this.checkedKeys=e},selectNode:function(e,t){var n=t.node.dataRef,s=n.attributes.deptType;if("user"===s){this.selectedKeys=[],this.userdata=[];var a=n.id,r=n.title,c=n.parentIds,i=n.attributes.subtitle,o={id:a,name:r,subtitle:i,parentIds:c,icon:"user"};this.selectedKeys.push(a),this.userdata.push(o)}else this.$message.warning("请选择用户添加")},checkNode:function(e,t){var n=this;if(t.checked&&!t.node.isLeaf){var s=t.node.dataRef.children;null===s?Promise.all([this.onLoadData(t.node)]).then((function(e){var s=t.node.$options.propsData.dataRef.id;n.expandedKeys.push(s),n.expandSonData.length>0&&(n.setSelectUserInfoByNodes(n.expandSonData),n.expandSonData=[])})):this.setSelectUserInfo(t.checkedNodes)}else t.checked&&t.node.isLeaf?this.setSelectUserInfo(t.checkedNodes):this.removeSelectUserByUserTree(t.node,"node")},unique:function(e){var t=new Map;return e.filter((function(e){return!t.has(e.id)&&t.set(e.id,1)}))},removeSelectUserByUserTree:function(e,t){var n=this,s="",a=null;"node"===t?(s=e.dataRef.id,a=e.dataRef.children):(s=e.id,a=e.children),this.selectedKeys=this.selectedKeys.filter((function(e){return e!==s})),this.userdata=this.userdata.filter((function(e){return e.id!==s})),null!==a&&a.forEach((function(e){n.removeSelectUserByUserTree(e,"children")}))},setSelectUserInfo:function(e){var t=this;e.forEach((function(e){var n=e.componentOptions.propsData.dataRef.title,s=e.componentOptions.propsData.dataRef.id,a=e.componentOptions.propsData.dataRef.parentIds,r=e.componentOptions.propsData.dataRef.attributes.deptType,c=e.componentOptions.propsData.dataRef.attributes.subtitle;t.setSelectEdUserInfo(s,n,c,r,a)}))},setSelectUserInfoByNodes:function(e){var t=this;e.forEach((function(e){var n=e.title,s=e.id,a=e.parentIds,r=e.attributes.deptType,c=e.attributes.subtitle;t.setSelectEdUserInfo(s,n,c,r,a)}))},setSelectEdUserInfo:function(e,t,n,s,a){if(this.selectedKeys.push(e),this.checkedKeys.push(e),"user"===s){var r={id:e,name:t,subtitle:n,parentIds:a,icon:"user"};this.userdata.push(r),this.userdata=this.unique(this.userdata)}},saveSelectUser:function(){var e=this,t="",n="";if(this.userdata.length>this.maxSelect&&0!==this.maxSelect)this.$message.warning("已设置最多选择".concat(this.maxSelect,"人！"));else{this.userdata.forEach((function(e,s){s>0&&(t+=";",n+=";"),t+=e.id,n+=e.name})),this.showValue=n;var s={ids:t,names:n};this.$emit("change",s),this.$nextTick((function(){e.select=s,e.$emit("input",s),e.$emit("callBack",s)})),this.open=!1}},rowDrop:function(){var e=this,t=this;this.$nextTick((function(){var n=e.$refs.editTable,s=n.$el.querySelector(".ant-list-items");e.sortable=d["a"].create(s,{handle:".ant-list-item",animation:300,delay:100,chosenClass:"select-list-color",dragClass:"drag-list-color",onEnd:function(e){var n=e.newIndex,s=e.oldIndex,a=t.userdata.splice(s,1)[0];t.userdata.splice(n,0,a)},onUpdate:function(e){var t=e.newIndex,n=e.oldIndex,a=s,r=a.children[t],c=a.children[n];a.removeChild(r),t>n?a.insertBefore(r,c):a.insertBefore(r,c.nextSibling)}})}))}}},l=u,h=(n("4ea84"),n("2877")),p=Object(h["a"])(l,s,a,!1,null,null,null);t["a"]=p.exports},"4ea84":function(e,t,n){"use strict";n("c658")},c0c7:function(e,t,n){"use strict";n.d(t,"l",(function(){return r})),n.d(t,"h",(function(){return c})),n.d(t,"a",(function(){return i})),n.d(t,"p",(function(){return o})),n.d(t,"e",(function(){return d})),n.d(t,"n",(function(){return u})),n.d(t,"f",(function(){return l})),n.d(t,"m",(function(){return h})),n.d(t,"j",(function(){return p})),n.d(t,"q",(function(){return f})),n.d(t,"r",(function(){return m})),n.d(t,"s",(function(){return y})),n.d(t,"k",(function(){return b})),n.d(t,"d",(function(){return g})),n.d(t,"b",(function(){return k})),n.d(t,"c",(function(){return x})),n.d(t,"i",(function(){return v})),n.d(t,"g",(function(){return O})),n.d(t,"o",(function(){return I}));var s=n("b775"),a=n("028d");function r(e){return Object(s["b"])({url:"/system/user/list",method:"get",params:e})}function c(e){return Object(s["b"])({url:"/system/user/"+Object(a["i"])(e),method:"get"})}function i(e){return Object(s["b"])({url:"/system/user",method:"post",data:e})}function o(e){return Object(s["b"])({url:"/system/user/edit",method:"post",data:e})}function d(e){return Object(s["b"])({url:"/system/user/"+e,method:"post"})}function u(e){return Object(s["b"])({url:"/system/user/restart/"+e,method:"post"})}function l(e){return Object(s["b"])({url:"/system/user/export",method:"get",params:e})}function h(e,t){var n={id:e,password:t};return Object(s["b"])({url:"/system/user/resetPwd/edit",method:"post",data:n})}function p(){return Object(s["b"])({url:"/system/user/profile",method:"get"})}function f(e){return Object(s["b"])({url:"/system/user/profile",method:"post",data:e})}function m(e,t){var n={oldPassword:e,newPassword:t};return Object(s["b"])({url:"/system/user/profile/updatePwd/edit",method:"post",params:n})}function y(e){return Object(s["b"])({url:"/system/user/profile/avatar",method:"post",data:e})}function b(){return Object(s["b"])({url:"/system/user/importTemplate",method:"get"})}function g(e){return Object(s["b"])({url:"/system/user/checkUserNameUnique",method:"get",params:e})}function k(e){return Object(s["b"])({url:"/system/user/checkEmailUnique",method:"get",params:e})}function x(e){return Object(s["b"])({url:"/system/user/checkPhoneUnique",method:"get",params:e})}function v(e){return Object(s["b"])({url:"/system/user/getUserInfoByIds",method:"post",data:e})}function O(e){return Object(s["b"])({url:"/system/user/roleUserList",method:"get",params:e})}function I(e){return Object(s["b"])({url:"/system/user/addRoleUser",method:"post",data:e})}},c658:function(e,t,n){},fcb7:function(e,t,n){"use strict";n.d(t,"g",(function(){return a})),n.d(t,"h",(function(){return r})),n.d(t,"i",(function(){return c})),n.d(t,"e",(function(){return i})),n.d(t,"j",(function(){return o})),n.d(t,"a",(function(){return d})),n.d(t,"o",(function(){return u})),n.d(t,"b",(function(){return l})),n.d(t,"d",(function(){return h})),n.d(t,"k",(function(){return p})),n.d(t,"l",(function(){return f})),n.d(t,"p",(function(){return m})),n.d(t,"m",(function(){return y})),n.d(t,"f",(function(){return b})),n.d(t,"n",(function(){return g})),n.d(t,"c",(function(){return k}));n("d3b7");var s=n("b775");function a(e,t,n){return null!=t&&""!==t||(t="0"),null!=n&&""!==n||(n="1"),Object(s["b"])({url:"/system/dept/list/"+n+"/"+t,method:"get",params:e})}function r(e){return Object(s["b"])({url:"/system/dept/listTreeExcludeChild/10/0/"+e,method:"get"})}function c(e,t){return null!=e&&""!==e||(e="0"),null!=t&&""!==t||(t="1"),Object(s["b"])({url:"/system/dept/listTree/"+t+"/"+e,method:"get"})}function i(e){return Object(s["b"])({url:"/system/dept/"+e,method:"get"})}function o(e){return Object(s["b"])({url:"/system/dept/roleDeptTreeselect/"+e,method:"get"})}function d(e){return Object(s["b"])({url:"/system/dept",method:"post",data:e})}function u(e){return Object(s["b"])({url:"/system/dept/edit",method:"post",data:e})}function l(e){return Object(s["b"])({url:"/system/dept/"+e,method:"post"})}function h(e){return Object(s["b"])({url:"/system/dept/findMaxSort/"+e,method:"get"})}function p(e){return Object(s["b"])({url:"/system/dept/search",method:"get",params:e})}function f(e){return Object(s["b"])({url:"/system/dept/searchDeptList",method:"get",params:e})}function m(e,t){return null!=e&&""!==e||(e="0"),null!=t&&""!==t||(t="1"),Object(s["b"])({url:"/system/dept/userSelectList/"+t+"/"+e,method:"get"})}function y(e){return Object(s["b"])({url:"/system/dept/searchDeptUserList",method:"get",params:e})}function b(e){return Object(s["b"])({url:"/system/dept/getDeptInfoByIds",method:"post",data:e})}function g(){return new Promise((function(e,t){e({code:200,msg:"",data:[]})}))}function k(e){return Object(s["b"])({url:"/system/dept/export",method:"get",params:e})}}}]);