Merge branch 'dev-3.7' of git.mesalab.cn:nezha/nezha-fronted into dev-3.7
This commit is contained in:
@@ -423,6 +423,7 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1px;
|
bottom: 1px;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
z-index: 1;
|
||||||
width: calc(100% - 20px);
|
width: calc(100% - 20px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,6 +415,7 @@
|
|||||||
.el-select{
|
.el-select{
|
||||||
width: 310px;
|
width: 310px;
|
||||||
.el-input__inner{
|
.el-input__inner{
|
||||||
|
font-size: 14px;
|
||||||
color: $--color-text-primary;
|
color: $--color-text-primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -450,6 +451,7 @@
|
|||||||
height: 36px !important;
|
height: 36px !important;
|
||||||
line-height: 36px !important;
|
line-height: 36px !important;
|
||||||
padding-left: 12px;
|
padding-left: 12px;
|
||||||
|
font-size: 14px;
|
||||||
color: $--color-text-regular;
|
color: $--color-text-regular;
|
||||||
border-color: $--border-color-light;
|
border-color: $--border-color-light;
|
||||||
background: $--select-page-hover-background-color !important;
|
background: $--select-page-hover-background-color !important;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
:show-zoom="false"
|
:show-zoom="false"
|
||||||
class="meta2d-chart"
|
class="meta2d-chart"
|
||||||
:is-chart="true"
|
:is-chart="true"
|
||||||
|
:iconArray="iconArray"
|
||||||
:ref="'topology' + index"
|
:ref="'topology' + index"
|
||||||
/>
|
/>
|
||||||
</el-carousel-item>
|
</el-carousel-item>
|
||||||
@@ -37,7 +38,8 @@ export default {
|
|||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
topologyLoading: false,
|
topologyLoading: false,
|
||||||
allProject: []
|
allProject: [],
|
||||||
|
iconArray: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mixins: [chartMixin],
|
mixins: [chartMixin],
|
||||||
@@ -136,6 +138,9 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
// this.queryAllProjectData()
|
// this.queryAllProjectData()
|
||||||
|
this.$get('/topology/icon').then(res => {
|
||||||
|
this.iconArray = [...res.data.list]
|
||||||
|
})
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
this.allProject = []
|
this.allProject = []
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ export default {
|
|||||||
topoData: {},
|
topoData: {},
|
||||||
querysArray: [],
|
querysArray: [],
|
||||||
meta2dType: '',
|
meta2dType: '',
|
||||||
params: {}
|
params: {},
|
||||||
|
iconArray: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export default {
|
|||||||
nodesArr: [],
|
nodesArr: [],
|
||||||
offsetX: 0,
|
offsetX: 0,
|
||||||
offsetY: 0,
|
offsetY: 0,
|
||||||
moduleId: ''
|
moduleId: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mixins: [topoUtil],
|
mixins: [topoUtil],
|
||||||
@@ -152,8 +152,11 @@ export default {
|
|||||||
pen.text = name
|
pen.text = name
|
||||||
}
|
}
|
||||||
if (pen.data && pen.data.imageId) {
|
if (pen.data && pen.data.imageId) {
|
||||||
|
const imageInfo = this.iconArray.find(item => item.id === pen.data.imageId)
|
||||||
pen.imageId = pen.data.imageId
|
pen.imageId = pen.data.imageId
|
||||||
pen.image = `/monitor/project/topo/icon/${pen.data.imageId}/0`
|
if (imageInfo) {
|
||||||
|
pen.image = `/topology/icon/0/${imageInfo.unit}/${imageInfo.name}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pen.data = {
|
pen.data = {
|
||||||
params: { // 用于编辑时 重置为节点初始状态
|
params: { // 用于编辑时 重置为节点初始状态
|
||||||
|
|||||||
@@ -126,6 +126,12 @@ export default {
|
|||||||
mixins: [meta2dMain, topoUtil],
|
mixins: [meta2dMain, topoUtil],
|
||||||
props: {
|
props: {
|
||||||
meta2dId: {}, // 唯一id 不可重复
|
meta2dId: {}, // 唯一id 不可重复
|
||||||
|
iconArray: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
topoData: {}, // topo图数据
|
topoData: {}, // topo图数据
|
||||||
isChart: {
|
isChart: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<transition name="el-zoom-in-top">
|
<transition name="el-zoom-in-top">
|
||||||
<div v-show="item.show" class="nz-collapse-body">
|
<div v-show="item.show" class="nz-collapse-body">
|
||||||
<div v-for="(btn, i) in item.children" :key="'info2'+'-'+index+'-'+i" class="buttons image-box-item" :class="btn.id === selectImgId ? 'is-select':''">
|
<div v-for="(btn, i) in item.children" :key="'info2'+'-'+index+'-'+i" class="buttons image-box-item" :class="btn.id === selectImgId ? 'is-select':''">
|
||||||
<img :src="btn.image" v-if="btn.image" class="image-src" @click.stop="selectImageChange(btn)">
|
<img :src="baseUrl + btn.image" v-if="btn.image" class="image-src" @click.stop="selectImageChange(btn)">
|
||||||
<i v-if="btn.nzClassName" class="nz-icon image-src" :class="btn.nzClassName" style="font-size: 40px" @click.stop="selectImageChange(btn)"/>
|
<i v-if="btn.nzClassName" class="nz-icon image-src" :class="btn.nzClassName" style="font-size: 40px" @click.stop="selectImageChange(btn)"/>
|
||||||
<div class="img-text text-ellipsis" :title="btn.imageName">{{btn.imageName}}</div>
|
<div class="img-text text-ellipsis" :title="btn.imageName">{{btn.imageName}}</div>
|
||||||
<i v-if="item.group!=='General'" class="delIcon nz-icon nz-icon-delete" @click.stop="tooltipDelete(btn)"></i>
|
<i v-if="item.group!=='General'" class="delIcon nz-icon nz-icon-delete" @click.stop="tooltipDelete(btn)"></i>
|
||||||
@@ -167,12 +167,12 @@ export default {
|
|||||||
selectImg: '',
|
selectImg: '',
|
||||||
unit: '',
|
unit: '',
|
||||||
imageName: '',
|
imageName: '',
|
||||||
baseUrl: '',
|
baseUrl: 'http://192.168.44.22/',
|
||||||
token: ''
|
token: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.baseUrl = localStorage.getItem('nz-baseURL')
|
// this.baseUrl = localStorage.getItem('nz-baseURL')
|
||||||
this.token = localStorage.getItem('nz-token')
|
this.token = localStorage.getItem('nz-token')
|
||||||
if (this.icon) {
|
if (this.icon) {
|
||||||
const iconId = this.icon.charCodeAt().toString(16)
|
const iconId = this.icon.charCodeAt().toString(16)
|
||||||
@@ -186,13 +186,13 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
imageInit () { // 加载所有图片
|
imageInit () { // 加载所有图片
|
||||||
this.$get('monitor/project/topo/icon').then(res => {
|
this.$get('/topology/icon').then(res => {
|
||||||
this.imgageLoading = true
|
this.imgageLoading = true
|
||||||
this.tools = [...Tools]
|
this.tools = [...Tools]
|
||||||
this.iconArray = [...res.data.list]
|
this.iconArray = [...res.data.list]
|
||||||
this.iconArray.forEach((item, index) => {
|
this.iconArray.forEach((item, index) => {
|
||||||
item.imageName = item.name
|
item.imageName = item.name
|
||||||
item.image = `/monitor/project/topo/icon/${item.id}/0`
|
item.image = `/topology/icon/0/${item.unit}/${item.name}`
|
||||||
if (this.imgId == item.id) {
|
if (this.imgId == item.id) {
|
||||||
this.unit = item.unit
|
this.unit = item.unit
|
||||||
this.imageName = item.imageName
|
this.imageName = item.imageName
|
||||||
@@ -284,7 +284,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
delImg (item) {
|
delImg (item) {
|
||||||
this.$delete('monitor/project/topo/icon?ids=' + item.imageId).then(res => {
|
this.$delete('topology/icon?ids=' + item.imageId).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
||||||
const findItem = this.tools.find(group => group.group === item.unit)
|
const findItem = this.tools.find(group => group.group === item.unit)
|
||||||
@@ -295,7 +295,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
delCollpseTitle (item) {
|
delCollpseTitle (item) {
|
||||||
this.$delete('monitor/project/topo/iconUnit?unit=' + item.group).then(res => {
|
this.$delete('/topology/unit?unit=' + item.group).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
||||||
this.tools = this.tools.filter(group => group.group !== item.group)
|
this.tools = this.tools.filter(group => group.group !== item.group)
|
||||||
@@ -398,7 +398,7 @@ export default {
|
|||||||
form.append('unit', this.uploadPic.unit)
|
form.append('unit', this.uploadPic.unit)
|
||||||
form.append('width', this.imgWidth)
|
form.append('width', this.imgWidth)
|
||||||
form.append('height', this.imgHeight)
|
form.append('height', this.imgHeight)
|
||||||
this.$post('monitor/project/topo/icon', form, { 'Content-Type': 'multipart/form-data' }).then(res => {
|
this.$post('/topology/icon', form, { 'Content-Type': 'multipart/form-data' }).then(res => {
|
||||||
this.imageSave = false
|
this.imageSave = false
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<!-- 顶部分页组件,当打开底部上滑框时出现 -->
|
<!-- 顶部分页组件,当打开底部上滑框时出现 -->
|
||||||
<!-- <div v-if="showLayout.indexOf('pagination') > -1" class="pagination-top pagination-top-hide display-none"></div>-->
|
<!-- <div v-if="showLayout.indexOf('pagination') > -1" class="pagination-top pagination-top-hide display-none"></div>-->
|
||||||
</div>
|
</div>
|
||||||
<div v-if="showLayout.indexOf('clickSearch') > -1" class="search-box">
|
<div v-show="bottomBox.mainResizeShow" v-if="showLayout.indexOf('clickSearch') > -1" class="search-box">
|
||||||
<slot name="search"></slot>
|
<slot name="search"></slot>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="bottomBox.mainResizeShow" :style="{ height: nzTableHeight }" class="nz-table-list">
|
<div v-show="bottomBox.mainResizeShow" :style="{ height: nzTableHeight }" class="nz-table-list">
|
||||||
|
|||||||
@@ -83,9 +83,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.$nextTick(() => {
|
this.getAssetList()
|
||||||
this.getAssetList()
|
|
||||||
})
|
|
||||||
this.token = localStorage.getItem('nz-token')
|
this.token = localStorage.getItem('nz-token')
|
||||||
axios.get('/healthy').then(response => {
|
axios.get('/healthy').then(response => {
|
||||||
const url = response.request.responseURL
|
const url = response.request.responseURL
|
||||||
@@ -107,10 +105,10 @@ export default {
|
|||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.assetList = response.data.list
|
this.assetList = response.data.list
|
||||||
if (this.assetList && this.assetList.length > 0) {
|
if (this.assetList && this.assetList.length > 0) {
|
||||||
// setTimeout(() => {
|
this.$nextTick(() => {
|
||||||
this.assetId = String(this.assetList[0].id)
|
this.assetId = String(this.assetList[0].id)
|
||||||
this.loadFinish = true
|
this.loadFinish = true
|
||||||
// }, 100)
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="project">
|
<div class="project">
|
||||||
<!-- <topologyL5 v-if="reloadFacade" ref="facade" :obj="currentProject" :topologyIndexF="topologyIndexF" targetTab.sync="panel" @changeTopologyIndexF="changeTopologyIndexF"/>-->
|
<!-- <topologyL5 v-if="reloadFacade" ref="facade" :obj="currentProject" :topologyIndexF="topologyIndexF" targetTab.sync="panel" @changeTopologyIndexF="changeTopologyIndexF"/>-->
|
||||||
<meta2dMain :meta2dId="'projectId'" :topoData="topoData" :querysArray="querysArray" :project="currentProject" :params="params" @reload="reload"/>
|
<meta2dMain :meta2dId="'projectId'" :topoData="topoData" :querysArray="querysArray" :project="currentProject" :params="params" :iconArray="iconArray" @reload="reload"/>
|
||||||
<transition name="el-zoom-in-bottom">
|
<transition name="el-zoom-in-bottom">
|
||||||
<bottom-box
|
<bottom-box
|
||||||
v-if="bottomBox.showSubList"
|
v-if="bottomBox.showSubList"
|
||||||
@@ -57,6 +57,7 @@
|
|||||||
:querysArray="isPreview.querysArray"
|
:querysArray="isPreview.querysArray"
|
||||||
:project="isPreview.currentProject"
|
:project="isPreview.currentProject"
|
||||||
:params="isPreview.params"
|
:params="isPreview.params"
|
||||||
|
:iconArray="iconArray"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -620,7 +621,9 @@ export default {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.ready = true
|
this.ready = true
|
||||||
}, 300)
|
}, 300)
|
||||||
|
this.$get('/topology/icon').then(res => {
|
||||||
|
this.iconArray = [...res.data.list]
|
||||||
|
})
|
||||||
this.initEvent()
|
this.initEvent()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
Reference in New Issue
Block a user