feat:explore保存图表增加state状态
This commit is contained in:
@@ -311,6 +311,13 @@
|
|||||||
}
|
}
|
||||||
.el-date-range-picker.el-picker-panel__body__only {
|
.el-date-range-picker.el-picker-panel__body__only {
|
||||||
width: 324px;
|
width: 324px;
|
||||||
|
.el-date-range-picker__header{
|
||||||
|
.el-picker-panel__icon-btn.el-icon-arrow-right{
|
||||||
|
font-size: 12px;
|
||||||
|
color: $--button-icon-color;
|
||||||
|
transform: scale(0.8);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.el-date-range-picker__content.el-date-range-picker__content__only{
|
.el-date-range-picker__content.el-date-range-picker__content__only{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ export default {
|
|||||||
thresholdShow: true,
|
thresholdShow: true,
|
||||||
thresholds: [{ value: undefined, color: randomcolor() }]
|
thresholds: [{ value: undefined, color: randomcolor() }]
|
||||||
},
|
},
|
||||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }],
|
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }],
|
||||||
panel: '',
|
panel: '',
|
||||||
sync: 0,
|
sync: 0,
|
||||||
remark: '',
|
remark: '',
|
||||||
|
|||||||
@@ -52,7 +52,14 @@
|
|||||||
<div v-if="expressionsShow[index-1].error" class="el-form-item__error" style="top: 10px;left: 164px"> {{expressionsShow[index-1].error}}</div>
|
<div v-if="expressionsShow[index-1].error" class="el-form-item__error" style="top: 10px;left: 164px"> {{expressionsShow[index-1].error}}</div>
|
||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<span @click="()=>{addExpression()}" style="margin-right: 5px;padding-left: 10px" :title="$t('tip.add')">
|
<!-- 显示隐藏 -->
|
||||||
|
<span v-if="expressionsShow[index-1].state === 1" @click="()=>{switchExpression(index - 1,1)}" :title="$t('overall.visible')" style="margin-right: 5px;padding-left: 10px">
|
||||||
|
<i class="nz-icon nz-icon-mimakejian"></i>
|
||||||
|
</span>
|
||||||
|
<span v-else @click="()=>{switchExpression(index - 1,0)}" :title="$t('overall.invisible')" style="margin-right: 5px;padding-left: 10px">
|
||||||
|
<i class="nz-icon nz-icon-mimabukejian"></i>
|
||||||
|
</span>
|
||||||
|
<span @click="()=>{addExpression()}" style="margin-right: 5px" :title="$t('tip.add')">
|
||||||
<i class="nz-icon nz-icon-create-square" style="font-weight: normal; font-size: 17px; cursor: pointer;"></i>
|
<i class="nz-icon nz-icon-create-square" style="font-weight: normal; font-size: 17px; cursor: pointer;"></i>
|
||||||
</span>
|
</span>
|
||||||
<span @click="copyExpression(index - 1)" style="margin-right: 5px" :title="$t('overall.duplicate')">
|
<span @click="copyExpression(index - 1)" style="margin-right: 5px" :title="$t('overall.duplicate')">
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ export default {
|
|||||||
type: 'line',
|
type: 'line',
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 100,
|
max: 100,
|
||||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }],
|
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }],
|
||||||
param: {
|
param: {
|
||||||
stack: 0,
|
stack: 0,
|
||||||
nullType: 'null',
|
nullType: 'null',
|
||||||
@@ -389,7 +389,7 @@ export default {
|
|||||||
legend: true,
|
legend: true,
|
||||||
valueMapping: false
|
valueMapping: false
|
||||||
},
|
},
|
||||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }],
|
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }],
|
||||||
param: {
|
param: {
|
||||||
limit: 100,
|
limit: 100,
|
||||||
showHeader: this.editChart.param.showHeader
|
showHeader: this.editChart.param.showHeader
|
||||||
|
|||||||
@@ -329,13 +329,21 @@ export default {
|
|||||||
if (this.expressions.length) {
|
if (this.expressions.length) {
|
||||||
this.chartConfig.elements = []
|
this.chartConfig.elements = []
|
||||||
this.expressions.forEach((expr, i) => {
|
this.expressions.forEach((expr, i) => {
|
||||||
this.chartConfig.elements.push({ id: this.expressionsShow[i].elementId, expression: expr, type: 'expert', legend: this.expressionsShow[i].legend, name: this.expressionName[i] })
|
this.chartConfig.elements.push({ id: this.expressionsShow[i].elementId, expression: expr, type: 'expert', legend: this.expressionsShow[i].legend, name: this.expressionName[i], state: this.expressionsShow[i].state })
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.chartConfig.elements = []
|
this.chartConfig.elements = []
|
||||||
}
|
}
|
||||||
this.change()
|
this.change()
|
||||||
},
|
},
|
||||||
|
switchExpression (index, flag) {
|
||||||
|
if (flag === 1) {
|
||||||
|
this.$set(this.expressionsShow[index], 'state', 0)
|
||||||
|
} else {
|
||||||
|
this.$set(this.expressionsShow[index], 'state', 1)
|
||||||
|
}
|
||||||
|
this.expressionChange()
|
||||||
|
},
|
||||||
expressionNameChange (index) {
|
expressionNameChange (index) {
|
||||||
if (this.expressionsShow[index].error) {
|
if (this.expressionsShow[index].error) {
|
||||||
this.expressionName[index] = this.expressionsShow[index].oldName
|
this.expressionName[index] = this.expressionsShow[index].oldName
|
||||||
@@ -383,7 +391,8 @@ export default {
|
|||||||
oldName: expressionName,
|
oldName: expressionName,
|
||||||
error: '',
|
error: '',
|
||||||
legend: '',
|
legend: '',
|
||||||
elementId: ''
|
elementId: '',
|
||||||
|
state: 1
|
||||||
})
|
})
|
||||||
this.expressionChange()
|
this.expressionChange()
|
||||||
} else {
|
} else {
|
||||||
@@ -396,7 +405,8 @@ export default {
|
|||||||
oldName: item.name,
|
oldName: item.name,
|
||||||
error: '',
|
error: '',
|
||||||
elementId: item.id,
|
elementId: item.id,
|
||||||
legend: item.legend
|
legend: item.legend,
|
||||||
|
state: item.state
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ export default {
|
|||||||
thresholdShow: true,
|
thresholdShow: true,
|
||||||
thresholds: [{ value: undefined, color: randomcolor() }]
|
thresholds: [{ value: undefined, color: randomcolor() }]
|
||||||
},
|
},
|
||||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }],
|
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }],
|
||||||
panel: '',
|
panel: '',
|
||||||
sync: 0,
|
sync: 0,
|
||||||
remark: '',
|
remark: '',
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ export default {
|
|||||||
thresholds: [{ value: undefined, color: randomcolor() }],
|
thresholds: [{ value: undefined, color: randomcolor() }],
|
||||||
showHeader: 1
|
showHeader: 1
|
||||||
},
|
},
|
||||||
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A' }],
|
elements: [{ expression: '', legend: '', type: 'expert', id: '', name: 'A', state: 1 }],
|
||||||
panel: '',
|
panel: '',
|
||||||
sync: 0,
|
sync: 0,
|
||||||
remark: '',
|
remark: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user