From 07d66dd77dd4f2362afde7a5b8a6570eaba6a081 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 26 Nov 2024 18:30:05 +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=E6=90=BA=E5=B8=A6?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E8=B7=B3=E8=BD=AC=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=A0=A1=E9=AA=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E8=B5=84=E6=BA=90=E6=9D=83=E9=99=90=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/visualization/LinkJumpSet.vue | 397 ++++++++-------- .../src/components/visualization/linkJump.vue | 424 ------------------ core/core-frontend/src/locales/en.ts | 13 +- core/core-frontend/src/locales/tw.ts | 13 +- core/core-frontend/src/locales/zh-CN.ts | 13 +- 5 files changed, 246 insertions(+), 614 deletions(-) delete mode 100644 core/core-frontend/src/components/visualization/linkJump.vue diff --git a/core/core-frontend/src/components/visualization/LinkJumpSet.vue b/core/core-frontend/src/components/visualization/LinkJumpSet.vue index f9eaee9198..a7b2498790 100644 --- a/core/core-frontend/src/components/visualization/LinkJumpSet.vue +++ b/core/core-frontend/src/components/visualization/LinkJumpSet.vue @@ -143,7 +143,7 @@
- +
-
- - - - - - -
- - @@ -616,14 +633,29 @@ const { t } = useI18n() const dialogShow = ref(false) const snapshotStore = snapshotStoreWithOut() const appStore = useAppStoreWithOut() -const { wsCache } = useCache() const embeddedStore = useEmbedded() const resourceType = computed(() => dvInfo.value.type === 'dashboard' ? t('work_branch.dashboard') : t('work_branch.big_data_screen') ) +const selectSourceTips = + dvInfo.type === 'dashboard' + ? t('visualization.select_target_dashboard_tips') + : t('visualization.select_target_screen_tips') + +const targetSource = + dvInfo.value.type === 'dashboard' + ? t('visualization.target_dashboard') + : t('visualization.target_screen') + +const curSource = + dvInfo.value.type === 'dashboard' + ? t('visualization.cur_dashboard') + : t('visualization.cur_screen') + const state = reactive({ + curDataVWeight: 0, activeCollapse: 'view', loading: false, showSelected: false, @@ -910,6 +942,7 @@ const getPanelViewList = dvId => { const dvNodeClick = data => { if (data.leaf) { + state.curDataVWeight = data.weight state.linkJumpInfo.targetViewInfoList = [] addLinkJumpField() getPanelViewList(data.id) @@ -982,9 +1015,13 @@ const filterNodeMethod = (value, data) => { } const isEmbedded = computed(() => appStore.getIsDataEaseBi || appStore.getIsIframe) -const openType = wsCache.get('open-backend') === '1' ? '_self' : '_blank' +const openType = '_blank' const resourceEdit = resourceId => { + if (state.curDataVWeight && state.curDataVWeight < 7) { + ElMessage.error(t('visualization.no_edit_auth')) + return + } const baseUrl = dvInfo.value.type === 'dataV' ? '#/dvCanvas?dvId=' : '#/dashboard?resourceId=' if (isEmbedded.value) { embeddedStore.clearState() diff --git a/core/core-frontend/src/components/visualization/linkJump.vue b/core/core-frontend/src/components/visualization/linkJump.vue deleted file mode 100644 index 378859d362..0000000000 --- a/core/core-frontend/src/components/visualization/linkJump.vue +++ /dev/null @@ -1,424 +0,0 @@ - - - - - diff --git a/core/core-frontend/src/locales/en.ts b/core/core-frontend/src/locales/en.ts index c715691cff..eeab0d143e 100644 --- a/core/core-frontend/src/locales/en.ts +++ b/core/core-frontend/src/locales/en.ts @@ -2647,6 +2647,13 @@ Scatter chart (bubble) chart: {a} (series name), {b} (data name), {c} (value arr column_name: 'Field name' }, visualization: { + no_edit_auth: 'No edit permissions for the target resource, please contact the administrator!', + select_target_dashboard_tips: 'Please select the target dashboard', + select_target_screen_tips: 'Please select the target data screen', + cur_dashboard: 'Current dashboard', + cur_screen: 'Current data screen', + target_dashboard: 'Target dashboard', + target_screen: 'Target data screen', component_id: 'Component ID', view_id: 'Chart ID', resource_create_tips: 'Select components from the top toolbar and add them here to create.', @@ -2726,7 +2733,6 @@ Scatter chart (bubble) chart: {a} (series name), {b} (data name), {c} (value arr hold_canvas_tips: 'Hold spacebar to drag the canvas', keep_subject: 'Keep Original Style', select_component: 'Select Component', - show_selected_only: 'Show Selected Only', no_available_component: 'No available components currently', no_selected_component: 'Currently selected component', no_params_tips: 'Parameters cannot be empty', @@ -2879,8 +2885,7 @@ Scatter chart (bubble) chart: {a} (series name), {b} (data name), {c} (value arr source_filter: 'Source Filter', link_target_tips1: 'The target dashboard has no external parameters, so conditional queries cannot be carried out. If needed,', - link_target_tips2: - 'The target dashboard has no external parameters, so conditional queries cannot be carried out. If needed,', + link_target_tips2: 'Please go to the settings for external parameters.', link_outer_params: 'Linked External Parameters', indicator_name: 'Indicator Name', component_size: 'Size', @@ -3249,7 +3254,7 @@ Scatter chart (bubble) chart: {a} (series name), {b} (data name), {c} (value arr choose_background_tips: "The component's own background will overwrite the current setting", setting_background: 'Set Background', setting_jump: 'Jump Setting', - select_view: 'Please select a chart...', + select_view: 'Please select a chart', visual: 'Virtualization', prohibit_multiple: 'Prohibit multiple fields in the same dataset', be_empty_dir: 'This is an empty directory!', diff --git a/core/core-frontend/src/locales/tw.ts b/core/core-frontend/src/locales/tw.ts index a6cc9d9f9c..e2a4943ef4 100644 --- a/core/core-frontend/src/locales/tw.ts +++ b/core/core-frontend/src/locales/tw.ts @@ -2585,6 +2585,13 @@ export default { column_name: '欄位名稱' }, visualization: { + no_edit_auth: '目標資源沒有編輯權限,請聯繫管理員!', + select_target_dashboard_tips: '請選擇目標儀表板', + select_target_screen_tips: '請選擇目標數據大屏', + cur_dashboard: '當前儀表板', + cur_screen: '當前數據大屏', + target_dashboard: '目標儀表板', + target_screen: '目標數據大屏', component_id: '組件ID', view_id: '圖表ID', resource_create_tips: '從頂部工具欄中選擇組件,添加到這裡創建。', @@ -2662,7 +2669,7 @@ export default { hold_canvas_tips: '按住空格可拖動畫布', keep_subject: '保持源樣式', select_component: '選擇組件', - show_selected_only: '選擇組件', + show_selected_only: '僅展示已選', no_available_component: '當前沒有可用的組件', no_selected_component: '當前選擇的組件', no_params_tips: '參數不能為空', @@ -2809,7 +2816,7 @@ export default { source_field: '來源字段', source_filter: '來源條件', link_target_tips1: '目標儀表板無外部參數,因此無法攜帶條件查詢,如有需要,', - link_target_tips2: '目標儀表板無外部參數,因此無法攜帶條件查詢,如有需要,', + link_target_tips2: '請前往設定外部參數', link_outer_params: '聯動外部參數', indicator_name: '指標名稱', component_size: '大小', @@ -3169,7 +3176,7 @@ export default { choose_background_tips: '組件自有背景會覆蓋當前設置', setting_background: '設置背景', setting_jump: '跳轉設置', - select_view: '請選擇圖表...', + select_view: '請選擇圖表', visual: '虛擬化', prohibit_multiple: '禁止同數據集多字段', be_empty_dir: '是空目錄!', diff --git a/core/core-frontend/src/locales/zh-CN.ts b/core/core-frontend/src/locales/zh-CN.ts index afbaeb191a..a22034ceaf 100644 --- a/core/core-frontend/src/locales/zh-CN.ts +++ b/core/core-frontend/src/locales/zh-CN.ts @@ -2587,6 +2587,13 @@ export default { column_name: '字段名称' }, visualization: { + no_edit_auth: '目标资源没有编辑权限,请联系管理员!', + select_target_dashboard_tips: '请选择目标仪表板', + select_target_screen_tips: '请选择目标数据大屏', + cur_dashboard: '当前仪表板', + cur_screen: '当前数据大屏', + target_dashboard: '目标仪表板', + target_screen: '目标数据大屏', component_id: '组件ID', view_id: '图表ID', resource_create_tips: '从顶部工具栏中选择组件,添加到这里创建', @@ -2664,7 +2671,7 @@ export default { hold_canvas_tips: '按住空格可拖动画布', keep_subject: '保持源样式', select_component: '选择组件', - show_selected_only: '选择组件', + show_selected_only: '仅展示已选', no_available_component: '当前没有可用的组件', no_selected_component: '当前选择的组件', no_params_tips: '参数不能为空', @@ -2811,7 +2818,7 @@ export default { source_field: '源字段', source_filter: '源条件', link_target_tips1: '目标仪表板无外部参数,因此无法携带条件查询,如有需要,', - link_target_tips2: '目标仪表板无外部参数,因此无法携带条件查询,如有需要,', + link_target_tips2: '请前往设置外部参数', link_outer_params: '联动外部参数', indicator_name: '指标名称', component_size: '大小', @@ -3172,7 +3179,7 @@ export default { choose_background_tips: '组件自有背景会覆盖当前设置', setting_background: '设置背景', setting_jump: '跳转设置', - select_view: '请选择图表...', + select_view: '请选择图表', visual: '虚拟化', prohibit_multiple: '禁止同数据集多字段', be_empty_dir: '是空目录!',