fix:修改 黑暗主题下 ping trace样式的问题 以及chart-line 最大值为负数的问题

This commit is contained in:
zhangyu
2022-05-31 17:31:32 +08:00
parent 3959695a7c
commit 62adfbdc58
18 changed files with 113 additions and 15 deletions

View File

@@ -415,3 +415,9 @@ td .nz-icon-gear:before{
input, textarea { input, textarea {
font-family: Inter-Regular !important; font-family: Inter-Regular !important;
} }
.message-next{
vertical-align: bottom;
float: unset;
font-size: 10px;
margin-left: 190px;
}

View File

@@ -217,3 +217,7 @@
.fz12{ .fz12{
font-size: 12px; font-size: 12px;
} }
.el-skeleton__item{
//background-color: $--background-color-disabled !important;
//background-image: unset !important;
}

View File

@@ -225,7 +225,7 @@
} }
.list-page.profile-right { .list-page.profile-right {
width: calc(100% - 370px); width: calc(100% - 370px);
padding: 0px 0px 7px 0px; padding: 0;
pxbox-shadow: 0 1px 2px 0 rgba(0,0,0,0.06); pxbox-shadow: 0 1px 2px 0 rgba(0,0,0,0.06);
border-radius: 2px; border-radius: 2px;
.nz-table2 { .nz-table2 {

View File

@@ -251,6 +251,7 @@
} }
.right-content-box{ .right-content-box{
width: 380px; width: 380px;
color: $--color-text-primary;
} }
.tools-header-right-content{ .tools-header-right-content{
margin-left: 30px; margin-left: 30px;
@@ -410,3 +411,11 @@
} }
} }
td.el-table__expanded-cell {
padding: 0 0 0 60px;
background-color: $--popover-background-color !important;
}
td.el-table__expanded-cell:hover {
padding: 0 0 0 60px;
background-color: $--background-color-base !important;
}

View File

@@ -253,7 +253,7 @@ $--right-box-sub-title-border-color: $--border-color-light;
$--tooltip-background-color: #222329; $--tooltip-background-color: #222329;
$--tooltip-border-color: rgba(112,116,122,0.6); $--tooltip-border-color: rgba(112,116,122,0.6);
/* 17.label*/ /* 17.label*/
$--label-background-color: #18171D; $--label-background-color: $--background-color-empty;
/*** themes/common.scss是与主题切换无关的变量 ***/ /*** themes/common.scss是与主题切换无关的变量 ***/
@import './src/common/var.scss'; @import './src/common/var.scss';

View File

@@ -158,11 +158,19 @@ export default {
minValue = valueSorted.length ? valueSorted[0][1] : 0 minValue = valueSorted.length ? valueSorted[0][1] : 0
maxValue = valueSorted.length ? valueSorted[valueSorted.length - 1][1] : 0 maxValue = valueSorted.length ? valueSorted[valueSorted.length - 1][1] : 0
const unit = chartDataFormat.getUnit(chartUnit) const unit = chartDataFormat.getUnit(chartUnit)
minValue = minValue > 0 ? 0 : minValue
if (!isNaN(maxValue)) { if (!isNaN(maxValue)) {
maxValue = Number(maxValue) maxValue = Number(maxValue)
} else { } else {
maxValue = 0 maxValue = 0
} }
if (maxValue < 0) {
maxValue = Math.abs(maxValue)
}
if (Math.abs(minValue) > Math.abs(maxValue)) {
maxValue = Math.abs(minValue)
}
maxValue = maxValue - minValue
maxValue = chartDataFormat.formatDatas(maxValue, unit.type, 'ceil', unit.ascii) // 取最大值后 需要对其进行取整 maxValue = chartDataFormat.formatDatas(maxValue, unit.type, 'ceil', unit.ascii) // 取最大值后 需要对其进行取整
let oldValue = maxValue let oldValue = maxValue
let dot = 0 let dot = 0
@@ -192,7 +200,7 @@ export default {
offset = Number.parseInt(offset) offset = Number.parseInt(offset)
const localOffset = new Date().getTimezoneOffset() * 60 * 1000 * -1 // 默认 一分钟显示时区偏移的结果 const localOffset = new Date().getTimezoneOffset() * 60 * 1000 * -1 // 默认 一分钟显示时区偏移的结果
if (window.dataJson) { if (window.dataJson) {
offset = new Date().getTimezoneOffset()* -1/60 offset = new Date().getTimezoneOffset() * -1 / 60
} }
const tData = new Date(value - localOffset + offset * 60 * 60 * 1000) const tData = new Date(value - localOffset + offset * 60 * 60 * 1000)
let hour = tData.getHours() let hour = tData.getHours()

View File

@@ -226,9 +226,21 @@ export default {
const chartUnit = chartInfo.unit ? chartInfo.unit : 2 const chartUnit = chartInfo.unit ? chartInfo.unit : 2
const unit = chartDataFormat.getUnit(chartUnit) const unit = chartDataFormat.getUnit(chartUnit)
minValue = minValue > 0 ? 0 : minValue minValue = minValue > 0 ? 0 : minValue
if (maxValue < 0) {
maxValue = Math.abs(maxValue)
}
if (Math.abs(minValue) > Math.abs(maxValue)) {
maxValue = Math.abs(minValue)
}
maxValue = maxValue - minValue maxValue = maxValue - minValue
maxValue = chartDataFormat.formatDatas(maxValue, unit.type, 'ceil', unit.ascii) maxValue = chartDataFormat.formatDatas(maxValue, unit.type, 'ceil', unit.ascii)
let oldValue = maxValue let oldValue = maxValue
if (maxValue < 0) {
oldValue = Math.abs(maxValue)
}
if (minValue < 0) {
oldValue = Math.abs(maxValue - minValue)
}
let dot = 0 let dot = 0
if (maxValue == 1) { if (maxValue == 1) {
dot++ dot++

View File

@@ -2071,6 +2071,17 @@ export default {
const chartUnit = chartInfo.unit ? chartInfo.unit : 2 const chartUnit = chartInfo.unit ? chartInfo.unit : 2
const unit = chartDataFormat.getUnit(chartUnit) const unit = chartDataFormat.getUnit(chartUnit)
minValue = minValue > 0 ? 0 : minValue minValue = minValue > 0 ? 0 : minValue
if (!isNaN(maxValue)) {
maxValue = Number(maxValue)
} else {
maxValue = 0
}
if (maxValue < 0) {
maxValue = Math.abs(maxValue)
}
if (Math.abs(minValue) > Math.abs(maxValue)) {
maxValue = Math.abs(minValue)
}
maxValue = maxValue - minValue maxValue = maxValue - minValue
maxValue = chartDataFormat.formatDatas(maxValue, unit.type, 'ceil', unit.ascii) maxValue = chartDataFormat.formatDatas(maxValue, unit.type, 'ceil', unit.ascii)
let oldValue = maxValue let oldValue = maxValue

View File

@@ -11,7 +11,7 @@
<div class="global-search-content" v-if="!firstShow"> <div class="global-search-content" v-if="!firstShow">
<div class="global-search-content-content" v-if="!isNoData"> <div class="global-search-content-content" v-if="!isNoData">
<div class="global-search-content-left"> <div class="global-search-content-left">
<el-skeleton :loading="loading" animated class="list"> <el-skeleton :loading="true" animated class="list">
<template slot="template"> <template slot="template">
<li <li
v-for="(item,index) in skeletonArr" v-for="(item,index) in skeletonArr"

View File

@@ -1,5 +1,5 @@
<template> <template>
<el-skeleton style="height: 100%;width: 100%" :loading="loading || faLoading" animated> <el-skeleton style="height: 100%;width: 100%" :loading="true" animated>
<template slot="template"> <template slot="template">
<div class="search-item-box"> <div class="search-item-box">
<div class="search-item-title-icon"> <div class="search-item-title-icon">

View File

@@ -1,7 +1,11 @@
export default { export default {
data () { data () {
return { return {
isEdit: false isEdit: false,
messageParams: {
route: '',
params: {}
}
} }
}, },
mounted () { mounted () {
@@ -11,6 +15,31 @@ export default {
} }
} }
}, },
methods: {
messageShow (msg, route, params, showNext = false) {
this.messageParams.route = route
this.messageParams.params = params
this.$message({
duration: 2000,
dangerouslyUseHTMLString: true,
type: 'success',
message: `<div>${msg} <span id="assetAdd" class="message-next ${showNext ? '' : 'hidden'}">Next</span></div>`,
onClose: () => {
const assetAdd = document.getElementById('assetAdd')
assetAdd.removeEventListener('click', this.saveNext)
}
})
const assetAdd = document.getElementById('assetAdd')
assetAdd.addEventListener('click', this.saveNext)
},
saveNext () {
console.log(this.assetId)
this.$router.push({
path: this.messageParams.route,
query: this.messageParams.params
})
}
},
destroyed () { destroyed () {
window.onbeforeunload = null window.onbeforeunload = null
} }

View File

@@ -433,7 +433,8 @@ export default {
}) })
} }
} }
} },
assetId: ''
} }
}, },
watch: { watch: {
@@ -686,6 +687,8 @@ export default {
}) })
}, },
save () { save () {
const self = this
// console.log(123123132, self, 'params.id')
if (this.prevent_opt.save) { return } if (this.prevent_opt.save) { return }
this.prevent_opt.save = true this.prevent_opt.save = true
@@ -740,7 +743,7 @@ export default {
this.$put(this.url, params).then(res => { this.$put(this.url, params).then(res => {
this.prevent_opt.save = false this.prevent_opt.save = false
if (res.code === 200) { if (res.code === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) this.messageShow(this.$t('tip.saveSuccess'), '/endpoint', { assetId: res.data.id }, false)
this.esc(true) this.esc(true)
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
@@ -750,7 +753,7 @@ export default {
this.$post(this.url, params).then(res => { this.$post(this.url, params).then(res => {
this.prevent_opt.save = false this.prevent_opt.save = false
if (res.code === 200) { if (res.code === 200) {
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') }) this.messageShow(this.$t('tip.saveSuccess'), '/endpoint', { assetId: res.data.id }, false)
this.esc(true) this.esc(true)
} else { } else {
this.$message.error(res.msg) this.$message.error(res.msg)
@@ -763,7 +766,6 @@ export default {
} }
}) })
}, },
getStateData () { getStateData () {
return new Promise(resolve => { return new Promise(resolve => {
this.$get('asset/stateConf?pageSize=-1').then(response => { this.$get('asset/stateConf?pageSize=-1').then(response => {

View File

@@ -1107,7 +1107,7 @@ export default {
this.editEndpoint.moduleId = '' this.editEndpoint.moduleId = ''
this.editEndpoint.name = '' this.editEndpoint.name = ''
this.editEndpoint.assetName = '' this.editEndpoint.assetName = ''
this.editEndpoint.assetId = '' // this.editEndpoint.assetId = ''
this.$refs.sp.remove() this.$refs.sp.remove()
this.$refs.moduleForm.clearValidate('moduleId') this.$refs.moduleForm.clearValidate('moduleId')
} }
@@ -1479,7 +1479,9 @@ export default {
} }
}, },
mounted () { mounted () {
setTimeout(() => {
this.editEndpoint.assetId = this.module.assetId + ''
}, 500)
}, },
created () { created () {
this.getProjectList() this.getProjectList()

View File

@@ -544,6 +544,17 @@ export default {
const chartUnit = chartInfo.unit ? chartInfo.unit : 2 const chartUnit = chartInfo.unit ? chartInfo.unit : 2
const unit = chartDataFormat.getUnit(chartUnit) const unit = chartDataFormat.getUnit(chartUnit)
minValue = minValue > 0 ? 0 : minValue minValue = minValue > 0 ? 0 : minValue
if (!isNaN(maxValue)) {
maxValue = Number(maxValue)
} else {
maxValue = 0
}
if (maxValue < 0) {
maxValue = Math.abs(maxValue)
}
if (Math.abs(minValue) > Math.abs(maxValue)) {
maxValue = Math.abs(minValue)
}
maxValue = maxValue - minValue maxValue = maxValue - minValue
maxValue = chartDataFormat.formatDatas(maxValue, unit.type, 'ceil', unit.ascii) maxValue = chartDataFormat.formatDatas(maxValue, unit.type, 'ceil', unit.ascii)
let oldValue = maxValue let oldValue = maxValue

View File

@@ -580,7 +580,6 @@ export default {
this.$get('visual/panel/chart?panelId=' + params.panelId + '&groupId=0' + '&pageSize=-1').then(response => { this.$get('visual/panel/chart?panelId=' + params.panelId + '&groupId=0' + '&pageSize=-1').then(response => {
if (response.code === 200) { if (response.code === 200) {
this.chartListLoading = false this.chartListLoading = false
// response = chartData
this.dataList = response.data.list.map(item => { this.dataList = response.data.list.map(item => {
return { return {
...item, ...item,

View File

@@ -875,6 +875,13 @@ export default {
this.initQueryFromPath(searchKeys) this.initQueryFromPath(searchKeys)
}, },
mounted () { mounted () {
if (this.$route.query && this.$route.query.assetId) {
this.object = {
...this.newObject(),
assetId: JSON.stringify(this.$route.query.assetId),
}
this.rightBox.show = true
}
if (localStorage.getItem('endpointProjectId')) { if (localStorage.getItem('endpointProjectId')) {
this.selectValue.projectIds = [Number(localStorage.getItem('endpointProjectId'))] this.selectValue.projectIds = [Number(localStorage.getItem('endpointProjectId'))]
// this.$refs.clickSearch.selectValueOut.projectIds = [localStorage.getItem('endpointProjectId')] // this.$refs.clickSearch.selectValueOut.projectIds = [localStorage.getItem('endpointProjectId')]

View File

@@ -208,7 +208,6 @@ export default {
} }
if (event.path[0].className === 'ti-input') { if (event.path[0].className === 'ti-input') {
const tiInputBox = document.getElementsByClassName('ti-new-tag-input')[0] const tiInputBox = document.getElementsByClassName('ti-new-tag-input')[0]
console.log(tiInputBox)
tiInputBox.focus() tiInputBox.focus()
} }
}) })

View File

@@ -209,7 +209,6 @@ export default {
} }
if (event.path[0].className === 'ti-input') { if (event.path[0].className === 'ti-input') {
const tiInputBox = document.getElementsByClassName('ti-new-tag-input')[0] const tiInputBox = document.getElementsByClassName('ti-new-tag-input')[0]
console.log(tiInputBox)
tiInputBox.focus() tiInputBox.focus()
} }
}) })