fix(仪表板): 过滤器标题隐藏后再开启被清空

This commit is contained in:
fit2cloud-chenyw 2022-09-27 17:53:45 +08:00
parent 2532483a85
commit f5ca282259
4 changed files with 62 additions and 72 deletions

View File

@ -1,7 +1,7 @@
<template>
<div ref="myContainer" class="my-container">
<div ref="conditionMain" :style="outsideStyle" class="condition-main">
<div v-if="element.options.attrs.title" ref="deTitleContainer" :style="titleStyle" class="condition-title">
<div v-if="element.options.attrs.showTitle && element.options.attrs.title" ref="deTitleContainer" :style="titleStyle" class="condition-title">
<div class="condition-title-absolute">
<div class="first-title">
<div class="span-container">
@ -13,7 +13,7 @@
<div
ref="deContentContainer"
class="condition-content"
:class="element.options.attrs.title ? '' : 'condition-content-default'"
:class="(element.options.attrs.showTitle && element.options.attrs.title) ? '' : 'condition-content-default'"
>
<div class="condition-content-container">
<div class="first-element">

View File

@ -562,7 +562,7 @@ export default {
return false
} else if (this.curComponent && this.showAttrComponent.includes(this.curComponent.type)) {
//
if (this.curComponent.type === 'custom' && !this.curComponent.options.attrs.title) {
if (this.curComponent.type === 'custom' && (!this.curComponent.options.attrs.showTitle || !this.curComponent.options.attrs.title)) {
return false
} else {
return true

View File

@ -76,7 +76,7 @@ export default {
if (showName) {
result = this.$t(showName)
}
if (item.options.attrs.title) {
if (item.options.attrs.showTitle && item.options.attrs.title) {
result += '【' + item.options.attrs.title + '】'
}

View File

@ -50,8 +50,13 @@
</el-checkbox>
<el-popover v-model="titlePopovervisible" placement="bottom-end" :disabled="!attrs.showTitle" width="200">
<div style="width: 100%;overflow-y: auto;overflow-x: hidden;word-break: break-all;position: relative;">
<el-input v-model="attrs.title" :placeholder="$t('panel.input_title')" type="textarea" maxlength="15"
show-word-limit/>
<el-input
v-model="attrs.title"
:placeholder="$t('panel.input_title')"
type="textarea"
maxlength="15"
show-word-limit
/>
</div>
<i
@ -107,8 +112,10 @@
class="de-checkbox"
>
<div class="span-div">
<span v-if="item.alias && item.alias.length <= 7"
style="margin-left: 6px">{{ item.alias }}</span>
<span
v-if="item.alias && item.alias.length <= 7"
style="margin-left: 6px"
>{{ item.alias }}</span>
<el-tooltip v-else class="item" effect="dark" :content="item.alias" placement="left">
<span style="margin-left: 6px">{{ item.alias }}</span>
</el-tooltip>
@ -179,59 +186,42 @@ export default {
if ('timeYearWidget,timeMonthWidget,timeDateWidget,textSelectWidget,numberSelectWidget'.indexOf(this.widget.name) !== -1) {
this.showParams = true
}
}
,
},
methods: {
multipleChange(value)
{
multipleChange(value) {
this.fillAttrs2Filter()
}
,
showTimeChange(value)
{
},
showTimeChange(value) {
this.attrs.accuracy = this.accuracyOptions[1].id
this.attrs.default.isDynamic = false
this.fillAttrs2Filter()
}
,
checkedViewsChange(values)
{
},
checkedViewsChange(values) {
this.fillAttrs2Filter()
}
,
enableRangeChange(value)
{
},
enableRangeChange(value) {
if (!value) {
this.attrs.viewIds = []
}
this.fillAttrs2Filter()
}
,
enableParametersChange(value)
{
},
enableParametersChange(value) {
if (!value) {
this.attrs.parameters = []
}
this.fillAttrs2Filter()
}
,
showTitleChange(value)
{
},
showTitleChange(value) {
if (!value) {
this.attrs.title = ''
this.element.style.backgroundColor = ''
}
this.fillAttrs2Filter()
}
,
showVisualChange(value)
{
},
showVisualChange(value) {
this.fillAttrs2Filter()
}
,
},
fillAttrs2Filter()
{
fillAttrs2Filter() {
}
}
}