Merge branch 'dev-3.2' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.3
# Conflicts: # nezha-fronted/src/components/charts/chartDataFormat.js # nezha-fronted/src/components/page/asset/asset.vue
This commit is contained in:
@@ -309,7 +309,6 @@ export default {
|
||||
this.chartChildrenData = flag
|
||||
},
|
||||
resize () {
|
||||
console.log(this.$refs['chart' + this.chartInfo.id])
|
||||
this.$refs['chart' + this.chartInfo.id] && this.$refs['chart' + this.chartInfo.id].resize()
|
||||
},
|
||||
refreshLogs (params) {
|
||||
|
||||
@@ -341,7 +341,6 @@ export default {
|
||||
}
|
||||
},
|
||||
resize () {
|
||||
console.log(213)
|
||||
setTimeout(() => {
|
||||
getChart(this.chartId) && getChart(this.chartId).resize()
|
||||
}, 100)
|
||||
|
||||
@@ -34,7 +34,7 @@ function percent02 (value, index) {
|
||||
if (!numberWithEConvent(scientificNotationValue)) {
|
||||
return `${scientificNotationValue} %`
|
||||
}
|
||||
value = parseFloat((Number(value) * 100))
|
||||
value = parseFloat((Number(value) * 100).toFixed(2))
|
||||
return `${value} %`
|
||||
}
|
||||
function localFormat (value, index) {
|
||||
@@ -728,7 +728,7 @@ export default {
|
||||
pow++
|
||||
value = value * 10
|
||||
}
|
||||
return Math.ceil(value + 1) / Math.pow(10, pow)
|
||||
return Math.floor(value + 1) / Math.pow(10, pow)
|
||||
}
|
||||
if (type === 'Time') {
|
||||
return value
|
||||
|
||||
@@ -203,9 +203,9 @@ export const cancelWithChange = {
|
||||
if (!binding.value || !binding.value.obj) return
|
||||
const unsavedChange = localStorage.getItem('nz-unnsaved-change')
|
||||
const oldValue = JSON.parse(JSON.stringify(binding.value.obj))
|
||||
el.__newValue__ = oldValue
|
||||
function domClick (e) {
|
||||
const newValue = JSON.parse(JSON.stringify(binding.value.obj))
|
||||
if (unsavedChange == 'on' && !isEqual(oldValue, newValue)) {
|
||||
if (unsavedChange == 'on' && !isEqual(oldValue, el.__newValue__)) {
|
||||
MessageBox.confirm(i18n.t('tip.confirmCancel'), {
|
||||
confirmButtonText: i18n.t('tip.yes'),
|
||||
cancelButtonText: i18n.t('tip.no'),
|
||||
@@ -222,6 +222,9 @@ export const cancelWithChange = {
|
||||
el.__vueDomClick__ = domClick
|
||||
el.addEventListener('click', domClick)
|
||||
},
|
||||
update (el, binding, vnode) {
|
||||
el.__newValue__ = binding.value.obj
|
||||
},
|
||||
unbind: function (el, binding) {
|
||||
// 解除事件监听
|
||||
document.removeEventListener('click', el.__vueDomClick__)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<el-tab-pane :label="$t('project.topology.data')" name="1">
|
||||
<el-form v-model="selection.pen.data" class="pens-data" label-position="top">
|
||||
<!--module-->
|
||||
<el-form-item v-if="!selection.pen.type&&!fromDiagram" class="sub-box half-form-item" label="Module"
|
||||
<el-form-item v-if="!selection.pen.type&&!fromDiagram" class="sub-box half-form-item" :label="$t('overall.module')"
|
||||
prop="moduleId">
|
||||
<el-select v-model="selection.pen.data.moduleId" :placeholder="$t('el.select.placeholder')"
|
||||
:popper-append-to-body="true" popper-class="asset-dropdown right-box-select-top" size="small"
|
||||
@@ -274,7 +274,7 @@
|
||||
<!--</div>-->
|
||||
<!--</el-collapse-item>-->
|
||||
<!--样式-->
|
||||
<el-collapse-item :title="'Style'" name="4" v-if="selection.pen">
|
||||
<el-collapse-item :title="$t('project.topology.style')" name="4" v-if="selection.pen">
|
||||
<div class="flex flex-warp">
|
||||
|
||||
<div class="props-pen-item" v-if="selection.pen&&!selection.pen.type">
|
||||
@@ -650,7 +650,7 @@
|
||||
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="'Font'" name="5" v-if="selection.pen&&!selection.pen.type">
|
||||
<el-collapse-item :title="$t('project.topology.font')" name="5" v-if="selection.pen&&!selection.pen.type">
|
||||
<div class="flex flex-warp">
|
||||
<div class="props-pen-item" style="width: 100%">
|
||||
<div>{{ $t('project.topology.textContent') }}</div>
|
||||
|
||||
@@ -234,14 +234,18 @@ export default {
|
||||
params.x = 0
|
||||
params.y = 0
|
||||
}
|
||||
if (!params.x && !params.y && params.groupId) { // group 内的坐标需要单独计算
|
||||
if (isNaN(params.y) && isNaN(params.y) && params.groupId) { // group 内的坐标需要单独计算
|
||||
params.x = 0
|
||||
params.y = 999
|
||||
}
|
||||
if (!params.x && !params.y) {
|
||||
if (isNaN(params.y) && isNaN(params.y)) {
|
||||
params.x = this.chartLastPosition.x + params.span > 12 ? 0 : this.chartLastPosition.x
|
||||
params.y = this.chartLastPosition.y + 12
|
||||
}
|
||||
if (params.x + params.span > 12) {
|
||||
params.x = 0
|
||||
params.y += 1
|
||||
}
|
||||
delete params.panel
|
||||
if (params.type === 'table') {
|
||||
delete params.param.tags
|
||||
|
||||
@@ -104,7 +104,7 @@ Vue.mixin({
|
||||
},
|
||||
utcTimeToTimezoneStr: function (time) {
|
||||
if (time) {
|
||||
return bus.timeFormate(bus.UTCTimeToConfigTimezone(time), localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD HH:mm:ss')
|
||||
return bus.timeFormate(time, localStorage.getItem('nz-default-dateFormat') || 'YYYY-MM-DD HH:mm:ss')
|
||||
} else {
|
||||
return '-'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user