Merge pull request #1544 from dataease/pr@dev@fix_preview_filter_valid

fix: 仪表板预览过滤条件失效
This commit is contained in:
fit2cloud-chenyw 2021-12-28 18:11:36 +08:00 committed by GitHub
commit 6f9eb29ca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -236,7 +236,8 @@ export default {
'nowPanelJumpInfo',
'publicLinkStatus',
'previewCanvasScale',
'mobileLayoutStatus'
'mobileLayoutStatus',
'componentData'
])
},
@ -309,7 +310,8 @@ export default {
created() {
this.refId = uuid.v1
if (this.element && this.element.propValue && this.element.propValue.viewId) {
this.getData(this.element.propValue.viewId, false)
const hasFilter = this.componentData.filter(item => item.type === 'custom').some(item => item.options.value)
hasFilter || this.getData(this.element.propValue.viewId, false)
}
},
methods: {

View File

@ -17,13 +17,13 @@
{{ $t('commons.all') }}</el-checkbox>
<el-checkbox-group v-model="value" @change="handleCheckedChange">
<el-checkbox v-for="item in datas" :key="item.id" :label="item.id">{{ item.id }}</el-checkbox>
<el-checkbox v-for="item in datas.filter(node => node.id && node.id.includes(keyWord))" :key="item.id" :label="item.id">{{ item.id }}</el-checkbox>
</el-checkbox-group>
</div>
<div v-else class="radio-group-container">
<el-radio-group v-model="value" @change="changeRadioBox">
<el-radio v-for="(item, index) in datas" :key="index" :label="item.id" @click.native.prevent="testChange(item)">
<el-radio v-for="(item, index) in datas.filter(node => node.id && node.id.includes(keyWord))" :key="index" :label="item.id" @click.native.prevent="testChange(item)">
<span>{{ item.id }}</span>
</el-radio>
</el-radio-group>