2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3d2fa68d"],{"0a47":function(e,t,s){},"0c6d":function(e,t,s){"use strict";s("d3b7");var i=s("2b0e"),a=s("bc3a"),n=s.n(a),c=s("5c96");s("0fae");i["default"].prototype.$axios=n.a;var r=n.a.create({baseURL:i["default"].prototype.BASE_URL+"",timeout:5e4});r.defaults.withCredentials=!0,r.interceptors.request.use((function(e){return e}),(function(e){return Promise.reject(e)})),r.interceptors.response.use((function(e){switch(e.data.code){case 200:e.data.msg&&c["Message"].success(e.data.msg);break;case 401:c["MessageBox"].alert("登陆已过期,请关闭当前窗口重新进入-能臣工作台");break;case 403:break;case 500:c["Notification"].error({title:"提醒",message:e.data.msg});break;case 404:Object(c["Notification"])({title:"提醒",message:"未找到,检查参数",type:"warning"});break;default:break}return e.data}),(function(e){switch(console.log("请求",e),e.response.status){case 401:c["MessageBox"].alert("登陆已过期,请关闭当前窗口重新进入-能臣工作台");break;case 403:break;case 500:c["Notification"].error({title:"提醒",message:"服务器出了点小错误"});break;case 404:Object(c["Notification"])({title:"提醒",message:"未找到,检查参数",type:"warning"});break;default:return Promise.reject(e)}return Promise.reject(e)})),t["a"]=r},"3c6d":function(e,t,s){},"709c":function(e,t,s){"use strict";var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("w-dialog",{attrs:{border:!1,closeFree:"",width:"600px",title:e.title},on:{ok:e.selectOk},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[s("div",{staticClass:"picker"},[s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"candidate"},["role"!==e.type?s("div",[s("el-input",{staticStyle:{width:"95%"},attrs:{size:"small",clearable:"",placeholder:"搜索人员,支持拼音、姓名","prefix-icon":"el-icon-search"},on:{input:e.searchUser},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.showUsers,expression:"!showUsers"}]},[s("ellipsis",{staticStyle:{height:"18px",color:"#8c8c8c",padding:"5px 0 0"},attrs:{hoverTip:"",row:1,content:e.deptStackStr}},[s("i",{staticClass:"el-icon-office-building",attrs:{slot:"pre"},slot:"pre"})]),s("div",{staticStyle:{"margin-top":"5px"}},[s("el-checkbox",{attrs:{disabled:!e.multiple},on:{change:e.handleCheckAllChange},model:{value:e.checkAll,callback:function(t){e.checkAll=t},expression:"checkAll"}},[e._v("全选")]),s("span",{directives:[{name:"show",rawName:"v-show",value:e.deptStack.length>0,expression:"deptStack.length > 0"}],staticClass:"top-dept",on:{click:e.beforeNode}},[e._v("上一级")])],1)],1)],1):s("div",{staticClass:"role-header"},[s("div",[e._v("系统角色")])]),s("div",{staticClass:"org-items",style:"role"===e.type?"height: 350px":""},[s("el-empty",{directives:[{name:"show",rawName:"v-show",value:0===e.orgs.length,expression:"orgs.length === 0"}],attrs:{"image-size":100,description:"似乎没有数据"}}),e._l(e.orgs,(function(t,i){return s("div",{key:i,class:e.orgItemClass(t),on:{click:function(s){return e.selectChange(t)}}},[s("el-checkbox",{attrs:{disabled:e.disableDept(t)},model:{value:t.selected,callback:function(s){e.$set(t,"selected",s)},expression:"org.selected"}}),"dept"===t.type?s("div",[s("i",{staticClass:"el-icon-folder-opened"}),s("span",{staticClass:"name"},[e._v(e._s(t.name))]),s("span",{class:"next-dept"+(t.selected?"-disable":""),on:{click:function(s){return s.stopPropagation(),e.nextNode(t)}}},[s("i",{staticClass:"iconfont icon-map-site"}),e._v("下级 ")])]):"user"===t.type?s("div",{staticStyle:{display:"flex","align-items":"center"}},[e.$isNotEmpty(t.avatar)?s("el-avatar",{attrs:{size:35,src:t.avatar}}):s("span",{staticClass:"avatar"},[e._v(e._s(e.getShortName(t.name)))]),s("span",{staticClass:"name"},[e._v(e._s(t.name))])],1):s("div",{staticStyle:{display:"inline-block"}},[s("i",{staticClass:"iconfont icon-bumen"}),s("span",{staticClass:"name"},[e._v(e._s(t.name))])])],1)}))],2)]),s("div",{staticClass:"selected"},[s("div",{staticClass:"count"},[s("span",[e._v("已选 "+e._s(e.select.length)+" 项")]),s("span",{on:{click:e.clearSelected}},[e._v("清空")])]),s("div",{staticClass:"org-items",staticStyle:{height:"350px"}},[s("el-empty",{directives:[{name:"show",rawName:"v-show",value:0===e.select.length,expression:"select.length === 0"}],attrs:{"image-size":100,description:"请点击左侧列表选择数据"}}),e._l(e.select,(function(t,i){return s("div",{key:i,class:e.orgItemClass(t)},["dept"===t.type?s("div",[s("i",{staticClass:"el-icon-folder-opened"}),s("span",{staticClass:"name",staticStyle:{position:"static"}},[e._v(e._s(t.name))])]):"user"===t.type?s("div",{staticStyle:{display:"flex","align-items":"center"}},[e.$isNotEmpty(t.avatar)?s("el-avatar",{attrs:{size:35,src:t.avatar}}):s("span",{staticClass:"avatar"},[e._v(e._s(e.getShortName(t.name)))]),s("span",{staticClass:"name"},[e._v(e._s(t.name))])],1):s("div",[s("i",{staticClass:"iconfont icon-bumen"}),s("span",{staticClass:"name"},[e._v(e._s(t.name))])]),s("i",{staticClass:"el-icon-close",on:{click:function(t){return e.noSelected(i)}}})])}))],2)])])])},a=[],n=(s("ac1f"),s("5319"),s("5b81"),s("d81d"),s("b0c0"),s("841c"),s("498a"),s("d3b7"),s("159b"),s("a434"),s("0c6d"));function c(e){return Object(n["a"])({url:"easyflow/flowbase/getOrgTree",method:"get",params:e})}function r(){return Object(n["a"])({url:"easyflow/flowbase/getRole",method:"get"})}function l(e){return Object(n["a"])({url:"oa/org/tree/user/search",method:"get",params:e})}var o={name:"OrgPicker",components:{},props:{title:{default:"请选择",type:String},type:{default:"org",type:String},multiple:{default:!1,type:Boolean},selected:{default:function(){return[]},type:Array}},data:function(){return{visible:!1,loading:!1,checkAll:!1,nowDeptId:null,isIndeterminate:!1,searchUsers:[],nodes:[],select:[],search:"",deptStack:[]}},computed:{deptStackStr:function(){return String(this.deptStack.map((function(e){return e.name}))).replaceAll(","," > ")},orgs:function(){return this.search&&""!==this.search.trim()?this.searchUsers:this.nodes},showUsers:function(){return this.search||""!==this.search.trim()}},methods:{show:function(e){this.visible=!0,this.init(),this.getOrgList(e)},orgItemClass:function(e){return{"org-item":!0,"org-dept-item":"dept"===e.type,"org-user-item":"user"===e.type,"org-role-item":"role"===e.type}},disableDept:function(e){return"user"===this.type&&"dept"===e.type},getOrgList:function(e){var t=this;this.loading=!0,"role"==e?r({deptId:this.nowDeptId,type:this.type}).then((function(e){t.loading=!1,t.nodes=e.data,t.selectToLeft()})).catch((function(e){t.loading=!1,t.$message.error(e.response.data)})):c({deptId:this.nowDeptId,type:this.type}).then((function(e){t.loading=!1,t.nodes=e.data,t.selectToLeft()})).catch((function(e){t.loading=!1,t.$message.error(e.response.data)}))},getShortName:function(e){return e?e.length>2?e.substring(1,3):e:"**"},searchUser:function(){var e=this,t=this.search.trim();this.searchUsers=[],this.loading=!0,l({userName:t}).then((function(t){e.loading=!1,e.searchUsers=t.data,e.selectToLeft()})).catch((function(t){e.loading=!1,e.$message.error("接口异常")}))},selectToLeft:function(){var e=this,t=""===this.search.trim()?this.nodes:this.searchUsers;t.forEach((function(t){for(var s=0;s<e.select.length;s++){if(e.select[s].id===t.id){t.selected=!0;break}t.selected=!1}}))},selectChange:function(e){if(e.selected){this.checkAll=!1;for(var t=0;t<this.select.length;t++)if(this.select[t].id===e.id){this.select.splice(t,1);break}e.selected=!1}else if(!this.disableDept(e)){e.selected=!0;var s=""===this.search.trim()?this.nodes:this.searchUsers;this.multiple||s.forEach((function(t){e.id!==t.id&&(t.selected=!1)})),"dept"===e.type?this.multiple?this.select.unshift(e):this.select=[e]:this.multiple?this.select.push(e):this.select=[e]}},noSelected:function(e){for(var t=this.nodes,s=0;s<2;s++){for(var i=0;i<t.length;i++)if(t[i].id===this.select[e].id){t[i].selected=!1,this.checkAll=!1;break}t=this.searchUsers}this.select.splice(e,1)},handleCheckAllChange:function(){var e=this;this.nodes.forEach((function(t){if(e.checkAll)t.selected||e.disableDept(t)||(t.selected=!0,e.select.push(t));else{t.selected=!1;for(var s=0;s<e.select.length;s++)if(e.select[s].id===t.id){e.select.splice(s,1);break}}}))},nextNode:function(e){this.nowDeptId=e.id,this.deptStack.push(e),this.getOrgList()},beforeNode:function(){0!==this.deptStack.length&&(this.deptStack.length<2?this.nowDeptId=null:this.nowDeptId=this.deptStack[this.deptStack.length-2].id,this.deptStack.splice(this.deptStack.length-1,1),this.getOrgList())},recover:function(){this.select=[],this.nodes.forEach((function(e){return e.selected=!1}))},selectOk:function(){this.$emit("ok",Object.assign([],this.select.map((function(e){return e.avatar=void 0,e})))),this.visible=!1,this.recover()},clearSelected:function(){var e=this;this.$confirm("您确定要清空已选中的项?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.recover()}))},close:function(){this.$emit("close"),this.recover()},init:function(){this.checkAll=!1,this.nowDeptId=null,this.nodes=[],this.select=Object.assign([],this.selected),this.selectToLeft()}}},d=o,h=(s("e4b3"),s("2877")),u=Object(h["a"])(d,i,a,!1,null,"91ed14ba",null);t["a"]=u.exports},cdfc:function(e,t,s){"use strict";s("3c6d")},d504:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticStyle:{"text-align":"center"}},[s("h4",[e._v("先选择本次登录人员的身份,再进入相应的系统 😅")]),s("div",{staticClass:"work-panel"},[s("div",{staticClass:"user"},[s("el-button",{attrs:{type:"primary",round:"",size:"small",icon:"el-icon-user"},on:{click:function(t){return e.$refs.orgPicker.show()}}},[e._v("选择本次登录者")]),""!==e.loginUser&&null!==e.loginUser?s("div",[s("span",[e._v(e._s(e.loginUser.name))])]):e._e()],1),s("div",{staticClass:"panel"},[s("div",{staticClass:"panel-item",on:{click:function(t){return e.to("/workSpace")}}},[e._m(0),s("p",[e._v(" 您可以发起、处理及查看审批,进行日常工作任务 ")])]),s("div",{staticClass:"panel-item",on:{click:function(t){return e.to("/formsPanel")}}},[e._m(1),s("p",[e._v(" 审批工作流创建 、编辑及其他设置操作,均可以在后台进行 ")])])])]),s("org-picker",{ref:"orgPicker",attrs:{type:"user",selected:e.select},on:{ok:e.selected}})],1)},a=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("i",{staticClass:"el-icon-s-platform"}),s("span",[e._v("进入工作区")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("i",{staticClass:"el-icon-s-custom"}),s("span",[e._v("进入管理后台")])])}],n=(s("e9c4"),s("709c")),c={name:"Index",components:{OrgPicker:n["a"]},data:function(){return{select:[],loginUser:""}},mounted:function(){var e=sessionStorage.getItem("user");null!==e&&""!==e&&(this.loginUser=JSON.parse(e),this.select.push(this.loginUser))},methods:{selected:function(e){this.select=e,this.loginUser=e.length>0?e[0]:"",this.showUserSelect=!1,sessionStorage.setItem("user",JSON.stringify(this.loginUser))},to:function(e){null===this.loginUser||""===this.loginUser?this.$message.warning("请先选择一个人员身份进行登录"):this.$router.push(e)}}},r=c,l=(s("cdfc"),s("2877")),o=Object(l["a"])(r,i,a,!1,null,"398dfb57",null);t["default"]=o.exports},e4b3:function(e,t,s){"use strict";s("0a47")}}]);
|
|
//# sourceMappingURL=chunk-3d2fa68d.b7d22861.js.map
|