forked from github/dataease
feat: 仪表板条件过滤组件增加标题
This commit is contained in:
parent
aa99b45cf5
commit
dfd0f04698
@ -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",
|
||||||
|
@ -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: {
|
||||||
|
@ -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,
|
||||||
|
@ -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: '',
|
||||||
|
@ -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: '',
|
||||||
|
@ -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: '',
|
||||||
|
@ -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: '',
|
||||||
|
@ -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: '',
|
||||||
|
@ -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: '',
|
||||||
|
@ -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: '',
|
||||||
|
@ -182,28 +182,44 @@
|
|||||||
</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-checkbox v-model="componentInfo.options.attrs.enableRange" @change="enableRangeChange"><span> {{ $t('panel.custom_scope') }} </span> </el-checkbox>
|
<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>
|
||||||
|
|
||||||
<el-popover
|
<i slot="reference" :class="{'i-filter-active': componentInfo.options.attrs.showTitle, 'i-filter-inactive': !componentInfo.options.attrs.showTitle}" class="el-icon-setting i-filter" />
|
||||||
v-model="popovervisible"
|
</el-popover>
|
||||||
placement="bottom-end"
|
</el-col>
|
||||||
:disabled="!componentInfo.options.attrs.enableRange"
|
<el-col :span="8">
|
||||||
width="200"
|
<el-checkbox v-model="componentInfo.options.attrs.enableRange" @change="enableRangeChange"><span> {{ $t('panel.custom_scope') }} </span> </el-checkbox>
|
||||||
>
|
|
||||||
<div class="view-container-class">
|
|
||||||
<el-checkbox-group v-model="componentInfo.options.attrs.viewIds" @change="checkedViewsChange">
|
|
||||||
<el-checkbox v-for="(item ) in viewInfos" :key="item.id" :label="item.id">
|
|
||||||
<span>
|
|
||||||
<svg-icon :icon-class="item.type" class="chart-icon" />
|
|
||||||
<span style="margin-left: 6px">{{ item.name }}</span>
|
|
||||||
</span>
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<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>
|
v-model="popovervisible"
|
||||||
<!-- <el-checkbox disabled>备选项</el-checkbox> -->
|
placement="bottom-end"
|
||||||
|
:disabled="!componentInfo.options.attrs.enableRange"
|
||||||
|
width="200"
|
||||||
|
>
|
||||||
|
<div class="view-container-class">
|
||||||
|
<el-checkbox-group v-model="componentInfo.options.attrs.viewIds" @change="checkedViewsChange">
|
||||||
|
<el-checkbox v-for="(item ) in viewInfos" :key="item.id" :label="item.id">
|
||||||
|
<span>
|
||||||
|
<svg-icon :icon-class="item.type" class="chart-icon" />
|
||||||
|
<span style="margin-left: 6px">{{ item.name }}</span>
|
||||||
|
</span>
|
||||||
|
</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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-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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user