diff --git a/frontend/src/components/suspensionSelector/index.vue b/frontend/src/components/suspensionSelector/index.vue new file mode 100644 index 0000000000..7182735689 --- /dev/null +++ b/frontend/src/components/suspensionSelector/index.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/frontend/src/components/widget/deWidget/inputStyleMixin.js b/frontend/src/components/widget/deWidget/inputStyleMixin.js index 0c8c2c93e4..5efdbd95d4 100644 --- a/frontend/src/components/widget/deWidget/inputStyleMixin.js +++ b/frontend/src/components/widget/deWidget/inputStyleMixin.js @@ -58,7 +58,7 @@ export default { mounted() { if (!this.isFilterComponent) return this.typeTransform().forEach(item => { - const nodeCache = this.$refs.deOutWidget.$refs[item].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[item].$el + const nodeCache = this.$refs.deOutWidget?.$refs[item].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[item].$el this.styleAttrs.forEach(ele => { nodeCache.style[this.attrsMap[ele]] = this.element.style[ele] this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(item), ele, this.element.style[ele]) @@ -70,7 +70,7 @@ export default { let nodeCache = '' this.styleAttrs.forEach(ele => { if (!nodeCache) { - nodeCache = this.$refs.deOutWidget.$refs[type].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[type].$el + nodeCache = this.$refs.deOutWidget?.$refs[type].$el.querySelector('.el-input__inner') || this.$refs.deOutWidget.$refs[type].$el } nodeCache.style[this.attrsMap[ele]] = newValue[ele] this[this.element.serviceName] && this[this.element.serviceName](this.selectRange(type), ele, newValue[ele]) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 37b9f1aed1..ab85919e2c 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -915,6 +915,7 @@ export default { password_input_error: 'Original password input error' }, chart: { + suspension: 'Suspension', chart_background: 'Component background', solid_color: 'Solid color', split_gradient: 'Split gradient', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index c08143f472..d62580b15b 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -915,6 +915,7 @@ export default { password_input_error: '原始密碼輸入錯誤' }, chart: { + suspension: '懸浮', chart_background: '組件背景', solid_color: '純色', split_gradient: '分離漸變', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 6465be6c4c..ee387a98f6 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -914,6 +914,7 @@ export default { password_input_error: '原始密码输入错误' }, chart: { + suspension: '悬浮', chart_background: '组件背景', solid_color: '纯色', split_gradient: '分离渐变', diff --git a/frontend/src/views/chart/chart/chart.js b/frontend/src/views/chart/chart/chart.js index 116da2af59..c2c3bf250a 100644 --- a/frontend/src/views/chart/chart/chart.js +++ b/frontend/src/views/chart/chart/chart.js @@ -124,6 +124,9 @@ export const DEFAULT_SIZE = { showIndex: false, indexLabel: '序号' } +export const DEFAULT_SUSPENSION = { + show: true +} export const DEFAULT_LABEL = { show: false, position: 'top', diff --git a/frontend/src/views/chart/chart/map/map.js b/frontend/src/views/chart/chart/map/map.js index 4e6e9d7da7..bf9f18311c 100644 --- a/frontend/src/views/chart/chart/map/map.js +++ b/frontend/src/views/chart/chart/map/map.js @@ -125,6 +125,11 @@ export function baseMapOption(chart_option, chart, themeStyle, curAreaCode) { if (themeStyle) { chart_option.visualMap.textStyle = { color: themeStyle } } + if (customAttr.suspension && !customAttr.suspension.show) { + chart_option.visualMap.show = false + } else if ('show' in chart_option.visualMap) { + delete chart_option.visualMap.show + } } for (let i = 0; i < valueArr.length; i++) { diff --git a/frontend/src/views/chart/chart/util.js b/frontend/src/views/chart/chart/util.js index 3773ba17b3..7550515c99 100644 --- a/frontend/src/views/chart/chart/util.js +++ b/frontend/src/views/chart/chart/util.js @@ -3073,7 +3073,8 @@ export const TYPE_CONFIGS = [ 'color-selector', 'label-selector', 'tooltip-selector', - 'title-selector' + 'title-selector', + 'suspension-selector' ], propertyInner: { @@ -3107,6 +3108,9 @@ export const TYPE_CONFIGS = [ 'vPosition', 'isItalic', 'isBolder' + ], + 'suspension-selector': [ + 'show' ] } } diff --git a/frontend/src/views/chart/components/ChartComponent.vue b/frontend/src/views/chart/components/ChartComponent.vue index 84c7849e1c..e4cfcfce24 100644 --- a/frontend/src/views/chart/components/ChartComponent.vue +++ b/frontend/src/views/chart/components/ChartComponent.vue @@ -13,7 +13,7 @@ :style="{ borderRadius: borderRadius}" />
@@ -143,7 +143,8 @@ export default { mapCenter: null, linkageActiveParam: null, buttonTextColor: null, - loading: true + loading: true, + showSuspension: true } }, @@ -318,6 +319,9 @@ export default { } if (chart.type === 'map') { const customAttr = JSON.parse(chart.customAttr) + if (customAttr.suspension) { + this.showSuspension = customAttr.suspension.show + } if (!customAttr.areaCode) { this.myChart.clear() return diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index a2928853c4..07ae672ac8 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -951,6 +951,7 @@ @onLegendChange="onLegendChange" @onMarginChange="onMarginChange" @onChangeBackgroundForm="onChangeBackgroundForm" + @onSuspensionChange="onSuspensionChange" /> + + + @@ -317,6 +330,7 @@ import LegendSelectorAntV from '@/views/chart/components/componentStyle/LegendSe import BackgroundColorSelector from '@/views/chart/components/componentStyle/BackgroundColorSelector' import SplitSelector from '@/views/chart/components/componentStyle/SplitSelector' import SplitSelectorAntV from '@/views/chart/components/componentStyle/SplitSelectorAntV' +import SuspensionSelector from '@/components/suspensionSelector' import { mapState } from 'vuex' export default { @@ -344,7 +358,8 @@ export default { SizeSelector, ColorSelector, MarginSelector, - PluginCom + PluginCom, + SuspensionSelector }, props: { chart: { @@ -422,6 +437,10 @@ export default { val['propertyName'] = propertyName this.$emit('onColorChange', val) }, + onSuspensionChange(val, propertyName) { + val['propertyName'] = propertyName + this.$emit('onSuspensionChange', val) + }, onSizeChange(val, propertyName) { val['propertyName'] = propertyName this.$emit('onSizeChange', val)