diff --git a/core/core-frontend/src/assets/svg/graphical-rect.svg b/core/core-frontend/src/assets/svg/graphical-rect.svg index 75aacdddec..1bbb69c54f 100644 --- a/core/core-frontend/src/assets/svg/graphical-rect.svg +++ b/core/core-frontend/src/assets/svg/graphical-rect.svg @@ -1 +1 @@ - + diff --git a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue index 86245c8ca3..0d3d2e175a 100644 --- a/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue +++ b/core/core-frontend/src/components/data-visualization/canvas/CanvasCore.vue @@ -189,7 +189,8 @@ const start = ref({ const width = ref(0) const height = ref(0) const isShowArea = ref(false) -const svgFilterAttrs = ['width', 'height', 'top', 'left', 'rotate'] +const svgFilterAttrs = ['width', 'height', 'top', 'left', 'rotate', 'backgroundColor'] +const commonFilterAttrs = ['width', 'height', 'top', 'left', 'rotate'] const userViewEnlargeRef = ref(null) const linkJumpRef = ref(null) const linkageRef = ref(null) @@ -507,6 +508,10 @@ const handleContextMenu = e => { } const getComponentStyle = style => { + return getStyle(style, commonFilterAttrs) +} + +const getSvgComponentStyle = style => { return getStyle(style, svgFilterAttrs) } @@ -1450,7 +1455,23 @@ defineExpose({ :dv-info="dvInfo" :canvas-active="canvasActive" /> - + { } const getComponentStyleDefault = style => { - return getStyle(style, ['top', 'left', 'width', 'height', 'rotate']) + if (config.value.component.includes('Svg')) { + return getStyle(style, ['top', 'left', 'width', 'height', 'rotate', 'backgroundColor']) + } else { + return getStyle(style, ['top', 'left', 'width', 'height', 'rotate']) + } } const onMouseEnter = () => { diff --git a/core/core-frontend/src/custom-component/common/ComponentConfig.ts b/core/core-frontend/src/custom-component/common/ComponentConfig.ts index d01e99c0d0..e33896835e 100644 --- a/core/core-frontend/src/custom-component/common/ComponentConfig.ts +++ b/core/core-frontend/src/custom-component/common/ComponentConfig.ts @@ -71,6 +71,12 @@ export const CANVAS_MATERIAL = [ title: '矩形', icon: 'graphical-rect' }, + { + value: 'SvgTriangle', + type: 'graphical', + title: '三角形', + icon: 'graphical-triangle' + }, { value: 'CircleShape', type: 'graphical', diff --git a/core/core-frontend/src/custom-component/component-list.ts b/core/core-frontend/src/custom-component/component-list.ts index 4c807295aa..692de5b6a9 100644 --- a/core/core-frontend/src/custom-component/component-list.ts +++ b/core/core-frontend/src/custom-component/component-list.ts @@ -190,11 +190,11 @@ const list = [ style: { width: 200, height: 200, - borderColor: '#000', borderWidth: 1, - backgroundColor: '', + borderRadius: 5, borderStyle: 'solid', - borderRadius: 5 + borderColor: '#000', + backgroundColor: '' } }, { @@ -206,9 +206,9 @@ const list = [ style: { width: 200, height: 200, - borderColor: '#000', borderWidth: 1, borderStyle: 'solid', + borderColor: '#000', backgroundColor: '' } }, @@ -221,9 +221,9 @@ const list = [ style: { width: 200, height: 200, - borderColor: '#000', borderWidth: 1, - backgroundColor: '' + borderColor: '#000', + backgroundColor: 'rgba(236,231,231,0.1)' } }, { diff --git a/core/core-frontend/src/custom-component/svgs/svg-star/Component.vue b/core/core-frontend/src/custom-component/svgs/svg-star/Component.vue index 7294694f31..2ae7a2a647 100644 --- a/core/core-frontend/src/custom-component/svgs/svg-star/Component.vue +++ b/core/core-frontend/src/custom-component/svgs/svg-star/Component.vue @@ -6,7 +6,7 @@ :points="points" :stroke="element.style.borderColor" :fill="element.style.backgroundColor" - stroke-width="1" + :stroke-width="element.style.borderWidth" /> diff --git a/core/core-frontend/src/custom-component/svgs/svg-triangle/Component.vue b/core/core-frontend/src/custom-component/svgs/svg-triangle/Component.vue index af4263b29b..2aaaddc3e8 100644 --- a/core/core-frontend/src/custom-component/svgs/svg-triangle/Component.vue +++ b/core/core-frontend/src/custom-component/svgs/svg-triangle/Component.vue @@ -1,15 +1,14 @@ diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index fbb30aba60..8a58280f51 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -2000,7 +2000,7 @@ export default { borderStyle: '边框风格', borderWidth: '边框宽度', borderColor: '边框颜色', - borderRadius: '边框半径', + borderRadius: '圆角', fontSize: '字体大小', fontWeight: '字体粗细', lineHeight: '行高', diff --git a/core/core-frontend/src/utils/attr.ts b/core/core-frontend/src/utils/attr.ts index 341020af27..1ff4c624c8 100644 --- a/core/core-frontend/src/utils/attr.ts +++ b/core/core-frontend/src/utils/attr.ts @@ -11,7 +11,7 @@ export const styleData = [ { key: 'borderWidth', label: '边框宽度', min: 0, max: 20, step: 1 }, { key: 'borderStyle', label: '边框风格' }, { key: 'borderColor', label: '边框颜色' }, - { key: 'borderRadius', label: '边框半径', min: 0, max: 50, step: 1 }, + { key: 'borderRadius', label: '圆角', min: 0, max: 50, step: 1 }, { key: 'letterSpacing', label: '字间距', min: 0, max: 50, step: 1 }, { key: 'fontSize', label: '字体大小', min: 0, max: 128, step: 1 }, { key: 'activeFontSize', label: '激活字体大小', min: 0, max: 128, step: 1 }, @@ -38,7 +38,7 @@ export const styleMap = { borderWidth: '边框宽度', borderStyle: '边框风格', borderColor: '边框颜色', - borderRadius: '边框半径', + borderRadius: '圆角', fontSize: '字体大小', fontWeight: '字体粗细', lineHeight: '行高', diff --git a/core/core-frontend/src/utils/canvasStyle.ts b/core/core-frontend/src/utils/canvasStyle.ts index 9fc8318a06..80a846696a 100644 --- a/core/core-frontend/src/utils/canvasStyle.ts +++ b/core/core-frontend/src/utils/canvasStyle.ts @@ -381,7 +381,9 @@ export function adaptCurThemeCommonStyle(component) { // 背景融合-Begin 如果是大屏['CanvasBoard', 'CanvasIcon', 'Picture']组件不需要设置背景 if ( dvMainStore.dvInfo.type === 'dataV' && - ['CanvasBoard', 'CanvasIcon', 'Picture', 'Group'].includes(component.component) + ['CanvasBoard', 'CanvasIcon', 'Picture', 'Group', 'SvgTriangle', 'SvgStar'].includes( + component.component + ) ) { component.commonBackground['backgroundColorSelect'] = false component.commonBackground['innerPadding'] = 0 diff --git a/core/core-frontend/src/views/visualized/view/panel/filter-config/index.vue b/core/core-frontend/src/views/visualized/view/panel/filter-config/index.vue index 0cc63e3081..cdf76e24a6 100644 --- a/core/core-frontend/src/views/visualized/view/panel/filter-config/index.vue +++ b/core/core-frontend/src/views/visualized/view/panel/filter-config/index.vue @@ -284,7 +284,7 @@ const handleTabClick = () => {
- 边框半径 + 圆角