From 895c1009c1269a00f4366c74608667933f288b7e Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 26 Nov 2024 16:27:06 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A2=9E=E5=8A=A0tab,?= =?UTF-8?q?=E5=88=86=E7=BB=84=E7=AD=89=E7=BB=84=E4=BB=B6id=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/visualization/DvSidebar.vue | 34 +++++++++++++++++++ core/core-frontend/src/locales/en.ts | 2 ++ core/core-frontend/src/locales/tw.ts | 2 ++ core/core-frontend/src/locales/zh-CN.ts | 2 ++ .../views/chart/components/editor/index.vue | 4 ++- .../src/views/dashboard/index.vue | 1 + .../src/views/data-visualization/index.vue | 2 ++ 7 files changed, 46 insertions(+), 1 deletion(-) diff --git a/core/core-frontend/src/components/visualization/DvSidebar.vue b/core/core-frontend/src/components/visualization/DvSidebar.vue index 6aa475919a..794780fae2 100644 --- a/core/core-frontend/src/components/visualization/DvSidebar.vue +++ b/core/core-frontend/src/components/visualization/DvSidebar.vue @@ -4,13 +4,21 @@ import { ElIcon, ElMessage } from 'element-plus-secondary' import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import { storeToRefs } from 'pinia' import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot' +import Icon from '../icon-custom/src/Icon.vue' const dvMainStore = dvMainStoreWithOut() const { canvasCollapse } = storeToRefs(dvMainStore) let componentNameEdit = ref(false) let inputComponentName = ref('') let componentNameInputAttr = ref(null) +import dvInfoSvg from '@/assets/svg/dv-info.svg' +import { useI18n } from '@/hooks/web/useI18n' const snapshotStore = snapshotStoreWithOut() +const { t } = useI18n() const props = defineProps({ + element: { + required: false, + default: {} + }, scrollWidth: { required: false, type: Number, @@ -36,6 +44,7 @@ const props = defineProps({ type: String, default: 'defaultSide' }, + view: { type: Object as PropType, required: false @@ -115,6 +124,30 @@ const onComponentNameChange = () => { @dblclick="editComponentName" > {{ isViewTitle ? view.title : title }} + + +
+ {{ t('visualization.component_id') }} +
+
+ {{ element['id'] }} +
+
{ font-size: 14px !important; overflow: hidden; cursor: pointer; + display: flex; input { position: absolute; left: 0; diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index 9a2dc330e6..d3d19c2441 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -2647,6 +2647,8 @@ Scatter chart (bubble) chart: {a} (series name), {b} (data name), {c} (value arr column_name: 'Field name' }, visualization: { + component_id: 'Component ID', + view_id: 'Chart ID', resource_create_tips: 'Select components from the top toolbar and add them here to create.', component_select_tips: 'Please elect a component...', border_style_dotted: 'Dotted', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index bf141c61cf..cac32bd9fc 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -2585,6 +2585,8 @@ export default { column_name: '欄位名稱' }, visualization: { + component_id: '組件ID', + view_id: '圖表ID', resource_create_tips: '從頂部工具欄中選擇組件,添加到這裡創建。', component_select_tips: '請選擇組件...', border_style_dotted: '點線', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index cee4b33958..461de6a50b 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -2587,6 +2587,8 @@ export default { column_name: '字段名称' }, visualization: { + component_id: '组件ID', + view_id: '图表ID', resource_create_tips: '从顶部工具栏中选择组件,添加到这里创建', component_select_tips: '请选择组件...', border_style_dotted: '点线', diff --git a/core/core-frontend/src/views/chart/components/editor/index.vue b/core/core-frontend/src/views/chart/components/editor/index.vue index a6e20c17df..ba28a655a8 100644 --- a/core/core-frontend/src/views/chart/components/editor/index.vue +++ b/core/core-frontend/src/views/chart/components/editor/index.vue @@ -1914,7 +1914,9 @@ const deleteChartFieldItem = id => { > -
图表ID
+
+ {{ t('visualization.view_id') }} +
{{ view.id }}
diff --git a/core/core-frontend/src/views/dashboard/index.vue b/core/core-frontend/src/views/dashboard/index.vue index 7dc04d537c..a8c9266774 100644 --- a/core/core-frontend/src/views/dashboard/index.vue +++ b/core/core-frontend/src/views/dashboard/index.vue @@ -289,6 +289,7 @@ onUnmounted(() => { :side-name="'componentProp'" :aside-position="'right'" :view="canvasViewInfo[curComponent.id]" + :element="curComponent" class="left-sidebar" > diff --git a/core/core-frontend/src/views/data-visualization/index.vue b/core/core-frontend/src/views/data-visualization/index.vue index a58675f874..53a00fbc16 100644 --- a/core/core-frontend/src/views/data-visualization/index.vue +++ b/core/core-frontend/src/views/data-visualization/index.vue @@ -568,6 +568,8 @@ eventBus.on('tabSort', tabSort) :aside-position="'right'" class="left-sidebar" :slide-index="2" + :themes="'dark'" + :element="curComponent" :view="canvasViewInfo[curComponent.id]" :class="{ 'preview-aside': editMode === 'preview' }" >