1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-232de7fe"],{2053:function(e,t,a){"use strict";a("416c")},"416c":function(e,t,a){},"44ff":function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e._self._c;return t("awsui-layout",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{id:"create","element-loading-text":e.loadingText}},[t("awsui-main",{style:{width:"100%",padding:0,height:e.bodyHeight},attrs:{id:"createMain"}},[t("div",{staticStyle:{width:"100%",height:"100%"}},[t("div",{staticStyle:{width:"100%",height:"300px",margin:"auto",position:"relative",top:"35%"}},[t("div",{staticStyle:{"text-align":"center"}},[t("span",[t("i",{staticClass:"iconfont",staticStyle:{color:"#C2C2C2","font-size":"60px"}},[e._v("")])]),t("p",{staticClass:"text-general-color",staticStyle:{margin:"15px 0"}},[e._v("您还没加入任何小组!")])]),e.isManage?t("div",{staticStyle:{"text-align":"center"}},[t("awsui-button",{staticClass:"button-general-color text-general-color",attrs:{type:"primary"},on:{click:e.createTeam}},[e._v("创建小组")])],1):e._e()])])]),t("cooperation-update",{ref:"cooperationUpdate",attrs:{visible:e.update.visible,teamId:e.update.teamId,title:e.update.title},on:{"update:visible":function(t){return e.$set(e.update,"visible",t)},cancel:function(t){e.update.visible=!1},getResult:e.updateDone}})],1)},s=[],n=a("de40"),r=(a("0f08"),{name:"Create",components:{CooperationUpdate:n["a"]},data(){return{bodyHeight:document.documentElement.clientHeight+"px",isManage:isManage,update:{visible:!1,teamId:"",title:"创建小组"},loading:!1,loadingText:"正在保存"}},mounted(){const e=this;e.resize()},methods:{createTeam(){this.update.teamId="",this.update.visible=!0},updateDone(e){"ok"==e&&(this.update.visible=!1,parent.location.reload())},resize(){const e=this;let t=null;window.onresize=()=>(()=>{t&&clearTimeout(t),t=setTimeout((function(){e.bodyHeight=document.documentElement.clientHeight+"px"}),400)})()}}}),i=r,l=a("2877"),d=Object(l["a"])(i,o,s,!1,null,"35cadde6",null);t["default"]=d.exports},de40:function(e,t,a){"use strict";var o=function(){var e=this,t=e._self._c;return t("validation-observer",{ref:"updateTeam"},[t("awsui-layout",{attrs:{id:"update"}},[t("awsui-dialog",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{"element-loading-text":"加载中",title:e.title,visible:e.dialogVisible,width:e.width,height:e.height,border:!1,"close-on-click-modal":!1,"before-close":e.handleClose},on:{"update:visible":function(t){e.dialogVisible=t}}},[t("div",[t("el-steps",{attrs:{active:e.stepActive,"align-center":""}},[t("el-step",{attrs:{title:"小组信息"}}),t("el-step",{attrs:{title:"小组管理员"}}),t("el-step",{attrs:{title:"小组权限"}})],1),2==e.stepActive?t("el-input",{staticClass:"input-with-select",attrs:{size:"mini",placeholder:"请输入成员"},model:{value:e.searchUserName,callback:function(t){e.searchUserName=t},expression:"searchUserName"}},[t("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.searchUserNameFun},slot:"append"})],1):e._e(),t("div",{staticStyle:{width:"538px",height:"260px",border:"1px solid #e9e9e9",padding:"10px 10px 10px 15px"}},[1==e.stepActive?t("div",{staticStyle:{position:"relative",padding:"12px 0"}},[t("awsui-form",{ref:"infoForm",attrs:{model:e.baseInfo.form,rules:e.baseInfo.rules,"label-width":"100px","label-position":"top"}},[e.isloaded?t("div",[t("awsui-icon-picker",{staticClass:"icon-team-div",attrs:{defaultOptions:e.iconPickerOptions,value:{icon:e.baseInfo.form.teamLogo.code,color:e.baseInfo.form.teamLogo.color}},on:{change:e.changeIcon}})],1):e._e(),t("awsui-row",[t("awsui-col",{attrs:{span:18}},[t("awsui-form-item",{attrs:{label:"名称",required:""}},[t("validation-provider",{attrs:{rules:"required|teamName_formatCheck|maxLength:36"},scopedSlots:e._u([{key:"default",fn:function({classes:a,errors:o}){return[t("awsui-input",{attrs:{placeholder:"请输入名称"},model:{value:e.baseInfo.form.teamName,callback:function(t){e.$set(e.baseInfo.form,"teamName",t)},expression:"baseInfo.form.teamName"}}),t("div",{class:a},[e._v(e._s(o[0]))])]}}],null,!1,2850441238)})],1)],1)],1),t("awsui-row",[t("awsui-col",{attrs:{span:18}},[t("awsui-form-item",{attrs:{label:"工作网络",required:""}},[t("validation-provider",{attrs:{rules:"required|teamName_formatCheck|maxLength:36"},scopedSlots:e._u([{key:"default",fn:function({classes:a,errors:o}){return[t("awsui-select",{attrs:{filterable:"","allow-create":"","default-first-option":"",placeholder:"请选择/输入工作网络",options:e.baseInfo.form.categoryOpts},on:{change:e.changeCategory},model:{value:e.baseInfo.form.category,callback:function(t){e.$set(e.baseInfo.form,"category",t)},expression:"baseInfo.form.category"}}),t("div",{class:a},[e._v(e._s(o[0]))])]}}],null,!1,2989048194)})],1)],1)],1),t("awsui-row",[t("awsui-col",{attrs:{span:24}},[t("awsui-form-item",{attrs:{label:"简介"}},[t("validation-provider",{attrs:{rules:"maxLength:255"},scopedSlots:e._u([{key:"default",fn:function({classes:a,errors:o}){return[t("awsui-input",{attrs:{type:"textarea",placeholder:"请输入简介"},model:{value:e.baseInfo.form.teamDesc,callback:function(t){e.$set(e.baseInfo.form,"teamDesc",t)},expression:"baseInfo.form.teamDesc"}}),t("div",{class:a},[e._v(e._s(o[0]))])]}}],null,!1,3063291858)})],1)],1)],1)],1)],1):e._e(),2==e.stepActive?t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.adminUserInfo.loading,expression:"adminUserInfo.loading"}]},[t("div",{staticStyle:{height:"270px",overflow:"auto"}},[t("el-tree",{key:"userTree",ref:"userTree",attrs:{props:e.adminUserInfo.treeProps,"default-checked-keys":e.adminUserInfo.value,"expand-on-click-node":!1,"highlight-current":!0,"empty-text":"","filter-node-method":e.filterNode,"default-expanded-keys":e.expandKeys,"check-strictly":"","show-checkbox":!0,"node-key":"id",lazy:"",load:e.loadUserNode},on:{"node-click":e.openUserNode,"node-expand":e.expandUserNode,"node-collapse":e.closeUserNode,"check-change":e.checkedUserNode},scopedSlots:e._u([{key:"default",fn:function({node:a,data:o}){return t("span",{},[t("i",{staticClass:"awsui-iconfont tree-content-icon tree-content-icon-padding",style:{color:a.data.icon.color},domProps:{innerHTML:e._s(a.data.icon.icon)}}),t("span",[e._v(e._s(a.label))])])}}],null,!1,52448956)})],1)]):e._e(),3==e.stepActive?t("div",{directives:[{name:"loading",rawName:"v-loading",value:e.permInfo.loading,expression:"permInfo.loading"}]},[t("el-select",{staticStyle:{width:"100%"},attrs:{filterable:"","default-first-option":"",size:"small",placeholder:"请选择资产库"},on:{change:e.changeWs},model:{value:e.permInfo.ws.value,callback:function(t){e.$set(e.permInfo.ws,"value",t)},expression:"permInfo.ws.value"}},e._l(e.permInfo.ws.options,(function(e){return t("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),t("div",{staticStyle:{height:"238px",overflow:"auto"}},[""!=e.permInfo.ws.value?t("el-tree",{key:"repositoryTree",ref:"repositoryTree",attrs:{props:e.permInfo.tree.props,"default-checked-keys":e.permInfo.tree.value,"expand-on-click-node":!1,"highlight-current":!0,"empty-text":"","check-strictly":"","show-checkbox":"","node-key":"versionId",lazy:"",load:e.loadNode},on:{"node-click":e.openNode,"node-expand":e.expandNode,"node-collapse":e.closeNode,"check-change":e.checkedNode},scopedSlots:e._u([{key:"default",fn:function({node:a,data:o}){return t("span",{},[t("i",{staticClass:"awsui-iconfont tree-content-icon tree-content-icon-padding",style:{color:a.data.icon.color},domProps:{innerHTML:e._s(a.data.icon.icon)}}),t("span",[e._v(e._s(a.data.name))])])}}],null,!1,1613751043)}):e._e()],1)],1):e._e()])],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("awsui-button",{directives:[{name:"show",rawName:"v-show",value:2==e.stepActive||3==e.stepActive,expression:"stepActive == 2 || stepActive == 3"}],staticClass:"button-general-color-reverse",on:{click:function(){e.stepActive--}}},[e._v("上一步")]),t("awsui-button",{directives:[{name:"show",rawName:"v-show",value:1==e.stepActive||2==e.stepActive,expression:"stepActive == 1 || stepActive == 2"}],staticClass:"button-general-color",attrs:{type:"primary"},on:{click:e.next}},[e._v("下一步")]),t("awsui-button",{directives:[{name:"show",rawName:"v-show",value:3==e.stepActive,expression:"stepActive == 3"}],staticClass:"button-general-color",attrs:{type:"primary"},on:{click:e.submit}},[e._v("确定")])],1)])],1)],1)},s=[],n=a("0f08"),r={name:"CooperationUpdate",props:{visible:{type:Boolean,default:!1},teamId:{type:String,default:""},title:{type:String,default:"新建"}},data(){return{dialogVisible:!1,loading:!1,width:"600px",height:"370px",addressType:"user",baseInfo:{form:{teamName:"",category:"",categoryOpts:[],teamDesc:"",teamLogo:{color:"",code:""}},rules:{category:[{required:!0,message:"[工作网络]不允许为空",trigger:"blur"}],teamName:[{required:!0,message:"[名称]不允许为空",trigger:"blur"}]}},adminUserInfo:{value:[],treeProps:{label:"name",isLeaf:"leaf"},loading:!1},permInfo:{loading:!1,ws:{value:"",options:[]},tree:{props:{children:"children",label:"label",isLeaf:"leaf"},value:[]}},stepActive:1,isloaded:!1,iconPickerOptions:{type:"background",fatherWidth:70,iconFontSize:52,colorList:["#dc4f39","#ff9421","#009b52","#3383da","#009688","#6600d5","#0b0e7b","#666666","#e6e8ea"],iconfontArray:window.iconfontArray},searchUserName:"",tempNodeArr:[],expandKeys:[],userTreeNode:null,userTreeResolve:null}},mounted(){},methods:{changeCategory(e){this.baseInfo.form.category=e},initData(){const e=this;e.loading=!0;const t={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal.cooperation_team_create_or_update_data_query",teamId:e.teamId}};n["a"].post(t).then((function(t){if("ok"==t.result){const a=t.data;e.baseInfo.form.teamName=a.teamName,e.baseInfo.form.category=a.category,e.baseInfo.form.categoryOpts=a.categoryArr,e.baseInfo.form.teamDesc=a.teamDesc,e.baseInfo.form.teamLogo=a.teamLogo,e.isloaded=!0,e.adminUserInfo.value=a.admins,e.permInfo.ws.value=a.wsId,e.permInfo.ws.options=a.wsArr,e.permInfo.tree.value=a.repositorys}else e.$message.error(t.msg);e.loading=!1})).catch(t=>{console.log(t),e.loading=!1})},next(){const e=this;1==this.stepActive?this.$refs.updateTeam.validate().then(e=>{e&&this.stepActive++}):2==this.stepActive&&(0==e.adminUserInfo.value.length&&e.$message("未选择任何管理员,保存时默认"+(""==e.teamId?"创建":"修改")+"人为管理员"),this.stepActive++)},clearAllData(){const e=this;e.baseInfo.form.teamName="",e.baseInfo.form.category="",e.baseInfo.form.teamDesc="",e.baseInfo.form.teamLogo={},e.adminUserInfo.value=[],e.permInfo.ws.value="",e.permInfo.ws.options=[],e.permInfo.tree.value=[],e.stepActive=1,e.isloaded=!1},handleClose(e){this.closeDlalog("cancel"),e()},cancel(){this.closeDlalog("cancel")},submit(){const e=this.permInfo.ws.value;""!=e?this.closeDlalog("save"):this.$message({message:"请先创建资产库再进行小组创建",type:"warning"})},closeDlalog(e){const t=this;if("save"==e){const e=t.teamId,a=t.baseInfo.form.teamName,o=t.baseInfo.form.category,s=t.baseInfo.form.teamDesc,r=t.baseInfo.form.teamLogo,i=t.adminUserInfo.value,l=t.permInfo.ws.value,d=t.permInfo.tree.value,c={teamId:e,teamName:a,category:o,teamDesc:s,teamLogo:r,admins:i,wsId:l,repositorys:d};t.loading=!0;const p={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal.cooperation_team_create_or_update_data_save",data:JSON.stringify(c)}};n["a"].post(p).then((function(e){t.loading=!1,"ok"==e.result?(t.$message({message:"保存成功",type:"success"}),t.$emit("getResult","ok"),t.dialogVisible=!1,t.clearAllData()):t.$message.error(e.msg)})).catch(e=>{console.log(e),t.loading=!1})}else t.$emit("cancel"),t.dialogVisible=!1,t.clearAllData()},openUserNode(e,t,a){},loadUserNode(e,t){const a=this;a.adminUserInfo.loading=!0;const o={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal_bpm_org_address_component_subjson",addressType:a.addressType,pid:"",highSecurityFilter:""}};0===e.level?(o.data.parentType="",a.userTreeNode=e,a.userTreeResolve=t):(o.data.pid=e.data.id,o.data.parentType=e.data.type),n["a"].post(o).then((function(o){const s=a.addressType.indexOf("department")>-1,n=a.addressType.indexOf("user")>-1;a.addressType.indexOf("role");for(let e=0;e<o.data.length;e++){const t=o.data[e];"company"==t.type?t.disabled=!0:(s&&"department"==t.type&&(t.disabled=!1),s||"department"!=t.type||(t.disabled=!0),n&&"user"==t.type&&(t.disabled=!1),n||"user"!=t.type||(t.disabled=!0),"user"==t.type&&(t.leaf=!0))}if(t(o.data),a.adminUserInfo.loading=!1,0==e.level&&o.data.length>0){const e=a.$refs.userTree;e.getNode(o.data[0].id).expand(),setTimeout((function(){const t=e.getNode(o.data[0].id).childNodes[0];null!=t&&t.expand()}),500)}})).catch(e=>{console.log(e)})},expandUserNode(e,t,a){},closeUserNode(e,t,a){t.childNodes=[],t.loaded=!1},checkedUserNode(e,t,a){const o=this,s=e.id;if(t){const e=o.adminUserInfo.value;-1==e.indexOf(s)&&e.push(s)}else{const e=o.adminUserInfo.value,t=[];for(let a=0;a<e.length;a++)e[a]!=s&&t.push(e[a]);o.adminUserInfo.value=t}},changeWs(e){const t=this;t.permInfo.ws.value="",t.permInfo.tree.value,t.$nextTick((function(){t.permInfo.ws.value=e}))},openNode(e,t,a){},loadNode(e,t){const a=this;a.permInfo.loading=!0;const o={url:"jd",data:{}};o.data.wsId=a.permInfo.ws.value,o.data.teamId="",o.data.cmd="com.actionsoft.apps.coe.pal_processlevel_tree_data",0===e.level?o.data.pid="":o.data.pid=e.data.id,n["a"].post(o).then((function(o){for(let e=0;e<o.data.length;e++)o.data[e].id.length<36&&(o.data[e].disabled=!0);if(t(o.data),a.permInfo.loading=!1,0==e.level&&o.data.length>0){const e=a.$refs.repositoryTree;e.getNode(o.data[0].id).expand(),setTimeout((function(){const t=e.getNode(o.data[0].id).childNodes[0];null!=t&&t.expand()}),500)}})).catch(e=>{console.log(e)})},expandNode(e,t,a){},closeNode(e,t,a){t.childNodes=[],t.loaded=!1},checkedNode(e,t,a){const o=this,s={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal_publish_publishgroup_repository_data_query",wsId:o.permInfo.ws.value,pid:e.id}};n["a"].post(s).then((function(a){const s=a.data,n=e.versionId;if(t){const e=o.permInfo.tree.value;-1==e.indexOf(n)&&e.push(n);for(let t=0;t<s.length;t++)-1==e.indexOf(s[t])&&e.push(s[t]);o.$refs.repositoryTree.setCheckedKeys(e)}else{const e=o.permInfo.tree.value,t=[];for(let a=0;a<e.length;a++)e[a]!=n&&-1==s.indexOf(e[a])&&t.push(e[a]);o.permInfo.tree.value=t,o.$refs.repositoryTree.setCheckedKeys([])}})).catch(e=>{console.log(e)})},changeIcon(e){this.baseInfo.form.teamLogo.code=e.icon,this.baseInfo.form.teamLogo.color=e.color},searchUserNameFun(){let e=this;if(e.searchUserName){const t={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal_search_user_tree_node",userName:e.searchUserName}};n["a"].post(t).then(t=>{let a=[...t.data];a.length?e.searchParentUserIdFun(a,e.searchUserName):e.$message({type:"warning",message:"查询的部门不存在,请检查输入的部门名称"})}).catch(e=>{console.log(e)})}else{var t;e.userTreeNode.childNodes=[],e.loadUserNode(e.userTreeNode,e.userTreeResolve),e.expandKeys=[],null!==(t=e.tempNodeArr)&&void 0!==t&&t.length&&(e.tempNodeArr.forEach(t=>{e.$refs.userTree.remove(t)}),e.tempNodeArr.length=0)}},searchParentUserIdFun(e,t){let a=this;const o={url:"jd",data:{cmd:"com.actionsoft.apps.coe.pal_search_user_tree_parent_node",userid:e}};n["a"].post(o).then(t=>{a.expandKeys=[...t.data],setTimeout(()=>{let t=[];e.forEach(e=>{let o=a.$refs.userTree.getNode(e);t.push(o),a.tempNodeArr.push(o)}),a.$refs.userTree.filter(t)},600)}).catch(e=>{console.log(e)})},filterNode(e,t){if(console.log("xxxx",e),!e)return!0;let a=[];return e.forEach(e=>{if(-1!==e.data.pathIdList.indexOf(t.id)){let e=this.$refs.userTree.getNode(t.id);e&&this.tempNodeArr.push(e)}e.data.pathIdList.forEach(e=>{-1===a.indexOf(e)&&a.push(e)})}),-1!==a.indexOf(t.id)}},watch:{visible(e){this.dialogVisible=e,e&&this.initData()},searchUserName(e,t){var a;e||(this.userTreeNode.childNodes=[],this.loadUserNode(this.userTreeNode,this.userTreeResolve),this.expandKeys=[],null!==(a=this.tempNodeArr)&&void 0!==a&&a.length&&(this.tempNodeArr.forEach(e=>{this.$refs.userTree.remove(e)}),this.tempNodeArr.length=0))}}},i=r,l=(a("2053"),a("2877")),d=Object(l["a"])(i,o,s,!1,null,"48a18669",null);t["a"]=d.exports}}]); |