Authored by wangtao
... ... @@ -663,8 +663,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function
var trs = '';
if(res.data && res.data.length > 0){
$.each(res.data,function (i,v){
var collProtocol = '';
if (v.collProtocol){
collProtocol = v.collProtocol;
}
trs += `<tr><td>${i+1}</td><td>${v.resName}</td><td>${v.ip}</td><td>${v.adminName}</td>
<td>${v.resTypeName}</td><td>${v.collProtocol}</td><td><span id="${v.relId}" class="link resource_sublist_del">删除</span></td></tr>`;
<td>${v.resTypeName}</td><td>`+collProtocol+`</td><td><span id="${v.relId}" class="link resource_sublist_del">删除</span></td></tr>`;
});
}
... ... @@ -679,8 +683,12 @@ layui.define(['table', 'form', 'admin', 'layer', 'common','sessions'], function
function reloadData(res) {
var trs = '';
$.each(res.data,function (i,v){
var collProtocol = '';
if (v.collProtocol){
collProtocol = v.collProtocol;
}
trs += `<tr><td>${i+1}</td><td>${v.resName}</td><td>${v.ip}</td><td>${v.adminName}</td>
<td>${v.resTypeName}</td><td>${v.collProtocol}</td><td><span id="${v.relId}" class="link resource_sublist_del">删除</span></td></tr>`;
<td>${v.resTypeName}</td><td>`+collProtocol+`</td><td><span id="${v.relId}" class="link resource_sublist_del">删除</span></td></tr>`;
});
var tb = `
<form class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="dyglTools-form">
... ...
... ... @@ -157,8 +157,8 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'reslist', 'sessions'
view('commonViewModel').render("template/res/reslist").then(function (res) {
layer.open({
type: 1,
id:(new Date()).getTime(),
area: ['80%', '90%'],
id:'alarmtemplateRes',
area: ['80%', '81%'],
resize: false,
shadeClose: true,
content: laytpl(res.body).render(JSON.stringify({oldData: oldResIdList})),
... ...
... ... @@ -28,7 +28,7 @@ layui.define(['commonDetail','common'], function (exports) {
function reload() {
//基本信息
// 根据高磊最新调整,屏蔽 KPI1D79730C(是否IO优化)/KPI93CB4C19(专有网络名称)
commonDetail.renderTextCols("ali_cloud_ecs_baseinfo",resId,jbxxKpi,3);
commonDetail.renderTextCols("ali_cloud_ecs_baseinfo",resId,jbxxKpi,2);
//维保信息 joke add 20200611
commonDetail.renderMaintenanceInfo('ali_cloud_ecs_wbinfo',resId,resType);
// CPU使用率
... ... @@ -63,4 +63,4 @@ layui.define(['commonDetail','common'], function (exports) {
},commonDetail.timerTime);
commonDetail.detailTimer.push(timer);
});
});
\ No newline at end of file
});
... ...
... ... @@ -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");
... ... @@ -58,9 +60,17 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
common.viewBizTopo($(this).data('busid'));
return false;
});
//搜索按钮
$('#bizSearch').unbind('click').on('click',function (){
layer.load(2);
busIndexKeyWord = $('#bizInputSearch').val();
loadBizTree(busIndexKeyWord)
})
//回车搜索
$('#bizindex_keyword').keydown(function (e) {
if (e.keyCode === 13) {
busIndexKeyWord = $(this).val();
layer.load(2);
// renderList(busId, curBizResType);
reloadTable();
return false;
... ... @@ -117,9 +127,10 @@ 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',
}).done(function (res) {
layer.close(loading);
url: common.domainName + '/api-web/home/resource/countResourceGroupByBusType?keyword='+busHealthKeyWord,
sync: true
}).always(function (res) {
layer.closeAll('loading');
laytpl($('#bizindexTpl').html()).render({list: res.data, isBiz: true}, function (html) {
bizindexTable.html(html);
});
... ... @@ -136,7 +147,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/countSecondNum?parentId='+parentId,
url: common.domainName + '/api-web/home/resource/countSecondNum?parentId='+parentId+'&keyword='+busIndexKeyWord,
}).done(function (res) {
layer.close(loading);
laytpl($('#bizindexTpl').html()).render({list: res.data, isBiz: true}, function (html) {
... ... @@ -171,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,
... ... @@ -262,6 +274,8 @@ 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();
}
});
... ... @@ -371,7 +385,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 +420,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(),
... ... @@ -468,7 +481,7 @@ layui.define(['tree', 'laypage', 'laytpl', 'admin', 'form', 'table', 'commonCols
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);
... ... @@ -504,7 +517,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(),
... ... @@ -586,7 +599,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(),
... ... @@ -837,7 +850,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('');
... ... @@ -996,7 +1008,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(),
... ...
... ... @@ -1285,16 +1285,27 @@ layui.define(['xmSelect', 'md5'], function (exports) {
if (layHref.indexOf('=') !== -1) {
param = "=" + encodeURIComponent(layHref.split('=')[1]);
}
alink.setAttribute("lay-href",layHref.split('=')[0] + param);
alink.setAttribute("lay-href", layHref.split('=')[0] + param);
document.body.appendChild(alink);
alink.click();
document.body.removeChild(alink);
},
openMxgraph: function (layHref) {
var alink = document.createElement('a');
var param = '';
if (layHref.indexOf('=') !== -1) {
param = "=" + encodeURIComponent(layHref.split('=')[1]);
}
alink.setAttribute("lay-href", layHref.split('=')[0] + param);
admin.req({
url: obj.domainName + '/api-web/mxgraph/getJtopoInfoById/'+layHref.split('=')[2],
url: obj.domainName + '/api-web/mxgraph/getJtopoInfoById/' + layHref.split('=')[2],
success(response) {
//LH 修改 弹框展示子拓扑
layer.open({
title:response.object.topoName,
title: response.object.topoName,
type: 2,
area:['90%','90%'],
content: obj.graphEditorOrigin + "/jgraph/grapheditor/viewer.html?access_token=" + localStorage.getItem('access_token') + '&id='+layHref.split('=')[2] ,//+ "&layout=organic",
area: ['90%', '90%'],
content: obj.graphEditorOrigin + "/jgraph/grapheditor/viewer.html?access_token=" + localStorage.getItem('access_token') + '&id=' + layHref.split('=')[2],//+ "&layout=organic",
})
},
error() {
... ...
... ... @@ -12,7 +12,8 @@ layui.define(['commonDetail','common'], function (exports) {
}
commonDetail.bindTips();
//基本信息
var jbxxKpi = "KPIE13DD9A3,KPIF74D9D2B,KPI1635BB9B,KPIF3CCE8C7,KPI30D23EF4,KPI31ECC0E6,KPIF7800C96,KPI0420A9BC,KPI34772285";
// 高磊:华为云虚拟机指标采集不到连接状态
var jbxxKpi = "KPIF74D9D2B,KPI1635BB9B,KPIF3CCE8C7,KPI30D23EF4,KPI31ECC0E6,KPIF7800C96,KPI0420A9BC,KPI34772285";
//端口存活侦测(二维表格)
var portDetTableKpiId='KPI39C76443,KPIC6A062EC,KPI5212EE93,KPIDCBEA93D';
... ... @@ -65,4 +66,4 @@ layui.define(['commonDetail','common'], function (exports) {
commonDetail.detailTimer.push(timer);
});
});
\ No newline at end of file
});
... ...
... ... @@ -19,7 +19,8 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
var admin = layui.admin;
var commonDetail = layui.commonDetail;
var domainName = common.domainName;
var resHealthKeyWord = '';
var resindexKeyword = '';
var resTypeSelectExclude = ['HOST_MINICOMPUTER', 'HOST_MINICOMPUTER_SERVER', 'HOST_BMC', 'HOST_X86SERVER']
var curTreeNode = '';
... ... @@ -141,48 +142,16 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
window.setResizeEvents('autoHeight', autoHeight);
admin.req({
url: common.domainName + '/api-web/home/resource/healthByResType?pResType=' + resType,
url: common.domainName + '/api-web/home/resource/healthByResType?pResType=' + resType +'&keyword=' + resHealthKeyWord,
}).done(function (res) {
laytpl($('#resindexTpl').html()).render({list: res.data}, function (html) {
resindexTable.html(html);
layer.closeAll('loading');
});
});
}
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) {
... ... @@ -243,7 +212,44 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
});
}
//左侧树
function loadResTree(data) {
function loadResTree(val) {
admin.req({
url: common.domainName + '/api-web/home/resType/getTree?notExist=machineroom&table=resources&exist=HOST_MINICOMPUTER_SERVER&keyword='+val,
type: 'get',
sync: true,
done: function (res) {
layer.close(loading);
treeList(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);
});
renderIndex('')
}
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 treeList(data){
//默认展开全部一级节点
$.each(data,function (i,v) {
v.spread = true;
... ... @@ -681,11 +687,28 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
//回车搜索
$('#resindex_keyword').keydown(function (e) {
if (e.keyCode === 13) {
resindexKeyword = $(this).val();
// renderList(currentResType);
reloadTable();
return false;
}
});
$(".layui-input-search").keydown(function (e) {
if (e.keyCode === 13) {
layer.load(2)
loadResTree($(this).val());
resHealthKeyWord = $(this).val();
resindexKeyword = $(this).val();
}
});
//搜索按钮
$('#resSearch').unbind('click').on('click',function (){
resindexKeyword = $('#inputSearch').val();
resHealthKeyWord = $('#inputSearch').val();
layer.load(2)
loadResTree(resindexKeyword)
})
loadResTree('');
//资源详细信息
function renderDetail(resId, resType) {
... ... @@ -991,7 +1014,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
, url: common.domainName + '/api-web/home/res-list/' + resType
, where: {
access_token: accessToken,
resName: $("#resindex_keyword").val(),
resName: resindexKeyword,
busId: bizId,
resHealth: $("#resStatus").val(),
colonlyId: $("#res_colony").val(),
... ... @@ -1127,7 +1150,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
, url: common.domainName + '/api-web/home/res-list/' + resType
, where: {
access_token: accessToken,
resName: $("#resindex_keyword").val() !== '' ? $("#resindex_keyword").val() : id,
resName: resindexKeyword !== '' ? resindexKeyword : id,
busId: bizId,
resHealth: $("#resStatus").val(),
colonlyId: $("#res_colony").val(),
... ... @@ -1158,6 +1181,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
resTopo();
commonCols.colsClickEvent(editFlag);
loadRightResTypeSelectEvent(curTreeNode.id ? curTreeNode.id : curTreeNode.data.id, "normal", res.obj);
//表格排序监听 joke add 20200408
table.on('sort(resListTable)', function (obj) {
... ... @@ -1212,7 +1236,6 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
//加载资源池、集群等查询条件
function renderSerach(resType,subflag) {
//清空查询条件 joke add 20200409 开始
$('#resindex_keyword').val('');
$('#resStatus').val('');
// $('#resListBizTypes').val('');
if(xmSelect.get("#resListBizTypes") && xmSelect.get("#resListBizTypes")[0]){
... ... @@ -1522,7 +1545,7 @@ layui.define(['common', 'tree', 'laypage', 'laytpl', 'admin', 'form', 'table', '
}
, where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
access_token: accessToken,
resName: $("#resindex_keyword").val(),
resName: resindexKeyword,
busId: bizId,
resHealth: $("#resStatus").val(),
colonlyId: $("#res_colony").val(),
... ...
... ... @@ -190,7 +190,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate'
templet:
'<div>' +
' <button data-id="{{d.noticeTempId}}" lay-tips="删除" type="button" class="layui-btn layui-btn-xs layui-btn-normal link-notice-temp-delete"><i class="layui-icon layui-icon-delete"></i></button>' +
' <button data-id="{{d.noticeTempId}}" data-subId="{{d.subId}}" lay-tips="发送" type="button" class="layui-btn layui-btn-xs layui-btn-normal link-notice-temp-send"><i class="layui-icon layui-icon-release"></i></button>' +
' <button data-id="{{d.noticeTempId}}" data-layindex="{{d.LAY_TABLE_INDEX}}" data-subId="{{d.subId}}" lay-tips="发送" type="button" class="layui-btn layui-btn-xs layui-btn-normal link-notice-temp-send"><i class="layui-icon layui-icon-release"></i></button>' +
'</div>'
}]],
done: function (res) {
... ... @@ -229,7 +229,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'laydate'
// 手动发送
$('.link-notice-temp-send').click(function () {
openUserWindow($(this).data('subid'),res.data[$(this).data('index')]);
openUserWindow($(this).data('subid'),res.data[$(this).data('layindex')]);
});
// 绑定订阅事件
... ...
... ... @@ -7,14 +7,14 @@
<div class="lay-row">
<div class="lay-row-item lay-row-item--auto-width">
<h5 class="lay-row-title">基本信息<i data-id="ali_cloud_ecs_baseinfo" class="iconfont detail_base_info">&#xe61e;</i></h5>
<ul class="info-table info-ali-cloud-ecs" id="ali_cloud_ecs_baseinfo"></ul>
<ul class="info-table" id="ali_cloud_ecs_baseinfo"></ul>
</div>
</div>
<div class="lay-row">
<div class="lay-row-item lay-row-item--auto-width">
<div class="lay-row-item lay-row-item--small">
<h5 class="lay-row-title">维保信息</h5>
<ul class="info-table" id="ali_cloud_ecs_wbinfo"></ul>
</div>
</div>
<div class="lay-row">
<div class="lay-row-item">
<h5 class="lay-row-title">CPU使用率
<a class="detail_row_menu hide">
... ... @@ -30,8 +30,6 @@
</li>
</ul>
</div>
</div>
<div class="lay-row">
<div class="lay-row-item">
<h5 class="lay-row-title">内存使用率
<a class="detail_row_menu hide">
... ... @@ -118,4 +116,4 @@
fn(JSON.parse(parm));
}
});
</script>
\ No newline at end of file
</script>
... ...
<div>
<el-row>
<el-col :span="24">
<div class="set-add-div">
<el-row style="margin-bottom: 5px;margin-top: 5px">
<el-col :span="24">
<div class="flex-div-start margin-top-bottom-10">
<el-tooltip>
<template #content>关键字检索包含<br/>资源名称<br/>IP地址</template>
<el-input style="width:160px;margin-left: 10px;float: left;" class="margin-right-10"
v-model="keyWords"
placeholder="输入关键字"
clearable/>
</el-input>
</el-tooltip>
<el-dropdown style="margin-top: -15px;margin-left: 10px;float: left;">
<el-icon class="el-icon--right">
<arrow-down/>
</el-icon>
<cm-biz-type-tree-input multiple clearable collapseTags @callback="getBizType"/>
</el-dropdown>
<el-dropdown style="margin-top: -15px;margin-left: 10px;float: left;">
<el-icon class="el-icon--right">
<arrow-down/>
</el-icon>
<cm-res-type-tree-input multiple clearable collapseTags @callback="getResType"/>
</el-dropdown>
<div class="flex-div-start" style="float: left;">
<!-- <el-button type="primary" @click="onReset()">重置</el-button>-->
<el-button type="primary" @click="onBtnSearch()" style="margin-left: 10px">查询</el-button>
</div>
</div>
</el-col>
</el-row>
<el-row>
<div class="flex-div-start" style="margin: 4px;">
<el-button type="primary" @click="save()" style="margin-left: 10px">新增</el-button>
<el-button type="primary" @click="deleteOther()" style="margin-left: 10px">删除</el-button>
</div>
</el-row>
<el-row class="margin-bottom-50">
<el-col :span="24" class="table-height">
<cm-table-page :columns="columns"
:dataList="portSenseData"
:total="count"
:pageSize="pageSize"
@loaddata="loadTableDataList"
@selectionChange="selectionChange"
:showIndex="true"
:showSelection="true"
:showBorder="true"
:loading="loading"
:showPage="true"
:showTools="true"
:height="(height - 150)">
<template #default="{row,prop,column}">
<div v-if="prop == 'resName'">
<!-- 资源名称点击事件 -->
<el-tooltip placement="top">
<el-button type="text" size="small" @click.prevent="resourceClick(row)">
<span class="">{{row.resName}}</span>
</el-button>
<template #content>{{row.resName}}</template>
</el-tooltip>
</div>
</template>
<template #tools="{scope}">
<el-button type="text" size="small" @click.prevent="deleteItem(scope.row,scope.$index)">
<i class="el-icon-delete"/>
</el-button>
</template>
</cm-table-page>
</el-col>
</el-row>
<div class="container" :style="{'height':height+'px','max-height':height+'px','padding':'10px 0 10px 10px','background':'#fff','box-sizing':'border-box'}">
<div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%','padding-top':'3px'}">
<div class="search">
<div class="condition esData-conditon" style="justify-content: space-between;width: 100%;">
<el-form :inline="true">
<el-form-item>
<el-tooltip placement="bottom-start">
<template #content> 资源名称 <br /> 资源ip <br /> 业务名称</template>
<el-input clearable :size="$global.elementConfig.size.input" v-model="keyWords" placeholder="关键字检索" />
</el-tooltip>
</el-form-item>
<el-form-item style="margin-top: 9px;">
<el-dropdown>
<cm-res-type-tree-input :size="$global.elementConfig.size.input" @callback="getResType" clearable collapseTags multiple/>
</el-dropdown>
</el-form-item>
<el-form-item style="margin-top: 9px;">
<el-dropdown>
<cm-biz-type-tree-input :size="$global.elementConfig.size.input" @callback="getBizType" clearable collapseTags multiple/>
</el-dropdown>
</el-form-item>
<el-form-item style="margin-left: -30px;margin-top: -6px;">
<el-button @click="onBtnSearch()" :size="$global.elementConfig.size.button" type="primary" style="margin-left: 6px">查询</el-button>
<el-button type="primary" @click="save()" style="margin-left: 6px">新增</el-button>
<el-button type="primary" @click="deleteOther()" style="margin-left: 6px">删除</el-button>
</el-form-item>
</el-form>
</div>
</el-col>
</el-row>
</div>
<div class="search-table">
<cm-table-page :columns="columns"
:dataList="portSenseData"
:total="count"
:pageSize="pageSize"
@loaddata="loadTableDataList"
@selectionChange="selectionChange"
:showIndex="true"
:showSelection="true"
:showBorder="true"
:loading="loading"
:showPage="true"
:showTools="true"
:height="(height - 150)">
<template #default="{row,prop,column}">
<div v-if="prop == 'resName'">
<!-- 资源名称点击事件 -->
<el-tooltip placement="top">
<el-button type="text" size="small" @click.prevent="resourceClick(row)">
<span class="">{{row.resName}}</span>
</el-button>
<template #content>{{row.resName}}</template>
</el-tooltip>
</div>
</template>
<template #tools="{scope}">
<el-button type="text" size="small" @click.prevent="deleteItem(scope.row,scope.$index)">
<i class="el-icon-delete"/>
</el-button>
</template>
</cm-table-page>
</div>
</div>
</div>
<!--弹框-->
<cm-dialog :title="title" width="80%" :showDialogVisible="showPortSense" :showFooter="false" @hidedialog="showPortSenseDialog" :showOkBtn="false" cancelText="关闭">
<template v-slot>
<port-sense-config :parameter="portSenseConfigData"></port-sense-config>
</template>
</cm-dialog>
</div>
\ No newline at end of file
<!--弹框-->
<cm-dialog :title="title" width="80%" :showDialogVisible="showPortSense" :showFooter="false" @hidedialog="showPortSenseDialog" :showOkBtn="false" cancelText="关闭">
<template v-slot>
<port-sense-config :parameter="portSenseConfigData"></port-sense-config>
</template>
</cm-dialog>
... ...
... ... @@ -175,21 +175,22 @@ export default {
}
//删除单个数据
let deleteItem = (row, index) => {
proxy.$global.confirm("确认删除吗?", function () {
deleteItems([row.resId]);
})
deleteItems([row.resId]);
}
//删除多个或单个
let deleteItems = (list) => {
let params = {
redIds: list.toString()
}
proxy.$http.get('/api-web/bResourceExtendParam/delete', params, function (res) {
if (res && res.success) {
proxy.$global.showMsg('删除成功');
loadTableDataList({page: 1, limit: pageSize.value});
}
proxy.$global.confirm("确认删除吗?", function () {
proxy.$http.get('/api-web/bResourceExtendParam/delete', params, function (res) {
if (res && res.success) {
proxy.$global.showMsg('删除成功');
loadTableDataList({page: 1, limit: pageSize.value});
}
})
})
}
//添加
let save = () => {
... ... @@ -230,7 +231,12 @@ export default {
let list = pitch.value.map(item => {
return item.resId;
})
deleteItems(list);
if (list != null && list != ''){
deleteItems(list);
}else {
proxy.$global.showMsg("请选择需要删除的端口侦测数据","warning");
}
};
//重新加载表格数据
let loadTableDataList = ({page, limit}) => {
... ... @@ -280,4 +286,4 @@ export default {
showPortSenseDialog,
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -162,7 +162,28 @@ export default {
resId: "",
resIdList: resIdArr.value,
}
portSenseConfigData.value.push(data);
var length = portSenseConfigData.value.length
if (length == 0){
portSenseConfigData.value.push(data);
}
if (portSenseConfigData.value[length-1].protocolType == '' || portSenseConfigData.value[length-1].protocolType == null){
proxy.$global.showMsg('请填写协议类型','warning');
return false;
}else if (portSenseConfigData.value[length-1].port == '' || portSenseConfigData.value[length-1].port == null){
proxy.$global.showMsg('请填写端口号','warning');
return false;
}else if (portSenseConfigData.value[length-1].intervalTime == '' || portSenseConfigData.value[length-1].intervalTime == null){
proxy.$global.showMsg('请填写间隔时长','warning');
return false;
}else if (portSenseConfigData.value[length-1].portDesc == '' || portSenseConfigData.value[length-1].portDesc == null){
proxy.$global.showMsg('请填写端口备注','warning');
return false;
}else{
portSenseConfigData.value.push(data);
}
}
//下拉框值改变事件
let changePortSense = () => {
... ... @@ -331,4 +352,4 @@ export default {
portSenseSelectData
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -28,7 +28,7 @@ export default {
let initState = Vue.ref(true);
//初始化
let init = () => {
rowMaxHeight.value = "max-height: 75px;";
rowMaxHeight.value = "max-height: 58px;";
initState.value = true;
showIcon.value = "el-icon-arrow-down";
}
... ... @@ -77,7 +77,7 @@ export default {
}
//是否展开点击
let changeItem = () => {
rowMaxHeight.value = initState.value ? "" : "max-height: 75px;";
rowMaxHeight.value = initState.value ? "" : "max-height: 58px;";
showIcon.value = initState.value ? "el-icon-arrow-up" : "el-icon-arrow-down";
initState.value = !initState.value;
}
... ... @@ -91,4 +91,4 @@ export default {
changeItem
}
}
}
\ No newline at end of file
}
... ...