Merge pull request #3820 from dataease/pr@dev@feat_tab-active

feat(仪表板): Tab组件支持设置激活字体大小
This commit is contained in:
Junjun 2022-11-22 11:48:59 +08:00 committed by GitHub
commit dedf013830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 507 additions and 417 deletions

View File

@ -99,6 +99,30 @@
/> />
</div> </div>
<el-tooltip
v-if="attrShow('fontSize')"
:content="$t('panel.active_font_size')"
>
<i
style="float: left;margin-top: 3px;margin-left: 2px;"
class="iconfont icon-font"
/>
</el-tooltip>
<div
v-if="attrShow('activeFontSize')"
style="width: 70px;float: left;margin-top: 2px;margin-left: 2px;"
>
<el-input
v-model="initActiveFontSize"
type="number"
size="mini"
:min="miniFontSize"
:max="maxFontSize"
@change="styleChange"
/>
</div>
<el-tooltip <el-tooltip
v-if="attrShow('fontWeight')" v-if="attrShow('fontWeight')"
:content="$t('panel.fontWeight')" :content="$t('panel.fontWeight')"
@ -440,6 +464,7 @@ export default {
innerOpacity: 0, innerOpacity: 0,
mainWidthOffset: 600, mainWidthOffset: 600,
initFontSize: 12, initFontSize: 12,
initActiveFontSize: 18,
miniFontSize: 0, miniFontSize: 0,
maxFontSize: 128, maxFontSize: 128,
textAlignOptions: [ textAlignOptions: [
@ -520,6 +545,7 @@ export default {
// tab // tab
'de-tabs': [ 'de-tabs': [
'fontSize', 'fontSize',
'activeFontSize',
'borderStyle', 'borderStyle',
'borderWidth', 'borderWidth',
'borderColor', 'borderColor',
@ -623,6 +649,7 @@ export default {
handler(newVal, oldVla) { handler(newVal, oldVla) {
if (newVal.fontSize) { if (newVal.fontSize) {
this.initFontSize = newVal.fontSize this.initFontSize = newVal.fontSize
this.initActiveFontSize = newVal.activeFontSize
} }
}, },
deep: true deep: true
@ -632,6 +659,17 @@ export default {
this.styleInfo['opacity'] = this.innerOpacity / 100 this.styleInfo['opacity'] = this.innerOpacity / 100
} }
}, },
initActiveFontSize: {
handler(newVal) {
if (newVal < this.miniFontSize) {
this.styleInfo.activeFontSize = this.miniFontSize
} else if (newVal > this.maxFontSize) {
this.styleInfo.activeFontSize = this.maxFontSize
} else {
this.styleInfo.activeFontSize = newVal
}
}
},
initFontSize: { initFontSize: {
handler(newVal) { handler(newVal) {
if (newVal < this.miniFontSize) { if (newVal < this.miniFontSize) {
@ -656,6 +694,9 @@ export default {
if (this.attrShow('fontSize')) { if (this.attrShow('fontSize')) {
this.initFontSize = this.styleInfo.fontSize this.initFontSize = this.styleInfo.fontSize
} }
if (this.attrShow('activeFontSize')) {
this.initActiveFontSize = this.styleInfo.activeFontSize
}
}, },
methods: { methods: {

View File

@ -208,6 +208,7 @@ export default {
'left', 'left',
'width', 'width',
'fontSize', 'fontSize',
'activeFontSize',
'borderWidth', 'borderWidth',
'letterSpacing' 'letterSpacing'
], ],

View File

@ -94,8 +94,7 @@ export const VIDEOLINKS = {
fullscreenToggle: false, fullscreenToggle: false,
pause: false pause: false
}, },
sources: [{ sources: [{}]
}]
}, },
rtmp: { rtmp: {
sources: [{ sources: [{
@ -389,7 +388,10 @@ const list = [
borderStyle: 'solid', borderStyle: 'solid',
borderWidth: 0, borderWidth: 0,
borderColor: '#000000', borderColor: '#000000',
fontSize: 16 fontSize: 16,
activeFontSize: 18,
carouselEnable: false,
switchTime: 5
}, },
options: { options: {
tabList: [{ tabList: [{

View File

@ -103,6 +103,7 @@ export function panelDataPrepare(componentData, componentStyle, callback) {
} }
if (item.type === 'de-tabs') { if (item.type === 'de-tabs') {
item.style.fontSize = item.style.fontSize || 16 item.style.fontSize = item.style.fontSize || 16
item.style.activeFontSize = item.style.activeFontSize || 18
item.style.carouselEnable = item.style.carouselEnable || false item.style.carouselEnable = item.style.carouselEnable || false
item.style.switchTime = item.style.switchTime || 5 item.style.switchTime = item.style.switchTime || 5
} }

View File

@ -29,7 +29,7 @@
:name="item.name" :name="item.name"
> >
<span slot="label"> <span slot="label">
<span :style="titleStyle">{{ item.title }}</span> <span :style="titleStyle(item.name)">{{ item.title }}</span>
<el-dropdown <el-dropdown
v-if="dropdownShow" v-if="dropdownShow"
slot="label" slot="label"
@ -305,11 +305,6 @@ export default {
maskShow() { maskShow() {
return Boolean(this.$store.state.dragComponentInfo) return Boolean(this.$store.state.dragComponentInfo)
}, },
titleStyle() {
return {
fontSize: (this.element.style.fontSize || 16) + 'px'
}
},
headClass() { headClass() {
return 'tab-head-' + this.element.style.headPosition return 'tab-head-' + this.element.style.headPosition
}, },
@ -457,6 +452,17 @@ export default {
bus.$off('add-new-tab', this.addNewTab) bus.$off('add-new-tab', this.addNewTab)
}, },
methods: { methods: {
titleStyle(itemName) {
if (this.activeTabName === itemName) {
return {
fontSize: (this.element.style.activeFontSize || 18) + 'px'
}
} else {
return {
fontSize: (this.element.style.fontSize || 16) + 'px'
}
}
},
initCarousel() { initCarousel() {
this.timer && clearInterval(this.timer) this.timer && clearInterval(this.timer)
if (this.element.style.carouselEnable) { if (this.element.style.carouselEnable) {

View File

@ -118,14 +118,15 @@
<el-checkbox <el-checkbox
v-model="styleInfo.carouselEnable" v-model="styleInfo.carouselEnable"
size="mini" size="mini"
>{{ $('common.enable') }} @change="styleChange"
>{{ $t('commons.enable') }}
</el-checkbox> </el-checkbox>
</el-col> </el-col>
<el-col <el-col
:span="8" :span="8"
style="text-align: right;padding-right: 10px" style="text-align: right;padding-right: 10px"
> >
{{ $('panel.switch_time') }} {{ $t('panel.switch_time') }}
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<el-input <el-input
@ -135,6 +136,7 @@
size="mini" size="mini"
:min="2" :min="2"
class="hide-icon-number" class="hide-icon-number"
@change="styleChange"
> >
<template slot="append">S</template> <template slot="append">S</template>
</el-input> </el-input>

View File

@ -1875,6 +1875,7 @@ export default {
back_parent: 'Back to previous' back_parent: 'Back to previous'
}, },
panel: { panel: {
active_font_size: 'Active font size',
carousel: 'Carousel', carousel: 'Carousel',
switch_time: 'Switch time', switch_time: 'Switch time',
position_adjust: 'Position', position_adjust: 'Position',

View File

@ -1875,6 +1875,7 @@ export default {
back_parent: '返回上一級' back_parent: '返回上一級'
}, },
panel: { panel: {
active_font_size: '激活字體大小',
carousel: '輪播', carousel: '輪播',
switch_time: '切換時間', switch_time: '切換時間',
position_adjust: '位置', position_adjust: '位置',

View File

@ -1875,6 +1875,7 @@ export default {
back_parent: '返回上一级' back_parent: '返回上一级'
}, },
panel: { panel: {
active_font_size: '激活字体大小',
carousel: '轮播', carousel: '轮播',
switch_time: '切换时间', switch_time: '切换时间',
position_adjust: '位置', position_adjust: '位置',

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2459092 */ font-family: "iconfont"; /* Project id 2459092 */
src: url('iconfont.woff2?t=1668397590143') format('woff2'), src: url('iconfont.woff2?t=1669087400468') format('woff2'),
url('iconfont.woff?t=1668397590143') format('woff'), url('iconfont.woff?t=1669087400468') format('woff'),
url('iconfont.ttf?t=1668397590143') format('truetype'); url('iconfont.ttf?t=1669087400468') format('truetype');
} }
.iconfont { .iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-font:before {
content: "\e63d";
}
.icon-WATERMARK:before { .icon-WATERMARK:before {
content: "\ea16"; content: "\ea16";
} }

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,13 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "109745",
"name": "font",
"font_class": "font",
"unicode": "e63d",
"unicode_decimal": 58941
},
{ {
"icon_id": "23072499", "icon_id": "23072499",
"name": "WATERMARK", "name": "WATERMARK",

View File

@ -192,7 +192,7 @@
@command="chartFieldEdit" @command="chartFieldEdit"
> >
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<i class="el-icon-s-tools"/> <i class="el-icon-s-tools" />
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item <el-dropdown-item
@ -267,7 +267,7 @@
@command="chartFieldEdit" @command="chartFieldEdit"
> >
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<i class="el-icon-s-tools"/> <i class="el-icon-s-tools" />
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item <el-dropdown-item
@ -362,7 +362,7 @@
style="padding: 6px;" style="padding: 6px;"
> >
{{ $t('chart.change_chart_type') }} {{ $t('chart.change_chart_type') }}
<i class="el-icon-caret-bottom"/> <i class="el-icon-caret-bottom" />
</el-button> </el-button>
</el-popover> </el-popover>
</span> </span>
@ -490,8 +490,8 @@
> >
<span class="data-area-label"> <span class="data-area-label">
<span v-if="view.type && view.type.includes('table')">{{ <span v-if="view.type && view.type.includes('table')">{{
$t('chart.drag_block_table_data_column') $t('chart.drag_block_table_data_column')
}}</span> }}</span>
<span <span
v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'chart-mix' || view.type === 'waterfall' || view.type === 'area')" v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'chart-mix' || view.type === 'waterfall' || view.type === 'area')"
>{{ $t('chart.drag_block_type_axis') }}</span> >{{ $t('chart.drag_block_type_axis') }}</span>
@ -499,18 +499,18 @@
v-else-if="view.type && view.type.includes('pie')" v-else-if="view.type && view.type.includes('pie')"
>{{ $t('chart.drag_block_pie_label') }}</span> >{{ $t('chart.drag_block_pie_label') }}</span>
<span v-else-if="view.type && view.type.includes('funnel')">{{ <span v-else-if="view.type && view.type.includes('funnel')">{{
$t('chart.drag_block_funnel_split') $t('chart.drag_block_funnel_split')
}}</span> }}</span>
<span v-else-if="view.type && view.type.includes('radar')">{{ <span v-else-if="view.type && view.type.includes('radar')">{{
$t('chart.drag_block_radar_label') $t('chart.drag_block_radar_label')
}}</span> }}</span>
<span v-else-if="view.type && view.type === 'map'">{{ $t('chart.area') }}</span> <span v-else-if="view.type && view.type === 'map'">{{ $t('chart.area') }}</span>
<span v-else-if="view.type && view.type.includes('treemap')">{{ <span v-else-if="view.type && view.type.includes('treemap')">{{
$t('chart.drag_block_treemap_label') $t('chart.drag_block_treemap_label')
}}</span> }}</span>
<span v-else-if="view.type && view.type === 'word-cloud'">{{ <span v-else-if="view.type && view.type === 'word-cloud'">{{
$t('chart.drag_block_word_cloud_label') $t('chart.drag_block_word_cloud_label')
}}</span> }}</span>
<span v-else-if="view.type && view.type === 'label'">{{ $t('chart.drag_block_label') }}</span> <span v-else-if="view.type && view.type === 'label'">{{ $t('chart.drag_block_label') }}</span>
<span v-show="view.type !== 'richTextView'"> / </span> <span v-show="view.type !== 'richTextView'"> / </span>
<span v-if="view.type && view.type !== 'table-info'">{{ $t('chart.dimension') }}</span> <span v-if="view.type && view.type !== 'table-info'">{{ $t('chart.dimension') }}</span>
@ -633,8 +633,8 @@
> >
<span class="data-area-label"> <span class="data-area-label">
<span v-if="view.type && view.type.includes('table')">{{ <span v-if="view.type && view.type.includes('table')">{{
$t('chart.drag_block_table_data_column') $t('chart.drag_block_table_data_column')
}}</span> }}</span>
<span <span
v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'waterfall' || view.type === 'area')" v-else-if="view.type && (view.type.includes('bar') || view.type.includes('line') || view.type.includes('scatter') || view.type === 'waterfall' || view.type === 'area')"
>{{ $t('chart.drag_block_value_axis') }}</span> >{{ $t('chart.drag_block_value_axis') }}</span>
@ -642,30 +642,30 @@
v-else-if="view.type && view.type.includes('pie')" v-else-if="view.type && view.type.includes('pie')"
>{{ $t('chart.drag_block_pie_angel') }}</span> >{{ $t('chart.drag_block_pie_angel') }}</span>
<span v-else-if="view.type && view.type.includes('funnel')">{{ <span v-else-if="view.type && view.type.includes('funnel')">{{
$t('chart.drag_block_funnel_width') $t('chart.drag_block_funnel_width')
}}</span> }}</span>
<span v-else-if="view.type && view.type.includes('radar')">{{ <span v-else-if="view.type && view.type.includes('radar')">{{
$t('chart.drag_block_radar_length') $t('chart.drag_block_radar_length')
}}</span> }}</span>
<span v-else-if="view.type && view.type.includes('gauge')">{{ <span v-else-if="view.type && view.type.includes('gauge')">{{
$t('chart.drag_block_gauge_angel') $t('chart.drag_block_gauge_angel')
}}</span> }}</span>
<span <span
v-else-if="view.type && view.type.includes('text')" v-else-if="view.type && view.type.includes('text')"
>{{ $t('chart.drag_block_label_value') }}</span> >{{ $t('chart.drag_block_label_value') }}</span>
<span v-else-if="view.type && view.type === 'map'">{{ $t('chart.chart_data') }}</span> <span v-else-if="view.type && view.type === 'map'">{{ $t('chart.chart_data') }}</span>
<span v-else-if="view.type && view.type.includes('tree')">{{ <span v-else-if="view.type && view.type.includes('tree')">{{
$t('chart.drag_block_treemap_size') $t('chart.drag_block_treemap_size')
}}</span> }}</span>
<span v-else-if="view.type && view.type === 'chart-mix'">{{ <span v-else-if="view.type && view.type === 'chart-mix'">{{
$t('chart.drag_block_value_axis_main') $t('chart.drag_block_value_axis_main')
}}</span> }}</span>
<span <span
v-else-if="view.type && view.type === 'liquid'" v-else-if="view.type && view.type === 'liquid'"
>{{ $t('chart.drag_block_progress') }}</span> >{{ $t('chart.drag_block_progress') }}</span>
<span v-else-if="view.type && view.type === 'word-cloud'">{{ <span v-else-if="view.type && view.type === 'word-cloud'">{{
$t('chart.drag_block_word_cloud_size') $t('chart.drag_block_word_cloud_size')
}}</span> }}</span>
<span v-show="view.type !== 'richTextView'"> / </span> <span v-show="view.type !== 'richTextView'"> / </span>
<span>{{ $t('chart.quota') }}</span> <span>{{ $t('chart.quota') }}</span>
<i <i
@ -1116,7 +1116,7 @@
class="padding-tab" class="padding-tab"
style="width: 350px;" style="width: 350px;"
> >
<position-adjust/> <position-adjust />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -1268,7 +1268,7 @@
width="800px" width="800px"
class="dialog-css" class="dialog-css"
> >
<quota-filter-editor :item="quotaItem"/> <quota-filter-editor :item="quotaItem" />
<div <div
slot="footer" slot="footer"
class="dialog-footer" class="dialog-footer"
@ -1295,7 +1295,7 @@
width="800px" width="800px"
class="dialog-css" class="dialog-css"
> >
<dimension-filter-editor :item="dimensionItem"/> <dimension-filter-editor :item="dimensionItem" />
<div <div
slot="footer" slot="footer"
class="dialog-footer" class="dialog-footer"