diff --git a/ecom-dmb-frontend/apps/backend-mock/utils/mock-data.ts b/ecom-dmb-frontend/apps/backend-mock/utils/mock-data.ts index 192f30a0..3b082f35 100644 --- a/ecom-dmb-frontend/apps/backend-mock/utils/mock-data.ts +++ b/ecom-dmb-frontend/apps/backend-mock/utils/mock-data.ts @@ -29,7 +29,7 @@ export const MOCK_USERS: UserInfo[] = [ realName: 'Jack', roles: ['user'], username: 'jack', - homePath: '/analytics', + homePath: '/company-overview', }, ]; @@ -59,15 +59,15 @@ const dashboardMenus = [ }, name: 'Dashboard', path: '/dashboard', - redirect: '/analytics', + redirect: '/company-overview', children: [ { name: 'Analytics', - path: '/analytics', - component: '/dashboard/analytics/index', + path: '/company-overview', + component: '/dashboard/company-overview/index', meta: { affixTab: true, - title: 'page.dashboard.analytics', + title: 'page.dashboard.companyOverview', }, }, { diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product/types/types.dto.ts b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product/types/types.dto.ts index 5806b57c..82dc6928 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product/types/types.dto.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product/types/types.dto.ts @@ -27,17 +27,23 @@ export namespace ProductDTO { specs?: UpdateSpec[]; } - /** 商品规格DTO */ + /** 商品规格DTO(创建时) */ export interface Spec { /** 规格名称 */ name: string; /** 规格编码 */ specCode?: string; - /** 成本价 */ - costPrice: number; + /** 商品成本 */ + productCost: number; + /** 运费成本 */ + shippingCost?: number; + /** 其他成本 */ + otherCost?: number; + /** 备注 */ + remark?: string; } - /** 创建商品规格参数 */ + /** 创建商品规格参数(独立接口用) */ export interface CreateSpec { /** 商品ID */ productId: number; @@ -45,8 +51,14 @@ export namespace ProductDTO { name: string; /** 规格编码 */ specCode?: string; - /** 成本价 */ - costPrice: number; + /** 商品成本 */ + productCost: number; + /** 运费成本 */ + shippingCost?: number; + /** 其他成本 */ + otherCost?: number; + /** 备注 */ + remark?: string; } /** 更新商品规格参数 */ @@ -57,8 +69,14 @@ export namespace ProductDTO { name: string; /** 规格编码 */ specCode?: string; - /** 成本价 */ - costPrice: number; + /** 商品成本 */ + productCost: number; + /** 运费成本 */ + shippingCost?: number; + /** 其他成本 */ + otherCost?: number; + /** 备注 */ + remark?: string; } /** 商品过滤条件 */ diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product/types/types.vo.ts b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product/types/types.vo.ts index 77e3e861..ced81a16 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product/types/types.vo.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/product/types/types.vo.ts @@ -13,10 +13,8 @@ export namespace ProductVO { name: string; /** 商品编码 */ productCode?: string; - /** 主图URL(冗余字段) */ + /** 主图URL */ mainImage?: string; - /** 主图图片ID */ - mainImageId?: number; /** 创建时间 */ createTime: string; /** 更新时间 */ @@ -43,8 +41,14 @@ export namespace ProductVO { name: string; /** 规格编码 */ specCode?: string; - /** 成本价 */ - costPrice: number; + /** 商品成本 */ + productCost: number; + /** 运费成本 */ + shippingCost?: number; + /** 其他成本 */ + otherCost?: number; + /** 备注 */ + remark?: string; /** 创建时间 */ createTime: string; /** 更新时间 */ diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/shop/types/types.vo.ts b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/shop/types/types.vo.ts index a6e383a0..77db66a2 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/shop/types/types.vo.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/api/ecommerce/shop/types/types.vo.ts @@ -107,6 +107,8 @@ export namespace ShopVO { /** 店铺概览统计信息 */ export interface OverviewStatistics { + /** 店铺名称 */ + shopName: string; /** 店铺总销售额 */ totalSalesAmount: number; /** 较上月同期增长百分比 */ diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/system/file/apis.ts b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/apis.ts new file mode 100644 index 00000000..19b701cc --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/apis.ts @@ -0,0 +1,67 @@ +import type { FileDTO, FileVO } from './types'; + +import type { PageQueryDTO, PageResultVO } from '#/types/common'; + +import { requestClient } from '#/api/request'; + +/** + * 系统文件管理API + */ + +/** + * 批量上传文件 + * @param files 文件列表 + */ +export async function batchUploadFilesApi(files: File[]) { + const formData = new FormData(); + files.forEach((file) => { + formData.append('files', file); + }); + return requestClient.post( + '/sys/file/batch-upload', + formData, + { + headers: { + 'Content-Type': 'multipart/form-data', + }, + }, + ); +} + +/** + * 批量获取Header签名 + * @param data 批量签名请求参数 + */ +export async function batchSignUrlApi(data: FileDTO.BatchSignUrl) { + return requestClient.post( + '/sys/file/batch-sign-url', + data, + ); +} + +/** + * 批量创建OSS文件记录 + * @param data 批量创建OSS文件记录请求参数 + */ +export async function batchCreateOssFilesApi(data: FileDTO.BatchCreateOss) { + return requestClient.post('/sys/file/batch-create-oss', data); +} + +/** + * 获取文件访问URL + * @param fileId 文件ID + */ +export async function getFileAccessUrlApi(fileId: number) { + return requestClient.get(`/sys/file/${fileId}/access-url`); +} + +/** + * 分页获取文件列表 + * @param params 分页查询参数 + */ +export async function getFilePageApi(params: PageQueryDTO) { + return requestClient.post>( + '/sys/file/page', + params, + ); +} diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/system/file/index.ts b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/index.ts new file mode 100644 index 00000000..8041c309 --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/index.ts @@ -0,0 +1,6 @@ +/** + * 系统文件管理模块API导出 + */ + +export * from './apis'; +export * from './types'; diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/system/file/types/index.ts b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/types/index.ts new file mode 100644 index 00000000..0d1470a7 --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/types/index.ts @@ -0,0 +1,6 @@ +/** + * 系统文件管理模块类型定义导出 + */ + +export * from './types.dto'; +export * from './types.vo'; diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/system/file/types/types.dto.ts b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/types/types.dto.ts new file mode 100644 index 00000000..786f79b7 --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/types/types.dto.ts @@ -0,0 +1,63 @@ +/** + * 系统文件管理模块DTO类型定义 + */ + +export namespace FileDTO { + /** 批量URL签名请求参数 */ + export interface BatchSignUrl { + /** 文件列表 */ + files: FileItem[]; + } + + /** 文件项 */ + export interface FileItem { + /** 文件名 */ + filename: string; + /** 文件哈希值 */ + fileHash: string; + } + + /** 批量创建OSS文件记录请求参数 */ + export interface BatchCreateOss { + /** 文件列表 */ + files: CreateOssFileItem[]; + } + + /** 创建OSS文件项 */ + export interface CreateOssFileItem { + /** 文件名 */ + filename: string; + /** 文件哈希值 */ + fileHash: string; + /** 存储路径/Key */ + storagePath: string; + /** 文件大小(字节) */ + fileSize?: number; + /** MIME类型 */ + mimeType?: string; + /** 文件分类 */ + category?: string; + /** 标签 */ + tags?: string; + /** 备注 */ + remark?: string; + } + + /** 文件过滤条件 */ + export interface Filter { + /** 文件名(模糊查询) */ + filename?: string; + /** 文件格式(精准查询) */ + fileFormat?: string; + /** 存储类型(精准查询) */ + storageType?: string; + /** 文件分类(精准查询) */ + category?: string; + /** 标签(模糊查询) */ + tags?: string; + /** 上传时间范围-开始时间 */ + startUploadTime?: string; + /** 上传时间范围-结束时间 */ + endUploadTime?: string; + } +} diff --git a/ecom-dmb-frontend/apps/web-antd/src/api/system/file/types/types.vo.ts b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/types/types.vo.ts new file mode 100644 index 00000000..fccd1f94 --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/api/system/file/types/types.vo.ts @@ -0,0 +1,99 @@ +/** + * 系统文件管理模块VO类型定义 + */ + +export namespace FileVO { + /** 文件上传响应信息 */ + export interface Upload { + /** 文件ID */ + id: number; + /** 存储类型 */ + storageType: string; + /** 存储路径/Key */ + storagePath: string; + /** 原始文件名 */ + filename: string; + /** 文件格式 */ + fileFormat: string; + /** MIME类型 */ + mimeType: string; + /** 文件大小(字节) */ + fileSize: number; + /** 文件哈希值 */ + fileHash: string; + /** 文件分类 */ + category?: string; + /** 标签 */ + tags?: string; + /** 文件描述 */ + remark?: string; + /** 访问URL(临时签名URL,仅OSS存储) */ + accessUrl?: string; + } + + /** 系统文件信息 */ + export interface Info { + /** 文件ID */ + id: number; + /** 公司ID */ + companyId?: number; + /** 存储类型 */ + storageType: string; + /** 存储路径/Key */ + storagePath: string; + /** 原始文件名 */ + filename: string; + /** 文件格式 */ + fileFormat: string; + /** MIME类型 */ + mimeType: string; + /** 文件大小(字节) */ + fileSize: number; + /** 文件哈希值 */ + fileHash: string; + /** 文件分类 */ + category?: string; + /** 标签 */ + tags?: string; + /** 文件描述 */ + remark?: string; + /** 上传人ID */ + uploadBy?: number; + /** 上传时间 */ + uploadTime: string; + /** 更新时间 */ + updateTime: string; + /** 更新人ID */ + updateBy?: number; + /** 访问URL(临时签名URL) */ + accessUrl?: string; + } + + /** 批量Header签名响应(Header签名) */ + export interface BatchSignUrl { + /** 文件信息列表 */ + files: FileSignInfo[]; + } + + /** 文件签名信息 */ + export interface FileSignInfo { + /** 文件名 */ + filename: string; + /** 文件哈希值 */ + fileHash: string; + /** 文件ID(如果文件已存在) */ + fileId?: number; + /** 是否已存在 */ + exists: boolean; + /** 上传URL(如果文件不存在,不含签名参数) */ + uploadUrl?: string; + /** 上传所需的Header签名信息(如果文件不存在,包含Authorization、Date、x-oss-date、Content-Type等) */ + uploadHeaders?: Record; + /** 存储路径/Key(如果文件不存在,用于前端创建文件记录时使用) */ + storagePath?: string; + /** 访问URL(如果文件已存在,临时签名URL) */ + accessUrl?: string; + /** 文件信息(如果文件已存在) */ + fileInfo?: Info; + } +} diff --git a/ecom-dmb-frontend/apps/web-antd/src/preferences.ts b/ecom-dmb-frontend/apps/web-antd/src/preferences.ts index 303b909f..e56130b1 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/preferences.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/preferences.ts @@ -11,6 +11,7 @@ export const overridesPreferences = defineOverridesPreferences({ name: import.meta.env.VITE_APP_TITLE, accessMode: 'backend', // 启用后端访问控制模式 enableRefreshToken: true, // 启用token自动刷新功能 🔄 + defaultHomePath: '/company-overview', // 设置默认首页路由 }, navigation: { accordion: false, // 关闭手风琴模式,允许多个菜单同时展开 diff --git a/ecom-dmb-frontend/apps/web-antd/src/router/routes/modules/dashboard.ts b/ecom-dmb-frontend/apps/web-antd/src/router/routes/modules/dashboard.ts index d9068ad0..c976c65a 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/router/routes/modules/dashboard.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/router/routes/modules/dashboard.ts @@ -14,12 +14,12 @@ const routes: RouteRecordRaw[] = [ children: [ { name: 'Analytics', - path: '/analytics', - component: () => import('#/views/dashboard/analytics/index.vue'), + path: '/company-overview', + component: () => import('#/views/dashboard/company-overview/index.vue'), meta: { affixTab: true, icon: 'lucide:area-chart', - title: $t('page.dashboard.analytics'), + title: $t('page.dashboard.companyOverview'), }, }, // { diff --git a/ecom-dmb-frontend/apps/web-antd/src/store/auth.ts b/ecom-dmb-frontend/apps/web-antd/src/store/auth.ts index 5f3bdb17..1b9c7dce 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/store/auth.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/store/auth.ts @@ -210,7 +210,7 @@ export const useAuthStore = defineStore('auth', () => { userId: user.id.toString(), username: user.loginCode, desc: user.remark || '', - homePath: '/dashboard', + homePath: preferences.app.defaultHomePath, avatar: user.avatar || '', }; userStore.setUserInfo(userInfo as any); diff --git a/ecom-dmb-frontend/apps/web-antd/src/utils/oss-upload.ts b/ecom-dmb-frontend/apps/web-antd/src/utils/oss-upload.ts new file mode 100644 index 00000000..2d0af6df --- /dev/null +++ b/ecom-dmb-frontend/apps/web-antd/src/utils/oss-upload.ts @@ -0,0 +1,259 @@ +/** + * OSS文件上传工具 + */ + +import type { FileVO } from '#/api/system/file/types'; + +import { message } from 'ant-design-vue'; + +import { batchCreateOssFilesApi, batchSignUrlApi } from '#/api/system/file'; + +/** + * 上传选项 + */ +export interface UploadOptions { + /** 文件分类 */ + category?: string; + /** 错误提示消息 */ + errorMessage?: string; +} + +/** + * 计算文件的SHA-256哈希值 + * @param file 文件对象 + * @returns 返回文件的SHA-256哈希值(十六进制字符串) + */ +async function calculateFileHash(file: File): Promise { + const arrayBuffer = await file.arrayBuffer(); + const hashBuffer = await crypto.subtle.digest('SHA-256', arrayBuffer); + const hashArray = [...new Uint8Array(hashBuffer)]; + const hashHex = hashArray + .map((b) => b.toString(16).padStart(2, '0')) + .join(''); + return hashHex; +} + +/** + * 使用Header签名上传文件到OSS + * @param file 要上传的文件 + * @param uploadUrl 上传URL(不含签名参数) + * @param uploadHeaders Header签名信息(包含Authorization、Date、x-oss-date、Content-Type等) + * @returns Promise + */ +async function uploadFileToOssWithHeaderSignature( + file: File, + uploadUrl: string, + uploadHeaders: Record, +): Promise { + const headers: Record = { + ...uploadHeaders, + }; + + const response = await fetch(uploadUrl, { + method: 'PUT', + body: file, + headers, + }); + + if (!response.ok) { + throw new Error(`上传失败: ${response.status} ${response.statusText}`); + } +} + +/** + * 上传文件到OSS(通过Header签名) + * @param file 要上传的文件 + * @param options 上传选项 + * @param options.category 文件分类 + * @param options.errorMessage 错误提示消息 + * @returns 返回文件信息,包含文件ID + */ +export async function uploadFileToOss( + file: File, + options?: UploadOptions, +): Promise { + try { + // 1. 计算文件哈希值 + const fileHash = await calculateFileHash(file); + + // 2. 获取Header签名 + const signResponse = await batchSignUrlApi({ + files: [ + { + filename: file.name, + fileHash, + }, + ], + }); + + if (!signResponse.files || signResponse.files.length === 0) { + throw new Error('获取签名失败'); + } + + const signInfo = signResponse.files[0]; + if (!signInfo) { + throw new Error('获取签名失败'); + } + + // 3. 如果文件已存在,直接返回文件信息 + if (signInfo.exists && signInfo.fileInfo) { + return signInfo.fileInfo; + } + + // 4. 如果文件不存在,使用Header签名上传到OSS + if (!signInfo.uploadUrl) { + throw new Error('未获取到上传URL'); + } + if (!signInfo.uploadHeaders) { + throw new Error('未获取到上传Header签名信息'); + } + + await uploadFileToOssWithHeaderSignature( + file, + signInfo.uploadUrl, + signInfo.uploadHeaders, + ); + + // 5. 上传成功后,创建OSS文件记录 + // 使用签名响应中的 storagePath + if (!signInfo.storagePath) { + throw new Error('未获取到存储路径'); + } + + const createResponse = await batchCreateOssFilesApi({ + files: [ + { + filename: file.name, + fileHash, + storagePath: signInfo.storagePath, + fileSize: file.size, + mimeType: file.type, + category: options?.category, + }, + ], + }); + + if (!createResponse || createResponse.length === 0) { + throw new Error('创建文件记录失败'); + } + + const fileInfo = createResponse[0]; + if (!fileInfo) { + throw new Error('创建文件记录失败'); + } + + return fileInfo; + } catch (error) { + console.error('文件上传失败:', error); + const errorMsg = options?.errorMessage || '文件上传失败'; + message.error(errorMsg); + throw error; + } +} + +/** + * 批量上传文件到OSS(通过Header签名) + * @param files 要上传的文件列表 + * @param options 上传选项 + * @param options.category 文件分类 + * @param options.errorMessage 错误提示消息 + * @returns 返回文件信息列表 + */ +export async function uploadFilesToOss( + files: File[], + options?: UploadOptions, +): Promise { + try { + // 1. 计算所有文件的哈希值 + const fileItems = await Promise.all( + files.map(async (file) => ({ + filename: file.name, + fileHash: await calculateFileHash(file), + })), + ); + + // 2. 批量获取Header签名 + const signResponse = await batchSignUrlApi({ + files: fileItems, + }); + + if (!signResponse.files || signResponse.files.length === 0) { + throw new Error('获取签名失败'); + } + + const results: FileVO.Info[] = []; + const filesToUpload: Array<{ + file: File; + fileHash: string; + signInfo: FileVO.FileSignInfo; + }> = []; + + // 3. 分类处理:已存在的文件和需要上传的文件 + for (let i = 0; i < signResponse.files.length; i++) { + const signInfo = signResponse.files[i]; + const file = files[i]; + const fileItem = fileItems[i]; + if (!signInfo || !file || !fileItem) continue; + + if (signInfo.exists && signInfo.fileInfo) { + // 文件已存在,直接使用 + results.push(signInfo.fileInfo); + } else if (signInfo.uploadUrl && signInfo.uploadHeaders) { + // 文件不存在,需要上传 + filesToUpload.push({ + file, + fileHash: fileItem.fileHash, + signInfo, + }); + } + } + + // 4. 批量上传不存在的文件 + if (filesToUpload.length > 0) { + await Promise.all( + filesToUpload.map(({ file, signInfo }) => { + if (!signInfo.uploadUrl) { + throw new Error('未获取到上传URL'); + } + if (!signInfo.uploadHeaders) { + throw new Error('未获取到上传Header签名信息'); + } + return uploadFileToOssWithHeaderSignature( + file, + signInfo.uploadUrl, + signInfo.uploadHeaders, + ); + }), + ); + + // 5. 批量创建OSS文件记录 + const createResponse = await batchCreateOssFilesApi({ + files: filesToUpload.map(({ file, signInfo, fileHash }) => { + // 使用签名响应中的 storagePath + if (!signInfo.storagePath) { + throw new Error('未获取到存储路径'); + } + return { + filename: file.name, + fileHash, + storagePath: signInfo.storagePath, + fileSize: file.size, + mimeType: file.type, + category: options?.category, + }; + }), + }); + + if (createResponse && createResponse.length > 0) { + results.push(...createResponse); + } + } + + return results; + } catch (error) { + console.error('文件上传失败:', error); + const errorMsg = options?.errorMessage || '文件上传失败'; + message.error(errorMsg); + throw error; + } +} diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue deleted file mode 100644 index f1f0b232..00000000 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-trends.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits-data.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits-data.vue deleted file mode 100644 index 190fb41f..00000000 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits-data.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits-sales.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits-sales.vue deleted file mode 100644 index 02f50912..00000000 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits-sales.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits-source.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits-source.vue deleted file mode 100644 index 0915c7af..00000000 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits-source.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits.vue deleted file mode 100644 index 7e0f1013..00000000 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/analytics-visits.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/index.vue deleted file mode 100644 index 5e3d6d28..00000000 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/analytics/index.vue +++ /dev/null @@ -1,90 +0,0 @@ - - - diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/company-overview/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue similarity index 97% rename from ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/company-overview/index.vue rename to ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue index 953655f0..27563b2d 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/company-overview/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue @@ -7,6 +7,7 @@ import type { } from '#/api/ecommerce/company-overview'; import { onMounted, ref, watch } from 'vue'; +import { useRouter } from 'vue-router'; import { Page } from '@vben/common-ui'; import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; @@ -19,6 +20,9 @@ import { getShopPageApi } from '#/api/ecommerce/shop'; defineOptions({ name: 'CompanyOverview' }); +// 路由 +const router = useRouter(); + // 响应式数据 const loading = ref(false); const overviewData = ref(null); @@ -116,6 +120,17 @@ const formatPercentPlain = (value: number | undefined) => { return `${value.toFixed(1)}%`; }; +// 跳转到店铺详情页 +const navigateToShopOverview = (shopId: number) => { + router.push({ + path: `/ecom/shop/overview/${shopId}`, + query: { + startDate: dateRange.value[0].format('YYYY-MM-DD'), + endDate: dateRange.value[1].format('YYYY-MM-DD'), + }, + }); +}; + // 加载店铺数量 const loadShopCount = async () => { try { @@ -406,7 +421,7 @@ onMounted(async () => { -
+
@@ -673,9 +688,14 @@ onMounted(async () => { class="transition-colors hover:bg-blue-50/50" > - {{ shop.shopName }} + + {{ shop.shopName }} + diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workspace/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workspace/index.vue deleted file mode 100644 index b95d6138..00000000 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workspace/index.vue +++ /dev/null @@ -1,266 +0,0 @@ - - - diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/order-import/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/order-import/index.vue index 84f42027..468cd26d 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/order-import/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/order-import/index.vue @@ -235,9 +235,7 @@ onUnmounted(() => {