Merge branch 'dev-3.6' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.7
This commit is contained in:
@@ -149,5 +149,8 @@
|
|||||||
.nz-icon{
|
.nz-icon{
|
||||||
color: $--color-text-regular;
|
color: $--color-text-regular;
|
||||||
}
|
}
|
||||||
|
.activeLi .nz-icon {
|
||||||
|
color: $--color-primary;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ export function getUUID () {
|
|||||||
return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
|
return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function s8 () {
|
||||||
|
return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1)
|
||||||
|
}
|
||||||
|
|
||||||
export const chartCache = {}
|
export const chartCache = {}
|
||||||
|
|
||||||
export function getChart (key) {
|
export function getChart (key) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<div v-if="showColorPicker" class="vue-color right-box-select-top" :style="{top:position.y+'px',left:position.x+'px'}" ref="colorBox">
|
<div v-if="showColorPicker" class="vue-color right-box-select-top" :style="{top:position.y+'px',left:position.x+'px'}" ref="colorBox">
|
||||||
<el-row v-if="!single" class="color-tab">
|
<el-row v-if="!single" class="color-tab">
|
||||||
<div v-for="item in valueArr" :key="item.key" :class="[keyName==item.name?'color-active':'']" @click="colorTabChange(item)">{{item.name}}</div>
|
<div v-for="item in valueArr" :key="item.key" :class="[keyName==item.name?'color-active':'']" @click.stop="colorTabChange(item)">{{item.name}}</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
<sketch v-model="colors" :disableAlpha="disableAlpha" @input="updateValue" :presetColors="presetColors"/>
|
<sketch v-model="colors" :disableAlpha="disableAlpha" @input="updateValue" :presetColors="presetColors"/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -628,7 +628,7 @@
|
|||||||
<el-row v-if="chartConfig.param.enable.thresholds && isThresholdConfig(chartConfig.type)">
|
<el-row v-if="chartConfig.param.enable.thresholds && isThresholdConfig(chartConfig.type)">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-for="(item,index) in chartConfig.param.thresholds"
|
v-for="(item,index) in chartConfig.param.thresholds"
|
||||||
:key="item.color + '' + index"
|
:key="item.id + '' + index"
|
||||||
class="thresholds-item"
|
class="thresholds-item"
|
||||||
:prop="'param.thresholds.' + index + '.value'"
|
:prop="'param.thresholds.' + index + '.value'"
|
||||||
:rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}"
|
:rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}"
|
||||||
@@ -1083,6 +1083,7 @@ import publicConfig from '@/components/common/rightBox/chart/publicConfig'
|
|||||||
import chartTypeShow from '@/components/common/rightBox/chart/chartTypeShow'
|
import chartTypeShow from '@/components/common/rightBox/chart/chartTypeShow'
|
||||||
import VueTagsInput from '@johmun/vue-tags-input'
|
import VueTagsInput from '@johmun/vue-tags-input'
|
||||||
import draggable from 'vuedraggable'
|
import draggable from 'vuedraggable'
|
||||||
|
import { s8 } from '@/components/common/js/common'
|
||||||
import { randomcolor, ColorReverse } from '@/components/common/js/radomcolor/randomcolor'
|
import { randomcolor, ColorReverse } from '@/components/common/js/radomcolor/randomcolor'
|
||||||
import { isSankey } from '@/components/chart/chart/tools'
|
import { isSankey } from '@/components/chart/chart/tools'
|
||||||
|
|
||||||
@@ -1348,6 +1349,7 @@ export default {
|
|||||||
},
|
},
|
||||||
addThresholds () {
|
addThresholds () {
|
||||||
this.chartConfig.param.thresholds.push({
|
this.chartConfig.param.thresholds.push({
|
||||||
|
id: s8(),
|
||||||
value: undefined,
|
value: undefined,
|
||||||
color: randomcolor()
|
color: randomcolor()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { fromRoute } from '@/components/common/js/constants'
|
import { fromRoute } from '@/components/common/js/constants'
|
||||||
import editRigthBox from '@/components/common/mixin/editRigthBox'
|
import editRigthBox from '@/components/common/mixin/editRigthBox'
|
||||||
import { resetZIndex, getUUID } from '@/components/common/js/common'
|
import { resetZIndex, getUUID, s8 } from '@/components/common/js/common'
|
||||||
import selectPanel from '@/components/common/popBox/selectPanel'
|
import selectPanel from '@/components/common/popBox/selectPanel'
|
||||||
import chartConfig from '@/components/common/rightBox/chart/chartConfig'
|
import chartConfig from '@/components/common/rightBox/chart/chartConfig'
|
||||||
import otherChartConfig from '@/components/common/rightBox/chart/otherChartConfig'
|
import otherChartConfig from '@/components/common/rightBox/chart/otherChartConfig'
|
||||||
@@ -377,7 +377,7 @@ export default {
|
|||||||
valueMapping: false,
|
valueMapping: false,
|
||||||
visibility: false
|
visibility: false
|
||||||
},
|
},
|
||||||
thresholds: [{ value: undefined, color: '#eeeeeeff' }],
|
thresholds: [{ id: s8(), value: undefined, color: '#eeeeeeff' }],
|
||||||
showHeader: this.editChart.param.showHeader,
|
showHeader: this.editChart.param.showHeader,
|
||||||
visibility: {
|
visibility: {
|
||||||
varName: '',
|
varName: '',
|
||||||
@@ -536,6 +536,10 @@ export default {
|
|||||||
}
|
}
|
||||||
if (obj.param && !obj.param.thresholds) {
|
if (obj.param && !obj.param.thresholds) {
|
||||||
obj.param.thresholds = []
|
obj.param.thresholds = []
|
||||||
|
} else if (obj.param && obj.param.thresholds) {
|
||||||
|
obj.param.thresholds.forEach(item => {
|
||||||
|
item.id = s8()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (obj.groupId === -1) {
|
if (obj.groupId === -1) {
|
||||||
obj.groupId = ''
|
obj.groupId = ''
|
||||||
|
|||||||
@@ -398,7 +398,7 @@
|
|||||||
<el-row v-if="chartConfig.param.enable.thresholds && isThresholdConfig(chartConfig.type)">
|
<el-row v-if="chartConfig.param.enable.thresholds && isThresholdConfig(chartConfig.type)">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-for="(item,index) in chartConfig.param.thresholds"
|
v-for="(item,index) in chartConfig.param.thresholds"
|
||||||
:key="item.color + '' + index"
|
:key="item.id + '' + index"
|
||||||
class="thresholds-item"
|
class="thresholds-item"
|
||||||
:prop="'param.thresholds.' + index + '.value'"
|
:prop="'param.thresholds.' + index + '.value'"
|
||||||
:rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}"
|
:rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}"
|
||||||
|
|||||||
@@ -389,7 +389,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.variablesInit = false
|
this.variablesInit = false
|
||||||
this.showPanel = val
|
this.showPanel = val
|
||||||
this.variables = this.$loadsh.get(this, 'showPanel.param.variables', []) || []
|
this.variables = this.$loadsh.cloneDeep(this.$loadsh.get(this, 'showPanel.param.variables', []) || [])
|
||||||
this.showPanel.type = 'dashboard'
|
this.showPanel.type = 'dashboard'
|
||||||
this.filter.panelId = this.showPanel.id
|
this.filter.panelId = this.showPanel.id
|
||||||
this.panelId = this.showPanel.id
|
this.panelId = this.showPanel.id
|
||||||
|
|||||||
Reference in New Issue
Block a user