Merge branch 'dev-3.3' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.3
This commit is contained in:
@@ -95,6 +95,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
.list-item{
|
.list-item{
|
||||||
height: 64px;
|
height: 64px;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
}
|
}
|
||||||
.search-item-value-box{
|
.search-item-value-box{
|
||||||
line-height: 47px;
|
line-height: 47px;
|
||||||
height: 100%;
|
height: 13px;
|
||||||
width: calc(100% - 120px);
|
width: calc(100% - 120px);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -107,17 +107,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.panel-select-item:hover{
|
.panel-select-item:hover{
|
||||||
color: #FA901C;
|
color: $--color-primary;
|
||||||
background: $--background-color-base;
|
background: $--background-color-base;
|
||||||
i{
|
i{
|
||||||
color: #FA901C;
|
color: $--color-primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.panel-select-item.active{
|
.panel-select-item.active{
|
||||||
color: #FA901C;
|
color: $--color-primary;
|
||||||
background: $--background-color-base;
|
background: $--background-color-base;
|
||||||
i{
|
i{
|
||||||
color: #FA901C;
|
color: $--color-primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -161,4 +161,8 @@
|
|||||||
color:#FF9219 !important;
|
color:#FF9219 !important;
|
||||||
cursor: pointer ;
|
cursor: pointer ;
|
||||||
}
|
}
|
||||||
|
.highlight-keyword{
|
||||||
|
color:$--color-primary;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ import {
|
|||||||
myCubec,
|
myCubec,
|
||||||
myCubeAnchors
|
myCubeAnchors
|
||||||
} from '../project/L5/services/canvas.js'
|
} from '../project/L5/services/canvas.js'
|
||||||
import {getTopology, getTopologyImg, setTopology, setTopologyImg} from '../js/common'
|
import {getTopology, setTopology} from '../js/common'
|
||||||
import CanvasProps from '../project/L5/CanvasProps'
|
import CanvasProps from '../project/L5/CanvasProps'
|
||||||
import topologyTopTool from '../project/L5/topologyTopTool'
|
import topologyTopTool from '../project/L5/topologyTopTool'
|
||||||
import popDataMain from '../project/popData/Main'
|
import popDataMain from '../project/popData/Main'
|
||||||
@@ -1744,7 +1744,7 @@ export default {
|
|||||||
res.data.list.forEach((item, index) => {
|
res.data.list.forEach((item, index) => {
|
||||||
item.imageName = item.name
|
item.imageName = item.name
|
||||||
delete item.name
|
delete item.name
|
||||||
const nowImage = getTopologyImg(item.id) ? JSON.parse(getTopologyImg(item.id)) : ''
|
const nowImage = ''
|
||||||
if (nowImage && nowImage.data) {
|
if (nowImage && nowImage.data) {
|
||||||
promiseArr.push(nowImage)
|
promiseArr.push(nowImage)
|
||||||
} else {
|
} else {
|
||||||
@@ -1756,14 +1756,6 @@ export default {
|
|||||||
this.iconArray = [...res.data.list]
|
this.iconArray = [...res.data.list]
|
||||||
this.iconArray.forEach((item, index) => {
|
this.iconArray.forEach((item, index) => {
|
||||||
item.image = res2[index].data
|
item.image = res2[index].data
|
||||||
const nowImage = getTopologyImg(item.id) ? JSON.parse(getTopologyImg(item.id)) : ''
|
|
||||||
if (!nowImage || (nowImage && !nowImage.data)) {
|
|
||||||
setTopologyImg(item.id, JSON.stringify({
|
|
||||||
data: res2[index].data,
|
|
||||||
width: res2[index].width,
|
|
||||||
height: res2[index].height
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
const group = this.tools.find(tool => tool.group === item.unit)
|
const group = this.tools.find(tool => tool.group === item.unit)
|
||||||
if (group) {
|
if (group) {
|
||||||
group.children.push({
|
group.children.push({
|
||||||
@@ -1814,7 +1806,7 @@ export default {
|
|||||||
}
|
}
|
||||||
imgidList.forEach((item, index) => {
|
imgidList.forEach((item, index) => {
|
||||||
if (item.data.imageId && imageAllId.data.list.find(image => item.data.imageId === image.id)) {
|
if (item.data.imageId && imageAllId.data.list.find(image => item.data.imageId === image.id)) {
|
||||||
const nowImage = getTopologyImg(item.data.imageId) ? JSON.parse(getTopologyImg(item.data.imageId)) : ''
|
const nowImage = ''
|
||||||
if (nowImage && nowImage.data) {
|
if (nowImage && nowImage.data) {
|
||||||
promiseArr.push(nowImage)
|
promiseArr.push(nowImage)
|
||||||
} else {
|
} else {
|
||||||
@@ -1835,14 +1827,6 @@ export default {
|
|||||||
this.iconArray.forEach((item, index) => {
|
this.iconArray.forEach((item, index) => {
|
||||||
if (item.id) {
|
if (item.id) {
|
||||||
item.image = res2[index].data
|
item.image = res2[index].data
|
||||||
const nowImage = getTopologyImg(item.id) ? JSON.parse(getTopologyImg(item.id)) : ''
|
|
||||||
if (!nowImage || (nowImage && !nowImage.image)) {
|
|
||||||
setTopologyImg(item.id, JSON.stringify({
|
|
||||||
data: res2[index].data,
|
|
||||||
width: res2[index].width,
|
|
||||||
height: res2[index].height
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.imgInit = true
|
this.imgInit = true
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<div class="list-item-sub" v-if="item.sub">
|
<div class="list-item-sub" v-if="item.sub">
|
||||||
{{ item.sub }}
|
{{ item.sub }}
|
||||||
</div>
|
</div>
|
||||||
<div class="is-jump" v-my-loading:circle3.scaleMin.icon="true">
|
<div class="is-jump" v-my-loading:circle3.scaleMin.icon="jumpLoading">
|
||||||
<i class="nz-icon nz-icon-huiche"></i>
|
<i class="nz-icon nz-icon-huiche"></i>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -45,11 +45,11 @@ export function setTopology (key, value) {
|
|||||||
// const topologyImgList = localStorage.getItem('nz-imgList') ? JSON.parse(localStorage.getItem('nz-imgList')) : {}
|
// const topologyImgList = localStorage.getItem('nz-imgList') ? JSON.parse(localStorage.getItem('nz-imgList')) : {}
|
||||||
|
|
||||||
export function getTopologyImg (key) {
|
export function getTopologyImg (key) {
|
||||||
return localStorage.getItem('nz-topologyImg-' + key)
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setTopologyImg (key, img) {
|
export function setTopologyImg (key, img) {
|
||||||
localStorage.setItem('nz-topologyImg-' + key, img)
|
// localStorage.setItem('nz-topologyImg-' + key, img)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setHexagon (key, value) {
|
export function setHexagon (key, value) {
|
||||||
|
|||||||
@@ -8,8 +8,10 @@
|
|||||||
<span>{{item.name}}</span>
|
<span>{{item.name}}</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div slot="default">
|
<div class="dashboard-select-tail">
|
||||||
<slot name="tail"></slot>
|
<span class="dashboard-select-add" v-has="'main_add'" :title='$t("dashboard.panel.createPanelTitleSec")' @click="toAdd">
|
||||||
|
<i class="nz-icon nz-icon-create-square"></i> {{$t('overall.addDashboard')}}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pop-item-wider">
|
<div class="pop-item-wider">
|
||||||
@@ -28,11 +30,11 @@
|
|||||||
check-on-click-node
|
check-on-click-node
|
||||||
check-strictly
|
check-strictly
|
||||||
default-expand-all
|
default-expand-all
|
||||||
highlight-current
|
:highlight-current="true"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
ref="panelTree">
|
ref="panelTree">
|
||||||
<div class="tree--node" slot-scope="{ node, data }">
|
<div class="tree--node" slot-scope="{ node, data }">
|
||||||
<span :title="node.label + ' (' + data.chartNum +' charts)' ">{{ node.label }}</span>
|
<HighlightText :queries="filterPanel" :highlightClass="'highlight-keyword'" style="vertical-align: middle" :title="node.label + ' (' + data.chartNum +' charts)' ">{{node.label}}</HighlightText>
|
||||||
<el-row class="block-col-2" style="margin-left:10px;margin-right:8px">
|
<el-row class="block-col-2" style="margin-left:10px;margin-right:8px">
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-dropdown v-if="!panelLock" placement="bottom-end" trigger="click" style="margin-right:10px">
|
<el-dropdown v-if="!panelLock" placement="bottom-end" trigger="click" style="margin-right:10px">
|
||||||
@@ -64,8 +66,12 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import bus from '@/libs/bus'
|
import bus from '@/libs/bus'
|
||||||
|
import HighlightText from 'vue-text-highlight'
|
||||||
export default {
|
export default {
|
||||||
name: 'selectDashboard',
|
name: 'selectDashboard',
|
||||||
|
components: {
|
||||||
|
HighlightText
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
placement: { type: String },
|
placement: { type: String },
|
||||||
panelData: { type: Array },
|
panelData: { type: Array },
|
||||||
@@ -123,6 +129,12 @@ export default {
|
|||||||
this.userId = localStorage.getItem('nz-user-id')
|
this.userId = localStorage.getItem('nz-user-id')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 新增仪表盘
|
||||||
|
toAdd () {
|
||||||
|
this.$parent.toAdd()
|
||||||
|
this.esc()
|
||||||
|
},
|
||||||
|
|
||||||
// 左侧tab点击
|
// 左侧tab点击
|
||||||
tabChange (value) {
|
tabChange (value) {
|
||||||
if (this.currentTab !== value) {
|
if (this.currentTab !== value) {
|
||||||
@@ -141,7 +153,7 @@ export default {
|
|||||||
const flatArr = this.flatten(this.panelData)
|
const flatArr = this.flatten(this.panelData)
|
||||||
this.treeData = flatArr.filter(item => item.createBy == this.userId)
|
this.treeData = flatArr.filter(item => item.createBy == this.userId)
|
||||||
} else if (type === 'browse') { // 最近浏览
|
} else if (type === 'browse') { // 最近浏览
|
||||||
const browseArr = JSON.parse(localStorage.getItem(`nz-${this.userId}-browse`) || '[]')
|
const browseArr = JSON.parse(localStorage.getItem(`nz-view-dashboard-${this.userId}`) || '[]')
|
||||||
const flatArr = this.flatten(this.panelData)
|
const flatArr = this.flatten(this.panelData)
|
||||||
const tempArr = []
|
const tempArr = []
|
||||||
// 比对id获取最近浏览的数据
|
// 比对id获取最近浏览的数据
|
||||||
@@ -215,7 +227,7 @@ export default {
|
|||||||
// 设置最近浏览的面板
|
// 设置最近浏览的面板
|
||||||
setBrowse () {
|
setBrowse () {
|
||||||
// 获取最近浏览id数组
|
// 获取最近浏览id数组
|
||||||
let browseArr = JSON.parse(localStorage.getItem(`nz-${this.userId}-browse`) || '[]')
|
let browseArr = JSON.parse(localStorage.getItem(`nz-view-dashboard-${this.userId}`) || '[]')
|
||||||
const flatArr = this.flatten(this.panelData)
|
const flatArr = this.flatten(this.panelData)
|
||||||
// 若最近浏览的数据已被删除 则截取掉
|
// 若最近浏览的数据已被删除 则截取掉
|
||||||
for (let i = 0; i < browseArr.length; i++) {
|
for (let i = 0; i < browseArr.length; i++) {
|
||||||
@@ -236,7 +248,7 @@ export default {
|
|||||||
browseArr.unshift({ id: this.panel.id })
|
browseArr.unshift({ id: this.panel.id })
|
||||||
// 如果数组长度大于10则截取
|
// 如果数组长度大于10则截取
|
||||||
browseArr.splice(10)
|
browseArr.splice(10)
|
||||||
localStorage.setItem(`nz-${this.userId}-browse`, JSON.stringify(browseArr))
|
localStorage.setItem(`nz-view-dashboard-${this.userId}`, JSON.stringify(browseArr))
|
||||||
},
|
},
|
||||||
// 新增收藏
|
// 新增收藏
|
||||||
addStarred: bus.debounceFn(function (data) {
|
addStarred: bus.debounceFn(function (data) {
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ import {
|
|||||||
myCubec,
|
myCubec,
|
||||||
myCubeAnchors
|
myCubeAnchors
|
||||||
} from './L5/services/canvas.js'
|
} from './L5/services/canvas.js'
|
||||||
import { getTopology, setTopology, getTopologyImg, setTopologyImg } from '../js/common'
|
import { getTopology, setTopology } from '../js/common'
|
||||||
import CanvasProps from './L5/CanvasProps'
|
import CanvasProps from './L5/CanvasProps'
|
||||||
import topologyTopTool from './L5//topologyTopTool'
|
import topologyTopTool from './L5//topologyTopTool'
|
||||||
import CanvasContextMenu from './L5/CanvasContextMenu'
|
import CanvasContextMenu from './L5/CanvasContextMenu'
|
||||||
@@ -1744,26 +1744,13 @@ export default {
|
|||||||
res.data.list.forEach((item, index) => {
|
res.data.list.forEach((item, index) => {
|
||||||
item.imageName = item.name
|
item.imageName = item.name
|
||||||
delete item.name
|
delete item.name
|
||||||
const nowImage = getTopologyImg(item.id) ? JSON.parse(getTopologyImg(item.id)) : ''
|
|
||||||
if (nowImage && nowImage.data) {
|
|
||||||
promiseArr.push(nowImage)
|
|
||||||
} else {
|
|
||||||
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.id}/1`))
|
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.id}/1`))
|
||||||
}
|
|
||||||
imgArr.push({ ...item })
|
imgArr.push({ ...item })
|
||||||
})
|
})
|
||||||
Promise.all(promiseArr).then((res2, header) => {
|
Promise.all(promiseArr).then((res2, header) => {
|
||||||
this.iconArray = [...res.data.list]
|
this.iconArray = [...res.data.list]
|
||||||
this.iconArray.forEach((item, index) => {
|
this.iconArray.forEach((item, index) => {
|
||||||
item.image = res2[index].data
|
item.image = res2[index].data
|
||||||
const nowImage = getTopologyImg(item.id) ? JSON.parse(getTopologyImg(item.id)) : ''
|
|
||||||
if (!nowImage || (nowImage && !nowImage.data)) {
|
|
||||||
setTopologyImg(item.id, JSON.stringify({
|
|
||||||
data: res2[index].data,
|
|
||||||
width: res2[index].width,
|
|
||||||
height: res2[index].height
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
const group = this.tools.find(tool => tool.group === item.unit)
|
const group = this.tools.find(tool => tool.group === item.unit)
|
||||||
if (group) {
|
if (group) {
|
||||||
group.children.push({
|
group.children.push({
|
||||||
@@ -1816,12 +1803,7 @@ export default {
|
|||||||
}
|
}
|
||||||
imgidList.forEach((item, index) => {
|
imgidList.forEach((item, index) => {
|
||||||
if (item.data.imageId && imageAllId.data.list.find(image => item.data.imageId === image.id)) {
|
if (item.data.imageId && imageAllId.data.list.find(image => item.data.imageId === image.id)) {
|
||||||
const nowImage = getTopologyImg(item.data.imageId) ? JSON.parse(getTopologyImg(item.data.imageId)) : ''
|
|
||||||
if (nowImage && nowImage.data) {
|
|
||||||
promiseArr.push(nowImage)
|
|
||||||
} else {
|
|
||||||
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.data.imageId}/1`))
|
promiseArr.push(this.dealImg(`monitor/project/topo/icon/${item.data.imageId}/1`))
|
||||||
}
|
|
||||||
} else if (item.data.imageId) {
|
} else if (item.data.imageId) {
|
||||||
promiseArr.push(imgDefault)
|
promiseArr.push(imgDefault)
|
||||||
} else {
|
} else {
|
||||||
@@ -1837,14 +1819,6 @@ export default {
|
|||||||
this.iconArray.forEach((item, index) => {
|
this.iconArray.forEach((item, index) => {
|
||||||
if (item.id) {
|
if (item.id) {
|
||||||
item.image = res2[index].data
|
item.image = res2[index].data
|
||||||
const nowImage = getTopologyImg(item.id) ? JSON.parse(getTopologyImg(item.id)) : ''
|
|
||||||
if (!nowImage || (nowImage && !nowImage.image)) {
|
|
||||||
setTopologyImg(item.id, JSON.stringify({
|
|
||||||
data: res2[index].data,
|
|
||||||
width: res2[index].width,
|
|
||||||
height: res2[index].height
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.imgInit = true
|
this.imgInit = true
|
||||||
|
|||||||
@@ -30,13 +30,6 @@
|
|||||||
<i @click.stop="delStarred(showPanel)" v-if="showPanel.starred" class="nz-icon nz-icon-a-xingzhuang2"></i>
|
<i @click.stop="delStarred(showPanel)" v-if="showPanel.starred" class="nz-icon nz-icon-a-xingzhuang2"></i>
|
||||||
<i @click.stop="addStarred(showPanel)" v-else class="nz-icon nz-icon-xingzhuang"></i>
|
<i @click.stop="addStarred(showPanel)" v-else class="nz-icon nz-icon-xingzhuang"></i>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:tail>
|
|
||||||
<div class="dashboard-select-tail">
|
|
||||||
<span class="dashboard-select-add" v-has="'main_add'" :title='$t("dashboard.panel.createPanelTitleSec")' @click="toAdd">
|
|
||||||
<i class="nz-icon nz-icon-create-square"></i> {{$t('overall.addDashboard')}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</select-dashboard>
|
</select-dashboard>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ import chartList from '@/components/chart/chartList.vue'
|
|||||||
import moment from 'moment-timezone'
|
import moment from 'moment-timezone'
|
||||||
import { loadI18n } from '@/components/common/i18n'
|
import { loadI18n } from '@/components/common/i18n'
|
||||||
import i18nData from '@/entrance/exportHtml/i18nData'
|
import i18nData from '@/entrance/exportHtml/i18nData'
|
||||||
|
|
||||||
const dataJson = window.dataJson || {}
|
const dataJson = window.dataJson || {}
|
||||||
export default {
|
export default {
|
||||||
name: 'Entrance',
|
name: 'Entrance',
|
||||||
@@ -67,7 +68,7 @@ export default {
|
|||||||
this.$i18n.locale = this.dataJson.language
|
this.$i18n.locale = this.dataJson.language
|
||||||
loadI18n(i18nData)
|
loadI18n(i18nData)
|
||||||
const localOffset = moment.tz.guess()// 默认 一分钟显示时区偏移的结果
|
const localOffset = moment.tz.guess()// 默认 一分钟显示时区偏移的结果
|
||||||
localStorage.setItem('nz-sys-timezone', JSON.stringify(localOffset))
|
localStorage.setItem('nz-sys-timezone', localOffset)
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user