|
|
//资源视图
|
|
|
layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'sessions',
|
|
|
"commonDetail",'tableTree','soulTable','commonCols'], function (exports) {
|
|
|
var $ = layui.$;
|
|
|
var common = layui.common;
|
|
|
var table = layui.table;
|
|
|
|
|
|
//对外暴露的接口
|
|
|
exports('resindex', function (data) {
|
|
|
var laytpl = layui.laytpl;
|
|
|
var tree = layui.tree;
|
|
|
var form = layui.form;
|
|
|
var view = layui.view;
|
|
|
var router = layui.router();
|
|
|
|
|
|
var soulTable = layui.soulTable;
|
|
|
var tableTree = layui.tableTree;
|
|
|
var commonCols = layui.commonCols;
|
|
|
var admin = layui.admin;
|
|
|
var commonDetail = layui.commonDetail;
|
|
|
var domainName = common.domainName;
|
|
|
|
|
|
var resTypeSelectExclude = ['HOST_MINICOMPUTER', 'HOST_MINICOMPUTER_SERVER', 'HOST_BMC', 'HOST_X86SERVER']
|
|
|
|
|
|
var curTreeNode = '';
|
|
|
var currentResType = '';//当前选中节点的资源类型
|
|
|
var accessToken;
|
|
|
var sortKey = '';
|
|
|
// 资源类型视图表格
|
|
|
var resListTable;
|
|
|
var parentResListTable;
|
|
|
|
|
|
var bizId='';
|
|
|
var busIdSelect;
|
|
|
var busTypeList = [];
|
|
|
var collProtocols = '';
|
|
|
|
|
|
var editFlag = false;
|
|
|
if (data.choose == '1') {
|
|
|
editFlag = true;
|
|
|
$(".choose-resKpiInfo").show();
|
|
|
} else {
|
|
|
// 隐藏左侧菜单
|
|
|
$('#LAY_app_flexible').click();
|
|
|
}
|
|
|
|
|
|
|
|
|
function autoHeight(el) {
|
|
|
// var height = el.parents('.layui-card').height();
|
|
|
// el.css('min-height', height - 75);
|
|
|
}
|
|
|
var sessions = layui.sessions;
|
|
|
accessToken = sessions.getToken().access_token;
|
|
|
//点击卡片
|
|
|
$('#resindexTable').on('click', '[data-res-card]', function () {
|
|
|
var nodeId = $(this).attr("data-res-card");
|
|
|
currentResType = nodeId;//将当前点击的资源类型付给参数
|
|
|
selectedTreeNode('[data-id="' + currentResType + '"]','[data-id="' + currentResType.split('_')[0] + '"]');
|
|
|
renderList(currentResType,'');
|
|
|
// renderList($(this).data("res-card"));
|
|
|
// $("div[data-id='"+nodeId+"']").find(".layui-tree-entry:first span.layui-tree-txt").trigger("click")
|
|
|
});
|
|
|
|
|
|
// 树收缩事件
|
|
|
$('#resindex-leftree-shrink').on('click', function () {
|
|
|
$(".resIndexLeft").animate({width:0,minWidth:0,marginLeft:0},300,function () {
|
|
|
$("#resindex-leftree_btn").show();
|
|
|
$('#resindex-leftree-shrink').hide();
|
|
|
});
|
|
|
});
|
|
|
//获取全部协议
|
|
|
function initProtocolSelect() {
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/manage/protocol/page',
|
|
|
data: {
|
|
|
access_token: accessToken,
|
|
|
startTime: '',
|
|
|
endTime: '',
|
|
|
keyword: '',
|
|
|
hasParam: '',
|
|
|
limit: -1
|
|
|
}
|
|
|
}).done(function (res) {
|
|
|
xmSelect.render({
|
|
|
el: '#collProtocolSelect'
|
|
|
, filterable: true
|
|
|
, tips: '=采集协议='
|
|
|
, name: 'collProtocols'
|
|
|
, prop: {
|
|
|
name: 'protocolName',
|
|
|
value: 'protocolCode',
|
|
|
}
|
|
|
, model: {
|
|
|
label: {
|
|
|
type: 'block',
|
|
|
block: {
|
|
|
//最大显示数量, 0:不限制
|
|
|
showCount: 1,
|
|
|
//是否显示删除图标
|
|
|
showIcon: true,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
, data: res.data
|
|
|
,hide: function () {
|
|
|
var selectValue = xmSelect.get('#collProtocolSelect', true).getValue('value');
|
|
|
collProtocols = selectValue.join(',');
|
|
|
form.render()
|
|
|
reloadTable();
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
//树展开事件
|
|
|
$("#resindex-leftree_btn").on("click",function () {
|
|
|
$("#resindex-leftree_btn").hide();
|
|
|
$("#resindex-leftree-shrink").show();
|
|
|
$(".resIndexLeft").animate({minWidth:170,marginLeft:10},300);
|
|
|
});
|
|
|
|
|
|
var loading = layer.load(2, {shade: 0.2});
|
|
|
//统计
|
|
|
function renderIndex(resType) {
|
|
|
$('#resIndexContent').show();
|
|
|
$('#resListContent').hide();
|
|
|
$('#resDetailContent').empty();
|
|
|
$('#resDetailContent').hide();
|
|
|
$('#treeTableContent').hide();
|
|
|
|
|
|
//如果是阿里云,则显示阿里云的列表
|
|
|
if(resType && resType == 'ALI_CLOUD_PLAT'){
|
|
|
$(".resindexlist").show();
|
|
|
renderTableList("ALI_CLOUD_PLAT");
|
|
|
}else{
|
|
|
$(".resindexlist").hide();
|
|
|
}
|
|
|
|
|
|
var resindexTable = $('#resindexTable');
|
|
|
|
|
|
autoHeight(resindexTable);
|
|
|
|
|
|
window.setResizeEvents('autoHeight', autoHeight);
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/home/resource/healthByResType?pResType=' + resType,
|
|
|
}).done(function (res) {
|
|
|
laytpl($('#resindexTpl').html()).render({list: res.data}, function (html) {
|
|
|
resindexTable.html(html);
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/home/resType/getTree?notExist=machineroom&table=resources&exist=HOST_MINICOMPUTER_SERVER',
|
|
|
type: 'get',
|
|
|
sync: true,
|
|
|
done: function (res) {
|
|
|
layer.close(loading);
|
|
|
loadResTree(res.data);
|
|
|
//joke add 20200407,如果没有资源树,则默认资源页给提示无数据 开始
|
|
|
if (res.data.length === 0) {
|
|
|
var resindexTable = $('#resindexTable');
|
|
|
autoHeight(resindexTable);
|
|
|
laytpl($('#resindexTpl').html()).render({list: res.data}, function (html) {
|
|
|
resindexTable.html(html);
|
|
|
});
|
|
|
}
|
|
|
loadParamSelect();
|
|
|
//joke add 20200407,如果没有资源树,则默认资源页给提示无数据 开始
|
|
|
}
|
|
|
}).error(function () {
|
|
|
layer.close(loading);
|
|
|
//joke add 20200407
|
|
|
//树无数据提示
|
|
|
tree.render({
|
|
|
elem: '#resindextree',
|
|
|
showLine: false,
|
|
|
data: new Array()
|
|
|
});
|
|
|
//右侧无数据提示
|
|
|
var resindexTable = $('#resindexTable');
|
|
|
autoHeight(resindexTable);
|
|
|
laytpl($('#resindexTpl').html()).render({list: new Array()}, function (html) {
|
|
|
resindexTable.html(html);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
//不带分页的列表
|
|
|
function renderTableList(resType) {
|
|
|
//渲染表格
|
|
|
var resTableList;
|
|
|
//获取配置的列
|
|
|
common.getTableCols({
|
|
|
domId: 'resTableList',
|
|
|
moduleId: 'resIndex',
|
|
|
resType: resType
|
|
|
},function (retCols) {
|
|
|
var cols;
|
|
|
if (retCols) {
|
|
|
cols = retCols;
|
|
|
} else {
|
|
|
cols = commonCols.resTypeCls[resType];
|
|
|
}
|
|
|
resTableList = table.render({
|
|
|
elem: '#resindexList'
|
|
|
, id: 'resindexList'
|
|
|
, url: common.domainName + '/api-web/home/res-list/' + resType
|
|
|
, toolbar: '<div><button id="resTableIndex_cols_save" class="layui-btn layui-btn-primary layui-btn-xs toolbar-btn" lay-tips="保存列顺序"><i class="iconfont"></i></button></div>'
|
|
|
, where: {
|
|
|
access_token: accessToken,
|
|
|
resCategory: 'resources'
|
|
|
}
|
|
|
, height: '100'
|
|
|
, cellMinWidth: 80
|
|
|
, page: false
|
|
|
, cols: [cols]
|
|
|
, done: function (res, curr, count) {
|
|
|
//2021/10/18 徐毫杰 阿里云服务器更改样式
|
|
|
if(resType=='ALI_CLOUD_PLAT'){
|
|
|
$('.layui-table-view').height(170);
|
|
|
$('.layui-table-main').height(70);
|
|
|
}
|
|
|
//调用收藏方法
|
|
|
resFavorites();
|
|
|
resTopo();
|
|
|
|
|
|
commonCols.colsClickEvent(editFlag);
|
|
|
|
|
|
//触发拖动列事件,参数为保存按钮的id
|
|
|
common.dragCols("resTableIndex_cols_save");
|
|
|
|
|
|
//保存列顺序
|
|
|
$("#resTableIndex_cols_save").unbind("click").on("click", function () {
|
|
|
var params = {
|
|
|
domId: 'resTableList',
|
|
|
moduleId: 'resIndex',
|
|
|
resType: resType,
|
|
|
cols: resTableList.config.cols
|
|
|
}
|
|
|
common.saveTableCols(params);
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
//左侧树
|
|
|
function loadResTree(data) {
|
|
|
//默认展开全部一级节点
|
|
|
$.each(data,function (i,v) {
|
|
|
v.spread = true;
|
|
|
})
|
|
|
tree.render({
|
|
|
elem: '#resindextree',
|
|
|
showLine: false,
|
|
|
data: data,
|
|
|
click: function (node) {
|
|
|
if (node.data.children.length == 1) {
|
|
|
$('[data-id="'+ node.data.children[0].id +'"]').find('.layui-tree-iconClick:first').click()
|
|
|
}
|
|
|
|
|
|
curTreeNode = node;
|
|
|
currentResType = node.data.id;
|
|
|
|
|
|
var el = null;
|
|
|
if (node.data.children) {
|
|
|
el = $(node.elem[0]).find('>.layui-tree-entry .layui-tree-txt');
|
|
|
} else {
|
|
|
el = $(node.elem[0]).find('.layui-tree-txt');
|
|
|
}
|
|
|
|
|
|
var action = 'removeClass';
|
|
|
if (!el.hasClass('tree-node-select') && node.state === 'open') {
|
|
|
action = 'addClass';
|
|
|
el.parents('.layui-tree').find('.tree-node-select').removeClass('tree-node-select');
|
|
|
}
|
|
|
|
|
|
el[action]('tree-node-select');
|
|
|
|
|
|
// 决定显示那个视图
|
|
|
var optionsStr = JSON.parse(node.data.code)['options'];
|
|
|
if (optionsStr && optionsStr != "") {
|
|
|
options = JSON.parse(optionsStr);
|
|
|
var callback = options.viewCallBack;
|
|
|
var fun = eval(callback);
|
|
|
// 获取回调方法
|
|
|
if ($.isFunction(fun)) {
|
|
|
fun.call(this, data, node.data, options);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
if (data.length > 0) {
|
|
|
var optionsStr = JSON.parse(data[0].code)['options'];
|
|
|
if (optionsStr && optionsStr != "") {
|
|
|
options = JSON.parse(optionsStr);
|
|
|
var callback = options.viewCallBack;
|
|
|
var fun = eval(callback);
|
|
|
// 获取回调方法
|
|
|
if ($.isFunction(fun)) {
|
|
|
fun.call(this, data, data[0], options);
|
|
|
currentResType = data[0].id;
|
|
|
curTreeNode = data[0];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//回选树节点
|
|
|
function selectedTreeNode(target,parentTarget) {
|
|
|
var el = $(target).find('.layui-tree-txt').eq(0);
|
|
|
var action = 'removeClass';
|
|
|
if (!el.hasClass('tree-node-select')) {
|
|
|
action = 'addClass';
|
|
|
el.parents('.layui-tree').find('.tree-node-select').removeClass('tree-node-select');
|
|
|
}
|
|
|
el[action]('tree-node-select');
|
|
|
el.parents('.layui-tree').find(parentTarget).find(".layui-tree-set").addClass("layui-tree-spread");
|
|
|
el.parents('.layui-tree').find(parentTarget).find(".layui-tree-pack").show();
|
|
|
|
|
|
}
|
|
|
|
|
|
//资源详细页
|
|
|
function loadResDetailInfo(parentNode, data, node, options) {
|
|
|
var resId = data.id;
|
|
|
var resType = data.pid;
|
|
|
renderDetail(resId, resType);
|
|
|
}
|
|
|
|
|
|
//子节点统计
|
|
|
function loadChildResTypeCount(parentNode, data, node, options) {
|
|
|
var resId = data.id;
|
|
|
for (var i = 0; i < parentNode.length; i++) {
|
|
|
if (parentNode.id == data.id) {
|
|
|
resId = '';
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
renderIndex(resId);
|
|
|
}
|
|
|
|
|
|
//资源视图列表
|
|
|
function openResourceView(parentNode, data, node, options) {
|
|
|
renderList(data.id);
|
|
|
}
|
|
|
//资源视图父级列表
|
|
|
function openParentResourceView(parentNode, data, node, options) {
|
|
|
renderParentList(data.id);
|
|
|
}
|
|
|
|
|
|
//加载虚拟化数据(平台、资源池、物理机、虚拟机)
|
|
|
function loadVirtualizationView(parentNode, data, node, options) {
|
|
|
$('#res_coll_protocol_select_div').show();
|
|
|
//绑定业务
|
|
|
// common.bizTypeSelect("treetableBizTypes", function () {
|
|
|
// form.render("select");
|
|
|
// });
|
|
|
//$('#treetableBizTypes').val('');
|
|
|
//绑定采集协议
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/protocol/page',
|
|
|
data: {
|
|
|
access_token: accessToken,
|
|
|
startTime: '',
|
|
|
endTime: '',
|
|
|
keyword: '',
|
|
|
hasParam: '',
|
|
|
limit: -1
|
|
|
}
|
|
|
}).done(function (res) {
|
|
|
xmSelect.render({
|
|
|
el: '#collProtocolSelect'
|
|
|
, filterable: true
|
|
|
, tips: '=采集协议='
|
|
|
, name: 'collProtocols'
|
|
|
, prop: {
|
|
|
name: 'protocolName',
|
|
|
value: 'protocolCode',
|
|
|
}
|
|
|
, model: {
|
|
|
label: {
|
|
|
type: 'block',
|
|
|
block: {
|
|
|
//最大显示数量, 0:不限制
|
|
|
showCount: 1,
|
|
|
//是否显示删除图标
|
|
|
showIcon: true,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
, data: res.data
|
|
|
,hide: function () {
|
|
|
var selectValue = xmSelect.get('#collProtocolSelect', true).getValue('value');
|
|
|
collProtocols = selectValue.join(',');
|
|
|
form.render()
|
|
|
reloadTable();
|
|
|
if (collProtocols) {
|
|
|
xmSelect.get('#collProtocolSelect', true).setValue([]);
|
|
|
collProtocols='';
|
|
|
form.render();
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
//绑定业务下拉选择数据
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/home/business/findAllBusType',
|
|
|
success: function (response) {
|
|
|
if (response && response.success) {
|
|
|
busTypeList = response.data;
|
|
|
var bizList = response.data.map(item => {
|
|
|
return {
|
|
|
name: item.busTypeName,
|
|
|
value: item.busId,
|
|
|
parentId: item.parentId
|
|
|
}
|
|
|
});
|
|
|
var bizTree=common.pidToChildren(bizList, 'value', 'parentId');
|
|
|
|
|
|
// 影响业务下拉框
|
|
|
busIdSelect = xmSelect.render({
|
|
|
el: '#treetableBizTypes',
|
|
|
name: 'bizId',
|
|
|
tips: '=所属业务=',
|
|
|
//开启搜索
|
|
|
filterable: true,
|
|
|
initValue: [bizId.split(',')[0]],
|
|
|
toolbar: {
|
|
|
show: true,
|
|
|
list: ['ALL', 'REVERSE', 'CLEAR']
|
|
|
},
|
|
|
height: '400px',
|
|
|
tree: {
|
|
|
show: true,
|
|
|
showFolderIcon: true,
|
|
|
showLine: true,
|
|
|
strict: true,
|
|
|
//间距
|
|
|
indent: 20,
|
|
|
},
|
|
|
data: bizTree,
|
|
|
on: function (data) {
|
|
|
if (data.arr.length != 0) {
|
|
|
var str='';
|
|
|
$.each(data.arr,function (i,v) {
|
|
|
str+=v.value+',';
|
|
|
})
|
|
|
bizId = str.substring(0,str.length-1);
|
|
|
} else {
|
|
|
bizId = '';
|
|
|
}
|
|
|
form.render();
|
|
|
renderTreeTable(curTreeNode.data.id)
|
|
|
}
|
|
|
});
|
|
|
if(busIdSelect){
|
|
|
//追加样式
|
|
|
$('#treetableBizTypes').find('.xm-body').eq(0).css("width","230px");
|
|
|
}
|
|
|
} else {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function () {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
if (data.id != 'VIRTUALIZATION_VMWARE' && data.id != 'VIRTUALIZATION_HUAWEI') {
|
|
|
$("#virtual_platform_div_id").show();
|
|
|
//绑定虚拟化平台
|
|
|
common.virtualPlatFormSelect("virtual_platForm_select", "", function () {
|
|
|
form.render("select");
|
|
|
}, data.id.match(/(VIRTUALIZATION_((?!_).)+)(.*)/)[1]);
|
|
|
$('#virtual_platForm_select').val('');
|
|
|
}
|
|
|
//初始化业务下拉数据
|
|
|
if (busIdSelect) {
|
|
|
busIdSelect.setValue([]);
|
|
|
bizId='';
|
|
|
form.render();
|
|
|
}
|
|
|
renderTreeTable(data.id);
|
|
|
}
|
|
|
|
|
|
//加载weblogic
|
|
|
function loadWeblogicView(parentNode, data, node, options) {
|
|
|
// //绑定业务
|
|
|
//common.bizTypeSelect("treetableBizTypes", function () {
|
|
|
// form.render("select");
|
|
|
// });
|
|
|
// $('#treetableBizTypes').val('');
|
|
|
//绑定业务下拉选择数据
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/home/business/findAllBusType',
|
|
|
success: function (response) {
|
|
|
if (response && response.success) {
|
|
|
busTypeList = response.data;
|
|
|
var bizList = response.data.map(item => {
|
|
|
return {
|
|
|
name: item.busTypeName,
|
|
|
value: item.busId,
|
|
|
parentId: item.parentId
|
|
|
}
|
|
|
});
|
|
|
var bizTree=common.pidToChildren(bizList, 'value', 'parentId');
|
|
|
|
|
|
// 影响业务下拉框
|
|
|
busIdSelect = xmSelect.render({
|
|
|
el: '#treetableBizTypes',
|
|
|
name: 'bizId',
|
|
|
tips: '=所属业务=',
|
|
|
//开启搜索
|
|
|
filterable: true,
|
|
|
|
|
|
initValue: [bizId.split(',')[0]],
|
|
|
toolbar: {
|
|
|
show: true,
|
|
|
list: ['ALL', 'REVERSE', 'CLEAR']
|
|
|
},
|
|
|
height: '400px',
|
|
|
tree: {
|
|
|
show: true,
|
|
|
showFolderIcon: true,
|
|
|
showLine: true,
|
|
|
strict: true,
|
|
|
//间距
|
|
|
indent: 20,
|
|
|
},
|
|
|
data: bizTree,
|
|
|
on: function (data) {
|
|
|
if (data.arr.length != 0) {
|
|
|
var str='';
|
|
|
$.each(data.arr,function (i,v) {
|
|
|
str+=v.value+',';
|
|
|
})
|
|
|
bizId = str.substring(0,str.length-1);
|
|
|
} else {
|
|
|
bizId = '';
|
|
|
}
|
|
|
form.render();
|
|
|
renderTreeTable(curTreeNode.data.id);
|
|
|
}
|
|
|
});
|
|
|
if(busIdSelect){
|
|
|
//追加样式
|
|
|
$('#treetableBizTypes').find('.xm-body').eq(0).css("width","230px");
|
|
|
}
|
|
|
} else {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function () {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
renderParentList(data.id);
|
|
|
}
|
|
|
|
|
|
// //业务选择事件
|
|
|
// form.on('select(resListBizTypes)', function (data) {
|
|
|
// // renderList(currentResType);
|
|
|
// reloadTable();
|
|
|
// });
|
|
|
//绑定业务下拉选择数据
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/home/business/findAllBusType',
|
|
|
success: function (response) {
|
|
|
if (response && response.success) {
|
|
|
busTypeList = response.data;
|
|
|
var bizList = response.data.map(item => {
|
|
|
return {
|
|
|
name: item.busTypeName,
|
|
|
value: item.busId,
|
|
|
parentId: item.parentId
|
|
|
}
|
|
|
});
|
|
|
var bizTree=common.pidToChildren(bizList, 'value', 'parentId');
|
|
|
|
|
|
// 影响业务下拉框
|
|
|
busIdSelect = xmSelect.render({
|
|
|
el: '#resListBizTypes',
|
|
|
name: 'bizId',
|
|
|
tips: '=所属业务=',
|
|
|
//开启搜索
|
|
|
filterable: true,
|
|
|
|
|
|
initValue: [bizId.split(',')[0]],
|
|
|
toolbar: {
|
|
|
show: true,
|
|
|
list: ['ALL', 'REVERSE', 'CLEAR']
|
|
|
},
|
|
|
height: '400px',
|
|
|
tree: {
|
|
|
show: true,
|
|
|
showFolderIcon: true,
|
|
|
showLine: true,
|
|
|
strict: true,
|
|
|
//间距
|
|
|
indent: 20,
|
|
|
},
|
|
|
data: bizTree,
|
|
|
on: function (data) {
|
|
|
if (data.arr.length != 0) {
|
|
|
var str='';
|
|
|
$.each(data.arr,function (i,v) {
|
|
|
str+=v.value+',';
|
|
|
})
|
|
|
bizId = str.substring(0,str.length-1);
|
|
|
} else {
|
|
|
bizId = '';
|
|
|
}
|
|
|
form.render();
|
|
|
reloadTable();
|
|
|
}
|
|
|
});
|
|
|
if(busIdSelect){
|
|
|
//追加样式
|
|
|
$('#resListBizTypes').find('.xm-body').eq(0).css("width","230px");
|
|
|
}
|
|
|
} else {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function () {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
//连接状态
|
|
|
form.on('select(link_state)', function (data) {
|
|
|
// renderList(currentResType);
|
|
|
reloadTable();
|
|
|
});
|
|
|
//集群选择事件
|
|
|
form.on('select(res_cluster)', function (data) {
|
|
|
// renderList(currentResType); new
|
|
|
reloadTable();
|
|
|
});
|
|
|
//资源池选择事件
|
|
|
form.on('select(res_colony)', function (data) {
|
|
|
// renderList(currentResType); new
|
|
|
reloadTable();
|
|
|
});
|
|
|
|
|
|
//资源状态
|
|
|
form.on('select(resStatus)', function (data) {
|
|
|
// renderList(currentResType);
|
|
|
reloadTable();
|
|
|
});
|
|
|
//资源连接状态
|
|
|
form.on('select(state)', function (data) {
|
|
|
reloadTable();
|
|
|
});
|
|
|
//资源池选择事件
|
|
|
form.on('select(res_platform)', function (data) {
|
|
|
// renderList(currentResType);
|
|
|
reloadTable();
|
|
|
});
|
|
|
//阿里云平台选择事件
|
|
|
form.on('select(aliyun_plantform)', function (data) {
|
|
|
// renderList(currentResType);
|
|
|
reloadTable();
|
|
|
});
|
|
|
//厂商选择事件
|
|
|
form.on('select(res_vendor)', function (data) {
|
|
|
// renderList(currentResType);
|
|
|
reloadTable();
|
|
|
});
|
|
|
//小型服务器选择事件
|
|
|
form.on('select(res_minicomputer)', function (data) {
|
|
|
reloadTable();
|
|
|
});
|
|
|
//资源池选择事件
|
|
|
form.on('select(sub_restype)', function (data) {
|
|
|
if(data.value){
|
|
|
loadRightResTypeSelectEvent(data.value,"normal")
|
|
|
}else{
|
|
|
loadRightResTypeSelectEvent(currentResType,"normal")
|
|
|
}
|
|
|
// renderList(currentResType);
|
|
|
reloadTable();
|
|
|
});
|
|
|
//回车搜索
|
|
|
$('#resindex_keyword').keydown(function (e) {
|
|
|
if (e.keyCode === 13) {
|
|
|
// renderList(currentResType);
|
|
|
reloadTable();
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//资源详细信息
|
|
|
function renderDetail(resId, resType) {
|
|
|
$('#resIndexContent').hide();
|
|
|
$('#resListContent').hide();
|
|
|
$('#resDetailContent').show();
|
|
|
$('#treeTableContent').hide();
|
|
|
var url = common.detailPath(resType,resId);
|
|
|
view('commonViewModel').render(url).then(function (res) {
|
|
|
var params = {
|
|
|
"resId": resId,
|
|
|
"resType": resType
|
|
|
};
|
|
|
laytpl(res.body).render(JSON.stringify(params), function (html) {
|
|
|
$("#resDetailContent").html(html);
|
|
|
});
|
|
|
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//树表格
|
|
|
function renderTreeTable(resType) {
|
|
|
$('#resIndexContent').hide();
|
|
|
$('#resListContent').hide();
|
|
|
$('#resDetailContent').empty();
|
|
|
$('#resDetailContent').hide();
|
|
|
$('#treeTableContent').show();
|
|
|
$(".top-head-info").removeClass("hide");
|
|
|
if("MIDDLEWARE_WEBLOGIC" == resType){
|
|
|
$("#res_platform_id").hide()
|
|
|
}
|
|
|
if(resType.indexOf("VIRTUALIZATION") >-1){
|
|
|
$("#tree_linkstate_area").hide()
|
|
|
}
|
|
|
|
|
|
|
|
|
if (resType == 'VIRTUALIZATION_VMWARE' || resType == 'VIRTUALIZATION_HUAWEI' || resType == 'MIDDLEWARE_WEBLOGIC') {
|
|
|
$("#virtual_platform_div_id").hide();
|
|
|
}
|
|
|
|
|
|
var index = layer.load(2); //加载层
|
|
|
|
|
|
var cols = commonCols.resTypeCls[resType];
|
|
|
admin.req({
|
|
|
url: common.domainName + "/api-web/home/virtual-res-list/" + resType
|
|
|
, type: "get"
|
|
|
, data: {
|
|
|
ptId: $("#virtual_platForm_select").val(),
|
|
|
busId: bizId,
|
|
|
keyWords: $("#treetable_keyword").val(),
|
|
|
health: $("#treetable_resStatus").val(),
|
|
|
state: $("#treetable_res_state").val(),
|
|
|
resCategory: 'resources',
|
|
|
collProtocols : collProtocols
|
|
|
|
|
|
}
|
|
|
, done: function (res) {
|
|
|
layer.close(index);
|
|
|
if (res.code == 0) {
|
|
|
//渲染表格
|
|
|
var tableTreeVirtual;
|
|
|
//获取配置的列
|
|
|
common.getTableCols({
|
|
|
domId: 'tableTreeVirtual',
|
|
|
moduleId: 'resIndex',
|
|
|
resType: resType
|
|
|
},function (retCols) {
|
|
|
if (retCols) {
|
|
|
cols = retCols;
|
|
|
}
|
|
|
tableTreeVirtual = table.render({
|
|
|
elem: '#virtual_platform_treeTable',
|
|
|
autoColumnWidth: false,
|
|
|
page: false,
|
|
|
limit: 9999,
|
|
|
data: res.data,
|
|
|
tree: {
|
|
|
iconIndex: 1
|
|
|
},
|
|
|
cols: [cols]
|
|
|
, height: 'full-220',
|
|
|
done: function (res) {
|
|
|
soulTable.render(this);
|
|
|
|
|
|
//调用收藏方法
|
|
|
resFavorites();
|
|
|
resTopo();
|
|
|
|
|
|
common.treeTableDragCols('#virtual_platform_treeTable', '#resTreeList-top-head-info-tpl');
|
|
|
loadRightResTypeSelectEvent(curTreeNode.data.id,"tree")
|
|
|
// 保存列顺序
|
|
|
$('#virtual_platform_treeTable').next().find('.btn_save_cols').unbind('click').on('click', function (){
|
|
|
common.saveTableCols({
|
|
|
domId: 'tableTreeVirtual',
|
|
|
moduleId: 'resIndex',
|
|
|
resType: resType,
|
|
|
cols: tableTreeVirtual.config.cols
|
|
|
});
|
|
|
});
|
|
|
|
|
|
commonCols.colsClickEvent(editFlag);
|
|
|
}
|
|
|
});
|
|
|
/**
|
|
|
/**表格的增删改都会回调此方法
|
|
|
* 与table.on(tool(lay-filter))用法一致。
|
|
|
**/
|
|
|
/*tableTreeVirtual.on('tool(tableEvent)',function (obj) {
|
|
|
if(!obj.data.treeList){
|
|
|
var field = obj.field; //单元格字段
|
|
|
var value = obj.value; //修改后的值
|
|
|
var data = obj.data; //当前行数据
|
|
|
var event = obj.event; //当前单元格事件属性值
|
|
|
var subResType = '';
|
|
|
if(data.resType == 'VIRTUALIZATION_VMWARE' || data.resType == 'VIRTUALIZATION_HUAWEI'){
|
|
|
subResType = data.resType=='VIRTUALIZATION_VMWARE'?'VIRTUALIZATION_VMWARE_CLUSTER':'VIRTUALIZATION_HUAWEI_CLUSTER';
|
|
|
}else if(data.resType.indexOf('CLUSTER')>-1){
|
|
|
subResType = data.resType=='VIRTUALIZATION_VMWARE_CLUSTER'?'VIRTUALIZATION_VMWARE_PHYSICSHOST':'VIRTUALIZATION_HUAWEI_PHYSICSHOST';
|
|
|
}else if(data.resType.indexOf('PHYSICSHOST')>-1){
|
|
|
subResType = data.resType=='VIRTUALIZATION_VMWARE_PHYSICSHOST'?'VIRTUALIZATION_VMWARE_VHOST':'VIRTUALIZATION_HUAWEI_VHOST';
|
|
|
}else{
|
|
|
subResType = data.resType
|
|
|
}
|
|
|
if(event === 'loadChildren'){
|
|
|
$.ajax({
|
|
|
url: common.domainName + "/api-web/home/virtual-res-list/" + subResType
|
|
|
, type: "get"
|
|
|
, data: {
|
|
|
ptId: $("#virtual_platForm_select").val(),
|
|
|
health: $("#treetable_resStatus").val(),
|
|
|
busId: $("#treetableBizTypes").val(),
|
|
|
keyWords: $("#treetable_keyword").val(),
|
|
|
state: $("#treetable_state").val(),
|
|
|
access_token:accessToken,
|
|
|
parentId:data.resId
|
|
|
}
|
|
|
,success:function (res) {
|
|
|
if(res.data.length>0){
|
|
|
obj.loadChildren(res.data);
|
|
|
commonCols.colsClickEvent();
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
});*/
|
|
|
//统计总数
|
|
|
// $('#virtual_platform_treeTable').next().find('.layui-table-box').after(laytpl($('#treetable-countTpl').html()).render(res.data.length));
|
|
|
});
|
|
|
} else {
|
|
|
console.log(data.msg);
|
|
|
}
|
|
|
//关键字回车事件
|
|
|
$('#treetable_keyword').keydown(function (e) {
|
|
|
if (e.keyCode === 13) {
|
|
|
renderTreeTable(curTreeNode.data.id)
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
//选择资源状态
|
|
|
form.on('select(treetable_resStatus)', function (data) {
|
|
|
renderTreeTable(curTreeNode.data.id);
|
|
|
});
|
|
|
// //选择业务
|
|
|
// form.on('select(treetableBizTypes)', function (data) {
|
|
|
// renderTreeTable(curTreeNode.data.id);
|
|
|
// });
|
|
|
//选择平台
|
|
|
form.on('select(virtual_platForm_select)', function (data) {
|
|
|
renderTreeTable(curTreeNode.data.id);
|
|
|
});
|
|
|
//选择资源连接状态
|
|
|
form.on('select(treetable_state)', function (data) {
|
|
|
renderTreeTable(curTreeNode.data.id);
|
|
|
});
|
|
|
form.on('select(treetable_res_state)', function (data) {
|
|
|
renderTreeTable(curTreeNode.data.id);
|
|
|
});
|
|
|
|
|
|
commonCols.colsClickEvent(editFlag);
|
|
|
|
|
|
}
|
|
|
}).error(function () {
|
|
|
layer.close(index);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //绑定业务下拉选择数据
|
|
|
// common.bizTypeSelect("resListBizTypes", function () {
|
|
|
// form.render("select");
|
|
|
// });
|
|
|
//绑定业务下拉选择数据
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/home/business/findAllBusType',
|
|
|
success: function (response) {
|
|
|
if (response && response.success) {
|
|
|
busTypeList = response.data;
|
|
|
var bizList = response.data.map(item => {
|
|
|
return {
|
|
|
name: item.busTypeName,
|
|
|
value: item.busId,
|
|
|
parentId: item.parentId
|
|
|
}
|
|
|
});
|
|
|
var bizTree=common.pidToChildren(bizList, 'value', 'parentId');
|
|
|
|
|
|
// 影响业务下拉框
|
|
|
busIdSelect = xmSelect.render({
|
|
|
el: '#resListBizTypes',
|
|
|
name: 'bizId',
|
|
|
tips: '=所属业务=',
|
|
|
//开启搜索
|
|
|
filterable: true,
|
|
|
initValue: [bizId.split(',')[0]],
|
|
|
toolbar: {
|
|
|
show: true,
|
|
|
list: ['ALL', 'REVERSE', 'CLEAR']
|
|
|
},
|
|
|
height: '400px',
|
|
|
tree: {
|
|
|
show: true,
|
|
|
showFolderIcon: true,
|
|
|
showLine: true,
|
|
|
strict: true,
|
|
|
//间距
|
|
|
indent: 20,
|
|
|
},
|
|
|
data: bizTree,
|
|
|
on: function (data) {
|
|
|
if (data.arr.length != 0) {
|
|
|
var str='';
|
|
|
$.each(data.arr,function (i,v) {
|
|
|
str+=v.value+',';
|
|
|
})
|
|
|
bizId = str.substring(0,str.length-1);
|
|
|
} else {
|
|
|
bizId = '';
|
|
|
}
|
|
|
form.render();
|
|
|
reloadTable();
|
|
|
}
|
|
|
});
|
|
|
if(busIdSelect){
|
|
|
//追加样式
|
|
|
$('#resListBizTypes').find('.xm-body').eq(0).css("width","230px");
|
|
|
}
|
|
|
} else {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
},
|
|
|
error: function () {
|
|
|
layer.msg('获取业务失败', {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
form.render(null, 'res-list-form');
|
|
|
|
|
|
//父级资源列表
|
|
|
function renderParentList(resType) {
|
|
|
$('#resIndexContent').hide();
|
|
|
$('#resListContent').show();
|
|
|
$('#resDetailContent').empty();
|
|
|
$('#resDetailContent').hide();
|
|
|
$('#treeTableContent').hide();
|
|
|
//加载查询条件
|
|
|
renderSerach(resType,true);
|
|
|
|
|
|
// , {field: 'state', title: '连接状态', minWidth: 100, align: 'center', templet: '#resListContentTpl'}];
|
|
|
if (resType && resType != 'PASSWORD_SERVER' && !/VIRTUALIZATION_((?!_).)+_(PHYSICSHOST|VHOST)/.test(resType)){
|
|
|
$('#link_state_div').show();
|
|
|
$('#host_state_div').hide();
|
|
|
$('#power_state_div').hide();
|
|
|
} else if(/VIRTUALIZATION_((?!_).)+_PHYSICSHOST/.test(resType)){
|
|
|
$('#link_state_div').hide();
|
|
|
$('#host_state_div').show();
|
|
|
$('#power_state_div').hide();
|
|
|
} else if(/VIRTUALIZATION_((?!_).)+_VHOST/.test(resType)){
|
|
|
$('#link_state_div').hide();
|
|
|
$('#host_state_div').hide();
|
|
|
$('#power_state_div').show();
|
|
|
}
|
|
|
//渲染表格
|
|
|
var cols = commonCols.resTypeCls[resType];
|
|
|
//获取配置的列
|
|
|
common.getTableCols({
|
|
|
domId: 'parentResListTable',
|
|
|
moduleId: 'resIndex',
|
|
|
resType: resType
|
|
|
},function (retCols) {
|
|
|
if(retCols){
|
|
|
cols = retCols;
|
|
|
}
|
|
|
|
|
|
parentResListTable = table.render({
|
|
|
elem: '#resListTable'
|
|
|
, id: 'resListTable'
|
|
|
, toolbar: '#resList-top-head-info-tpl' //开启头部工具栏,并为其绑定左侧模板
|
|
|
, defaultToolbar: ['filter']
|
|
|
, drag: {toolbar: false}
|
|
|
, url: common.domainName + '/api-web/home/res-list/' + resType
|
|
|
, where: {
|
|
|
access_token: accessToken,
|
|
|
resName: $("#resindex_keyword").val(),
|
|
|
busId: bizId,
|
|
|
resHealth: $("#resStatus").val(),
|
|
|
colonlyId: $("#res_colony").val(),
|
|
|
parentId: $("#res_cluster").val(),
|
|
|
sortKey: sortKey,
|
|
|
state: $("#state").val(),
|
|
|
linkState: $("#link_state").val(),
|
|
|
hostState: $("#host_state").val(),
|
|
|
powerState: $("#power_state").val(),
|
|
|
resCategory: 'resources'
|
|
|
}
|
|
|
, height: 'full-165'
|
|
|
, cellMinWidth: 80
|
|
|
, page: {
|
|
|
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
|
|
|
, theme: '#1E9FFF'
|
|
|
}
|
|
|
, autoSort: false
|
|
|
, limit: 150
|
|
|
, limits: [150, 200, 300]
|
|
|
, cols: [cols]
|
|
|
, done: function (res, curr, count) {
|
|
|
//更改样式
|
|
|
function noClick($that) {
|
|
|
$that.css("color", "#666");
|
|
|
$that.css("text-decoration", "none");
|
|
|
$that.attr("lay-tips", "未监控到数据");
|
|
|
}
|
|
|
|
|
|
// 共享设备,厂商是H3C、HDS的设备不让点击并且提示暂无监控信息
|
|
|
var $hsc_ = $('span[data-restype="STORAGE_SHARE"][data-provider="H3C"]');
|
|
|
$.each($hsc_, function (i, v) {
|
|
|
noClick($(this));
|
|
|
});
|
|
|
var $hds = $('span[data-restype="STORAGE_SHARE"][data-provider="HDS"]');
|
|
|
$.each($hds, function (i, v) {
|
|
|
noClick($(this));
|
|
|
});
|
|
|
//华为云,阿里云不让点击,并且提示暂无监控信息
|
|
|
// var $hds = $('span[data-restype="HUAWEI_CLOUD_PLAT"]');
|
|
|
// $.each($hds, function (i, v) {
|
|
|
// noClick($(this));
|
|
|
// });
|
|
|
// var $hds = $('span[data-restype="ALI_CLOUD_PLAT"]');
|
|
|
// $.each($hds, function (i, v) {
|
|
|
// noClick($(this));
|
|
|
// });
|
|
|
|
|
|
soulTable.render(this)
|
|
|
|
|
|
//调用收藏方法
|
|
|
resFavorites();
|
|
|
resTopo();
|
|
|
|
|
|
commonCols.colsClickEvent(editFlag);
|
|
|
|
|
|
//表格排序监听 joke add 20200408
|
|
|
table.on('sort(resListTable)', function (obj) {
|
|
|
//有些时候,你可能需要根据当前排序的字段,重新向服务端发送请求,从而实现服务端排序,如:
|
|
|
if (obj.type != null) {
|
|
|
if (obj.field == 'ip') {
|
|
|
sortKey = 'INET_ATON(' + obj.field + ') ' + obj.type;
|
|
|
} else {
|
|
|
sortKey = obj.field + ' ' + obj.type;
|
|
|
}
|
|
|
} else {
|
|
|
sortKey = '';
|
|
|
}
|
|
|
reloadTable();
|
|
|
})
|
|
|
|
|
|
|
|
|
//触发拖动列事件,参数为保存按钮的id
|
|
|
common.dragCols("parentResIndex_cols_save");
|
|
|
|
|
|
//保存列顺序
|
|
|
$("#parentResIndex_cols_save").unbind("click").on("click", function () {
|
|
|
var params = {
|
|
|
domId: 'parentResListTable',
|
|
|
moduleId: 'resIndex',
|
|
|
resType: resType,
|
|
|
cols: parentResListTable.config.cols
|
|
|
}
|
|
|
common.saveTableCols(params);
|
|
|
});
|
|
|
// 渲染统计数据
|
|
|
loadRightResTypeSelectEvent(resType,"normal");
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//资源列表
|
|
|
function renderList(resType,id) {
|
|
|
$('#resIndexContent').hide();
|
|
|
$('#resListContent').show();
|
|
|
$('#resDetailContent').empty();
|
|
|
$('#resDetailContent').hide();
|
|
|
$('#treeTableContent').hide();
|
|
|
//加载查询条件
|
|
|
renderSerach(resType);
|
|
|
|
|
|
// , {field: 'state', title: '连接状态', minWidth: 100, align: 'center', templet: '#resListContentTpl'}];
|
|
|
if (resType && resType != 'PASSWORD_SERVER' && !/VIRTUALIZATION_((?!_).)+_(PHYSICSHOST|VHOST)/.test(resType)){
|
|
|
$('#link_state_div').show();
|
|
|
$('#host_state_div').hide();
|
|
|
$('#power_state_div').hide();
|
|
|
} else if(/VIRTUALIZATION_((?!_).)+_PHYSICSHOST/.test(resType)){
|
|
|
$('#link_state_div').hide();
|
|
|
$('#host_state_div').show();
|
|
|
$('#power_state_div').hide();
|
|
|
} else if(/VIRTUALIZATION_((?!_).)+_VHOST/.test(resType)){
|
|
|
$('#link_state_div').hide();
|
|
|
$('#host_state_div').hide();
|
|
|
$('#power_state_div').show();
|
|
|
}
|
|
|
var cols = commonCols.resTypeCls[resType];
|
|
|
//获取配置的列
|
|
|
common.getTableCols({
|
|
|
domId: 'resListTable',
|
|
|
moduleId: 'resIndex',
|
|
|
resType: resType
|
|
|
},function (retCols) {
|
|
|
if (retCols) {
|
|
|
cols = retCols;
|
|
|
}
|
|
|
resListTable = table.render({
|
|
|
elem: '#resListTable'
|
|
|
, id: 'resListTable'
|
|
|
, toolbar: '<div><button id="resIndex_cols_save" class="layui-btn layui-btn-primary layui-btn-xs toolbar-btn" lay-tips="保存列顺序"><i class="iconfont"></i></button></div>' //开启头部工具栏,并为其绑定左侧模板
|
|
|
, defaultToolbar: ['filter']
|
|
|
, drag: {toolbar: false}
|
|
|
, url: common.domainName + '/api-web/home/res-list/' + resType
|
|
|
, where: {
|
|
|
access_token: accessToken,
|
|
|
resName: $("#resindex_keyword").val() !== '' ? $("#resindex_keyword").val() : id,
|
|
|
busId: bizId,
|
|
|
resHealth: $("#resStatus").val(),
|
|
|
colonlyId: $("#res_colony").val(),
|
|
|
parentId: $("#res_cluster").val(),
|
|
|
sortKey: sortKey,
|
|
|
state: $("#state").val(),
|
|
|
linkState: $("#link_state").val(),
|
|
|
hostState: $("#host_state").val(),
|
|
|
powerState: $("#power_state").val(),
|
|
|
provider: $("#res_vendor").val(),
|
|
|
resCategory: 'resources'
|
|
|
}
|
|
|
, height: 'full-165'
|
|
|
, cellMinWidth: 80
|
|
|
, page: {
|
|
|
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
|
|
|
, theme: '#1E9FFF'
|
|
|
}
|
|
|
, autoSort: false
|
|
|
, limit: 150
|
|
|
, limits: [150, 200, 300]
|
|
|
, cols: [cols]
|
|
|
, done: function (res, curr, count) {
|
|
|
soulTable.render(this)
|
|
|
|
|
|
//调用收藏方法
|
|
|
resFavorites();
|
|
|
resTopo();
|
|
|
|
|
|
commonCols.colsClickEvent(editFlag);
|
|
|
|
|
|
//表格排序监听 joke add 20200408
|
|
|
table.on('sort(resListTable)', function (obj) {
|
|
|
//有些时候,你可能需要根据当前排序的字段,重新向服务端发送请求,从而实现服务端排序,如:
|
|
|
if (obj.type != null) {
|
|
|
sortKey = obj.field + ' ' + obj.type;
|
|
|
} else {
|
|
|
sortKey = '';
|
|
|
}
|
|
|
reloadTable();
|
|
|
})
|
|
|
|
|
|
//触发拖动列事件,参数为保存按钮的id
|
|
|
common.dragCols("resIndex_cols_save");
|
|
|
|
|
|
//保存列顺序
|
|
|
$("#resIndex_cols_save").unbind("click").on("click", function () {
|
|
|
var params = {
|
|
|
domId: 'resListTable',
|
|
|
moduleId: 'resIndex',
|
|
|
resType: resType,
|
|
|
cols: resListTable.config.cols
|
|
|
}
|
|
|
common.saveTableCols(params);
|
|
|
$(this).addClass("hide");
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getResCount(resType) {
|
|
|
admin.req({
|
|
|
url: common.domainName + "/api-web/home/res-list/count/" + resType
|
|
|
, type: "get"
|
|
|
, done: function (data) {
|
|
|
var rest = data.map;
|
|
|
if (data.code === 0) {
|
|
|
$("#resGoodCount").text("优:" + rest.good);
|
|
|
$("#resWorseCount").text("良:" + rest.worse);
|
|
|
$("#resWorstCount").text("中:" + rest.worst);
|
|
|
} else {
|
|
|
console.log(data.msg);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//加载资源池、集群等查询条件
|
|
|
function renderSerach(resType,subflag) {
|
|
|
//清空查询条件 joke add 20200409 开始
|
|
|
$('#resindex_keyword').val('');
|
|
|
$('#resStatus').val('');
|
|
|
// $('#resListBizTypes').val('');
|
|
|
if(xmSelect.get("#resListBizTypes") && xmSelect.get("#resListBizTypes")[0]){
|
|
|
xmSelect.get("#resListBizTypes")[0].setValue([]);
|
|
|
}
|
|
|
$("#aliyun_plantform").val('');
|
|
|
$('#res_colony').val('');
|
|
|
$('#res_cluster').val('');
|
|
|
$('#state').val('');
|
|
|
$('#link_state').val('');
|
|
|
|
|
|
//虚拟化查询条件清空
|
|
|
$("#virtual_platForm_select").val('');
|
|
|
$("#treetable_resStatus").val('');
|
|
|
//$("#treetableBizTypes").val('');
|
|
|
if(xmSelect.get("#treetableBizTypes") && xmSelect.get("#treetableBizTypes")[0]){
|
|
|
xmSelect.get("#treetableBizTypes")[0].setValue([]);
|
|
|
}
|
|
|
// if(xmSelect.get("#collProtocolSelect") && xmSelect.get("#collProtocolSelect")[0]){
|
|
|
// xmSelect.get("#collProtocolSelect")[0].setValue([]);
|
|
|
// }
|
|
|
|
|
|
$("#treetable_keyword").val('');
|
|
|
$("#treetable_state").val('');
|
|
|
$("#host_state").val('');
|
|
|
$("#power_state").val('');
|
|
|
|
|
|
if(busIdSelect){
|
|
|
busIdSelect.setValue([]);
|
|
|
bizId = '';
|
|
|
}
|
|
|
form.render('select');
|
|
|
form.render();
|
|
|
//清空查询条件 joke add 20200409 结束
|
|
|
|
|
|
var targetId = '';
|
|
|
var searchType = "";
|
|
|
var optons = "";
|
|
|
//阿里云显示平台
|
|
|
if(/ALI_CLOUD/.test(resType)){
|
|
|
$("#aliyun_plantform").parent().parent().removeClass("hide");
|
|
|
form.render("select");
|
|
|
}else{
|
|
|
$("#aliyun_plantform").parent().parent().addClass("hide");
|
|
|
}
|
|
|
//华为云物理机,加载华为云集群查询条件
|
|
|
if (resType == 'HUAWEI_CLOUD_PHYSICSHOST') {
|
|
|
optons = "<option value=''>=所属集群=</option>"
|
|
|
searchType = "HUAWEI_CLOUD_CLUSTER";
|
|
|
targetId = "res_cluster";
|
|
|
$("#res_cluster_id").show();
|
|
|
} else if ("MIDDLEWARE_WEBLOGIC" == resType) {
|
|
|
optons = "<option value=''>=所属控制台=</option>"
|
|
|
searchType = "MIDDLEWARE_WEBLOGIC";
|
|
|
targetId = 'res_cluster'
|
|
|
$("#res_cluster_id").show();
|
|
|
} else {
|
|
|
$("#res_cluster_id").hide();
|
|
|
}
|
|
|
//vmware虚拟机 joke add 20200528
|
|
|
if (/VIRTUALIZATION_((?!_).)+_(PHYSICSHOST|VHOST)/.test(resType)) {
|
|
|
$("#res_platform_id").show();
|
|
|
//绑定虚拟化平台
|
|
|
common.virtualPlatFormSelect("res_platform", "", function () {
|
|
|
form.render("select");
|
|
|
}, resType.match(/(VIRTUALIZATION_((?!_).)+)_(PHYSICSHOST|VHOST)/)[1]);
|
|
|
} else {
|
|
|
$("#res_platform_id").hide();
|
|
|
}
|
|
|
//华为云的集群、虚拟化物理机、虚拟机,查询条件绑定资源池
|
|
|
if (resType == 'HUAWEI_CLOUD_CLUSTER' || /VIRTUALIZATION_((?!_).)+_(PHYSICSHOST|VHOST)/.test(resType)) {
|
|
|
optons = "<option value=''>=所属资源池=</option>"
|
|
|
if (/VIRTUALIZATION_((?!_).)+_(PHYSICSHOST|VHOST)/.test(resType)) {
|
|
|
searchType = "VIRTUALIZATION_" + resType.match(/VIRTUALIZATION_(((?!_).)+)_(PHYSICSHOST|VHOST)/)[1] + "_CLUSTER";
|
|
|
}
|
|
|
if (resType == 'HUAWEI_CLOUD_CLUSTER') {
|
|
|
searchType = "HUAWEI_CLOUD_COLONY";
|
|
|
}
|
|
|
targetId = "res_colony";
|
|
|
$("#res_colony_id").show();
|
|
|
} else {
|
|
|
$("#res_colony_id").hide();
|
|
|
}
|
|
|
if ("MIDDLEWARE_WEBLOGIC" == resType) {
|
|
|
$("#res_platform_id").hide()
|
|
|
}
|
|
|
|
|
|
if (resType == 'VIRTUALIZATION_VMWARE' || resType == 'VIRTUALIZATION_HUAWEI' || resType == 'MIDDLEWARE_WEBLOGIC') {
|
|
|
$("#virtual_platform_div_id").hide();
|
|
|
}
|
|
|
|
|
|
if (resType == 'HOST_BMC') {
|
|
|
$("#res_vendor").parent().parent().removeClass("hide");
|
|
|
var providerStr = '';
|
|
|
$.ajax({
|
|
|
url: `${common.domainName}/api-web/manage/ddic/findSucDdics/provider?access_token=${accessToken}`,
|
|
|
method: 'POST',
|
|
|
success: function (res) {
|
|
|
if (res && res.data) {
|
|
|
var ddiclist = res.data;
|
|
|
$.each(ddiclist, function (i, v) {
|
|
|
providerStr += '<option value="' + v.ddicCode + '">' + v.ddicName + '</option>';
|
|
|
});
|
|
|
$("#res_vendor").append(providerStr)
|
|
|
form.render("select");
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
$("#res_vendor").parent().parent().addClass("hide");
|
|
|
}
|
|
|
if(/HUAWEI_CLOUD_VIRTUALHOST/.test(resType) || /ALI_CLOUD_ECS/.test(resType) || /VIRTUALIZATION_VMWARE_VHOST/.test(resType)){
|
|
|
//绑定采集协议
|
|
|
admin.req({
|
|
|
url: domainName + '/api-web/manage/protocol/page',
|
|
|
data: {
|
|
|
access_token: accessToken,
|
|
|
startTime: '',
|
|
|
endTime: '',
|
|
|
keyword: '',
|
|
|
hasParam: '',
|
|
|
limit: -1
|
|
|
}
|
|
|
}).done(function (res) {
|
|
|
$('#res_coll_protocol_select_div').show();
|
|
|
xmSelect.render({
|
|
|
el: '#collProtocolSelect'
|
|
|
, filterable: true
|
|
|
, tips: '=采集协议='
|
|
|
, name: 'collProtocols'
|
|
|
, prop: {
|
|
|
name: 'protocolName',
|
|
|
value: 'protocolCode',
|
|
|
}
|
|
|
, model: {
|
|
|
label: {
|
|
|
type: 'block',
|
|
|
block: {
|
|
|
//最大显示数量, 0:不限制
|
|
|
showCount: 1,
|
|
|
//是否显示删除图标
|
|
|
showIcon: true,
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
, data: res.data
|
|
|
, hide: function () {
|
|
|
var selectValue = xmSelect.get('#collProtocolSelect', true).getValue('value');
|
|
|
collProtocols = selectValue.join(',');
|
|
|
form.render()
|
|
|
reloadTable();
|
|
|
if (collProtocols) {
|
|
|
xmSelect.get('#collProtocolSelect', true).setValue([]);
|
|
|
collProtocols = '';
|
|
|
form.render();
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
}else{
|
|
|
$('#res_coll_protocol_select_div').hide();
|
|
|
}
|
|
|
if (resType === 'HOST_MINICOMPUTER_PARTITION') {
|
|
|
$("#res_minicomputer").parent().parent().removeClass("hide");
|
|
|
var minicomputerStr = '';
|
|
|
minicomputerStr = '<option value="">=小型机服务器=</option>';
|
|
|
let url = `${common.domainName}/api-web/home/res-list/hostMinicomputerPartitionParents?access_token=${accessToken}`
|
|
|
$.ajax({
|
|
|
url: url,
|
|
|
method: 'get',
|
|
|
success: function (res) {
|
|
|
if (res && res.data) {
|
|
|
var list = res.data;
|
|
|
$.each(list, function (i, v) {
|
|
|
minicomputerStr += '<option value="' + v.resId + '">' + v.resName + '</option>';
|
|
|
});
|
|
|
$("#res_minicomputer").empty();
|
|
|
$("#res_minicomputer").append(minicomputerStr)
|
|
|
form.render("select");
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
$("#res_minicomputer").parent().parent().addClass("hide");
|
|
|
}
|
|
|
|
|
|
if (targetId && searchType) {
|
|
|
var url = "/api-web/home/res-list/" + searchType + "?page=1&limit=50";
|
|
|
if(searchType == 'MIDDLEWARE_WEBLOGIC'){
|
|
|
url += '&parentId=null&parentType=parent'
|
|
|
}
|
|
|
admin.req({
|
|
|
url: common.domainName + url
|
|
|
}).done(function (res) {
|
|
|
if (res.data) {
|
|
|
$.each(res.data, function (i, v) {
|
|
|
optons += '<option value="' + v.resId + '">' + v.resName + '</option>';
|
|
|
});
|
|
|
}
|
|
|
$('#' + targetId).html(optons);
|
|
|
form.render("select");
|
|
|
})
|
|
|
}
|
|
|
|
|
|
if(subflag && !resTypeSelectExclude.includes(resType)){
|
|
|
if(/ALI_CLOUD_/.test(resType) || /HUAWEI_CLOUD_/.test(resType)) {
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
$("#res_sub_restype").parent().parent().removeClass("hide");
|
|
|
$(".top-head-info").removeClass("hide");
|
|
|
|
|
|
var url = `${common.domainName}/api-web/bResource/finsResTypeListByParentId?resType=${resType}`
|
|
|
admin.req({
|
|
|
url: url
|
|
|
}).done(function (res) {
|
|
|
var subhtml = '<option value="">=资源类型=</option>';
|
|
|
if (res.data) {
|
|
|
$.each(res.data, function (i, v) {
|
|
|
subhtml += '<option value="' + v.name + '">' + v.val + '</option>';
|
|
|
});
|
|
|
}
|
|
|
$('#res_sub_restype').html(subhtml);
|
|
|
form.render("select");
|
|
|
})
|
|
|
}else{
|
|
|
if(!$("#resListContent").find(".top-head-info").hasClass("hide")){
|
|
|
$("#resListContent").find(".top-head-info").addClass("hide")
|
|
|
}
|
|
|
if(!$("#res_sub_restype").parent().parent().hasClass("hide")){
|
|
|
$("#res_sub_restype").parent().parent().addClass("hide");
|
|
|
}
|
|
|
}
|
|
|
form.render();
|
|
|
}
|
|
|
//加载右侧资源类型下拉框
|
|
|
function loadRightResTypeSelectEvent(resType,type) {
|
|
|
layer.closeAll('tips');
|
|
|
var counturl = `${common.domainName}/api-web/bResource/resCountInfomation?resType=${resType}`
|
|
|
admin.req({
|
|
|
url: counturl,
|
|
|
data:{
|
|
|
access_token: accessToken,
|
|
|
subResType:$("#res_sub_restype").val(),
|
|
|
resCategory: 'resources',
|
|
|
resName: $("#resindex_keyword").val(),
|
|
|
busId: bizId,
|
|
|
health: $("#resStatus").val(),
|
|
|
colonlyId: $("#res_colony").val(),
|
|
|
parentId: $("#res_cluster").val() ? $("#res_cluster").val() : $('#res_minicomputer').val(),
|
|
|
state: $("#state").val(),
|
|
|
linkState: $("#link_state").val(),
|
|
|
hostState: $("#host_state").val(),
|
|
|
powerState: $("#power_state").val(),
|
|
|
ptId: $("#res_platform").val(),
|
|
|
provider: $("#res_vendor").val()
|
|
|
}
|
|
|
}).done(function (res) {
|
|
|
var str = '';
|
|
|
var domStr = 'resListContent'
|
|
|
var fun = reloadTable;
|
|
|
if(type == 'tree'){
|
|
|
str = 'tree_'
|
|
|
domStr = 'treeTableContent'
|
|
|
fun = renderTreeTable
|
|
|
}
|
|
|
var map = res.object;
|
|
|
$.each(map,function(key,values){
|
|
|
$("#"+str+key+"_res").html(map[key])
|
|
|
});
|
|
|
$("#"+domStr).find(".info-box-count .num span").unbind().on("click",function () {
|
|
|
var val = $(this).data("value"),target =$(this).data("target");
|
|
|
if(val && target){
|
|
|
$("#"+target).val(val);
|
|
|
form.render("select");
|
|
|
fun(resType);
|
|
|
}else{
|
|
|
$('#resindex_keyword').val('');
|
|
|
$('#resStatus').val('');
|
|
|
// $('#resListBizTypes').val('');
|
|
|
$('#res_colony').val('');
|
|
|
$('#res_cluster').val('');
|
|
|
$('#state').val('');
|
|
|
$('#link_state').val('');
|
|
|
$("#virtual_platForm_select").val('');
|
|
|
|
|
|
$("#treetable_keyword").val('');
|
|
|
$("#treetable_resStatus").val('');
|
|
|
$("#treetable_res_state").val('');
|
|
|
form.render("select");
|
|
|
fun(resType);
|
|
|
if(busIdSelect){
|
|
|
busIdSelect.setValue([ ]);
|
|
|
bizId='';
|
|
|
form.render();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
})
|
|
|
form.render("select");
|
|
|
form.render();
|
|
|
})
|
|
|
}
|
|
|
|
|
|
//重新load表格
|
|
|
function reloadTable() {
|
|
|
resListTable = parentResListTable = table.reload('resListTable', {
|
|
|
page: {
|
|
|
curr: 1
|
|
|
}
|
|
|
, where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
|
|
|
access_token: accessToken,
|
|
|
resName: $("#resindex_keyword").val(),
|
|
|
busId: bizId,
|
|
|
resHealth: $("#resStatus").val(),
|
|
|
colonlyId: $("#res_colony").val(),
|
|
|
parentId: $("#res_cluster").val() ? $("#res_cluster").val() : $('#res_minicomputer').val(),
|
|
|
sortKey: sortKey,
|
|
|
state: $("#state").val(),
|
|
|
linkState: $("#link_state").val(),
|
|
|
hostState: $("#host_state").val(),
|
|
|
powerState: $("#power_state").val(),
|
|
|
ptId: $("#res_platform").val(),
|
|
|
subResType:$("#res_sub_restype").val(),
|
|
|
provider: $("#res_vendor").val(),
|
|
|
resCategory: 'resources',
|
|
|
collProtocols:collProtocols,
|
|
|
platform: $("#aliyun_plantform").val(),
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
//对比分析调用当前页面 开始
|
|
|
function tabDom(resName,kpiName,name,info) {
|
|
|
//<div class="choose-tab"><span>浙江税务_出口退税_sc_134-内存使用率</span><a href="javascript:;">x</a></div>
|
|
|
var html =
|
|
|
'<div class="choose-tab">' +
|
|
|
'<input type="hidden" name="chooseDataInfo">'+
|
|
|
'<span>'+resName+'-'+kpiName+'</span>' +
|
|
|
'<a href="javascript:;">x</a>' +
|
|
|
'</div>'
|
|
|
var $dom = $(html)
|
|
|
$dom.find("input[type=hidden][name=chooseDataInfo]").val(info);
|
|
|
$(".choose-resKpiInfo>.layui-card-header").append($dom);
|
|
|
}
|
|
|
|
|
|
//获取选中的数据
|
|
|
function getCheckData() {
|
|
|
var arr = [];
|
|
|
$.each($("input[type=hidden][name=chooseDataInfo]"),function (i,e) {
|
|
|
arr.push(JSON.parse(e.value))
|
|
|
})
|
|
|
return arr;
|
|
|
}
|
|
|
|
|
|
//从当前路由中获取数据参数自动定位
|
|
|
function loadParamSelect() {
|
|
|
if (router.search.resType) {
|
|
|
currentResType = router.search.resType;
|
|
|
var currentResId = router.search.resId ? router.search.resId : '';
|
|
|
selectedTreeNode('[data-id="' + currentResType + '"]','[data-id="' + currentResType.split('_')[0] + '"]');
|
|
|
renderList(currentResType,currentResId);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//资源收藏
|
|
|
function resFavorites() {
|
|
|
|
|
|
//绑定鼠标移入移出事件
|
|
|
$('table tr').hover(function (obj) {
|
|
|
$(obj.currentTarget).find('.layui-icon-rate').removeClass('hide');
|
|
|
},function (obj) {
|
|
|
$(obj.currentTarget).find('.layui-icon-rate').addClass('hide');
|
|
|
})
|
|
|
|
|
|
// 加入/移出收藏夹
|
|
|
$('a.layui-icon-rate').unbind('click').on('click',rate );
|
|
|
|
|
|
function rate() {
|
|
|
var $aDom = $(this);
|
|
|
var resId = $aDom.data('id');
|
|
|
var favIdList = $aDom.data('favid') && $aDom.data('favid') != 'null' ? $aDom.data('favid').split(',') : [];
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/favorites/treeSelectData'
|
|
|
}).done(function (response) {
|
|
|
var data = response.data;
|
|
|
if (data.length == 0) {
|
|
|
var selectValue = '';
|
|
|
saveFavs($aDom,selectValue,resId,'true')
|
|
|
} else if (data.length == 1) {
|
|
|
var selectValue = data[0].value;
|
|
|
saveFavs($aDom,selectValue,resId,'false');
|
|
|
} else {
|
|
|
layer.open({
|
|
|
type: '1',
|
|
|
title: '选择收藏夹',
|
|
|
id: 'layer-select-favorites',
|
|
|
content: '<div class="div-select-favorites"><div id="slt-favorites-tree"></div></div>',
|
|
|
offset: '150px',
|
|
|
area: ['20%', '25%'],
|
|
|
btn: ['选择', '取消'],
|
|
|
resize: false,
|
|
|
success: function () {
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/favorites/treeSelectData'
|
|
|
}).done(function (response) {
|
|
|
xmSelect.render({
|
|
|
el: '#slt-favorites-tree',
|
|
|
radio: true,
|
|
|
clickClose: true,
|
|
|
autoRow: true,
|
|
|
filterable: true,
|
|
|
height: '200px',
|
|
|
toolbar: {
|
|
|
show: true,
|
|
|
},
|
|
|
model: {
|
|
|
label: {
|
|
|
type: 'text'
|
|
|
}
|
|
|
},
|
|
|
tree: {
|
|
|
show: true,
|
|
|
showFolderIcon: true,
|
|
|
showLine: true,
|
|
|
indent: 20,
|
|
|
expandedKeys: true,
|
|
|
strict: false
|
|
|
},
|
|
|
data: data
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
yes: function (layerIndex) {
|
|
|
var selectValue = xmSelect.get('#slt-favorites-tree', true).getValue('value');
|
|
|
if (favIdList.length === 0 && selectValue.length === 0) {
|
|
|
layer.msg('请选择一个收藏夹!', {icon: 0, time: 3000});
|
|
|
return false;
|
|
|
}
|
|
|
var favIds = selectValue.join(',');
|
|
|
layer.load(2);
|
|
|
saveFavs($aDom,favIds,resId,'false',layerIndex);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
|
|
|
//移出收藏夹
|
|
|
$('a.layui-icon-rate-solid').unbind('click').on('click',rateSolidClick );
|
|
|
|
|
|
function rateSolidClick() {
|
|
|
var $aDom = $(this);
|
|
|
var resId = $aDom.data('id');
|
|
|
var favId = '';
|
|
|
saveFavs($aDom,favId,resId,'false');
|
|
|
}
|
|
|
|
|
|
//添加收藏夹/移出收藏夹
|
|
|
function saveFavs($aDom,favIds,resId,flag,layerIndex) {
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/favorites/save/fav',
|
|
|
type: 'POST',
|
|
|
data: {
|
|
|
favIds: favIds,
|
|
|
resId: resId,
|
|
|
flag: flag
|
|
|
},
|
|
|
error: function () {
|
|
|
layer.closeAll('loading');
|
|
|
}
|
|
|
}).done(function (response) {
|
|
|
layer.closeAll('loading');
|
|
|
if (response.success) {
|
|
|
if (favIds != '' || (flag == 'true' && favIds == '')) {
|
|
|
$aDom.removeClass('layui-icon-rate');
|
|
|
$aDom.removeClass('hide');
|
|
|
$aDom.addClass('layui-icon-rate-solid');
|
|
|
$aDom.unbind('click').on('click', rateSolidClick);
|
|
|
$aDom.attr('lay-tips', '移出收藏夹');
|
|
|
$aDom.css('color','#FEB61E').css('font-size','14px').css('margin-left','10px');
|
|
|
$aDom.data('favid', favIds);
|
|
|
} else {
|
|
|
$aDom.removeClass('layui-icon-rate-solid');
|
|
|
$aDom.addClass('layui-icon-rate');
|
|
|
$aDom.unbind('click').on('click', rate);
|
|
|
$aDom.addClass('hide');
|
|
|
$aDom.attr('lay-tips', '加入收藏夹');
|
|
|
$aDom.css('font-size', '14px');
|
|
|
$aDom.data('favid', '');
|
|
|
}
|
|
|
layer.close(layerIndex);
|
|
|
} else {
|
|
|
layer.msg('保存失败!', {icon: 2, time: 3000});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function resTopo() {
|
|
|
//绑定鼠标移入移出事件
|
|
|
$('table tr').hover(function (obj) {
|
|
|
$(obj.currentTarget).find('.reslist-view-topo').removeClass('hide');
|
|
|
$(obj.currentTarget).find('.reslist-assets-details').removeClass('hide');
|
|
|
}, function (obj) {
|
|
|
$(obj.currentTarget).find('.reslist-view-topo').addClass('hide');
|
|
|
$(obj.currentTarget).find('.reslist-assets-details').addClass('hide');
|
|
|
})
|
|
|
|
|
|
// 加入/移出收藏夹
|
|
|
$('a.reslist-view-topo').unbind('click').on('click', function () {
|
|
|
common.viewResTopo($(this).data('resid'));
|
|
|
});
|
|
|
|
|
|
// 查看资产配置信息
|
|
|
$('a.reslist-assets-details').unbind('click').on('click', function () {
|
|
|
var $that = $(this);
|
|
|
var resId = $that.data("resid");
|
|
|
var resType = $that.data("restype");
|
|
|
var resName = $that.data("name")?$that.data("name"):'';
|
|
|
var ip = $that.data("ip")?$that.data("ip"):'';
|
|
|
var name = resName + " " + ip;
|
|
|
var url = 'assets/assetsProperty';
|
|
|
var params = {
|
|
|
"resId": resId,
|
|
|
"resType": resType
|
|
|
};
|
|
|
//资产配置信息弹窗大小设置
|
|
|
var AREA_DEFAULT=['80%','80%'];
|
|
|
var AREA_DEFAULT_SMALL=['70%','80%'];
|
|
|
var AREA_DEFAULT_BIG=['90%','80%'];
|
|
|
var area=AREA_DEFAULT_SMALL;
|
|
|
// if(resType==''){
|
|
|
// area=AREA_DEFAULT_SMALL;
|
|
|
// }
|
|
|
common.openWin(url, name, params,null,null,null,area);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
return {getData: getCheckData};
|
|
|
});
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|