Authored by xwx

资源视图、业务视图左侧树搜索优化

... ... @@ -419,7 +419,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
editMode: 'true',
resCategory: 'resources'
},
height: 'full-200',
height: 615,
cellMinWidth: 80,
page: {
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
... ... @@ -433,11 +433,11 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
field: 'resName', title: '资源名称', align: 'center',sort:true,
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>'
}
, {field: 'ip', title: 'IP地址', align: 'center',sort:true}
, {field: 'port', title: '端口号', align: 'center',sort:true}
, {field: 'adminName', title: '负责人', align: 'center',sort:true}
, {field: 'resTypeName', title: '资源类型', align: 'center',sort:true}
, {field: 'state', title: '资源状态', align: 'center',sort:true, templet: function (d) {
, {field: 'ip', title: 'IP地址', align: 'center',sort:true,width:200}
, {field: 'port', title: '端口号', align: 'center',sort:true,width:200}
, {field: 'adminName', title: '负责人', align: 'center',sort:true,width:180}
, {field: 'resTypeName', title: '资源类型', align: 'center',sort:true,width:230}
, {field: 'state', title: '资源状态', align: 'center',sort:true,width:180, templet: function (d) {
switch (d.state) {
case "new" :
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 +450,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
}
}}
, {
title: '操作', fixed: 'right', align: 'center', fixed: 'right',
title: '操作', fixed: 'right', align: 'center', fixed: 'right',width:100,
templet: '<div><span data-id="{{d.resId}}" class="layui-table-link tem_res_delete_btn">删除</span></div>'
}
]],
... ...
... ... @@ -163,7 +163,10 @@
<p class="biz-count">业务总数<span id="bizTotal">0</span></p>
</div>
<div class="layui-card-body">
<input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search">
<div>
<input type="search" placeholder="搜索..." id="bizInputSearch" autocomplete="off" class="layui-input layui-input-search" style="width: 180px">
<button class="layui-btn layui-btn-sm layui-btn-normal" id="bizSearch" style="width: 50px;height: 30px;margin-top: -6px;">搜索</button>
</div>
<div id="bizindextree"></div>
</div>
</div>
... ... @@ -340,4 +343,4 @@
layui.use('bizindex', function (fn) {
fn();
});
</script>
\ No newline at end of file
</script>
... ...
... ... @@ -274,7 +274,10 @@
<div class="layui-card">
<div class="layui-card-body">
<input type="text" placeholder="搜索..." autocomplete="off" class="layui-input layui-input-search">
<div>
<input type="search" placeholder="搜索..." autocomplete="off" id="inputSearch" class="layui-input layui-input-search" style="width: 180px">
<button class="layui-btn layui-btn-sm layui-btn-normal" id="resSearch" style="width: 50px;height: 30px;margin-top: -6px;">搜索</button>
</div>
<div id="resindextree"></div>
</div>
</div>
... ...
... ... @@ -60,6 +60,12 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
common.viewBizTopo($(this).data('busid'));
return false;
});
//搜索按钮
$('#bizSearch').unbind('click').on('click',function (){
busIndexKeyWord = $('#bizInputSearch').val();
loadBizTree(busIndexKeyWord)
})
//回车搜索
$('#bizindex_keyword').keydown(function (e) {
if (e.keyCode === 13) {
... ... @@ -122,7 +128,8 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
window.setResizeEvents('autoHeight', autoHeight);
admin.req({
url: common.domainName + '/api-web/home/resource/countResourceGroupByBusType?keyword='+busHealthKeyWord,
}).done(function (res) {
sync: true
}).always(function (res) {
layer.close(loading);
laytpl($('#bizindexTpl').html()).render({list: res.data, isBiz: true}, function (html) {
bizindexTable.html(html);
... ... @@ -175,6 +182,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
if (val == '' || val == null || val == undefined) {
val = '';
}
busHealthKeyWord = val;
admin.req({
url: common.domainName + '/api-web/home/business/getBusTree?keyword=' + val + '&notExist=machineroom',
sync: true,
... ... @@ -269,7 +277,6 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
loadBizTree($(this).val())
busIndexKeyWord = $(this).val();
busHealthKeyWord = $(this).val();
renderDefaultIndex();
}
});
... ...
... ... @@ -704,6 +704,12 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
resindexKeyword = $(this).val();
}
});
//搜索按钮
$('#resSearch').unbind('click').on('click',function (){
resindexKeyword = $('#inputSearch').val();
resHealthKeyWord = $('#inputSearch').val();
loadResTree(resindexKeyword)
})
loadResTree('');
//资源详细信息
function renderDetail(resId, resType) {
... ...