From 0b3d3257eaf603322f7106b0e0bc76f83fd38d7c Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 20 Sep 2022 14:29:21 +0800 Subject: [PATCH 1/5] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E8=A7=86=E5=9B=BE=E6=94=AF=E6=8C=81=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=BD=93=E5=89=8D=E4=BB=AA=E8=A1=A8=E6=9D=BF=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/canvas/components/Editor/Preview.vue | 2 +- .../canvas/components/Editor/SettingMenu.vue | 2 +- .../components/canvas/custom-component/UserView.vue | 11 ++++++++++- frontend/src/components/canvas/store/copy.js | 10 ++++++++-- frontend/src/store/index.js | 7 +++++++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Preview.vue b/frontend/src/components/canvas/components/Editor/Preview.vue index 51e36d2a38..3c6f7bb9aa 100644 --- a/frontend/src/components/canvas/components/Editor/Preview.vue +++ b/frontend/src/components/canvas/components/Editor/Preview.vue @@ -253,7 +253,7 @@ export default { }, // 此处单独计算componentData的值 不放入全局mapState中 componentDataInfo() { - return this.componentDataShow + return this.componentDataShow||[] }, ...mapState([ 'isClickComponent' diff --git a/frontend/src/components/canvas/components/Editor/SettingMenu.vue b/frontend/src/components/canvas/components/Editor/SettingMenu.vue index 8bf5c7dfec..c951e7fbc5 100644 --- a/frontend/src/components/canvas/components/Editor/SettingMenu.vue +++ b/frontend/src/components/canvas/components/Editor/SettingMenu.vue @@ -130,7 +130,7 @@ export default { }, paste() { - this.$store.commit('paste', true) + this.$store.commit('paste', false) this.$store.commit('recordSnapshot', 'paste') }, diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index 6805b544de..e658c49cd7 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -137,7 +137,7 @@ import { adaptCurTheme, customAttrTrans, customStyleTrans, recursionTransObj } f import ChartComponentS2 from '@/views/chart/components/ChartComponentS2' import PluginCom from '@/views/system/plugin/PluginCom' import LabelNormalText from '@/views/chart/components/normal/LabelNormalText' -import { viewPropsSave } from '@/api/chart/chart' +import { viewEditSave, viewPropsSave } from '@/api/chart/chart' import { checkAddHttp } from '@/utils/urlUtils' import DeRichTextView from '@/components/canvas/custom-component/DeRichTextView' import Vue from 'vue' @@ -582,6 +582,15 @@ export default { this.chart['position'] = this.inTab ? 'tab' : 'panel' // 记录当前数据 this.panelViewDetailsInfo[id] = JSON.stringify(this.chart) + if(this.element.needAdaptor){ + const customStyleObj = JSON.parse(this.chart.customStyle) + const customAttrObj = JSON.parse(this.chart.customAttr) + adaptCurTheme(customStyleObj, customAttrObj) + this.chart.customStyle = JSON.stringify(customStyleObj) + this.chart.customAttr = JSON.stringify(customAttrObj) + viewEditSave(this.panelInfo.id,{ id: this.chart.id, customStyle: this.chart.customStyle, customAttr: this.chart.customAttr }) + this.$store.commit('adaptorStatusDisable',this.element.id) + } this.sourceCustomAttrStr = this.chart.customAttr this.sourceCustomStyleStr = this.chart.customStyle this.chart.drillFields = this.chart.drillFields ? JSON.parse(this.chart.drillFields) : [] diff --git a/frontend/src/components/canvas/store/copy.js b/frontend/src/components/canvas/store/copy.js index a353aa4737..291b08b631 100644 --- a/frontend/src/components/canvas/store/copy.js +++ b/frontend/src/components/canvas/store/copy.js @@ -4,6 +4,8 @@ import generateID from '@/components/canvas/utils/generateID' import { deepCopy } from '@/components/canvas/utils/utils' import { chartBatchCopy, chartCopy } from '@/api/chart/chart' import { uuid } from 'vue-uuid' +import { adaptCurThemeCommonStyle } from '@/components/canvas/utils/style' +import Vue from "vue"; export default { state: { @@ -85,7 +87,7 @@ export default { state.isCut = false }, - paste(state, isMouse) { + paste(state, needAdaptor) { if (!state.copyData) { toast('请选择组件') return @@ -103,12 +105,13 @@ export default { if (data.type === 'view') { chartCopy(data.propValue.viewId, state.panel.panelInfo.id).then(res => { const newView = deepCopy(data) + Vue.set(newView, 'needAdaptor', needAdaptor) newView.id = uuid.v1() newView.propValue.viewId = res.data if (newView.filters && newView.filters.length) { newView.filters = [] } - + needAdaptor && adaptCurThemeCommonStyle(newView) store.commit('addComponent', { component: newView }) }) } else if (data.type === 'de-tabs') { @@ -120,17 +123,20 @@ export default { const newViewId = uuid.v1() sourceAndTargetIds[item.content.propValue.viewId] = newViewId item.content.propValue.viewId = newViewId + Vue.set(item.content, 'needAdaptor', needAdaptor) if (item.content.filters && item.content.filters.length) { item.content.filters = [] } } }) chartBatchCopy({ 'sourceAndTargetIds': sourceAndTargetIds }, state.panel.panelInfo.id).then((rsp) => { + needAdaptor && adaptCurThemeCommonStyle(newCop) store.commit('addComponent', { component: newCop }) }) } else { const newCop = deepCopy(data) newCop.id = uuid.v1() + needAdaptor && adaptCurThemeCommonStyle(newCop) store.commit('addComponent', { component: newCop }) } if (state.isCut) { diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index 91207ad0ea..983d62e34a 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -708,6 +708,13 @@ const data = { }, setInEditorStatus(state, status) { state.isInEditor = status + }, + adaptorStatusDisable(state,componentId) { + state.componentData.forEach(item => { + if(item.id === componentId){ + item.needAdaptor = false + } + }) } }, modules: { From 70f423a6fcd9c74bddf0d9ea210722f1359b4e3f Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 20 Sep 2022 15:11:53 +0800 Subject: [PATCH 2/5] =?UTF-8?q?perf(=E4=BB=AA=E8=A1=A8=E6=9D=BF-=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8):=20=E8=BF=87=E6=BB=A4=E5=99=A8=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/widget/DeWidget/DeSelect.vue | 7 ++++++- frontend/src/lang/en.js | 10 +++++----- frontend/src/lang/tw.js | 10 +++++----- frontend/src/lang/zh.js | 10 +++++----- 4 files changed, 21 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index 8fb364e606..5afd67e53a 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -8,7 +8,7 @@ :collapse-tags="showNumber" :clearable="!element.options.attrs.multiple" :multiple="element.options.attrs.multiple" - :placeholder="$t(element.options.attrs.placeholder)" + :placeholder="$t(element.options.attrs.placeholder) + placeholderSuffix" :popper-append-to-body="inScreen" :size="size" :filterable="true" @@ -110,6 +110,11 @@ export default { customStyle() { const { brColor, wordColor, innerBgColor } = this.element.style return { brColor, wordColor, innerBgColor } + }, + placeholderSuffix() { + const i18nKey = this.element.options.attrs.multiple ? 'panel.multiple_choice' : 'panel.single_choice' + const i18nValue = this.$t(i18nKey) + return '(' + i18nValue + ')' } }, diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index cd9db96d02..2d09f5e12b 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -131,7 +131,7 @@ export default { default_login: 'Normal' }, commons: { - uninstall:'Uninstall', + uninstall: 'Uninstall', no_result: 'No Result', manage_member: 'Managing members', confirm_remove_cancel: 'Are you sure to delete the role?', @@ -2339,7 +2339,7 @@ export default { }, denumberselect: { label: 'Number selector', - placeholder: 'Please select' + placeholder: 'Please select number' }, deinputsearch: { label: 'Text search', @@ -2347,7 +2347,7 @@ export default { }, detextselect: { label: 'Text selector', - placeholder: 'Please select' + placeholder: 'Please select text' }, detextselectTree: { label: 'Tree selector', @@ -2564,8 +2564,8 @@ export default { no_apps: 'No apps', app_group_icon: 'Cover icon', app_name: 'Application name', - search_by_keyword:'Search by keyword', - apply_logs:'Apply logs', + search_by_keyword: 'Search by keyword', + apply_logs: 'Apply logs', app_group_delete_tips: 'Are you sure to delete this application category?', app_group_delete_content: 'After deletion, all application templates in this category will also be deleted.' } diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 078c88b4b6..dc2d0e315e 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -131,7 +131,7 @@ export default { default_login: '普通登錄' }, commons: { - uninstall:'卸载', + uninstall: '卸载', no_result: '没有找到相关内容', manage_member: '管理成員', user_confirm_remove_cancel: '確定將該用戶從角色中移除嗎?', @@ -2340,7 +2340,7 @@ export default { }, denumberselect: { label: '數字下拉', - placeholder: '請選擇' + placeholder: '請選擇數字' }, deinputsearch: { label: '文本搜索', @@ -2348,7 +2348,7 @@ export default { }, detextselect: { label: '文本下拉', - placeholder: '請選擇' + placeholder: '請選擇文本' }, detextselectTree: { label: '下拉樹', @@ -2565,8 +2565,8 @@ export default { no_apps: '暫無應用', app_group_icon: '封面圖標', app_name: '應用名稱', - search_by_keyword:'通過關鍵字搜索', - apply_logs:'應用記錄', + search_by_keyword: '通過關鍵字搜索', + apply_logs: '應用記錄', app_group_delete_tips: '確定刪除該應用分類嗎?', app_group_delete_content: '刪除後,該分類中所有的應用模闆也將被刪除。' } diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index cfe0b029cf..2bdc366141 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -131,7 +131,7 @@ export default { default_login: '普通登录' }, commons: { - uninstall:'卸载', + uninstall: '卸载', no_result: '没有找到相关内容', manage_member: '管理成员', confirm_remove_cancel: '确定删除该角色吗?', @@ -2341,7 +2341,7 @@ export default { }, denumberselect: { label: '数字下拉', - placeholder: '请选择' + placeholder: '请选择数字' }, deinputsearch: { label: '文本搜索', @@ -2349,7 +2349,7 @@ export default { }, detextselect: { label: '文本下拉', - placeholder: '请选择' + placeholder: '请选择文本' }, detextselectTree: { label: '下拉树', @@ -2566,8 +2566,8 @@ export default { no_apps: '暂无应用', app_group_icon: '封面图标', app_name: '应用名称', - search_by_keyword:'通过关键字搜索', - apply_logs:'应用记录', + search_by_keyword: '通过关键字搜索', + apply_logs: '应用记录', app_group_delete_tips: '确定删除该应用分类吗?', app_group_delete_content: '删除后,该分类中所有的应用模板也将被删除。' } From 558d328c527ef5c9c13f738ad86473f09fdac20b Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 20 Sep 2022 15:59:15 +0800 Subject: [PATCH 3/5] =?UTF-8?q?style(=E8=A7=86=E5=9B=BE):=20=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/styles/index.scss | 8 -------- frontend/src/views/chart/view/ChartEdit.vue | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index a550ba3ac6..730a435bd9 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -607,14 +607,6 @@ div:focus { padding-bottom: 0 !important; } -// .el-collapse-item__header { -// height: 34px !important; -// line-height: 34px !important; -// padding: 0 0 0 6px !important; -// font-size: 12px !important; -// font-weight: 400 !important; -// } - .blackTheme .el-submenu__title { color: var(--TextPrimary); } diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index e876b24dc4..e9abaf3bac 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -3247,4 +3247,12 @@ span { padding-left: 0!important; } +.view-panel-row ::v-deep .el-collapse-item__header{ + height: 34px !important; + line-height: 34px !important; + padding: 0 0 0 6px !important; + font-size: 12px !important; + font-weight: 400 !important; +} + From a29a232aa8e50b9c6ff8b5b1d6fe6218e658fcb8 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 20 Sep 2022 16:19:33 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feat:=20=E6=A8=A1=E6=9D=BF=E5=B8=82?= =?UTF-8?q?=E5=9C=BA=E6=94=AF=E6=8C=81=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=92=8C=E7=B3=BB=E7=BB=9F=E5=8F=82=E6=95=B0=E5=8F=A0=E5=8A=A0?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=B8=BA=E4=B8=8D=E5=90=8C=E7=94=A8=E6=88=B7=E5=BC=80=E6=94=BE?= =?UTF-8?q?=E6=88=96=E5=85=B3=E9=97=AD=E2=80=9C=E6=A8=A1=E6=9D=BF=E5=B8=82?= =?UTF-8?q?=E5=9C=BA=E2=80=9D=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/resources/db/migration/V40__1.15.sql | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/src/main/resources/db/migration/V40__1.15.sql b/backend/src/main/resources/db/migration/V40__1.15.sql index 826007787b..c5282cedcf 100644 --- a/backend/src/main/resources/db/migration/V40__1.15.sql +++ b/backend/src/main/resources/db/migration/V40__1.15.sql @@ -96,4 +96,13 @@ ALTER TABLE `sys_task_email` ALTER TABLE `sys_task_email` - ADD COLUMN `reci_users` varchar(255) NULL COMMENT '接收人账号' AFTER `conditions`; \ No newline at end of file + ADD COLUMN `reci_users` varchar(255) NULL COMMENT '接收人账号' AFTER `conditions`; + +UPDATE `sys_menu` SET `pid` = 0, `sub_count` = 0, `type` = 1, `title` = '模板市场', `name` = 'template-market', `component` = 'panel/templateMarket/index', `menu_sort` = 5, `icon` = 'dashboard', `path` = '/templateMarket', `i_frame` = 0, `cache` = 0, `hidden` = 0, `permission` = 'template-market:read', `create_by` = NULL, `update_by` = NULL, `create_time` = NULL, `update_time` = 1620444227389 WHERE `menu_id` = 202; + +INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`, `copy_from`, `copy_id`) VALUES ('e6b2cebf-02d8-4d46-833c-56fb07febb0f', '202', 'menu', '2', 'user', 1663661210626, NULL, 'admin', NULL, NULL, NULL); +INSERT INTO `sys_auth` (`id`, `auth_source`, `auth_source_type`, `auth_target`, `auth_target_type`, `auth_time`, `auth_details`, `auth_user`, `update_time`, `copy_from`, `copy_id`) VALUES ('f4e07708-26f1-4f42-9a4a-8e6dae63353c', '202', 'menu', '2', 'role', 1663661388831, NULL, 'admin', NULL, NULL, NULL); +INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`, `copy_from`, `copy_id`) VALUES ('2e9f56e5-38bb-11ed-8383-0242ac130005', 'e6b2cebf-02d8-4d46-833c-56fb07febb0f', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1663661211000, NULL, NULL, NULL); +INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`, `copy_from`, `copy_id`) VALUES ('2e9f5ca1-38bb-11ed-8383-0242ac130005', 'e6b2cebf-02d8-4d46-833c-56fb07febb0f', 'i18n_auth_use', 1, 0, 'use', '基础权限-使用', 'admin', 1663661211000, NULL, NULL, NULL); +INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`, `copy_from`, `copy_id`) VALUES ('98d77463-38bb-11ed-8383-0242ac130005', 'f4e07708-26f1-4f42-9a4a-8e6dae63353c', 'i18n_auth_grant', 15, 0, 'grant', '基础权限-授权', 'admin', 1663661389000, NULL, NULL, NULL); +INSERT INTO `sys_auth_detail` (`id`, `auth_id`, `privilege_name`, `privilege_type`, `privilege_value`, `privilege_extend`, `remark`, `create_user`, `create_time`, `update_time`, `copy_from`, `copy_id`) VALUES ('98d77856-38bb-11ed-8383-0242ac130005', 'f4e07708-26f1-4f42-9a4a-8e6dae63353c', 'i18n_auth_use', 1, 1, 'use', '基础权限-使用', 'admin', 1663661389000, NULL, NULL, NULL); From 7eac3fa0a6a68a3ec578e03d7a59d0ce14704e88 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 20 Sep 2022 16:24:50 +0800 Subject: [PATCH 5/5] =?UTF-8?q?style(=E8=A7=86=E5=9B=BE):=20=E4=B8=8B?= =?UTF-8?q?=E9=92=BB=E5=8C=BA=E5=9F=9F=E4=BB=A5=E5=8F=8A=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E7=BC=A9=E6=94=BE=E6=96=87=E5=AD=97=E8=B7=9F=E9=9A=8F=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E8=83=8C=E6=99=AF=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/custom-component/UserView.vue | 8 ++-- frontend/src/views/background/index.vue | 4 +- .../views/chart/components/ChartComponent.vue | 18 +++++++ frontend/src/views/chart/view/DrillPath.vue | 48 ++++++++++++++++++- 4 files changed, 70 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index e658c49cd7..68a044312f 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -109,7 +109,7 @@ @onJumpClick="jumpClick" />
- +
@@ -582,14 +582,14 @@ export default { this.chart['position'] = this.inTab ? 'tab' : 'panel' // 记录当前数据 this.panelViewDetailsInfo[id] = JSON.stringify(this.chart) - if(this.element.needAdaptor){ + if (this.element.needAdaptor) { const customStyleObj = JSON.parse(this.chart.customStyle) const customAttrObj = JSON.parse(this.chart.customAttr) adaptCurTheme(customStyleObj, customAttrObj) this.chart.customStyle = JSON.stringify(customStyleObj) this.chart.customAttr = JSON.stringify(customAttrObj) - viewEditSave(this.panelInfo.id,{ id: this.chart.id, customStyle: this.chart.customStyle, customAttr: this.chart.customAttr }) - this.$store.commit('adaptorStatusDisable',this.element.id) + viewEditSave(this.panelInfo.id, { id: this.chart.id, customStyle: this.chart.customStyle, customAttr: this.chart.customAttr }) + this.$store.commit('adaptorStatusDisable', this.element.id) } this.sourceCustomAttrStr = this.chart.customAttr this.sourceCustomStyleStr = this.chart.customStyle diff --git a/frontend/src/views/background/index.vue b/frontend/src/views/background/index.vue index 5b1ff9de34..9474251b10 100644 --- a/frontend/src/views/background/index.vue +++ b/frontend/src/views/background/index.vue @@ -80,7 +80,7 @@ - +
- {{ $t('commons.all') }} - {{ filter.value[0] }} + + {{ $t('commons.all') }} + + + {{ filter.value[0] }} +