fix: 仪表板>过滤器 选择“字段枚举值”后,再次打开下拉框没有数据
This commit is contained in:
parent
3ba69be557
commit
f1124fad3f
@ -275,6 +275,11 @@ export default {
|
||||
this.logic = this.item.logic
|
||||
this.filterType = this.item.filterType
|
||||
this.enumCheckField = this.item.enumCheckField
|
||||
|
||||
// init enum option
|
||||
if (this.item.filterType === 'enum' && this.needRequestEnum) {
|
||||
this.initEnumOptions()
|
||||
}
|
||||
},
|
||||
initEnumOptions() {
|
||||
// 查找枚举值
|
||||
|
||||
@ -1,24 +1,65 @@
|
||||
<template>
|
||||
<span style="position: relative;display: inline-block;">
|
||||
<i class="el-icon-arrow-down el-icon-delete" style="position: absolute;top: 6px;right: 24px;color: #878d9f;cursor: pointer;z-index: 1;" @click="removeItem" />
|
||||
<el-dropdown trigger="click" size="mini" @command="clickItem">
|
||||
<i
|
||||
class="el-icon-arrow-down el-icon-delete"
|
||||
style="position: absolute;top: 6px;right: 24px;color: #878d9f;cursor: pointer;z-index: 1;"
|
||||
@click="removeItem"
|
||||
/>
|
||||
<el-dropdown
|
||||
trigger="click"
|
||||
size="mini"
|
||||
@command="clickItem"
|
||||
>
|
||||
<span class="el-dropdown-link">
|
||||
<el-tag size="small" class="item-axis" :type="tagType">
|
||||
<el-tag
|
||||
size="small"
|
||||
class="item-axis"
|
||||
:type="tagType"
|
||||
>
|
||||
<span style="float: left">
|
||||
<svg-icon v-if="item.deType === 0" icon-class="field_text" class="field-icon-text" />
|
||||
<svg-icon v-if="item.deType === 1" icon-class="field_time" class="field-icon-time" />
|
||||
<svg-icon v-if="item.deType === 2 || item.deType === 3" icon-class="field_value" class="field-icon-value" />
|
||||
<svg-icon v-if="item.deType === 5" icon-class="field_location" class="field-icon-location" />
|
||||
<svg-icon
|
||||
v-if="item.deType === 0"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 1"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 2 || item.deType === 3"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 5"
|
||||
icon-class="field_location"
|
||||
class="field-icon-location"
|
||||
/>
|
||||
</span>
|
||||
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
|
||||
<span
|
||||
class="item-span-style"
|
||||
:title="item.name"
|
||||
>{{ item.name }}</span>
|
||||
<field-error-tips v-if="tagType === 'danger'"/>
|
||||
<i class="el-icon-arrow-down el-icon--right" style="position: absolute;top: 6px;right: 10px;" />
|
||||
<i
|
||||
class="el-icon-arrow-down el-icon--right"
|
||||
style="position: absolute;top: 6px;right: 10px;"
|
||||
/>
|
||||
</el-tag>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-files" :command="beforeClickItem('filter')">
|
||||
<el-dropdown-item
|
||||
icon="el-icon-files"
|
||||
:command="beforeClickItem('filter')"
|
||||
>
|
||||
<span>{{ $t('chart.filter') }}...</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-delete" divided :command="beforeClickItem('remove')">
|
||||
<el-dropdown-item
|
||||
icon="el-icon-delete"
|
||||
divided
|
||||
:command="beforeClickItem('remove')"
|
||||
>
|
||||
<span>{{ $t('chart.delete') }}</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@ -30,6 +71,7 @@
|
||||
<script>
|
||||
import {getItemType} from './utils'
|
||||
import FieldErrorTips from './FieldErrorTips'
|
||||
|
||||
export default {
|
||||
name: 'FilterItem',
|
||||
components: {FieldErrorTips},
|
||||
@ -53,7 +95,12 @@ export default {
|
||||
quotaData: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
bus: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -72,6 +119,10 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.bus.$on('reset-change-table', this.getItemTagType)
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.bus.$off('reset-change-table', this.getItemTagType)
|
||||
},
|
||||
methods: {
|
||||
clickItem(param) {
|
||||
@ -146,7 +197,7 @@ export default {
|
||||
|
||||
.item-span-style {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
width: 115px;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
|
||||
@ -84,7 +84,7 @@
|
||||
@add="addCustomFilter" @update="calcData(true)">
|
||||
<transition-group class="draggable-group">
|
||||
<filter-item v-for="(item,index) in view.customFilter" :key="item.id" :param="param" :index="index"
|
||||
:item="item" :dimension-data="dimension" :quota-data="quota"
|
||||
:item="item" :dimension-data="dimension" :quota-data="quota" :bus="bus"
|
||||
@onFilterItemRemove="filterItemRemove"
|
||||
@editItemFilter="showEditFilter"/>
|
||||
</transition-group>
|
||||
|
||||
@ -1,24 +1,65 @@
|
||||
<template>
|
||||
<span style="position: relative;display: inline-block;">
|
||||
<i class="el-icon-arrow-down el-icon-delete" style="position: absolute;top: 6px;right: 24px;color: #878d9f;cursor: pointer;z-index: 1;" @click="removeItem" />
|
||||
<el-dropdown trigger="click" size="mini" @command="clickItem">
|
||||
<i
|
||||
class="el-icon-arrow-down el-icon-delete"
|
||||
style="position: absolute;top: 6px;right: 24px;color: #878d9f;cursor: pointer;z-index: 1;"
|
||||
@click="removeItem"
|
||||
/>
|
||||
<el-dropdown
|
||||
trigger="click"
|
||||
size="mini"
|
||||
@command="clickItem"
|
||||
>
|
||||
<span class="el-dropdown-link">
|
||||
<el-tag size="small" class="item-axis" :type="tagType">
|
||||
<el-tag
|
||||
size="small"
|
||||
class="item-axis"
|
||||
:type="tagType"
|
||||
>
|
||||
<span style="float: left">
|
||||
<svg-icon v-if="item.deType === 0" icon-class="field_text" class="field-icon-text" />
|
||||
<svg-icon v-if="item.deType === 1" icon-class="field_time" class="field-icon-time" />
|
||||
<svg-icon v-if="item.deType === 2 || item.deType === 3" icon-class="field_value" class="field-icon-value" />
|
||||
<svg-icon v-if="item.deType === 5" icon-class="field_location" class="field-icon-location" />
|
||||
<svg-icon
|
||||
v-if="item.deType === 0"
|
||||
icon-class="field_text"
|
||||
class="field-icon-text"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 1"
|
||||
icon-class="field_time"
|
||||
class="field-icon-time"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 2 || item.deType === 3"
|
||||
icon-class="field_value"
|
||||
class="field-icon-value"
|
||||
/>
|
||||
<svg-icon
|
||||
v-if="item.deType === 5"
|
||||
icon-class="field_location"
|
||||
class="field-icon-location"
|
||||
/>
|
||||
</span>
|
||||
<span class="item-span-style" :title="item.name">{{ item.name }}</span>
|
||||
<span
|
||||
class="item-span-style"
|
||||
:title="item.name"
|
||||
>{{ item.name }}</span>
|
||||
<field-error-tips v-if="tagType === 'danger'"/>
|
||||
<i class="el-icon-arrow-down el-icon--right" style="position: absolute;top: 6px;right: 10px;" />
|
||||
<i
|
||||
class="el-icon-arrow-down el-icon--right"
|
||||
style="position: absolute;top: 6px;right: 10px;"
|
||||
/>
|
||||
</el-tag>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item icon="el-icon-files" :command="beforeClickItem('filter')">
|
||||
<el-dropdown-item
|
||||
icon="el-icon-files"
|
||||
:command="beforeClickItem('filter')"
|
||||
>
|
||||
<span>{{ $t('chart.filter') }}...</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-delete" divided :command="beforeClickItem('remove')">
|
||||
<el-dropdown-item
|
||||
icon="el-icon-delete"
|
||||
divided
|
||||
:command="beforeClickItem('remove')"
|
||||
>
|
||||
<span>{{ $t('chart.delete') }}</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
@ -30,6 +71,7 @@
|
||||
<script>
|
||||
import {getItemType} from './utils'
|
||||
import FieldErrorTips from './FieldErrorTips'
|
||||
|
||||
export default {
|
||||
name: 'FilterItem',
|
||||
components: {FieldErrorTips},
|
||||
@ -53,7 +95,12 @@ export default {
|
||||
quotaData: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
bus: {
|
||||
type: Object,
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -72,6 +119,10 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.bus.$on('reset-change-table', this.getItemTagType)
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.bus.$off('reset-change-table', this.getItemTagType)
|
||||
},
|
||||
methods: {
|
||||
clickItem(param) {
|
||||
@ -146,7 +197,7 @@ export default {
|
||||
|
||||
.item-span-style {
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
width: 115px;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
@add="addCustomFilter" @update="calcData(true)">
|
||||
<transition-group class="draggable-group">
|
||||
<filter-item v-for="(item,index) in view.customFilter" :key="item.id" :param="param" :index="index"
|
||||
:item="item" :dimension-data="dimension" :quota-data="quota"
|
||||
:item="item" :dimension-data="dimension" :quota-data="quota" :bus="bus"
|
||||
@onFilterItemRemove="filterItemRemove"
|
||||
@editItemFilter="showEditFilter"/>
|
||||
</transition-group>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user