feat(app): 初始化项目配置和页面结构
- 添加 .dockerignore 和 .env.example 配置文件 - 添加 .gitignore 忽略规则配置 - 创建服务端代理API路由(_file、_modules、_server) - 集成 Ant Design Vue 组件库并配置SSR样式提取 - 定义API响应类型封装 - 创建基础布局组件(blank、console) - 实现应用中心页面和组件(AppsCenter) - 添加文章列表测试页面 - 配置控制台导航菜单结构 - 实现控制台头部组件 - 创建联系页面表单
This commit is contained in:
106
app/api/cms/cmsStatistics/index.ts
Normal file
106
app/api/cms/cmsStatistics/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CmsStatistics, CmsStatisticsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询站点统计信息表
|
||||
*/
|
||||
export async function pageCmsStatistics(params: CmsStatisticsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CmsStatistics>>>(
|
||||
MODULES_API_URL + '/cms/cms-statistics/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询站点统计信息表列表
|
||||
*/
|
||||
export async function listCmsStatistics(params?: CmsStatisticsParam) {
|
||||
const res = await request.get<ApiResult<CmsStatistics[]>>(
|
||||
MODULES_API_URL + '/cms/cms-statistics',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加站点统计信息表
|
||||
*/
|
||||
export async function addCmsStatistics(data: CmsStatistics) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-statistics',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改站点统计信息表
|
||||
*/
|
||||
export async function updateCmsStatistics(data: CmsStatistics) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-statistics',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除站点统计信息表
|
||||
*/
|
||||
export async function removeCmsStatistics(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-statistics/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除站点统计信息表
|
||||
*/
|
||||
export async function removeBatchCmsStatistics(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/cms/cms-statistics/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询站点统计信息表
|
||||
*/
|
||||
export async function getCmsStatistics(id: number) {
|
||||
const res = await request.get<ApiResult<CmsStatistics>>(
|
||||
MODULES_API_URL + '/cms/cms-statistics/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
79
app/api/cms/cmsStatistics/model/index.ts
Normal file
79
app/api/cms/cmsStatistics/model/index.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 站点统计信息表
|
||||
*/
|
||||
export interface CmsStatistics {
|
||||
// 自增ID
|
||||
id?: number;
|
||||
// 站点ID
|
||||
websiteId?: number;
|
||||
// 用户总数
|
||||
userCount?: number;
|
||||
// 订单总数
|
||||
orderCount?: number;
|
||||
// 商品总数
|
||||
productCount?: number;
|
||||
// 总销售额
|
||||
totalSales?: number;
|
||||
// 本月销售额
|
||||
monthSales?: number;
|
||||
// 今日销售额
|
||||
todaySales?: number;
|
||||
// 昨日销售额
|
||||
yesterdaySales?: number;
|
||||
// 本周销售额
|
||||
weekSales?: number;
|
||||
// 本年销售额
|
||||
yearSales?: number;
|
||||
// 今日订单数
|
||||
todayOrders?: number;
|
||||
// 本月订单数
|
||||
monthOrders?: number;
|
||||
// 今日新增用户
|
||||
todayUsers?: number;
|
||||
// 本月新增用户
|
||||
monthUsers?: number;
|
||||
// 今日访问量
|
||||
todayVisits?: number;
|
||||
// 总访问量
|
||||
totalVisits?: number;
|
||||
// 商户总数
|
||||
merchantCount?: number;
|
||||
// 活跃用户数
|
||||
activeUsers?: number;
|
||||
// 转化率(%)
|
||||
conversionRate?: string;
|
||||
// 平均订单金额
|
||||
avgOrderAmount?: string;
|
||||
// 统计日期
|
||||
statisticsDate?: string;
|
||||
// 统计类型: 1日统计, 2月统计, 3年统计
|
||||
statisticsType?: number;
|
||||
// 运行天数
|
||||
runDays?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 操作用户ID
|
||||
userId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 状态: 0禁用, 1启用
|
||||
status?: string;
|
||||
// 是否删除: 0否, 1是
|
||||
deleted?: string;
|
||||
// 租户ID
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 站点统计信息表搜索条件
|
||||
*/
|
||||
export interface CmsStatisticsParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user