diff --git a/apps/web-antd/src/api/infra/file/index.ts b/apps/web-antd/src/api/infra/file/index.ts index 785dce14a..aac65cf99 100644 --- a/apps/web-antd/src/api/infra/file/index.ts +++ b/apps/web-antd/src/api/infra/file/index.ts @@ -27,7 +27,7 @@ export namespace InfraFileApi { /** 上传文件 */ export interface FileUploadReqVO { - file: File; + file: globalThis.File; path?: string; } } @@ -46,12 +46,9 @@ export function deleteFile(id: number) { /** 获取文件预签名地址 */ export function getFilePresignedUrl(path: string) { - return requestClient.get( - '/infra/file/presigned-url', - { - params: { path }, - }, - ); + return requestClient.get('/infra/file/presigned-url', { + params: { path }, + }); } /** 创建文件 */ @@ -60,10 +57,6 @@ export function createFile(data: InfraFileApi.File) { } /** 上传文件 */ -// TODO @芋艿:这里有爆红 -export function uploadFile( - data: InfraFileApi.FileUploadReqVO, - onUploadProgress?: AxiosProgressEvent, -) { +export function uploadFile(data: InfraFileApi.FileUploadReqVO, onUploadProgress?: AxiosProgressEvent) { return requestClient.upload('/infra/file/upload', data, { onUploadProgress }); } diff --git a/apps/web-antd/src/api/system/dict/data/index.ts b/apps/web-antd/src/api/system/dict/data/index.ts index a873d63c0..a64330cda 100644 --- a/apps/web-antd/src/api/system/dict/data/index.ts +++ b/apps/web-antd/src/api/system/dict/data/index.ts @@ -1,3 +1,5 @@ +import type { PageParam } from '@vben/request'; + import { requestClient } from '#/api/request'; export namespace SystemDictDataApi { @@ -22,7 +24,7 @@ export function getSimpleDictDataList() { } // 查询字典数据列表 -export function getDictDataPage(params: any) { +export function getDictDataPage(params: PageParam) { return requestClient.get('/system/dict-data/page', { params }); } diff --git a/apps/web-antd/src/components/upload/use-upload.ts b/apps/web-antd/src/components/upload/use-upload.ts index c7c7aa2e4..81aa22076 100644 --- a/apps/web-antd/src/components/upload/use-upload.ts +++ b/apps/web-antd/src/components/upload/use-upload.ts @@ -1,17 +1,14 @@ +import type { AxiosProgressEvent, InfraFileApi } from '#/api/infra/file'; import type { Ref } from 'vue'; -import type { AxiosProgressEvent, InfraFileApi } from '#/api/infra/file'; - +import { createFile, getFilePresignedUrl, uploadFile } from '#/api/infra/file'; +import { baseRequestClient } from '#/api/request'; import { computed, unref } from 'vue'; import { useAppConfig } from '@vben/hooks'; import { $t } from '@vben/locales'; - import CryptoJS from 'crypto-js'; -import { createFile, getFilePresignedUrl, uploadFile } from '#/api/infra/file'; -import { baseRequestClient } from '#/api/request'; - const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD); /** @@ -46,9 +43,7 @@ export function useUploadType({ const getStringAccept = computed(() => { return unref(getAccept) .map((item) => { - return item.indexOf('/') > 0 || item.startsWith('.') - ? item - : `.${item}`; + return item.indexOf('/') > 0 || item.startsWith('.') ? item : `.${item}`; }) .join(','); }); @@ -85,13 +80,9 @@ export const useUpload = () => { // 后端上传地址 const uploadUrl = getUploadUrl(); // 是否使用前端直连上传 - const isClientUpload = - UPLOAD_TYPE.CLIENT === import.meta.env.VITE_UPLOAD_TYPE; + const isClientUpload = UPLOAD_TYPE.CLIENT === import.meta.env.VITE_UPLOAD_TYPE; // 重写ElUpload上传方法 - const httpRequest = async ( - file: File, - onUploadProgress?: AxiosProgressEvent, - ) => { + const httpRequest = async (file: File, onUploadProgress?: AxiosProgressEvent) => { // 模式一:前端上传 if (isClientUpload) { // 1.1 生成文件名称 @@ -113,7 +104,6 @@ export const useUpload = () => { }); } else { // 模式二:后端上传 - // TODO @芋艿:这里有爆红 return uploadFile({ file }, onUploadProgress); } }; @@ -138,11 +128,7 @@ export const getUploadUrl = (): string => { * @param name 文件名称 * @param file 文件 */ -function createFile0( - vo: InfraFileApi.FilePresignedUrlRespVO, - name: string, - file: File, -) { +function createFile0(vo: InfraFileApi.FilePresignedUrlRespVO, name: string, file: File) { const fileVO = { configId: vo.configId, url: vo.url, diff --git a/apps/web-antd/src/router/access.ts b/apps/web-antd/src/router/access.ts index de84f93f9..ecb000a4e 100644 --- a/apps/web-antd/src/router/access.ts +++ b/apps/web-antd/src/router/access.ts @@ -1,7 +1,4 @@ -import type { - ComponentRecordType, - GenerateMenuAndRoutesOptions, -} from '@vben/types'; +import type { AppRouteRecordRaw, ComponentRecordType, GenerateMenuAndRoutesOptions } from '@vben/types'; import { generateAccessible } from '@vben/access'; import { preferences } from '@vben/preferences'; @@ -25,8 +22,8 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) { ...options, fetchMenuListAsync: async () => { // 由于 yudao 通过 accessStore 读取,所以不在进行 message.loading 提示 - const accessMenus = accessStore.accessMenus; - // TODO @芋艿:爆红!!! + // 补充说明:accessStore.accessMenus 一开始是 AppRouteRecordRaw 类型(后端加载),后面被赋值成 MenuRecordRaw 类型(前端转换) + const accessMenus = accessStore.accessMenus as AppRouteRecordRaw[]; return convertServerMenuToRouteRecordStringComponent(accessMenus); }, // 可以指定没有权限跳转403页面 diff --git a/apps/web-antd/src/router/routes/modules/demos.ts b/apps/web-antd/src/router/routes/modules/demos.ts index beb3dc075..b1f9b7916 100644 --- a/apps/web-antd/src/router/routes/modules/demos.ts +++ b/apps/web-antd/src/router/routes/modules/demos.ts @@ -1,28 +1,28 @@ import type { RouteRecordRaw } from 'vue-router'; -import { $t } from '#/locales'; +// import { $t } from '#/locales'; const routes: RouteRecordRaw[] = [ - { - meta: { - icon: 'ic:baseline-view-in-ar', - keepAlive: true, - order: 1000, - title: $t('demos.title'), - }, - name: 'Demos', - path: '/demos', - children: [ - { - meta: { - title: $t('demos.antd'), - }, - name: 'AntDesignDemos', - path: '/demos/ant-design', - component: () => import('#/views/demos/antd/index.vue'), - }, - ], - }, + // { + // meta: { + // icon: 'ic:baseline-view-in-ar', + // keepAlive: true, + // order: 1000, + // title: $t('demos.title'), + // }, + // name: 'Demos', + // path: '/demos', + // children: [ + // { + // meta: { + // title: $t('demos.antd'), + // }, + // name: 'AntDesignDemos', + // path: '/demos/ant-design', + // component: () => import('#/views/demos/antd/index.vue'), + // }, + // ], + // }, ]; -// export default routes; // update by 芋艿:不展示 \ No newline at end of file +export default routes; // update by 芋艿:不展示 diff --git a/apps/web-antd/src/router/routes/modules/vben.ts b/apps/web-antd/src/router/routes/modules/vben.ts index 36aeeab08..96f980d10 100644 --- a/apps/web-antd/src/router/routes/modules/vben.ts +++ b/apps/web-antd/src/router/routes/modules/vben.ts @@ -1,81 +1,81 @@ import type { RouteRecordRaw } from 'vue-router'; -import { - VBEN_DOC_URL, - VBEN_ELE_PREVIEW_URL, - VBEN_GITHUB_URL, - VBEN_LOGO_URL, - VBEN_NAIVE_PREVIEW_URL, -} from '@vben/constants'; - -import { IFrameView } from '#/layouts'; -import { $t } from '#/locales'; +// import { +// VBEN_DOC_URL, +// VBEN_ELE_PREVIEW_URL, +// VBEN_GITHUB_URL, +// VBEN_LOGO_URL, +// VBEN_NAIVE_PREVIEW_URL, +// } from '@vben/constants'; +// +// import { IFrameView } from '#/layouts'; +// import { $t } from '#/locales'; const routes: RouteRecordRaw[] = [ - { - meta: { - badgeType: 'dot', - icon: VBEN_LOGO_URL, - order: 9998, - title: $t('demos.vben.title'), - }, - name: 'VbenProject', - path: '/vben-admin', - children: [ - { - name: 'VbenDocument', - path: '/vben-admin/document', - component: IFrameView, - meta: { - icon: 'lucide:book-open-text', - link: VBEN_DOC_URL, - title: $t('demos.vben.document'), - }, - }, - { - name: 'VbenGithub', - path: '/vben-admin/github', - component: IFrameView, - meta: { - icon: 'mdi:github', - link: VBEN_GITHUB_URL, - title: 'Github', - }, - }, - { - name: 'VbenNaive', - path: '/vben-admin/naive', - component: IFrameView, - meta: { - badgeType: 'dot', - icon: 'logos:naiveui', - link: VBEN_NAIVE_PREVIEW_URL, - title: $t('demos.vben.naive-ui'), - }, - }, - { - name: 'VbenElementPlus', - path: '/vben-admin/ele', - component: IFrameView, - meta: { - badgeType: 'dot', - icon: 'logos:element', - link: VBEN_ELE_PREVIEW_URL, - title: $t('demos.vben.element-plus'), - }, - }, - ], - }, - { - name: 'VbenAbout', - path: '/vben-admin/about', - component: () => import('#/views/_core/about/index.vue'), - meta: { - icon: 'lucide:copyright', - title: $t('demos.vben.about'), - order: 9999, - }, - }, + // { + // meta: { + // badgeType: 'dot', + // icon: VBEN_LOGO_URL, + // order: 9998, + // title: $t('demos.vben.title'), + // }, + // name: 'VbenProject', + // path: '/vben-admin', + // children: [ + // { + // name: 'VbenDocument', + // path: '/vben-admin/document', + // component: IFrameView, + // meta: { + // icon: 'lucide:book-open-text', + // link: VBEN_DOC_URL, + // title: $t('demos.vben.document'), + // }, + // }, + // { + // name: 'VbenGithub', + // path: '/vben-admin/github', + // component: IFrameView, + // meta: { + // icon: 'mdi:github', + // link: VBEN_GITHUB_URL, + // title: 'Github', + // }, + // }, + // { + // name: 'VbenNaive', + // path: '/vben-admin/naive', + // component: IFrameView, + // meta: { + // badgeType: 'dot', + // icon: 'logos:naiveui', + // link: VBEN_NAIVE_PREVIEW_URL, + // title: $t('demos.vben.naive-ui'), + // }, + // }, + // { + // name: 'VbenElementPlus', + // path: '/vben-admin/ele', + // component: IFrameView, + // meta: { + // badgeType: 'dot', + // icon: 'logos:element', + // link: VBEN_ELE_PREVIEW_URL, + // title: $t('demos.vben.element-plus'), + // }, + // }, + // ], + // }, + // { + // name: 'VbenAbout', + // path: '/vben-admin/about', + // component: () => import('#/views/_core/about/index.vue'), + // meta: { + // icon: 'lucide:copyright', + // title: $t('demos.vben.about'), + // order: 9999, + // }, + // }, ]; -// export default routes; // update by 芋艿:不展示 +export default routes; // update by 芋艿:不展示 diff --git a/apps/web-antd/src/views/_core/profile/modules/profile-user.vue b/apps/web-antd/src/views/_core/profile/modules/profile-user.vue index 5c4c86abc..bf0f444cc 100644 --- a/apps/web-antd/src/views/_core/profile/modules/profile-user.vue +++ b/apps/web-antd/src/views/_core/profile/modules/profile-user.vue @@ -1,27 +1,28 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/bpm/processInstance/create/index.vue b/apps/web-antd/src/views/bpm/processInstance/create/index.vue index 0c4ec29ec..278a8387d 100644 --- a/apps/web-antd/src/views/bpm/processInstance/create/index.vue +++ b/apps/web-antd/src/views/bpm/processInstance/create/index.vue @@ -1,7 +1,6 @@ \ No newline at end of file + diff --git a/apps/web-antd/src/views/infra/apiAccessLog/modules/detail.vue b/apps/web-antd/src/views/infra/apiAccessLog/modules/detail.vue index edb378e6b..2e773396f 100644 --- a/apps/web-antd/src/views/infra/apiAccessLog/modules/detail.vue +++ b/apps/web-antd/src/views/infra/apiAccessLog/modules/detail.vue @@ -1,15 +1,14 @@