Merge branch 'dev-3.7' of git.mesalab.cn:nezha/nezha-fronted into dev-3.7

This commit is contained in:
zyh
2023-04-07 16:50:44 +08:00
10 changed files with 41 additions and 22 deletions

View File

@@ -423,6 +423,7 @@
position: absolute;
bottom: 1px;
height: 48px;
z-index: 1;
width: calc(100% - 20px);
}
}

View File

@@ -415,6 +415,7 @@
.el-select{
width: 310px;
.el-input__inner{
font-size: 14px;
color: $--color-text-primary;
}
}
@@ -450,6 +451,7 @@
height: 36px !important;
line-height: 36px !important;
padding-left: 12px;
font-size: 14px;
color: $--color-text-regular;
border-color: $--border-color-light;
background: $--select-page-hover-background-color !important;

View File

@@ -17,6 +17,7 @@
:show-zoom="false"
class="meta2d-chart"
:is-chart="true"
:iconArray="iconArray"
:ref="'topology' + index"
/>
</el-carousel-item>
@@ -37,7 +38,8 @@ export default {
data () {
return {
topologyLoading: false,
allProject: []
allProject: [],
iconArray: []
}
},
mixins: [chartMixin],
@@ -136,6 +138,9 @@ export default {
},
mounted () {
// this.queryAllProjectData()
this.$get('/topology/icon').then(res => {
this.iconArray = [...res.data.list]
})
},
beforeDestroy () {
this.allProject = []

View File

@@ -4,7 +4,8 @@ export default {
topoData: {},
querysArray: [],
meta2dType: '',
params: {}
params: {},
iconArray: []
}
},
watch: {

View File

@@ -73,7 +73,7 @@ export default {
nodesArr: [],
offsetX: 0,
offsetY: 0,
moduleId: ''
moduleId: '',
}
},
mixins: [topoUtil],
@@ -152,8 +152,11 @@ export default {
pen.text = name
}
if (pen.data && pen.data.imageId) {
const imageInfo = this.iconArray.find(item => item.id === 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 = {
params: { // 用于编辑时 重置为节点初始状态

View File

@@ -126,6 +126,12 @@ export default {
mixins: [meta2dMain, topoUtil],
props: {
meta2dId: {}, // 唯一id 不可重复
iconArray: {
type: Array,
default: () => {
return []
}
},
topoData: {}, // topo图数据
isChart: {
type: Boolean,

View File

@@ -36,7 +36,7 @@
<transition name="el-zoom-in-top">
<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':''">
<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)"/>
<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>
@@ -167,12 +167,12 @@ export default {
selectImg: '',
unit: '',
imageName: '',
baseUrl: '',
baseUrl: 'http://192.168.44.22/',
token: ''
}
},
mounted () {
this.baseUrl = localStorage.getItem('nz-baseURL')
// this.baseUrl = localStorage.getItem('nz-baseURL')
this.token = localStorage.getItem('nz-token')
if (this.icon) {
const iconId = this.icon.charCodeAt().toString(16)
@@ -186,13 +186,13 @@ export default {
},
methods: {
imageInit () { // 加载所有图片
this.$get('monitor/project/topo/icon').then(res => {
this.$get('/topology/icon').then(res => {
this.imgageLoading = true
this.tools = [...Tools]
this.iconArray = [...res.data.list]
this.iconArray.forEach((item, index) => {
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) {
this.unit = item.unit
this.imageName = item.imageName
@@ -284,7 +284,7 @@ export default {
})
},
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) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
const findItem = this.tools.find(group => group.group === item.unit)
@@ -295,7 +295,7 @@ export default {
})
},
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) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
this.tools = this.tools.filter(group => group.group !== item.group)
@@ -398,7 +398,7 @@ export default {
form.append('unit', this.uploadPic.unit)
form.append('width', this.imgWidth)
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
if (res.code == 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })

View File

@@ -40,7 +40,7 @@
<!-- 顶部分页组件当打开底部上滑框时出现 -->
<!-- <div v-if="showLayout.indexOf('pagination') > -1" class="pagination-top pagination-top-hide display-none"></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>
</div>
<div v-show="bottomBox.mainResizeShow" :style="{ height: nzTableHeight }" class="nz-table-list">

View File

@@ -83,9 +83,7 @@ export default {
}
},
created () {
this.$nextTick(() => {
this.getAssetList()
})
this.getAssetList()
this.token = localStorage.getItem('nz-token')
axios.get('/healthy').then(response => {
const url = response.request.responseURL
@@ -107,10 +105,10 @@ export default {
if (response.code === 200) {
this.assetList = response.data.list
if (this.assetList && this.assetList.length > 0) {
// setTimeout(() => {
this.assetId = String(this.assetList[0].id)
this.loadFinish = true
// }, 100)
this.$nextTick(() => {
this.assetId = String(this.assetList[0].id)
this.loadFinish = true
})
}
}
})

View File

@@ -1,7 +1,7 @@
<template>
<div class="project">
<!-- <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">
<bottom-box
v-if="bottomBox.showSubList"
@@ -57,6 +57,7 @@
:querysArray="isPreview.querysArray"
:project="isPreview.currentProject"
:params="isPreview.params"
:iconArray="iconArray"
/>
</div>
</el-dialog>
@@ -620,7 +621,9 @@ export default {
setTimeout(() => {
this.ready = true
}, 300)
this.$get('/topology/icon').then(res => {
this.iconArray = [...res.data.list]
})
this.initEvent()
},
computed: {