1 |
- var defaultParams={sysCode:"",sysName:"",sysDomain:"",valid:"",limit:5,offset:0,order:"",sort:""},msSystemInfoListContentVm=new Vue({el:"#msSystemInfoListContent",data:{msConfig:(new ProjectConfig).platmanServiceConfig,searchParams:JSON.parse(JSON.stringify(defaultParams)),fieldDictTypeMap:{sysDomain:"ms_system_biz_domain",valid:"y_n","admin.userStatus":"user_status"},pageDictMap:{},msSystemInfoTablePage:{},msSystemAdminSearchParams:{sys:"-1",limit:5,offset:0,order:"",sort:""},msSystemAdminTablePage:{},pageLoading:!0,editType:GetQueryString("editType"),systemInfoLoading:!1,msSystemAdminTableLoading:!1},computed:{formBaseUrl:function(){return getRelativePath()+"msSystemInfoForm.html?editType="},requestPrefix:function(){return this.msConfig.gatewayRoute+this.msConfig.adminPath}},methods:{getDictByField:function(e){return this.pageDictMap[this.fieldDictTypeMap[e]]},refreshTable:function(){var s=this;s.systemInfoLoading=!0,axiosRequest(s.requestPrefix+"/platman/msSystemInfo/getMsSystemInfoList","获取微服务系统信息记录","GET",s.searchParams).then(function(e){s.msSystemInfoTablePage=e,s.systemInfoLoading=!1,s.$nextTick(function(){var e=s.$refs.msSystemInfoTable;0<e.tableData.length&&e.toggleRowSelection(e.tableData[0],!0)})})},resetSearchParam:function(){this.searchParams=JSON.parse(JSON.stringify(defaultParams)),this.refreshTable()},handleRowClick:function(e,s,t){eleTableClickSelection(this.$refs.msSystemInfoTable,e,t)},handleTableSizeChange:function(e){this.searchParams.limit=e,this.refreshTable()},handleTableCurrentChange:function(e){this.searchParams.offset=this.searchParams.limit*(e-1),this.refreshTable()},handleSortChange:function(e){null===e.prop||null===e.order?(this.searchParams.sort=defaultParams.sort,this.searchParams.order=defaultParams.order):(this.searchParams.sort=e.prop,this.searchParams.order=e.order.split("ending")[0]),this.refreshTable()},addNewMsSystemInfo:function(){var e=this.formBaseUrl+"add",s=this;openDialog("新增微服务系统信息",e,{width:"800px",height:"500px",callback:function(){s.refreshTable()}})},deleteSelectedMsSystemInfo:function(){var i=this,n=i.$refs.msSystemInfoTable.selection;0!==n.length?direwolfCommonConfirm({message:"数据删除后不可恢复,确定继续删除吗?",title:"删除提醒"},function(){var s="";n.forEach(function(e){e.id&&(s+=e.id+",")}),1<s.length&&(s=s.substr(0,s.length-1));var e=i.requestPrefix+"/platman/msSystemInfo/deleteAll?ids="+s,t="批量删除微服务系统信息";axios.post(e).then(function(e){"success"===getDataFromAxiosResponse(e,t,!0).type&&i.refreshTable()}).catch(function(e){axiosErrorTips(e,t+"异常")})}):direwolfCommonTips("warning","请选择要删除的记录")},viewSelectedMsSystemInfo:function(e){var s=this.formBaseUrl+"view&id="+e.row.id;openDialogView("查看微服务系统信息",s,{width:"800px",height:"500px"})},editMsSystemInfoRecord:function(){var e=this,s=this.$refs.msSystemInfoTable.selection;1===s.length?openDialog("修改微服务系统信息",e.formBaseUrl+"edit&id="+s[0].id,{width:"800px",height:"500px",callback:function(){e.refreshTable()}}):direwolfCommonTips("warning","仅能选择一条记录进行修改")},handleSelectionChange:function(e){1===e.length&&(this.msSystemAdminSearchParams.sys=e[0].id,this.refreshMsSystemAdminTable())},handleMsSystemAdminRowClick:function(e,s,t){eleTableClickSelection(this.$refs.msSystemAdminTable,e,t)},handleMsSystemAdminTableSizeChange:function(e){this.msSystemAdminSearchParams.limit=e,this.refreshMsSystemAdminTable()},handleMsSystemAdminTableCurrentChange:function(e){this.msSystemAdminSearchParams.offset=this.msSystemAdminSearchParams.limit*(e-1),this.refreshMsSystemAdminTable()},refreshMsSystemAdminTable:function(){var s=this,e=s.requestPrefix+"/platman/msSystemAdmin/getMsSystemAdminList?"+jsonToSpringBinder(s.msSystemAdminSearchParams),t="获取租户信息信息";s.msSystemAdminTableLoading=!0,axios.get(e).then(function(e){s.msSystemAdminTablePage=getDataFromAxiosResponse(e,t),s.msSystemAdminTableLoading=!1}).catch(function(e){axiosErrorTips(e,t+"异常")})},addNewMsSystemAdmin:function(){var r=this,e="400px",s="350px",t="/common-assets/pages/lazyTreeSelect.html?url="+WEB_ROOT+"/sys/org/getOrgList&expendURL="+encodeURIComponent(WEB_ROOT+"/sys/user/getUserTreeListOfExpand?roleId=2780e66aa97b480898d377831fb2084c")+"&parentKeyOfLeaf=orgId&multiple=T&searchUrl="+encodeURIComponent(WEB_ROOT+"/sys/role/searchUserList?roleId=2780e66aa97b480898d377831fb2084c")+"&pIdKeyOfParent=parentId&nameKeyOfParent=orgName&"+$.param({multiple:"T"});$(document.activeElement).blur(),top.layer.open({type:2,area:[s,e],title:"选择用户,按住Ctrl同时选择多个",maxmin:!1,content:t,btn:["确定","关闭"],zIndex:getTopIndex(),yes:function(s,e){var t=e.find("iframe")[0].contentWindow.tree.getSelectedNodes(),i=0,n=[];t.forEach(function(e){e.isParent?i++:n.push({sys:{id:r.msSystemAdminSearchParams.sys},admin:{id:e.id}})});var a=0<i?"选择节点中的"+i+"个单位节点已被跳过,":"";a+="确定保存"+(0<i?"其余":"")+n.length+"个账户作为系统租户吗?",direwolfCommonConfirm({message:a,title:"保存确认"},function(){axiosRequest(r.requestPrefix+"/platman/msSystemAdmin/insertList","保存租户信息","POST",n).then(function(e){e&&"success"===e.type&&(top.layer.close(s),r.refreshMsSystemAdminTable())})})},cancel:function(e){setTimeout(function(){top.layer.close(e)},100)}})},deleteSelectedMsSystemAdmin:function(){var i=this.$refs.msSystemAdminTable.selection,n=this;0!==i.length?direwolfCommonConfirm({message:"数据删除后不可恢复,确定继续删除吗?",title:"删除提醒"},function(){var s="";i.forEach(function(e){e.id&&(s+=e.id+",")}),1<s.length&&(s=s.substr(0,s.length-1));var e=n.requestPrefix+"/platman/msSystemAdmin/deleteAll?ids="+s,t="批量删除系统管理员";axios.post(e).then(function(e){"success"===getDataFromAxiosResponse(e,t,!0).type&&n.refreshMsSystemAdminTable()}).catch(function(e){axiosErrorTips(e,t+"异常")})}):direwolfCommonTips("warning","请选择要删除的记录")},viewSelectedMsSystemAdmin:function(e){var s=getProjectPath()+"/sys-app/pages/userForm.html?editType=view&id="+e.row.admin.id;openDialogView("查看租户信息",s,{width:"800px",height:"500px"})},configSystemInfo:function(){var e=this.$refs.msSystemInfoTable.selection;0!==e.length?window.location.href="./msSystemConfigCenter.html?sysId="+e[0].id:direwolfCommonTips("warning","请选择要配置的系统")}},created:function(){var s=this;checkPagePermission(s.requestPrefix+"/platman/msSystemInfo/checkMsSystemInfoListPermission"),axiosRequest(s.requestPrefix+"/platman/msSystemInfo/getEditType","获取系统信息").then(function(e){s.pageLoading=!1,s.editType=e.data}),axiosRequest(dictUrl+"ms_system_biz_domain,y_n,user_status","获取字典信息").then(function(e){s.pageDictMap=e.data,s.refreshTable()})},mounted:function(){}});
|