feat: 仪表板条件过滤组件增加标题

This commit is contained in:
fit2cloud-chenyw 2021-07-14 16:58:07 +08:00
parent aa99b45cf5
commit dfd0f04698
11 changed files with 85 additions and 34 deletions

View File

@ -20,7 +20,7 @@
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^2.6.5", "core-js": "^2.6.5",
"echarts": "^5.0.1", "echarts": "^5.0.1",
"element-resize-detector": "^1.2.2", "element-resize-detector": "^1.2.3",
"element-ui": "2.13.0", "element-ui": "2.13.0",
"file-save": "^0.2.0", "file-save": "^0.2.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",

View File

@ -5,8 +5,7 @@
class="component" class="component"
@click="handleClick" @click="handleClick"
> >
<component <de-out-widget
:is="config.component"
v-if="config.type==='custom'" v-if="config.type==='custom'"
:id="'component' + config.id" :id="'component' + config.id"
class="component-custom" class="component-custom"
@ -14,6 +13,7 @@
:out-style="config.style" :out-style="config.style"
:element="config" :element="config"
/> />
<component <component
:is="config.component" :is="config.component"
v-else v-else
@ -31,8 +31,9 @@ import { getStyle } from '@/components/canvas/utils/style'
import runAnimation from '@/components/canvas/utils/runAnimation' import runAnimation from '@/components/canvas/utils/runAnimation'
import { mixins } from '@/components/canvas/utils/events' import { mixins } from '@/components/canvas/utils/events'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import DeOutWidget from '@/components/dataease/DeOutWidget'
export default { export default {
components: { DeOutWidget },
mixins: [mixins], mixins: [mixins],
props: { props: {
config: { config: {

View File

@ -44,6 +44,27 @@
:active="item === curComponent" :active="item === curComponent"
@input="handleInput" @input="handleInput"
/> />
<!-- <out-widget
:is="item.component"
v-else-if="item.type==='custom'"
:id="'component' + item.id"
class="component"
:style="getComponentStyleDefault(item.style)"
:prop-value="item.propValue"
:element="item"
:out-style="getShapeStyleInt(item.style)"
:active="item === curComponent"
/> -->
<de-out-widget
v-else-if="item.type==='custom'"
:id="'component' + item.id"
class="component"
:style="getComponentStyleDefault(item.style)"
:prop-value="item.propValue"
:element="item"
:out-style="getShapeStyleInt(item.style)"
:active="item === curComponent"
/>
<component <component
:is="item.component" :is="item.component"
v-else-if="item.type==='other'" v-else-if="item.type==='other'"
@ -127,9 +148,9 @@ import Grid from './Grid'
import { changeStyleWithScale } from '@/components/canvas/utils/translate' import { changeStyleWithScale } from '@/components/canvas/utils/translate'
import { deepCopy } from '@/components/canvas/utils/utils' import { deepCopy } from '@/components/canvas/utils/utils'
import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog' import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
import DeOutWidget from '@/components/dataease/DeOutWidget'
export default { export default {
components: { Shape, ContextMenu, MarkLine, Area, Grid, DeDrag, UserViewDialog }, components: { Shape, ContextMenu, MarkLine, Area, Grid, DeDrag, UserViewDialog, DeOutWidget },
props: { props: {
isEdit: { isEdit: {
type: Boolean, type: Boolean,

View File

@ -26,7 +26,8 @@ const drawPanel = {
type: 'custom', type: 'custom',
style: { style: {
width: 300, width: 300,
height: 47, // height: 47,
height: 90,
fontSize: 14, fontSize: 14,
fontWeight: 500, fontWeight: 500,
lineHeight: '', lineHeight: '',

View File

@ -22,7 +22,8 @@ const drawPanel = {
type: 'custom', type: 'custom',
style: { style: {
width: 300, width: 300,
height: 45.5, // height: 45.5,
height: 90,
fontSize: 14, fontSize: 14,
fontWeight: 500, fontWeight: 500,
lineHeight: '', lineHeight: '',

View File

@ -27,7 +27,7 @@ const drawPanel = {
type: 'custom', type: 'custom',
style: { style: {
width: 300, width: 300,
height: 38, height: 90,
fontSize: 14, fontSize: 14,
fontWeight: 500, fontWeight: 500,
lineHeight: '', lineHeight: '',

View File

@ -24,7 +24,8 @@ const drawPanel = {
type: 'custom', type: 'custom',
style: { style: {
width: 300, width: 300,
height: 47, // height: 47,
height: 90,
fontSize: 14, fontSize: 14,
fontWeight: 500, fontWeight: 500,
lineHeight: '', lineHeight: '',

View File

@ -22,7 +22,8 @@ const drawPanel = {
type: 'custom', type: 'custom',
style: { style: {
width: 300, width: 300,
height: 47, // height: 47,
height: 90,
fontSize: 14, fontSize: 14,
fontWeight: 500, fontWeight: 500,
lineHeight: '', lineHeight: '',

View File

@ -22,7 +22,8 @@ const drawPanel = {
type: 'custom', type: 'custom',
style: { style: {
width: 300, width: 300,
height: 47, // height: 47,
height: 90,
fontSize: 14, fontSize: 14,
fontWeight: 500, fontWeight: 500,
lineHeight: '', lineHeight: '',

View File

@ -22,7 +22,8 @@ const drawPanel = {
type: 'custom', type: 'custom',
style: { style: {
width: 300, width: 300,
height: 47, // height: 47,
height: 90,
fontSize: 14, fontSize: 14,
fontWeight: 500, fontWeight: 500,
lineHeight: '', lineHeight: '',

View File

@ -182,6 +182,22 @@
</div> </div>
</el-col> </el-col>
<el-col :span="16"><div class="filter-options-right"> <el-col :span="16"><div class="filter-options-right">
<el-col :span="8">
<el-checkbox v-model="componentInfo.options.attrs.showTitle" @change="showTitleChange">显示标题</el-checkbox>
<el-popover
v-model="titlePopovervisible"
placement="bottom-end"
:disabled="!componentInfo.options.attrs.showTitle"
width="200"
>
<div style="width: 100%;overflow-y: auto;overflow-x: hidden;word-break: break-all;position: relative;">
<el-input v-model="componentInfo.options.attrs.title" placeholder="请输入标题" type="textarea" maxlength="15" show-word-limit />
</div>
<i slot="reference" :class="{'i-filter-active': componentInfo.options.attrs.showTitle, 'i-filter-inactive': !componentInfo.options.attrs.showTitle}" class="el-icon-setting i-filter" />
</el-popover>
</el-col>
<el-col :span="8">
<el-checkbox v-model="componentInfo.options.attrs.enableRange" @change="enableRangeChange"><span> {{ $t('panel.custom_scope') }} </span> </el-checkbox> <el-checkbox v-model="componentInfo.options.attrs.enableRange" @change="enableRangeChange"><span> {{ $t('panel.custom_scope') }} </span> </el-checkbox>
<el-popover <el-popover
@ -203,7 +219,7 @@
<i slot="reference" :class="{'i-filter-active': componentInfo.options.attrs.enableRange, 'i-filter-inactive': !componentInfo.options.attrs.enableRange}" class="el-icon-setting i-filter" /> <i slot="reference" :class="{'i-filter-active': componentInfo.options.attrs.enableRange, 'i-filter-inactive': !componentInfo.options.attrs.enableRange}" class="el-icon-setting i-filter" />
</el-popover> </el-popover>
<!-- <el-checkbox disabled>备选项</el-checkbox> --> </el-col>
</div> </div>
</el-col> </el-col>
@ -301,7 +317,8 @@ export default {
keyWord: '', keyWord: '',
timer: null, timer: null,
expandedArray: [], expandedArray: [],
viewKeyWord: '' viewKeyWord: '',
titlePopovervisible: false
} }
}, },
computed: { computed: {
@ -610,6 +627,12 @@ export default {
} }
// this.componentInfo.options.attrs.enableRange = value // this.componentInfo.options.attrs.enableRange = value
this.$emit('re-fresh-component', this.componentInfo) this.$emit('re-fresh-component', this.componentInfo)
},
showTitleChange(value) {
if (!value) {
this.componentInfo.options.attrs.title = ''
}
this.$emit('re-fresh-component', this.componentInfo)
} }
} }
} }