NEZ-1029 : topology bug修改
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
<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="Module"
|
||||||
prop="moduleId">
|
prop="moduleId">
|
||||||
<el-select v-model="selection.pen.data.moduleId" :placeholder="$t('el.select.placeholder')"
|
<el-select v-model="selection.pen.data.moduleId" :placeholder="$t('el.select.placeholder')"
|
||||||
:popper-append-to-body="false" popper-class="asset-dropdown" size="small"
|
:popper-append-to-body="true" popper-class="asset-dropdown" size="small"
|
||||||
@change="moduleIdChange">
|
@change="moduleIdChange">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in modules"
|
v-for="item in modules"
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col style="width: calc(100% - 120px)">
|
<el-col style="width: calc(100% - 120px)">
|
||||||
<el-select v-model="selection.pen.data.aggregation" :placeholder="$t('el.select.placeholder')"
|
<el-select v-model="selection.pen.data.aggregation" :placeholder="$t('el.select.placeholder')"
|
||||||
:popper-append-to-body="false" class="right-box-row-with-btn"
|
:popper-append-to-body="true" class="right-box-row-with-btn"
|
||||||
popper-class="chart-box-dropdown-small"
|
popper-class="chart-box-dropdown-small"
|
||||||
size="mini"
|
size="mini"
|
||||||
style="width: 100%" value-key="chartType">
|
style="width: 100%" value-key="chartType">
|
||||||
@@ -144,7 +144,7 @@
|
|||||||
<!--线-->
|
<!--线-->
|
||||||
<el-select v-if="selection.pen&&selection.pen.type&&item.level!==0"
|
<el-select v-if="selection.pen&&selection.pen.type&&item.level!==0"
|
||||||
v-model="item.animateType"
|
v-model="item.animateType"
|
||||||
:popper-append-to-body="false"
|
:popper-append-to-body="true"
|
||||||
size="small">
|
size="small">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item,index) in lineAnimateOptions"
|
v-for="(item,index) in lineAnimateOptions"
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
<!--点-->
|
<!--点-->
|
||||||
<el-select v-if="selection.pen&&!selection.pen.type&&item.level!==0"
|
<el-select v-if="selection.pen&&!selection.pen.type&&item.level!==0"
|
||||||
v-model="item.animateType"
|
v-model="item.animateType"
|
||||||
:popper-append-to-body="false"
|
:popper-append-to-body="true"
|
||||||
size="small">
|
size="small">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item,index) in nodeAnimateOptions"
|
v-for="(item,index) in nodeAnimateOptions"
|
||||||
@@ -221,7 +221,7 @@
|
|||||||
<el-form-item :label="$t('dashboard.panel.chartForm.type')" class="half-form-item half-form-item--end"
|
<el-form-item :label="$t('dashboard.panel.chartForm.type')" class="half-form-item half-form-item--end"
|
||||||
prop="type">
|
prop="type">
|
||||||
<el-select v-model="selection.pen.data.type" :placeholder="$t('el.select.placeholder')"
|
<el-select v-model="selection.pen.data.type" :placeholder="$t('el.select.placeholder')"
|
||||||
:popper-append-to-body="false" class="right-box-row-with-btn"
|
:popper-append-to-body="true" class="right-box-row-with-btn"
|
||||||
popper-class="chart-box-dropdown-small"
|
popper-class="chart-box-dropdown-small"
|
||||||
size="mini" value-key="chartType">
|
size="mini" value-key="chartType">
|
||||||
<el-option v-for="item in chartTypeList" :key="item.id" :label="item.name" :value="item.id">
|
<el-option v-for="item in chartTypeList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
@@ -438,7 +438,7 @@
|
|||||||
<div class="props-pen-item" v-if="selection.pen&&!selection.pen.type">
|
<div class="props-pen-item" v-if="selection.pen&&!selection.pen.type">
|
||||||
<div>{{ $t('project.topology.gradient') }}</div>
|
<div>{{ $t('project.topology.gradient') }}</div>
|
||||||
<div class="p10 pl0 gradient-to">
|
<div class="p10 pl0 gradient-to">
|
||||||
<el-select :popper-append-to-body="false" v-model="selection.pen.gradientType" size="small"
|
<el-select :popper-append-to-body="true" v-model="selection.pen.gradientType" size="small"
|
||||||
class="color-before-select" popper-class="color-before-select"
|
class="color-before-select" popper-class="color-before-select"
|
||||||
style="width: 60px;border-radius: 4px 0 0 4px;background: #F5F7FA" @change="bkTypeChange">
|
style="width: 60px;border-radius: 4px 0 0 4px;background: #F5F7FA" @change="bkTypeChange">
|
||||||
<div slot="prefix">
|
<div slot="prefix">
|
||||||
@@ -481,7 +481,7 @@
|
|||||||
<div class="props-pen-item special-select">
|
<div class="props-pen-item special-select">
|
||||||
<div>{{ $t('project.topology.lineDash') }}</div>
|
<div>{{ $t('project.topology.lineDash') }}</div>
|
||||||
<div class="p10 pl0">
|
<div class="p10 pl0">
|
||||||
<el-select :popper-append-to-body="false" v-model="selection.pen.dash" size="small"
|
<el-select :popper-append-to-body="true" v-model="selection.pen.dash" size="small"
|
||||||
@change="onChange">
|
@change="onChange">
|
||||||
<div slot="prefix">
|
<div slot="prefix">
|
||||||
<div class="icon-item">
|
<div class="icon-item">
|
||||||
@@ -511,7 +511,7 @@
|
|||||||
<div class="props-pen-item special-select" v-if="selection.pen&&selection.pen.type">
|
<div class="props-pen-item special-select" v-if="selection.pen&&selection.pen.type">
|
||||||
<div>{{ $t('project.topology.lineType') }}</div>
|
<div>{{ $t('project.topology.lineType') }}</div>
|
||||||
<div class="p10 pl0">
|
<div class="p10 pl0">
|
||||||
<el-select :popper-append-to-body="false" v-model="selection.pen.name" size="small"
|
<el-select :popper-append-to-body="true" v-model="selection.pen.name" size="small"
|
||||||
@change="onClickName">
|
@change="onClickName">
|
||||||
<div slot="prefix">
|
<div slot="prefix">
|
||||||
<div class="icon-item">
|
<div class="icon-item">
|
||||||
@@ -541,7 +541,7 @@
|
|||||||
<div class="props-pen-item special-select" v-if="selection.pen&&selection.pen.type">
|
<div class="props-pen-item special-select" v-if="selection.pen&&selection.pen.type">
|
||||||
<div>{{ $t('project.topology.fromArrow') }}</div>
|
<div>{{ $t('project.topology.fromArrow') }}</div>
|
||||||
<div class="p10 pl0">
|
<div class="p10 pl0">
|
||||||
<el-select :popper-append-to-body="false" v-model="selection.pen.fromArrow" size="small"
|
<el-select :popper-append-to-body="true" v-model="selection.pen.fromArrow" size="small"
|
||||||
@change="onClickFromArrow">
|
@change="onClickFromArrow">
|
||||||
<div slot="prefix">
|
<div slot="prefix">
|
||||||
<div class="icon-item">
|
<div class="icon-item">
|
||||||
@@ -590,7 +590,7 @@
|
|||||||
<div class="props-pen-item special-select" v-if="selection.pen&&selection.pen.type">
|
<div class="props-pen-item special-select" v-if="selection.pen&&selection.pen.type">
|
||||||
<div>{{ $t('project.topology.toArrow') }}</div>
|
<div>{{ $t('project.topology.toArrow') }}</div>
|
||||||
<div class="p10 pl0">
|
<div class="p10 pl0">
|
||||||
<el-select :popper-append-to-body="false" v-model="selection.pen.toArrow" size="small"
|
<el-select :popper-append-to-body="true" v-model="selection.pen.toArrow" size="small"
|
||||||
@change="onClickToArrow">
|
@change="onClickToArrow">
|
||||||
<div slot="prefix">
|
<div slot="prefix">
|
||||||
<div class="icon-item">
|
<div class="icon-item">
|
||||||
@@ -1109,22 +1109,22 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {alignNodes, spaceBetween, layout} from '@topology/layout'
|
import { alignNodes, spaceBetween, layout } from '@topology/layout'
|
||||||
import {getTopology, resetZIndex} from '../../js/common'
|
import { getTopology, resetZIndex } from '../../js/common'
|
||||||
import chartDataFormat from '../../../charts/chartDataFormat'
|
import chartDataFormat from '../../../charts/chartDataFormat'
|
||||||
import promqlInput from '../../../page/dashboard/explore/promqlInput'
|
import promqlInput from '../../../page/dashboard/explore/promqlInput'
|
||||||
import nezhaColor from '../../nezhaColor'
|
import nezhaColor from '../../nezhaColor'
|
||||||
|
|
||||||
const rz = {
|
const rz = {
|
||||||
methods: {
|
methods: {
|
||||||
rz(e) {
|
rz (e) {
|
||||||
resetZIndex(e)
|
resetZIndex(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
// pen.type 0为node 1位line
|
// pen.type 0为node 1位line
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
expressions: [],
|
expressions: [],
|
||||||
chartTypeList: [
|
chartTypeList: [
|
||||||
@@ -1135,7 +1135,7 @@ export default {
|
|||||||
{
|
{
|
||||||
id: 'stackArea',
|
id: 'stackArea',
|
||||||
name: this.$t('dashboard.panel.chartForm.typeVal.stackArea.label')
|
name: this.$t('dashboard.panel.chartForm.typeVal.stackArea.label')
|
||||||
},
|
}
|
||||||
// {
|
// {
|
||||||
// id: 'bar',
|
// id: 'bar',
|
||||||
// name: this.$t('dashboard.panel.chartForm.typeVal.bar.label')
|
// name: this.$t('dashboard.panel.chartForm.typeVal.bar.label')
|
||||||
@@ -1277,19 +1277,19 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
penDash: [
|
penDash: [
|
||||||
{d: 'M5 14 l85 0', 'stroke-dasharray': ''},
|
{ d: 'M5 14 l85 0', 'stroke-dasharray': '' },
|
||||||
{d: 'M5 14 l85 0', 'stroke-dasharray': '5,5'},
|
{ d: 'M5 14 l85 0', 'stroke-dasharray': '5,5' },
|
||||||
{d: 'M5 14 l85 0', 'stroke-dasharray': '10,10'},
|
{ d: 'M5 14 l85 0', 'stroke-dasharray': '10,10' },
|
||||||
{d: 'M5 14 l85 0', 'stroke-dasharray': '10,10,2,10'}
|
{ d: 'M5 14 l85 0', 'stroke-dasharray': '10,10,2,10' }
|
||||||
],
|
],
|
||||||
penLineType: [
|
penLineType: [
|
||||||
{d: 'M5 14 a100,50 0 0,1 85,0', 'stroke-dasharray': '', name: 'curve'},
|
{ d: 'M5 14 a100,50 0 0,1 85,0', 'stroke-dasharray': '', name: 'curve' },
|
||||||
{d: 'M5 8 l40 0 l0 12 l40 0', 'stroke-dasharray': '', name: 'polyline'},
|
{ d: 'M5 8 l40 0 l0 12 l40 0', 'stroke-dasharray': '', name: 'polyline' },
|
||||||
{d: 'M5 14 l85 0', 'stroke-dasharray': '', name: 'line'}
|
{ d: 'M5 14 l85 0', 'stroke-dasharray': '', name: 'line' }
|
||||||
// {d:'M5 20 C0,8 50,0 85,0',"stroke-dasharray":"",name:'mind'},
|
// {d:'M5 20 C0,8 50,0 85,0',"stroke-dasharray":"",name:'mind'},
|
||||||
],
|
],
|
||||||
penLineFromTOArrow: [
|
penLineFromTOArrow: [
|
||||||
{d: 'M5 14 l85 0', points: '', fill: '', stroke: '', 'stroke-width': '', name: ''},
|
{ d: 'M5 14 l85 0', points: '', fill: '', stroke: '', 'stroke-width': '', name: '' },
|
||||||
{
|
{
|
||||||
d: 'M5 14 l85 0',
|
d: 'M5 14 l85 0',
|
||||||
points: '5 14,20 9,20 19',
|
points: '5 14,20 9,20 19',
|
||||||
@@ -1328,11 +1328,11 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
lineAnimateOptions: [
|
lineAnimateOptions: [
|
||||||
{id: 1, name: this.$t('project.topology.flow')},
|
{ id: 1, name: this.$t('project.topology.flow') },
|
||||||
{id: 'beads', name: this.$t('project.topology.beads')},
|
{ id: 'beads', name: this.$t('project.topology.beads') },
|
||||||
{id: 'dot', name: this.$t('project.topology.dot')},
|
{ id: 'dot', name: this.$t('project.topology.dot') },
|
||||||
{id: 'comet', name: this.$t('project.topology.comet')},
|
{ id: 'comet', name: this.$t('project.topology.comet') },
|
||||||
{id: 'custom', name: this.$t('project.topology.none')}
|
{ id: 'custom', name: this.$t('project.topology.none') }
|
||||||
],
|
],
|
||||||
nodeAnimateOptions: [
|
nodeAnimateOptions: [
|
||||||
{
|
{
|
||||||
@@ -1440,7 +1440,7 @@ export default {
|
|||||||
// immediate:false,
|
// immediate:false,
|
||||||
// },
|
// },
|
||||||
selection: {
|
selection: {
|
||||||
handler() {
|
handler () {
|
||||||
// this.loading = false
|
// this.loading = false
|
||||||
if (this.selection.pen && this.selection.pen.data && (!this.selection.pen.data.expressAllArr || this.selection.pen.data.expressAllArr.length === 0)) {
|
if (this.selection.pen && this.selection.pen.data && (!this.selection.pen.data.expressAllArr || this.selection.pen.data.expressAllArr.length === 0)) {
|
||||||
this.selection.pen.data.expressAllArr = ['']
|
this.selection.pen.data.expressAllArr = ['']
|
||||||
@@ -1451,7 +1451,7 @@ export default {
|
|||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
fromDiagram: {
|
fromDiagram: {
|
||||||
handler() {
|
handler () {
|
||||||
if (this.selection.pen && this.selection.pen.data) {
|
if (this.selection.pen && this.selection.pen.data) {
|
||||||
// eslint-disable-next-line vue/no-mutating-props
|
// eslint-disable-next-line vue/no-mutating-props
|
||||||
this.selection.pen.data.iconToolState = false
|
this.selection.pen.data.iconToolState = false
|
||||||
@@ -1461,14 +1461,14 @@ export default {
|
|||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
imgArr: {
|
imgArr: {
|
||||||
handler() {
|
handler () {
|
||||||
// this.loading = false
|
// this.loading = false
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created () {
|
||||||
const dataOption = this.index == -2 ? getTopology(-1).data : getTopology(this.index).data
|
const dataOption = this.index == -2 ? getTopology(-1).data : getTopology(this.index).data
|
||||||
if (!dataOption.data) {
|
if (!dataOption.data) {
|
||||||
dataOption.data = {}
|
dataOption.data = {}
|
||||||
@@ -1481,14 +1481,14 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted () {
|
||||||
// this.queryMetrics()
|
// this.queryMetrics()
|
||||||
// this.topologyData.data.grid= !!dataOption.grid;
|
// this.topologyData.data.grid= !!dataOption.grid;
|
||||||
// this.topologyData.data.rule= !!dataOption.rule;
|
// this.topologyData.data.rule= !!dataOption.rule;
|
||||||
// this.topologyData.data.projectInfo= !!dataOption.projectInfo;
|
// this.topologyData.data.projectInfo= !!dataOption.projectInfo;
|
||||||
// this.topologyData.data.alertInfo= !!dataOption.alertInfo;
|
// this.topologyData.data.alertInfo= !!dataOption.alertInfo;
|
||||||
},
|
},
|
||||||
updated(n, o) {
|
updated (n, o) {
|
||||||
if (!this.selection.pen) { // 没选中node line返回
|
if (!this.selection.pen) { // 没选中node line返回
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1506,7 +1506,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
queryMetrics() {
|
queryMetrics () {
|
||||||
this.metricOptions = []
|
this.metricOptions = []
|
||||||
this.$get('prom/api/v1/label/__name__/values').then(response => {
|
this.$get('prom/api/v1/label/__name__/values').then(response => {
|
||||||
if (response.status == 'success') {
|
if (response.status == 'success') {
|
||||||
@@ -1523,9 +1523,9 @@ export default {
|
|||||||
}
|
}
|
||||||
if (metricMap.get(key)) {
|
if (metricMap.get(key)) {
|
||||||
const values = metricMap.get(key)
|
const values = metricMap.get(key)
|
||||||
values.push({label: item, value: item})
|
values.push({ label: item, value: item })
|
||||||
} else {
|
} else {
|
||||||
const values = [{label: item, value: item}]
|
const values = [{ label: item, value: item }]
|
||||||
metricMap.set(key, values)
|
metricMap.set(key, values)
|
||||||
}
|
}
|
||||||
// this.metricStore.push({label:item,value:item,insertText:item})
|
// this.metricStore.push({label:item,value:item,insertText:item})
|
||||||
@@ -1543,9 +1543,9 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
tabClick(n) {
|
tabClick (n) {
|
||||||
},
|
},
|
||||||
moduleIdChange(n) {
|
moduleIdChange (n) {
|
||||||
this.selection.pen.data.moduleName = this.modules.find(item => item.id === n).name
|
this.selection.pen.data.moduleName = this.modules.find(item => item.id === n).name
|
||||||
if (!this.selection.pen.data.title) {
|
if (!this.selection.pen.data.title) {
|
||||||
this.selection.pen.data.title = this.selection.pen.data.moduleName
|
this.selection.pen.data.title = this.selection.pen.data.moduleName
|
||||||
@@ -1554,7 +1554,7 @@ export default {
|
|||||||
this.$emit('notModuleIDArrChange', this.selection.pen.id)
|
this.$emit('notModuleIDArrChange', this.selection.pen.id)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeTitle(val) {
|
changeTitle (val) {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
this.selection.pen.text = this.selection.pen.data.moduleName || ''
|
this.selection.pen.text = this.selection.pen.data.moduleName || ''
|
||||||
this.selection.pen.data.title = this.selection.pen.data.moduleName || ''
|
this.selection.pen.data.title = this.selection.pen.data.moduleName || ''
|
||||||
@@ -1563,7 +1563,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.onChange()
|
this.onChange()
|
||||||
},
|
},
|
||||||
onChange(value) {
|
onChange (value) {
|
||||||
if (value === 'lineWidth') {
|
if (value === 'lineWidth') {
|
||||||
this.selection.pen.lineWidth = this.selection.pen.data.lineWidth
|
this.selection.pen.lineWidth = this.selection.pen.data.lineWidth
|
||||||
}
|
}
|
||||||
@@ -1574,27 +1574,27 @@ export default {
|
|||||||
// this.$emit('change');
|
// this.$emit('change');
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
changeExpand() {
|
changeExpand () {
|
||||||
this.selection.expand = !this.selection.expand
|
this.selection.expand = !this.selection.expand
|
||||||
},
|
},
|
||||||
isJson(obj) {
|
isJson (obj) {
|
||||||
return typeof (obj) === 'object' && Object.prototype.toString.call(obj).toLowerCase() == '[object object]' && !obj.length
|
return typeof (obj) === 'object' && Object.prototype.toString.call(obj).toLowerCase() == '[object object]' && !obj.length
|
||||||
},
|
},
|
||||||
|
|
||||||
// 组件事件
|
// 组件事件
|
||||||
onNodesAlign(align) { // 对齐node
|
onNodesAlign (align) { // 对齐node
|
||||||
alignNodes(getTopology(this.index).activeLayer.pens, getTopology(this.index).activeLayer.rect, align)
|
alignNodes(getTopology(this.index).activeLayer.pens, getTopology(this.index).activeLayer.rect, align)
|
||||||
getTopology(this.index).updateProps()
|
getTopology(this.index).updateProps()
|
||||||
},
|
},
|
||||||
onSpaceBetween() {
|
onSpaceBetween () {
|
||||||
spaceBetween(getTopology(this.index).activeLayer.pens, getTopology(this.index).activeLayer.rect.width)
|
spaceBetween(getTopology(this.index).activeLayer.pens, getTopology(this.index).activeLayer.rect.width)
|
||||||
getTopology(this.index).updateProps()
|
getTopology(this.index).updateProps()
|
||||||
},
|
},
|
||||||
onLayout() { // 改变布局
|
onLayout () { // 改变布局
|
||||||
layout(getTopology(this.index).activeLayer.pens, this.layout)
|
layout(getTopology(this.index).activeLayer.pens, this.layout)
|
||||||
getTopology(this.index).updateProps()
|
getTopology(this.index).updateProps()
|
||||||
},
|
},
|
||||||
onClickDash(number) { // 改变线型
|
onClickDash (number) { // 改变线型
|
||||||
this.pen.dash = number
|
this.pen.dash = number
|
||||||
this.drowdown = 0
|
this.drowdown = 0
|
||||||
if (this.selection.pen) {
|
if (this.selection.pen) {
|
||||||
@@ -1603,7 +1603,7 @@ export default {
|
|||||||
|
|
||||||
this.onChange()
|
this.onChange()
|
||||||
},
|
},
|
||||||
onClickName(name) {
|
onClickName (name) {
|
||||||
this.pen.name = name
|
this.pen.name = name
|
||||||
// this.pen.calcControlPoints()
|
// this.pen.calcControlPoints()
|
||||||
this.drowdown = 0
|
this.drowdown = 0
|
||||||
@@ -1612,7 +1612,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.onChange()
|
this.onChange()
|
||||||
},
|
},
|
||||||
bkTypeChange(val) {
|
bkTypeChange (val) {
|
||||||
this.selection.pen.data.gradientType = val
|
this.selection.pen.data.gradientType = val
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
if (val === 0) {
|
if (val === 0) {
|
||||||
@@ -1638,17 +1638,17 @@ export default {
|
|||||||
}
|
}
|
||||||
this.onChange()
|
this.onChange()
|
||||||
},
|
},
|
||||||
colorPickerClick(ref) {
|
colorPickerClick (ref) {
|
||||||
this.$refs[ref].showPicker = true
|
this.$refs[ref].showPicker = true
|
||||||
},
|
},
|
||||||
colorPickerClickTable(ref, row) {
|
colorPickerClickTable (ref, row) {
|
||||||
row.showColor = row.color.fill
|
row.showColor = row.color.fill
|
||||||
row.showType = 'fill'
|
row.showType = 'fill'
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs[ref][0].showPicker = true
|
this.$refs[ref][0].showPicker = true
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
colorChange(val, name) { // 改变颜色
|
colorChange (val, name) { // 改变颜色
|
||||||
const bktype = this.selection.pen.data.gradientType
|
const bktype = this.selection.pen.data.gradientType
|
||||||
if (name === 'toArrowColor') {
|
if (name === 'toArrowColor') {
|
||||||
this.selection.pen.fromArrowColor = this.colorRGBtoHex(val)
|
this.selection.pen.fromArrowColor = this.colorRGBtoHex(val)
|
||||||
@@ -1687,15 +1687,15 @@ export default {
|
|||||||
this.selection.pen.data[name] = this.colorRGBtoHex(val)
|
this.selection.pen.data[name] = this.colorRGBtoHex(val)
|
||||||
this.onChange()
|
this.onChange()
|
||||||
},
|
},
|
||||||
colorChangeTable(item, val, key) { // 改变颜色
|
colorChangeTable (item, val, key) { // 改变颜色
|
||||||
item.color[key] = this.colorRGBtoHex(val)
|
item.color[key] = this.colorRGBtoHex(val)
|
||||||
},
|
},
|
||||||
changeShowPicker(item, type) {
|
changeShowPicker (item, type) {
|
||||||
this.$refs['colorPickerBac' + item.level][0].showPicker = true
|
this.$refs['colorPickerBac' + item.level][0].showPicker = true
|
||||||
item.showType = type
|
item.showType = type
|
||||||
item.showColor = item.color[type]
|
item.showColor = item.color[type]
|
||||||
},
|
},
|
||||||
colorOut(obj, e) {
|
colorOut (obj, e) {
|
||||||
let flag = false
|
let flag = false
|
||||||
e.path.forEach((item) => {
|
e.path.forEach((item) => {
|
||||||
if (item.className === 'el-color-dropdown el-color-picker__panel' || item.className === 'color-tab') {
|
if (item.className === 'el-color-dropdown el-color-picker__panel' || item.className === 'color-tab') {
|
||||||
@@ -1708,7 +1708,7 @@ export default {
|
|||||||
obj.showType = ''
|
obj.showType = ''
|
||||||
obj.showColor = undefined
|
obj.showColor = undefined
|
||||||
},
|
},
|
||||||
changeTopologyOpt(val, key, isColor) {
|
changeTopologyOpt (val, key, isColor) {
|
||||||
//
|
//
|
||||||
// getTopology(this.index).data[key]=val;
|
// getTopology(this.index).data[key]=val;
|
||||||
// getTopology(this.index).render();
|
// getTopology(this.index).render();
|
||||||
@@ -1727,7 +1727,7 @@ export default {
|
|||||||
getTopology(this.index).render()
|
getTopology(this.index).render()
|
||||||
this.$emit('changeProjectTitle')
|
this.$emit('changeProjectTitle')
|
||||||
},
|
},
|
||||||
colorRGBtoHex(color) { // 获取颜色16进制数
|
colorRGBtoHex (color) { // 获取颜色16进制数
|
||||||
if (!color) {
|
if (!color) {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
@@ -1742,17 +1742,17 @@ export default {
|
|||||||
const hex = '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)
|
const hex = '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)
|
||||||
return hex
|
return hex
|
||||||
},
|
},
|
||||||
onClickToArrow(arrow) {
|
onClickToArrow (arrow) {
|
||||||
this.selection.pen.toArrow = arrow
|
this.selection.pen.toArrow = arrow
|
||||||
this.drowdown = 0
|
this.drowdown = 0
|
||||||
this.onChange()
|
this.onChange()
|
||||||
},
|
},
|
||||||
onClickFromArrow(arrow) {
|
onClickFromArrow (arrow) {
|
||||||
this.selection.pen.fromArrow = arrow
|
this.selection.pen.fromArrow = arrow
|
||||||
this.drowdown = 0
|
this.drowdown = 0
|
||||||
this.onChange()
|
this.onChange()
|
||||||
},
|
},
|
||||||
changeAnimatePlay(val, type) {
|
changeAnimatePlay (val, type) {
|
||||||
if (type === 'node') {
|
if (type === 'node') {
|
||||||
if (val === 'custom') {
|
if (val === 'custom') {
|
||||||
this.selection.pen.data.animatePlay = false
|
this.selection.pen.data.animatePlay = false
|
||||||
@@ -1768,27 +1768,27 @@ export default {
|
|||||||
}
|
}
|
||||||
this.onChange()
|
this.onChange()
|
||||||
},
|
},
|
||||||
onAnimate(val) {
|
onAnimate (val) {
|
||||||
// this.selection.pen.animateStart=this.selection.pen.animateStart?Date.now():0;
|
// this.selection.pen.animateStart=this.selection.pen.animateStart?Date.now():0;
|
||||||
// this.selection.pen.data.animatePlay=this.selection.pen.animatePlay;
|
// this.selection.pen.data.animatePlay=this.selection.pen.animatePlay;
|
||||||
this.onChange()
|
this.onChange()
|
||||||
// this.$emit('animate');
|
// this.$emit('animate');
|
||||||
},
|
},
|
||||||
delTopologyPen() {
|
delTopologyPen () {
|
||||||
const delObj = this.selection.pen ? this.selection.pen.id : this.selection.pens
|
const delObj = this.selection.pen ? this.selection.pen.id : this.selection.pens
|
||||||
this.$emit('del', delObj)
|
this.$emit('del', delObj)
|
||||||
},
|
},
|
||||||
getMetricOptions() {
|
getMetricOptions () {
|
||||||
return this.metricOptions
|
return this.metricOptions
|
||||||
},
|
},
|
||||||
addExpression() {
|
addExpression () {
|
||||||
this.selection.pen.data.expressAllArr.push('')
|
this.selection.pen.data.expressAllArr.push('')
|
||||||
this.selection.pen.data.legendsAll.push('')
|
this.selection.pen.data.legendsAll.push('')
|
||||||
},
|
},
|
||||||
expressionChange(item) {
|
expressionChange (item) {
|
||||||
|
|
||||||
},
|
},
|
||||||
removeExpression(index) {
|
removeExpression (index) {
|
||||||
if (this.selection.pen.data.expressAllArr.length > 1) {
|
if (this.selection.pen.data.expressAllArr.length > 1) {
|
||||||
this.selection.pen.data.expressAllArr.splice(index, 1)
|
this.selection.pen.data.expressAllArr.splice(index, 1)
|
||||||
this.selection.pen.data.legendsAll.splice(index, 1)
|
this.selection.pen.data.legendsAll.splice(index, 1)
|
||||||
@@ -1801,7 +1801,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
copyExpression(index) {
|
copyExpression (index) {
|
||||||
this.selection.pen.data.expressAllArr.push(this.selection.pen.data.expressAllArr[index])
|
this.selection.pen.data.expressAllArr.push(this.selection.pen.data.expressAllArr[index])
|
||||||
this.selection.pen.data.legendsAll.push(this.selection.pen.data.legendsAll[index])
|
this.selection.pen.data.legendsAll.push(this.selection.pen.data.legendsAll[index])
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
@@ -1812,7 +1812,7 @@ export default {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
valueMappingAdd() {
|
valueMappingAdd () {
|
||||||
if (this.selection.pen.data.valueMappingSort === 'desc') {
|
if (this.selection.pen.data.valueMappingSort === 'desc') {
|
||||||
this.selection.pen.data.valueMapping.push({
|
this.selection.pen.data.valueMapping.push({
|
||||||
color: {
|
color: {
|
||||||
@@ -1847,10 +1847,10 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
valueMappingValueChange(index, row) {
|
valueMappingValueChange (index, row) {
|
||||||
|
|
||||||
},
|
},
|
||||||
changeValueMappingSort() {
|
changeValueMappingSort () {
|
||||||
if (this.selection.pen.data.valueMappingSort === 'desc') {
|
if (this.selection.pen.data.valueMappingSort === 'desc') {
|
||||||
this.selection.pen.data.valueMappingSort = 'asc'
|
this.selection.pen.data.valueMappingSort = 'asc'
|
||||||
const arr = JSON.parse(JSON.stringify(this.selection.pen.data.valueMapping))
|
const arr = JSON.parse(JSON.stringify(this.selection.pen.data.valueMapping))
|
||||||
@@ -1867,17 +1867,17 @@ export default {
|
|||||||
this.selection.pen.data.valueMapping = arr
|
this.selection.pen.data.valueMapping = arr
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
valueMappingDel(index, row) {
|
valueMappingDel (index, row) {
|
||||||
this.selection.pen.data.valueMapping.splice(index, 1)
|
this.selection.pen.data.valueMapping.splice(index, 1)
|
||||||
this.selection.pen.data.valueMapping.forEach((item, index) => {
|
this.selection.pen.data.valueMapping.forEach((item, index) => {
|
||||||
item.level = index
|
item.level = index
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
inputFocus(e) {
|
inputFocus (e) {
|
||||||
e.path[2].children[0].setAttribute('tabindex', '0')
|
e.path[2].children[0].setAttribute('tabindex', '0')
|
||||||
e.path[2].children[1].setAttribute('tabindex', '1')
|
e.path[2].children[1].setAttribute('tabindex', '1')
|
||||||
},
|
},
|
||||||
inputBlur(e) {
|
inputBlur (e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2471,6 +2471,7 @@ export default {
|
|||||||
|
|
||||||
/deep/ .metric-selector-title {
|
/deep/ .metric-selector-title {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
width: 98px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .query-row .input-box {
|
/deep/ .query-row .input-box {
|
||||||
@@ -2495,4 +2496,10 @@ export default {
|
|||||||
/deep/ .metric-selector-title {
|
/deep/ .metric-selector-title {
|
||||||
background: #fff !important;
|
background: #fff !important;
|
||||||
}
|
}
|
||||||
|
/deep/ .el-collapse-item__arrow.el-icon-arrow-right{
|
||||||
|
display: inline-block !important;
|
||||||
|
}
|
||||||
|
/deep/ .el-select--mini {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<el-collapse-item :title="item.group" :name="item.group">
|
<el-collapse-item :title="item.group" :name="item.group">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<div style="display: flex;width: 100%;">
|
<div style="display: flex;width: 100%;">
|
||||||
<i class="nz-icon nz-icon-caret-right"></i> <div style="flex: 1">{{item.group}}</div> <i class="nz-icon nz-icon-delete title-delete" @click="tooltipDeleteTitle(item)"></i>
|
<i class="nz-icon nz-icon-arrow-right"></i> <div style="flex: 1">{{item.group}}</div> <i class="nz-icon nz-icon-delete title-delete" @click="tooltipDeleteTitle(item)"></i>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<div v-for="(btn, i) in item.children" :key="'info2'+'-'+index+'-'+i" class="buttons">
|
<div v-for="(btn, i) in item.children" :key="'info2'+'-'+index+'-'+i" class="buttons">
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="(!editTopologyFlag&&!fromOverView) && !isPreview" class="top-tools" style="padding-left: 10px">
|
<div v-if="(!editTopologyFlag&&!fromOverView) && !isPreview" class="top-tools" style="padding-left: 10px">
|
||||||
<div>{{topologyInfo.name}}</div>
|
<div>{{obj.name}}</div>
|
||||||
<div v-if="!editTopologyFlag&&!fromPrev&&!fromOverView" class="top-tool-right">
|
<div v-if="!editTopologyFlag&&!fromPrev&&!fromOverView" class="top-tool-right">
|
||||||
<pick-time
|
<pick-time
|
||||||
v-show="!editTopologyFlag"
|
v-show="!editTopologyFlag"
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
:class="{'nz-icon':true, 'nz-icon-shuidi':true,'model-error':item.data.state&&item.data.state.error&&!item.data.show,'model-error-active':item.data.state&&item.data.state.error&&item.data.show}"
|
:class="{'nz-icon':true, 'nz-icon-shuidi':true,'model-error':item.data.state&&item.data.state.error&&!item.data.show,'model-error-active':item.data.state&&item.data.state.error&&item.data.show}"
|
||||||
@click="showNodeTools(index,item)"
|
@click="showNodeTools(index,item)"
|
||||||
>
|
>
|
||||||
<i class="nz-icon nz-icon-model"></i>
|
<i style="cursor: pointer" class="nz-icon nz-icon-model"></i>
|
||||||
</i>
|
</i>
|
||||||
<!--'selpop':selpopIs(item),'no-selPop':!selpopIs(item),'error-model-stat':modelPopError(item) @click="popClick(item.id)" -->
|
<!--'selpop':selpopIs(item),'no-selPop':!selpopIs(item),'error-model-stat':modelPopError(item) @click="popClick(item.id)" -->
|
||||||
<div v-for="(item1, index) in popData" :key="index">
|
<div v-for="(item1, index) in popData" :key="index">
|
||||||
@@ -816,6 +816,7 @@ export default {
|
|||||||
data.pens.forEach(item => {
|
data.pens.forEach(item => {
|
||||||
if (item.type === 0 && item.data.imageId) {
|
if (item.type === 0 && item.data.imageId) {
|
||||||
const img = this.iconArray.find(item1 => item1.id == item.data.imageId)
|
const img = this.iconArray.find(item1 => item1.id == item.data.imageId)
|
||||||
|
console.log(img)
|
||||||
item.image = img ? img.image : imgDefault
|
item.image = img ? img.image : imgDefault
|
||||||
}
|
}
|
||||||
if (item.type === 0) {
|
if (item.type === 0) {
|
||||||
@@ -849,16 +850,27 @@ export default {
|
|||||||
Promise.all(promiseArr).then(res => {
|
Promise.all(promiseArr).then(res => {
|
||||||
res.forEach((response, index) => {
|
res.forEach((response, index) => {
|
||||||
const item = data.pens[index]
|
const item = data.pens[index]
|
||||||
if (item.type === 0) {
|
if (item.type === 0 && item.data.state) {
|
||||||
item.data.state.error = item.data.error = !res[index].data.list[0].state
|
item.data.state.error = item.data.error = !res[index].data.list[0].state
|
||||||
item.data.state.asset = !!res[index].data.list[0].asset
|
item.data.state.asset = !!res[index].data.list[0].asset
|
||||||
item.data.state.alert = !!res[index].data.list[0].alert
|
item.data.state.alert = !!res[index].data.list[0].alert
|
||||||
item.data.state.endpoint = !!res[index].data.list[0].endpoint
|
item.data.state.endpoint = !!res[index].data.list[0].endpoint
|
||||||
|
} else {
|
||||||
|
item.data.state = {
|
||||||
|
error: false,
|
||||||
|
asset: 0,
|
||||||
|
alert: 0,
|
||||||
|
endpoint: 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
self.saveData = { ...data }
|
self.saveData = { ...data }
|
||||||
resolve(data)
|
resolve(data)
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
|
}).catch(res => {
|
||||||
|
self.saveData = { ...data }
|
||||||
|
resolve(data)
|
||||||
|
clearInterval(timer)
|
||||||
})
|
})
|
||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
@@ -1127,7 +1139,7 @@ export default {
|
|||||||
onMessage (event, data, e) {
|
onMessage (event, data, e) {
|
||||||
// console.log('onMessage', event, data)
|
// console.log('onMessage', event, data)
|
||||||
// console.log(getTopology(this.topologyIndex))
|
// console.log(getTopology(this.topologyIndex))
|
||||||
// this.notModuleIDArr=[];
|
this.notModuleIDArr = []
|
||||||
// this.toolShow.attr = false
|
// this.toolShow.attr = false
|
||||||
// this.toolShow.topTool = false
|
// this.toolShow.topTool = false
|
||||||
// this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
@@ -1311,7 +1323,7 @@ export default {
|
|||||||
this.penId = data.id
|
this.penId = data.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$refs.CanvasProps.loading = true
|
this.$refs.CanvasProps && (this.$refs.CanvasProps.loading = true)
|
||||||
break
|
break
|
||||||
case 'line':
|
case 'line':
|
||||||
case 'addLine':
|
case 'addLine':
|
||||||
@@ -1332,7 +1344,7 @@ export default {
|
|||||||
this.penId = data.id
|
this.penId = data.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.$refs.CanvasProps.loading = true
|
this.$refs.CanvasProps && (this.$refs.CanvasProps.loading = true)
|
||||||
break
|
break
|
||||||
case 'multi':
|
case 'multi':
|
||||||
this.props = {
|
this.props = {
|
||||||
@@ -1572,23 +1584,16 @@ export default {
|
|||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||||
this.uploadPicShow = false
|
this.uploadPicShow = false
|
||||||
this.dealImg(`monitor/project/topo/icon/${res.data.id}/1`).then((data, header) => {
|
this.$get('monitor/project/topo/icon', { id: res.data.id }).then(iconInfo => {
|
||||||
const group = this.tools.find(tool => tool.group === this.uploadPic.unit)
|
console.log(iconInfo)
|
||||||
if (group) {
|
this.dealImg(`monitor/project/topo/icon/${res.data.id}/1`).then((data, header) => {
|
||||||
group.children.push({
|
const group = this.tools.find(tool => tool.group === this.uploadPic.unit)
|
||||||
...imageTemp,
|
this.iconArray.push({
|
||||||
data: {
|
...iconInfo.data.list[0],
|
||||||
...imageTemp.data,
|
image: data
|
||||||
text: res.data.imageName,
|
|
||||||
image: data,
|
|
||||||
imageId: res.data.id,
|
|
||||||
unit: this.uploadPic.unit
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
} else {
|
if (group) {
|
||||||
this.tools.push({
|
group.children.push({
|
||||||
group: this.uploadPic.unit,
|
|
||||||
children: [{
|
|
||||||
...imageTemp,
|
...imageTemp,
|
||||||
data: {
|
data: {
|
||||||
...imageTemp.data,
|
...imageTemp.data,
|
||||||
@@ -1597,10 +1602,25 @@ export default {
|
|||||||
imageId: res.data.id,
|
imageId: res.data.id,
|
||||||
unit: this.uploadPic.unit
|
unit: this.uploadPic.unit
|
||||||
}
|
}
|
||||||
}]
|
})
|
||||||
})
|
} else {
|
||||||
}
|
this.tools.push({
|
||||||
|
group: this.uploadPic.unit,
|
||||||
|
children: [{
|
||||||
|
...imageTemp,
|
||||||
|
data: {
|
||||||
|
...imageTemp.data,
|
||||||
|
text: res.data.imageName,
|
||||||
|
image: data,
|
||||||
|
imageId: res.data.id,
|
||||||
|
unit: this.uploadPic.unit
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.msg)
|
this.$message.error(res.msg)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user