From ab111a9d32607c1e7eb5f7ddde81f1c815af9218 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 25 May 2022 10:08:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=85=B3=E4=BA=8E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=AD=E7=89=88=E6=9C=AC=E5=8F=B7=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/dataease/service/AboutService.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/AboutService.java b/backend/src/main/java/io/dataease/service/AboutService.java index 1c9fc4421e..4727f9434e 100644 --- a/backend/src/main/java/io/dataease/service/AboutService.java +++ b/backend/src/main/java/io/dataease/service/AboutService.java @@ -9,6 +9,7 @@ import io.dataease.commons.utils.LogUtil; import io.dataease.listener.util.CacheUtils; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; @@ -25,6 +26,10 @@ public class AboutService { @Resource private DefaultLicenseService defaultLicenseService; + + @Value("${version}") + private String version; + public F2CLicenseResponse updateLicense(String licenseKey) { F2CLicenseResponse f2CLicenseResponse = defaultLicenseService.updateLicense(product, licenseKey); Optional.ofNullable(f2CLicenseResponse).ifPresent(resp -> { @@ -62,8 +67,7 @@ public class AboutService { return version; } } - String property = CommonBeanFactory.getBean(Environment.class).getProperty("cmp.version"); - return Optional.ofNullable(property).orElse("V1.0"); + return Optional.ofNullable(version).orElse("V1.0"); } catch (Exception e) { LogUtil.error("failed to get build version.", e); } From d8c73873a267f1f887ce9ee8cef5446376f147bc Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 25 May 2022 10:53:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E6=97=B6=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=AD=98=E9=87=8F=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/panel/PanelGroupService.java | 14 +++--- .../canvas/custom-component/component-list.js | 44 ++++++++++--------- .../views/panel/ViewSelect/multiplexing.vue | 20 ++++++++- 3 files changed, 48 insertions(+), 30 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java index 1dd3831ce7..ee9231fdc3 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java @@ -329,13 +329,13 @@ public class PanelGroupService { // result.addAll(viewResult); // } result = TreeUtils.mergeTree(result, "panel_list"); -// if (AuthUtils.getUser().getIsAdmin()) { -// // 原有视图的目录结构 -// List viewOriginal = extVAuthModelMapper.queryAuthViewsOriginal(viewRequest); -// if (CollectionUtils.isNotEmpty(viewOriginal) && viewOriginal.size() > 1) { -// result.addAll(TreeUtils.mergeTree(viewOriginal, "public_chart")); -// } -// } + if (AuthUtils.getUser().getIsAdmin()) { + // 原有视图的目录结构 + List viewOriginal = extVAuthModelMapper.queryAuthViewsOriginal(viewRequest); + if (CollectionUtils.isNotEmpty(viewOriginal) && viewOriginal.size() > 1) { + result.addAll(TreeUtils.mergeTree(viewOriginal, "public_chart")); + } + } } return result; diff --git a/frontend/src/components/canvas/custom-component/component-list.js b/frontend/src/components/canvas/custom-component/component-list.js index 26d9f928c4..541fd89725 100644 --- a/frontend/src/components/canvas/custom-component/component-list.js +++ b/frontend/src/components/canvas/custom-component/component-list.js @@ -226,6 +226,28 @@ export const otherList = [ } ] +export const USER_VIEW = { + id: '10005', + component: 'user-view', + label: '用户视图', + propValue: '', + icon: 'juxing', + type: 'view', + mobileStyle: BASE_MOBILE_STYLE, + hyperlinks: HYPERLINKS, + style: { + width: 300, + height: 200 + }, + x: 1, + y: 108, + sizex: 12, + sizey: 6, + auxiliaryMatrix: true, + miniSizex: 1, + miniSizey: 1 +} + // 编辑器左侧组件列表 const list = [ { @@ -337,27 +359,7 @@ const list = [ miniSizex: 1, miniSizey: 1 }, - { - id: '10005', - component: 'user-view', - label: '用户视图', - propValue: '', - icon: 'juxing', - type: 'view', - mobileStyle: BASE_MOBILE_STYLE, - hyperlinks: HYPERLINKS, - style: { - width: 300, - height: 200 - }, - x: 1, - y: 108, - sizex: 12, - sizey: 6, - auxiliaryMatrix: true, - miniSizex: 1, - miniSizey: 1 - }, + USER_VIEW, { id: '10006', component: 'de-tabs', diff --git a/frontend/src/views/panel/ViewSelect/multiplexing.vue b/frontend/src/views/panel/ViewSelect/multiplexing.vue index 928b4f92cc..920dee4020 100644 --- a/frontend/src/views/panel/ViewSelect/multiplexing.vue +++ b/frontend/src/views/panel/ViewSelect/multiplexing.vue @@ -27,9 +27,12 @@ import DeMainContainer from '@/components/dataease/DeMainContainer' import DeContainer from '@/components/dataease/DeContainer' import DeAsideContainer from '@/components/dataease/DeAsideContainer' import { findOne } from '@/api/panel/panel' -import { panelDataPrepare } from '@/components/canvas/utils/utils' +import { deepCopy, panelDataPrepare } from '@/components/canvas/utils/utils' import Preview from '@/components/canvas/components/Editor/Preview' import MultiplexingView from '@/views/panel/ViewSelect/multiplexingView' +import { DEFAULT_COMMON_CANVAS_STYLE_STRING } from '@/views/panel/panel' +import { USER_VIEW } from '@/components/canvas/custom-component/component-list' +import { uuid } from 'vue-uuid' export default { name: 'Multiplexing', @@ -61,7 +64,7 @@ export default { methods: { showDetails(params) { const _this = this - _this.selectedPanel = params.showId + _this.selectedPanel = params if (params.showType === 'panel') { this.panelLoading = true findOne(params.showId).then(response => { @@ -71,6 +74,19 @@ export default { _this.canvasStyleData = rsp.componentStyle }) }) + } else if (params.showType === 'view') { + const componentId = uuid.v1() + _this.canvasStyleData = deepCopy(DEFAULT_COMMON_CANVAS_STYLE_STRING) + const userView = { + ... deepCopy(USER_VIEW), + 'id': componentId } + userView.style.width = _this.canvasStyleData.width + userView.style.height = _this.canvasStyleData.height + userView['propValue'] = { + 'viewId': params.showId, + 'id': componentId + } + _this.componentData.push(userView) } } }