feat:新增功能

1.panel图表的表格展示功能
2.panel图表按时间查询功能(进行中,显示了时间选择组件和快捷日期,未实现查询功能)
fix:修改BUG
1.panel图表修改时,删除第一个metric时,删除的是第二个metric
2.panel图表新增时的标题为编辑时的标题
This commit is contained in:
hanyuxia
2020-01-07 17:12:48 +08:00
parent caeb1c0a84
commit fca0867d1b
8 changed files with 201 additions and 35 deletions

View File

@@ -83,7 +83,7 @@
<el-row v-show="tableShow == 2">
<el-col span="22">
<el-form-item prop="expression" ><!--expression和metric的验证只能有一个不能同时存在:rules="{ required: true, type: 'string', message: '', trigger: 'change' }"-->
<el-input size="mini" type="textarea" maxlength="1024" show-word-limit v-model="elementInfo.expression" :placeholder="this.$t('dashboard.metric.expertTip')" ></el-input>
<el-input size="mini" ref="metricExpression" type="textarea" maxlength="1024" show-word-limit v-model="elementInfo.expression" :placeholder="this.$t('dashboard.metric.expertTip')" ></el-input>
</el-form-item>
</el-col>
<el-col span="2">
@@ -193,22 +193,37 @@ export default {
methods: {
// 删除该选项,第一步,传递要删除的参数
deleteTarget() {
//alert('metric第一步删除的指针之后回调box的第一个步'+this.pointer);
this.$emit('on-delete-target', this.pointer);
},
// 第二步,on-delete-target回调保存数据
subSave() {
//alert('metric第二步bus.chartAddInfo.metricTarget,指针'+JSON.stringify(bus.chartAddInfo.metricTarget)+'==pointer'+this.pointer);
bus.chartAddInfo.metricTarget[this.pointer] = this.elementInfo;
//alert('metric第二步保存信息到bus'+JSON.stringify(this.elementInfo))
this.$emit('sub-save-ok');
},
// 第三步,将数据重新赋值,sub-save-ok回调
setSubdata(index) {
if (index === this.pointer) {
this.elementInfo.metric = bus.chartAddInfo.metricTarget[this.pointer].metric;
//alert('metric第三步bus='+JSON.stringify(bus.chartAddInfo.metricTarget));
//alert('metric第三步bus('+this.pointer+')='+JSON.stringify(bus.chartAddInfo.metricTarget[this.pointer]));
this.elementInfo = bus.chartAddInfo.metricTarget[this.pointer];
//alert('metric第三步index'+index+',如果index是当前pointer('+this.pointer+')则继续把bus中的值赋值给当前metric')
//alert('metric第三步elementInfo='+JSON.stringify(this.elementInfo));
if(this.elementInfo.type==='expert'){
//alert('metric第三步expert');
// 当该项expression为空时重置一下
if (!this.elementInfo.expression && this.$refs.metricExpression) {
this.$refs.metricExpression.reset();
}
this.clickTabelShow(2,'expert');
}else {
// alert('metric第三步normal');
// 当该项metric为空时重置一下
if (!this.elementInfo.metric && this.$refs.metricSelect) {
this.$refs.metricSelect.reset();
}
this.elementInfo.tagList = bus.chartAddInfo.metricTarget[this.pointer].tagList;
this.clickTabelShow(1,'normal');
}
},
@@ -293,6 +308,7 @@ export default {
//alert('metricSetData'+JSON.stringify(data));
this.setDataFlag = true;
this.target = Object.assign({}, data);
//this.pointer =
if(this.target.type==='expert'){
this.tableShow = 2;
this.elementInfo.type = this.target.type;