fix:修改endpoint 显示问题

This commit is contained in:
zhangyu
2021-04-27 19:24:26 +08:00
parent 06584204ae
commit 257f27eedc
9 changed files with 33 additions and 24 deletions

View File

@@ -263,14 +263,12 @@ export default {
iframe.attachEvent('onload', function () { iframe.attachEvent('onload', function () {
// iframe加载完毕以后执行操作 // iframe加载完毕以后执行操作
that.firstShow = true that.firstShow = true
// console.log('iframe已加载完毕');
that.endLoading('screen') that.endLoading('screen')
}) })
} else { } else {
iframe.onload = function () { iframe.onload = function () {
// iframe加载完毕以后执行操作 // iframe加载完毕以后执行操作
that.firstShow = true that.firstShow = true
// console.log('iframe已加载完毕');
that.endLoading('screen') that.endLoading('screen')
} }
} }

View File

@@ -361,18 +361,13 @@ export default {
chartTitle.style.background = '#d8dce1' chartTitle.style.background = '#d8dce1'
}, },
clone (event) { clone (event) {
// console.log('clone',event );
const canvas = event.item.querySelector('canvas') const canvas = event.item.querySelector('canvas')
// console.log('clone-canvas',canvas);
const canvasclone = event.clone.querySelector('canvas') const canvasclone = event.clone.querySelector('canvas')
canvasclone.style.border = 'solid 1px yellow' canvasclone.style.border = 'solid 1px yellow'
// console.log('clone-canvasclone',canvasclone);
if (canvas && canvasclone) { if (canvas && canvasclone) {
const image = new Image() const image = new Image()
image.src = canvas.toDataURL() image.src = canvas.toDataURL()
// console.log('clone-image',image);
const ctxClone = canvasclone.getContext('2d') const ctxClone = canvasclone.getContext('2d')
// ctxClone.drawImage(image,0,0);
image.onload = function () { image.onload = function () {
ctxClone.drawImage(image, 0, 0) ctxClone.drawImage(image, 0, 0)
} }
@@ -662,7 +657,7 @@ export default {
}) })
return return
} }
if (param.from == fromRoute.chartTemp) { if (param.from == fromRoute.chartTemp) { // 模板列表
this.dataList = this.panelDataList this.dataList = this.panelDataList
this.$nextTick(() => { this.$nextTick(() => {
this.dataList.forEach((item, index) => { this.dataList.forEach((item, index) => {
@@ -685,7 +680,6 @@ export default {
item.isLoaded = false item.isLoaded = false
}) })
// response.data.list = response.data.list.filter((item) => item.groupId === -1 || !item.groupId) // 处理外层存在的groupItem // response.data.list = response.data.list.filter((item) => item.groupId === -1 || !item.groupId) // 处理外层存在的groupItem
// console.log(response.data.list)
if (response.data.list) { if (response.data.list) {
this.dataTotalListBak = response.data.list this.dataTotalListBak = response.data.list
} else { } else {

View File

@@ -37,7 +37,7 @@
<div :class="targetTab === 'panel' ? 'bottom-panel' : 'nz-table2'"> <div :class="targetTab === 'panel' ? 'bottom-panel' : 'nz-table2'">
<slot></slot> <slot></slot>
</div> </div>
<div class="pagination-bottom"> <div class="pagination-bottom" v-if="showPagination">
<slot name="pagination"></slot> <slot name="pagination"></slot>
</div> </div>
</div> </div>
@@ -76,6 +76,10 @@ export default {
customTool: { customTool: {
type: Boolean, type: Boolean,
default: false default: false
},
showPagination: {
type: Boolean,
default: true
} }
}, },
data () { data () {
@@ -131,6 +135,7 @@ export default {
padding: 10px; padding: 10px;
height: 100%; height: 100%;
background-color: #f6f6f6; background-color: #f6f6f6;
overflow-y: auto;
&>div { &>div {
background-color: white; background-color: white;
} }
@@ -180,6 +185,7 @@ export default {
.bottom-panel { .bottom-panel {
padding-top: 15px; padding-top: 15px;
background-color: white; background-color: white;
padding-bottom: 50px;
} }
.resize-modal { .resize-modal {

View File

@@ -6,6 +6,7 @@
:targetTab="targetTab" :targetTab="targetTab"
@changeTab="changeTab" @changeTab="changeTab"
class="full-width-height" class="full-width-height"
:showPagination="false"
> >
<template v-slot:title><span :title="obj.name">{{obj.name}}</span></template> <template v-slot:title><span :title="obj.name">{{obj.name}}</span></template>
<template v-if="from === fromRoute.asset" v-slot:top-tool-right> <template v-if="from === fromRoute.asset" v-slot:top-tool-right>
@@ -274,14 +275,17 @@ export default {
this.getData(this.filter) this.getData(this.filter)
} else { } else {
if (this.from == this.$CONSTANTS.fromRoute.chartTemp) { if (this.from == this.$CONSTANTS.fromRoute.chartTemp) {
console.log(this.obj)
this.panelDataList = [this.obj]
console.log(this.panelData)
if (this.obj.type === 'group') { if (this.obj.type === 'group') {
this.$get('/visual/panel/chart', { ids: this.obj.id,groupId:0}).then(res => { this.$get('/visual/panel/chart', { ids: this.obj.id,groupId:0}).then(res => {
console.log(res) this.panelDataList = res.data.list
if (this.panelDataList.length > 0) {
this.showPanel.id = this.filter.panelId = 0
this.getData(this.filter)
}
}) })
return
} }
this.panelDataList = [this.obj]
if (this.panelDataList.length > 0) { if (this.panelDataList.length > 0) {
this.showPanel.id = this.filter.panelId = 0 this.showPanel.id = this.filter.panelId = 0
this.getData(this.filter) this.getData(this.filter)

View File

@@ -101,6 +101,7 @@ export default {
immediate: true, immediate: true,
deep: true, deep: true,
handler (n) { handler (n) {
console.log(n)
this.$emit('reload', n) this.$emit('reload', n)
} }
} }

View File

@@ -755,13 +755,13 @@ export default {
currentModuleCopy: { currentModuleCopy: {
immediate: true, immediate: true,
handler (n, o) { handler (n, o) {
if (n.type && n.type.toLowerCase() == 'snmp') { // if (n.type && n.type.toLowerCase() == 'snmp') {
this.endpointTableTitle[4].show = false // this.endpointTableTitle[4].show = false
this.endpointTableTitle[5].show = false // this.endpointTableTitle[5].show = false
} else { // } else {
this.endpointTableTitle[4].show = true // this.endpointTableTitle[4].show = true
this.endpointTableTitle[5].show = true // this.endpointTableTitle[5].show = true
} // }
} }
} }
} }

View File

@@ -77,7 +77,7 @@
<div v-else-if="scope.row[item.prop]===1"> <div v-else-if="scope.row[item.prop]===1">
<div class="active-icon green inline-block"></div> up <div class="active-icon green inline-block"></div> up
</div> </div>
<div v-else> <div v-else-if="scope.row[item.prop]">
<div class="active-icon gray inline-block"></div> suspended <div class="active-icon gray inline-block"></div> suspended
</div> </div>
</div> </div>
@@ -174,6 +174,7 @@ export default {
this.$message.success(this.$t('overall.copySuccess')) this.$message.success(this.$t('overall.copySuccess'))
}, },
suspendedStr (status) { // 10进制转为2进制 分别给对应的状态 suspendedStr (status) { // 10进制转为2进制 分别给对应的状态
if (!status || status === 1 || status == 0) { return '' }
const arr = status.toString(2).split('') const arr = status.toString(2).split('')
while (arr.length < 5) { while (arr.length < 5) {
arr.unshift('0') arr.unshift('0')

View File

@@ -266,7 +266,6 @@ export default {
response.data.list[i].status = response.data.list[i].status + '' response.data.list[i].status = response.data.list[i].status + ''
} }
this.tableData = response.data.list this.tableData = response.data.list
console.log(this.tableData);
this.pageObj.total = response.data.total this.pageObj.total = response.data.total
if (!this.scrollbarWrap) { if (!this.scrollbarWrap) {
this.$nextTick(() => { this.$nextTick(() => {
@@ -279,6 +278,9 @@ export default {
}, },
reloadTable (obj) { reloadTable (obj) {
Object.keys(obj).forEach(key => { Object.keys(obj).forEach(key => {
if (key === 'change') {
return
}
this.searchCheckBox[key] = obj[key].join(',') this.searchCheckBox[key] = obj[key].join(',')
}) })
console.log(obj, this.searchCheckBox) console.log(obj, this.searchCheckBox)

View File

@@ -1,5 +1,5 @@
import Vue from 'vue' import Vue from 'vue'
import moment from 'moment-timezone'
Date.prototype.setStart = function () { Date.prototype.setStart = function () {
this.setHours(0) this.setHours(0)
this.setMinutes(0) this.setMinutes(0)
@@ -261,6 +261,7 @@ export default new Vue({
// 将本地时区转为系统配置的时区 // 将本地时区转为系统配置的时区
computeTimezone: function (sourceTime) { computeTimezone: function (sourceTime) {
let offset = localStorage.getItem('nz-sys-timezone') let offset = localStorage.getItem('nz-sys-timezone')
offset = moment.tz(offset).zoneAbbr()
if (offset && offset !== 'undefined') { if (offset && offset !== 'undefined') {
offset = Number.parseInt(offset) offset = Number.parseInt(offset)
const date = new Date(sourceTime) const date = new Date(sourceTime)
@@ -296,6 +297,7 @@ export default new Vue({
}, },
UTCTimeToConfigTimezone (utcTime) { UTCTimeToConfigTimezone (utcTime) {
let offset = localStorage.getItem('nz-sys-timezone') let offset = localStorage.getItem('nz-sys-timezone')
offset = moment.tz(offset).zoneAbbr()
if (offset && offset !== 'undefined') { if (offset && offset !== 'undefined') {
let time = utcTime let time = utcTime
if (typeof time === 'string' && /(\d+?-){2}\d+?\s(\d+?:)*\d+/.test(time)) { if (typeof time === 'string' && /(\d+?-){2}\d+?\s(\d+?:)*\d+/.test(time)) {
@@ -310,6 +312,7 @@ export default new Vue({
}, },
configTimezoneToUTCTime: function (configTime) { configTimezoneToUTCTime: function (configTime) {
let offset = localStorage.getItem('nz-sys-timezone') let offset = localStorage.getItem('nz-sys-timezone')
offset = moment.tz(offset).zoneAbbr()
if (offset && offset !== 'undefined') { if (offset && offset !== 'undefined') {
let time = configTime let time = configTime
if (typeof time === 'string' && /(\d+?-){2}\d+?\s(\d+?:)*\d+/.test(time)) { if (typeof time === 'string' && /(\d+?-){2}\d+?\s(\d+?:)*\d+/.test(time)) {