From 07a5abeb89c3dc640a377cbe3d2db725dbd1ac16 Mon Sep 17 00:00:00 2001 From: zhuibobo Date: Thu, 16 Jul 2026 13:57:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E6=95=B0=E6=8D=AE=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../005-2-重新整理二期菜单结构.sql | 3 + .../src/api/efcode/biz/index.ts | 75 ++++ .../src/api/efcode/interface/index.ts | 54 +++ .../src/views/efcode/biz/index.vue | 365 +++++++++++++++++ .../src/views/efcode/interface/index.vue | 386 ++++++++++++++++++ 5 files changed, 883 insertions(+) create mode 100644 zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/biz/index.ts create mode 100644 zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/interface/index.ts create mode 100644 zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/biz/index.vue create mode 100644 zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/interface/index.vue diff --git a/script/sql/zfjd-refactoring-v1/005-2-重新整理二期菜单结构.sql b/script/sql/zfjd-refactoring-v1/005-2-重新整理二期菜单结构.sql index ea0ba824..c4a33f63 100644 --- a/script/sql/zfjd-refactoring-v1/005-2-重新整理二期菜单结构.sql +++ b/script/sql/zfjd-refactoring-v1/005-2-重新整理二期菜单结构.sql @@ -17,6 +17,7 @@ INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (40, '系统工具', 0, 4, 'tool', null, '', 1, 0, '#', '', 'M', '0', '0', '', 'tool', 103, 1, '2026-03-31 20:14:46', null, null, '系统工具目录', 'authService', null); INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (2, '系统监控', 0, 5, 'monitor', null, '', 1, 0, '#', '', 'M', '0', '0', '', 'monitor', 103, 1, '2026-03-31 20:14:46', null, null, '系统监控目录', 'authService', null); INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (60, '系统对接', 0, 6, 'integration', null, '', 1, 0, '#', '', 'M', '0', '0', '', 'international', 103, 1, '2026-03-31 20:14:46', null, null, '系统对接目录', 'authService', null); + -- INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (70, '系统集成模拟', 0, 7, 'system-integration-mock', null, '', 1, 0, '#', '', 'M', '0', '0', '', 'redis', 103, 1, '2026-03-31 20:14:46', null, null, '系统集成模拟目录', 'authService', null); -- ============================================= @@ -61,6 +62,8 @@ INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, -- ============================================= INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (4001, '代码生成', 40, 1, 'gen', 'tool/gen/index', '', 1, 0, '#', '', 'C', '0', '0', 'tool:gen:list', 'code', 103, 1, '2026-03-31 20:14:46', null, null, '代码生成菜单', 'authService', null); +INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (4021, '业务数据同步', 40, 3, 'biz', 'efcode/biz/index', '', 1, 0, '#', '', 'C', '0', '0', 'tool:biz:list', 'code', 103, 1, '2026-03-31 20:14:46', null, null, '调用任务', 'authService', null); +INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (4031, '调用接口', 40, 4, 'interface', 'efcode/interface/index', '', 1, 0, '#', '', 'C', '0', '0', 'tool:biz:list', 'code', 103, 1, '2026-03-31 20:14:46', null, null, '调用接口', 'authService', null); -- 系统工具 辅助隐藏页面 INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, url, target, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark, system_code, type) VALUES (4010, '修改生成配置', 40, 2, 'gen-edit/index/:tableId', 'tool/gen/editTable', '', 1, 1, '#', '', 'C', '1', '0', 'tool:gen:edit', '#', 103, 1, '2026-03-31 20:14:46', null, null, '/tool/gen', 'authService', null); diff --git a/zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/biz/index.ts b/zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/biz/index.ts new file mode 100644 index 00000000..178a19f0 --- /dev/null +++ b/zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/biz/index.ts @@ -0,0 +1,75 @@ +import request from '@/utils/request'; + +/** + * 手工触发指定表增量同步 + */ +export const triggerSync = (configKey: string) => { + return request({ + url: '/web/biz-sync/trigger/' + configKey, + method: 'post' + }); +}; + +/** + * 手工触发全部表增量同步 + */ +export const triggerAllSync = () => { + return request({ + url: '/web/biz-sync/trigger-all', + method: 'post' + }); +}; + +/** + * 强制全量同步(PK 游标全表扫描) + */ +export const triggerForceSync = () => { + return request({ + url: '/web/biz-sync/trigger-force', + method: 'post' + }); +}; + +/** + * 分页查询同步任务 + */ +export const getTaskList = (params: { configKey?: string; pageNum?: number; pageSize?: number }) => { + return request({ + url: '/web/biz-sync/task/list', + method: 'get', + params + }); +}; + +/** + * 分页查询同步日志 + */ +export const getLogList = (params: { taskId?: string; configKey?: string; pageNum?: number; pageSize?: number }) => { + return request({ + url: '/web/biz-sync/log/list', + method: 'get', + params + }); +}; + +/** + * 分页查询行级影子记录 + */ +export const getRecordList = (params: { configKey?: string; status?: string; pageNum?: number; pageSize?: number }) => { + return request({ + url: '/web/biz-sync/record/list', + method: 'get', + params + }); +}; + +/** + * 重试死信记录 + */ +export const retryRecord = (recordId: number) => { + return request({ + url: '/web/biz-sync/record/retry', + method: 'post', + params: { recordId } + }); +}; diff --git a/zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/interface/index.ts b/zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/interface/index.ts new file mode 100644 index 00000000..8eaa4a62 --- /dev/null +++ b/zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/interface/index.ts @@ -0,0 +1,54 @@ +import request from '@/utils/request'; + +/** HTTP 方法类型 */ +export type InterfaceMethod = 'get' | 'post' | 'put' | 'delete'; + +/** 接口调用配置(与页面中的 JSON 定义一致) */ +export interface InterfaceItem { + /** 显示名称 */ + name: string; + /** 分组(通常填 Controller 名称) */ + group: string; + /** 请求路径,支持 {占位符} 形式的路径参数,例如 /reserve/check/{targetPlanId} */ + url: string; + /** 请求方法 */ + method: InterfaceMethod; + /** 描述说明 */ + description?: string; + /** 默认参数(get 拼 query,post/put 作 body) */ + params?: Record; + /** 路径参数默认值,key 与 url 中的 {xxx} 对应 */ + pathParams?: Record; + /** 是否需要二次确认 */ + confirm?: boolean; +} + +/** 将 URL 中的 {xxx} 占位符替换为实际值 */ +function fillPathParams(url: string, pathParams?: Record): string { + if (!pathParams) return url; + return url.replace(/\{(\w+)\}/g, (_, key) => { + const v = pathParams[key]; + return v == null ? '' : encodeURIComponent(String(v)); + }); +} + +/** + * 通用调用后端接口 + * @param item 接口配置 + * @param overrideParams 本次调用的参数(覆盖 item.params) + * @param overridePathParams 本次调用的路径参数(覆盖 item.pathParams) + */ +export const invokeInterface = ( + item: InterfaceItem, + overrideParams?: Record, + overridePathParams?: Record +) => { + const method = (item.method || 'get').toLowerCase() as InterfaceMethod; + const url = fillPathParams(item.url, overridePathParams ?? item.pathParams); + const payload = overrideParams ?? item.params ?? {}; + + if (method === 'get' || method === 'delete') { + return request({ url, method, params: payload }); + } + return request({ url, method, data: payload }); +}; diff --git a/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/biz/index.vue b/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/biz/index.vue new file mode 100644 index 00000000..d32c2413 --- /dev/null +++ b/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/biz/index.vue @@ -0,0 +1,365 @@ + + + + + diff --git a/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/interface/index.vue b/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/interface/index.vue new file mode 100644 index 00000000..a2306453 --- /dev/null +++ b/zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/interface/index.vue @@ -0,0 +1,386 @@ + + + + +