feat: explore table 显示列切换显示隐藏的选项

This commit is contained in:
zhangyu
2021-12-27 15:37:14 +08:00
parent 95204d3127
commit 28127e3653
3 changed files with 43 additions and 5 deletions

View File

@@ -35,6 +35,7 @@
width: 100%; width: 100%;
height: 300px; height: 300px;
border: 1px solid $--button-light-border-color !important; border: 1px solid $--button-light-border-color !important;
line-height: 1.5;
} }
.custom-labels i { .custom-labels i {
color: #04b330; color: #04b330;
@@ -42,6 +43,15 @@
position: absolute; position: absolute;
left: 5px; left: 5px;
top: 6px; top: 6px;
margin: 0 !important;
}
.explore-table-title{
display: none;
}
.is-active .explore-table-title{
display: block;
position: relative;
width: 100%
} }
.nz-btn.nz-btn-style-light { .nz-btn.nz-btn-style-light {
background-color: $--background-color-empty; background-color: $--background-color-empty;

View File

@@ -8,7 +8,7 @@
v-for="(item,index) in custom" v-for="(item,index) in custom"
:key="index" :key="index"
class="custom-label" class="custom-label"
@click="handler(item,index)" @click.stop="handler(item,index)"
:id="'element-set-el-'+index" :id="'element-set-el-'+index"
:class="{'custom-title orange-font':item.type == 'title','custom-label-disabled':!allowedAll&&!item.allowed && (index==0 || index == 1 || item.NotSet)}" :class="{'custom-title orange-font':item.type == 'title','custom-label-disabled':!allowedAll&&!item.allowed && (index==0 || index == 1 || item.NotSet)}"
> >
@@ -20,17 +20,17 @@
</div> </div>
</div> </div>
<div class="custom-bottom-btns"> <div class="custom-bottom-btns">
<button v-if="isCancel" :id="tableId+'-element-set-none'" class="nz-btn nz-btn-size-small nz-btn-style-light is-cancel" type="button" @click="batchHandler(false)"> <button v-if="isCancel" :id="tableId+'-element-set-none'" class="nz-btn nz-btn-size-small nz-btn-style-light is-cancel" type="button" @click.stop="batchHandler(false)">
<span class="top-tool-btn-txt">{{$t('overall.clear')}}</span> <span class="top-tool-btn-txt">{{$t('overall.clear')}}</span>
</button> </button>
<button v-if="!isCancel" :id="tableId+'-element-set-all'" class="nz-btn nz-btn-size-small nz-btn-style-light" type="button" @click="batchHandler(true)"> <button v-if="!isCancel" :id="tableId+'-element-set-all'" class="nz-btn nz-btn-size-small nz-btn-style-light" type="button" @click.stop="batchHandler(true)">
<span class="top-tool-btn-txt">{{$t('overall.all')}}</span> <span class="top-tool-btn-txt">{{$t('overall.all')}}</span>
</button> </button>
<div> <div>
<button :id="tableId+'-element-set-esc'" class="nz-btn nz-btn-size-small nz-btn-style-light" type="button" @click="esc"> <button :id="tableId+'-element-set-esc'" class="nz-btn nz-btn-size-small nz-btn-style-light" type="button" @click.stop="esc">
<span class="top-tool-btn-txt">{{$t('overall.esc')}}</span> <span class="top-tool-btn-txt">{{$t('overall.esc')}}</span>
</button> </button>
<button :id="tableId+'-element-set-save'" class="nz-btn nz-btn-size-small nz-btn-style-normal" type="button" @click="save"> <button :id="tableId+'-element-set-save'" class="nz-btn nz-btn-size-small nz-btn-style-normal" type="button" @click.stop="save">
<span class="top-tool-btn-txt">{{$t('overall.save')}}</span> <span class="top-tool-btn-txt">{{$t('overall.save')}}</span>
</button> </button>
</div> </div>

View File

@@ -91,6 +91,29 @@
</div> </div>
</el-collapse-item> </el-collapse-item>
<el-collapse-item class="el-collapse-item__height" name="2" title="Table"> <el-collapse-item class="el-collapse-item__height" name="2" title="Table">
<div slot="title" class="explore-table-title">
Table
<button class="top-tool-btn table-column-setting"
style="position: absolute;right: 10px;top: 8px"
type="button"
@click.stop="tools.showCustomTableTitle = true"
>
<i class="nz-icon-gear nz-icon"></i>
</button> <!-- 自定义table列 -->
<transition name="el-zoom-in-top">
<element-set
@click.stop
v-if="tools.showCustomTableTitle"
:tableId="tableId"
ref="customTableTitle"
:custom-table-title="tools.customTableTitle"
:original-table-title="tableTitle"
:operation-true="true"
@close="tools.showCustomTableTitle = false"
@update="updateCustomTableTitle"
></element-set>
</transition>
</div>
<!-- 自定义table列 --> <!-- 自定义table列 -->
<div class="nz-table2 explore-table"> <div class="nz-table2 explore-table">
<el-table ref="exploreTable" <el-table ref="exploreTable"
@@ -332,6 +355,7 @@ export default {
}, },
value: true, value: true,
tabPosition: 'none', tabPosition: 'none',
tableId: 'explore',
searchMetrics: [ searchMetrics: [
{ {
value: 'Metrics', value: 'Metrics',
@@ -984,6 +1008,10 @@ export default {
this.$refs.logDetail.myChart.resize() this.$refs.logDetail.myChart.resize()
} }
}) })
},
updateCustomTableTitle (custom) {
this.tools.customTableTitle = custom
this.$refs.exploreTable.doLayout()
} }
}, },
watch: { watch: {