forked from github/dataease
refactor(仪表板): 修改Tab轮播设置位置
This commit is contained in:
parent
6a7e597c14
commit
7359568d75
@ -66,6 +66,12 @@
|
|||||||
@click.native="linkageSetting"
|
@click.native="linkageSetting"
|
||||||
>{{ $t('panel.linkage_setting') }}
|
>{{ $t('panel.linkage_setting') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item
|
||||||
|
v-if="tabCarouselShow"
|
||||||
|
icon="el-icon-switch-button"
|
||||||
|
@click.native="tabCarouselSet"
|
||||||
|
>{{ $t('panel.carousel') }}
|
||||||
|
</el-dropdown-item>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
v-if="'de-tabs'===curComponent.type"
|
v-if="'de-tabs'===curComponent.type"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@ -115,6 +121,21 @@
|
|||||||
/>
|
/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!--tab 轮播设计-->
|
||||||
|
<el-dialog
|
||||||
|
:visible.sync="tabCarouselVisible"
|
||||||
|
width="400px"
|
||||||
|
class="dialog-css"
|
||||||
|
:destroy-on-close="true"
|
||||||
|
:append-to-body="true"
|
||||||
|
:show-close="true"
|
||||||
|
>
|
||||||
|
<TabCarouselDialog
|
||||||
|
v-if="tabCarouselVisible"
|
||||||
|
@onClose="tabCarouselVisible = false"
|
||||||
|
/>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-if="showCustomSort"
|
v-if="showCustomSort"
|
||||||
v-dialogDrag
|
v-dialogDrag
|
||||||
@ -155,12 +176,14 @@ import { mapState } from 'vuex'
|
|||||||
import bus from '@/utils/bus'
|
import bus from '@/utils/bus'
|
||||||
import { getViewLinkageGather } from '@/api/panel/linkage'
|
import { getViewLinkageGather } from '@/api/panel/linkage'
|
||||||
import HyperlinksDialog from '@/components/canvas/components/editor/HyperlinksDialog'
|
import HyperlinksDialog from '@/components/canvas/components/editor/HyperlinksDialog'
|
||||||
|
import TabCarouselDialog from '@/components/canvas/components/editor/TabCarouselDialog'
|
||||||
import CustomTabsSort from '@/components/widget/deWidget/CustomTabsSort'
|
import CustomTabsSort from '@/components/widget/deWidget/CustomTabsSort'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { CustomTabsSort, HyperlinksDialog },
|
components: { CustomTabsSort, HyperlinksDialog,TabCarouselDialog },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
tabCarouselVisible: false,
|
||||||
systemOS: 'Mac',
|
systemOS: 'Mac',
|
||||||
showCustomSort: false,
|
showCustomSort: false,
|
||||||
jumpExcludeViewType: [
|
jumpExcludeViewType: [
|
||||||
@ -189,6 +212,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
tabCarouselShow() {
|
||||||
|
return this.curComponent.type === 'de-tabs'
|
||||||
|
},
|
||||||
linkJumpSetShow() {
|
linkJumpSetShow() {
|
||||||
return this.curComponent.type === 'view' &&
|
return this.curComponent.type === 'view' &&
|
||||||
!this.jumpExcludeViewType.includes(this.curComponent.propValue.innerType) &&
|
!this.jumpExcludeViewType.includes(this.curComponent.propValue.innerType) &&
|
||||||
@ -340,7 +366,12 @@ export default {
|
|||||||
// 超链接设置
|
// 超链接设置
|
||||||
hyperlinksSet() {
|
hyperlinksSet() {
|
||||||
this.hyperlinksSetVisible = true
|
this.hyperlinksSetVisible = true
|
||||||
|
},
|
||||||
|
// 轮播设置
|
||||||
|
tabCarouselSet() {
|
||||||
|
this.tabCarouselVisible = true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -0,0 +1,127 @@
|
|||||||
|
<template>
|
||||||
|
<el-row>
|
||||||
|
<el-form
|
||||||
|
ref="form"
|
||||||
|
size="mini"
|
||||||
|
label-width="70px"
|
||||||
|
>
|
||||||
|
<el-form-item :label="$t('panel.enable_carousel')">
|
||||||
|
<el-switch
|
||||||
|
v-model="carouselEnable"
|
||||||
|
size="mini"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('panel.switch_time')">
|
||||||
|
<el-input
|
||||||
|
v-model="switchTime"
|
||||||
|
:disabled="!carouselEnable"
|
||||||
|
type="number"
|
||||||
|
size="mini"
|
||||||
|
:min="2"
|
||||||
|
:max="3600"
|
||||||
|
class="hide-icon-number number-padding"
|
||||||
|
@change="switchTimeChange"
|
||||||
|
>
|
||||||
|
<template slot="append">S</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="onSubmit"
|
||||||
|
>{{ $t('panel.confirm') }}</el-button>
|
||||||
|
<el-button @click="onClose">{{ $t('panel.cancel') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
carouselEnable: false,
|
||||||
|
switchTime: 50
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState([
|
||||||
|
'curComponent'
|
||||||
|
])
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.carouselEnable = this.curComponent.style.carouselEnable
|
||||||
|
this.switchTime = this.curComponent.style.switchTime
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
switchTimeChange() {
|
||||||
|
if (!this.switchTime || this.switchTime < 2) {
|
||||||
|
this.switchTime = 2
|
||||||
|
} else if (this.switchTime && this.switchTime > 3600) {
|
||||||
|
this.switchTime = 3600
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onSubmit() {
|
||||||
|
this.curComponent.style.carouselEnable = this.carouselEnable
|
||||||
|
this.curComponent.style.switchTime = this.switchTime
|
||||||
|
this.$store.commit('canvasChange')
|
||||||
|
this.onClose()
|
||||||
|
},
|
||||||
|
onClose() {
|
||||||
|
this.$emit('onClose')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.slot-class{
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
margin-top: 20px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
.ellip{
|
||||||
|
/*width: 100%;*/
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
overflow: hidden;/*超出部分隐藏*/
|
||||||
|
white-space: nowrap;/*不换行*/
|
||||||
|
text-overflow:ellipsis;/*超出部分文字以...显示*/
|
||||||
|
background-color: #f7f8fa;
|
||||||
|
color: #3d4d66;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 24px;
|
||||||
|
height: 24px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-filed{
|
||||||
|
/*width: 100%;*/
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
|
overflow: hidden;/*超出部分隐藏*/
|
||||||
|
white-space: nowrap;/*不换行*/
|
||||||
|
text-overflow:ellipsis;/*超出部分文字以...显示*/
|
||||||
|
color: #3d4d66;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 35px;
|
||||||
|
height: 35px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
::v-deep .el-popover{
|
||||||
|
height: 200px;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
.icon-font{
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
@ -112,39 +112,6 @@
|
|||||||
<el-radio-button label="right">{{ $t('chart.text_pos_right') }}</el-radio-button>
|
<el-radio-button label="right">{{ $t('chart.text_pos_right') }}</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('panel.carousel')">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-checkbox
|
|
||||||
v-model="styleInfo.carouselEnable"
|
|
||||||
size="mini"
|
|
||||||
@change="styleChange"
|
|
||||||
>{{ $t('commons.enable') }}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-col>
|
|
||||||
<el-col
|
|
||||||
:span="8"
|
|
||||||
style="text-align: right;padding-right: 10px"
|
|
||||||
>
|
|
||||||
{{ $t('panel.switch_time') }}
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="10">
|
|
||||||
<el-input
|
|
||||||
v-model="styleInfo.switchTime"
|
|
||||||
:disabled="!styleInfo.carouselEnable"
|
|
||||||
type="number"
|
|
||||||
size="mini"
|
|
||||||
:min="2"
|
|
||||||
:max="3600"
|
|
||||||
class="hide-icon-number number-padding"
|
|
||||||
@change="switchTimeChange"
|
|
||||||
>
|
|
||||||
<template slot="append">S</template>
|
|
||||||
</el-input>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
</el-row>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
<i
|
<i
|
||||||
slot="reference"
|
slot="reference"
|
||||||
@ -181,14 +148,6 @@ export default {
|
|||||||
const current = this.$refs[pickKey]
|
const current = this.$refs[pickKey]
|
||||||
current && (current.showPicker = true)
|
current && (current.showPicker = true)
|
||||||
},
|
},
|
||||||
switchTimeChange() {
|
|
||||||
if (!this.styleInfo.switchTime || this.styleInfo.switchTime < 2) {
|
|
||||||
this.styleInfo.switchTime = 2
|
|
||||||
} else if (this.styleInfo.switchTime && this.styleInfo.switchTime > 3600) {
|
|
||||||
this.styleInfo.switchTime = 3600
|
|
||||||
}
|
|
||||||
this.styleChange()
|
|
||||||
},
|
|
||||||
styleChange() {
|
styleChange() {
|
||||||
this.$store.commit('canvasChange')
|
this.$store.commit('canvasChange')
|
||||||
}
|
}
|
||||||
|
@ -2001,6 +2001,7 @@ export default {
|
|||||||
position_adjust_component: 'Position adjust',
|
position_adjust_component: 'Position adjust',
|
||||||
active_font_size: 'Selected font size',
|
active_font_size: 'Selected font size',
|
||||||
carousel: 'Carousel',
|
carousel: 'Carousel',
|
||||||
|
enable_carousel: 'Enable Carousel',
|
||||||
switch_time: 'Switch time',
|
switch_time: 'Switch time',
|
||||||
position_adjust: 'Position',
|
position_adjust: 'Position',
|
||||||
space_top: 'Top',
|
space_top: 'Top',
|
||||||
|
@ -1995,6 +1995,7 @@ export default {
|
|||||||
position_adjust_component: '位置調整',
|
position_adjust_component: '位置調整',
|
||||||
active_font_size: '选中字體大小',
|
active_font_size: '选中字體大小',
|
||||||
carousel: '輪播',
|
carousel: '輪播',
|
||||||
|
enable_carousel: '啟用輪播',
|
||||||
switch_time: '切換時間',
|
switch_time: '切換時間',
|
||||||
position_adjust: '位置',
|
position_adjust: '位置',
|
||||||
space_top: '上',
|
space_top: '上',
|
||||||
|
@ -2012,6 +2012,7 @@ export default {
|
|||||||
position_adjust_component: '位置调整',
|
position_adjust_component: '位置调整',
|
||||||
active_font_size: '选中字体大小',
|
active_font_size: '选中字体大小',
|
||||||
carousel: '轮播',
|
carousel: '轮播',
|
||||||
|
enable_carousel: '启用轮播',
|
||||||
switch_time: '切换时间',
|
switch_time: '切换时间',
|
||||||
position_adjust: '位置',
|
position_adjust: '位置',
|
||||||
space_top: '上',
|
space_top: '上',
|
||||||
|
Loading…
Reference in New Issue
Block a user