From b8727f9b5a28876410304e740fa0227f528ec6f7 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Fri, 22 Jul 2022 13:20:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E6=9D=BF=E9=A2=84=E8=A7=88=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BB=AA=E8=A1=A8=E6=9D=BF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/panel/PanelGroupService.java | 6 ++ .../main/resources/db/migration/V38__1.13.sql | 4 + frontend/src/api/panel/panel.js | 6 +- frontend/src/api/panel/shareProxy.js | 6 +- .../src/components/DeViewSelect/index.vue | 6 +- frontend/src/lang/en.js | 17 ++-- frontend/src/lang/tw.js | 15 ++-- frontend/src/lang/zh.js | 17 ++-- frontend/src/views/link/view/index.vue | 6 +- frontend/src/views/panel/list/PanelList.vue | 6 +- .../src/views/panel/list/PanelViewShow.vue | 18 +++- .../panel/list/common/PanelDetailInfo.vue | 84 +++++++++++++++++++ 12 files changed, 157 insertions(+), 34 deletions(-) create mode 100644 frontend/src/views/panel/list/common/PanelDetailInfo.vue 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 35eb934abb..5832c13c90 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java @@ -134,6 +134,8 @@ public class PanelGroupService { public String update(PanelGroupRequest request) { String panelId = request.getId(); + request.setUpdateTime(System.currentTimeMillis()); + request.setUpdateBy(AuthUtils.getUser().getUsername()); panelViewService.syncPanelViews(request); if ("toDefaultPanel".equals(request.getOptType())) { // 转存为默认仪表板 panelId = UUID.randomUUID().toString(); @@ -146,6 +148,7 @@ public class PanelGroupService { newDefaultPanel.setLevel(0); newDefaultPanel.setSource(request.getId()); newDefaultPanel.setCreateBy(AuthUtils.getUser().getUsername()); + newDefaultPanel.setCreateTime(System.currentTimeMillis()); checkPanelName(newDefaultPanel.getName(), newDefaultPanel.getPid(), PanelConstants.OPT_TYPE_INSERT, newDefaultPanel.getId(), newDefaultPanel.getNodeType()); panelGroupMapper.insertSelective(newDefaultPanel); // 清理权限缓存 @@ -177,6 +180,8 @@ public class PanelGroupService { record.setName(request.getName()); record.setId(request.getId()); record.setPid(request.getPid()); + record.setUpdateTime(request.getUpdateTime()); + record.setUpdateBy(request.getUpdateBy()); panelGroupMapper.updateByPrimaryKeySelective(record); DeLogUtils.save(SysLogConstants.OPERATE_TYPE.MODIFY, sourceType, request.getId(), panelInfo.getPid(), request.getPid(), sourceType); @@ -336,6 +341,7 @@ public class PanelGroupService { newPanel.setName(request.getName()); newPanel.setId(newPanelId); newPanel.setCreateBy(AuthUtils.getUser().getUsername()); + newPanel.setCreateTime(System.currentTimeMillis()); //TODO copy panelView extPanelViewMapper.copyFromPanel(newPanelId, sourcePanelId, copyId); //TODO 复制视图 chart_view diff --git a/backend/src/main/resources/db/migration/V38__1.13.sql b/backend/src/main/resources/db/migration/V38__1.13.sql index 4d771988dd..6161690bbf 100644 --- a/backend/src/main/resources/db/migration/V38__1.13.sql +++ b/backend/src/main/resources/db/migration/V38__1.13.sql @@ -71,3 +71,7 @@ INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, INSERT INTO `system_parameter` (`param_key`, `param_value`, `type`, `sort`) VALUES ('basic.templateAccessKey', 'dataease', 'text', NULL); INSERT INTO `system_parameter` (`param_key`, `param_value`, `type`, `sort`) VALUES ('basic.templateMarketUlr', 'https://dataease.io/templates', 'text', 4); + +ALTER TABLE `panel_group` + ADD COLUMN `update_by` varchar(255) NULL COMMENT '更新人' AFTER `status`, +ADD COLUMN `update_time` bigint(13) NULL COMMENT '更新时间' AFTER `update_by`; diff --git a/frontend/src/api/panel/panel.js b/frontend/src/api/panel/panel.js index d97c41b615..0827fa10b1 100644 --- a/frontend/src/api/panel/panel.js +++ b/frontend/src/api/panel/panel.js @@ -154,7 +154,11 @@ export function initPanelData(panelId, callback) { name: response.data.name, privileges: response.data.privileges, sourcePanelName: response.data.sourcePanelName, - status: response.data.status + status: response.data.status, + createBy: response.data.createBy, + createTime: response.data.createTime, + updateBy: response.data.updateBy, + updateTime: response.data.updateTime }) // 刷新联动信息 getPanelAllLinkageInfo(panelId).then(rsp => { diff --git a/frontend/src/api/panel/shareProxy.js b/frontend/src/api/panel/shareProxy.js index c47d5b3fb4..f171f73429 100644 --- a/frontend/src/api/panel/shareProxy.js +++ b/frontend/src/api/panel/shareProxy.js @@ -13,7 +13,11 @@ export function proxyInitPanelData(panelId, proxy, callback) { name: response.data.name, privileges: response.data.privileges, proxy: proxy.userId, - status: response.data.status + status: response.data.status, + createBy: response.data.createBy, + createTime: response.data.createTime, + updateBy: response.data.updateBy, + updateTime: response.data.updateTime }) // 刷新联动信息 getPanelAllLinkageInfo(panelId, proxy).then(rsp => { diff --git a/frontend/src/components/DeViewSelect/index.vue b/frontend/src/components/DeViewSelect/index.vue index 40160056f6..405419110e 100644 --- a/frontend/src/components/DeViewSelect/index.vue +++ b/frontend/src/components/DeViewSelect/index.vue @@ -133,7 +133,11 @@ export default { name: response.data.name, privileges: response.data.privileges, sourcePanelName: response.data.sourcePanelName, - status: response.data.status + status: response.data.status, + createBy: response.data.createBy, + createTime: response.data.createTime, + updateBy: response.data.updateBy, + updateTime: response.data.updateTime } this.$store.dispatch('panel/setPanelInfo', this.panelInfo) panelDataPrepare(JSON.parse(response.data.panelData), JSON.parse(response.data.panelStyle), rsp => { diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index c6d407daaa..d75a96b062 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -132,7 +132,7 @@ export default { }, commons: { manage_member: 'Managing members', - user_confirm_remove_cancel:'Are you sure you want to remove the user from the role?', + user_confirm_remove_cancel: 'Are you sure you want to remove the user from the role?', confirm_remove_cancel: 'Are you sure to delete the role?', default_value: 'Default Value', params_value: 'Param Value', @@ -623,12 +623,11 @@ export default { can_not_move: `Can't be removed, keep at least one administrator`, manage_can_not_move: 'Administrator is a preset role of the system. By default, he has all the permissions of system management and cannot be deleted', manage_can_not_update: 'Administrator is a preset role of the system. By default, he has all the permissions of system management and cannot be edit', - role_name: 'Role name', role_description: 'Role description', editer_role: 'Edit role', add_role: 'Add role', role_name_exist: 'The role name already exists', - search_by_role: 'Search by role name', + search_by_role: 'Search by role name' }, menu: { parent_category: 'Parent Category', @@ -667,7 +666,6 @@ export default { member: 'member', organization: 'organization', add_user: 'Add user', - search_by_name: 'Search by organization name', sure_move_user: 'Are you sure to remove this user from the organization?', move_success: 'Removed successfully', user: 'user', @@ -680,9 +678,8 @@ export default { canot_delete: 'Cannot delete', remove_user_first: 'Please remove all users in the organization before deleting the organization', sure_delete_organization: 'Are you sure to delete this organization?', - delete: 'delete', add_child_org: 'Add sub organization', - edite_organization: 'Edit organization', + edite_organization: 'Edit organization' }, system_parameter_setting: { mailbox_service_settings: 'Mail Settings', @@ -1546,6 +1543,10 @@ export default { sure_bt: 'Confirm' }, panel: { + create_by: '创建人', + create_time: '创建时间', + update_by: '最近修改人', + update_time: '最近修改时间', target_url: 'Target Url', target_url_tips: 'You can click fields to splice URLs or parameters', select_world: 'Select World', @@ -1919,8 +1920,6 @@ export default { column_permission: 'Column permission rule', enable_column: 'Enable column permissions', search_by_field: 'Search by field name', - add_condition: 'Add condition', - add_relationship: 'Add relationship', filter_fields: 'Filter fields', selct_filter_fields: 'Please select a filter field', enter_keywords: 'Please enter keywords', @@ -1934,7 +1933,7 @@ export default { please_fill: 'Please fill in one line and add 500 at most. Duplicate options and added options will be automatically filtered when identifying and entering', close: 'close', add: 'add to', - sure: 'determine', + sure: 'determine' }, about: { auth_to: 'Authorized to', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index 49f37db3be..e5f2af74d9 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -624,12 +624,11 @@ export default { can_not_move: '不可移除,至少保留一位管理員', manage_can_not_move: '管理員是系統預置角色,默認擁有系統管理全部權限,無法刪除', manage_can_not_update: '管理員是系統預置角色,默認擁有系統管理全部權限,無法編輯', - role_name: '角色名稱', role_description: '角色描述', editer_role: '編輯角色', add_role: '添加角色', role_name_exist: '該角色名稱已存在', - search_by_role: '通過角色名稱搜索', + search_by_role: '通過角色名稱搜索' }, menu: { parent_category: '上級目錄', @@ -658,7 +657,6 @@ export default { create_time: '創建日期', create: '新建組織', modify: '修改組織', - delete: '刪除組織', delete_confirm: '確定要刪除該組織嗎?', input_name: '請輸入組織名稱', select_organization: '請選擇組織', @@ -668,7 +666,6 @@ export default { member: '成員', organization: '組織', add_user: '添加用戶', - search_by_name: '通過組織名稱搜索', sure_move_user: '確定將該用戶從組織中移除嗎?', move_success: '移除成功', user: '用戶', @@ -683,7 +680,7 @@ export default { sure_delete_organization: '確定刪除該組織嗎?', delete: '刪除', add_child_org: '添加子組織', - edite_organization: '編輯組織', + edite_organization: '編輯組織' }, system_parameter_setting: { mailbox_service_settings: '郵件設置', @@ -1546,6 +1543,10 @@ export default { sure_bt: '確定' }, panel: { + create_by: '创建人', + create_time: '创建时间', + update_by: '最近修改人', + update_time: '最近修改时间', target_url: '目标URL', target_url_tips: '可以点击字段用来拼接URL或者参数', select_world: '点击选择字段', @@ -1930,8 +1931,6 @@ export default { column_permission: '列權限規則', enable_column: '啟用列權限', search_by_field: '通過字段名稱搜索', - add_condition: '添加條件', - add_relationship: '添加關系', filter_fields: '篩選字段', selct_filter_fields: '請選擇篩選字段', enter_keywords: '請輸關鍵字', @@ -1945,7 +1944,7 @@ export default { please_fill: '請一行填一個,最多添加500個,識別錄入時會自動過濾重復的選項和已經添加過的選項', close: '關 閉', add: '添 加', - sure: '確 定', + sure: '確 定' }, about: { auth_to: '授權給', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 4a4e92425c..31cc4dd966 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -133,7 +133,7 @@ export default { commons: { manage_member: '管理成员', confirm_remove_cancel: '确定删除该角色吗?', - user_confirm_remove_cancel:'确定将该用户从角色中移除吗?', + user_confirm_remove_cancel: '确定将该用户从角色中移除吗?', default_value: '默认值', params_value: '参数值', input_role_name: '请输入角色名称', @@ -615,7 +615,6 @@ export default { modify: '修改角色', tips: '提示', confirm_delete: '确认删除角色 ', - role_name: '角色名称', search_by_name: '按名称搜索', pls_input_name: '请输入名称', search_by_name_email: '通过姓名或邮箱搜索', @@ -630,7 +629,7 @@ export default { editer_role: '编辑角色', add_role: '添加角色', role_name_exist: '该角色名称已存在', - search_by_role: '通过角色名称搜索', + search_by_role: '通过角色名称搜索' }, menu: { parent_category: '上级目录', @@ -659,7 +658,6 @@ export default { create_time: '创建日期', create: '新建组织', modify: '修改组织', - delete: '删除组织', delete_confirm: '确定要删除该组织吗?', input_name: '请输入组织名称', select_organization: '请选择组织', @@ -669,7 +667,6 @@ export default { member: '成员', organization: '组织', add_user: '添加用户', - search_by_name: '通过组织名称搜索', sure_move_user: '确定将该用户从组织中移除吗?', move_success: '移除成功', user: '用户', @@ -684,7 +681,7 @@ export default { sure_delete_organization: '确定删除该组织吗?', delete: '删除', add_child_org: '添加子组织', - edite_organization: '编辑组织', + edite_organization: '编辑组织' }, system_parameter_setting: { mailbox_service_settings: '邮件设置', @@ -1554,6 +1551,10 @@ export default { sure_bt: '确定' }, panel: { + create_by: '创建人', + create_time: '创建时间', + update_by: '最近修改人', + update_time: '最近修改时间', target_url: '目标URL', target_url_tips: '可以点击字段用来拼接URL或者参数', select_world: '点击选择字段', @@ -1931,8 +1932,6 @@ export default { row_column: '行列权限设置', row_permission: '行权限规则', enable_row: '启用行权限', - add_condition: '添加条件', - add_relationship: '添加关系', white_list: '白名单', white_user_not: '以上权限规则对白名单用户不生效', organization_or_role: '请选择组织或角色', @@ -1954,7 +1953,7 @@ export default { please_fill: '请一行填一个,最多添加500个,识别录入时会自动过滤重复的选项和已经添加过的选项', close: '关 闭', add: '添 加', - sure: '确 定', + sure: '确 定' }, about: { auth_to: '授权给', diff --git a/frontend/src/views/link/view/index.vue b/frontend/src/views/link/view/index.vue index d4a041dc46..b6594b6714 100644 --- a/frontend/src/views/link/view/index.vue +++ b/frontend/src/views/link/view/index.vue @@ -57,7 +57,11 @@ export default { id: res.data.id, name: res.data.name, privileges: res.data.privileges, - status: res.data.status + status: res.data.status, + createBy: res.data.createBy, + createTime: res.data.createTime, + updateBy: res.data.updateBy, + updateTime: res.data.updateTime } this.$store.dispatch('panel/setPanelInfo', this.panelInfo) diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 34f34d36d7..0bfe88dfb4 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -721,7 +721,11 @@ export default { name: data.name, privileges: data.privileges, sourcePanelName: data.sourcePanelName, - status: data.status + status: data.status, + createBy: data.createBy, + createTime: data.createTime, + updateBy: data.updateBy, + updateTime: data.updateTime }) bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' }) }, diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index 03076f4c60..623d570dfc 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -18,9 +18,20 @@
{{ $t('panel.create_by') }}
+{{ panelInfo.createBy }}
+{{ $t('panel.create_time') }}
+{{ panelInfo.createTime |timestampFormatDate }}
+{{ $t('panel.update_by') }}
+{{ panelInfo.updateBy || 'N/A' }}
+{{ $t('panel.update_time') }}
+{{ panelInfo.updateTime | timestampFormatDate }}
+N/A
+