2021-06-07 18:35:16 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="cn-header">
|
2022-07-15 16:53:01 +08:00
|
|
|
|
<div class="cn-header__banner">
|
|
|
|
|
|
<div class="banner__left">
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<span @click="shrink" class="shrink-button" :class="{'shrink-button--collapse': showMenu}"><i
|
|
|
|
|
|
class="cn-icon cn-icon-navigation"></i></span>
|
2023-08-11 18:35:05 +08:00
|
|
|
|
<img alt="loading..." height="26" :src="logo" @click="jump('/panel/networkOverview', '', '', 0)" style="cursor: pointer"/>
|
2022-07-15 16:53:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
<!--个人操作-->
|
|
|
|
|
|
<div class="personal">
|
|
|
|
|
|
<el-dropdown>
|
|
|
|
|
|
<div class="header-menu--item"><i class="cn-icon cn-icon-language"></i></div>
|
|
|
|
|
|
<template #dropdown>
|
|
|
|
|
|
<el-dropdown-menu>
|
|
|
|
|
|
<el-dropdown-item>
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<div id="header-to-english" :style="language === 'en'?'color:#0091ff':''" @click="changeLocal('en')">
|
|
|
|
|
|
English
|
|
|
|
|
|
</div>
|
2022-07-15 16:53:01 +08:00
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
|
<el-dropdown-item>
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<div id="header-to-chinese" :style="language === 'cn'?'color:#0091ff':''" @click="changeLocal('cn')">
|
|
|
|
|
|
中文
|
|
|
|
|
|
</div>
|
2022-07-15 16:53:01 +08:00
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
|
<el-dropdown>
|
2023-09-14 15:19:30 +08:00
|
|
|
|
<div class='login-user header-menu--item'>{{ nickName }} <i class="cn-icon cn-icon-arrow-down"></i></div>
|
2022-07-15 16:53:01 +08:00
|
|
|
|
<template #dropdown>
|
|
|
|
|
|
<el-dropdown-menu>
|
|
|
|
|
|
<el-dropdown-item>
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<div id="header-to-changepin" @click="showPinDialog">{{ $t('overall.changePassword') }}</div>
|
2022-07-15 16:53:01 +08:00
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
|
<el-dropdown-item>
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<div id="header-to-logout" @click="logout">{{ $t('overall.logout') }}</div>
|
2022-07-15 16:53:01 +08:00
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="cn-header__nav">
|
|
|
|
|
|
<i class="cn-icon cn-icon-a-NetworkAnalytics"></i>
|
2023-02-26 23:06:57 +08:00
|
|
|
|
<el-breadcrumb class="header__left-breadcrumb" separator=">">
|
|
|
|
|
|
<el-breadcrumb-item class="header__left-breadcrumb-item" :id="`breadcrumb${item.value}`" :title="item.value"
|
|
|
|
|
|
v-for="(item,index) in breadcrumb" :key="item.value">
|
2022-08-05 15:46:31 +08:00
|
|
|
|
<template v-if="index===3">
|
|
|
|
|
|
<div class="header__left-breadcrumb-item-select">
|
|
|
|
|
|
<el-popover placement="bottom-start"
|
|
|
|
|
|
ref="breadcrumbPopover"
|
|
|
|
|
|
:show-arrow="false"
|
|
|
|
|
|
:append-to-body="false"
|
|
|
|
|
|
:hide-after="0"
|
|
|
|
|
|
:show-after="0"
|
|
|
|
|
|
popper-class="breadcrumb__popper"
|
2023-02-26 23:06:57 +08:00
|
|
|
|
@show="showBreadcrumbPopover(item.value)"
|
2022-08-05 15:46:31 +08:00
|
|
|
|
@hide="hideBreadcrumbPopover()"
|
|
|
|
|
|
trigger="click">
|
|
|
|
|
|
<template #reference>
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<div class="breadcrumb-button" id="breadcrumbButton"
|
|
|
|
|
|
:class="showBackground?'breadcrumb-button__active':''">
|
|
|
|
|
|
<span id="breadcrumbValue">
|
2022-11-04 12:18:26 +08:00
|
|
|
|
<template v-if="curTabProp === 'qtype'">
|
2023-02-26 23:06:57 +08:00
|
|
|
|
<span>{{ dnsQtypeMapData.get(item.value)}}</span>
|
2022-11-04 12:18:26 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="curTabProp === 'rcode'">
|
2023-02-26 23:06:57 +08:00
|
|
|
|
<span>{{ dnsRcodeMapData.get(item.value)}}</span>
|
2022-11-04 12:18:26 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else>
|
2023-02-26 23:06:57 +08:00
|
|
|
|
<span>{{ item.value }}</span>
|
2022-11-04 12:18:26 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</span><i class="cn-icon-xiala cn-icon"></i>
|
2022-08-05 15:46:31 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<el-row type="flex" justify="center" style="width: fit-content;flex-direction: column;">
|
|
|
|
|
|
<div class="search-input">
|
2023-08-23 10:35:09 +08:00
|
|
|
|
<el-input :placeholder="$t('filter.options')"
|
2022-08-05 15:46:31 +08:00
|
|
|
|
size="mini"
|
|
|
|
|
|
v-model="dropDownValue"
|
|
|
|
|
|
@input="dropDownSearch"></el-input>
|
|
|
|
|
|
</div>
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<ul class="select-dropdown" id="breadcrumbSelectDropdown" @scroll="scrollList()">
|
|
|
|
|
|
<li v-for="item in breadcrumbColumnValueListShow" title='' :key="item" :id="item"
|
2023-02-26 23:06:57 +08:00
|
|
|
|
class="select-dropdown__item" @click="changeValue(item)">
|
2022-11-04 12:18:26 +08:00
|
|
|
|
<template v-if="curTabProp === 'qtype'">
|
2022-11-21 11:28:56 +08:00
|
|
|
|
<span>{{ dnsQtypeMapData.get(item) }}</span>
|
2022-11-04 12:18:26 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="curTabProp === 'rcode'">
|
2022-11-21 11:28:56 +08:00
|
|
|
|
<span>{{ dnsRcodeMapData.get(item) }}</span>
|
2022-11-04 12:18:26 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else>
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<span>{{ item }}</span>
|
2022-11-04 12:18:26 +08:00
|
|
|
|
</template>
|
2022-08-05 15:46:31 +08:00
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-popover>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else-if="index===2">
|
2023-10-23 18:04:29 +08:00
|
|
|
|
<span v-if="route===wholeScreenRouterMapping.dns || !route.startsWith('/panel')">{{ $t(item.value) }}</span>
|
2023-02-26 23:06:57 +08:00
|
|
|
|
<span v-else class="route-menu" @click="jump(route,item.value,'',3)">{{ $t(item.value) }}</span>
|
2022-08-05 15:46:31 +08:00
|
|
|
|
</template>
|
2023-02-26 23:06:57 +08:00
|
|
|
|
<!-- index=0和index=1的点击跳转由breadcrumb里的数据控制 -->
|
2022-08-05 15:46:31 +08:00
|
|
|
|
<template v-else-if="index===1">
|
2023-02-26 23:06:57 +08:00
|
|
|
|
<span v-if="item.clickable" class="route-menu" @click="jump(route,'','',2)">{{ item.value }}</span>
|
|
|
|
|
|
<span v-else>{{ item.value }}</span>
|
2022-08-05 15:46:31 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<template v-else>
|
2023-02-26 23:06:57 +08:00
|
|
|
|
<span v-if="item.clickable" class="route-menu" @click="jump(item.route,'','',0)">{{ item.value }}</span>
|
|
|
|
|
|
<span v-else>{{ item.value }}</span>
|
2022-08-05 15:46:31 +08:00
|
|
|
|
</template>
|
2021-08-13 09:39:02 +08:00
|
|
|
|
</el-breadcrumb-item>
|
2021-08-12 18:11:38 +08:00
|
|
|
|
</el-breadcrumb>
|
2021-06-07 18:35:16 +08:00
|
|
|
|
</div>
|
2022-07-18 15:04:32 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 菜单 -->
|
2022-07-15 16:53:01 +08:00
|
|
|
|
<el-drawer
|
|
|
|
|
|
v-model="showMenu"
|
|
|
|
|
|
direction="ttb"
|
|
|
|
|
|
custom-class="cn-menu"
|
|
|
|
|
|
modal-class="cn-menu-modal"
|
|
|
|
|
|
:with-header="false"
|
|
|
|
|
|
:show-close="false"
|
|
|
|
|
|
>
|
2023-09-19 16:21:14 +08:00
|
|
|
|
<div class="cn-menu__left" v-if="otherMenu">
|
2022-09-30 07:35:09 +08:00
|
|
|
|
<div class="left-menu" v-for="menu in otherMenu" :key="menu.id" @click="jump(menu.route,'','',0)">
|
2022-07-15 16:53:01 +08:00
|
|
|
|
<i :class="menu.icon"></i>
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<span>{{ $t(menu.i18n || menu.name) }}</span>
|
2022-07-15 16:53:01 +08:00
|
|
|
|
<i class="cn-icon cn-icon-right"></i>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2023-09-22 14:22:47 +08:00
|
|
|
|
<div class="cn-menu__middle" >
|
2022-07-15 16:53:01 +08:00
|
|
|
|
<div class="middle-menus middle-menus--network-analytics">
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<div class="middle-menus__header">{{ $t('overall.networkAnalytics') }}</div>
|
2023-09-19 16:21:14 +08:00
|
|
|
|
<div class="middle-menus__body" v-if="networkAnalyticsMenu && networkAnalyticsMenu.children">
|
2022-09-13 18:05:54 +08:00
|
|
|
|
<div style="width: 260px;">
|
|
|
|
|
|
<template v-for="(menu, index) in networkAnalyticsMenu.children" :key="index">
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<div class="middle-menu" v-if="index < 5" @click="jump(menu.route,'','',2)">
|
|
|
|
|
|
{{ $t(menu.i18n || menu.name) }}
|
|
|
|
|
|
</div>
|
2022-09-13 18:05:54 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<template v-for="(menu, index) in networkAnalyticsMenu.children" :key="index">
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<div class="middle-menu" v-if="index >= 5 && index < 10" @click="jump(menu.route,'','',2)">
|
|
|
|
|
|
{{ $t(menu.i18n || menu.name) }}
|
|
|
|
|
|
</div>
|
2022-09-13 18:05:54 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</div>
|
2022-07-15 16:53:01 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</el-drawer>
|
2022-07-18 15:04:32 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 改密码 -->
|
2021-08-26 17:14:51 +08:00
|
|
|
|
<el-dialog v-model="showChangePin"
|
2021-08-24 17:36:27 +08:00
|
|
|
|
width="30%"
|
|
|
|
|
|
:before-close="handleClose">
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<el-form :rules="changePassFormRules" :model="changePassForm" ref="changePassForm">
|
2021-08-24 17:36:27 +08:00
|
|
|
|
<el-row :gutter="20">
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
<el-form-item :label="$t('overall.currentPassword')" prop="oldPwd">
|
|
|
|
|
|
<el-input v-model="changePassForm.oldPwd" type="password"></el-input>
|
|
|
|
|
|
</el-form-item>
|
2021-08-24 17:36:27 +08:00
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24">
|
2021-08-26 17:14:51 +08:00
|
|
|
|
<el-form-item :label="$t('overall.newPassword')" prop="newPwd">
|
|
|
|
|
|
<el-input v-model="changePassForm.newPwd" type="password"></el-input>
|
2021-08-24 17:36:27 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="24">
|
2021-08-26 17:14:51 +08:00
|
|
|
|
<el-form-item :label="$t('overall.confirmNewPassword')" prop="newPwd2">
|
|
|
|
|
|
<el-input v-model="changePassForm.newPwd2" type="password"></el-input>
|
2021-08-24 17:36:27 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<template #footer>
|
2021-08-26 17:14:51 +08:00
|
|
|
|
<span class="dialog-footer">
|
2022-11-07 15:48:46 +08:00
|
|
|
|
<el-button @click="showChangePin = false">{{ $t('overall.cancel') }}</el-button>
|
|
|
|
|
|
<el-button type="primary" @click="submit">{{ $t('overall.update') }}</el-button>
|
2021-08-26 17:14:51 +08:00
|
|
|
|
</span>
|
2021-08-24 17:36:27 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
</el-dialog>
|
2021-06-07 18:35:16 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2023-08-24 17:15:41 +08:00
|
|
|
|
import axios from 'axios'
|
2022-10-07 21:04:08 +08:00
|
|
|
|
import {
|
|
|
|
|
|
curTabState,
|
|
|
|
|
|
entityType,
|
2023-07-03 11:21:21 +08:00
|
|
|
|
fromRoute,
|
2022-10-09 08:24:07 +08:00
|
|
|
|
networkTable,
|
2022-10-07 21:04:08 +08:00
|
|
|
|
operationType,
|
2022-10-12 11:11:22 +08:00
|
|
|
|
storageKey,
|
2023-07-03 11:21:21 +08:00
|
|
|
|
wholeScreenRouterMapping
|
2022-10-07 21:04:08 +08:00
|
|
|
|
} from '@/utils/constants'
|
2022-10-09 08:24:07 +08:00
|
|
|
|
import { api } from '@/utils/api'
|
|
|
|
|
|
import { ref } from 'vue'
|
2022-11-07 15:48:46 +08:00
|
|
|
|
import {
|
2023-07-03 11:21:21 +08:00
|
|
|
|
combineDrilldownTableWithUserConfig,
|
2022-11-07 15:48:46 +08:00
|
|
|
|
combineTabList,
|
|
|
|
|
|
getDefaultCurTab,
|
2023-07-03 11:21:21 +08:00
|
|
|
|
getDnsMapData,
|
2022-11-07 15:48:46 +08:00
|
|
|
|
getTabList,
|
2023-07-03 11:21:21 +08:00
|
|
|
|
handleSpecialValue,
|
2022-11-07 15:48:46 +08:00
|
|
|
|
overwriteUrl,
|
2023-07-03 11:21:21 +08:00
|
|
|
|
urlParamsHandler
|
2022-11-07 15:48:46 +08:00
|
|
|
|
} from '@/utils/tools'
|
2022-10-09 08:24:07 +08:00
|
|
|
|
import { getNowTime, getSecond } from '@/utils/date-util'
|
2023-02-24 18:51:17 +08:00
|
|
|
|
import _ from 'lodash'
|
2023-07-03 11:21:21 +08:00
|
|
|
|
import { useRoute } from 'vue-router'
|
2021-09-15 12:19:13 +08:00
|
|
|
|
|
2021-06-07 18:35:16 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
name: 'Header',
|
|
|
|
|
|
data () {
|
2021-08-26 17:14:51 +08:00
|
|
|
|
const passwordComparison = (rule, value, callback) => {
|
|
|
|
|
|
if (value !== this.changePassForm.newPwd) {
|
|
|
|
|
|
callback(new Error(this.$t('validate.passwordConsistent')))
|
2021-08-24 17:36:27 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
callback()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-07-15 12:50:03 +08:00
|
|
|
|
const validateFiveLength = (rule, value, callback) => {
|
|
|
|
|
|
if (value.length < 5) {
|
|
|
|
|
|
callback(new Error(this.$t('validate.atLeastFive')))
|
|
|
|
|
|
} else {
|
|
|
|
|
|
callback()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-06-07 18:35:16 +08:00
|
|
|
|
return {
|
2022-06-22 14:05:11 +08:00
|
|
|
|
username: localStorage.getItem(storageKey.username),
|
2023-09-14 15:19:30 +08:00
|
|
|
|
nickName: localStorage.getItem(storageKey.nickName),
|
2022-04-14 15:52:07 +08:00
|
|
|
|
language: localStorage.getItem(storageKey.language) ? localStorage.getItem(storageKey.language) : 'en',
|
2021-08-12 18:11:38 +08:00
|
|
|
|
showChangePin: false,
|
2021-08-24 17:36:27 +08:00
|
|
|
|
from: '', // entity类型
|
|
|
|
|
|
changePassForm: {
|
2021-08-26 17:14:51 +08:00
|
|
|
|
oldPwd: '',
|
|
|
|
|
|
newPwd: '',
|
|
|
|
|
|
newPwd2: ''
|
2021-08-24 17:36:27 +08:00
|
|
|
|
},
|
|
|
|
|
|
changePassFormRules: {
|
2022-11-07 15:48:46 +08:00
|
|
|
|
oldPwd: [{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: this.$t('validate.required'),
|
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}],
|
|
|
|
|
|
newPwd: [{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: this.$t('validate.required'),
|
|
|
|
|
|
trigger: 'blur'
|
2023-07-15 12:50:03 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
validator: validateFiveLength,
|
|
|
|
|
|
trigger: 'change'
|
2022-11-07 15:48:46 +08:00
|
|
|
|
}],
|
|
|
|
|
|
newPwd2: [{
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: this.$t('validate.required'),
|
|
|
|
|
|
trigger: 'blur'
|
2023-07-15 12:50:03 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
validator: validateFiveLength,
|
|
|
|
|
|
trigger: 'change'
|
2022-11-07 15:48:46 +08:00
|
|
|
|
}, {
|
|
|
|
|
|
validator: passwordComparison,
|
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
}]
|
2022-07-15 16:53:01 +08:00
|
|
|
|
},
|
2022-08-05 15:46:31 +08:00
|
|
|
|
showMenu: false,
|
|
|
|
|
|
dropDownValue: '',
|
|
|
|
|
|
breadcrumbColumnValueListShow: [],
|
2022-11-07 15:48:46 +08:00
|
|
|
|
curTabProp: '',
|
2022-11-09 15:22:09 +08:00
|
|
|
|
dnsRcodeMapData: new Map(),
|
|
|
|
|
|
dnsQtypeMapData: new Map(),
|
2022-11-07 15:48:46 +08:00
|
|
|
|
isDnsMapType: false,
|
2022-08-05 15:46:31 +08:00
|
|
|
|
valueMeta: [],
|
|
|
|
|
|
showBackground: false,
|
|
|
|
|
|
selected: false,
|
|
|
|
|
|
valueMenuId: '',
|
2022-11-04 12:18:26 +08:00
|
|
|
|
fromRoute: fromRoute,
|
2022-09-05 13:36:22 +08:00
|
|
|
|
detectionMenuList: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'securityEvents',
|
|
|
|
|
|
i18n: 'entities.securityEvents',
|
|
|
|
|
|
path: '/detection/securityEvent'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'performanceEvents',
|
|
|
|
|
|
i18n: 'overall.performanceEvents',
|
|
|
|
|
|
path: '/detection/performanceEvent'
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
2022-09-16 17:46:20 +08:00
|
|
|
|
curPageNum: 1,
|
2022-10-02 16:21:39 +08:00
|
|
|
|
curTabState: curTabState,
|
2022-10-12 11:11:22 +08:00
|
|
|
|
urlChangeParams: {},
|
2022-12-09 18:15:04 +08:00
|
|
|
|
wholeScreenRouterMapping,
|
2023-08-11 18:35:05 +08:00
|
|
|
|
logo: 'images/logo-header.svg'
|
2021-08-12 18:11:38 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
2022-07-15 16:53:01 +08:00
|
|
|
|
networkAnalyticsMenu () {
|
|
|
|
|
|
return this.$store.getters.menuList.find(menu => menu.code === 'networkAnalytics')
|
|
|
|
|
|
},
|
|
|
|
|
|
otherMenu () {
|
2023-08-29 17:33:23 +08:00
|
|
|
|
return this.$store.getters.menuList.filter(menu => ['networkAnalytics', 'chart', 'I18N', 'entityDetail', 'temp', 'entityGraph', 'detectionPolicy'].indexOf(menu.code) === -1)
|
2022-07-15 16:53:01 +08:00
|
|
|
|
|
|
|
|
|
|
/* function excludeButton (menu) {
|
|
|
|
|
|
for (let i = 0; i < menu.length; i++) {
|
|
|
|
|
|
if (menu[i].type === 2) {
|
|
|
|
|
|
menu.splice(i, 1)
|
|
|
|
|
|
i--
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (menu[i].children && menu[i].children.length > 0) {
|
|
|
|
|
|
excludeButton(menu[i].children)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} */
|
|
|
|
|
|
},
|
2021-08-12 18:11:38 +08:00
|
|
|
|
breadcrumb () {
|
2023-02-24 18:51:17 +08:00
|
|
|
|
const breadcrumb = []
|
|
|
|
|
|
this.generateBreadcrumb(breadcrumb, this.$store.getters.menuList)
|
2023-02-26 23:06:57 +08:00
|
|
|
|
// 写死一级和二级菜单是否可以点击跳转
|
|
|
|
|
|
if (breadcrumb[0]) {
|
|
|
|
|
|
if (['knowledgeBase'].indexOf(breadcrumb[0].code) > -1) {
|
|
|
|
|
|
breadcrumb[0].clickable = true
|
|
|
|
|
|
}
|
|
|
|
|
|
if (breadcrumb[1]) {
|
|
|
|
|
|
if (breadcrumb[1].route && breadcrumb[1].route.indexOf('/panel/') === 0) {
|
|
|
|
|
|
breadcrumb[1].clickable = true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-09-20 09:33:49 +08:00
|
|
|
|
const thirdMenu = this.getUrlParam(this.curTabState.thirdMenu, '')
|
|
|
|
|
|
const fourthMenu = this.getUrlParam(this.curTabState.fourthMenu, '')
|
2023-02-24 18:51:17 +08:00
|
|
|
|
|
|
|
|
|
|
let result = [...breadcrumb]
|
2022-10-09 16:52:21 +08:00
|
|
|
|
if (fourthMenu) {
|
2023-02-26 23:06:57 +08:00
|
|
|
|
result = [...result, { value: thirdMenu }, { value: fourthMenu }]
|
2022-09-20 09:33:49 +08:00
|
|
|
|
} else if (thirdMenu) {
|
2023-02-26 23:06:57 +08:00
|
|
|
|
result = [...result, { value: thirdMenu }]
|
2023-02-23 18:12:20 +08:00
|
|
|
|
}
|
2022-10-09 16:52:21 +08:00
|
|
|
|
return result
|
2021-08-12 18:11:38 +08:00
|
|
|
|
},
|
2021-08-13 09:39:02 +08:00
|
|
|
|
showEntityTypeSelector () {
|
|
|
|
|
|
return this.$store.getters.getShowEntityTypeSelector
|
|
|
|
|
|
},
|
2021-08-13 18:57:49 +08:00
|
|
|
|
storeFrom () {
|
|
|
|
|
|
return this.$store.getters.from
|
2022-07-15 16:53:01 +08:00
|
|
|
|
},
|
|
|
|
|
|
route () {
|
|
|
|
|
|
return this.$route.path
|
2021-08-13 09:39:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
from (n) {
|
|
|
|
|
|
this.$store.commit('entityTypeChange', n)
|
|
|
|
|
|
},
|
2021-08-13 18:57:49 +08:00
|
|
|
|
storeFrom (n) {
|
|
|
|
|
|
if (this.from !== n) {
|
|
|
|
|
|
this.from = n
|
|
|
|
|
|
}
|
2022-12-15 17:42:01 +08:00
|
|
|
|
},
|
|
|
|
|
|
async breadcrumb (n) {
|
2023-02-24 18:51:17 +08:00
|
|
|
|
this.curTabProp = this.$route.query.dimensionType ? this.$route.query.dimensionType : null
|
2022-12-15 17:42:01 +08:00
|
|
|
|
if (this.$route.params.typeName === fromRoute.dnsServiceInsights) {
|
|
|
|
|
|
if (this.dnsQtypeMapData.size === 0) {
|
|
|
|
|
|
this.dnsQtypeMapData = await getDnsMapData('dnsQtype')
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.dnsRcodeMapData.size === 0) {
|
|
|
|
|
|
this.dnsRcodeMapData = await getDnsMapData('dnsRcode')
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-07-03 11:21:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
'$store.getters.timeFilter': function (newVal) {
|
|
|
|
|
|
if (newVal && Object.keys(newVal).length > 0) {
|
|
|
|
|
|
this.chartTimeFilter = newVal
|
|
|
|
|
|
}
|
2021-08-13 09:39:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-11-04 12:18:26 +08:00
|
|
|
|
async mounted () {
|
2021-08-13 09:39:02 +08:00
|
|
|
|
this.from = Object.keys(this.entityType)[0]
|
2022-11-21 11:28:56 +08:00
|
|
|
|
// 是否需要dns的qtype和rcode的数据字典
|
2022-12-08 16:09:46 +08:00
|
|
|
|
if (this.$route.params.typeName === fromRoute.dnsServiceInsights) {
|
2022-12-15 17:42:01 +08:00
|
|
|
|
if (this.dnsQtypeMapData.size === 0) {
|
|
|
|
|
|
this.dnsQtypeMapData = await getDnsMapData('dnsQtype')
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.dnsRcodeMapData.size === 0) {
|
|
|
|
|
|
this.dnsRcodeMapData = await getDnsMapData('dnsRcode')
|
|
|
|
|
|
}
|
2022-11-21 11:28:56 +08:00
|
|
|
|
}
|
2023-10-09 11:55:19 +08:00
|
|
|
|
const path = this.$route.path
|
2023-09-22 14:22:47 +08:00
|
|
|
|
if (path.indexOf('panel') > -1 && path.indexOf('linkMonitor') === -1) {
|
2023-08-02 11:17:24 +08:00
|
|
|
|
await this.initDropdownList()
|
|
|
|
|
|
}
|
2021-08-13 09:39:02 +08:00
|
|
|
|
},
|
|
|
|
|
|
setup () {
|
2023-07-03 11:21:21 +08:00
|
|
|
|
const { query } = useRoute()
|
|
|
|
|
|
// 获取url携带的range、startTime、endTime
|
|
|
|
|
|
const rangeParam = query.range
|
|
|
|
|
|
const startTimeParam = query.startTime
|
|
|
|
|
|
const endTimeParam = query.endTime
|
|
|
|
|
|
// 若url携带了,使用携带的值,否则使用默认值。
|
|
|
|
|
|
|
|
|
|
|
|
const dateRangeValue = rangeParam ? parseInt(query.range) : 60
|
|
|
|
|
|
const chartTimeFilter = ref({ dateRangeValue })
|
|
|
|
|
|
if (!startTimeParam || !endTimeParam) {
|
|
|
|
|
|
const { startTime, endTime } = getNowTime(60)
|
|
|
|
|
|
chartTimeFilter.value.startTime = startTime
|
|
|
|
|
|
chartTimeFilter.value.endTime = endTime
|
|
|
|
|
|
} else {
|
|
|
|
|
|
chartTimeFilter.value.startTime = parseInt(startTimeParam)
|
|
|
|
|
|
chartTimeFilter.value.endTime = parseInt(endTimeParam)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-08-13 09:39:02 +08:00
|
|
|
|
return {
|
2022-08-05 15:46:31 +08:00
|
|
|
|
chartTimeFilter,
|
2021-08-13 09:39:02 +08:00
|
|
|
|
entityType // 所有entity类型,用于header下拉框选择
|
2021-06-07 18:35:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2023-02-24 18:51:17 +08:00
|
|
|
|
generateBreadcrumb (breadcrumb, menus) {
|
2023-05-15 15:31:22 +08:00
|
|
|
|
if (this.route === '/entityDetail') {
|
|
|
|
|
|
const entityMenu = menus.find(m => m.route === '/entityExplorer')
|
|
|
|
|
|
const entityDetailMenu = menus.find(m => m.route === '/entityDetail')
|
|
|
|
|
|
breadcrumb.push({
|
|
|
|
|
|
code: entityMenu.code,
|
|
|
|
|
|
value: entityMenu.i18n ? this.$t(entityMenu.i18n) : entityMenu.name,
|
|
|
|
|
|
route: entityMenu.route,
|
|
|
|
|
|
type: entityMenu.type
|
|
|
|
|
|
})
|
|
|
|
|
|
breadcrumb.push({
|
|
|
|
|
|
code: entityDetailMenu.code,
|
|
|
|
|
|
value: entityDetailMenu.i18n ? this.$t(entityDetailMenu.i18n) : entityDetailMenu.name,
|
|
|
|
|
|
route: entityDetailMenu.route,
|
|
|
|
|
|
type: entityDetailMenu.type
|
|
|
|
|
|
})
|
|
|
|
|
|
return true
|
2023-08-02 11:17:24 +08:00
|
|
|
|
} else if (this.route === '/entityGraph') {
|
|
|
|
|
|
const entityMenu = menus.find(m => m.route === '/entityExplorer')
|
|
|
|
|
|
const entityGraphMenu = menus.find(m => m.route === '/entityGraph')
|
|
|
|
|
|
breadcrumb.push({
|
|
|
|
|
|
code: entityMenu.code,
|
|
|
|
|
|
value: entityMenu.i18n ? this.$t(entityMenu.i18n) : entityMenu.name,
|
|
|
|
|
|
route: entityMenu.route,
|
|
|
|
|
|
type: entityMenu.type
|
|
|
|
|
|
})
|
|
|
|
|
|
breadcrumb.push({
|
|
|
|
|
|
code: entityGraphMenu.code,
|
|
|
|
|
|
value: entityGraphMenu.i18n ? this.$t(entityGraphMenu.i18n) : entityGraphMenu.name,
|
|
|
|
|
|
route: entityGraphMenu.route,
|
|
|
|
|
|
type: entityGraphMenu.type
|
|
|
|
|
|
})
|
|
|
|
|
|
return true
|
2023-05-15 15:31:22 +08:00
|
|
|
|
}
|
2023-02-24 18:51:17 +08:00
|
|
|
|
const menu = menus.find(m => m.route === this.route)
|
|
|
|
|
|
if (menu) {
|
2023-02-26 23:06:57 +08:00
|
|
|
|
breadcrumb.unshift({
|
|
|
|
|
|
code: menu.code,
|
|
|
|
|
|
value: menu.i18n ? this.$t(menu.i18n) : menu.name,
|
|
|
|
|
|
route: menu.route,
|
|
|
|
|
|
type: menu.type
|
|
|
|
|
|
})
|
2023-02-24 18:51:17 +08:00
|
|
|
|
return true
|
|
|
|
|
|
} else {
|
|
|
|
|
|
for (let i = 0; i < menus.length; i++) {
|
|
|
|
|
|
if (!_.isEmpty(menus[i].children)) {
|
|
|
|
|
|
if (this.generateBreadcrumb(breadcrumb, menus[i].children)) {
|
2023-02-26 23:06:57 +08:00
|
|
|
|
breadcrumb.unshift({
|
|
|
|
|
|
code: menus[i].code,
|
|
|
|
|
|
value: menus[i].i18n ? this.$t(menus[i].i18n) : menus[i].name,
|
|
|
|
|
|
route: menus[i].route,
|
|
|
|
|
|
type: menus[i].type
|
|
|
|
|
|
})
|
2023-02-24 18:51:17 +08:00
|
|
|
|
return true
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-08-24 17:36:27 +08:00
|
|
|
|
handleClose () {
|
|
|
|
|
|
this.showChangePin = false
|
|
|
|
|
|
},
|
2021-06-07 18:35:16 +08:00
|
|
|
|
changeLocal (lang) {
|
2022-04-14 15:52:07 +08:00
|
|
|
|
if (lang !== localStorage.getItem(storageKey.language)) {
|
|
|
|
|
|
localStorage.setItem(storageKey.language, lang)
|
2021-06-07 18:35:16 +08:00
|
|
|
|
window.location.reload()
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
showPinDialog () {
|
|
|
|
|
|
this.showChangePin = true
|
|
|
|
|
|
},
|
|
|
|
|
|
logout () {
|
2022-05-19 18:26:51 +08:00
|
|
|
|
sessionStorage.removeItem(storageKey.tokenExpireCurrentPath)
|
2022-01-03 22:46:22 +08:00
|
|
|
|
localStorage.removeItem(storageKey.token)
|
2023-08-24 17:15:41 +08:00
|
|
|
|
axios.get(api.logout)
|
2021-06-07 18:35:16 +08:00
|
|
|
|
},
|
|
|
|
|
|
refreshLang () {
|
2022-04-14 15:52:07 +08:00
|
|
|
|
this.language = localStorage.getItem(storageKey.language)
|
2021-06-07 18:35:16 +08:00
|
|
|
|
this.$i18n.locale = this.language
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
window.location.reload()
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
2022-11-07 15:48:46 +08:00
|
|
|
|
getCurTabByLabel (label) {
|
2022-11-04 12:18:26 +08:00
|
|
|
|
let curTab = null
|
2022-11-07 15:48:46 +08:00
|
|
|
|
const tableType = this.$route.params ? this.$route.params.typeName : 'networkOverview'
|
|
|
|
|
|
const curTableInCode = networkTable[tableType] ? networkTable[tableType] : networkTable.networkOverview
|
2022-11-04 12:18:26 +08:00
|
|
|
|
if (curTableInCode && curTableInCode.tabList) {
|
2022-12-09 18:15:04 +08:00
|
|
|
|
curTab = curTableInCode.tabList.find(item => item.label === label)
|
2022-11-04 12:18:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
return curTab
|
|
|
|
|
|
},
|
2022-11-03 17:51:53 +08:00
|
|
|
|
async initDropdownList () {
|
2022-11-07 15:48:46 +08:00
|
|
|
|
// 是否需要dns的qtype和rcode的数据字典
|
2022-11-04 12:18:26 +08:00
|
|
|
|
this.curTabProp = this.$route.query.dimensionType ? this.$route.query.dimensionType : null
|
2022-11-07 15:48:46 +08:00
|
|
|
|
const currentValue = document.getElementById('breadcrumbValue') ? document.getElementById('breadcrumbValue').innerText : ''
|
|
|
|
|
|
const columnName = this.getUrlParam(this.curTabState.thirdMenu, '')
|
2022-08-05 15:46:31 +08:00
|
|
|
|
let type = 'ip'
|
2022-11-07 15:48:46 +08:00
|
|
|
|
const tableType = this.$route.params ? this.$route.params.typeName : 'networkOverview'
|
|
|
|
|
|
const curTableInCode = networkTable[tableType] ? networkTable[tableType] : networkTable.networkOverview
|
2022-10-09 08:24:07 +08:00
|
|
|
|
if (curTableInCode && curTableInCode.tabList) {
|
2022-12-09 18:15:04 +08:00
|
|
|
|
const curTab = curTableInCode.tabList.find(item => item.label === columnName)
|
2022-08-05 15:46:31 +08:00
|
|
|
|
if (curTab) {
|
|
|
|
|
|
type = curTab.prop
|
2023-09-06 15:17:02 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
type = curTableInCode.tabList[0].prop
|
2022-08-05 15:46:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
startTime: getSecond(this.chartTimeFilter.startTime),
|
|
|
|
|
|
endTime: getSecond(this.chartTimeFilter.endTime),
|
|
|
|
|
|
limit: 10 * this.curPageNum++,
|
|
|
|
|
|
type: type,
|
|
|
|
|
|
name: this.dropDownValue ? this.dropDownValue : ''
|
|
|
|
|
|
}
|
2023-01-05 10:52:20 +08:00
|
|
|
|
// 有的界面刷新时没有drilldownList接口地址,会报404
|
|
|
|
|
|
if (!curTableInCode.url.drilldownList) {
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|
2023-08-24 17:15:41 +08:00
|
|
|
|
axios.get(curTableInCode.url.drilldownList, { params }).then(async response => {
|
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
|
this.breadcrumbColumnValueListShow = response.data.data.result
|
2022-12-15 17:42:01 +08:00
|
|
|
|
if (this.$route.params.typeName === fromRoute.dnsServiceInsights) {
|
|
|
|
|
|
if (this.dnsQtypeMapData.size === 0) {
|
|
|
|
|
|
this.dnsQtypeMapData = await getDnsMapData('dnsQtype')
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.dnsRcodeMapData.size === 0) {
|
|
|
|
|
|
this.dnsRcodeMapData = await getDnsMapData('dnsRcode')
|
|
|
|
|
|
}
|
2022-11-21 11:28:56 +08:00
|
|
|
|
}
|
2022-08-05 15:46:31 +08:00
|
|
|
|
this.$nextTick(() => {
|
2022-08-09 11:02:59 +08:00
|
|
|
|
this.breadcrumbColumnValueListShow.forEach(item => {
|
|
|
|
|
|
const selectedDom = document.getElementById(item)
|
|
|
|
|
|
if (selectedDom) {
|
2022-11-04 12:18:26 +08:00
|
|
|
|
let itemName = item
|
2022-11-07 15:48:46 +08:00
|
|
|
|
if (this.curTabProp === 'qtype') {
|
2022-11-04 12:18:26 +08:00
|
|
|
|
itemName = this.dnsQtypeMapData.get(item)
|
2022-11-07 15:48:46 +08:00
|
|
|
|
} else if (this.curTabProp === 'rcode') {
|
2022-11-04 12:18:26 +08:00
|
|
|
|
itemName = this.dnsRcodeMapData.get(item)
|
|
|
|
|
|
}
|
|
|
|
|
|
if (itemName === currentValue) {
|
2022-08-09 11:02:59 +08:00
|
|
|
|
selectedDom.style.cssText = 'color:#0091ff;font-weight: bold;'
|
|
|
|
|
|
} else {
|
|
|
|
|
|
selectedDom.style.cssText = ''
|
2022-08-05 15:46:31 +08:00
|
|
|
|
}
|
2022-08-09 11:02:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
2022-08-05 15:46:31 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
showBreadcrumbPopover (valueMenuId) {
|
2022-08-19 10:46:24 +08:00
|
|
|
|
this.breadcrumbColumnValueListShow.splice(0, this.breadcrumbColumnValueListShow.length)
|
2022-08-05 15:46:31 +08:00
|
|
|
|
this.curPageNum = 1
|
|
|
|
|
|
this.showBackground = true
|
|
|
|
|
|
this.dropDownValue = ''
|
2022-08-09 11:02:59 +08:00
|
|
|
|
this.initDropdownList()
|
2022-08-05 15:46:31 +08:00
|
|
|
|
this.valueMenuId = 'breadcrumb' + valueMenuId
|
|
|
|
|
|
},
|
|
|
|
|
|
hideBreadcrumbPopover () {
|
|
|
|
|
|
this.showBackground = false
|
|
|
|
|
|
},
|
2022-09-23 19:01:30 +08:00
|
|
|
|
getUrlParam (param, defaultValue, isNumber) {
|
|
|
|
|
|
if (isNumber) {
|
2022-09-20 11:44:39 +08:00
|
|
|
|
return this.$route.query[param] ? Number(this.$route.query[param]) : defaultValue
|
2022-09-23 19:01:30 +08:00
|
|
|
|
} else {
|
2022-09-20 11:44:39 +08:00
|
|
|
|
return this.$route.query[param] ? this.$route.query[param] : defaultValue
|
|
|
|
|
|
}
|
2022-09-20 09:33:49 +08:00
|
|
|
|
},
|
2022-08-05 15:46:31 +08:00
|
|
|
|
changeValue (value) {
|
|
|
|
|
|
// 设置面包屑显示的内容及hover时的title
|
2022-11-04 12:18:26 +08:00
|
|
|
|
let valName = value
|
2023-06-07 17:44:49 +08:00
|
|
|
|
if (this.curTabProp === 'qtype') {
|
2022-11-07 15:48:46 +08:00
|
|
|
|
valName = this.dnsQtypeMapData.get(value)
|
2023-06-07 17:44:49 +08:00
|
|
|
|
} else if (this.curTabProp === 'rcode') {
|
2022-11-07 15:48:46 +08:00
|
|
|
|
valName = this.dnsRcodeMapData.get(value)
|
2022-11-04 12:18:26 +08:00
|
|
|
|
}
|
|
|
|
|
|
this.curTabProp = this.$route.query.dimensionType ? this.$route.query.dimensionType : null
|
2023-06-07 17:44:49 +08:00
|
|
|
|
document.getElementById('breadcrumbValue').innerText = valName
|
2022-11-04 12:18:26 +08:00
|
|
|
|
document.getElementById(this.valueMenuId).setAttribute('title', valName)
|
2022-08-09 11:02:59 +08:00
|
|
|
|
document.getElementById('breadcrumbButton').click()
|
2022-09-20 09:33:49 +08:00
|
|
|
|
const columnName = this.getUrlParam(this.curTabState.thirdMenu, '')
|
2022-11-16 16:59:52 +08:00
|
|
|
|
const curTab = this.getCurTabByLabel(columnName)
|
2022-11-04 12:18:26 +08:00
|
|
|
|
if (curTab) {
|
|
|
|
|
|
const queryCondition = []
|
|
|
|
|
|
const searchProps = curTab.dillDownProp
|
|
|
|
|
|
if (curTab.prop === 'protocolPort') {
|
|
|
|
|
|
const valueGroup = value.split(':')
|
|
|
|
|
|
if (valueGroup) {
|
2022-11-07 15:48:46 +08:00
|
|
|
|
queryCondition.push('common_l7_protocol=\'' + valueGroup[0] + '\'')
|
2022-11-04 12:18:26 +08:00
|
|
|
|
queryCondition.push('common_server_port=' + valueGroup[1])
|
2022-08-24 11:54:09 +08:00
|
|
|
|
}
|
2023-01-18 11:53:21 +08:00
|
|
|
|
// console.log(queryCondition.join(' AND '))
|
2022-11-04 12:18:26 +08:00
|
|
|
|
this.urlChangeParams[this.curTabState.queryCondition] = queryCondition.join(' AND ')
|
2023-09-05 08:30:50 +08:00
|
|
|
|
this.urlChangeParams[this.curTabState.lineQueryCondition] = queryCondition.join(' AND ')
|
2022-11-04 12:18:26 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
searchProps.forEach(item => {
|
2022-11-17 15:21:17 +08:00
|
|
|
|
queryCondition.push(item + '=\'' + handleSpecialValue(value) + '\'')
|
2022-11-04 12:18:26 +08:00
|
|
|
|
})
|
|
|
|
|
|
this.urlChangeParams[this.curTabState.queryCondition] = queryCondition.join(' OR ')
|
2023-09-05 08:30:50 +08:00
|
|
|
|
const lineQueryCondition = []
|
|
|
|
|
|
if (curTab.lineQueryCondition) {
|
|
|
|
|
|
curTab.lineQueryCondition.forEach(item => {
|
|
|
|
|
|
lineQueryCondition.push(item.replaceAll('$param', value))
|
|
|
|
|
|
})
|
|
|
|
|
|
this.urlChangeParams[this.curTabState.lineQueryCondition] = lineQueryCondition.join(' OR ')
|
|
|
|
|
|
}
|
2022-08-05 15:46:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-10-02 16:21:39 +08:00
|
|
|
|
this.changeUrlTabState()
|
2022-10-07 21:04:08 +08:00
|
|
|
|
this.jump(this.route, columnName, value, operationType.fourthMenu)
|
2022-08-05 15:46:31 +08:00
|
|
|
|
},
|
2021-06-07 18:35:16 +08:00
|
|
|
|
shrink () {
|
2022-07-15 16:53:01 +08:00
|
|
|
|
this.showMenu = !this.showMenu
|
2021-08-24 17:36:27 +08:00
|
|
|
|
},
|
|
|
|
|
|
submit () {
|
|
|
|
|
|
this.$refs.changePassForm.validate((valid) => {
|
|
|
|
|
|
if (valid) {
|
2023-08-24 17:15:41 +08:00
|
|
|
|
axios.put(api.pin, {
|
2022-11-07 15:48:46 +08:00
|
|
|
|
oldPin: this.changePassForm.oldPwd,
|
|
|
|
|
|
newPin: this.changePassForm.newPwd
|
|
|
|
|
|
}).then(res => {
|
2023-08-24 17:15:41 +08:00
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
|
this.$message.success(this.$t('tip.success'))
|
2021-08-24 17:36:27 +08:00
|
|
|
|
this.showChangePin = false
|
2023-08-24 17:15:41 +08:00
|
|
|
|
} else if (res.data.code === 518005) {
|
|
|
|
|
|
this.$message.error(this.$t('tip.incorrectPassword'))
|
2023-07-03 16:14:09 +08:00
|
|
|
|
} else {
|
2023-08-24 17:15:41 +08:00
|
|
|
|
this.$message.error(res.data.message)
|
2023-07-03 16:14:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
}).catch(e => {
|
|
|
|
|
|
console.error(e)
|
|
|
|
|
|
if (e.response.data && e.response.data.message) {
|
|
|
|
|
|
this.$message.error(e.response.data.message)
|
|
|
|
|
|
} else {
|
2023-08-01 17:58:27 +08:00
|
|
|
|
this.$message.error(this.$t('tip.somethingWentWrong'))
|
2021-08-24 17:36:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return false
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2022-07-15 16:53:01 +08:00
|
|
|
|
},
|
2022-10-02 16:21:39 +08:00
|
|
|
|
changeUrlTabState () {
|
|
|
|
|
|
if (this.urlChangeParams && JSON.stringify(this.urlChangeParams) !== '{}') {
|
|
|
|
|
|
const { query } = this.$route
|
|
|
|
|
|
const newUrl = urlParamsHandler(window.location.href, query, this.urlChangeParams)
|
|
|
|
|
|
overwriteUrl(newUrl)
|
|
|
|
|
|
}
|
|
|
|
|
|
this.urlChangeParams = {}
|
2022-09-16 17:46:20 +08:00
|
|
|
|
},
|
2022-12-09 18:15:04 +08:00
|
|
|
|
async handleCurDrilldownTableConfig (thirdMenu) {
|
2022-11-07 15:48:46 +08:00
|
|
|
|
// const userId = localStorage.getItem(storageKey.userId)
|
2022-09-30 07:35:09 +08:00
|
|
|
|
const tableType = this.$route.params ? this.$route.params.typeName : 'networkOverview'
|
2022-12-15 17:42:01 +08:00
|
|
|
|
const metric = this.getUrlParam(this.curTabState.tableMetric, 'Bits/s')
|
2022-12-21 11:40:49 +08:00
|
|
|
|
const drillDownTableConfigs = await combineDrilldownTableWithUserConfig()
|
2022-09-30 07:35:09 +08:00
|
|
|
|
const currentTableConfig = drillDownTableConfigs.find(config => config.route === tableType)
|
|
|
|
|
|
const tables = currentTableConfig ? currentTableConfig.tables : []
|
|
|
|
|
|
const commonTabList = currentTableConfig ? currentTableConfig.tabs : []
|
|
|
|
|
|
if (tables && tables.length > 0) {
|
2022-10-07 21:04:08 +08:00
|
|
|
|
const curTable = tables.find(table => table.id === tableType)
|
2022-09-30 07:35:09 +08:00
|
|
|
|
if (curTable) {
|
|
|
|
|
|
const tabList = getTabList(curTable, metric)// 未下钻的tab列表
|
|
|
|
|
|
if (tabList && tabList.length > 0) {
|
|
|
|
|
|
combineTabList(tableType, tabList, commonTabList)
|
|
|
|
|
|
tabList.forEach(item => {
|
|
|
|
|
|
if (item.label === thirdMenu) {
|
|
|
|
|
|
item.checked = true
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2023-09-05 08:30:50 +08:00
|
|
|
|
async jump (route, columnName, columnValue, opeType) {
|
2022-12-22 17:20:42 +08:00
|
|
|
|
if (route === '/panel/linkMonitor' && opeType === 3) {
|
|
|
|
|
|
return true
|
|
|
|
|
|
}
|
2022-08-24 17:15:22 +08:00
|
|
|
|
this.showMenu = false
|
2022-09-30 07:35:09 +08:00
|
|
|
|
const menus = this.breadcrumb
|
2022-08-05 15:46:31 +08:00
|
|
|
|
if (opeType) {
|
2022-10-02 16:21:39 +08:00
|
|
|
|
this.urlChangeParams[this.curTabState.tabOperationBeforeType] = this.getUrlParam(this.curTabState.tabOperationType, '', true)
|
|
|
|
|
|
this.urlChangeParams[this.curTabState.tabOperationType] = opeType
|
2022-10-11 15:59:55 +08:00
|
|
|
|
if (opeType === 3) {
|
2023-01-31 15:41:04 +08:00
|
|
|
|
this.urlChangeParams.queryCondition = ''
|
2023-09-06 15:17:02 +08:00
|
|
|
|
this.urlChangeParams.lineQueryCondition = ''
|
2022-10-11 15:59:55 +08:00
|
|
|
|
}
|
2022-08-05 15:46:31 +08:00
|
|
|
|
} else {
|
2022-10-02 16:21:39 +08:00
|
|
|
|
this.urlChangeParams[this.curTabState.tabOperationType] = operationType.mainMenu
|
2022-08-05 15:46:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (!columnName) { // 点击第二级菜单
|
|
|
|
|
|
this.$store.commit('setNetworkOverviewTabList', [])
|
|
|
|
|
|
}
|
|
|
|
|
|
// 清空网络概况的特殊面包屑
|
2023-09-05 08:30:50 +08:00
|
|
|
|
const tableType = this.$route.params ? this.$route.params.typeName : 'networkOverview'
|
|
|
|
|
|
const metric = this.getUrlParam(this.curTabState.tableMetric, 'Bits/s')
|
|
|
|
|
|
const curTab = await getDefaultCurTab(tableType, metric, columnName)
|
2022-08-05 15:46:31 +08:00
|
|
|
|
this.$store.getters.menuList.forEach(menu => {
|
|
|
|
|
|
if (!this.$_.isEmpty(menu.children)) {
|
|
|
|
|
|
menu.children.forEach(child => {
|
|
|
|
|
|
if (this.$route.path === child.route) {
|
|
|
|
|
|
if (columnValue) { // 点击的为值
|
|
|
|
|
|
child.columnValue = columnValue
|
|
|
|
|
|
child.columnName = columnName
|
2022-10-02 16:21:39 +08:00
|
|
|
|
this.urlChangeParams[this.curTabState.thirdMenu] = columnName
|
|
|
|
|
|
this.urlChangeParams[this.curTabState.fourthMenu] = columnValue
|
2022-11-07 15:48:46 +08:00
|
|
|
|
// const tabObjGroup = networkOverviewTabList.filter(item => item.label == columnName)
|
|
|
|
|
|
// let curTab = this.getCurTabByLabel()
|
|
|
|
|
|
// const type = curTab ? curTab.prop : ''
|
|
|
|
|
|
// this.curTabProp = this.$route.query.dimensionType ? this.$route.query.dimensionType : null
|
|
|
|
|
|
// this.urlChangeParams[this.curTabState.dimensionType] = type
|
2022-10-02 16:21:39 +08:00
|
|
|
|
this.urlChangeParams[this.curTabState.panelName] = columnValue
|
2022-08-05 15:46:31 +08:00
|
|
|
|
} else if (columnName) { // 点击的为列名
|
|
|
|
|
|
child.columnValue = ''
|
|
|
|
|
|
child.columnName = columnName
|
2022-10-02 16:21:39 +08:00
|
|
|
|
this.urlChangeParams[this.curTabState.thirdMenu] = columnName
|
|
|
|
|
|
this.urlChangeParams[this.curTabState.fourthMenu] = ''
|
2022-11-17 15:21:17 +08:00
|
|
|
|
this.urlChangeParams[this.curTabState.panelName] = columnName
|
2023-09-05 08:30:50 +08:00
|
|
|
|
if (curTab.thirdDimensionQueryCondition) {
|
|
|
|
|
|
this.urlChangeParams[this.curTabState.thirdDimensionQueryCondition] = curTab.thirdDimensionQueryCondition.join(' OR ')
|
|
|
|
|
|
}
|
|
|
|
|
|
if (curTab.lineThirdDimensionQueryCondition) {
|
|
|
|
|
|
this.urlChangeParams[this.curTabState.lineThirdDimensionQueryCondition] = curTab.lineThirdDimensionQueryCondition.join(' OR ')
|
|
|
|
|
|
}
|
2022-10-02 16:21:39 +08:00
|
|
|
|
this.urlChangeParams[this.curTabState.curTab] = curTab.prop
|
|
|
|
|
|
this.urlChangeParams[this.curTabState.dimensionType] = curTab ? curTab.prop : ''
|
2023-09-05 08:30:50 +08:00
|
|
|
|
this.$_.omit(this.urlChangeParams, [this.curTabState.queryCondition, this.curTabState.networkOverviewBeforeTab, this.curTabState.lineQueryCondition])
|
2022-08-05 15:46:31 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
child.columnName = ''
|
|
|
|
|
|
child.columnValue = ''
|
2023-09-07 12:05:04 +08:00
|
|
|
|
this.$_.omit(this.urlChangeParams, [this.curTabState.thirdPanel, this.curTabState.fourthPanel, this.curTabState.thirdMenu, this.curTabState.fourthMenu, this.curTabState.dimensionType, this.curTabState.panelName, this.curTabState.curTab, this.curTabState.queryCondition, this.curTabState.lineQueryCondition, this.curTabState.networkOverviewBeforeTab, this.curTabState.lineThirdDimensionQueryCondition, this.curTabState.thirdDimensionQueryCondition])
|
2022-08-05 15:46:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2022-10-02 16:21:39 +08:00
|
|
|
|
this.changeUrlTabState()
|
2022-09-30 07:35:09 +08:00
|
|
|
|
if (opeType === 2 || opeType === 0) { // 二级菜单 或主菜单
|
|
|
|
|
|
// 如果有四级菜单,则将四级菜单对应tab的checked设置为true:根据columnName和columnValue 或 url判断不准确
|
|
|
|
|
|
if (menus[3]) {
|
2022-10-02 16:21:39 +08:00
|
|
|
|
this.handleCurDrilldownTableConfig(this.breadcrumb[2], this.breadcrumb[3])
|
2022-09-30 07:35:09 +08:00
|
|
|
|
}
|
2022-10-09 18:47:09 +08:00
|
|
|
|
this.$router.push({
|
2022-09-30 07:35:09 +08:00
|
|
|
|
path: route,
|
|
|
|
|
|
query: {
|
|
|
|
|
|
t: +new Date()
|
|
|
|
|
|
}
|
2022-10-09 18:47:09 +08:00
|
|
|
|
})
|
2023-10-16 15:21:34 +08:00
|
|
|
|
return
|
2022-09-30 07:35:09 +08:00
|
|
|
|
} else if (opeType === 3) {
|
2022-10-09 18:47:09 +08:00
|
|
|
|
this.$router.push({
|
2022-11-07 15:48:46 +08:00
|
|
|
|
query: {
|
|
|
|
|
|
...this.$route.query,
|
|
|
|
|
|
fourthPanel: '',
|
|
|
|
|
|
t: +new Date()
|
|
|
|
|
|
}
|
2022-10-09 18:47:09 +08:00
|
|
|
|
})
|
2023-10-16 15:21:34 +08:00
|
|
|
|
return
|
2022-12-09 18:15:04 +08:00
|
|
|
|
} else if (opeType !== 4) {
|
2022-10-09 18:47:09 +08:00
|
|
|
|
this.$router.push({
|
2022-11-07 15:48:46 +08:00
|
|
|
|
query: {
|
|
|
|
|
|
...this.$route.query,
|
|
|
|
|
|
fourthPanel: '',
|
|
|
|
|
|
thirdPanel: '',
|
|
|
|
|
|
t: +new Date()
|
|
|
|
|
|
}
|
2022-10-09 18:47:09 +08:00
|
|
|
|
})
|
2023-10-16 15:21:34 +08:00
|
|
|
|
return
|
2022-08-19 10:46:24 +08:00
|
|
|
|
}
|
2023-10-30 16:28:33 +08:00
|
|
|
|
if (route === this.route) {
|
2022-07-15 16:53:01 +08:00
|
|
|
|
this.refresh()
|
|
|
|
|
|
return
|
2023-10-30 16:28:33 +08:00
|
|
|
|
}
|
2022-08-26 16:24:29 +08:00
|
|
|
|
if (route) {
|
2022-10-09 18:47:09 +08:00
|
|
|
|
this.$router.push({
|
2022-08-26 16:24:29 +08:00
|
|
|
|
path: route,
|
|
|
|
|
|
query: {
|
|
|
|
|
|
t: +new Date()
|
|
|
|
|
|
}
|
2022-10-09 18:47:09 +08:00
|
|
|
|
})
|
2022-08-26 16:24:29 +08:00
|
|
|
|
}
|
2022-07-15 16:53:01 +08:00
|
|
|
|
},
|
2022-08-05 15:46:31 +08:00
|
|
|
|
dropDownSearch () {
|
|
|
|
|
|
this.curPageNum = 1
|
|
|
|
|
|
this.initDropdownList()
|
|
|
|
|
|
},
|
2022-07-15 16:53:01 +08:00
|
|
|
|
refresh () {
|
|
|
|
|
|
this.$emit('refresh')
|
2022-08-05 15:46:31 +08:00
|
|
|
|
},
|
|
|
|
|
|
refreshPanel (menu) {
|
|
|
|
|
|
if (this.breadcrumb.length >= 4) {
|
|
|
|
|
|
const breadList = this.breadcrumb.splice(3, this.breadcrumb.length - 3)
|
|
|
|
|
|
this.breadcrumb = ref(breadList)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
scrollList () {
|
|
|
|
|
|
const obj = document.getElementById('breadcrumbSelectDropdown')
|
|
|
|
|
|
if (obj.scrollTop + obj.clientHeight === obj.scrollHeight) {
|
|
|
|
|
|
this.initDropdownList()
|
|
|
|
|
|
}
|
2021-06-07 18:35:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|