forked from github/dataease
feat:怎讲仪表板联动清除按钮
This commit is contained in:
parent
6c906bb951
commit
22d32aafaa
@ -0,0 +1,49 @@
|
|||||||
|
<template>
|
||||||
|
<div v-show="existLinkage" class="bar-main">
|
||||||
|
<div>
|
||||||
|
<el-button size="mini" type="info" @click="clearAllLinkage">清除所有联动</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
existLinkage() {
|
||||||
|
let linkageFiltersCount = 0
|
||||||
|
this.componentData.forEach(item => {
|
||||||
|
if (item.linkageFilters && item.linkageFilters.length > 0) {
|
||||||
|
linkageFiltersCount++
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return linkageFiltersCount
|
||||||
|
},
|
||||||
|
...mapState([
|
||||||
|
'componentData'
|
||||||
|
])
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
clearAllLinkage() {
|
||||||
|
this.$store.commit('clearPanelLinkageInfo')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.bar-main{
|
||||||
|
position: absolute;
|
||||||
|
left: 0px;
|
||||||
|
z-index: 10;
|
||||||
|
height: 20px;
|
||||||
|
border-radius:2px;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 2px;
|
||||||
|
cursor:pointer!important;
|
||||||
|
opacity: 0.8;
|
||||||
|
/*background-color: #0a7be0;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
@ -3,6 +3,7 @@
|
|||||||
<el-row v-if="componentDataShow.length===0" style="height: 100%;" class="custom-position">
|
<el-row v-if="componentDataShow.length===0" style="height: 100%;" class="custom-position">
|
||||||
{{ $t('panel.panelNull') }}
|
{{ $t('panel.panelNull') }}
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<canvas-opt-bar />
|
||||||
<ComponentWrapper
|
<ComponentWrapper
|
||||||
v-for="(item, index) in componentDataInfo"
|
v-for="(item, index) in componentDataInfo"
|
||||||
:key="index"
|
:key="index"
|
||||||
@ -39,9 +40,10 @@ import { deepCopy } from '@/components/canvas/utils/utils'
|
|||||||
import eventBus from '@/components/canvas/utils/eventBus'
|
import eventBus from '@/components/canvas/utils/eventBus'
|
||||||
import elementResizeDetectorMaker from 'element-resize-detector'
|
import elementResizeDetectorMaker from 'element-resize-detector'
|
||||||
import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
|
import UserViewDialog from '@/components/canvas/custom-component/UserViewDialog'
|
||||||
|
import CanvasOptBar from '@/components/canvas/components/Editor/CanvasOptBar'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { ComponentWrapper, UserViewDialog },
|
components: { ComponentWrapper, UserViewDialog, CanvasOptBar },
|
||||||
model: {
|
model: {
|
||||||
prop: 'show',
|
prop: 'show',
|
||||||
event: 'change'
|
event: 'change'
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
>
|
>
|
||||||
<!-- 网格线 -->
|
<!-- 网格线 -->
|
||||||
<Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" />
|
<Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" />
|
||||||
|
|
||||||
|
<!-- 仪表板联动清除按钮-->
|
||||||
|
<canvas-opt-bar />
|
||||||
<!--页面组件列表展示-->
|
<!--页面组件列表展示-->
|
||||||
<de-drag
|
<de-drag
|
||||||
v-for="(item, index) in componentData"
|
v-for="(item, index) in componentData"
|
||||||
@ -156,8 +159,10 @@ 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'
|
import DeOutWidget from '@/components/dataease/DeOutWidget'
|
||||||
|
import CanvasOptBar from '@/components/canvas/components/Editor/CanvasOptBar'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { Shape, ContextMenu, MarkLine, Area, Grid, DeDrag, UserViewDialog, DeOutWidget },
|
components: { Shape, ContextMenu, MarkLine, Area, Grid, DeDrag, UserViewDialog, DeOutWidget, CanvasOptBar },
|
||||||
props: {
|
props: {
|
||||||
isEdit: {
|
isEdit: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
|
@ -237,6 +237,13 @@ const data = {
|
|||||||
},
|
},
|
||||||
setNowPanelTrackInfo(state, trackInfo) {
|
setNowPanelTrackInfo(state, trackInfo) {
|
||||||
state.nowPanelTrackInfo = trackInfo
|
state.nowPanelTrackInfo = trackInfo
|
||||||
|
},
|
||||||
|
clearPanelLinkageInfo(state) {
|
||||||
|
state.componentData.forEach(item => {
|
||||||
|
if (item.linkageFilters && item.linkageFilters.length > 0) {
|
||||||
|
item.linkageFilters.splice(0, item.linkageFilters.length)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
modules: {
|
modules: {
|
||||||
|
Loading…
Reference in New Issue
Block a user