Authored by 王涛

Merge branch 'master-v32-xwx' into 'master'

【1422】B2业务视图添加快速检索按钮



See merge request !726
... ... @@ -36,6 +36,8 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
var bizParentList;
// 资源视图表格
var bizListTable;
var busHealthKeyWord = '';
var busIndexKeyWord = '';
//点击卡片
$('#bizindexTable').unbind('click').on('click', '[data-biz-card]', function () {
var resType = $(this).data("biz-card");
... ... @@ -61,6 +63,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
//回车搜索
$('#bizindex_keyword').keydown(function (e) {
if (e.keyCode === 13) {
busIndexKeyWord = $(this).val();
// renderList(busId, curBizResType);
reloadTable();
return false;
... ... @@ -93,6 +96,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
$('#biztreeTableContent').hide();
$('#bizDetailContent').empty();
$('#bizDetailContent').hide();
// $('#bizindex_keyword').val(busIndexKeyWord)
var bizindexTable = $('#bizindexTable');
autoHeight(bizindexTable);
window.setResizeEvents('autoHeight', autoHeight);
... ... @@ -117,7 +121,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
autoHeight(bizindexTable);
window.setResizeEvents('autoHeight', autoHeight);
admin.req({
url: common.domainName + '/api-web/home/resource/countResourceGroupByBusType',
url: common.domainName + '/api-web/home/resource/countResourceGroupByBusType?keyword='+busHealthKeyWord,
}).done(function (res) {
layer.close(loading);
laytpl($('#bizindexTpl').html()).render({list: res.data, isBiz: true}, function (html) {
... ... @@ -183,6 +187,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
showLine: false,
data: data,
click: function (node) {
// $('#bizindex_keyword').val(busIndexKeyWord)
if (node && node.data && node.data.children && node.data.children.length == 1) {
$('[data-id="' + node.data.children[0].id + '"]').find('.layui-tree-iconClick:first').click()
}
... ... @@ -262,6 +267,9 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
$(".layui-input-search").keyup(function (e) {
if (e.keyCode === 13) {
loadBizTree($(this).val())
busIndexKeyWord = $(this).val();
busHealthKeyWord = $(this).val();
renderDefaultIndex();
}
});
... ... @@ -371,7 +379,6 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
$('#biztreeTableContent').hide();
//清除查询条件
$("#bizindex_keyword").val("");
$("#biz_resStatus").val("");
$("#biz_res_colony").val("");
$("#biz_res_cluster").val("");
... ... @@ -407,7 +414,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
, url: common.domainName + '/api-web/home/res-list/' + resTypeList.toString()
, where: {
access_token: accessToken,
resName: $("#bizindex_keyword").val(),
resName:busIndexKeyWord,
resHealth: $("#biz_resStatus").val(),
busId: busId,
colonlyId: $("#biz_res_colony").val(),
... ... @@ -466,11 +473,12 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
$('#biztreeTableContent').hide();
$('#bizDetailContent').empty();
$('#bizDetailContent').hide();
// $('#bizindex_keyword').val(busIndexKeyWord)
var bizindexTable = $('#bizindexTable');
autoHeight(bizindexTable);
window.setResizeEvents('autoHeight', autoHeight);
admin.req({
url: common.domainName + "/api-web/datavis/getResTotal/?busId=" + bizId
url: common.domainName + "/api-web/datavis/getResTotal/?busId=" + bizId +"&keyWord="+busHealthKeyWord
, done: function (res) {
laytpl($('#bizindexTpl').html()).render({list: res.data}, function (html) {
bizindexTable.html(html);
... ... @@ -506,7 +514,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
, drag: {toolbar: false}
, where: {
access_token: accessToken,
resName: $("#bizindex_keyword").val(),
resName: busIndexKeyWord,
resHealth: $("#biz_resStatus").val(),
busId: busId,
colonlyId: $("#biz_res_colony").val(),
... ... @@ -566,7 +574,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
$('#bizDetailContent').empty();
$('#bizDetailContent').hide();
$('#biztreeTableContent').hide();
// $('#bizindex_keyword').val(busIndexKeyWord)
renderBizSerach(resType, busId);
form.render(null, 'biz-list-form');
... ... @@ -589,7 +597,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
, url: common.domainName + '/api-web/home/res-list/' + resType
, where: {
access_token: accessToken,
resName: $("#bizindex_keyword").val(),
resName: busIndexKeyWord,
resHealth: $("#biz_resStatus").val(),
busId: busId,
colonlyId: $("#biz_res_colony").val(),
... ... @@ -841,7 +849,6 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
//加载资源池、集群等查询条件
function renderBizSerach(resType, busId, subflag) {
//清空查询条件 joke add 20200409 开始
$('#bizindex_keyword').val('');
$('#biz_resStatus').val('');
$('#biz_res_colony').val('');
$('#biz_res_cluster').val('');
... ... @@ -993,7 +1000,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
}
,where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
access_token: accessToken,
resName: $("#bizindex_keyword").val(),
resName: busIndexKeyWord,
resHealth: $("#biz_resStatus").val(),
busId: busId,
colonlyId: $("#biz_res_colony").val(),
... ... @@ -1033,4 +1040,4 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
}
});
});
\ No newline at end of file
});
... ...
... ... @@ -127,7 +127,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
$('#resDetailContent').empty();
$('#resDetailContent').hide();
$('#treeTableContent').hide();
$('#resindex_keyword').val(resindexKeyword)
// $('#resindex_keyword').val(resindexKeyword)
//如果是阿里云,则显示阿里云的列表
if(resType && resType == 'ALI_CLOUD_PLAT'){
$(".resindexlist").show();
... ... @@ -1052,7 +1052,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
$('#resDetailContent').empty();
$('#resDetailContent').hide();
$('#treeTableContent').hide();
$('#resindex_keyword').val(resindexKeyword)
// $('#resindex_keyword').val(resindexKeyword)
//加载查询条件
renderSerach(resType);
... ...