From 7b5d2ea050e9fc7bba621edcde3acb89cb481117 Mon Sep 17 00:00:00 2001 From: wangxiang <1827945911@qq.com> Date: Mon, 17 Jul 2023 16:47:38 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9E=B6=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/controller/reportSystemFile.ts | 17 +++ .../report/entity/reportSystemFile.ts | 16 ++ src/enums/cacheEnum.ts | 4 +- src/router/guard/paramMenuGuard.ts | 11 +- src/utils/cache/persistent.ts | 5 +- src/views/report/design/design.data.ts | 45 ++++++ src/views/report/design/index.vue | 139 ++++++++++++++++++ src/views/system/client/client.data.ts | 2 +- 8 files changed, 231 insertions(+), 8 deletions(-) create mode 100644 src/api/platform/report/controller/reportSystemFile.ts create mode 100644 src/api/platform/report/entity/reportSystemFile.ts create mode 100644 src/views/report/design/design.data.ts create mode 100644 src/views/report/design/index.vue diff --git a/src/api/platform/report/controller/reportSystemFile.ts b/src/api/platform/report/controller/reportSystemFile.ts new file mode 100644 index 0000000..80ebed8 --- /dev/null +++ b/src/api/platform/report/controller/reportSystemFile.ts @@ -0,0 +1,17 @@ +import type { ReportSystemFile, ReportSystemFileParams, ReportSystemFileResult } from '/@/api/platform/report/entity/reportSystemFile'; +import { defHttp } from '/@/utils/http/axios'; + +enum Api { + list = '/report_proxy/report/rest/list', + get = '/report_proxy/report/rest', + del = '/report_proxy/report/client/remove', +} + +/** 查询报表列表 */ +export const listReportSystemFile = (params?: Partial) => defHttp.get({ url: Api.list, params }, { isReturnResultResponse: true }); + +/** 查询报表详细 */ +export const getReportSystemFile = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); + +/** 删除报表 */ +export const delReportSystemFile = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` }); diff --git a/src/api/platform/report/entity/reportSystemFile.ts b/src/api/platform/report/entity/reportSystemFile.ts new file mode 100644 index 0000000..ba591db --- /dev/null +++ b/src/api/platform/report/entity/reportSystemFile.ts @@ -0,0 +1,16 @@ +import type { R } from '/#/axios'; +import type { CommonEntity, Page } from '/@/api/common/data/entity'; + +/** 报表系统文件查询参数 */ +export type ReportSystemFileParams = Page & ReportSystemFile; + +/** 报表系统文件 */ +export interface ReportSystemFile extends CommonEntity { + id: string; + name: string; + content: Blob[]; + [key: string]: any; +} + +/** 报表系统文件响应对象 */ +export type ReportSystemFileResult = R; diff --git a/src/enums/cacheEnum.ts b/src/enums/cacheEnum.ts index ece16c4..60b8327 100644 --- a/src/enums/cacheEnum.ts +++ b/src/enums/cacheEnum.ts @@ -35,10 +35,10 @@ export const MULTIPLE_TABS_KEY = 'MULTIPLE_TABS__KEY__'; /** 应用主题键 */ export const APP_DARK_MODE_KEY = '__APP__DARK__MODE__'; -/** 基本全局本地缓存密钥 */ +/** 基本全局本地缓存键 */ export const APP_LOCAL_CACHE_KEY = 'COMMON__LOCAL__KEY__'; -/** 基本全局会话缓存密钥 */ +/** 基本全局会话缓存键 */ export const APP_SESSION_CACHE_KEY = 'COMMON__SESSION__KEY__'; export enum CacheTypeEnum { diff --git a/src/router/guard/paramMenuGuard.ts b/src/router/guard/paramMenuGuard.ts index 3044cf7..2e71a08 100644 --- a/src/router/guard/paramMenuGuard.ts +++ b/src/router/guard/paramMenuGuard.ts @@ -2,24 +2,27 @@ import type { Router } from 'vue-router'; import { configureDynamicParamsMenu } from '../helper/menuHelper'; import { Menu } from '../types'; import { usePermissionStoreWithOut } from '/@/store/modules/permission'; +import { merge } from 'lodash-es'; export function createParamMenuGuard(router: Router) { const permissionStore = usePermissionStoreWithOut(); router.beforeEach(async (to, _, next) => { - // filter no name route + // 过滤无名称路由 if (!to.name) { next(); return; } - - // menu has been built. + // 菜单已经建立 if (!permissionStore.getIsDynamicAddedRoute) { next(); return; } - let menus: Menu[] = permissionStore.getMenuList; menus.forEach((item) => configureDynamicParamsMenu(item, to.params)); + // 处理路由切换动态替换vue-router自定义元数据 + if (to.query?.enableMetaMerge === 'y') { + merge(to.meta, to.query); + } next(); }); } diff --git a/src/utils/cache/persistent.ts b/src/utils/cache/persistent.ts index 4b4a801..4ecc726 100644 --- a/src/utils/cache/persistent.ts +++ b/src/utils/cache/persistent.ts @@ -20,7 +20,10 @@ import { PROJ_CFG_KEY, APP_LOCAL_CACHE_KEY, APP_SESSION_CACHE_KEY, - MULTIPLE_TABS_KEY, REFRESH_TOKEN_KEY, ROLE_IDS_KEY, PERMISSIONS_KEY, + MULTIPLE_TABS_KEY, + REFRESH_TOKEN_KEY, + ROLE_IDS_KEY, + PERMISSIONS_KEY, } from '/@/enums/cacheEnum'; import { DEFAULT_CACHE_TIME } from '/@/settings/encryptionSetting'; import { toRaw } from 'vue'; diff --git a/src/views/report/design/design.data.ts b/src/views/report/design/design.data.ts new file mode 100644 index 0000000..928d17b --- /dev/null +++ b/src/views/report/design/design.data.ts @@ -0,0 +1,45 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; + +/** 表格列配置 */ +export const columns: BasicColumn[] = [ + { + title: '文件名', + dataIndex: 'name', + width: 100 + }, + { + title: '更新时间', + dataIndex: 'updateTime', + width: 100 + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 100 + }, +]; + +/** 搜索表单配置 */ +export const searchFormSchema: FormSchema[] = [ + { + field: 'name', + label: '文件名', + component: 'Input', + componentProps: { + placeholder: '请输入文件名', + }, + colProps: { span: 8 }, + }, + { + field: 'dateRange', + label: '创建时间', + component: 'RangePicker', + componentProps: { + style: { width:'100%' }, + valueFormat: 'YYYY-MM-DD', + placeholder: ['开始日期','结束日期'] + }, + colProps: { span: 8 } + } +]; diff --git a/src/views/report/design/index.vue b/src/views/report/design/index.vue new file mode 100644 index 0000000..282cee2 --- /dev/null +++ b/src/views/report/design/index.vue @@ -0,0 +1,139 @@ + + + diff --git a/src/views/system/client/client.data.ts b/src/views/system/client/client.data.ts index 3667fb8..0c7bd3a 100644 --- a/src/views/system/client/client.data.ts +++ b/src/views/system/client/client.data.ts @@ -1,6 +1,6 @@ /** * @program: kicc-ui - * @description: 多租户模块动态渲染配置 + * @description: 授权客户端模块动态渲染配置 * @author: entfrm开发团队-王翔 * @create: 2022/4/21 */