Authored by wangtao
@@ -60,7 +60,7 @@ layui.define(['form','table', 'admin', 'common','sessions'], function (exports) @@ -60,7 +60,7 @@ layui.define(['form','table', 'admin', 'common','sessions'], function (exports)
60 //选择策略 60 //选择策略
61 $("#add_alarmtemplate_policy").on("click",function (){ 61 $("#add_alarmtemplate_policy").on("click",function (){
62 $('[lay-id="/baseconfig/alarmpolicy/index"]').find('.layui-tab-close').trigger('click'); 62 $('[lay-id="/baseconfig/alarmpolicy/index"]').find('.layui-tab-close').trigger('click');
63 - common.openWin("baseconfig/alarmpolicy/index","选择策略",{},["选择","取消"], function () { 63 + common.openWin("baseconfig/alarmpolicy/index","选择策略",{type:'alarmTemplate'},["选择","取消"], function () {
64 var data = layui.alarmpolicyIndex().getData(); 64 var data = layui.alarmpolicyIndex().getData();
65 createAlarmtemplatePolicyTable(data); 65 createAlarmtemplatePolicyTable(data);
66 return true; 66 return true;
@@ -101,11 +101,6 @@ layui.define(['form','table', 'admin', 'common','sessions'], function (exports) @@ -101,11 +101,6 @@ layui.define(['form','table', 'admin', 'common','sessions'], function (exports)
101 } 101 }
102 //删除 102 //删除
103 $(".delete-alarmtemplate-policy-btn").on("click",function (){ 103 $(".delete-alarmtemplate-policy-btn").on("click",function (){
104 - var tr = $("#alarmtemplate-policy-table-body").find('tr').length  
105 - if (tr <= 1){  
106 - layer.msg("告警模板至少绑定一条告警策略", { offset: '15px' , icon: 7 , time: 1000 });  
107 - return false;  
108 - }  
109 $(this).parent().parent().remove(); 104 $(this).parent().parent().remove();
110 }); 105 });
111 } 106 }
@@ -14,12 +14,14 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -14,12 +14,14 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
14 exports('alarmtemplateIndex', function (data) { 14 exports('alarmtemplateIndex', function (data) {
15 var policyId = (data && data.policyId) ? data.policyId : ""; 15 var policyId = (data && data.policyId) ? data.policyId : "";
16 var resIdList = (data && data.resIds) ? data.resIds : ''; 16 var resIdList = (data && data.resIds) ? data.resIds : '';
  17 + var resType = (data && common.isNotEmpty(data.resType)) ? data.resType : '';
17 var sessions = layui.sessions; 18 var sessions = layui.sessions;
18 var accessToken = sessions.getToken()['access_token']; 19 var accessToken = sessions.getToken()['access_token'];
19 //获得权限列表 20 //获得权限列表
20 var checkList = common.checkPermission(accessToken); 21 var checkList = common.checkPermission(accessToken);
21 -  
22 - 22 + var alarmTempId = '';
  23 + // 业务类型Id
  24 + var busId = '';
23 //回车搜索 25 //回车搜索
24 $('#alarmtemplatekw').keydown(function (e) { 26 $('#alarmtemplatekw').keydown(function (e) {
25 if (e.keyCode === 13) { 27 if (e.keyCode === 13) {
@@ -77,7 +79,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -77,7 +79,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
77 } 79 }
78 80
79 if (tempData && tempData.length > 0) { 81 if (tempData && tempData.length > 0) {
80 - common.openWin("baseconfig/alarmpolicy/index", "选择策略", {oldData: oldAlarmPolicyIdList}, ["选择", "取消"], function () { 82 + common.openWin("baseconfig/alarmpolicy/index", "选择策略", {oldData: oldAlarmPolicyIdList,type:'alarmTemplate'}, ["选择", "取消"], function () {
81 var policyData = layui.alarmpolicyIndex().getData(); 83 var policyData = layui.alarmpolicyIndex().getData();
82 var tempIds = [], policyIds = []; 84 var tempIds = [], policyIds = [];
83 $.each(tempData, function (i, v) { 85 $.each(tempData, function (i, v) {
@@ -357,7 +359,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -357,7 +359,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
357 359
358 //查看告警模板的资源数量 360 //查看告警模板的资源数量
359 $(".view-alarmtemplate-res-total").on("click", function () { 361 $(".view-alarmtemplate-res-total").on("click", function () {
360 - var alarmTempId = $(this).data("id"); 362 + alarmTempId = $(this).data("id");
361 layer.open({ 363 layer.open({
362 title: ['绑定资源', 'font-size:18px;'], 364 title: ['绑定资源', 'font-size:18px;'],
363 type: 1, 365 type: 1,
@@ -366,13 +368,69 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -366,13 +368,69 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
366 btn: ['确定','取消'], 368 btn: ['确定','取消'],
367 content: laytpl($('#tempResource').html()).render(JSON.stringify({})), 369 content: laytpl($('#tempResource').html()).render(JSON.stringify({})),
368 success: function (index, layero) { 370 success: function (index, layero) {
369 - renderResByTemp(alarmTempId) 371 + renderResByTemp(resType)
370 372
371 //新增资源权限 373 //新增资源权限
372 $('#addAuthResBtn').on('click', function () { 374 $('#addAuthResBtn').on('click', function () {
373 openResByTemp(alarmTempId,index) 375 openResByTemp(alarmTempId,index)
374 }) 376 })
375 377
  378 + // 查询条件框回车查询事件
  379 + $('#res-keyword').keydown(function (e) {
  380 + if (e.keyCode === 13) {
  381 + renderResByTemp(resType);
  382 + }
  383 + });
  384 + //查询按钮事件
  385 + $('#tempResBut').unbind().on('click',function () {
  386 + renderResByTemp(resType);
  387 + });
  388 +
  389 + // 如果参数有busId
  390 + if(data && common.isNotEmpty(data.busId)){
  391 + busId = data.busId;
  392 + $("#templist_resListBizTypes").attr("disabled",true);
  393 + form.render()
  394 + }
  395 + //绑定业务下拉选择数据
  396 + common.bizTypeSelect("templist_resListBizTypes",function () {
  397 + $("#templist_resListBizTypes").val(busId);
  398 + form.render("select");
  399 + });
  400 + //绑定资源类型下拉选择
  401 + common.resTypeXmSelect({
  402 + el: '#templist_restype',
  403 + initValue: resType.split(','),
  404 + on(data) {
  405 + resType = data.arr.map(item => item.resTypeCode).join(',');
  406 + resType || (resType = 'all')
  407 + renderResByTemp(resType);
  408 + }
  409 + });
  410 + //绑定厂商下拉选择
  411 + common.providerSelect("templist_provider",function () {
  412 + form.render("select");
  413 + });
  414 +
  415 + form.render();
  416 + bindSelectEvent();
  417 + //绑定下拉搜索事件
  418 + function bindSelectEvent() {
  419 + //选择业务搜索
  420 + form.on('select(templist_resListBizTypes)', function(data){
  421 + busId = data.value;
  422 + renderResByTemp(resType);
  423 + });
  424 + // 资源状态
  425 + form.on('select(templist_resStatus)', function(data){
  426 + renderResByTemp(resType);
  427 + });
  428 + // 厂商
  429 + form.on('select(templist_provider)', function(data){
  430 + renderResByTemp(resType);
  431 + });
  432 + }
  433 +
376 //删除资源权限 434 //删除资源权限
377 $('#delAuthResBtn').on('click', function () { 435 $('#delAuthResBtn').on('click', function () {
378 deleteResTemp(alarmTempId) 436 deleteResTemp(alarmTempId)
@@ -399,16 +457,16 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -399,16 +457,16 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
399 }); 457 });
400 458
401 //渲染用户所有资源权限列表表格 459 //渲染用户所有资源权限列表表格
402 - function renderResByTemp(alarmTempId) { 460 + function renderResByTemp(resType) {
403 temResTable = table.render({ 461 temResTable = table.render({
404 elem: '#res_temp_table', 462 elem: '#res_temp_table',
405 - url: domainName + '/api-web/home/res-list/all', 463 + url: common.domainName + '/api-web/home/res-list/' + (resType ? resType : 'all'),
406 where: { 464 where: {
407 access_token: accessToken, 465 access_token: accessToken,
408 - resName: '',  
409 - busId: '',  
410 - resHealth: '',  
411 - provider:'', 466 + resName: $('#res-keyword').val(),
  467 + busId: $("#templist_resListBizTypes").val(),
  468 + resHealth: $("#templist_resStatus").val(),
  469 + provider:$("#templist_provider").val(),
412 collectorId: '', 470 collectorId: '',
413 trapCollectorId: '', 471 trapCollectorId: '',
414 alarmTempId: alarmTempId, 472 alarmTempId: alarmTempId,
@@ -419,7 +477,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -419,7 +477,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
419 editMode: 'true', 477 editMode: 'true',
420 resCategory: 'resources' 478 resCategory: 'resources'
421 }, 479 },
422 - height: 'full-200', 480 + height: 615,
423 cellMinWidth: 80, 481 cellMinWidth: 80,
424 page: { 482 page: {
425 layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'] 483 layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
@@ -433,11 +491,11 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -433,11 +491,11 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
433 field: 'resName', title: '资源名称', align: 'center',sort:true, 491 field: 'resName', title: '资源名称', align: 'center',sort:true,
434 templet: '<div><span resmanage-data-edit="{{d.resId}}" data-zymc="{{ d.resId }}" data-ip="{{ d.ip }}" data-resTypeName="{{ d.resTypeName }}" data-admin="{{ d.admin }}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-pingenable="{{d.pingEnable}}">{{ d.resName }}</span></div>' 492 templet: '<div><span resmanage-data-edit="{{d.resId}}" data-zymc="{{ d.resId }}" data-ip="{{ d.ip }}" data-resTypeName="{{ d.resTypeName }}" data-admin="{{ d.admin }}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-pingenable="{{d.pingEnable}}">{{ d.resName }}</span></div>'
435 } 493 }
436 - , {field: 'ip', title: 'IP地址', align: 'center',sort:true}  
437 - , {field: 'port', title: '端口号', align: 'center',sort:true}  
438 - , {field: 'adminName', title: '负责人', align: 'center',sort:true}  
439 - , {field: 'resTypeName', title: '资源类型', align: 'center',sort:true}  
440 - , {field: 'state', title: '资源状态', align: 'center',sort:true, templet: function (d) { 494 + , {field: 'ip', title: 'IP地址', align: 'center',sort:true,width:200}
  495 + , {field: 'port', title: '端口号', align: 'center',sort:true,width:200}
  496 + , {field: 'adminName', title: '负责人', align: 'center',sort:true,width:180}
  497 + , {field: 'resTypeName', title: '资源类型', align: 'center',sort:true,width:230}
  498 + , {field: 'state', title: '资源状态', align: 'center',sort:true,width:180, templet: function (d) {
441 switch (d.state) { 499 switch (d.state) {
442 case "new" : 500 case "new" :
443 return '<button type="button" class="layui-btn layui-btn-warm layui-bg-gray layui-btn-radius layui-btn-xs p-0-15">未监控</button>' 501 return '<button type="button" class="layui-btn layui-btn-warm layui-bg-gray layui-btn-radius layui-btn-xs p-0-15">未监控</button>'
@@ -450,7 +508,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions' @@ -450,7 +508,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
450 } 508 }
451 }} 509 }}
452 , { 510 , {
453 - title: '操作', fixed: 'right', align: 'center', fixed: 'right', 511 + title: '操作', fixed: 'right', align: 'center', fixed: 'right',width:100,
454 templet: '<div><span data-id="{{d.resId}}" class="layui-table-link tem_res_delete_btn">删除</span></div>' 512 templet: '<div><span data-id="{{d.resId}}" class="layui-table-link tem_res_delete_btn">删除</span></div>'
455 } 513 }
456 ]], 514 ]],
@@ -63,6 +63,56 @@ @@ -63,6 +63,56 @@
63 <div class="page-panel"> 63 <div class="page-panel">
64 <div class="main"> 64 <div class="main">
65 <div class="layui-card"> 65 <div class="layui-card">
  66 + <div class="layui-card-header">
  67 + <div class="layui-status">
  68 + <form class="layui-form layui-card-header layuiadmin-card-header-auto">
  69 + <div class="layui-form-item">
  70 + <div class="layui-inline">
  71 + <div class="layui-input-inline layui-input-inline--long">
  72 + <input type="text" id="res-keyword" placeholder="输入名称,回车搜索" autocomplete="off"
  73 + lay-tips="关键字检索包含: </br>资源名称</br>ip地址"
  74 + class="layui-input">
  75 + </div>
  76 + </div>
  77 + <div class="layui-inline">
  78 + <div class="layui-input-inline layui-input-inline--long">
  79 + <div id="templist_restype"></div>
  80 + </div>
  81 + </div>
  82 +
  83 + <div class="layui-inline">
  84 + <div class="layui-input-inline">
  85 + <select name="reslist_resStatus" id="templist_resStatus" lay-filter="templist_resStatus" lay-verify="required">
  86 + <option value="">=资源状态=</option>
  87 + <option value="1"></option>
  88 + <option value="2"></option>
  89 + <option value="3"></option>
  90 + </select>
  91 + </div>
  92 + </div>
  93 + <div class="layui-inline">
  94 + <div class="layui-input-inline">
  95 + <select name="label" id="templist_resListBizTypes" lay-filter="templist_resListBizTypes" lay-search>
  96 + <option value="">=选择业务=</option>
  97 + </select>
  98 + </div>
  99 + </div>
  100 + <div class="layui-inline">
  101 + <div class="layui-input-inline">
  102 + <select name="provider" id="templist_provider" lay-filter="templist_provider" lay-search>
  103 + <option value="">=选择厂商=</option>
  104 + </select>
  105 + </div>
  106 + </div>
  107 + <div class="layui-inline">
  108 + <button id="tempResBut" type="button" class="layui-btn layui-btn-normal" ><i
  109 + class="layui-icon layui-icon-search"></i>查
  110 + </button>
  111 + </div>
  112 + </div>
  113 + </form>
  114 + </div>
  115 + </div>
66 <div class="layui-card-body"> 116 <div class="layui-card-body">
67 <div class="warn-btns"> 117 <div class="warn-btns">
68 <button id="addAuthResBtn" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i 118 <button id="addAuthResBtn" type="button" class="layui-btn layui-btn-sm layui-btn-normal"><i
@@ -163,7 +163,10 @@ @@ -163,7 +163,10 @@
163 <p class="biz-count">业务总数<span id="bizTotal">0</span></p> 163 <p class="biz-count">业务总数<span id="bizTotal">0</span></p>
164 </div> 164 </div>
165 <div class="layui-card-body"> 165 <div class="layui-card-body">
166 - <input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search"> 166 + <div>
  167 + <input type="search" placeholder="搜索..." id="bizInputSearch" autocomplete="off" class="layui-input layui-input-search" style="width: 180px">
  168 + <button class="layui-btn layui-btn-sm layui-btn-normal" id="bizSearch" style="width: 50px;height: 30px;margin-top: -6px;">搜索</button>
  169 + </div>
167 <div id="bizindextree"></div> 170 <div id="bizindextree"></div>
168 </div> 171 </div>
169 </div> 172 </div>
@@ -340,4 +343,4 @@ @@ -340,4 +343,4 @@
340 layui.use('bizindex', function (fn) { 343 layui.use('bizindex', function (fn) {
341 fn(); 344 fn();
342 }); 345 });
343 -</script>  
  346 +</script>
@@ -274,7 +274,10 @@ @@ -274,7 +274,10 @@
274 <div class="layui-card"> 274 <div class="layui-card">
275 275
276 <div class="layui-card-body"> 276 <div class="layui-card-body">
277 - <input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search"> 277 + <div>
  278 + <input type="search" placeholder="搜索..." autocomplete="off" id="inputSearch" class="layui-input layui-input-search" style="width: 180px">
  279 + <button class="layui-btn layui-btn-sm layui-btn-normal" id="resSearch" style="width: 50px;height: 30px;margin-top: -6px;">搜索</button>
  280 + </div>
278 <div id="resindextree"></div> 281 <div id="resindextree"></div>
279 </div> 282 </div>
280 </div> 283 </div>
@@ -36,6 +36,8 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -36,6 +36,8 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
36 var bizParentList; 36 var bizParentList;
37 // 资源视图表格 37 // 资源视图表格
38 var bizListTable; 38 var bizListTable;
  39 + var busHealthKeyWord = '';
  40 + var busIndexKeyWord = '';
39 //点击卡片 41 //点击卡片
40 $('#bizindexTable').unbind('click').on('click', '[data-biz-card]', function () { 42 $('#bizindexTable').unbind('click').on('click', '[data-biz-card]', function () {
41 var resType = $(this).data("biz-card"); 43 var resType = $(this).data("biz-card");
@@ -58,9 +60,16 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -58,9 +60,16 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
58 common.viewBizTopo($(this).data('busid')); 60 common.viewBizTopo($(this).data('busid'));
59 return false; 61 return false;
60 }); 62 });
  63 +
  64 + //搜索按钮
  65 + $('#bizSearch').unbind('click').on('click',function (){
  66 + busIndexKeyWord = $('#bizInputSearch').val();
  67 + loadBizTree(busIndexKeyWord)
  68 + })
61 //回车搜索 69 //回车搜索
62 $('#bizindex_keyword').keydown(function (e) { 70 $('#bizindex_keyword').keydown(function (e) {
63 if (e.keyCode === 13) { 71 if (e.keyCode === 13) {
  72 + busIndexKeyWord = $(this).val();
64 // renderList(busId, curBizResType); 73 // renderList(busId, curBizResType);
65 reloadTable(); 74 reloadTable();
66 return false; 75 return false;
@@ -93,6 +102,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -93,6 +102,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
93 $('#biztreeTableContent').hide(); 102 $('#biztreeTableContent').hide();
94 $('#bizDetailContent').empty(); 103 $('#bizDetailContent').empty();
95 $('#bizDetailContent').hide(); 104 $('#bizDetailContent').hide();
  105 + // $('#bizindex_keyword').val(busIndexKeyWord)
96 var bizindexTable = $('#bizindexTable'); 106 var bizindexTable = $('#bizindexTable');
97 autoHeight(bizindexTable); 107 autoHeight(bizindexTable);
98 window.setResizeEvents('autoHeight', autoHeight); 108 window.setResizeEvents('autoHeight', autoHeight);
@@ -117,8 +127,9 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -117,8 +127,9 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
117 autoHeight(bizindexTable); 127 autoHeight(bizindexTable);
118 window.setResizeEvents('autoHeight', autoHeight); 128 window.setResizeEvents('autoHeight', autoHeight);
119 admin.req({ 129 admin.req({
120 - url: common.domainName + '/api-web/home/resource/countResourceGroupByBusType',  
121 - }).done(function (res) { 130 + url: common.domainName + '/api-web/home/resource/countResourceGroupByBusType?keyword='+busHealthKeyWord,
  131 + sync: true
  132 + }).always(function (res) {
122 layer.close(loading); 133 layer.close(loading);
123 laytpl($('#bizindexTpl').html()).render({list: res.data, isBiz: true}, function (html) { 134 laytpl($('#bizindexTpl').html()).render({list: res.data, isBiz: true}, function (html) {
124 bizindexTable.html(html); 135 bizindexTable.html(html);
@@ -171,6 +182,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -171,6 +182,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
171 if (val == '' || val == null || val == undefined) { 182 if (val == '' || val == null || val == undefined) {
172 val = ''; 183 val = '';
173 } 184 }
  185 + busHealthKeyWord = val;
174 admin.req({ 186 admin.req({
175 url: common.domainName + '/api-web/home/business/getBusTree?keyword=' + val + '&notExist=machineroom', 187 url: common.domainName + '/api-web/home/business/getBusTree?keyword=' + val + '&notExist=machineroom',
176 sync: true, 188 sync: true,
@@ -183,6 +195,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -183,6 +195,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
183 showLine: false, 195 showLine: false,
184 data: data, 196 data: data,
185 click: function (node) { 197 click: function (node) {
  198 + // $('#bizindex_keyword').val(busIndexKeyWord)
186 if (node && node.data && node.data.children && node.data.children.length == 1) { 199 if (node && node.data && node.data.children && node.data.children.length == 1) {
187 $('[data-id="' + node.data.children[0].id + '"]').find('.layui-tree-iconClick:first').click() 200 $('[data-id="' + node.data.children[0].id + '"]').find('.layui-tree-iconClick:first').click()
188 } 201 }
@@ -262,6 +275,8 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -262,6 +275,8 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
262 $(".layui-input-search").keyup(function (e) { 275 $(".layui-input-search").keyup(function (e) {
263 if (e.keyCode === 13) { 276 if (e.keyCode === 13) {
264 loadBizTree($(this).val()) 277 loadBizTree($(this).val())
  278 + busIndexKeyWord = $(this).val();
  279 + busHealthKeyWord = $(this).val();
265 } 280 }
266 }); 281 });
267 282
@@ -371,7 +386,6 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -371,7 +386,6 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
371 $('#biztreeTableContent').hide(); 386 $('#biztreeTableContent').hide();
372 387
373 //清除查询条件 388 //清除查询条件
374 - $("#bizindex_keyword").val("");  
375 $("#biz_resStatus").val(""); 389 $("#biz_resStatus").val("");
376 $("#biz_res_colony").val(""); 390 $("#biz_res_colony").val("");
377 $("#biz_res_cluster").val(""); 391 $("#biz_res_cluster").val("");
@@ -407,7 +421,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -407,7 +421,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
407 , url: common.domainName + '/api-web/home/res-list/' + resTypeList.toString() 421 , url: common.domainName + '/api-web/home/res-list/' + resTypeList.toString()
408 , where: { 422 , where: {
409 access_token: accessToken, 423 access_token: accessToken,
410 - resName: $("#bizindex_keyword").val(), 424 + resName:busIndexKeyWord,
411 resHealth: $("#biz_resStatus").val(), 425 resHealth: $("#biz_resStatus").val(),
412 busId: busId, 426 busId: busId,
413 colonlyId: $("#biz_res_colony").val(), 427 colonlyId: $("#biz_res_colony").val(),
@@ -466,11 +480,12 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -466,11 +480,12 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
466 $('#biztreeTableContent').hide(); 480 $('#biztreeTableContent').hide();
467 $('#bizDetailContent').empty(); 481 $('#bizDetailContent').empty();
468 $('#bizDetailContent').hide(); 482 $('#bizDetailContent').hide();
  483 + // $('#bizindex_keyword').val(busIndexKeyWord)
469 var bizindexTable = $('#bizindexTable'); 484 var bizindexTable = $('#bizindexTable');
470 autoHeight(bizindexTable); 485 autoHeight(bizindexTable);
471 window.setResizeEvents('autoHeight', autoHeight); 486 window.setResizeEvents('autoHeight', autoHeight);
472 admin.req({ 487 admin.req({
473 - url: common.domainName + "/api-web/datavis/getResTotal/?busId=" + bizId 488 + url: common.domainName + "/api-web/datavis/getResTotal/?busId=" + bizId +"&keyWord="+busHealthKeyWord
474 , done: function (res) { 489 , done: function (res) {
475 laytpl($('#bizindexTpl').html()).render({list: res.data}, function (html) { 490 laytpl($('#bizindexTpl').html()).render({list: res.data}, function (html) {
476 bizindexTable.html(html); 491 bizindexTable.html(html);
@@ -506,7 +521,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -506,7 +521,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
506 , drag: {toolbar: false} 521 , drag: {toolbar: false}
507 , where: { 522 , where: {
508 access_token: accessToken, 523 access_token: accessToken,
509 - resName: $("#bizindex_keyword").val(), 524 + resName: busIndexKeyWord,
510 resHealth: $("#biz_resStatus").val(), 525 resHealth: $("#biz_resStatus").val(),
511 busId: busId, 526 busId: busId,
512 colonlyId: $("#biz_res_colony").val(), 527 colonlyId: $("#biz_res_colony").val(),
@@ -566,7 +581,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -566,7 +581,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
566 $('#bizDetailContent').empty(); 581 $('#bizDetailContent').empty();
567 $('#bizDetailContent').hide(); 582 $('#bizDetailContent').hide();
568 $('#biztreeTableContent').hide(); 583 $('#biztreeTableContent').hide();
569 - 584 + // $('#bizindex_keyword').val(busIndexKeyWord)
570 renderBizSerach(resType, busId); 585 renderBizSerach(resType, busId);
571 586
572 form.render(null, 'biz-list-form'); 587 form.render(null, 'biz-list-form');
@@ -589,7 +604,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -589,7 +604,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
589 , url: common.domainName + '/api-web/home/res-list/' + resType 604 , url: common.domainName + '/api-web/home/res-list/' + resType
590 , where: { 605 , where: {
591 access_token: accessToken, 606 access_token: accessToken,
592 - resName: $("#bizindex_keyword").val(), 607 + resName: busIndexKeyWord,
593 resHealth: $("#biz_resStatus").val(), 608 resHealth: $("#biz_resStatus").val(),
594 busId: busId, 609 busId: busId,
595 colonlyId: $("#biz_res_colony").val(), 610 colonlyId: $("#biz_res_colony").val(),
@@ -841,7 +856,6 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -841,7 +856,6 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
841 //加载资源池、集群等查询条件 856 //加载资源池、集群等查询条件
842 function renderBizSerach(resType, busId, subflag) { 857 function renderBizSerach(resType, busId, subflag) {
843 //清空查询条件 joke add 20200409 开始 858 //清空查询条件 joke add 20200409 开始
844 - $('#bizindex_keyword').val('');  
845 $('#biz_resStatus').val(''); 859 $('#biz_resStatus').val('');
846 $('#biz_res_colony').val(''); 860 $('#biz_res_colony').val('');
847 $('#biz_res_cluster').val(''); 861 $('#biz_res_cluster').val('');
@@ -993,7 +1007,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -993,7 +1007,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
993 } 1007 }
994 ,where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式) 1008 ,where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
995 access_token: accessToken, 1009 access_token: accessToken,
996 - resName: $("#bizindex_keyword").val(), 1010 + resName: busIndexKeyWord,
997 resHealth: $("#biz_resStatus").val(), 1011 resHealth: $("#biz_resStatus").val(),
998 busId: busId, 1012 busId: busId,
999 colonlyId: $("#biz_res_colony").val(), 1013 colonlyId: $("#biz_res_colony").val(),
@@ -1033,4 +1047,4 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols @@ -1033,4 +1047,4 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
1033 1047
1034 } 1048 }
1035 }); 1049 });
1036 -});  
  1050 +});
@@ -127,7 +127,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -127,7 +127,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
127 $('#resDetailContent').empty(); 127 $('#resDetailContent').empty();
128 $('#resDetailContent').hide(); 128 $('#resDetailContent').hide();
129 $('#treeTableContent').hide(); 129 $('#treeTableContent').hide();
130 - $('#resindex_keyword').val(resindexKeyword) 130 + // $('#resindex_keyword').val(resindexKeyword)
131 //如果是阿里云,则显示阿里云的列表 131 //如果是阿里云,则显示阿里云的列表
132 if(resType && resType == 'ALI_CLOUD_PLAT'){ 132 if(resType && resType == 'ALI_CLOUD_PLAT'){
133 $(".resindexlist").show(); 133 $(".resindexlist").show();
@@ -704,6 +704,12 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -704,6 +704,12 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
704 resindexKeyword = $(this).val(); 704 resindexKeyword = $(this).val();
705 } 705 }
706 }); 706 });
  707 + //搜索按钮
  708 + $('#resSearch').unbind('click').on('click',function (){
  709 + resindexKeyword = $('#inputSearch').val();
  710 + resHealthKeyWord = $('#inputSearch').val();
  711 + loadResTree(resindexKeyword)
  712 + })
707 loadResTree(''); 713 loadResTree('');
708 //资源详细信息 714 //资源详细信息
709 function renderDetail(resId, resType) { 715 function renderDetail(resId, resType) {
@@ -1052,7 +1058,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', ' @@ -1052,7 +1058,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
1052 $('#resDetailContent').empty(); 1058 $('#resDetailContent').empty();
1053 $('#resDetailContent').hide(); 1059 $('#resDetailContent').hide();
1054 $('#treeTableContent').hide(); 1060 $('#treeTableContent').hide();
1055 - $('#resindex_keyword').val(resindexKeyword) 1061 + // $('#resindex_keyword').val(resindexKeyword)
1056 //加载查询条件 1062 //加载查询条件
1057 renderSerach(resType); 1063 renderSerach(resType);
1058 1064