From ac3e4b0a400c86d47031b4c239b79f9ccb8124a6 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Sun, 29 Sep 2024 16:49:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E7=BB=84=E7=BB=84=E4=BB=B6=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/dashboard/DbToolbar.vue | 2 +- .../custom-component/common/CommonAttr.vue | 2 +- .../component-group/MediaGroup.vue | 27 +- .../custom-component/picture-group/Attr.vue | 205 ++-------- .../picture-group/PictureGroupUploadAttr.vue | 358 ++++++++++++++++++ core/core-frontend/src/utils/components.ts | 4 +- .../editor/editor-style/ChartStyle.vue | 6 +- .../chart/components/editor/util/chart.ts | 9 +- .../src/views/dashboard/index.vue | 4 +- 9 files changed, 423 insertions(+), 194 deletions(-) create mode 100644 core/core-frontend/src/custom-component/picture-group/PictureGroupUploadAttr.vue diff --git a/core/core-frontend/src/components/dashboard/DbToolbar.vue b/core/core-frontend/src/components/dashboard/DbToolbar.vue index 6fe5928131..a07689c3e0 100644 --- a/core/core-frontend/src/components/dashboard/DbToolbar.vue +++ b/core/core-frontend/src/components/dashboard/DbToolbar.vue @@ -531,7 +531,7 @@ const initOpenHandler = newWindow => { is-label themes="light" placement="bottom" - :base-width="315" + :base-width="328" :icon-name="dvMedia" title="媒体" > diff --git a/core/core-frontend/src/custom-component/common/CommonAttr.vue b/core/core-frontend/src/custom-component/common/CommonAttr.vue index 6b72fd10dc..87c81a24c7 100644 --- a/core/core-frontend/src/custom-component/common/CommonAttr.vue +++ b/core/core-frontend/src/custom-component/common/CommonAttr.vue @@ -143,7 +143,7 @@ const stopEvent = e => { - + { - eventBus.emit('handleNew', { componentName: params, innerType: params }) +const newComponent = (componentName, innerType) => { + eventBus.emit('handleNew', { componentName: componentName, innerType: innerType }) } const handleDragStart = e => { @@ -47,25 +48,36 @@ const handleDragEnd = e => { @@ -73,6 +85,9 @@ const handleDragEnd = e => { diff --git a/core/core-frontend/src/custom-component/picture-group/Attr.vue b/core/core-frontend/src/custom-component/picture-group/Attr.vue index a318a73ae0..1294c54542 100644 --- a/core/core-frontend/src/custom-component/picture-group/Attr.vue +++ b/core/core-frontend/src/custom-component/picture-group/Attr.vue @@ -1,200 +1,47 @@ diff --git a/core/core-frontend/src/utils/components.ts b/core/core-frontend/src/utils/components.ts index 3d35be10a9..e12329c4ac 100644 --- a/core/core-frontend/src/utils/components.ts +++ b/core/core-frontend/src/utils/components.ts @@ -85,8 +85,8 @@ export default function findComponent(key) { export function findComponentAttr(component) { const key = - component.component === 'UserView' && component.innerType === 'Picture' - ? 'PictureAttr' + component.component === 'UserView' && component.innerType === 'picture-group' + ? 'PictureGroupAttr' : component.component + 'Attr' return componentsMap[key] } diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue index 2dbcd972fd..a019c5976b 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/ChartStyle.vue @@ -28,7 +28,7 @@ import FlowMapLineSelector from '@/views/chart/components/editor/editor-style/co import FlowMapPointSelector from '@/views/chart/components/editor/editor-style/components/FlowMapPointSelector.vue' import CommonEvent from '@/custom-component/common/CommonEvent.vue' import CommonBorderSetting from '@/custom-component/common/CommonBorderSetting.vue' -import PictureGroupAttr from '@/custom-component/picture-group/Attr.vue' +import PictureGroupUploadAttr from '@/custom-component/picture-group/PictureGroupUploadAttr.vue' const dvMainStore = dvMainStoreWithOut() const { dvInfo, batchOptStatus, curComponent } = storeToRefs(dvMainStore) @@ -609,11 +609,11 @@ watch( @onChangeYAxisExtForm="onChangeYAxisExtForm" /> - + > diff --git a/core/core-frontend/src/views/chart/components/editor/util/chart.ts b/core/core-frontend/src/views/chart/components/editor/util/chart.ts index bfb2fc71db..7a5f2da107 100644 --- a/core/core-frontend/src/views/chart/components/editor/util/chart.ts +++ b/core/core-frontend/src/views/chart/components/editor/util/chart.ts @@ -1494,7 +1494,7 @@ export const CHART_TYPE_CONFIGS = [ }, { category: 'other', - title: '富文本', + title: '其他', display: 'hidden', details: [ { @@ -1503,6 +1503,13 @@ export const CHART_TYPE_CONFIGS = [ value: 'rich-text', title: '富文本', icon: 'rich-text' + }, + { + render: 'custom', + category: 'quota', + value: 'picture-group', + title: '图片组', + icon: 'picture-group' } ] } diff --git a/core/core-frontend/src/views/dashboard/index.vue b/core/core-frontend/src/views/dashboard/index.vue index 2bfd794681..ce663078bf 100644 --- a/core/core-frontend/src/views/dashboard/index.vue +++ b/core/core-frontend/src/views/dashboard/index.vue @@ -80,7 +80,7 @@ const otherEditorShow = computed(() => { curComponent.value && (!['UserView', 'VQuery'].includes(curComponent.value?.component) || (curComponent.value?.component === 'UserView' && - curComponent.value?.innerType === 'Picture')) && + curComponent.value?.innerType === 'picture-group')) && !batchOptStatus.value ) }) @@ -93,7 +93,7 @@ const viewEditorShow = computed(() => { return Boolean( curComponent.value && ['UserView', 'VQuery'].includes(curComponent.value.component) && - curComponent.value.innerType !== 'Picture' && + curComponent.value.innerType !== 'picture-group' && !batchOptStatus.value ) }) From ad975053e456faa7d33489e91e476b7cf0de1bd4 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Sun, 29 Sep 2024 17:43:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor(=E5=9B=BE=E8=A1=A8):=20=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E7=BB=84=E7=BB=84=E4=BB=B6=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-component/picture-group/Attr.vue | 19 +- .../PictureGroupDatasetSelect.vue | 205 ++++++++++++++++++ 2 files changed, 214 insertions(+), 10 deletions(-) create mode 100644 core/core-frontend/src/custom-component/picture-group/PictureGroupDatasetSelect.vue diff --git a/core/core-frontend/src/custom-component/picture-group/Attr.vue b/core/core-frontend/src/custom-component/picture-group/Attr.vue index 1294c54542..8eb6c51f59 100644 --- a/core/core-frontend/src/custom-component/picture-group/Attr.vue +++ b/core/core-frontend/src/custom-component/picture-group/Attr.vue @@ -6,26 +6,18 @@ import { storeToRefs } from 'pinia' import { PropType, toRefs } from 'vue' import PictureGroupUploadAttr from '@/custom-component/picture-group/PictureGroupUploadAttr.vue' import { BASE_VIEW_CONFIG } from '@/views/chart/components/editor/util/chart' +import PictureGroupDatasetSelect from '@/custom-component/picture-group/PictureGroupDatasetSelect.vue' const props = defineProps({ themes: { type: String as PropType, default: 'dark' - }, - view: { - type: Object as PropType, - required: false, - default() { - return { ...BASE_VIEW_CONFIG } - } } }) -const { view } = toRefs(props) - const dvMainStore = dvMainStoreWithOut() -const { curComponent } = storeToRefs(dvMainStore) +const { curComponent, canvasViewInfo } = storeToRefs(dvMainStore)