...
|
...
|
@@ -749,6 +749,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
|
|
|
}
|
|
|
, done: function (res) {
|
|
|
var obj= res.obj;
|
|
|
layer.close(index);
|
|
|
if (res.code == 0) {
|
|
|
//渲染表格
|
...
|
...
|
@@ -775,13 +776,11 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
, 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")
|
|
|
loadRightResTypeSelectEvent(curTreeNode.data.id, "tree", obj);
|
|
|
// 保存列顺序
|
|
|
$('#virtual_platform_treeTable').next().find('.btn_save_cols').unbind('click').on('click', function (){
|
|
|
common.saveTableCols({
|
...
|
...
|
@@ -791,55 +790,9 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
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);
|
...
|
...
|
@@ -1036,16 +989,6 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
$.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)
|
|
|
|
|
|
//调用收藏方法
|
...
|
...
|
@@ -1084,7 +1027,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
common.saveTableCols(params);
|
|
|
});
|
|
|
// 渲染统计数据
|
|
|
loadRightResTypeSelectEvent(resType,"normal");
|
|
|
loadRightResTypeSelectEvent(resType, "normal", res.obj);
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
@@ -1127,7 +1070,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
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>' //开启头部工具栏,并为其绑定左侧模板
|
|
|
//, 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>' //开启头部工具栏,并为其绑定左侧模板
|
|
|
, toolbar: '#resList-top-head-info-tpl' //开启头部工具栏,并为其绑定左侧模板
|
|
|
, defaultToolbar: ['filter']
|
|
|
, drag: {toolbar: false}
|
|
|
, url: common.domainName + '/api-web/home/res-list/' + resType
|
...
|
...
|
@@ -1165,6 +1109,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
|
|
|
commonCols.colsClickEvent(editFlag);
|
|
|
|
|
|
loadRightResTypeSelectEvent(curTreeNode.data.id, "normal", res.obj);
|
|
|
|
|
|
//表格排序监听 joke add 20200408
|
|
|
table.on('sort(resListTable)', function (obj) {
|
|
|
//有些时候,你可能需要根据当前排序的字段,重新向服务端发送请求,从而实现服务端排序,如:
|
...
|
...
|
@@ -1450,47 +1396,28 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
form.render();
|
|
|
}
|
|
|
//加载右侧资源类型下拉框
|
|
|
function loadRightResTypeSelectEvent(resType,type) {
|
|
|
function loadRightResTypeSelectEvent(resType, type, obj) {
|
|
|
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'){
|
|
|
if (type == 'tree') {
|
|
|
str = 'tree_'
|
|
|
domStr = 'treeTableContent'
|
|
|
fun = renderTreeTable
|
|
|
}
|
|
|
var map = res.object;
|
|
|
$.each(map,function(key,values){
|
|
|
$("#"+str+key+"_res").html(map[key])
|
|
|
var map = obj;
|
|
|
$.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);
|
|
|
$("#" + 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{
|
|
|
} else {
|
|
|
$('#resindex_keyword').val('');
|
|
|
$('#resStatus').val('');
|
|
|
// $('#resListBizTypes').val('');
|
...
|
...
|
@@ -1505,17 +1432,19 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' |
|
|
$("#treetable_res_state").val('');
|
|
|
form.render("select");
|
|
|
fun(resType);
|
|
|
if(busIdSelect){
|
|
|
busIdSelect.setValue([ ]);
|
|
|
bizId='';
|
|
|
if (busIdSelect) {
|
|
|
busIdSelect.setValue([]);
|
|
|
bizId = '';
|
|
|
form.render();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
})
|
|
|
});
|
|
|
if(resType == 'HOST_MINICOMPUTER'){//小型机整机 屏蔽连接状态
|
|
|
$('.info-box-count').eq(3).hide();
|
|
|
}
|
|
|
form.render("select");
|
|
|
form.render();
|
|
|
})
|
|
|
}
|
|
|
|
|
|
//重新load表格
|
...
|
...
|
|