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
Showing 20 changed files with 963 additions and 15 deletions
<title>CMDB数据同步</title>
<iframe src="/vue3/index.html#/cmdbdatasync" frameborder="0" class="layadmin-iframe" style="height: 99.5%!important;"/>
... ...
<title>日志视图</title>
<iframe src="/vue3/index.html#/esData" frameborder="0" class="layadmin-iframe" style="height: 99.5%!important;"/>
... ...
... ... @@ -5,6 +5,10 @@
@import "../css/cacheData.css";
/*告警消除处理*/
@import "../css/alarmsClear.css";
/*日志详情*/
@import "../css/esData.css";
/*cmdb数据同步*/
@import "../css/cmdbdatasync.css";
.d-flex {
display: flex;
... ...
.protocol-btn{
display: flex;
justify-content: center;
align-items: center;
}
.icon-add{
margin-left:10px;
width:20px;
height:20px;
background: #1e9fff;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.protocol-btn i{
color:#ffffff;
}
\ No newline at end of file
... ...
.esData-detail-container{
padding:0 15px;
min-height: 500px;
max-height:800px;
overflow: auto;
}
.esData-detail-container .info-title{
display: flex;
justify-content: space-between;
margin-bottom: 10px;
padding-top:10px;
font-size: 16px;
margin-top:10px;
}
.esData-detail-container .info-content{
margin-bottom: 5px;
}
.esData-detail-container .info-content-body{
background: #ffffff;
padding:10px 30px;
}
.esData-detail-container .content-body-info{
display: flex;
align-items: center;
justify-content: flex-start;
flex-wrap: wrap;
}
.esData-detail-container .info-item{
width:33%;
margin:8px 0;
text-align: left;
}
.esData-detail-info-content{
text-align: left;
}
\ No newline at end of file
... ...
<div >
<!-- 表格-->
<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;">
style="width: 100%;margin: 0px 0px; font-size:13.5px;" :row-key="getRowKeys" :expand-row-keys="expands">
<el-table-column type="expand" v-if="showExpand">
<template #default="scope">
<slot name="expand" :scope="scope" >
</slot>
</template>
</el-table-column>
<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="50"/>
... ...
... ... @@ -87,6 +87,21 @@ export default {
multipleSelection:{
type:Array,
default:[]
},
//展开行
showExpand:{
type: Boolean,
default: false
},
//行数据的key
getRowKeys:{
type: String,
default: 'id'
},
//是否默认展开所有行
expands:{
type: Array,
default: []
}
},
data() {
... ...
... ... @@ -103,6 +103,18 @@ const routes = [{
name: 'busDoc',
component: () => myImport('views/busDoc/index')
},
//日志
{
path: '/esData',
name: 'esDataIndex',
component: () => myImport('views/esData/index'),
},
//监控对接CMDB功能
{
path: '/cmdbdatasync',
name: 'cmdbdatasync',
component: () => myImport('views/cmdbdatasync/index'),
},
];
// hash模式: createWebHashHistory
... ...
... ... @@ -271,22 +271,28 @@ global.openDetail = (resId, resType, proxy) => {
// 获取资源详情
proxy.$http.get(`/api-web/v32/res/detail/${resId}`, {}, function (res) {
if (res && res.map) {
let data = res.map;
provider = data.provider;
ip = data.ip;
resTypeName = data.resTypeName;
adminName = data.adminName;
manageIp = data.manageIp;
collProtocol = data.collProtocol;
name = data.resName;
if(resType == ''){
resType = data.resType;
if(res && res.success){
if (res && res.map) {
let data = res.map;
provider = data.provider;
ip = data.ip;
resTypeName = data.resTypeName;
adminName = data.adminName;
manageIp = data.manageIp;
collProtocol = data.collProtocol;
name = data.resName;
if(resType == ''){
resType = data.resType;
}
lyaui.commonCols.detailPage(resId, resType, editFlag, provider, name, ip, resTypeName, adminName, manageIp, collProtocol);
}
}else{
proxy.$global.showMsg('该资源暂未监控', "error");
lyaui.commonCols.detailPage(resId, resType, editFlag, provider, name, ip, resTypeName, adminName, manageIp, collProtocol);
}
});
}
... ... @@ -363,6 +369,15 @@ global.getAlarmLevel = (level) => {
return params[level];
}
global.getHealthDesc = (level) => {
let params = {
"3": {name: '优', color: '#7be00d'},
"2": {name: '良', color: '#f5a623'},
"1": {name: '中', color: '#d81e06'}
}
return params[level];
}
// 组件默认大小 medium / small / mini
global.elementSize = '';
global.height = window.innerHeight - 20;
... ...
<div class="cmdbdatasyncEdit-container" style="min-height: 500px;">
<div class="search-table">
<cm-table-page :columns="tableData.columns" :dataList="editTbaleData"
:showIndex="true"
@loaddata = "loaddata"
:showSelection="false"
:showBorder="true"
:loading="false"
:pageSize="pageSize"
:showPage="false"
:showTools="true"
:showExpand="true"
:getRowKeys="tableData.getRowKeys"
:expands="tableData.expands"
:height="height - 110">
<template #expand="{scope}">
aaa{{scope.row.expand}}
</template>
<template #default="{row,prop,column}">
<div>
<el-input v-model="row[prop]" placeholder="Please input" />
<!--<el-select placeholder="请选择" size="small" style="width: 100%"
@change="changeProperty(row,prop,column)" v-model="row[prop]"
:multiple="false"
collapse-tags clearable filterable placeholder="请选择">
<el-option label="是" :value="0"></el-option>
<el-option label="否" :value="1"></el-option>
</el-select>-->
</div>
</template>
<template #tools="{scope}">
<div class="protocol-btn">
<span class="icon-add" @click="addProtocol" title="协议参数"><i class="el-icon-plus"></i></span>
</div>
</template>
</cm-table-page>
</div>
<div class="save-button" style="text-align:right;">
<el-button type="primary" style="margin-top:20px;margin-right:10px;" @click="saveEdit">确定</el-button>
</div>
</div>
\ No newline at end of file
... ...
export default {
name: 'cmdbdatasyncEdit',
template: '',
components: {
},
props: {
tableData:{
type:Object,
default: {}
}
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
let height = Vue.ref(window.innerHeight);
let editTbaleData=Vue.ref(props.tableData.dataList);
// let columns=Vue.ref(props.tableData.columns);
// let getRowKeys=Vue.ref(props.tableData.getRowKeys);
// let expands=Vue.ref(props.tableData.expands);
//保存编辑
let saveEdit=()=>{
//保存接口 todo
let param={
editTbaleData:editTbaleData.value,
visibility:false
}
emit("callbackedit",param)
}
//添加协议
let addProtocol=()=>{
proxy.$global.layer.open({
title:'资源协议',
id:'resManageChooseProtocolHtml',
type:1,
area: ['80%', '90%'],
btn:['确定','取消'],
scrollbar:true,
success: function(){
proxy.$global.layui.view('resManageChooseProtocolHtml').render('/baseconfig/protocol/index',{'hasParam':'1'});
},
yes:function (index,layero) {
var data = proxy.$global.layui.table.checkStatus('protocol_table').data;
formData.ip = $('#resManageAddForm').find('input[name="ip"]').val();
formData.port = $('#resManageAddForm').find('input[name="port"]').val();
if(data.length>0){
createProtocolDom(data,false);
form.render()
layer.close(index);
}else{
layer.msg("无选中的数据或当",{ offset: '15px' , icon: 7 , time: 2000 })
return false;
}
}
})
}
// 挂载完
Vue.onMounted(() => {
})
return {
height,
editTbaleData,
// columns,
saveEdit,
addProtocol,
// getRowKeys,
// expands
}
}
}
... ...
<div class="container" :style="{'height':height+'px','max-height':height+'px','display':'flex'}">
<div class="async-left-tree" style="width:200px;overflow-x: auto;background: #fff;border-right:1px solid #f2f2f2;">
<el-tree style="padding-top:10px;" class="tree-div" ref="roleTree" :data="treeData" :props="defaultProps" @node-click="handleNodeClick"
node-key="id" :default-checked-keys="checkedKeys"
/>
</div>
<div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%','padding-top':'3px','flex':'1'}">
<div class="search">
<div class="condition">
<el-form-item >
<el-input v-model="search.keyword" placeholder="关键字"></el-input>
</el-form-item>
<el-form-item >
<el-button @click="getDataList">查询</el-button>
</el-form-item>
<el-form-item >
<el-button @click="handleEdit">编辑</el-button>
</el-form-item>
<el-form-item >
<el-button @click="handleRefresh">同步</el-button>
</el-form-item>
</div>
</div>
<div class="search-table">
<cm-table-page :columns="tableData.columns" :dataList="tableData.dataList"
:showIndex="true"
:total="tableData.count"
@loaddata = "loaddata"
@selectionChange="selectionChange"
:showSelection="true"
:showBorder="true"
:loading="false"
:pageSize="pageSize"
:showPage="true"
:showTools="true"
:height="height - 110">
<template #default="{row,prop,column}">
<div v-if="prop == 'resName'">
<span class="resName-span" style="cursor: pointer;color:#1e9fff" @click="goResDetail(row.resId,row.resName,row.resType)">{{row.resName}}</span>
</div>
</template>
<template #tools="{scope}">
<div class="list-handle">
<span class="icon-bg" @click="handleEdit(1,scope.row)"><i class="el-icon-edit-outline" title="编辑"></i></span>
<span class="icon-bg" @click="handleRefresh(1,scope.row)"><i class="el-icon-refresh" title="同步"></i></span>
</div>
</template>
</cm-table-page>
</div>
</div>
</div>
<!--弹框-->
<cm-dialog :title="dialog.title" width="90%" :showDialogVisible="dialog.show" @hidedialog="hideDialog" :showFooter="false">
<template v-slot>
<cmdbdatasyncEdit :tableData="dialog.tableData" @callbackedit="callbackedit"/>
</template>
</cm-dialog>
... ...
export default {
name: 'cmdbdatasync',
template: '',
components: {
'cmdbdatasyncEdit': Vue.defineAsyncComponent(
() => myImport('views/cmdbdatasync/cmdbdatasyncEdit/index')
)
},
props: [],
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
let height = Vue.ref(window.innerHeight);
let defaultProps=Vue.ref({
children: 'children',
label: 'title'
})
let treeData=Vue.ref([]) // 所有的树结点
let defaultNode=Vue.ref(true);//默认节点
let resType=Vue.ref('');//选中的树节点值
let handleNodeClick=(data,node)=>{
//点击树节点,根据某个字段获取列表 todo
console.log("*(*(*(*",data,node)
proxy.$global.showMsg(data.id,'warning')
resType.value=data.value;
defaultNode.value=false;
getDataList();
}
let search = Vue.ref({
keyword: '',
pageNum: 1,
pageSize: 20,
});
//表格字段
let tableData = Vue.ref({
count:0,
dataList: [{
id:1,
resName:'资源一'
},{
id:2,
resName:'资源34'
}],
columns: [
{
prop: 'resName',
label: '资源名称',
sortable: true,
align: 'center',
width: '250'
},
{
prop: 'resTypeName',
label: '资源类型',
sortable: true,
align: 'center',
width: '200'
}, {
prop: 'host',
label: 'IP地址',
sortable: true,
align: 'center',
width: '200'
}, {
prop: 'type',
label: '日志来源',
sortable: true,
align: 'center',
width: '200'
},
{
prop: 'program',
label: '日志类型',
sortable: true,
align: 'center',
width: '200'
},
{
prop: 'message',
label: '日志内容',
sortable: true,
align: 'center',
},
]
})
let dialog = Vue.ref({
title : "编辑",
show:false,
tableData : {}
});
let loaddata = ({page, limit}) => {
search.value.pageNum = page;
search.value.pageSize = limit;
}
let hideDialog = (flg) => {
dialog.value.show = flg;
}
//全选事件
let selectionData=Vue.ref([]);//选择的数据
let selectionChange= (val) =>{
selectionData.value=val;
}
// 处理弹框
let handle = (row) =>{
hideDialog(true);
dialog.value.tableData.dataList= row;
dialog.value.tableData.columns=tableData.value.columns;
dialog.value.tableData.getRowKeys= 'id';
let arr=[];
row.map(item=>{
arr.push(item.id)
})
//默认展开第一行
dialog.value.tableData.expands= [arr[0]];
}
//编辑
let handleEdit = (flag,row) =>{
if(flag==1){
handle([row]);
}else{
if(selectionData.value.length>0){
handle(selectionData.value);
}else{
proxy.$global.showMsg('请选择数据','warning')
}
}
}
//同步 todo
let handleRefresh = (flag,row) =>{
if(flag==1){
//单个同步 row-->对象
}else{
//多选同步 selectionData.value-->数组
if(selectionData.value.length>0){
//...
}else{
proxy.$global.showMsg('请选择数据','warning')
}
}
}
//编辑返回数据
let callbackedit=(obj)=>{
console.log("***",obj.editTbaleData,obj.visibility)
hideDialog(obj.visibility)
//obj.editTbaleData编辑后的数据,todo
// getDataList();//获取列表数据
}
//查看资源详情
let goResDetail=(resId,resName,resType)=>{
proxy.$global.openDetail(resId, resType, proxy);
}
//获取资源树数据
let getResData=()=>{
proxy.$http.post(`/api-web/attribute/getTree`, {}, function (res) {
if (res && res.data) {
treeData.value = res.data;
}
});
}
// 获取列表 todo
let getDataList = () => {
if(defaultNode.value){
resType.value=treeData.value[0].children[0].value;
}
let params={
resType:resType.value,
pageNum: search.value.pageNum,
pageSize: search.value.pageSize,
keyword:search.value.keyword
}
proxy.$http.post(`/api-web/`, params, function (res) {
if (res && res.object) {
tableData.value.dataList = res.object;
tableData.value.count = parseInt(res.object.total);
} else {
tableData.value.dataList = [];
tableData.value.count = 0;
}
});
}
// 挂载完
Vue.onMounted(() => {
// getDataList();//获取列表数据
getResData();//获取资源树数据
})
return {
defaultProps,
treeData,
defaultNode,
handleNodeClick,
getResData,
height,
search,
dialog,
hideDialog,
selectionChange,
selectionData,
handle,
loaddata,
tableData,
getDataList,
handleEdit,
handleRefresh,
callbackedit,
goResDetail,
resType
}
}
}
... ...
<div class="esData-detail-container">
<el-descriptions
class=""
title="日志信息"
:column="2"
:size="size"
border
>
<el-descriptions-item>
<template #label>
<div class="cell-item">
资源名称
</div>
</template>
{{detail.resName}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
IP地址
</div>
</template>
{{detail.host}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
资源类型
</div>
</template>
{{detail.resTypeName}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
日志来源
</div>
</template>
{{detail.type}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
日志类型
</div>
</template>
{{detail.program}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
采集时间
</div>
</template>
{{detail.dbTimeStr}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
日志时间
</div>
</template>
{{detail.logDate}}
</el-descriptions-item>
</el-descriptions>
<div class="info-title">
<span style="font-weight:bold">日志内容</span>
</div>
<div class="esData-detail-info-content" v-html="detail.message">
</div>
</div>
\ No newline at end of file
... ...
export default {
name: 'esDataDetail',
template: '',
components: {
},
props: {
detail:{
type:Object,
default: {}
}
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
// 挂载完
Vue.onMounted(() => {
})
return {
}
}
}
... ...
<div class="container" :style="{'height':height+'px','max-height':height+'px'}">
<div class="cm-card" :style="{'min-height':height+'px','max-height':height+'px','height':'100%','padding-top':'3px'}">
<div class="search">
<div class="condition">
<el-form-item >
<el-input v-model="search.keyword" placeholder="=资源名称、日志内容="></el-input>
</el-form-item>
<el-form-item >
<el-dropdown>
<cm-res-type-tree-input multiple clearable collapseTags @callback="getResType"/>
</el-dropdown>
</el-form-item>
<el-form-item >
<el-select v-model="search.program" class="m-2" placeholder="日志类型" clearable>
<el-option
v-for="item in logTypeData"
:key="item.ddicCode"
:label="item.ddicName"
:value="item.ddicCode"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-date-picker
v-model="search.dateTime"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</el-form-item>
<el-form-item >
<el-button @click="getDataList">查询</el-button>
</el-form-item>
</div>
</div>
<div class="search-table">
<cm-table-page :columns="tableData.columns" :dataList="tableData.dataList"
:showIndex="true"
:total="tableData.count"
@loaddata = "loaddata"
:showSelection="false"
:showBorder="true"
:loading="false"
:pageSize="search.pageSize"
:showPage="true"
:showTools="true"
:height="height - 110">
<template #default="{row,prop,column}">
<div v-if="prop == 'resName'">
<span class="resName-span" style="cursor: pointer;color:#1e9fff" @click="goResDetail(row.resId,row.resName,row.resType)">{{row.resName}}</span>
</div>
<div v-if="prop == 'message'" >
<el-tooltip >
<template #content>
<div style="max-width:400px;overflow: hidden; text-overflow: ellipsis;display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;">
{{row.message}}
</div>
</template>
<div v-html="row.message" style="overflow: hidden; text-overflow: ellipsis;display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;"></div>
</el-tooltip>
</div>
</template>
<template #tools="{scope}">
<div class="list-handle">
<span class="icon-bg">
<i class="el-icon-view" title="查看" @click="handleView(scope.row)"></i>
</span>
</div>
</template>
</cm-table-page>
</div>
</div>
</div>
<!--弹框-->
<cm-dialog :title="dialog.title" width="60%" :showDialogVisible="dialog.show" @hidedialog="hideDialog" :showFooter="false">
<template v-slot>
<esDataDetail :detail="dialog.detail" />
</template>
</cm-dialog>
... ...
export default {
name: 'esDataIndex',
template: '',
components: {
'esDataDetail': Vue.defineAsyncComponent(
() => myImport('views/esData/esDataDetail/index')
)
},
props: [],
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
let height = Vue.ref(window.innerHeight);
let dateTime=Vue.ref([])
let search = Vue.ref({
program:'',
sortBy:'dbTime',
scopeBy:'dbTimeStr.keyword',
keyword: '',
type:'syslog',
pageNum: 1,
pageSize: 20,
dateTime:[],
resType:'',
});
let dialog = Vue.ref({
title : "日志详情",
show:false,
esId : ''
});
//表格字段
let tableData = Vue.ref({
count:0,
dataList: [],
columns: [
{
prop: 'logDate',
label: '日志时间',
sortable: true,
align: 'center',
width: '250',
},
{
prop: 'resName',
label: '资源名称',
sortable: true,
align: 'center',
width: '250'
},
{
prop: 'resTypeName',
label: '资源类型',
sortable: true,
align: 'center',
width: '200'
}, {
prop: 'host',
label: 'IP地址',
sortable: true,
align: 'center',
width: '200'
}, {
prop: 'type',
label: '日志来源',
sortable: true,
align: 'center',
width: '200'
},
{
prop: 'program',
label: '日志类型',
sortable: true,
align: 'center',
width: '200'
},
{
prop: 'message',
label: '日志内容',
sortable: true,
align: 'center',
},
]
})
let resTypeArr = Vue.ref([]);
let getResType = (arr) => {
var types = arr.map(function (v) {
return v.id;
});
resTypeArr.value = types;
search.value.resType=resTypeArr.value.join(',');
// getDataList();
}
//获取时间点 转年月日的方法
const getDateTime=(newDate)=>{
let dateTime='';
let year=newDate.getFullYear();//获取当前年
let month1=(newDate.getMonth()+1)+'';
let month=timeFormat(month1);//获取当前月
let day=timeFormat(newDate.getDate());//获取当前日
let hours=timeFormat(newDate.getHours()+'');//获取当前时
let minutes=timeFormat(newDate.getMinutes()+'');//获取当前分
let seconds=timeFormat(newDate.getSeconds()+'');//获取当前秒
dateTime= year+'-'+month+'-'+day;//' '+hours+':'+minutes+':'+seconds;
return dateTime;
}
//转换个位数为 00
let timeFormat =(number)=> {
return number.length == 1 ? ('0' + number) : number
}
// 获取列表
let getDataList = () => {
let nowDate=getDateTime(new Date());
let startTime=(search.value.dateTime && search.value.dateTime[0])?search.value.dateTime[0]:'';
let endTime=(search.value.dateTime && search.value.dateTime[1])?search.value.dateTime[1]:'';
let startDateStr=startTime?startTime.split(' ')[0]:'';
let endDateStr=endTime?endTime.split(' ')[0]:'';
let dateStr='';
if(search.value.dateTime && search.value.dateTime.length>0){
if(startDateStr!=endDateStr){
dateStr='log-syslog-search';
}else{
dateStr='log-syslog_'+startDateStr;
}
}else {
dateStr='log-syslog_'+nowDate;
}
let params={
indexName:dateStr,
pageNum: search.value.pageNum,
pageSize: search.value.pageSize,
type:search.value.type,
sortBy:search.value.sortBy,
scopeBy:search.value.scopeBy,
startTime:startTime,
endTime: endTime,
resType:search.value.resType,
param:{}
}
if(search.value.keyword){
params.param={
'resName.keyword': search.value.keyword,
'host.keyword':search.value.keyword,
'message.keyword':search.value.keyword,
}
}
if(search.value.program){
params['param']['program.keyword']=search.value.program;
}
proxy.$http.post(`/api-web/esData/list`, params, function (res) {
if (res && res.object) {
let dataList=res.object.content;
let arr=[];
dataList.map(item=>{
arr.push(item[0])
})
tableData.value.dataList = arr;
tableData.value.count = parseInt(res.object.total);
} else {
tableData.value.dataList = [];
tableData.value.count = 0;
}
});
}
let loaddata = ({page, limit}) => {
search.value.pageNum = page;
search.value.pageSize = limit;
getDataList();
}
let hideDialog = (flg) => {
dialog.value.show = flg;
}
// 处理弹框
let handle = (row) =>{
hideDialog(true);
dialog.value.detail = row;
}
//查看详情
let handleView = (row) =>{
handle(row);
}
//查看资源详情
let goResDetail=(resId,resName,resType)=>{
proxy.$global.openDetail(resId, resType, proxy);
}
//日志类型数据
let logTypeData=Vue.ref([]);
let getLogType=()=>{
proxy.$http.post(`/api-web/manage/ddic/findSucDdics/LOG_SOURCE_TYPE`, {}, function (res) {
if (res && res.data) {
logTypeData.value = res.data;
}
});
}
// 挂载完
Vue.onMounted(() => {
getDataList();
getLogType();
})
return {
logTypeData,
getLogType,
dateTime,
height,
search,
dialog,
hideDialog,
handle,
loaddata,
tableData,
getDataList,
resTypeArr,
getResType,
handleView,
goResDetail,
getDateTime
}
}
}
... ...
... ... @@ -198,6 +198,12 @@ const routes = [{
name: 'busDoc',
component: () => myImport('views/busDoc/index')
},
//日志
{
path: '/esData',
name: 'esDataIndex',
component: () => myImport('views/esData/index'),
},
];
// hash模式: createWebHashHistory
... ...
... ... @@ -359,6 +359,26 @@ layui.define(['view'], function(exports){
//纠正首尾
return href.replace(/^(\/+)/, '/')
.replace(new RegExp('\/' + setter.entry + '$'), '/'); //过滤路由最后的默认视图文件名(如:index)
},
//封装获取cookie
getCookie:function(name) {
var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
if (arr = document.cookie.match(reg))
return (arr[2]);
else
return null;
},
setCookie:function (c_name, value, expiredays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + expiredays);
document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
},
delCookie:function (name) {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(name);
if (cval != null)
document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
}
//……
... ...
... ... @@ -169,7 +169,19 @@ const routes = [{
path: '/alarmsubscribe/excludeKpi',
name: 'alarmSubscribeExcludeKpi',
component: () => myImport('views/alarmsubscribe/index')
}
},
//日志
{
path: '/esData',
name: 'esDataIndex',
component: () => myImport('views/esData/index'),
},
//监控对接CMDB功能
{
path: '/cmdbdatasync',
name: 'cmdbdatasync',
component: () => myImport('views/cmdbdatasync/index'),
},
];
// hash模式: createWebHashHistory
... ...