Authored by XuHaoJie

Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into master-V32-XuHaoJie

... ... @@ -222,7 +222,7 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
// {field: 'provider', title: '厂商', minWidth: x_130, align: 'center', sort: true},
// {field: 'model', title: '型号', minWidth: x_130, align: 'center', sort: true},
{
field: 'resName', title: '资源名称', minWidth: x_330, sort: true,
field: 'resName', title: '资源名称', minWidth: x_250, sort: true,
templet: '#resindex_resName' },
{field: 'health', title: '健康状态', minWidth: x_110, align: 'center', sort: true, templet: '#healthTpl'},
// {field: 'diskSize', title: '磁盘总大小', minWidth: 120, align: 'center'},
... ...
... ... @@ -637,21 +637,23 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
field: 'alarmNo', title: '告警编号', align: 'center', width: 140, sort: true,
}
, {
field: 'resName', title: '资源名称', width: 230, sort: true,
field: 'resName', title: '资源名称', width: 250, sort: true,
templet:`
<div>
<div style="display: flex;align-items: center;">
{{# if (d.confirmStatus == 0 || d.confirmStatus == null) { }}
<i lay-tips="新的告警未确认,告警确认后消失!" class="shake iconfont" style="color: red;font-size: 28px;">&#xe68b;</i>
{{# } }}
{{# if(d.isBus == 'N'){ }}
<span data-isBus="{{d.isBus}}" data-resid="{{d.resId}}" data-restype="{{d.resType}}" data-warn-zymc="{{d.id}}" data-ip="{{d.ip}}"
<span lay-tips="{{ d.resName }}" style="margin:0 5px;max-width: 160px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;display: inline-block;" data-isBus="{{d.isBus}}" data-resid="{{d.resId}}" data-restype="{{d.resType}}" data-warn-zymc="{{d.id}}" data-ip="{{d.ip}}"
data-resname="{{d.resName}}" data-pingenable="{{d.pingEnable}}" class="layui-table-link">{{d.resName}}</span>
{{# }else{ }}
<span data-isBus="{{d.isBus}}" data-resid="{{d.resId}}" data-restype="{{d.resType}}" data-warn-zymc="{{d.id}}" data-ip="{{d.ip}}"
<span lay-tips="{{ d.resName }}" style="margin:0 5px;max-width: 160px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;display: inline-block;" data-isBus="{{d.isBus}}" data-resid="{{d.resId}}" data-restype="{{d.resType}}" data-warn-zymc="{{d.id}}" data-ip="{{d.ip}}"
data-resname="{{d.resName}}" data-pingenable="{{d.pingEnable}}" >{{d.resName}}</span>
{{# } }}
<a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" lay-tips="查看资源拓扑"><i class="iconfont" style="font-size: 20px;
color: #FEB61E;"></i></a>
</div>
</div>
`
}
... ...
... ... @@ -596,13 +596,13 @@
<!--资源名称-->
<script type="text/html" id="resindex_resName">
<div>
<span data-zymc="{{ d.resId }}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-childrennum="{{d.childrenNum}}" data-ip="{{ d.ip }}" data-resTypeName="{{ d.resTypeName }}" data-admin="{{ d.admin }}" data-adminname="{{ d.adminName }}" data-pingenable="{{d.pingEnable}}" data-manageIp="{{d.manageIp}}" data-collProtocol="{{d.collProtocol}}" data-provider="{{d.provider}}" data-state="{{d.state}}" class="layui-table-link">{{ d.resName }}</span>
<span lay-tips="{{ d.resName }}" style="float: left;width: 180px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;display: inline-block;" data-zymc="{{ d.resId }}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-childrennum="{{d.childrenNum}}" data-ip="{{ d.ip }}" data-resTypeName="{{ d.resTypeName }}" data-admin="{{ d.admin }}" data-adminname="{{ d.adminName }}" data-pingenable="{{d.pingEnable}}" data-manageIp="{{d.manageIp}}" data-collProtocol="{{d.collProtocol}}" data-provider="{{d.provider}}" data-state="{{d.state}}" class="layui-table-link">{{ d.resName }}</span>
{{# if (d.favId == null) { }}
<a class="layui-icon layui-icon-rate hide" data-favid="{{d.favId}}" data-id="{{d.resId}}" lay-tips="加入收藏夹" style="font-size: 14px"></a>
{{# } else { }}
<a class="layui-icon layui-icon-rate-solid" data-favid="{{d.favId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" data-id="{{d.resId}}" lay-tips="移出收藏夹"></a>
<a class="layui-icon layui-icon-rate-solid" data-favid="{{d.favId}}" style="color: #FEB61E; font-size: 14px; margin-left: 1px;" data-id="{{d.resId}}" lay-tips="移出收藏夹"></a>
{{# } }}
<a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" lay-tips="查看资源拓扑"><i class="iconfont">&#XE515;</i></a>
<a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" style="color: #FEB61E; font-size: 14px; margin-left: 1px;" lay-tips="查看资源拓扑"><i class="iconfont">&#XE515;</i></a>
<!--{{# if (d.resCategory == 'share' && d.hardwareFlag && d.hardwareFlag.endsWith("Y")) { }}
<a class="layui-icon reslist-assets-details hide" data-resid="{{d.resId}}" data-restype="{{d.resType}}" data-name="{{d.resName}}" data-ip="{{ d.ip }}" style="color: #FEB61E; font-size: 14px; margin-left: 10px;" lay-tips="资产配置信息"><i class="iconfont">&#XE517;</i></a>
{{# } }}-->
... ...
... ... @@ -2,7 +2,7 @@
<el-row>
<el-col :span="24">
<div class="flex-div-start margin-top-bottom-10">
<el-input class="margin-right-10" v-model="keyWords" placeholder="输入关键字" />
<el-input class="margin-right-10" v-model="keyword" placeholder="输入关键字" />
<div class="flex-div-start">
... ... @@ -18,30 +18,31 @@
<el-row class="margin-top-bottom-10">
<el-col :span="24" class="flex-div-start margin-bottom-10">
<el-check-tag class="tag-item" v-for="(item,index) in tagData" :checked="checkedId==item.id" @click="changeTag(item.id)">{{item.name}}</el-check-tag>
<el-check-tag class="tag-item" v-for="(item,index) in tagData" :checked="checkedId==item.ddicCode" @click="changeTag(item.ddicCode)">{{item.ddicName}}</el-check-tag>
</el-col>
</el-row>
<el-row class="margin-top-bottom-10">
<el-row class="margin-top-bottom-10" v-if="tableDataList.length" >
<el-col :span="24" class="flex-div-start margin-bottom-10">
<!-- <span>匹配项:{{num}}个</span>-->
<span>[筛选:{{num}}个]</span>
<span>[筛选:{{keyword}}]({{count}})</span>
</el-col>
</el-row>
<el-row class="margin-bottom-50">
<el-col :span="24" class="table-height">
<cm-table-page v-show="tableDataList" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList"
<cm-table-page v-if="tableDataList.length" :columns="columns" :dataList="tableDataList" @loaddata="loadTableDataList"
:showIndex="true" :total="count" :showSelection="false"
:showBorder="true" :loading="false" :pageSize="pageSize"
:showPage="true" :showTools="true" :height="(height - 500)">
:showPage="true" :showTools="true" :height="(height - 300)">
<template #tools="{scope}">
<el-button type="text" size="small" @click.prevent="handleView(scope.row,scope.$index)">
查看
</el-button>
</template>
</cm-table-page>
<div class="flex-div-center" v-if="keyword && (!tableDataList || tableDataList.length==0)">暂无数据</div>
</el-col>
</el-row>
... ... @@ -51,8 +52,9 @@
<div class="view-container">
<div class="view-title">Value:</div>
<div class="view-detail">
<div class="detail-data">
{{viewData}}
<div class="detail-data" >
<pre v-html="viewData"></pre>
</div>
</div>
... ...
... ... @@ -12,10 +12,6 @@ export default {
const {proxy} = Vue.getCurrentInstance();
// Start LSQ 2022/1/5
let height = Vue.ref(window.innerHeight - 10);
// 挂载完
Vue.onMounted(() => {
})
//配置项标签数据
let tagData=Vue.ref([{
name:'配置1',
... ... @@ -30,28 +26,31 @@ export default {
//表格字段
let columns=Vue.ref([
{
prop: 'busTypeName',
label: '业务系统',
prop: 'classify1',
label: '一级分类',
sortable: true,
align: 'center',
width:'300'
},
{
prop: 'resName',
label: '资源名称',
prop: 'classify2',
label: '二级分类',
sortable: true,
align: 'center',
width:'300'
},
{
prop: 'key',
label: '缓存key',
sortable: true,
align: 'left',
},
])
let page=Vue.ref(1);
let currentPage=Vue.ref(1);
let pageSize=Vue.ref(10);
let keyWords=Vue.ref();
let keyword=Vue.ref();
let count=Vue.ref(0);
let tableDataList=Vue.ref([{
busTypeName:'电子税务局',
id:'111',
resName:'缓存',
val:'25698458'
}]);
let tableDataList=Vue.ref([]);
let checkedId = Vue.ref(0);
let titleName=Vue.ref('查看数据')
let cacheVisible=Vue.ref(false);
... ... @@ -61,19 +60,74 @@ export default {
//点击标签进行搜索
const changeTag = (status) => {
console.log("aa",status)
checkedId.value = status;
keyword.value=status;
getDataList();
}
//操作按钮 查看
const handleView=(row,index)=>{
viewData.value=row.val;
cacheVisible.value=true;
viewDetail(row.key);
}
//获取配置项列表
let getConf=()=>{
let params={
ddicCategory:'INIT_REDIS_CACHE'
// ddicName:'缓存展示'
}
//api-web/manage/ddic/page
//api-web/ContrastAnalysis/selectTogetherRate
proxy.$http.get(`/api-web/manage/ddic/page`, params, function (res) {
if (res && res.data) {
tagData.value=res.data;
}
});
}
//查看详情
let viewDetail=(val)=>{
let params={
key:val
}
proxy.$http.get(`/api-web/redis/cache/key`, params, function (res) {
if (res && res.object) {
viewData.value =prettyFormat(res.object) ;
}else{
viewData.value='暂无数据';
}
cacheVisible.value=true;
});
}
//格式化json数据
let prettyFormat=(code)=> {
try {
for (const key in code) {
console.log("code",key,typeof code[key])
if (typeof code[key] === 'function') {
let str = code[key];
str = str.toString();
code[key] = str.replace(/\n/g, '<br/>');
}
}
// 设置缩进为2个空格
let str = JSON.stringify(code, null, 2);
str = str
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>');
// str = str.replace(/\n/g, '/r')
return str;
} catch (e) {
console.error('异常信息:' + e);
return '';
}
}
//重新加载表格数据
let loadTableDataList = ({page, limit}) => {
page.value=page;
currentPage.value=page;
pageSize.value=limit;
getDataList()
}
... ... @@ -83,37 +137,46 @@ export default {
}
//获取缓存数据
let getDataList=()=>{
let params={
page:page.value,
pageSize:pageSize.value,
keyWord:keyWords.value,
id:checkedId.value
}
/*proxy.$http.get(`/api-web/`, params, function (res) {
if (res && res.success) {
count.value = res.count;
tableDataList.value = res.data;
if(keyword.value){
let params={
page:currentPage.value,
pageSize:pageSize.value,
keyword:keyword.value,
}
});*/
proxy.$http.get(`/api-web/redis/cache`, params, function (res) {
if (res && res.data) {
count.value = res.count;
tableDataList.value = res.data;
}
});
}
}
//关闭弹框回调函数
let closeDialog=()=>{
cacheVisible.value=false;
}
//关闭弹框
let cancelBtn=()=>{
cacheVisible.value=false;
}
// 挂载完
Vue.onMounted(() => {
getConf();
getDataList();
})
return {
num,
height,
columns,
tagData,
page,
currentPage,
count,
pageSize,
keyWords,
keyword,
tableDataList,
checkedId,
changeTag,
... ... @@ -125,7 +188,10 @@ export default {
titleName,
viewData,
closeDialog,
cancelBtn
cancelBtn,
viewDetail,
prettyFormat,
getConf
}
//End LSQ 2022/1/5
... ...