Authored by xwx

Merge branch 'master-500-dev' of http://113.200.75.45:82/monitor_v3/hg-monitor-w…

…eb into master-500-dev-xwx
... ... @@ -2976,8 +2976,7 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
sort: true,
templet: '#weblogicIpTpl'
},
{field: 'resName', title: '资源名称', minWidth: x_200, sort: true,
templet: '<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}}" class="layui-table-link">{{ d.resName }}</span></div>'},
{field: 'resName', title: '资源名称', minWidth: x_200, sort: true,templet: '#resindex_resName'},
{field: 'health', title: '健康状态', minWidth: x_110, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'serverState', title: '服务状态', minWidth: x_120, align: 'center', sort: true},
{field: 'queueLength', title: '队列长度', minWidth: x_110, align: 'center', templet: '#queueLengthTpl'},
... ... @@ -3024,9 +3023,7 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
"MIDDLEWARE_WEBLOGICCONSOLE": [
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
{
field: 'resName', title: '资源名称', minWidth: 250, sort: true,
templet: '<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}}" class="layui-table-link">{{ d.resName }}</span></div>'
},
field: 'resName', title: '资源名称', minWidth: 250, sort: true,templet: '#resindex_resName' },
// {field: 'shortName', title: '别名', minWidth: 100, align: 'center', sort: true, templet:'#shortNameTpl'},
{field: 'health', title: '健康状态', minWidth: 83, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', minWidth: 161, align: 'center', sort: true},
... ... @@ -4797,18 +4794,18 @@ layui.define(['soulTable', 'commonDetail', 'common', 'laytpl', 'view', 'admin',
"DATABASE_OGG": [
{field: 'ip', title: 'IP地址', width: 130, align: 'center', sort: true},
{
field: 'resName', title: '资源名称', width: resNameWidth, sort: true,
field: 'resName', title: '资源名称', minWidth: resNameWidth, sort: true,
templet: '#resindex_resName'
//lsq 资源名称用模板 2022-08-29
// templet: '<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.adminName }}" data-pingenable="{{d.pingEnable}}" class="layui-table-link">{{ d.resName }}</span></div>'
},
// {field: 'shortName', title: '别名', width: 100, align: 'center', sort: true, templet:'#shortNameTpl'},
{field: 'health', title: '健康状态', width: 86, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'health', title: '健康状态', width: 100, align: 'center', sort: true, templet: '#healthTpl'},
{field: 'lastColTime', title: '最近采集时间', width: 161, align: 'center', sort: true},
{field: 'linkState', title: '连接状态', align: 'center', width: 85, templet: '#linkStateTpl', sort: true},
{field: 'adminName', title: '负责人', width: 123, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 118, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 98, align: 'center', sort: true, templet: '#resStateTpl'}
{field: 'linkState', title: '连接状态', align: 'center', width: 120, templet: '#linkStateTpl', sort: true},
{field: 'adminName', title: '负责人', width: 133, align: 'center', sort: true},
{field: 'adminPhone', title: '负责人电话', width: 128, align: 'center', sort: true},
{field: 'state', title: '资源状态', width: 110, align: 'center', sort: true, templet: '#resStateTpl'}
],
"HOST_X86_SIGN": [
//{type: 'numbers', title: '序号', align: 'center', fixed: 'left'},
... ...
... ... @@ -1708,7 +1708,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
var alarmMsg = new msgTips({
dom: ".right-bottom-tips",
title: "告警消息",
message: `<p style="line-height: 40px">您有【${alarm}】条告警未处理,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${alarm}】条告警未处理,请及时关注</p>`,
duration: 15000,
space: 10,
firstSpace: 8,
... ... @@ -1749,7 +1749,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
dom: ".right-bottom-tips",
title: "工作日志未读消息",
duration: 15000,
message: `<p style="line-height: 40px">您有【${notRead}】条工作汇报未读,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${notRead}】条工作汇报未读,请及时关注</p>`,
toastType: 'warning',
space: 10,
type: 'click',
... ... @@ -1783,7 +1783,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
dom: ".right-bottom-tips",
title: "监控资源即将过期提示消息",
duration: 15000,
message: `<p style="line-height: 40px">共有【${toTimeOut}】个资源的监控账号将在${toTimeOutDay}天内过期</p>`,
message: `<p style="line-height: 20px">共有【${toTimeOut}】个资源的监控账号将在${toTimeOutDay}天内过期</p>`,
toastType: 'warning',
space: 10,
type: 'click',
... ... @@ -1843,7 +1843,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
var duty = new msgTips({
dom: ".right-bottom-tips",
title: "值班调换消息",
message: `<p style="line-height: 40px">您有【${dutyMessage.count}】条调换值班信息未处理,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${dutyMessage.count}】条调换值班信息未处理,请及时关注</p>`,
duration: 3 * 60 * 1000,
space: 10,
firstSpace: 8,
... ...
... ... @@ -1530,7 +1530,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
var alarmMsg = new msgTips({
dom: ".right-bottom-tips",
title: "告警消息",
message: `<p style="line-height: 40px">您有【${alarm}】条告警未处理,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${alarm}】条告警未处理,请及时关注</p>`,
duration: 15000,
space: 10,
firstSpace: 8,
... ... @@ -1571,7 +1571,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
dom: ".right-bottom-tips",
title: "工作日志未读消息",
duration: 15000,
message: `<p style="line-height: 40px">您有【${notRead}】条工作汇报未读,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${notRead}】条工作汇报未读,请及时关注</p>`,
toastType: 'warning',
space: 10,
type: 'click',
... ... @@ -1588,7 +1588,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
// dom:".right-bottom-tips",
// title: "重复监控资源提示消息",
// duration:15000,
// message:`<p style="line-height: 40px">共有【${doubleCheck}】个资源重复监控,请及时处理</p>`,
// message:`<p style="line-height: 20px">共有【${doubleCheck}】个资源重复监控,请及时处理</p>`,
// toastType:'warning',
// space:10,
// type:'click',
... ... @@ -1605,7 +1605,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
dom: ".right-bottom-tips",
title: "监控资源即将过期提示消息",
duration: 15000,
message: `<p style="line-height: 40px">共有【${toTimeOut}】个资源的监控账号将在${toTimeOutDay}天内过期</p>`,
message: `<p style="line-height: 20px">共有【${toTimeOut}】个资源的监控账号将在${toTimeOutDay}天内过期</p>`,
toastType: 'warning',
space: 10,
type: 'click',
... ... @@ -1665,7 +1665,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
var duty = new msgTips({
dom: ".right-bottom-tips",
title: "值班调换消息",
message: `<p style="line-height: 40px">您有【${dutyMessage.count}】条调换值班信息未处理,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${dutyMessage.count}】条调换值班信息未处理,请及时关注</p>`,
duration: 3 * 60 * 1000,
space: 10,
firstSpace: 8,
... ...
... ... @@ -122,7 +122,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
var alarmMsg = new msgTips({
dom: ".right-bottom-tips",
title: "告警消息",
message: `<p style="line-height: 40px">您有【${alarm}】条告警未处理,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${alarm}】条告警未处理,请及时关注</p>`,
duration: 15000,
space: 10,
firstSpace: 8,
... ... @@ -163,7 +163,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
dom: ".right-bottom-tips",
title: "工作日志未读消息",
duration: 15000,
message: `<p style="line-height: 40px">您有【${notRead}】条工作汇报未读,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${notRead}】条工作汇报未读,请及时关注</p>`,
toastType: 'warning',
space: 10,
type: 'click',
... ... @@ -180,7 +180,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
// dom: ".right-bottom-tips",
// title: "重复监控资源提示消息",
// duration: 15000,
// message: `<p style="line-height: 40px">共有【${doubleCheck}】个资源重复监控,请及时处理</p>`,
// message: `<p style="line-height: 20px">共有【${doubleCheck}】个资源重复监控,请及时处理</p>`,
// toastType: 'warning',
// space: 10,
// type: 'click',
... ... @@ -197,7 +197,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
dom: ".right-bottom-tips",
title: "监控资源即将过期提示消息",
duration: 15000,
message: `<p style="line-height: 40px">共有【${toTimeOut}】个资源的监控账号将在${toTimeOutDay}天内过期</p>`,
message: `<p style="line-height: 20px">共有【${toTimeOut}】个资源的监控账号将在${toTimeOutDay}天内过期</p>`,
toastType: 'warning',
space: 10,
type: 'click',
... ... @@ -257,7 +257,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
var duty = new msgTips({
dom: ".right-bottom-tips",
title: "值班调换消息",
message: `<p style="line-height: 40px">您有【${dutyMessage.count}】条调换值班信息未处理,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${dutyMessage.count}】条调换值班信息未处理,请及时关注</p>`,
duration: 3 * 60 * 1000,
space: 10,
firstSpace: 8,
... ...
... ... @@ -228,7 +228,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'msgTips'
var alarmMsg = new msgTips({
dom: ".right-bottom-tips",
title: "告警消息",
message: `<p style="line-height: 40px">您有【${alarm}】条告警未处理,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${alarm}】条告警未处理,请及时关注</p>`,
duration: 15000,
space: 10,
firstSpace: 8,
... ... @@ -269,7 +269,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'msgTips'
dom: ".right-bottom-tips",
title: "工作日志未读消息",
duration: 15000,
message: `<p style="line-height: 40px">您有【${notRead}】条工作汇报未读,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${notRead}】条工作汇报未读,请及时关注</p>`,
toastType: 'warning',
space: 10,
type: 'click',
... ... @@ -286,7 +286,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'msgTips'
// dom:".right-bottom-tips",
// title: "重复监控资源提示消息",
// duration:15000,
// message:`<p style="line-height: 40px">共有【${doubleCheck}】个资源重复监控,请及时处理</p>`,
// message:`<p style="line-height: 20px">共有【${doubleCheck}】个资源重复监控,请及时处理</p>`,
// toastType:'warning',
// space:10,
// type:'click',
... ... @@ -303,7 +303,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'msgTips'
dom: ".right-bottom-tips",
title: "监控资源即将过期提示消息",
duration: 15000,
message: `<p style="line-height: 40px">共有【${toTimeOut}】个资源的监控账号将在${toTimeOutDay}天内过期</p>`,
message: `<p style="line-height: 20px">共有【${toTimeOut}】个资源的监控账号将在${toTimeOutDay}天内过期</p>`,
toastType: 'warning',
space: 10,
type: 'click',
... ... @@ -871,7 +871,7 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'msgTips'
var duty = new msgTips({
dom: ".right-bottom-tips",
title: "值班调换消息",
message: `<p style="line-height: 40px">您有【${dutyMessage.count}】条调换值班信息未处理,请及时关注</p>`,
message: `<p style="line-height: 20px">您有【${dutyMessage.count}】条调换值班信息未处理,请及时关注</p>`,
duration: 3 * 60 * 1000,
space: 10,
firstSpace: 8,
... ...
... ... @@ -525,7 +525,7 @@ layui.extend({
new msgTips({
dom: ".right-bottom-tips",
title: title,
message: `<p style="line-height: 40px">${content}</p>`,
message: `<p style="line-height: 20px">${content}</p>`,
duration: 10000,
space: 10,
firstSpace: 8,
... ... @@ -651,17 +651,17 @@ layui.extend({
connectFlg = false;
if (location.hash.indexOf('#/user/login') == -1) {
//lsq 注释掉多无提示框 2022-08-28
/* // 调用测试接口,出现过期则会跳转到登录页面
// 调用测试接口,出现过期则会跳转到登录页面
try {
$.ajax({
url: domainName + "/api-web/common/test",
type: "get",
async: false,
success: function (res) {
$('head').append('<style id="ew-tree-table-css">' + res + '</style>');
console.log("检查登录状态:",'正常')
},
error:(error)=>{
console.error("检查登录状态:",error)
if(error.status === 401){
window.top.location.reload();
return;
... ... @@ -675,7 +675,7 @@ layui.extend({
tryIndex = 1;
// 服务异常:服务重启,网络问题等不可访问等因素
tryFunc();
}*/
}
} else {
tryIndex = 1;
tryFunc();
... ...
... ... @@ -132,7 +132,7 @@
<span class="icon-bg" @click.prevent="getFile(scope.row)">
<i class="el-icon-view" title="查看"/>
</span>
<span class="icon-bg" @click.prevent="aloneHandle(scope.row,'download')">
<span class="icon-bg" v-if="scope.row.type != 'folder'" @click.prevent="aloneHandle(scope.row,'download')">
<i class="el-icon-download" title="下载"/>
</span>
<span class="icon-bg" @click.prevent="aloneHandle(scope.row,'delete')">
... ...
<div>
<div >
<!-- 表格-->
<el-table :border="showBorder" :data="dataList" :default-expand-all="defaultExpand" :expand-row-keys="expands"
:height="height" :row-key="getRowKeys" :size="size" @select="handleSelect"
@select-all="handleSelectAll"
@selection-change="handleSelectionChange" header-row-class-name="tbl-header-class" ref="multipleTable"
stripe
style="width: 100%;margin: 0px 0px; font-size:13.5px;" v-loading="loading"
<el-table :border="showBorder" v-loading="loading" :size="size" ref="multipleTable" @selection-change="handleSelectionChange" :data="dataList" stripe header-row-class-name="tbl-header-class" :height="height"
style="width: 100%;margin: 0px 0px; font-size:13.5px;" :row-key="getRowKeys" :expand-row-keys="expands" :default-expand-all="defaultExpand"
@select="handleSelect" @select-all="handleSelectAll"
>
<el-table-column type="expand" v-if="showExpand">
<template #default="scope">
<slot :scope="scope" name="expand">
<slot name="expand" :scope="scope" >
</slot>
</template>
</el-table-column>
<el-table-column align="center" type="selection" v-if="showSelection && columns.length > 0" width="55"/>
<el-table-column :label="indexLabel" align="center" type="index" v-if="showIndex && columns.length > 0"
width="50"/>
<el-table-column v-if="showSelection && columns.length > 0" align="center" type="selection" width="55" />
<el-table-column v-if="showIndex && columns.length > 0" type="index" :label="indexLabel" align="center" width="80"/>
<el-table-column :align="item.align == undefined ? 'center' : item.align " :label="item.label" :prop="item.prop"
:sortable="item.sortable == undefined ? false : item.sortable"
:width="getWidth(item.width)"
v-for="item in columns">
<template v-if="!item.columns || item.columns.lendth==0" #default="scope">
<slot :column="item" :prop="item.prop" :row="scope.row">
<div v-if="typeof(item.click) == 'function' && typeof(item.render) == 'function'">
<span @click="item.click(scope.row)" style="cursor: pointer"
v-html="item.render(scope.row)"></span>
<el-table-column v-for="item in columns" :prop="item.prop" :label="item.label" :sortable="item.sortable == undefined ? false : item.sortable" :align="item.align == undefined ? 'center' : item.align "
:width="getWidth(item.width)">
<template #default="scope">
<slot :row="scope.row" :prop="item.prop" :column="item">
<div v-if="typeof(item.click) == 'function' && typeof(item.render) == 'function'">
<span style="cursor: pointer" @click="item.click(scope.row)" v-html="item.render(scope.row)"></span>
</div>
<div v-else-if="typeof(item.click) == 'function'">
<span @click="item.click(scope.row)" style="cursor: pointer"> {{scope.row[item.prop]}}</span>
<div v-else-if="typeof(item.click) == 'function'" >
<span style="cursor: pointer" @click="item.click(scope.row)"> {{scope.row[item.prop]}}</span>
</div>
<div v-else-if="typeof(item.render) == 'function'">
<div v-else-if="typeof(item.render) == 'function'" >
<span v-html="item.render(scope.row)">{{scope.row[item.prop]}}</span>
</div>
<span v-else>
<el-tooltip placement="top">
<template #content>
<el-tooltip placement="top-start" :disabled="scope.row.isShowTooltip == undefined || scope.row.isShowTooltip == false">
<template #content >
<div v-html="getTextContent(scope.row[item.prop])">
</div>
</template>
<div style="overflow: hidden; text-overflow: ellipsis;display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;">
<div class="text-overflow-line2" @mouseenter="tableColMouseenter($event,scope.row)">
{{scope.row[item.prop]}}
</div>
</el-tooltip>
</span>
</slot>
</template>
<el-table-column v-else :align="columnItem.align == undefined ? 'center' : columnItem.align " :label="columnItem.label" :prop="columnItem.prop"
:sortable="columnItem.sortable == undefined ? false : columnItem.sortable"
:width="getWidth(columnItem.width)"
v-for="columnItem in item.columns">
<template #default="scope">
<slot :column="columnItem" :prop="columnItem.prop" :row="scope.row">
<div v-if="typeof(columnItem.click) == 'function' && typeof(columnItem.render) == 'function'">
<span @click="columnItem.click(scope.row)" style="cursor: pointer"
v-html="columnItem.render(scope.row)"></span>
</div>
<div v-else-if="typeof(columnItem.click) == 'function'">
<span @click="columnItem.click(scope.row)" style="cursor: pointer"> {{scope.row[columnItem.prop]}}</span>
</div>
<div v-else-if="typeof(columnItem.render) == 'function'">
<span v-html="columnItem.render(scope.row)">{{scope.row[columnItem.prop]}}</span>
</div>
<span v-else>
<el-tooltip placement="top">
<template #content>
<div v-html="getTextContent(scope.row[columnItem.prop])">
</div>
</template>
<div style="overflow: hidden; text-overflow: ellipsis;display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;">
{{scope.row[columnItem.prop]}}
</div>
</el-tooltip>
</span>
</slot>
</template>
</el-table-column>
</el-table-column>
<el-table-column align="center" label="操作" v-if="showTools && columns.length > 0" width="80">
<el-table-column v-if="showTools && columns.length > 0" fixed="right" label="操作" :width="toolsWith" align="center">
<template #default="scope">
<slot :scope="scope" name="tools"></slot>
<slot name="tools" :scope="scope" ></slot>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div style='text-align: left;background-color: white' v-if="showPage">
<el-pagination
@size-change="handleSizeChange"
@prev-click="prePage"
@next-click="nextPage"
@current-change="handleCurrentChange"
:current-page="currentPage"
:layout="layout"
:page-size="pageSize"
:page-sizes="pageSizes"
:total="total"
@current-change="handleCurrentChange"
@next-click="nextPage"
@prev-click="prePage"
@size-change="handleSizeChange">
:page-size="pageSize"
:layout="layout"
:total="total">
</el-pagination>
</div>
</div>
... ...
... ... @@ -36,7 +36,7 @@ export default {
// 分页页码设置
pageSizes: {
type: Array,
default: [10, 50, 100, 200, 300, 400]
default: [10,50,100, 200, 300, 400]
},
// 默认展示
pageSize: {
... ... @@ -67,46 +67,50 @@ export default {
default: []
},
// 是否展示加载
loading: {
loading:{
type: Boolean,
default: false
},
maxWidth: {
maxWidth:{
type: Number,
default: window.innerWidth
},
showTools: {
showTools:{
type: Boolean,
default: false
},
toolsWith:{
type: Number,
default: 80
},
// medium / small / mini
size: {
size:{
type: String,
default: 'small'
},
multipleSelection: {
type: Array,
default: []
multipleSelection:{
type:Array,
default:[]
},
//展开行
showExpand: {
showExpand:{
type: Boolean,
default: false
},
//行数据的key
getRowKeys: {
getRowKeys:{
type: String,
default: 'id'
},
//默认展开哪行
expands: {
expands:{
type: Array,
default: []
},
//是否默认展开所有行
defaultExpand: {
type: Boolean,
default: false
defaultExpand:{
type:Boolean,
default:false
}
},
data() {
... ... @@ -125,22 +129,22 @@ export default {
* 时间:2021/11/16 16:19
*/
let getWidth = (width) => {
let maxWidth = (function () {
let getWidth = (width) =>{
let maxWidth = (function (){
let cols = props.columns;
if (cols && cols.length > 0) {
if(cols && cols.length > 0){
// 求和
let w = 0;
cols.forEach(function (v) {
w += parseFloat(v.width);
w += parseFloat(v.width) ;
})
let max = props.maxWidth;
if (props.showTools) {
if(props.showTools){
max -= 80;
}
if (w < max) {
if(w < max){
return max / w * width;
}
}
... ... @@ -151,7 +155,7 @@ export default {
}
let callback = () => {
let callback = () =>{
let params = {
page: currentPage.value, limit: pageSize.value
}
... ... @@ -183,7 +187,7 @@ export default {
let prePage = (val) => {
// console.log(`当前页: ${val}`)
// props.currentPage = val - 1;
currentPage.value = val - 1;
currentPage.value = val-1;
callback();
}
... ... @@ -191,7 +195,7 @@ export default {
let nextPage = (val) => {
// console.log(`当前页: ${val}`)
// props.currentPage = val + 1;
currentPage.value = val + 1;
currentPage.value = val+1;
callback();
}
... ... @@ -201,13 +205,13 @@ export default {
// });
//全选事件
let handleSelectionChange = (val) => {
let handleSelectionChange=(val)=>{
// multipleSelection.value = val
emit('selectionChange', val)
}
//设置默认选中
let toggleSelection = (rows) => {
let toggleSelection=(rows)=> {
//console.log("rows",rows)
proxy.$nextTick(function () {
//console.log("set",props.dataList,props.multipleSelection)
... ... @@ -223,18 +227,18 @@ export default {
})
}
let getTextContent = (val) => {
if (val && val != '' && val != null) {
val = val + ''.replace(/[^\x00-\xff]/g, "$&\x01").replace(/.{50}\x01?/g, "$&<br/>").replace(/\x01/g, "");
let getTextContent = (val) =>{
if(val && val != '' && val != null){
val = val+''.replace(/[^\x00-\xff]/g,"$&\x01").replace(/.{50}\x01?/g,"$&<br/>").replace(/\x01/g,"");
}
return val;
return `<pre>${val}</pre>`;
}
//设置父节点选中后children也选中
let setChecked = (row) => {
let arr = [];
if (row.children) {
row.children.map(j => {
let setChecked=(row)=>{
let arr=[];
if(row.children){
row.children.map(j=>{
arr.push(j)
setChecked(j)
})
... ... @@ -242,43 +246,67 @@ export default {
toggleSelection(arr)
}
//勾选数据行的Checkbox事件
let handleSelect = (selection, row) => {
let handleSelect=(selection, row)=>{
/* if(selection.some(el=>{ return row[props.getRowKeys] ===el[props.getRowKeys]})){
setChecked(row);
}else{
setChecked(row);
}*/
setChecked(row);
emit('handleSelect', selection)
emit('handleSelect',selection)
}
//勾选全选checkbox事件
let handleSelectAll = (selection) => {
const isSelect = selection.some(el => {
const tableDataIds = props.dataList.map(j => j[props.getRowKeys])
let handleSelectAll=(selection)=>{
const isSelect=selection.some(el=>{
const tableDataIds=props.dataList.map(j=>j[props.getRowKeys])
return tableDataIds.includes(el.id)
})
const isCancel = !props.dataList.every(el => {
const selectIds = selection.map(j => j[props.getRowKeys])
const isCancel=!props.dataList.every(el=>{
const selectIds=selection.map(j=>j[props.getRowKeys])
return selectIds.includes(el.id)
})
if (isSelect) {
if(isSelect){
setChecked(selection);
}
if (isCancel) {
props.dataList.map(el => {
if(isCancel){
props.dataList.map(el=>{
setChecked(el);
})
}
emit('handleSelectAll', selection)
emit('handleSelectAll',selection)
}
/**
* 表格组件,超过2行展示tooltip
* @param e
* @param item
*/
const tableColMouseenter = (e, item) => {
const ev = e.target;
var height = $(ev).scroll().height()
// 超过2行 46
if (height > 45) {
// 实际高度 > 可视高度 文字溢出
item.isShowTooltip = true;
} else {
// 否则为不溢出
item.isShowTooltip = false;
}
}
// 挂载完
Vue.onMounted(() => {
//callback();
})
Vue.watch(() => props.dataList, (newValue, oldValue) => {
setTimeout(function () {
if (props.showSelection) {
toggleSelection(props.multipleSelection)
}
}, 100)
Vue.watch(()=>props.dataList,(newValue, oldValue)=>{
setTimeout(function (){
if(props.showSelection){
toggleSelection(props.multipleSelection)
}
},100)
})
... ... @@ -296,7 +324,8 @@ export default {
prePage,
nextPage,
getWidth,
getTextContent
getTextContent,
tableColMouseenter
}
}
}
... ...
... ... @@ -12,6 +12,7 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
var commonDetail = layui.commonDetail;
var domainName = common.domainName;
var todayStr = '';
var knowledgeData = '';//lsq 定义获取告警中心知识库跳转设置数据 2022-08-30
//对外暴露的接口
exports('activewarning', function () {
var sessions = layui.sessions;
... ... @@ -48,6 +49,18 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
form.render("select");
function initDate() {
//lsq 获取告警中心知识库跳转设置 2022-08-30
if(!knowledgeData){
admin.req({
url: common.domainName + '/api-web/manage/ddic/findSucDdics/warnKnowledge'
, method: 'POST'
, async: false
}).done(function (res) {
if(res && res.data && res.data.length>0){
knowledgeData=res.data[0];
}
})
}
let startMin = {};
let endMax = {};
//开始时间
... ... @@ -778,8 +791,7 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
<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>
<a class="layui-icon reslist-view-topo hide" data-resid="{{d.resId}}" lay-tips="查看资源拓扑"></a>
</div>
</div>
`
... ... @@ -820,8 +832,18 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
, {field: 'adminName', title: '负责人', align: 'center', width: 180}
, {field: 'noticeTime', title: '通知时间', align: 'center', width: 180, hide: true}
, {
title: '操作', align: 'center', minWidth: 100,
templet: '<div><span data-warn-view="{{d.id}}" class="layui-table-link">查看</span> <span data-warn-path="{{d.id}}" class="layui-table-link">轨迹</span></div>'
title: '操作', align: 'center', minWidth: 150,
templet: function (row){
let knoStr='';
if(knowledgeData && knowledgeData.ddicCode.indexOf(':on')!=-1){
let dataKno=` data-row='`+JSON.stringify([row])+`'`;
knoStr=' <span data-warn-knowledge="'+row.id+'" '+dataKno+' class="layui-table-link">知识</span>'
}
return '<div><span data-warn-view="'+row.id+'" class="layui-table-link">查看</span>' +
' <span data-warn-path="'+row.id+'" class="layui-table-link">轨迹</span>' +
knoStr +
'</div>'
}
}
];
... ... @@ -1031,6 +1053,30 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
});
});
});
//start lsq 知识库跳转 2022-08-30
$('[data-warn-knowledge]').unbind('click').on('click',function(){
//lsq 行数据
let dataRowStr=$(this).data('row');
let dataRow=dataRowStr[0];
//lsq 配置的path地址
let desc=knowledgeData.ddicDesc;
//lsq 获取path路径进行相对应得替换
let descArr=desc.split("?");
let descStr='';
let path='';
if(descArr && descArr.length>1){
path+=descArr[0]+'?';
//lsq path中有参数的部分
descStr=descArr[1];
//lsq 替换${kpiName}...
for(let key in dataRow){
descStr= descStr.replace("${"+key+"}",dataRow[key])
}
}
path+=descStr.replace('${accessToken}',accessToken);
window.open(path);
})
//end lsq 2022-08-30
});
//点击严重重要一般统计告警
... ...