Merge pull request #8459 from dataease/pr@dev_empty_data

feat(过滤组件): 文本下拉组件的选项新增空数据选项
This commit is contained in:
dataeaseShu 2024-03-12 17:53:35 +08:00 committed by GitHub
commit b6c1774942
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 2 deletions

View File

@ -17,7 +17,7 @@
:key-word="keyWord" :key-word="keyWord"
popper-class="coustom-de-select" popper-class="coustom-de-select"
:class="{'disabled-close': !inDraw && selectFirst && element.options.attrs.multiple, 'show-required-tips': showRequiredTips}" :class="{'disabled-close': !inDraw && selectFirst && element.options.attrs.multiple, 'show-required-tips': showRequiredTips}"
:list="data" :list="(element.options.attrs.showEmpty ? [{ text: '空数据', id: '_empty_$'}, ...data] : data)"
:flag="flag" :flag="flag"
:is-config="isConfig" :is-config="isConfig"
:custom-style="customStyle" :custom-style="customStyle"
@ -555,7 +555,7 @@ export default {
if (this.isCustomSortWidget && this.element.options.attrs?.sort?.sort === 'custom') { if (this.isCustomSortWidget && this.element.options.attrs?.sort?.sort === 'custom') {
tempData = mergeCustomSortOption(this.element.options.attrs.sort.list, tempData) tempData = mergeCustomSortOption(this.element.options.attrs.sort.list, tempData)
} }
this.filterInvalidValue(tempData) this.filterInvalidValue(this.element.options.attrs.showEmpty ? [...tempData, '_empty_$'] : tempData)
return tempData.map(item => { return tempData.map(item => {
return { return {
id: item, id: item,

View File

@ -2282,6 +2282,7 @@ export default {
data_list: 'Data list', data_list: 'Data list',
component_list: 'Component list', component_list: 'Component list',
custom_scope: 'Target', custom_scope: 'Target',
show_empty: 'Option contains empty data',
multiple_choice: 'Multiple choice', multiple_choice: 'Multiple choice',
show_time: 'Show time', show_time: 'Show time',
single_choice: 'Single choice', single_choice: 'Single choice',

View File

@ -2273,6 +2273,7 @@ export default {
data_list: '數據列表', data_list: '數據列表',
component_list: '組件列表', component_list: '組件列表',
custom_scope: '控製範圍', custom_scope: '控製範圍',
show_empty: '選項包含空數據',
binding_parameters: '參數', binding_parameters: '參數',
multiple_choice: '多選', multiple_choice: '多選',
show_time: '顯示時間', show_time: '顯示時間',

View File

@ -2276,6 +2276,7 @@ export default {
data_list: '数据列表', data_list: '数据列表',
component_list: '组件列表', component_list: '组件列表',
custom_scope: '控制范围', custom_scope: '控制范围',
show_empty: '选项包含空数据',
binding_parameters: '参数', binding_parameters: '参数',
multiple_choice: '多选', multiple_choice: '多选',
show_time: '显示时间', show_time: '显示时间',

View File

@ -70,6 +70,13 @@
<el-col :span="16"> <el-col :span="16">
<div class="filter-options-right"> <div class="filter-options-right">
<span style="padding-right: 10px;"> <span style="padding-right: 10px;">
<el-checkbox
v-model="attrs.showEmpty"
>{{ $t('panel.show_empty') }}
</el-checkbox>
</span>
<span style="padding-right: 10px;">
<el-checkbox <el-checkbox
v-model="attrs.showTitle" v-model="attrs.showTitle"
@change="showTitleChange" @change="showTitleChange"