From a85578ff7a78d401719c0dad086145a6b904b64c Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Sun, 18 Feb 2024 18:21:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=BE=E5=BD=A2=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/assets/svg/graphical-circular.svg | 1 + .../src/assets/svg/graphical-rect.svg | 1 + .../src/assets/svg/graphical-triangle.svg | 1 + .../src/assets/svg/icon_graphical.svg | 1 + .../common/ComponentConfig.ts | 25 ++ .../component-group/CommonGroup.vue | 2 +- .../src/custom-component/component-list.ts | 20 ++ .../custom-component/de-graphical/Attr.vue | 268 ++++++++++++++++++ .../de-graphical/Component.vue | 38 +++ core/core-frontend/src/utils/components.ts | 6 +- 10 files changed, 361 insertions(+), 2 deletions(-) create mode 100644 core/core-frontend/src/assets/svg/graphical-circular.svg create mode 100644 core/core-frontend/src/assets/svg/graphical-rect.svg create mode 100644 core/core-frontend/src/assets/svg/graphical-triangle.svg create mode 100644 core/core-frontend/src/assets/svg/icon_graphical.svg create mode 100644 core/core-frontend/src/custom-component/de-graphical/Attr.vue create mode 100644 core/core-frontend/src/custom-component/de-graphical/Component.vue diff --git a/core/core-frontend/src/assets/svg/graphical-circular.svg b/core/core-frontend/src/assets/svg/graphical-circular.svg new file mode 100644 index 0000000000..cdffe094ac --- /dev/null +++ b/core/core-frontend/src/assets/svg/graphical-circular.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/core/core-frontend/src/assets/svg/graphical-rect.svg b/core/core-frontend/src/assets/svg/graphical-rect.svg new file mode 100644 index 0000000000..75aacdddec --- /dev/null +++ b/core/core-frontend/src/assets/svg/graphical-rect.svg @@ -0,0 +1 @@ + diff --git a/core/core-frontend/src/assets/svg/graphical-triangle.svg b/core/core-frontend/src/assets/svg/graphical-triangle.svg new file mode 100644 index 0000000000..74a6439cb7 --- /dev/null +++ b/core/core-frontend/src/assets/svg/graphical-triangle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/core/core-frontend/src/assets/svg/icon_graphical.svg b/core/core-frontend/src/assets/svg/icon_graphical.svg new file mode 100644 index 0000000000..78871f64c9 --- /dev/null +++ b/core/core-frontend/src/assets/svg/icon_graphical.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/core/core-frontend/src/custom-component/common/ComponentConfig.ts b/core/core-frontend/src/custom-component/common/ComponentConfig.ts index 4c3d54ab29..36f712596b 100644 --- a/core/core-frontend/src/custom-component/common/ComponentConfig.ts +++ b/core/core-frontend/src/custom-component/common/ComponentConfig.ts @@ -60,6 +60,31 @@ export const CANVAS_MATERIAL = [ } ] }, + { + category: 'DeGraphical', + title: '图形', + span: 8, + details: [ + { + value: 'rect', + type: 'graphical', + title: '矩形', + icon: 'graphical-rect' + }, + { + value: 'triangle', + type: 'graphical', + title: '三角形', + icon: 'graphical-triangle' + }, + { + value: 'circular', + type: 'graphical', + title: '圆形', + icon: 'graphical-circular' + } + ] + }, { category: 'CanvasIcon', title: '图标', diff --git a/core/core-frontend/src/custom-component/component-group/CommonGroup.vue b/core/core-frontend/src/custom-component/component-group/CommonGroup.vue index e965ec7099..f4cc1f701d 100644 --- a/core/core-frontend/src/custom-component/component-group/CommonGroup.vue +++ b/core/core-frontend/src/custom-component/component-group/CommonGroup.vue @@ -86,7 +86,7 @@ const groupActiveChange = category => { :data-id="groupInfo.category + '&' + chartInfo.value" > diff --git a/core/core-frontend/src/custom-component/component-list.ts b/core/core-frontend/src/custom-component/component-list.ts index d2c788cfd0..f0e688753a 100644 --- a/core/core-frontend/src/custom-component/component-list.ts +++ b/core/core-frontend/src/custom-component/component-list.ts @@ -181,6 +181,26 @@ const list = [ color: '' } }, + { + component: 'DeGraphical', + name: '图形', + label: '图形', + propValue: '', + icon: 'icon_graphical', + innerType: '', + editing: false, + canvasActive: false, + x: 1, + y: 1, + sizeX: 15, + sizeY: 15, + style: { + width: 300, + height: 200, + color: '#000000', + board: 1 + } + }, { component: 'DeTabs', name: '选项卡', diff --git a/core/core-frontend/src/custom-component/de-graphical/Attr.vue b/core/core-frontend/src/custom-component/de-graphical/Attr.vue new file mode 100644 index 0000000000..ff1c824d1c --- /dev/null +++ b/core/core-frontend/src/custom-component/de-graphical/Attr.vue @@ -0,0 +1,268 @@ + + + + + { + e.target.value = '' + } + " + @change="reUpload" + /> + + + + + + + + + + + + + 支持JPG、PNG、GIF + + + + 重新上传 + + + + + + + + diff --git a/core/core-frontend/src/custom-component/de-graphical/Component.vue b/core/core-frontend/src/custom-component/de-graphical/Component.vue new file mode 100644 index 0000000000..956c32c325 --- /dev/null +++ b/core/core-frontend/src/custom-component/de-graphical/Component.vue @@ -0,0 +1,38 @@ + + + + + + + + + + + diff --git a/core/core-frontend/src/utils/components.ts b/core/core-frontend/src/utils/components.ts index 9d122a7a91..45610af6ec 100644 --- a/core/core-frontend/src/utils/components.ts +++ b/core/core-frontend/src/utils/components.ts @@ -13,6 +13,8 @@ import CanvasIcon from '@/custom-component/canvas-icon/Component.vue' import CanvasIconAttr from '@/custom-component/canvas-icon/Attr.vue' import DeTabs from '@/custom-component/de-tabs/Component.vue' import DeTabsAttr from '@/custom-component/de-tabs/Attr.vue' +import DeGraphical from '@/custom-component/de-graphical/Component.vue' +import DeGraphicalAttr from '@/custom-component/de-graphical/Attr.vue' export const componentsMap = { VText: VText, @@ -29,7 +31,9 @@ export const componentsMap = { CanvasIcon: CanvasIcon, CanvasIconAttr: CanvasIconAttr, DeTabs: DeTabs, - DeTabsAttr: DeTabsAttr + DeTabsAttr: DeTabsAttr, + DeGraphical: DeGraphical, + DeGraphicalAttr: DeGraphicalAttr } export default function findComponent(key) {