feat:修改tab组件在预览态出现右键菜单

main
liu.shiyi 2 years ago
parent 1385d02022
commit fbdeec745e

@ -27,6 +27,7 @@
</div> </div>
</div> </div>
<div <div
v-if="config.customize.tabList &&config.customize.tabList.length"
class="line-box" class="line-box"
:style="{'background-color':config.customize.lineColor}" :style="{'background-color':config.customize.lineColor}"
/> />
@ -34,16 +35,27 @@
v-if="config.customize.tabList &&config.customize.tabList.length" v-if="config.customize.tabList &&config.customize.tabList.length"
class="chart-item-box" class="chart-item-box"
> >
<Configuration <!-- <Configuration-->
:config="config.customize.tabList[currentIndex].chart" <!-- :config="config.customize.tabList[currentIndex].chart"-->
@openRightPanel="openRightPanel" <!-- @openRightPanel="openRightPanel"-->
<!-- >-->
<div
class="configuration-wrap"
:class="{
'active': activeCodes.includes(config.customize.tabList[currentIndex].chart.code),
'hover': hoverCode === config.customize.tabList[currentIndex].chart.code
}"
@mouseenter.stop="changeHover(config.customize.tabList[currentIndex].chart.code)"
@mouseleave="changeHover('')"
@click.stop="changeActive(config.customize.tabList[currentIndex].chart)"
> >
<RenderCardInner <RenderCardInner
:ref="'RenderCard' + config.customize.tabList[currentIndex].chartCode" :ref="'RenderCard' + config.customize.tabList[currentIndex].chartCode"
:config="config.customize.tabList[currentIndex].chart" :config="config.customize.tabList[currentIndex].chart"
@click.native="currentChartHandler" @click.native="currentChartHandler"
/> />
</Configuration> </div>
<!-- </Configuration>-->
</div> </div>
<el-empty <el-empty
v-else-if="!config.customize.tabList.length" v-else-if="!config.customize.tabList.length"
@ -75,6 +87,8 @@ export default {
pageCode: state => state.bigScreen.pageInfo.code, pageCode: state => state.bigScreen.pageInfo.code,
customTheme: state => state.bigScreen.pageInfo.pageConfig.customTheme, customTheme: state => state.bigScreen.pageInfo.pageConfig.customTheme,
activeCode: state => state.bigScreen.activeCode, activeCode: state => state.bigScreen.activeCode,
activeCodes: state => state.bigScreen.activeCodes,
hoverCode: state => state.bigScreen.hoverCode,
chartList: (state) => state.bigScreen.pageInfo.chartList chartList: (state) => state.bigScreen.pageInfo.chartList
}) })
}, },
@ -96,7 +110,8 @@ export default {
...mapMutations({ ...mapMutations({
changeChartConfig: 'bigScreen/changeChartConfig', changeChartConfig: 'bigScreen/changeChartConfig',
changeActiveItemConfig: 'bigScreen/changeActiveItemConfig', changeActiveItemConfig: 'bigScreen/changeActiveItemConfig',
changeActiveCode: 'bigScreen/changeActiveCode' changeActiveCode: 'bigScreen/changeActiveCode',
changeHoverCode: 'bigScreen/changeHoverCode'
}), }),
changeStyle (config) { changeStyle (config) {
config = { ...this.config, ...config } config = { ...this.config, ...config }
@ -115,11 +130,14 @@ export default {
currentChartHandler () { currentChartHandler () {
this.changeActiveCode(this.config.customize.tabList[this.currentIndex]?.chartCode) this.changeActiveCode(this.config.customize.tabList[this.currentIndex]?.chartCode)
this.changeActiveItemConfig(this.config.customize.tabList[this.currentIndex]?.chart) this.changeActiveItemConfig(this.config.customize.tabList[this.currentIndex]?.chart)
console.log()
}, },
// // hover
openRightPanel () { changeHover (code) {
// EventBus.$emit('openRightPanel', this.currentChart) this.changeHoverCode(code)
},
//
changeActive (config) {
this.changeActiveCode(config.code)
} }
} }
} }
@ -141,6 +159,13 @@ export default {
.chart-item-box{ .chart-item-box{
width: 100%; width: 100%;
height: calc(100% - 40px); height: calc(100% - 40px);
&:hover{
cursor: pointer;
}
.configuration-wrap{
width: 100%;
height: calc(100% - 40px);
}
} }
.active{ .active{
color: var(--bs-el-color-primary) !important; color: var(--bs-el-color-primary) !important;

Loading…
Cancel
Save