Merge branch 'dev' of https://gitee.com/yudaocode/yudao-ui-admin-vben into dev_xx
commit
0f701dd49b
|
|
@ -1,3 +1,4 @@
|
|||
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { h } from 'vue';
|
||||
|
|
@ -9,9 +10,20 @@ import {
|
|||
setupVbenVxeTable,
|
||||
useVbenVxeGrid,
|
||||
} from '@vben/plugins/vxe-table';
|
||||
import { isFunction, isString } from '@vben/utils';
|
||||
import {
|
||||
erpNumberFormatter,
|
||||
formatToFractionDigit,
|
||||
isFunction,
|
||||
isString,
|
||||
} from '@vben/utils';
|
||||
|
||||
import { Button, Image, Popconfirm, Switch } from 'ant-design-vue';
|
||||
import {
|
||||
Button,
|
||||
Image,
|
||||
ImagePreviewGroup,
|
||||
Popconfirm,
|
||||
Switch,
|
||||
} from 'ant-design-vue';
|
||||
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { $t } from '#/locales';
|
||||
|
|
@ -63,7 +75,7 @@ setupVbenVxeTable({
|
|||
round: true,
|
||||
showOverflow: true,
|
||||
size: 'small',
|
||||
},
|
||||
} as VxeTableGridOptions,
|
||||
});
|
||||
|
||||
// 表格配置项可以用 cellRender: { name: 'CellImage' },
|
||||
|
|
@ -74,6 +86,20 @@ setupVbenVxeTable({
|
|||
},
|
||||
});
|
||||
|
||||
vxeUI.renderer.add('CellImages', {
|
||||
renderTableDefault(_renderOpts, params) {
|
||||
const { column, row } = params;
|
||||
if (column && column.field && row[column.field]) {
|
||||
return h(ImagePreviewGroup, {}, () => {
|
||||
return row[column.field].map((item: any) =>
|
||||
h(Image, { src: item }),
|
||||
);
|
||||
});
|
||||
}
|
||||
return '';
|
||||
},
|
||||
});
|
||||
|
||||
// 表格配置项可以用 cellRender: { name: 'CellLink' },
|
||||
vxeUI.renderer.add('CellLink', {
|
||||
renderTableDefault(renderOpts) {
|
||||
|
|
@ -267,36 +293,48 @@ setupVbenVxeTable({
|
|||
|
||||
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
||||
// vxeUI.formats.add
|
||||
// add by 星语:数量格式化,例如说:金额
|
||||
vxeUI.formats.add('formatNumber', {
|
||||
tableCellFormatMethod({ cellValue }, digits = 2) {
|
||||
|
||||
vxeUI.formats.add('formatPast2', {
|
||||
tableCellFormatMethod({ cellValue }) {
|
||||
if (cellValue === null || cellValue === undefined) {
|
||||
return '';
|
||||
}
|
||||
if (isString(cellValue)) {
|
||||
cellValue = Number.parseFloat(cellValue);
|
||||
// 定义时间单位常量,便于维护
|
||||
const SECOND = 1000;
|
||||
const MINUTE = 60 * SECOND;
|
||||
const HOUR = 60 * MINUTE;
|
||||
const DAY = 24 * HOUR;
|
||||
|
||||
// 计算各时间单位
|
||||
const day = Math.floor(cellValue / DAY);
|
||||
const hour = Math.floor((cellValue % DAY) / HOUR);
|
||||
const minute = Math.floor((cellValue % HOUR) / MINUTE);
|
||||
const second = Math.floor((cellValue % MINUTE) / SECOND);
|
||||
|
||||
// 根据时间长短返回不同格式
|
||||
if (day > 0) {
|
||||
return `${day} 天${hour} 小时 ${minute} 分钟`;
|
||||
}
|
||||
// 如果非 number,则直接返回空串
|
||||
if (Number.isNaN(cellValue)) {
|
||||
return '';
|
||||
if (hour > 0) {
|
||||
return `${hour} 小时 ${minute} 分钟`;
|
||||
}
|
||||
return cellValue.toFixed(digits);
|
||||
if (minute > 0) {
|
||||
return `${minute} 分钟`;
|
||||
}
|
||||
return second > 0 ? `${second} 秒` : `${0} 秒`;
|
||||
},
|
||||
});
|
||||
|
||||
vxeUI.formats.add('formatFraction', {
|
||||
tableCellFormatMethod({ cellValue }) {
|
||||
if (cellValue === null || cellValue === undefined) {
|
||||
return '0.00';
|
||||
}
|
||||
if (isString(cellValue)) {
|
||||
cellValue = Number.parseFloat(cellValue);
|
||||
}
|
||||
// 如果非 number,则直接返回空串
|
||||
if (Number.isNaN(cellValue)) {
|
||||
return '0.00';
|
||||
}
|
||||
return `${(cellValue / 100).toFixed(2)}元`;
|
||||
// add by 星语:数量格式化,例如说:金额
|
||||
vxeUI.formats.add('formatNumber', {
|
||||
tableCellFormatMethod({ cellValue }, digits = 2) {
|
||||
return formatToFractionDigit(cellValue, digits);
|
||||
},
|
||||
});
|
||||
|
||||
vxeUI.formats.add('formatAmount2', {
|
||||
tableCellFormatMethod({ cellValue }, digits = 2) {
|
||||
return `${erpNumberFormatter(cellValue, digits)}元`;
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmCategoryApi {
|
||||
/** BPM 流程分类 VO */
|
||||
export interface CategoryVO {
|
||||
/** 流程分类 */
|
||||
export interface Category {
|
||||
id: number;
|
||||
name: string;
|
||||
code: string;
|
||||
|
|
@ -16,7 +16,7 @@ export namespace BpmCategoryApi {
|
|||
|
||||
/** 查询流程分类分页 */
|
||||
export async function getCategoryPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmCategoryApi.CategoryVO>>(
|
||||
return requestClient.get<PageResult<BpmCategoryApi.Category>>(
|
||||
'/bpm/category/page',
|
||||
{ params },
|
||||
);
|
||||
|
|
@ -24,18 +24,18 @@ export async function getCategoryPage(params: PageParam) {
|
|||
|
||||
/** 查询流程分类详情 */
|
||||
export async function getCategory(id: number) {
|
||||
return requestClient.get<BpmCategoryApi.CategoryVO>(
|
||||
return requestClient.get<BpmCategoryApi.Category>(
|
||||
`/bpm/category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增流程分类 */
|
||||
export async function createCategory(data: BpmCategoryApi.CategoryVO) {
|
||||
export async function createCategory(data: BpmCategoryApi.Category) {
|
||||
return requestClient.post<number>('/bpm/category/create', data);
|
||||
}
|
||||
|
||||
/** 修改流程分类 */
|
||||
export async function updateCategory(data: BpmCategoryApi.CategoryVO) {
|
||||
export async function updateCategory(data: BpmCategoryApi.Category) {
|
||||
return requestClient.put<boolean>('/bpm/category/update', data);
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ export async function deleteCategory(id: number) {
|
|||
|
||||
/** 查询流程分类列表 */
|
||||
export async function getCategorySimpleList() {
|
||||
return requestClient.get<BpmCategoryApi.CategoryVO[]>(
|
||||
return requestClient.get<BpmCategoryApi.Category[]>(
|
||||
`/bpm/category/simple-list`,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/** 流程定义 */
|
||||
export namespace BpmProcessDefinitionApi {
|
||||
// 流程定义
|
||||
export interface ProcessDefinitionVO {
|
||||
/** 流程定义 */
|
||||
export interface ProcessDefinition {
|
||||
id: string;
|
||||
version: number;
|
||||
deploymentTime: number;
|
||||
|
|
@ -15,12 +14,13 @@ export namespace BpmProcessDefinitionApi {
|
|||
formType?: number;
|
||||
bpmnXml?: string;
|
||||
simpleModel?: string;
|
||||
formFields?: string[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询流程定义 */
|
||||
export async function getProcessDefinition(id?: string, key?: string) {
|
||||
return requestClient.get<BpmProcessDefinitionApi.ProcessDefinitionVO>(
|
||||
return requestClient.get<BpmProcessDefinitionApi.ProcessDefinition>(
|
||||
'/bpm/process-definition/get',
|
||||
{
|
||||
params: { id, key },
|
||||
|
|
@ -31,13 +31,13 @@ export async function getProcessDefinition(id?: string, key?: string) {
|
|||
/** 分页查询流程定义 */
|
||||
export async function getProcessDefinitionPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<BpmProcessDefinitionApi.ProcessDefinitionVO>
|
||||
PageResult<BpmProcessDefinitionApi.ProcessDefinition>
|
||||
>('/bpm/process-definition/page', { params });
|
||||
}
|
||||
|
||||
/** 查询流程定义列表 */
|
||||
export async function getProcessDefinitionList(params: any) {
|
||||
return requestClient.get<BpmProcessDefinitionApi.ProcessDefinitionVO[]>(
|
||||
return requestClient.get<BpmProcessDefinitionApi.ProcessDefinition[]>(
|
||||
'/bpm/process-definition/list',
|
||||
{
|
||||
params,
|
||||
|
|
@ -48,6 +48,6 @@ export async function getProcessDefinitionList(params: any) {
|
|||
/** 查询流程定义列表(简单列表) */
|
||||
export async function getSimpleProcessDefinitionList() {
|
||||
return requestClient.get<
|
||||
PageResult<BpmProcessDefinitionApi.ProcessDefinitionVO>
|
||||
PageResult<BpmProcessDefinitionApi.ProcessDefinition>
|
||||
>('/bpm/process-definition/simple-list');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmFormApi {
|
||||
// 流程表单
|
||||
export interface FormVO {
|
||||
/** 流程表单 */
|
||||
export interface Form {
|
||||
id?: number | undefined;
|
||||
name: string;
|
||||
conf: string;
|
||||
|
|
@ -17,23 +17,23 @@ export namespace BpmFormApi {
|
|||
|
||||
/** 获取表单分页列表 */
|
||||
export async function getFormPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmFormApi.FormVO>>('/bpm/form/page', {
|
||||
return requestClient.get<PageResult<BpmFormApi.Form>>('/bpm/form/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取表单详情 */
|
||||
export async function getFormDetail(id: number | string) {
|
||||
return requestClient.get<BpmFormApi.FormVO>(`/bpm/form/get?id=${id}`);
|
||||
export async function getFormDetail(id: number) {
|
||||
return requestClient.get<BpmFormApi.Form>(`/bpm/form/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 创建表单 */
|
||||
export async function createForm(data: BpmFormApi.FormVO) {
|
||||
export async function createForm(data: BpmFormApi.Form) {
|
||||
return requestClient.post('/bpm/form/create', data);
|
||||
}
|
||||
|
||||
/** 更新表单 */
|
||||
export async function updateForm(data: BpmFormApi.FormVO) {
|
||||
export async function updateForm(data: BpmFormApi.Form) {
|
||||
return requestClient.put('/bpm/form/update', data);
|
||||
}
|
||||
|
||||
|
|
@ -44,5 +44,5 @@ export async function deleteForm(id: number) {
|
|||
|
||||
/** 获取表单简单列表 */
|
||||
export async function getFormSimpleList() {
|
||||
return requestClient.get<BpmFormApi.FormVO[]>('/bpm/form/simple-list');
|
||||
return requestClient.get<BpmFormApi.Form[]>('/bpm/form/simple-list');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ export namespace BpmModelApi {
|
|||
deptName?: string;
|
||||
}
|
||||
|
||||
/** 流程定义 VO */
|
||||
export interface ProcessDefinitionVO {
|
||||
/** 流程定义 */
|
||||
export interface ProcessDefinition {
|
||||
id: string;
|
||||
key?: string;
|
||||
version: number;
|
||||
|
|
@ -22,8 +22,8 @@ export namespace BpmModelApi {
|
|||
formCustomViewPath?: string;
|
||||
}
|
||||
|
||||
/** 流程模型 VO */
|
||||
export interface ModelVO {
|
||||
/** 流程模型 */
|
||||
export interface Model {
|
||||
id: number;
|
||||
key: string;
|
||||
name: string;
|
||||
|
|
@ -35,7 +35,7 @@ export namespace BpmModelApi {
|
|||
formId: number;
|
||||
formCustomCreatePath: string;
|
||||
formCustomViewPath: string;
|
||||
processDefinition: ProcessDefinitionVO;
|
||||
processDefinition: ProcessDefinition;
|
||||
status: number;
|
||||
remark: string;
|
||||
createTime: string;
|
||||
|
|
@ -48,23 +48,23 @@ export namespace BpmModelApi {
|
|||
export interface ModelCategoryInfo {
|
||||
id: number;
|
||||
name: string;
|
||||
modelList: BpmModelApi.ModelVO[];
|
||||
modelList: BpmModelApi.Model[];
|
||||
}
|
||||
|
||||
/** 获取流程模型列表 */
|
||||
export async function getModelList(name: string | undefined) {
|
||||
return requestClient.get<BpmModelApi.ModelVO[]>('/bpm/model/list', {
|
||||
return requestClient.get<BpmModelApi.Model[]>('/bpm/model/list', {
|
||||
params: { name },
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取流程模型详情 */
|
||||
export async function getModel(id: string) {
|
||||
return requestClient.get<BpmModelApi.ModelVO>(`/bpm/model/get?id=${id}`);
|
||||
return requestClient.get<BpmModelApi.Model>(`/bpm/model/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 更新流程模型 */
|
||||
export async function updateModel(data: BpmModelApi.ModelVO) {
|
||||
export async function updateModel(data: BpmModelApi.Model) {
|
||||
return requestClient.put('/bpm/model/update', data);
|
||||
}
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ export async function updateModelSortBatch(ids: number[]) {
|
|||
}
|
||||
|
||||
/** 更新流程模型的 BPMN XML */
|
||||
export async function updateModelBpmn(data: BpmModelApi.ModelVO) {
|
||||
export async function updateModelBpmn(data: BpmModelApi.Model) {
|
||||
return requestClient.put('/bpm/model/update-bpmn', data);
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ export async function updateModelState(id: number, state: number) {
|
|||
}
|
||||
|
||||
/** 创建流程模型 */
|
||||
export async function createModel(data: BpmModelApi.ModelVO) {
|
||||
export async function createModel(data: BpmModelApi.Model) {
|
||||
return requestClient.post('/bpm/model/create', data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmOALeaveApi {
|
||||
export interface LeaveVO {
|
||||
export interface Leave {
|
||||
id: number;
|
||||
status: number;
|
||||
type: number;
|
||||
|
|
@ -17,23 +17,23 @@ export namespace BpmOALeaveApi {
|
|||
}
|
||||
|
||||
/** 创建请假申请 */
|
||||
export async function createLeave(data: BpmOALeaveApi.LeaveVO) {
|
||||
export async function createLeave(data: BpmOALeaveApi.Leave) {
|
||||
return requestClient.post('/bpm/oa/leave/create', data);
|
||||
}
|
||||
|
||||
/** 更新请假申请 */
|
||||
export async function updateLeave(data: BpmOALeaveApi.LeaveVO) {
|
||||
export async function updateLeave(data: BpmOALeaveApi.Leave) {
|
||||
return requestClient.post('/bpm/oa/leave/update', data);
|
||||
}
|
||||
|
||||
/** 获得请假申请 */
|
||||
export async function getLeave(id: number) {
|
||||
return requestClient.get<BpmOALeaveApi.LeaveVO>(`/bpm/oa/leave/get?id=${id}`);
|
||||
return requestClient.get<BpmOALeaveApi.Leave>(`/bpm/oa/leave/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得请假申请分页 */
|
||||
export async function getLeavePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmOALeaveApi.LeaveVO>>(
|
||||
return requestClient.get<PageResult<BpmOALeaveApi.Leave>>(
|
||||
'/bpm/oa/leave/page',
|
||||
{ params },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessExpressionApi {
|
||||
/** BPM 流程表达式 VO */
|
||||
export interface ProcessExpressionVO {
|
||||
/** 流程表达式 */
|
||||
export interface ProcessExpression {
|
||||
id: number; // 编号
|
||||
name: string; // 表达式名字
|
||||
status: number; // 表达式状态
|
||||
|
|
@ -15,27 +15,27 @@ export namespace BpmProcessExpressionApi {
|
|||
/** 查询流程表达式分页 */
|
||||
export async function getProcessExpressionPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<BpmProcessExpressionApi.ProcessExpressionVO>
|
||||
PageResult<BpmProcessExpressionApi.ProcessExpression>
|
||||
>('/bpm/process-expression/page', { params });
|
||||
}
|
||||
|
||||
/** 查询流程表达式详情 */
|
||||
export async function getProcessExpression(id: number) {
|
||||
return requestClient.get<BpmProcessExpressionApi.ProcessExpressionVO>(
|
||||
return requestClient.get<BpmProcessExpressionApi.ProcessExpression>(
|
||||
`/bpm/process-expression/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增流程表达式 */
|
||||
export async function createProcessExpression(
|
||||
data: BpmProcessExpressionApi.ProcessExpressionVO,
|
||||
data: BpmProcessExpressionApi.ProcessExpression,
|
||||
) {
|
||||
return requestClient.post<number>('/bpm/process-expression/create', data);
|
||||
}
|
||||
|
||||
/** 修改流程表达式 */
|
||||
export async function updateProcessExpression(
|
||||
data: BpmProcessExpressionApi.ProcessExpressionVO,
|
||||
data: BpmProcessExpressionApi.ProcessExpression,
|
||||
) {
|
||||
return requestClient.put<boolean>('/bpm/process-expression/update', data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,29 +8,30 @@ import type { BpmCandidateStrategyEnum, BpmNodeTypeEnum } from '#/utils';
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessInstanceApi {
|
||||
export type Task = {
|
||||
// TODO @芋艿:一些注释缺少或者不对;
|
||||
export interface Task {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type User = {
|
||||
export interface User {
|
||||
avatar: string;
|
||||
id: number;
|
||||
nickname: string;
|
||||
};
|
||||
}
|
||||
|
||||
// 审批任务信息
|
||||
export type ApprovalTaskInfo = {
|
||||
export interface ApprovalTaskInfo {
|
||||
assigneeUser: User;
|
||||
id: number;
|
||||
ownerUser: User;
|
||||
reason: string;
|
||||
signPicUrl: string;
|
||||
status: number;
|
||||
};
|
||||
}
|
||||
|
||||
// 审批节点信息
|
||||
export type ApprovalNodeInfo = {
|
||||
export interface ApprovalNodeInfo {
|
||||
candidateStrategy?: BpmCandidateStrategyEnum;
|
||||
candidateUsers?: User[];
|
||||
endTime?: Date;
|
||||
|
|
@ -40,10 +41,10 @@ export namespace BpmProcessInstanceApi {
|
|||
startTime?: Date;
|
||||
status: number;
|
||||
tasks: ApprovalTaskInfo[];
|
||||
};
|
||||
}
|
||||
|
||||
// 流程实例
|
||||
export type ProcessInstanceVO = {
|
||||
/** 流程实例 */
|
||||
export interface ProcessInstance {
|
||||
businessKey: string;
|
||||
category: string;
|
||||
createTime: string;
|
||||
|
|
@ -52,7 +53,7 @@ export namespace BpmProcessInstanceApi {
|
|||
formVariables: Record<string, any>;
|
||||
id: number;
|
||||
name: string;
|
||||
processDefinition?: BpmModelApi.ProcessDefinitionVO;
|
||||
processDefinition?: BpmModelApi.ProcessDefinition;
|
||||
processDefinitionId: string;
|
||||
remark: string;
|
||||
result: number;
|
||||
|
|
@ -60,20 +61,20 @@ export namespace BpmProcessInstanceApi {
|
|||
startUser?: User;
|
||||
status: number;
|
||||
tasks?: BpmProcessInstanceApi.Task[];
|
||||
};
|
||||
}
|
||||
|
||||
// 审批详情
|
||||
export type ApprovalDetail = {
|
||||
export interface ApprovalDetail {
|
||||
activityNodes: BpmProcessInstanceApi.ApprovalNodeInfo[];
|
||||
formFieldsPermission: any;
|
||||
processDefinition: BpmModelApi.ProcessDefinitionVO;
|
||||
processInstance: BpmProcessInstanceApi.ProcessInstanceVO;
|
||||
processDefinition: BpmModelApi.ProcessDefinition;
|
||||
processInstance: BpmProcessInstanceApi.ProcessInstance;
|
||||
status: number;
|
||||
todoTask: BpmTaskApi.TaskVO;
|
||||
};
|
||||
todoTask: BpmTaskApi.Task;
|
||||
}
|
||||
|
||||
// 抄送流程实例 VO
|
||||
export type CopyVO = {
|
||||
// 抄送流程实例
|
||||
export interface Copy {
|
||||
activityId: string;
|
||||
activityName: string;
|
||||
createTime: number;
|
||||
|
|
@ -89,12 +90,12 @@ export namespace BpmProcessInstanceApi {
|
|||
value: string;
|
||||
}[];
|
||||
taskId: string;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询我的流程实例分页 */
|
||||
export async function getProcessInstanceMyPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstanceVO>>(
|
||||
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstance>>(
|
||||
'/bpm/process-instance/my-page',
|
||||
{ params },
|
||||
);
|
||||
|
|
@ -102,7 +103,7 @@ export async function getProcessInstanceMyPage(params: PageParam) {
|
|||
|
||||
/** 查询管理员流程实例分页 */
|
||||
export async function getProcessInstanceManagerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstanceVO>>(
|
||||
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstance>>(
|
||||
'/bpm/process-instance/manager-page',
|
||||
{ params },
|
||||
);
|
||||
|
|
@ -110,7 +111,7 @@ export async function getProcessInstanceManagerPage(params: PageParam) {
|
|||
|
||||
/** 新增流程实例 */
|
||||
export async function createProcessInstance(data: any) {
|
||||
return requestClient.post<BpmProcessInstanceApi.ProcessInstanceVO>(
|
||||
return requestClient.post<BpmProcessInstanceApi.ProcessInstance>(
|
||||
'/bpm/process-instance/create',
|
||||
data,
|
||||
);
|
||||
|
|
@ -141,14 +142,14 @@ export async function cancelProcessInstanceByAdmin(id: number, reason: string) {
|
|||
|
||||
/** 查询流程实例详情 */
|
||||
export async function getProcessInstance(id: number) {
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstanceVO>(
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
||||
`/bpm/process-instance/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询复制流程实例分页 */
|
||||
export async function getProcessInstanceCopyPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstanceVO>>(
|
||||
return requestClient.get<PageResult<BpmProcessInstanceApi.ProcessInstance>>(
|
||||
'/bpm/process-instance/copy/page',
|
||||
{ params },
|
||||
);
|
||||
|
|
@ -156,9 +157,9 @@ export async function getProcessInstanceCopyPage(params: PageParam) {
|
|||
|
||||
/** 更新流程实例 */
|
||||
export async function updateProcessInstance(
|
||||
data: BpmProcessInstanceApi.ProcessInstanceVO,
|
||||
data: BpmProcessInstanceApi.ProcessInstance,
|
||||
) {
|
||||
return requestClient.put<BpmProcessInstanceApi.ProcessInstanceVO>(
|
||||
return requestClient.put<BpmProcessInstanceApi.ProcessInstance>(
|
||||
'/bpm/process-instance/update',
|
||||
data,
|
||||
);
|
||||
|
|
@ -182,7 +183,7 @@ export async function getNextApprovalNodes(params: any) {
|
|||
|
||||
/** 获取表单字段权限 */
|
||||
export async function getFormFieldsPermission(params: any) {
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstanceVO>(
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
||||
`/bpm/process-instance/get-form-fields-permission`,
|
||||
{ params },
|
||||
);
|
||||
|
|
@ -190,7 +191,7 @@ export async function getFormFieldsPermission(params: any) {
|
|||
|
||||
/** 获取流程实例 BPMN 模型视图 */
|
||||
export async function getProcessInstanceBpmnModelView(id: string) {
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstanceVO>(
|
||||
return requestClient.get<BpmProcessInstanceApi.ProcessInstance>(
|
||||
`/bpm/process-instance/get-bpmn-model-view?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmProcessListenerApi {
|
||||
/** BPM 流程监听器 VO */
|
||||
export interface ProcessListenerVO {
|
||||
/** BPM 流程监听器 */
|
||||
export interface ProcessListener {
|
||||
id: number; // 编号
|
||||
name: string; // 监听器名字
|
||||
type: string; // 监听器类型
|
||||
|
|
@ -17,7 +17,7 @@ export namespace BpmProcessListenerApi {
|
|||
|
||||
/** 查询流程监听器分页 */
|
||||
export async function getProcessListenerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmProcessListenerApi.ProcessListenerVO>>(
|
||||
return requestClient.get<PageResult<BpmProcessListenerApi.ProcessListener>>(
|
||||
'/bpm/process-listener/page',
|
||||
{ params },
|
||||
);
|
||||
|
|
@ -25,21 +25,21 @@ export async function getProcessListenerPage(params: PageParam) {
|
|||
|
||||
/** 查询流程监听器详情 */
|
||||
export async function getProcessListener(id: number) {
|
||||
return requestClient.get<BpmProcessListenerApi.ProcessListenerVO>(
|
||||
return requestClient.get<BpmProcessListenerApi.ProcessListener>(
|
||||
`/bpm/process-listener/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增流程监听器 */
|
||||
export async function createProcessListener(
|
||||
data: BpmProcessListenerApi.ProcessListenerVO,
|
||||
data: BpmProcessListenerApi.ProcessListener,
|
||||
) {
|
||||
return requestClient.post<number>('/bpm/process-listener/create', data);
|
||||
}
|
||||
|
||||
/** 修改流程监听器 */
|
||||
export async function updateProcessListener(
|
||||
data: BpmProcessListenerApi.ProcessListenerVO,
|
||||
data: BpmProcessListenerApi.ProcessListener,
|
||||
) {
|
||||
return requestClient.put<boolean>('/bpm/process-listener/update', data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import type { BpmProcessInstanceApi } from '../processInstance';
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmTaskApi {
|
||||
/** BPM 流程监听器 VO */
|
||||
export interface TaskVO {
|
||||
/** BPM 流程监听器 */
|
||||
export interface Task {
|
||||
id: number; // 编号
|
||||
name: string; // 监听器名字
|
||||
type: string; // 监听器类型
|
||||
|
|
@ -15,8 +15,8 @@ export namespace BpmTaskApi {
|
|||
valueType: string; // 监听器值类型
|
||||
}
|
||||
|
||||
// 流程任务 VO
|
||||
export interface TaskManagerVO {
|
||||
// 流程任务
|
||||
export interface TaskManager {
|
||||
id: string; // 编号
|
||||
name: string; // 任务名称
|
||||
createTime: number; // 创建时间
|
||||
|
|
@ -28,7 +28,7 @@ export namespace BpmTaskApi {
|
|||
assigneeUser: any; // 处理人
|
||||
taskDefinitionKey: string; // 任务定义key
|
||||
processInstanceId: string; // 流程实例id
|
||||
processInstance: BpmProcessInstanceApi.ProcessInstanceVO; // 流程实例
|
||||
processInstance: BpmProcessInstanceApi.ProcessInstance; // 流程实例
|
||||
parentTaskId: any; // 父任务id
|
||||
children: any; // 子任务
|
||||
formId: any; // 表单id
|
||||
|
|
@ -45,27 +45,21 @@ export namespace BpmTaskApi {
|
|||
|
||||
/** 查询待办任务分页 */
|
||||
export async function getTaskTodoPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmTaskApi.TaskVO>>(
|
||||
'/bpm/task/todo-page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
return requestClient.get<PageResult<BpmTaskApi.Task>>('/bpm/task/todo-page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询已办任务分页 */
|
||||
export async function getTaskDonePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmTaskApi.TaskVO>>(
|
||||
'/bpm/task/done-page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
return requestClient.get<PageResult<BpmTaskApi.Task>>('/bpm/task/done-page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询任务管理分页 */
|
||||
export async function getTaskManagerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmTaskApi.TaskVO>>(
|
||||
return requestClient.get<PageResult<BpmTaskApi.Task>>(
|
||||
'/bpm/task/manager-page',
|
||||
{ params },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ import type { PageParam, PageResult } from '@vben/request';
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace BpmUserGroupApi {
|
||||
/** BPM 用户组 VO */
|
||||
export interface UserGroupVO {
|
||||
/** BPM 用户组 */
|
||||
export interface UserGroup {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
|
|
@ -17,7 +17,7 @@ export namespace BpmUserGroupApi {
|
|||
|
||||
/** 查询用户组分页 */
|
||||
export async function getUserGroupPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<BpmUserGroupApi.UserGroupVO>>(
|
||||
return requestClient.get<PageResult<BpmUserGroupApi.UserGroup>>(
|
||||
'/bpm/user-group/page',
|
||||
{ params },
|
||||
);
|
||||
|
|
@ -25,18 +25,18 @@ export async function getUserGroupPage(params: PageParam) {
|
|||
|
||||
/** 查询用户组详情 */
|
||||
export async function getUserGroup(id: number) {
|
||||
return requestClient.get<BpmUserGroupApi.UserGroupVO>(
|
||||
return requestClient.get<BpmUserGroupApi.UserGroup>(
|
||||
`/bpm/user-group/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增用户组 */
|
||||
export async function createUserGroup(data: BpmUserGroupApi.UserGroupVO) {
|
||||
export async function createUserGroup(data: BpmUserGroupApi.UserGroup) {
|
||||
return requestClient.post<number>('/bpm/user-group/create', data);
|
||||
}
|
||||
|
||||
/** 修改用户组 */
|
||||
export async function updateUserGroup(data: BpmUserGroupApi.UserGroupVO) {
|
||||
export async function updateUserGroup(data: BpmUserGroupApi.UserGroup) {
|
||||
return requestClient.put<boolean>('/bpm/user-group/update', data);
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ export async function deleteUserGroup(id: number) {
|
|||
|
||||
/** 查询用户组列表 */
|
||||
export async function getUserGroupSimpleList() {
|
||||
return requestClient.get<BpmUserGroupApi.UserGroupVO[]>(
|
||||
return requestClient.get<BpmUserGroupApi.UserGroup[]>(
|
||||
`/bpm/user-group/simple-list`,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,11 @@ export namespace CrmCustomerApi {
|
|||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
export interface CustomerImport {
|
||||
ownerUserId: number;
|
||||
file: File;
|
||||
updateSupport: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询客户列表 */
|
||||
|
|
@ -78,8 +83,8 @@ export function importCustomerTemplate() {
|
|||
}
|
||||
|
||||
/** 导入客户 */
|
||||
export function importCustomer(file: File) {
|
||||
return requestClient.upload('/crm/customer/import', { file });
|
||||
export function importCustomer(data: CrmCustomerApi.CustomerImport) {
|
||||
return requestClient.upload('/crm/customer/import', data);
|
||||
}
|
||||
|
||||
/** 获取客户精简信息列表 */
|
||||
|
|
|
|||
|
|
@ -34,10 +34,21 @@ export namespace CrmReceivableApi {
|
|||
createTime: Date; // 创建时间
|
||||
updateTime: Date; // 更新时间
|
||||
}
|
||||
|
||||
export interface ReceivablePageParam extends PageParam {
|
||||
no?: string;
|
||||
planId?: number;
|
||||
customerId?: number;
|
||||
contractId?: number;
|
||||
sceneType?: number;
|
||||
auditStatus?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询回款列表 */
|
||||
export function getReceivablePage(params: PageParam) {
|
||||
export function getReceivablePage(
|
||||
params: CrmReceivableApi.ReceivablePageParam,
|
||||
) {
|
||||
return requestClient.get<PageResult<CrmReceivableApi.Receivable>>(
|
||||
'/crm/receivable/page',
|
||||
{ params },
|
||||
|
|
@ -45,7 +56,9 @@ export function getReceivablePage(params: PageParam) {
|
|||
}
|
||||
|
||||
/** 查询回款列表,基于指定客户 */
|
||||
export function getReceivablePageByCustomer(params: PageParam) {
|
||||
export function getReceivablePageByCustomer(
|
||||
params: CrmReceivableApi.ReceivablePageParam,
|
||||
) {
|
||||
return requestClient.get<PageResult<CrmReceivableApi.Receivable>>(
|
||||
'/crm/receivable/page-by-customer',
|
||||
{ params },
|
||||
|
|
|
|||
|
|
@ -29,10 +29,20 @@ export namespace CrmReceivablePlanApi {
|
|||
returnTime: Date;
|
||||
};
|
||||
}
|
||||
|
||||
export interface PlanPageParam extends PageParam {
|
||||
customerId?: number;
|
||||
contractId?: number;
|
||||
contractNo?: string;
|
||||
sceneType?: number;
|
||||
remindType?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询回款计划列表 */
|
||||
export function getReceivablePlanPage(params: PageParam) {
|
||||
export function getReceivablePlanPage(
|
||||
params: CrmReceivablePlanApi.PlanPageParam,
|
||||
) {
|
||||
return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
|
||||
'/crm/receivable-plan/page',
|
||||
{ params },
|
||||
|
|
@ -40,7 +50,9 @@ export function getReceivablePlanPage(params: PageParam) {
|
|||
}
|
||||
|
||||
/** 查询回款计划列表(按客户) */
|
||||
export function getReceivablePlanPageByCustomer(params: PageParam) {
|
||||
export function getReceivablePlanPageByCustomer(
|
||||
params: CrmReceivablePlanApi.PlanPageParam,
|
||||
) {
|
||||
return requestClient.get<PageResult<CrmReceivablePlanApi.Plan>>(
|
||||
'/crm/receivable-plan/page-by-customer',
|
||||
{ params },
|
||||
|
|
|
|||
|
|
@ -65,13 +65,13 @@ export namespace InfraCodegenApi {
|
|||
}
|
||||
|
||||
/** 更新代码生成请求 */
|
||||
export interface CodegenUpdateReqVO {
|
||||
export interface CodegenUpdateReq {
|
||||
table: any | CodegenTable;
|
||||
columns: CodegenColumn[];
|
||||
}
|
||||
|
||||
/** 创建代码生成请求 */
|
||||
export interface CodegenCreateListReqVO {
|
||||
export interface CodegenCreateListReq {
|
||||
dataSourceConfigId?: number;
|
||||
tableNames: string[];
|
||||
}
|
||||
|
|
@ -106,7 +106,7 @@ export function getCodegenTable(tableId: number) {
|
|||
}
|
||||
|
||||
/** 修改代码生成表定义 */
|
||||
export function updateCodegenTable(data: InfraCodegenApi.CodegenUpdateReqVO) {
|
||||
export function updateCodegenTable(data: InfraCodegenApi.CodegenUpdateReq) {
|
||||
return requestClient.put('/infra/codegen/update', data);
|
||||
}
|
||||
|
||||
|
|
@ -136,9 +136,7 @@ export function getSchemaTableList(params: any) {
|
|||
}
|
||||
|
||||
/** 基于数据库的表结构,创建代码生成器的表定义 */
|
||||
export function createCodegenList(
|
||||
data: InfraCodegenApi.CodegenCreateListReqVO,
|
||||
) {
|
||||
export function createCodegenList(data: InfraCodegenApi.CodegenCreateListReq) {
|
||||
return requestClient.post('/infra/codegen/create-list', data);
|
||||
}
|
||||
|
||||
|
|
@ -148,3 +146,10 @@ export function deleteCodegenTable(tableId: number) {
|
|||
params: { tableId },
|
||||
});
|
||||
}
|
||||
|
||||
/** 批量删除代码生成表定义 */
|
||||
export function deleteCodegenTableList(tableIds: number[]) {
|
||||
return requestClient.delete(
|
||||
`/infra/codegen/delete-list?tableIds=${tableIds.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,9 +54,14 @@ export function deleteConfig(id: number) {
|
|||
return requestClient.delete(`/infra/config/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除参数 */
|
||||
export function deleteConfigList(ids: number[]) {
|
||||
return requestClient.delete(`/infra/config/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 导出参数 */
|
||||
export function exportConfig(params: any) {
|
||||
return requestClient.download('/infra/config/export', {
|
||||
return requestClient.download('/infra/config/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@ export function deleteDemo01Contact(id: number) {
|
|||
}
|
||||
|
||||
/** 批量删除示例联系人 */
|
||||
// TODO @puhui999:ByIds,这种按照约定,是不带的,针对 Id 的情况哈。
|
||||
export function deleteDemo01ContactListByIds(ids: number[]) {
|
||||
export function deleteDemo01ContactList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/infra/demo01-contact/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ export function deleteDemo03Student(id: number) {
|
|||
}
|
||||
|
||||
/** 批量删除学生 */
|
||||
export function deleteDemo03StudentListByIds(ids: number[]) {
|
||||
export function deleteDemo03StudentList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/infra/demo03-student-erp/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
|
|
@ -109,7 +109,7 @@ export function deleteDemo03Course(id: number) {
|
|||
}
|
||||
|
||||
/** 批量删除学生课程 */
|
||||
export function deleteDemo03CourseListByIds(ids: number[]) {
|
||||
export function deleteDemo03CourseList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/infra/demo03-student-erp/demo03-course/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
|
|
@ -155,7 +155,7 @@ export function deleteDemo03Grade(id: number) {
|
|||
}
|
||||
|
||||
/** 批量删除学生班级 */
|
||||
export function deleteDemo03GradeListByIds(ids: number[]) {
|
||||
export function deleteDemo03GradeList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/infra/demo03-student-erp/demo03-grade/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ export function deleteDemo03Student(id: number) {
|
|||
}
|
||||
|
||||
/** 批量删除学生 */
|
||||
export function deleteDemo03StudentListByIds(ids: number[]) {
|
||||
export function deleteDemo03StudentList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/infra/demo03-student-inner/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ export function deleteDemo03Student(id: number) {
|
|||
}
|
||||
|
||||
/** 批量删除学生 */
|
||||
export function deleteDemo03StudentListByIds(ids: number[]) {
|
||||
export function deleteDemo03StudentList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/infra/demo03-student-normal/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -69,6 +69,13 @@ export function deleteFileConfig(id: number) {
|
|||
return requestClient.delete(`/infra/file-config/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除文件配置 */
|
||||
export function deleteFileConfigList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/infra/file-config/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 测试文件配置 */
|
||||
export function testFileConfig(id: number) {
|
||||
return requestClient.get(`/infra/file-config/test?id=${id}`);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export namespace InfraFileApi {
|
|||
}
|
||||
|
||||
/** 文件预签名地址 */
|
||||
export interface FilePresignedUrlRespVO {
|
||||
export interface FilePresignedUrlResp {
|
||||
configId: number; // 文件配置编号
|
||||
uploadUrl: string; // 文件上传 URL
|
||||
url: string; // 文件 URL
|
||||
|
|
@ -27,7 +27,7 @@ export namespace InfraFileApi {
|
|||
}
|
||||
|
||||
/** 上传文件 */
|
||||
export interface FileUploadReqVO {
|
||||
export interface FileUploadReq {
|
||||
file: globalThis.File;
|
||||
directory?: string;
|
||||
}
|
||||
|
|
@ -45,9 +45,14 @@ export function deleteFile(id: number) {
|
|||
return requestClient.delete(`/infra/file/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除文件 */
|
||||
export function deleteFileList(ids: number[]) {
|
||||
return requestClient.delete(`/infra/file/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 获取文件预签名地址 */
|
||||
export function getFilePresignedUrl(name: string, directory?: string) {
|
||||
return requestClient.get<InfraFileApi.FilePresignedUrlRespVO>(
|
||||
return requestClient.get<InfraFileApi.FilePresignedUrlResp>(
|
||||
'/infra/file/presigned-url',
|
||||
{
|
||||
params: { name, directory },
|
||||
|
|
@ -62,7 +67,7 @@ export function createFile(data: InfraFileApi.File) {
|
|||
|
||||
/** 上传文件 */
|
||||
export function uploadFile(
|
||||
data: InfraFileApi.FileUploadReqVO,
|
||||
data: InfraFileApi.FileUploadReq,
|
||||
onUploadProgress?: AxiosProgressEvent,
|
||||
) {
|
||||
// 特殊:由于 upload 内部封装,即使 directory 为 undefined,也会传递给后端
|
||||
|
|
|
|||
|
|
@ -46,6 +46,11 @@ export function deleteJob(id: number) {
|
|||
return requestClient.delete(`/infra/job/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除定时任务调度 */
|
||||
export function deleteJobList(ids: number[]) {
|
||||
return requestClient.delete(`/infra/job/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 导出定时任务调度 */
|
||||
export function exportJob(params: any) {
|
||||
return requestClient.download('/infra/job/export-excel', { params });
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBannerApi {
|
||||
/** Banner 信息 */
|
||||
export interface Banner {
|
||||
id: number;
|
||||
title: string;
|
||||
picUrl: string;
|
||||
status: number;
|
||||
url: string;
|
||||
position: number;
|
||||
sort: number;
|
||||
memo: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询Banner管理列表 */
|
||||
export function getBannerPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBannerApi.Banner>>(
|
||||
'/promotion/banner/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询Banner管理详情 */
|
||||
export function getBanner(id: number) {
|
||||
return requestClient.get<MallBannerApi.Banner>(
|
||||
`/promotion/banner/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增Banner管理 */
|
||||
export function createBanner(data: MallBannerApi.Banner) {
|
||||
return requestClient.post('/promotion/banner/create', data);
|
||||
}
|
||||
|
||||
/** 修改Banner管理 */
|
||||
export function updateBanner(data: MallBannerApi.Banner) {
|
||||
return requestClient.put('/promotion/banner/update', data);
|
||||
}
|
||||
|
||||
/** 删除Banner管理 */
|
||||
export function deleteBanner(id: number) {
|
||||
return requestClient.delete(`/promotion/banner/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBrandApi {
|
||||
/** 商品品牌 */
|
||||
export interface Brand {
|
||||
/** 品牌编号 */
|
||||
id?: number;
|
||||
/** 品牌名称 */
|
||||
name: string;
|
||||
/** 品牌图片 */
|
||||
picUrl: string;
|
||||
/** 品牌排序 */
|
||||
sort?: number;
|
||||
/** 品牌描述 */
|
||||
description?: string;
|
||||
/** 开启状态 */
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建商品品牌 */
|
||||
export function createBrand(data: MallBrandApi.Brand) {
|
||||
return requestClient.post('/product/brand/create', data);
|
||||
}
|
||||
|
||||
/** 更新商品品牌 */
|
||||
export function updateBrand(data: MallBrandApi.Brand) {
|
||||
return requestClient.put('/product/brand/update', data);
|
||||
}
|
||||
|
||||
/** 删除商品品牌 */
|
||||
export function deleteBrand(id: number) {
|
||||
return requestClient.delete(`/product/brand/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商品品牌 */
|
||||
export function getBrand(id: number) {
|
||||
return requestClient.get<MallBrandApi.Brand>(`/product/brand/get?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商品品牌列表 */
|
||||
export function getBrandPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBrandApi.Brand>>(
|
||||
'/product/brand/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商品品牌精简信息列表 */
|
||||
export function getSimpleBrandList() {
|
||||
return requestClient.get<MallBrandApi.Brand[]>(
|
||||
'/product/brand/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCategoryApi {
|
||||
/** 产品分类 */
|
||||
export interface Category {
|
||||
/** 分类编号 */
|
||||
id?: number;
|
||||
/** 父分类编号 */
|
||||
parentId?: number;
|
||||
/** 分类名称 */
|
||||
name: string;
|
||||
/** 移动端分类图 */
|
||||
picUrl: string;
|
||||
/** 分类排序 */
|
||||
sort: number;
|
||||
/** 开启状态 */
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建商品分类 */
|
||||
export function createCategory(data: MallCategoryApi.Category) {
|
||||
return requestClient.post('/product/category/create', data);
|
||||
}
|
||||
|
||||
/** 更新商品分类 */
|
||||
export function updateCategory(data: MallCategoryApi.Category) {
|
||||
return requestClient.put('/product/category/update', data);
|
||||
}
|
||||
|
||||
/** 删除商品分类 */
|
||||
export function deleteCategory(id: number) {
|
||||
return requestClient.delete(`/product/category/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商品分类 */
|
||||
export function getCategory(id: number) {
|
||||
return requestClient.get<MallCategoryApi.Category>(
|
||||
`/product/category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得商品分类列表 */
|
||||
export function getCategoryList(params: any) {
|
||||
return requestClient.get<MallCategoryApi.Category[]>(
|
||||
'/product/category/list',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCommentApi {
|
||||
export interface Property {
|
||||
propertyId: number;
|
||||
propertyName: string;
|
||||
valueId: number;
|
||||
valueName: string;
|
||||
}
|
||||
/** 商品评论 */
|
||||
export interface Comment {
|
||||
id: number;
|
||||
userId: number;
|
||||
userNickname: string;
|
||||
userAvatar: string;
|
||||
anonymous: boolean;
|
||||
orderId: number;
|
||||
orderItemId: number;
|
||||
spuId: number;
|
||||
spuName: string;
|
||||
skuId: number;
|
||||
visible: boolean;
|
||||
scores: number;
|
||||
descriptionScores: number;
|
||||
benefitScores: number;
|
||||
content: string;
|
||||
picUrls: string[];
|
||||
replyStatus: boolean;
|
||||
replyUserId: number;
|
||||
replyContent: string;
|
||||
replyTime: Date;
|
||||
createTime: Date;
|
||||
skuProperties: Property[];
|
||||
}
|
||||
|
||||
/** 评论可见性更新 */
|
||||
export interface CommentVisibleUpdate {
|
||||
id: number;
|
||||
visible: boolean;
|
||||
}
|
||||
|
||||
/** 评论回复 */
|
||||
export interface CommentReply {
|
||||
id: number;
|
||||
replyContent: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询商品评论列表 */
|
||||
export function getCommentPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallCommentApi.Comment>>(
|
||||
'/product/comment/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询商品评论详情 */
|
||||
export function getComment(id: number) {
|
||||
return requestClient.get<MallCommentApi.Comment>(
|
||||
`/product/comment/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 添加自评 */
|
||||
export function createComment(data: MallCommentApi.Comment) {
|
||||
return requestClient.post('/product/comment/create', data);
|
||||
}
|
||||
|
||||
/** 显示 / 隐藏评论 */
|
||||
export function updateCommentVisible(
|
||||
data: MallCommentApi.CommentVisibleUpdate,
|
||||
) {
|
||||
return requestClient.put('/product/comment/update-visible', data);
|
||||
}
|
||||
|
||||
/** 商家回复 */
|
||||
export function replyComment(data: MallCommentApi.CommentReply) {
|
||||
return requestClient.put('/product/comment/reply', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallFavoriteApi {
|
||||
/** 商品收藏 */
|
||||
export interface Favorite {
|
||||
/** 收藏编号 */
|
||||
id?: number;
|
||||
/** 用户编号 */
|
||||
userId?: string;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: null | number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得商品收藏列表 */
|
||||
export function getFavoritePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallFavoriteApi.Favorite>>(
|
||||
'/product/favorite/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallHistoryApi {
|
||||
/** 商品浏览记录 */
|
||||
export interface BrowseHistory {
|
||||
/** 记录编号 */
|
||||
id?: number;
|
||||
/** 用户编号 */
|
||||
userId?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 浏览时间 */
|
||||
createTime?: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得商品浏览记录分页
|
||||
*
|
||||
* @param params 请求参数
|
||||
*/
|
||||
export function getBrowseHistoryPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallHistoryApi.BrowseHistory>>(
|
||||
'/product/browse-history/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallPropertyApi {
|
||||
/** 商品属性 */
|
||||
export interface Property {
|
||||
/** 属性编号 */
|
||||
id?: number;
|
||||
/** 名称 */
|
||||
name: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 属性值 */
|
||||
export interface PropertyValue {
|
||||
/** 属性值编号 */
|
||||
id?: number;
|
||||
/** 属性项的编号 */
|
||||
propertyId?: number;
|
||||
/** 名称 */
|
||||
name: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 属性值查询参数 */
|
||||
export interface PropertyValueQuery extends PageParam {
|
||||
propertyId?: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建属性项 */
|
||||
export function createProperty(data: MallPropertyApi.Property) {
|
||||
return requestClient.post('/product/property/create', data);
|
||||
}
|
||||
|
||||
/** 更新属性项 */
|
||||
export function updateProperty(data: MallPropertyApi.Property) {
|
||||
return requestClient.put('/product/property/update', data);
|
||||
}
|
||||
|
||||
/** 删除属性项 */
|
||||
export function deleteProperty(id: number) {
|
||||
return requestClient.delete(`/product/property/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得属性项 */
|
||||
export function getProperty(id: number) {
|
||||
return requestClient.get<MallPropertyApi.Property>(
|
||||
`/product/property/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得属性项分页 */
|
||||
export function getPropertyPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallPropertyApi.Property>>(
|
||||
'/product/property/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得属性项精简列表 */
|
||||
export function getPropertySimpleList() {
|
||||
return requestClient.get<MallPropertyApi.Property[]>(
|
||||
'/product/property/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得属性值分页 */
|
||||
export function getPropertyValuePage(
|
||||
params: MallPropertyApi.PropertyValueQuery,
|
||||
) {
|
||||
return requestClient.get<PageResult<MallPropertyApi.PropertyValue>>(
|
||||
'/product/property/value/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得属性值 */
|
||||
export function getPropertyValue(id: number) {
|
||||
return requestClient.get<MallPropertyApi.PropertyValue>(
|
||||
`/product/property/value/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 创建属性值 */
|
||||
export function createPropertyValue(data: MallPropertyApi.PropertyValue) {
|
||||
return requestClient.post('/product/property/value/create', data);
|
||||
}
|
||||
|
||||
/** 更新属性值 */
|
||||
export function updatePropertyValue(data: MallPropertyApi.PropertyValue) {
|
||||
return requestClient.put('/product/property/value/update', data);
|
||||
}
|
||||
|
||||
/** 删除属性值 */
|
||||
export function deletePropertyValue(id: number) {
|
||||
return requestClient.delete(`/product/property/value/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得属性值精简列表 */
|
||||
export function getPropertyValueSimpleList(propertyId: number) {
|
||||
return requestClient.get<MallPropertyApi.PropertyValue[]>(
|
||||
'/product/property/value/simple-list',
|
||||
{
|
||||
params: { propertyId },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,177 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallSpuApi {
|
||||
/** 商品属性 */
|
||||
export interface Property {
|
||||
/** 属性编号 */
|
||||
propertyId?: number;
|
||||
/** 属性名称 */
|
||||
propertyName?: string;
|
||||
/** 属性值编号 */
|
||||
valueId?: number;
|
||||
/** 属性值名称 */
|
||||
valueName?: string;
|
||||
}
|
||||
|
||||
/** 商品 SKU */
|
||||
export interface Sku {
|
||||
/** 商品 SKU 编号 */
|
||||
id?: number;
|
||||
/** 商品 SKU 名称 */
|
||||
name?: string;
|
||||
/** SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 属性数组 */
|
||||
properties?: Property[];
|
||||
/** 商品价格 */
|
||||
price?: number | string;
|
||||
/** 市场价 */
|
||||
marketPrice?: number | string;
|
||||
/** 成本价 */
|
||||
costPrice?: number | string;
|
||||
/** 商品条码 */
|
||||
barCode?: string;
|
||||
/** 图片地址 */
|
||||
picUrl?: string;
|
||||
/** 库存 */
|
||||
stock?: number;
|
||||
/** 商品重量,单位:kg 千克 */
|
||||
weight?: number;
|
||||
/** 商品体积,单位:m^3 平米 */
|
||||
volume?: number;
|
||||
/** 一级分销的佣金 */
|
||||
firstBrokeragePrice?: number | string;
|
||||
/** 二级分销的佣金 */
|
||||
secondBrokeragePrice?: number | string;
|
||||
/** 商品销量 */
|
||||
salesCount?: number;
|
||||
}
|
||||
|
||||
/** 优惠券模板 */
|
||||
export interface GiveCouponTemplate {
|
||||
/** 优惠券编号 */
|
||||
id?: number;
|
||||
/** 优惠券名称 */
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/** 商品 SPU */
|
||||
export interface Spu {
|
||||
/** 商品编号 */
|
||||
id?: number;
|
||||
/** 商品名称 */
|
||||
name?: string;
|
||||
/** 商品分类 */
|
||||
categoryId?: number;
|
||||
/** 关键字 */
|
||||
keyword?: string;
|
||||
/** 单位 */
|
||||
unit?: number | undefined;
|
||||
/** 商品封面图 */
|
||||
picUrl?: string;
|
||||
/** 商品轮播图 */
|
||||
sliderPicUrls?: string[];
|
||||
/** 商品简介 */
|
||||
introduction?: string;
|
||||
/** 配送方式 */
|
||||
deliveryTypes?: number[];
|
||||
/** 运费模版 */
|
||||
deliveryTemplateId?: number | undefined;
|
||||
/** 商品品牌编号 */
|
||||
brandId?: number;
|
||||
/** 商品规格 */
|
||||
specType?: boolean;
|
||||
/** 分销类型 */
|
||||
subCommissionType?: boolean;
|
||||
/** sku数组 */
|
||||
skus?: Sku[];
|
||||
/** 商品详情 */
|
||||
description?: string;
|
||||
/** 商品排序 */
|
||||
sort?: number;
|
||||
/** 赠送积分 */
|
||||
giveIntegral?: number;
|
||||
/** 虚拟销量 */
|
||||
virtualSalesCount?: number;
|
||||
/** 商品价格 */
|
||||
price?: number;
|
||||
/** 商品拼团价格 */
|
||||
combinationPrice?: number;
|
||||
/** 商品秒杀价格 */
|
||||
seckillPrice?: number;
|
||||
/** 商品销量 */
|
||||
salesCount?: number;
|
||||
/** 市场价 */
|
||||
marketPrice?: number;
|
||||
/** 成本价 */
|
||||
costPrice?: number;
|
||||
/** 商品库存 */
|
||||
stock?: number;
|
||||
/** 商品创建时间 */
|
||||
createTime?: Date;
|
||||
/** 商品状态 */
|
||||
status?: number;
|
||||
}
|
||||
|
||||
/** 商品状态更新 */
|
||||
export interface StatusUpdate {
|
||||
/** 商品编号 */
|
||||
id: number;
|
||||
/** 商品状态 */
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得商品 SPU 列表 */
|
||||
export function getSpuPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallSpuApi.Spu>>('/product/spu/page', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得商品 SPU 列表 tabsCount */
|
||||
export function getTabsCount() {
|
||||
return requestClient.get<Record<string, number>>('/product/spu/get-count');
|
||||
}
|
||||
|
||||
/** 创建商品 SPU */
|
||||
export function createSpu(data: MallSpuApi.Spu) {
|
||||
return requestClient.post('/product/spu/create', data);
|
||||
}
|
||||
|
||||
/** 更新商品 SPU */
|
||||
export function updateSpu(data: MallSpuApi.Spu) {
|
||||
return requestClient.put('/product/spu/update', data);
|
||||
}
|
||||
|
||||
/** 更新商品 SPU 状态 */
|
||||
export function updateStatus(data: MallSpuApi.StatusUpdate) {
|
||||
return requestClient.put('/product/spu/update-status', data);
|
||||
}
|
||||
|
||||
/** 获得商品 SPU */
|
||||
export function getSpu(id: number) {
|
||||
return requestClient.get<MallSpuApi.Spu>(`/product/spu/get-detail?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得商品 SPU 详情列表 */
|
||||
export function getSpuDetailList(ids: number[]) {
|
||||
return requestClient.get<MallSpuApi.Spu[]>(`/product/spu/list?spuIds=${ids}`);
|
||||
}
|
||||
|
||||
/** 删除商品 SPU */
|
||||
export function deleteSpu(id: number) {
|
||||
return requestClient.delete(`/product/spu/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出商品 SPU Excel */
|
||||
export function exportSpu(params: PageParam) {
|
||||
return requestClient.download('/product/spu/export-excel', { params });
|
||||
}
|
||||
|
||||
/** 获得商品 SPU 精简列表 */
|
||||
export function getSpuSimpleList() {
|
||||
return requestClient.get<MallSpuApi.Spu[]>('/product/spu/list-all-simple');
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallArticleApi {
|
||||
/** 文章管理 */
|
||||
export interface Article {
|
||||
/** 文章编号 */
|
||||
id: number;
|
||||
/** 分类编号 */
|
||||
categoryId: number;
|
||||
/** 文章标题 */
|
||||
title: string;
|
||||
/** 作者 */
|
||||
author: string;
|
||||
/** 封面图 */
|
||||
picUrl: string;
|
||||
/** 文章简介 */
|
||||
introduction: string;
|
||||
/** 浏览数量 */
|
||||
browseCount: string;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 商品编号 */
|
||||
spuId: number;
|
||||
/** 是否热门 */
|
||||
recommendHot: boolean;
|
||||
/** 是否轮播图 */
|
||||
recommendBanner: boolean;
|
||||
/** 文章内容 */
|
||||
content: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询文章管理列表 */
|
||||
export function getArticlePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallArticleApi.Article>>(
|
||||
'/promotion/article/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询文章管理详情 */
|
||||
export function getArticle(id: number) {
|
||||
return requestClient.get<MallArticleApi.Article>(
|
||||
`/promotion/article/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增文章管理 */
|
||||
export function createArticle(data: MallArticleApi.Article) {
|
||||
return requestClient.post('/promotion/article/create', data);
|
||||
}
|
||||
|
||||
/** 修改文章管理 */
|
||||
export function updateArticle(data: MallArticleApi.Article) {
|
||||
return requestClient.put('/promotion/article/update', data);
|
||||
}
|
||||
|
||||
/** 删除文章管理 */
|
||||
export function deleteArticle(id: number) {
|
||||
return requestClient.delete(`/promotion/article/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallArticleCategoryApi {
|
||||
/** 文章分类 */
|
||||
export interface ArticleCategory {
|
||||
/** 分类编号 */
|
||||
id: number;
|
||||
/** 分类名称 */
|
||||
name: string;
|
||||
/** 分类图片 */
|
||||
picUrl: string;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询文章分类列表 */
|
||||
export function getArticleCategoryPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallArticleCategoryApi.ArticleCategory>>(
|
||||
'/promotion/article-category/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询文章分类精简信息列表 */
|
||||
export function getSimpleArticleCategoryList() {
|
||||
return requestClient.get<MallArticleCategoryApi.ArticleCategory[]>(
|
||||
'/promotion/article-category/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询文章分类详情 */
|
||||
export function getArticleCategory(id: number) {
|
||||
return requestClient.get<MallArticleCategoryApi.ArticleCategory>(
|
||||
`/promotion/article-category/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增文章分类 */
|
||||
export function createArticleCategory(
|
||||
data: MallArticleCategoryApi.ArticleCategory,
|
||||
) {
|
||||
return requestClient.post('/promotion/article-category/create', data);
|
||||
}
|
||||
|
||||
/** 修改文章分类 */
|
||||
export function updateArticleCategory(
|
||||
data: MallArticleCategoryApi.ArticleCategory,
|
||||
) {
|
||||
return requestClient.put('/promotion/article-category/update', data);
|
||||
}
|
||||
|
||||
/** 删除文章分类 */
|
||||
export function deleteArticleCategory(id: number) {
|
||||
return requestClient.delete(`/promotion/article-category/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBargainActivityApi {
|
||||
/** 砍价活动 */
|
||||
export interface BargainActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
/** 达到该人数,才能砍到低价 */
|
||||
helpMaxCount?: number;
|
||||
/** 最大帮砍次数 */
|
||||
bargainCount?: number;
|
||||
/** 最大购买次数 */
|
||||
totalLimitCount?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 砍价起始价格,单位分 */
|
||||
bargainFirstPrice: number;
|
||||
/** 砍价底价 */
|
||||
bargainMinPrice: number;
|
||||
/** 活动库存 */
|
||||
stock: number;
|
||||
/** 用户每次砍价的最小金额,单位:分 */
|
||||
randomMinPrice?: number;
|
||||
/** 用户每次砍价的最大金额,单位:分 */
|
||||
randomMaxPrice?: number;
|
||||
}
|
||||
|
||||
/** 砍价活动所需属性。选择的商品和属性的时候使用方便使用活动的通用封装 */
|
||||
export interface BargainProduct {
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 砍价起始价格,单位分 */
|
||||
bargainFirstPrice: number;
|
||||
/** 砍价底价 */
|
||||
bargainMinPrice: number;
|
||||
/** 活动库存 */
|
||||
stock: number;
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 砍价活动配置 */
|
||||
productConfig: BargainProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询砍价活动列表 */
|
||||
export function getBargainActivityPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBargainActivityApi.BargainActivity>>(
|
||||
'/promotion/bargain-activity/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询砍价活动详情 */
|
||||
export function getBargainActivity(id: number) {
|
||||
return requestClient.get<MallBargainActivityApi.BargainActivity>(
|
||||
`/promotion/bargain-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增砍价活动 */
|
||||
export function createBargainActivity(
|
||||
data: MallBargainActivityApi.BargainActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/bargain-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改砍价活动 */
|
||||
export function updateBargainActivity(
|
||||
data: MallBargainActivityApi.BargainActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/bargain-activity/update', data);
|
||||
}
|
||||
|
||||
/** 关闭砍价活动 */
|
||||
export function closeBargainActivity(id: number) {
|
||||
return requestClient.put(`/promotion/bargain-activity/close?id=${id}`);
|
||||
}
|
||||
|
||||
/** 删除砍价活动 */
|
||||
export function deleteBargainActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/bargain-activity/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBargainHelpApi {
|
||||
/** 砍价记录 */
|
||||
export interface BargainHelp {
|
||||
/** 记录编号 */
|
||||
id: number;
|
||||
/** 砍价记录编号 */
|
||||
record: number;
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 砍掉金额 */
|
||||
reducePrice: number;
|
||||
/** 结束时间 */
|
||||
endTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询砍价记录列表 */
|
||||
export function getBargainHelpPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBargainHelpApi.BargainHelp>>(
|
||||
'/promotion/bargain-help/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBargainRecordApi {
|
||||
/** 砍价记录 */
|
||||
export interface BargainRecord {
|
||||
/** 记录编号 */
|
||||
id: number;
|
||||
/** 活动编号 */
|
||||
activityId: number;
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 砍价起始价格 */
|
||||
bargainFirstPrice: number;
|
||||
/** 砍价价格 */
|
||||
bargainPrice: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 订单编号 */
|
||||
orderId: number;
|
||||
/** 结束时间 */
|
||||
endTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询砍价记录列表 */
|
||||
export function getBargainRecordPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBargainRecordApi.BargainRecord>>(
|
||||
'/promotion/bargain-record/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCombinationActivityApi {
|
||||
/** 拼团活动所需属性 */
|
||||
export interface CombinationProduct {
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 拼团价格 */
|
||||
combinationPrice: number;
|
||||
}
|
||||
/** 拼团活动 */
|
||||
export interface CombinationActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 总限购数量 */
|
||||
totalLimitCount?: number;
|
||||
/** 单次限购数量 */
|
||||
singleLimitCount?: number;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 用户数量 */
|
||||
userSize?: number;
|
||||
/** 总数量 */
|
||||
totalCount?: number;
|
||||
/** 成功数量 */
|
||||
successCount?: number;
|
||||
/** 订单用户数量 */
|
||||
orderUserCount?: number;
|
||||
/** 虚拟成团 */
|
||||
virtualGroup?: number;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
/** 限制时长 */
|
||||
limitDuration?: number;
|
||||
/** 拼团价格 */
|
||||
combinationPrice?: number;
|
||||
/** 商品列表 */
|
||||
products: CombinationProduct[];
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 拼团活动配置 */
|
||||
productConfig: CombinationProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询拼团活动列表 */
|
||||
export function getCombinationActivityPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallCombinationActivityApi.CombinationActivity>
|
||||
>('/promotion/combination-activity/page', { params });
|
||||
}
|
||||
|
||||
/** 查询拼团活动详情 */
|
||||
export function getCombinationActivity(id: number) {
|
||||
return requestClient.get<MallCombinationActivityApi.CombinationActivity>(
|
||||
`/promotion/combination-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得拼团活动列表,基于活动编号数组 */
|
||||
export function getCombinationActivityListByIds(ids: number[]) {
|
||||
return requestClient.get<MallCombinationActivityApi.CombinationActivity[]>(
|
||||
`/promotion/combination-activity/list-by-ids?ids=${ids}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增拼团活动 */
|
||||
export function createCombinationActivity(
|
||||
data: MallCombinationActivityApi.CombinationActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/combination-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改拼团活动 */
|
||||
export function updateCombinationActivity(
|
||||
data: MallCombinationActivityApi.CombinationActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/combination-activity/update', data);
|
||||
}
|
||||
|
||||
/** 关闭拼团活动 */
|
||||
export function closeCombinationActivity(id: number) {
|
||||
return requestClient.put(`/promotion/combination-activity/close?id=${id}`);
|
||||
}
|
||||
|
||||
/** 删除拼团活动 */
|
||||
export function deleteCombinationActivity(id: number) {
|
||||
return requestClient.delete(
|
||||
`/promotion/combination-activity/delete?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCombinationRecordApi {
|
||||
/** 拼团记录 */
|
||||
export interface CombinationRecord {
|
||||
/** 拼团记录编号 */
|
||||
id: number;
|
||||
/** 拼团活动编号 */
|
||||
activityId: number;
|
||||
/** 用户昵称 */
|
||||
nickname: string;
|
||||
/** 用户头像 */
|
||||
avatar: string;
|
||||
/** 团长编号 */
|
||||
headId: number;
|
||||
/** 过期时间 */
|
||||
expireTime: string;
|
||||
/** 可参团人数 */
|
||||
userSize: number;
|
||||
/** 已参团人数 */
|
||||
userCount: number;
|
||||
/** 拼团状态 */
|
||||
status: number;
|
||||
/** 商品名字 */
|
||||
spuName: string;
|
||||
/** 商品图片 */
|
||||
picUrl: string;
|
||||
/** 是否虚拟成团 */
|
||||
virtualGroup: boolean;
|
||||
/** 开始时间 (订单付款后开始的时间) */
|
||||
startTime: string;
|
||||
/** 结束时间(成团时间/失败时间) */
|
||||
endTime: string;
|
||||
}
|
||||
|
||||
/** 拼团记录概要信息 */
|
||||
export interface RecordSummary {
|
||||
/** 待成团数量 */
|
||||
pendingCount: number;
|
||||
/** 已成团数量 */
|
||||
successCount: number;
|
||||
/** 已失败数量 */
|
||||
failCount: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询拼团记录列表 */
|
||||
export function getCombinationRecordPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallCombinationRecordApi.CombinationRecord>
|
||||
>('/promotion/combination-record/page', { params });
|
||||
}
|
||||
|
||||
/** 获得拼团记录的概要信息 */
|
||||
export function getCombinationRecordSummary() {
|
||||
return requestClient.get<MallCombinationRecordApi.RecordSummary>(
|
||||
'/promotion/combination-record/get-summary',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCouponApi {
|
||||
/** 优惠券 */
|
||||
export interface Coupon {
|
||||
/** 优惠券编号 */
|
||||
id: number;
|
||||
/** 优惠券名称 */
|
||||
name: string;
|
||||
/** 优惠券状态 */
|
||||
status: number;
|
||||
/** 优惠券类型 */
|
||||
type: number;
|
||||
/** 优惠券金额 */
|
||||
price: number;
|
||||
/** 使用门槛 */
|
||||
usePrice: number;
|
||||
/** 商品范围 */
|
||||
productScope: number;
|
||||
/** 商品编号数组 */
|
||||
productSpuIds: number[];
|
||||
/** 有效期类型 */
|
||||
validityType: number;
|
||||
/** 固定日期-生效开始时间 */
|
||||
validStartTime: Date;
|
||||
/** 固定日期-生效结束时间 */
|
||||
validEndTime: Date;
|
||||
/** 领取日期-开始天数 */
|
||||
fixedStartTerm: number;
|
||||
/** 领取日期-结束天数 */
|
||||
fixedEndTerm: number;
|
||||
/** 每人限领个数 */
|
||||
takeLimitCount: number;
|
||||
/** 是否设置满多少金额可用 */
|
||||
usePriceEnabled: boolean;
|
||||
/** 商品分类编号数组 */
|
||||
productCategoryIds: number[];
|
||||
}
|
||||
|
||||
/** 发送优惠券 */
|
||||
export interface SendCoupon {
|
||||
/** 优惠券编号 */
|
||||
couponId: number;
|
||||
/** 用户编号数组 */
|
||||
userIds: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 删除优惠劵 */
|
||||
export function deleteCoupon(id: number) {
|
||||
return requestClient.delete(`/promotion/coupon/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得优惠劵分页 */
|
||||
export function getCouponPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallCouponApi.Coupon>>(
|
||||
'/promotion/coupon/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 发送优惠券 */
|
||||
export function sendCoupon(data: MallCouponApi.SendCoupon) {
|
||||
return requestClient.post('/promotion/coupon/send', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,112 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallCouponTemplateApi {
|
||||
/** 优惠券模板 */
|
||||
export interface CouponTemplate {
|
||||
/** 模板编号 */
|
||||
id: number;
|
||||
/** 模板名称 */
|
||||
name: string;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 发放数量 */
|
||||
totalCount: number;
|
||||
/** 每人限领个数 */
|
||||
takeLimitCount: number;
|
||||
/** 领取方式 */
|
||||
takeType: number;
|
||||
/** 使用门槛 */
|
||||
usePrice: number;
|
||||
/** 商品范围 */
|
||||
productScope: number;
|
||||
/** 商品范围值 */
|
||||
productScopeValues: number[];
|
||||
/** 有效期类型 */
|
||||
validityType: number;
|
||||
/** 固定日期-生效开始时间 */
|
||||
validStartTime: Date;
|
||||
/** 固定日期-生效结束时间 */
|
||||
validEndTime: Date;
|
||||
/** 领取日期-开始天数 */
|
||||
fixedStartTerm: number;
|
||||
/** 领取日期-结束天数 */
|
||||
fixedEndTerm: number;
|
||||
/** 优惠类型 */
|
||||
discountType: number;
|
||||
/** 折扣百分比 */
|
||||
discountPercent: number;
|
||||
/** 优惠金额 */
|
||||
discountPrice: number;
|
||||
/** 折扣上限 */
|
||||
discountLimitPrice: number;
|
||||
/** 已领取数量 */
|
||||
takeCount: number;
|
||||
/** 已使用数量 */
|
||||
useCount: number;
|
||||
}
|
||||
|
||||
/** 优惠券模板状态更新 */
|
||||
export interface StatusUpdate {
|
||||
/** 模板编号 */
|
||||
id: number;
|
||||
/** 状态 */
|
||||
status: 0 | 1;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建优惠劵模板 */
|
||||
export function createCouponTemplate(
|
||||
data: MallCouponTemplateApi.CouponTemplate,
|
||||
) {
|
||||
return requestClient.post('/promotion/coupon-template/create', data);
|
||||
}
|
||||
|
||||
/** 更新优惠劵模板 */
|
||||
export function updateCouponTemplate(
|
||||
data: MallCouponTemplateApi.CouponTemplate,
|
||||
) {
|
||||
return requestClient.put('/promotion/coupon-template/update', data);
|
||||
}
|
||||
|
||||
/** 更新优惠劵模板的状态 */
|
||||
export function updateCouponTemplateStatus(id: number, status: 0 | 1) {
|
||||
const data: MallCouponTemplateApi.StatusUpdate = { id, status };
|
||||
return requestClient.put('/promotion/coupon-template/update-status', data);
|
||||
}
|
||||
|
||||
/** 删除优惠劵模板 */
|
||||
export function deleteCouponTemplate(id: number) {
|
||||
return requestClient.delete(`/promotion/coupon-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得优惠劵模板 */
|
||||
export function getCouponTemplate(id: number) {
|
||||
return requestClient.get<MallCouponTemplateApi.CouponTemplate>(
|
||||
`/promotion/coupon-template/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得优惠劵模板分页 */
|
||||
export function getCouponTemplatePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallCouponTemplateApi.CouponTemplate>>(
|
||||
'/promotion/coupon-template/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得优惠劵模板列表 */
|
||||
export function getCouponTemplateList(ids: number[]) {
|
||||
return requestClient.get<MallCouponTemplateApi.CouponTemplate[]>(
|
||||
`/promotion/coupon-template/list?ids=${ids}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出优惠劵模板 Excel */
|
||||
export function exportCouponTemplateExcel(params: PageParam) {
|
||||
return requestClient.get('/promotion/coupon-template/export-excel', {
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDiscountActivityApi {
|
||||
/** 限时折扣相关属性 */
|
||||
export interface DiscountProduct {
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 折扣类型 */
|
||||
discountType: number;
|
||||
/** 折扣百分比 */
|
||||
discountPercent: number;
|
||||
/** 折扣价格 */
|
||||
discountPrice: number;
|
||||
}
|
||||
|
||||
/** 限时折扣活动 */
|
||||
export interface DiscountActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 状态 */
|
||||
status?: number;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 商品列表 */
|
||||
products?: DiscountProduct[];
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 限时折扣配置 */
|
||||
productConfig: DiscountProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询限时折扣活动列表 */
|
||||
export function getDiscountActivityPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallDiscountActivityApi.DiscountActivity>
|
||||
>('/promotion/discount-activity/page', { params });
|
||||
}
|
||||
|
||||
/** 查询限时折扣活动详情 */
|
||||
export function getDiscountActivity(id: number) {
|
||||
return requestClient.get<MallDiscountActivityApi.DiscountActivity>(
|
||||
`/promotion/discount-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增限时折扣活动 */
|
||||
export function createDiscountActivity(
|
||||
data: MallDiscountActivityApi.DiscountActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/discount-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改限时折扣活动 */
|
||||
export function updateDiscountActivity(
|
||||
data: MallDiscountActivityApi.DiscountActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/discount-activity/update', data);
|
||||
}
|
||||
|
||||
/** 关闭限时折扣活动 */
|
||||
export function closeDiscountActivity(id: number) {
|
||||
return requestClient.put(`/promotion/discount-activity/close?id=${id}`);
|
||||
}
|
||||
|
||||
/** 删除限时折扣活动 */
|
||||
export function deleteDiscountActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/discount-activity/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDiyPageApi {
|
||||
/** 装修页面 */
|
||||
export interface DiyPage {
|
||||
/** 页面编号 */
|
||||
id?: number;
|
||||
/** 模板编号 */
|
||||
templateId?: number;
|
||||
/** 页面名称 */
|
||||
name: string;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 预览图片地址数组 */
|
||||
previewPicUrls: string[];
|
||||
/** 页面属性 */
|
||||
property: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询装修页面列表 */
|
||||
export function getDiyPagePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallDiyPageApi.DiyPage>>(
|
||||
'/promotion/diy-page/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询装修页面详情 */
|
||||
export function getDiyPage(id: number) {
|
||||
return requestClient.get<MallDiyPageApi.DiyPage>(
|
||||
`/promotion/diy-page/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增装修页面 */
|
||||
export function createDiyPage(data: MallDiyPageApi.DiyPage) {
|
||||
return requestClient.post('/promotion/diy-page/create', data);
|
||||
}
|
||||
|
||||
/** 修改装修页面 */
|
||||
export function updateDiyPage(data: MallDiyPageApi.DiyPage) {
|
||||
return requestClient.put('/promotion/diy-page/update', data);
|
||||
}
|
||||
|
||||
/** 删除装修页面 */
|
||||
export function deleteDiyPage(id: number) {
|
||||
return requestClient.delete(`/promotion/diy-page/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得装修页面属性 */
|
||||
export function getDiyPageProperty(id: number) {
|
||||
return requestClient.get<string>(`/promotion/diy-page/get-property?id=${id}`);
|
||||
}
|
||||
|
||||
/** 更新装修页面属性 */
|
||||
export function updateDiyPageProperty(data: MallDiyPageApi.DiyPage) {
|
||||
return requestClient.put('/promotion/diy-page/update-property', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallDiyPageApi } from './page';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDiyTemplateApi {
|
||||
/** 装修模板 */
|
||||
export interface DiyTemplate {
|
||||
/** 模板编号 */
|
||||
id?: number;
|
||||
/** 模板名称 */
|
||||
name: string;
|
||||
/** 是否使用 */
|
||||
used: boolean;
|
||||
/** 使用时间 */
|
||||
usedTime?: Date;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 预览图片地址数组 */
|
||||
previewPicUrls: string[];
|
||||
/** 模板属性 */
|
||||
property: string;
|
||||
}
|
||||
|
||||
/** 装修模板属性(包含页面列表) */
|
||||
export interface DiyTemplateProperty extends DiyTemplate {
|
||||
/** 页面列表 */
|
||||
pages: MallDiyPageApi.DiyPage[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询装修模板列表 */
|
||||
export function getDiyTemplatePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallDiyTemplateApi.DiyTemplate>>(
|
||||
'/promotion/diy-template/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询装修模板详情 */
|
||||
export function getDiyTemplate(id: number) {
|
||||
return requestClient.get<MallDiyTemplateApi.DiyTemplate>(
|
||||
`/promotion/diy-template/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增装修模板 */
|
||||
export function createDiyTemplate(data: MallDiyTemplateApi.DiyTemplate) {
|
||||
return requestClient.post('/promotion/diy-template/create', data);
|
||||
}
|
||||
|
||||
/** 修改装修模板 */
|
||||
export function updateDiyTemplate(data: MallDiyTemplateApi.DiyTemplate) {
|
||||
return requestClient.put('/promotion/diy-template/update', data);
|
||||
}
|
||||
|
||||
/** 删除装修模板 */
|
||||
export function deleteDiyTemplate(id: number) {
|
||||
return requestClient.delete(`/promotion/diy-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 使用装修模板 */
|
||||
export function useDiyTemplate(id: number) {
|
||||
return requestClient.put(`/promotion/diy-template/use?id=${id}`);
|
||||
}
|
||||
|
||||
/** 获得装修模板属性 */
|
||||
export function getDiyTemplateProperty(id: number) {
|
||||
return requestClient.get<MallDiyTemplateApi.DiyTemplateProperty>(
|
||||
`/promotion/diy-template/get-property?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 更新装修模板属性 */
|
||||
export function updateDiyTemplateProperty(
|
||||
data: MallDiyTemplateApi.DiyTemplate,
|
||||
) {
|
||||
return requestClient.put('/promotion/diy-template/update-property', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
import type { PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallKefuConversationApi {
|
||||
/** 客服会话 */
|
||||
export interface Conversation {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 会话所属用户 */
|
||||
userId: number;
|
||||
/** 会话所属用户头像 */
|
||||
userAvatar: string;
|
||||
/** 会话所属用户昵称 */
|
||||
userNickname: string;
|
||||
/** 最后聊天时间 */
|
||||
lastMessageTime: Date;
|
||||
/** 最后聊天内容 */
|
||||
lastMessageContent: string;
|
||||
/** 最后发送的消息类型 */
|
||||
lastMessageContentType: number;
|
||||
/** 管理端置顶 */
|
||||
adminPinned: boolean;
|
||||
/** 用户是否可见 */
|
||||
userDeleted: boolean;
|
||||
/** 管理员是否可见 */
|
||||
adminDeleted: boolean;
|
||||
/** 管理员未读消息数 */
|
||||
adminUnreadMessageCount: number;
|
||||
/** 创建时间 */
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/** 会话置顶请求 */
|
||||
export interface ConversationPinnedUpdate {
|
||||
/** 会话编号 */
|
||||
id: number;
|
||||
/** 是否置顶 */
|
||||
pinned: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得客服会话列表 */
|
||||
export function getConversationList() {
|
||||
return requestClient.get<PageResult<MallKefuConversationApi.Conversation>>(
|
||||
'/promotion/kefu-conversation/list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得客服会话 */
|
||||
export function getConversation(id: number) {
|
||||
return requestClient.get<MallKefuConversationApi.Conversation>(
|
||||
`/promotion/kefu-conversation/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 客服会话置顶 */
|
||||
export function updateConversationPinned(
|
||||
data: MallKefuConversationApi.ConversationPinnedUpdate,
|
||||
) {
|
||||
return requestClient.put(
|
||||
'/promotion/kefu-conversation/update-conversation-pinned',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除客服会话 */
|
||||
export function deleteConversation(id: number) {
|
||||
return requestClient.delete(`/promotion/kefu-conversation/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallKefuMessageApi {
|
||||
/** 客服消息 */
|
||||
export interface Message {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 会话编号 */
|
||||
conversationId: number;
|
||||
/** 发送人编号 */
|
||||
senderId: number;
|
||||
/** 发送人头像 */
|
||||
senderAvatar: string;
|
||||
/** 发送人类型 */
|
||||
senderType: number;
|
||||
/** 接收人编号 */
|
||||
receiverId: number;
|
||||
/** 接收人类型 */
|
||||
receiverType: number;
|
||||
/** 消息类型 */
|
||||
contentType: number;
|
||||
/** 消息内容 */
|
||||
content: string;
|
||||
/** 是否已读 */
|
||||
readStatus: boolean;
|
||||
/** 创建时间 */
|
||||
createTime: Date;
|
||||
}
|
||||
|
||||
/** 发送消息请求 */
|
||||
export interface MessageSend {
|
||||
/** 会话编号 */
|
||||
conversationId: number;
|
||||
/** 消息类型 */
|
||||
contentType: number;
|
||||
/** 消息内容 */
|
||||
content: string;
|
||||
}
|
||||
|
||||
/** 消息列表查询参数 */
|
||||
export interface MessageQuery extends PageParam {
|
||||
/** 会话编号 */
|
||||
conversationId: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 发送客服消息 */
|
||||
export function sendKeFuMessage(data: MallKefuMessageApi.MessageSend) {
|
||||
return requestClient.post('/promotion/kefu-message/send', data);
|
||||
}
|
||||
|
||||
/** 更新客服消息已读状态 */
|
||||
export function updateKeFuMessageReadStatus(conversationId: number) {
|
||||
return requestClient.put(
|
||||
`/promotion/kefu-message/update-read-status?conversationId=${conversationId}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得消息列表(流式加载) */
|
||||
export function getKeFuMessageList(params: MallKefuMessageApi.MessageQuery) {
|
||||
return requestClient.get<PageResult<MallKefuMessageApi.Message>>(
|
||||
'/promotion/kefu-message/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallPointActivityApi {
|
||||
/** 积分商城商品 */
|
||||
export interface PointProduct {
|
||||
/** 积分商城商品编号 */
|
||||
id?: number;
|
||||
/** 积分商城活动 id */
|
||||
activityId?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 可兑换数量 */
|
||||
count: number;
|
||||
/** 兑换积分 */
|
||||
point: number;
|
||||
/** 兑换金额,单位:分 */
|
||||
price: number;
|
||||
/** 积分商城商品库存 */
|
||||
stock: number;
|
||||
/** 积分商城商品状态 */
|
||||
activityStatus?: number;
|
||||
}
|
||||
|
||||
/** 积分商城活动 */
|
||||
export interface PointActivity {
|
||||
/** 积分商城活动编号 */
|
||||
id: number;
|
||||
/** 积分商城活动商品 */
|
||||
spuId: number;
|
||||
/** 活动状态 */
|
||||
status: number;
|
||||
/** 积分商城活动库存 */
|
||||
stock: number;
|
||||
/** 积分商城活动总库存 */
|
||||
totalStock: number;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 积分商城商品 */
|
||||
products: PointProduct[];
|
||||
/** 商品名称 */
|
||||
spuName: string;
|
||||
/** 商品主图 */
|
||||
picUrl: string;
|
||||
/** 商品市场价,单位:分 */
|
||||
marketPrice: number;
|
||||
/** 兑换积分 */
|
||||
point: number;
|
||||
/** 兑换金额,单位:分 */
|
||||
price: number;
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 积分商城商品配置 */
|
||||
productConfig: PointProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
|
||||
/** 扩展 SPU 配置(带积分信息) */
|
||||
export interface SpuExtensionWithPoint extends MallSpuApi.Spu {
|
||||
/** 积分商城活动库存 */
|
||||
pointStock: number;
|
||||
/** 积分商城活动总库存 */
|
||||
pointTotalStock: number;
|
||||
/** 兑换积分 */
|
||||
point: number;
|
||||
/** 兑换金额,单位:分 */
|
||||
pointPrice: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询积分商城活动分页 */
|
||||
export function getPointActivityPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallPointActivityApi.PointActivity>>(
|
||||
'/promotion/point-activity/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询积分商城活动详情 */
|
||||
export function getPointActivity(id: number) {
|
||||
return requestClient.get<MallPointActivityApi.PointActivity>(
|
||||
`/promotion/point-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询积分商城活动列表,基于活动编号数组 */
|
||||
export function getPointActivityListByIds(ids: number[]) {
|
||||
return requestClient.get<MallPointActivityApi.PointActivity[]>(
|
||||
`/promotion/point-activity/list-by-ids?ids=${ids}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增积分商城活动 */
|
||||
export function createPointActivity(data: MallPointActivityApi.PointActivity) {
|
||||
return requestClient.post('/promotion/point-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改积分商城活动 */
|
||||
export function updatePointActivity(data: MallPointActivityApi.PointActivity) {
|
||||
return requestClient.put('/promotion/point-activity/update', data);
|
||||
}
|
||||
|
||||
/** 删除积分商城活动 */
|
||||
export function deletePointActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/point-activity/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 关闭积分商城活动 */
|
||||
export function closePointActivity(id: number) {
|
||||
return requestClient.put(`/promotion/point-activity/close?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallRewardActivityApi {
|
||||
/** 优惠规则 */
|
||||
export interface RewardRule {
|
||||
/** 满足金额 */
|
||||
limit?: number;
|
||||
/** 优惠金额 */
|
||||
discountPrice?: number;
|
||||
/** 是否包邮 */
|
||||
freeDelivery?: boolean;
|
||||
/** 赠送积分 */
|
||||
point: number;
|
||||
/** 赠送优惠券数量 */
|
||||
giveCouponTemplateCounts?: {
|
||||
[key: number]: number;
|
||||
};
|
||||
}
|
||||
|
||||
/** 满减送活动 */
|
||||
export interface RewardActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 开始和结束时间(仅前端使用) */
|
||||
startAndEndTime?: Date[];
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 条件类型 */
|
||||
conditionType?: number;
|
||||
/** 商品范围 */
|
||||
productScope?: number;
|
||||
/** 优惠规则列表 */
|
||||
rules: RewardRule[];
|
||||
/** 商品范围值(仅表单使用):值为品类编号列表、商品编号列表 */
|
||||
productScopeValues?: number[];
|
||||
/** 商品分类编号列表(仅表单使用) */
|
||||
productCategoryIds?: number[];
|
||||
/** 商品 SPU 编号列表(仅表单使用) */
|
||||
productSpuIds?: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 新增满减送活动 */
|
||||
export function createRewardActivity(
|
||||
data: MallRewardActivityApi.RewardActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/reward-activity/create', data);
|
||||
}
|
||||
|
||||
/** 更新满减送活动 */
|
||||
export function updateRewardActivity(
|
||||
data: MallRewardActivityApi.RewardActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/reward-activity/update', data);
|
||||
}
|
||||
|
||||
/** 查询满减送活动列表 */
|
||||
export function getRewardActivityPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallRewardActivityApi.RewardActivity>>(
|
||||
'/promotion/reward-activity/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询满减送活动详情 */
|
||||
export function getReward(id: number) {
|
||||
return requestClient.get<MallRewardActivityApi.RewardActivity>(
|
||||
`/promotion/reward-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 删除满减送活动 */
|
||||
export function deleteRewardActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/reward-activity/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 关闭满减送活动 */
|
||||
export function closeRewardActivity(id: number) {
|
||||
return requestClient.put(`/promotion/reward-activity/close?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallSpuApi } from '#/api/mall/product/spu';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallSeckillActivityApi {
|
||||
/** 秒杀商品 */
|
||||
export interface SeckillProduct {
|
||||
/** 商品 SKU 编号 */
|
||||
skuId: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 秒杀价格 */
|
||||
seckillPrice: number;
|
||||
/** 秒杀库存 */
|
||||
stock: number;
|
||||
}
|
||||
|
||||
/** 秒杀活动 */
|
||||
export interface SeckillActivity {
|
||||
/** 活动编号 */
|
||||
id?: number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: number;
|
||||
/** 活动名称 */
|
||||
name?: string;
|
||||
/** 活动状态 */
|
||||
status?: number;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 开始时间 */
|
||||
startTime?: Date;
|
||||
/** 结束时间 */
|
||||
endTime?: Date;
|
||||
/** 排序 */
|
||||
sort?: number;
|
||||
/** 配置编号 */
|
||||
configIds?: string;
|
||||
/** 订单数量 */
|
||||
orderCount?: number;
|
||||
/** 用户数量 */
|
||||
userCount?: number;
|
||||
/** 总金额 */
|
||||
totalPrice?: number;
|
||||
/** 总限购数量 */
|
||||
totalLimitCount?: number;
|
||||
/** 单次限购数量 */
|
||||
singleLimitCount?: number;
|
||||
/** 秒杀库存 */
|
||||
stock?: number;
|
||||
/** 秒杀总库存 */
|
||||
totalStock?: number;
|
||||
/** 秒杀价格 */
|
||||
seckillPrice?: number;
|
||||
/** 秒杀商品列表 */
|
||||
products?: SeckillProduct[];
|
||||
}
|
||||
|
||||
/** 扩展 SKU 配置 */
|
||||
export type SkuExtension = {
|
||||
/** 秒杀商品配置 */
|
||||
productConfig: SeckillProduct;
|
||||
} & MallSpuApi.Sku;
|
||||
|
||||
/** 扩展 SPU 配置 */
|
||||
export interface SpuExtension extends MallSpuApi.Spu {
|
||||
/** SKU 列表 */
|
||||
skus: SkuExtension[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询秒杀活动列表 */
|
||||
export function getSeckillActivityPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallSeckillActivityApi.SeckillActivity>>(
|
||||
'/promotion/seckill-activity/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询秒杀活动列表,基于活动编号数组 */
|
||||
export function getSeckillActivityListByIds(ids: number[]) {
|
||||
return requestClient.get<MallSeckillActivityApi.SeckillActivity[]>(
|
||||
`/promotion/seckill-activity/list-by-ids?ids=${ids}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询秒杀活动详情 */
|
||||
export function getSeckillActivity(id: number) {
|
||||
return requestClient.get<MallSeckillActivityApi.SeckillActivity>(
|
||||
`/promotion/seckill-activity/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增秒杀活动 */
|
||||
export function createSeckillActivity(
|
||||
data: MallSeckillActivityApi.SeckillActivity,
|
||||
) {
|
||||
return requestClient.post('/promotion/seckill-activity/create', data);
|
||||
}
|
||||
|
||||
/** 修改秒杀活动 */
|
||||
export function updateSeckillActivity(
|
||||
data: MallSeckillActivityApi.SeckillActivity,
|
||||
) {
|
||||
return requestClient.put('/promotion/seckill-activity/update', data);
|
||||
}
|
||||
|
||||
/** 关闭秒杀活动 */
|
||||
export function closeSeckillActivity(id: number) {
|
||||
return requestClient.put(`/promotion/seckill-activity/close?id=${id}`);
|
||||
}
|
||||
|
||||
/** 删除秒杀活动 */
|
||||
export function deleteSeckillActivity(id: number) {
|
||||
return requestClient.delete(`/promotion/seckill-activity/delete?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallSeckillConfigApi {
|
||||
/** 秒杀时段 */
|
||||
export interface SeckillConfig {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 秒杀时段名称 */
|
||||
name: string;
|
||||
/** 开始时间点 */
|
||||
startTime: string;
|
||||
/** 结束时间点 */
|
||||
endTime: string;
|
||||
/** 秒杀轮播图 */
|
||||
sliderPicUrls: string[];
|
||||
/** 活动状态 */
|
||||
status: number;
|
||||
}
|
||||
|
||||
/** 时段配置状态更新 */
|
||||
export interface StatusUpdate {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询秒杀时段分页 */
|
||||
export function getSeckillConfigPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallSeckillConfigApi.SeckillConfig>>(
|
||||
'/promotion/seckill-config/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询秒杀时段列表 */
|
||||
export function getSimpleSeckillConfigList() {
|
||||
return requestClient.get<MallSeckillConfigApi.SeckillConfig[]>(
|
||||
'/promotion/seckill-config/list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询秒杀时段详情 */
|
||||
export function getSeckillConfig(id: number) {
|
||||
return requestClient.get<MallSeckillConfigApi.SeckillConfig>(
|
||||
`/promotion/seckill-config/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增秒杀时段 */
|
||||
export function createSeckillConfig(data: MallSeckillConfigApi.SeckillConfig) {
|
||||
return requestClient.post('/promotion/seckill-config/create', data);
|
||||
}
|
||||
|
||||
/** 修改秒杀时段 */
|
||||
export function updateSeckillConfig(data: MallSeckillConfigApi.SeckillConfig) {
|
||||
return requestClient.put('/promotion/seckill-config/update', data);
|
||||
}
|
||||
|
||||
/** 删除秒杀时段 */
|
||||
export function deleteSeckillConfig(id: number) {
|
||||
return requestClient.delete(`/promotion/seckill-config/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 修改时段配置状态 */
|
||||
export function updateSeckillConfigStatus(id: number, status: number) {
|
||||
return requestClient.put('/promotion/seckill-config/update-status', {
|
||||
id,
|
||||
status,
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
/** 数据对照 Response */
|
||||
export interface MallDataComparisonResp<T> {
|
||||
value: T;
|
||||
reference: T;
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
import type { MallDataComparisonResp } from './common';
|
||||
|
||||
import { formatDate } from '@vben/utils';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallMemberStatisticsApi {
|
||||
/** 会员分析 Request */
|
||||
export interface AnalyseReq {
|
||||
times: Date[];
|
||||
}
|
||||
|
||||
/** 会员分析对照数据 Response */
|
||||
export interface AnalyseComparison {
|
||||
registerUserCount: number;
|
||||
visitUserCount: number;
|
||||
rechargeUserCount: number;
|
||||
}
|
||||
|
||||
/** 会员分析 Response */
|
||||
export interface Analyse {
|
||||
visitUserCount: number;
|
||||
orderUserCount: number;
|
||||
payUserCount: number;
|
||||
atv: number;
|
||||
comparison: MallDataComparisonResp<AnalyseComparison>;
|
||||
}
|
||||
|
||||
/** 会员地区统计 Response */
|
||||
export interface AreaStatistics {
|
||||
areaId: number;
|
||||
areaName: string;
|
||||
userCount: number;
|
||||
orderCreateUserCount: number;
|
||||
orderPayUserCount: number;
|
||||
orderPayPrice: number;
|
||||
}
|
||||
|
||||
/** 会员性别统计 Response */
|
||||
export interface SexStatistics {
|
||||
sex: number;
|
||||
userCount: number;
|
||||
}
|
||||
|
||||
/** 会员统计 Response */
|
||||
export interface Summary {
|
||||
userCount: number;
|
||||
rechargeUserCount: number;
|
||||
rechargePrice: number;
|
||||
expensePrice: number;
|
||||
}
|
||||
|
||||
/** 会员终端统计 Response */
|
||||
export interface TerminalStatistics {
|
||||
terminal: number;
|
||||
userCount: number;
|
||||
}
|
||||
|
||||
/** 会员数量统计 Response */
|
||||
export interface Count {
|
||||
/** 用户访问量 */
|
||||
visitUserCount: string;
|
||||
/** 注册用户数量 */
|
||||
registerUserCount: number;
|
||||
}
|
||||
|
||||
/** 会员注册数量 Response */
|
||||
export interface RegisterCount {
|
||||
date: string;
|
||||
count: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询会员统计 */
|
||||
export function getMemberSummary() {
|
||||
return requestClient.get<MallMemberStatisticsApi.Summary>(
|
||||
'/statistics/member/summary',
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询会员分析数据 */
|
||||
export function getMemberAnalyse(params: MallMemberStatisticsApi.AnalyseReq) {
|
||||
return requestClient.get<MallMemberStatisticsApi.Analyse>(
|
||||
'/statistics/member/analyse',
|
||||
{
|
||||
params: {
|
||||
times: [formatDate(params.times[0]), formatDate(params.times[1])],
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 按照省份,查询会员统计列表 */
|
||||
export function getMemberAreaStatisticsList() {
|
||||
return requestClient.get<MallMemberStatisticsApi.AreaStatistics[]>(
|
||||
'/statistics/member/area-statistics-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 按照性别,查询会员统计列表 */
|
||||
export function getMemberSexStatisticsList() {
|
||||
return requestClient.get<MallMemberStatisticsApi.SexStatistics[]>(
|
||||
'/statistics/member/sex-statistics-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 按照终端,查询会员统计列表 */
|
||||
export function getMemberTerminalStatisticsList() {
|
||||
return requestClient.get<MallMemberStatisticsApi.TerminalStatistics[]>(
|
||||
'/statistics/member/terminal-statistics-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得用户数量量对照 */
|
||||
export function getUserCountComparison() {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallMemberStatisticsApi.Count>
|
||||
>('/statistics/member/user-count-comparison');
|
||||
}
|
||||
|
||||
/** 获得会员注册数量列表 */
|
||||
export function getMemberRegisterCountList(beginTime: Date, endTime: Date) {
|
||||
return requestClient.get<MallMemberStatisticsApi.RegisterCount[]>(
|
||||
'/statistics/member/register-count-list',
|
||||
{
|
||||
params: {
|
||||
times: [formatDate(beginTime), formatDate(endTime)],
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallPayStatisticsApi {
|
||||
/** 支付统计 */
|
||||
export interface PaySummaryResp {
|
||||
/** 充值金额,单位分 */
|
||||
rechargePrice: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取钱包充值金额 */
|
||||
export function getWalletRechargePrice() {
|
||||
return requestClient.get<MallPayStatisticsApi.PaySummaryResp>(
|
||||
'/statistics/pay/summary',
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import type { MallDataComparisonResp } from './common';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallProductStatisticsApi {
|
||||
/** 商品统计数据 */
|
||||
export interface ProductStatistics {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 统计日期 */
|
||||
day: string;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId: number;
|
||||
/** 商品 SPU 名称 */
|
||||
spuName: string;
|
||||
/** 商品 SPU 图片 */
|
||||
spuPicUrl: string;
|
||||
/** 浏览次数 */
|
||||
browseCount: number;
|
||||
/** 浏览人数 */
|
||||
browseUserCount: number;
|
||||
/** 收藏次数 */
|
||||
favoriteCount: number;
|
||||
/** 加购次数 */
|
||||
cartCount: number;
|
||||
/** 下单次数 */
|
||||
orderCount: number;
|
||||
/** 支付次数 */
|
||||
orderPayCount: number;
|
||||
/** 支付金额 */
|
||||
orderPayPrice: number;
|
||||
/** 售后次数 */
|
||||
afterSaleCount: number;
|
||||
/** 退款金额 */
|
||||
afterSaleRefundPrice: number;
|
||||
/** 浏览转化率 */
|
||||
browseConvertPercent: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得商品统计分析 */
|
||||
export function getProductStatisticsAnalyse(params: PageParam) {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallProductStatisticsApi.ProductStatistics>
|
||||
>('/statistics/product/analyse', { params });
|
||||
}
|
||||
|
||||
/** 获得商品状况明细 */
|
||||
export function getProductStatisticsList(params: PageParam) {
|
||||
return requestClient.get<MallProductStatisticsApi.ProductStatistics[]>(
|
||||
'/statistics/product/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出获得商品状况明细 Excel */
|
||||
export function exportProductStatisticsExcel(params: PageParam) {
|
||||
return requestClient.download('/statistics/product/export-excel', { params });
|
||||
}
|
||||
|
||||
/** 获得商品排行榜分页 */
|
||||
export function getProductStatisticsRankPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallProductStatisticsApi.ProductStatistics>
|
||||
>('/statistics/product/rank-page', { params });
|
||||
}
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
import type { MallDataComparisonResp } from './common';
|
||||
|
||||
import { formatDate } from '@vben/utils';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallTradeStatisticsApi {
|
||||
/** 交易统计 Response */
|
||||
export interface TradeSummary {
|
||||
yesterdayOrderCount: number;
|
||||
monthOrderCount: number;
|
||||
yesterdayPayPrice: number;
|
||||
monthPayPrice: number;
|
||||
}
|
||||
|
||||
/** 交易状况 Request */
|
||||
export interface TradeTrendReq {
|
||||
times: [Date, Date];
|
||||
}
|
||||
|
||||
/** 交易状况统计 Response */
|
||||
export interface TradeTrendSummary {
|
||||
time: string;
|
||||
turnoverPrice: number;
|
||||
orderPayPrice: number;
|
||||
rechargePrice: number;
|
||||
expensePrice: number;
|
||||
walletPayPrice: number;
|
||||
brokerageSettlementPrice: number;
|
||||
afterSaleRefundPrice: number;
|
||||
}
|
||||
|
||||
/** 交易订单数量 Response */
|
||||
export interface TradeOrderCount {
|
||||
/** 待发货 */
|
||||
undelivered?: number;
|
||||
/** 待核销 */
|
||||
pickUp?: number;
|
||||
/** 退款中 */
|
||||
afterSaleApply?: number;
|
||||
/** 提现待审核 */
|
||||
auditingWithdraw?: number;
|
||||
}
|
||||
|
||||
/** 交易订单统计 Response */
|
||||
export interface TradeOrderSummary {
|
||||
/** 支付订单商品数 */
|
||||
orderPayCount?: number;
|
||||
/** 总支付金额,单位:分 */
|
||||
orderPayPrice?: number;
|
||||
}
|
||||
|
||||
/** 订单量趋势统计 Response */
|
||||
export interface TradeOrderTrend {
|
||||
/** 日期 */
|
||||
date: string;
|
||||
/** 订单数量 */
|
||||
orderPayCount: number;
|
||||
/** 订单支付金额 */
|
||||
orderPayPrice: number;
|
||||
}
|
||||
}
|
||||
|
||||
/** 时间参数需要格式化, 确保接口能识别 */
|
||||
const formatDateParam = (params: MallTradeStatisticsApi.TradeTrendReq) => {
|
||||
return {
|
||||
times: [formatDate(params.times[0]), formatDate(params.times[1])],
|
||||
} as MallTradeStatisticsApi.TradeTrendReq;
|
||||
};
|
||||
|
||||
/** 查询交易统计 */
|
||||
export function getTradeStatisticsSummary() {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallTradeStatisticsApi.TradeSummary>
|
||||
>('/statistics/trade/summary');
|
||||
}
|
||||
|
||||
/** 获得交易状况统计 */
|
||||
export function getTradeStatisticsAnalyse(
|
||||
params: MallTradeStatisticsApi.TradeTrendReq,
|
||||
) {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallTradeStatisticsApi.TradeTrendSummary>
|
||||
>('/statistics/trade/analyse', { params: formatDateParam(params) });
|
||||
}
|
||||
|
||||
/** 获得交易状况明细 */
|
||||
export function getTradeStatisticsList(
|
||||
params: MallTradeStatisticsApi.TradeTrendReq,
|
||||
) {
|
||||
return requestClient.get<MallTradeStatisticsApi.TradeTrendSummary[]>(
|
||||
'/statistics/trade/list',
|
||||
{ params: formatDateParam(params) },
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出交易状况明细 */
|
||||
export function exportTradeStatisticsExcel(
|
||||
params: MallTradeStatisticsApi.TradeTrendReq,
|
||||
) {
|
||||
return requestClient.download('/statistics/trade/export-excel', {
|
||||
params: formatDateParam(params),
|
||||
});
|
||||
}
|
||||
|
||||
/** 获得交易订单数量 */
|
||||
export function getOrderCount() {
|
||||
return requestClient.get<MallTradeStatisticsApi.TradeOrderCount>(
|
||||
'/statistics/trade/order-count',
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得交易订单数量对照 */
|
||||
export function getOrderComparison() {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallTradeStatisticsApi.TradeOrderSummary>
|
||||
>('/statistics/trade/order-comparison');
|
||||
}
|
||||
|
||||
/** 获得订单量趋势统计 */
|
||||
export function getOrderCountTrendComparison(
|
||||
type: number,
|
||||
beginTime: Date,
|
||||
endTime: Date,
|
||||
) {
|
||||
return requestClient.get<
|
||||
MallDataComparisonResp<MallTradeStatisticsApi.TradeOrderTrend>[]
|
||||
>('/statistics/trade/order-count-trend', {
|
||||
params: {
|
||||
type,
|
||||
beginTime: formatDate(beginTime),
|
||||
endTime: formatDate(endTime),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallAfterSaleApi {
|
||||
/** 商品属性 */
|
||||
export interface ProductProperty {
|
||||
/** 属性的编号 */
|
||||
propertyId?: null | number;
|
||||
/** 属性的名称 */
|
||||
propertyName?: string;
|
||||
/** 属性值的编号 */
|
||||
valueId?: null | number;
|
||||
/** 属性值的名称 */
|
||||
valueName?: string;
|
||||
}
|
||||
|
||||
/** 交易售后 */
|
||||
export interface AfterSale {
|
||||
/** 售后编号,主键自增 */
|
||||
id?: null | number;
|
||||
/** 售后单号 */
|
||||
no?: string;
|
||||
/** 退款状态 */
|
||||
status?: null | number;
|
||||
/** 售后方式 */
|
||||
way?: null | number;
|
||||
/** 售后类型 */
|
||||
type?: null | number;
|
||||
/** 用户编号 */
|
||||
userId?: null | number;
|
||||
/** 申请原因 */
|
||||
applyReason?: string;
|
||||
/** 补充描述 */
|
||||
applyDescription?: string;
|
||||
/** 补充凭证图片 */
|
||||
applyPicUrls?: string[];
|
||||
/** 交易订单编号 */
|
||||
orderId?: null | number;
|
||||
/** 订单流水号 */
|
||||
orderNo?: string;
|
||||
/** 交易订单项编号 */
|
||||
orderItemId?: null | number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: null | number;
|
||||
/** 商品 SPU 名称 */
|
||||
spuName?: string;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId?: null | number;
|
||||
/** 属性数组 */
|
||||
properties?: ProductProperty[];
|
||||
/** 商品图片 */
|
||||
picUrl?: string;
|
||||
/** 退货商品数量 */
|
||||
count?: null | number;
|
||||
/** 审批时间 */
|
||||
auditTime?: Date;
|
||||
/** 审批人 */
|
||||
auditUserId?: null | number;
|
||||
/** 审批备注 */
|
||||
auditReason?: string;
|
||||
/** 退款金额,单位:分 */
|
||||
refundPrice?: null | number;
|
||||
/** 支付退款编号 */
|
||||
payRefundId?: null | number;
|
||||
/** 退款时间 */
|
||||
refundTime?: Date;
|
||||
/** 退货物流公司编号 */
|
||||
logisticsId?: null | number;
|
||||
/** 退货物流单号 */
|
||||
logisticsNo?: string;
|
||||
/** 退货时间 */
|
||||
deliveryTime?: Date;
|
||||
/** 收货时间 */
|
||||
receiveTime?: Date;
|
||||
/** 收货备注 */
|
||||
receiveReason?: string;
|
||||
}
|
||||
|
||||
/** 拒绝售后请求 */
|
||||
export interface DisagreeRequest {
|
||||
/** 售后编号 */
|
||||
id: number;
|
||||
/** 拒绝原因 */
|
||||
reason: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 获得交易售后分页 */
|
||||
export function getAfterSalePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallAfterSaleApi.AfterSale>>(
|
||||
'/trade/after-sale/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得交易售后详情 */
|
||||
export function getAfterSale(id: number) {
|
||||
return requestClient.get<MallAfterSaleApi.AfterSale>(
|
||||
`/trade/after-sale/get-detail?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 同意售后 */
|
||||
export function agree(id: number) {
|
||||
return requestClient.put(`/trade/after-sale/agree?id=${id}`);
|
||||
}
|
||||
|
||||
/** 拒绝售后 */
|
||||
export function disagree(data: MallAfterSaleApi.DisagreeRequest) {
|
||||
return requestClient.put('/trade/after-sale/disagree', data);
|
||||
}
|
||||
|
||||
/** 确认收货 */
|
||||
export function receive(id: number) {
|
||||
return requestClient.put(`/trade/after-sale/receive?id=${id}`);
|
||||
}
|
||||
|
||||
/** 拒绝收货 */
|
||||
export function refuse(id: number) {
|
||||
return requestClient.put(`/trade/after-sale/refuse?id=${id}`);
|
||||
}
|
||||
|
||||
/** 确认退款 */
|
||||
export function refund(id: number) {
|
||||
return requestClient.put(`/trade/after-sale/refund?id=${id}`);
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBrokerageRecordApi {
|
||||
/** 佣金记录 */
|
||||
export interface BrokerageRecord {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 用户昵称 */
|
||||
userNickname: string;
|
||||
/** 用户头像 */
|
||||
userAvatar: string;
|
||||
/** 佣金金额,单位:分 */
|
||||
price: number;
|
||||
/** 佣金类型 */
|
||||
type: number;
|
||||
/** 关联订单编号 */
|
||||
orderId: number;
|
||||
/** 关联订单号 */
|
||||
orderNo: string;
|
||||
/** 创建时间 */
|
||||
createTime: Date;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 结算时间 */
|
||||
settlementTime: Date;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询佣金记录列表 */
|
||||
export function getBrokerageRecordPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBrokerageRecordApi.BrokerageRecord>>(
|
||||
'/trade/brokerage-record/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询佣金记录详情 */
|
||||
export function getBrokerageRecord(id: number) {
|
||||
return requestClient.get<MallBrokerageRecordApi.BrokerageRecord>(
|
||||
`/trade/brokerage-record/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBrokerageUserApi {
|
||||
/** 分销用户 */
|
||||
export interface BrokerageUser {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 推广员编号 */
|
||||
bindUserId: number;
|
||||
/** 推广员绑定时间 */
|
||||
bindUserTime: Date;
|
||||
/** 是否启用分销 */
|
||||
brokerageEnabled: boolean;
|
||||
/** 分销资格时间 */
|
||||
brokerageTime: Date;
|
||||
/** 可提现金额,单位:分 */
|
||||
price: number;
|
||||
/** 冻结金额,单位:分 */
|
||||
frozenPrice: number;
|
||||
/** 用户昵称 */
|
||||
nickname: string;
|
||||
/** 用户头像 */
|
||||
avatar: string;
|
||||
}
|
||||
|
||||
/** 创建分销用户请求 */
|
||||
export interface CreateRequest {
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
}
|
||||
|
||||
/** 修改推广员请求 */
|
||||
export interface UpdateBindUserRequest {
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 推广员编号 */
|
||||
bindUserId: number;
|
||||
}
|
||||
|
||||
/** 清除推广员请求 */
|
||||
export interface ClearBindUserRequest {
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
}
|
||||
|
||||
/** 修改推广资格请求 */
|
||||
export interface UpdateBrokerageEnabledRequest {
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 是否启用分销 */
|
||||
brokerageEnabled: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/** 创建分销用户 */
|
||||
export function createBrokerageUser(data: MallBrokerageUserApi.CreateRequest) {
|
||||
return requestClient.post('/trade/brokerage-user/create', data);
|
||||
}
|
||||
|
||||
/** 查询分销用户列表 */
|
||||
export function getBrokerageUserPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallBrokerageUserApi.BrokerageUser>>(
|
||||
'/trade/brokerage-user/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询分销用户详情 */
|
||||
export function getBrokerageUser(id: number) {
|
||||
return requestClient.get<MallBrokerageUserApi.BrokerageUser>(
|
||||
`/trade/brokerage-user/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改推广员 */
|
||||
export function updateBindUser(
|
||||
data: MallBrokerageUserApi.UpdateBindUserRequest,
|
||||
) {
|
||||
return requestClient.put('/trade/brokerage-user/update-bind-user', data);
|
||||
}
|
||||
|
||||
/** 清除推广员 */
|
||||
export function clearBindUser(data: MallBrokerageUserApi.ClearBindUserRequest) {
|
||||
return requestClient.put('/trade/brokerage-user/clear-bind-user', data);
|
||||
}
|
||||
|
||||
/** 修改推广资格 */
|
||||
export function updateBrokerageEnabled(
|
||||
data: MallBrokerageUserApi.UpdateBrokerageEnabledRequest,
|
||||
) {
|
||||
return requestClient.put(
|
||||
'/trade/brokerage-user/update-brokerage-enable',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallBrokerageWithdrawApi {
|
||||
/** 佣金提现 */
|
||||
export interface BrokerageWithdraw {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 用户编号 */
|
||||
userId: number;
|
||||
/** 提现金额,单位:分 */
|
||||
price: number;
|
||||
/** 手续费,单位:分 */
|
||||
feePrice: number;
|
||||
/** 总金额,单位:分 */
|
||||
totalPrice: number;
|
||||
/** 提现类型 */
|
||||
type: number;
|
||||
/** 用户名称 */
|
||||
userName: string;
|
||||
/** 用户账号 */
|
||||
userAccount: string;
|
||||
/** 银行名称 */
|
||||
bankName: string;
|
||||
/** 银行地址 */
|
||||
bankAddress: string;
|
||||
/** 收款码地址 */
|
||||
qrCodeUrl: string;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 审核备注 */
|
||||
auditReason: string;
|
||||
/** 审核时间 */
|
||||
auditTime: Date;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
/** 支付转账编号 */
|
||||
payTransferId?: number;
|
||||
/** 转账渠道编码 */
|
||||
transferChannelCode?: string;
|
||||
/** 转账时间 */
|
||||
transferTime?: Date;
|
||||
/** 转账错误信息 */
|
||||
transferErrorMsg?: string;
|
||||
}
|
||||
|
||||
/** 驳回申请请求 */
|
||||
export interface RejectRequest {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 驳回原因 */
|
||||
auditReason: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询佣金提现列表 */
|
||||
export function getBrokerageWithdrawPage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallBrokerageWithdrawApi.BrokerageWithdraw>
|
||||
>('/trade/brokerage-withdraw/page', { params });
|
||||
}
|
||||
|
||||
/** 查询佣金提现详情 */
|
||||
export function getBrokerageWithdraw(id: number) {
|
||||
return requestClient.get<MallBrokerageWithdrawApi.BrokerageWithdraw>(
|
||||
`/trade/brokerage-withdraw/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 佣金提现 - 通过申请 */
|
||||
export function approveBrokerageWithdraw(id: number) {
|
||||
return requestClient.put(`/trade/brokerage-withdraw/approve?id=${id}`);
|
||||
}
|
||||
|
||||
/** 审核佣金提现 - 驳回申请 */
|
||||
export function rejectBrokerageWithdraw(
|
||||
data: MallBrokerageWithdrawApi.RejectRequest,
|
||||
) {
|
||||
return requestClient.put('/trade/brokerage-withdraw/reject', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallTradeConfigApi {
|
||||
/** 交易中心配置 */
|
||||
export interface Config {
|
||||
id?: number;
|
||||
afterSaleRefundReasons?: string[];
|
||||
afterSaleReturnReasons?: string[];
|
||||
deliveryExpressFreeEnabled?: boolean;
|
||||
deliveryExpressFreePrice?: number;
|
||||
deliveryPickUpEnabled?: boolean;
|
||||
brokerageEnabled?: boolean;
|
||||
brokerageEnabledCondition?: number;
|
||||
brokerageBindMode?: number;
|
||||
brokeragePosterUrls?: string;
|
||||
brokerageFirstPercent?: number;
|
||||
brokerageSecondPercent?: number;
|
||||
brokerageWithdrawMinPrice?: number;
|
||||
brokerageFrozenDays?: number;
|
||||
brokerageWithdrawTypes?: string;
|
||||
tencentLbsKey?: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询交易中心配置详情 */
|
||||
export function getTradeConfig() {
|
||||
return requestClient.get<MallTradeConfigApi.Config>('/trade/config/get');
|
||||
}
|
||||
|
||||
/** 保存交易中心配置 */
|
||||
export function saveTradeConfig(data: MallTradeConfigApi.Config) {
|
||||
return requestClient.put('/trade/config/save', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDeliveryExpressApi {
|
||||
/** 快递公司 */
|
||||
export interface DeliveryExpress {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 快递公司编码 */
|
||||
code: string;
|
||||
/** 快递公司名称 */
|
||||
name: string;
|
||||
/** 快递公司 logo */
|
||||
logo: string;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
}
|
||||
|
||||
/** 快递公司精简信息 */
|
||||
export interface SimpleDeliveryExpress {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 快递公司编码 */
|
||||
code: string;
|
||||
/** 快递公司名称 */
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询快递公司列表 */
|
||||
export function getDeliveryExpressPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallDeliveryExpressApi.DeliveryExpress>>(
|
||||
'/trade/delivery/express/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询快递公司详情 */
|
||||
export function getDeliveryExpress(id: number) {
|
||||
return requestClient.get<MallDeliveryExpressApi.DeliveryExpress>(
|
||||
`/trade/delivery/express/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得快递公司精简信息列表 */
|
||||
export function getSimpleDeliveryExpressList() {
|
||||
return requestClient.get<MallDeliveryExpressApi.SimpleDeliveryExpress[]>(
|
||||
'/trade/delivery/express/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增快递公司 */
|
||||
export function createDeliveryExpress(
|
||||
data: MallDeliveryExpressApi.DeliveryExpress,
|
||||
) {
|
||||
return requestClient.post('/trade/delivery/express/create', data);
|
||||
}
|
||||
|
||||
/** 修改快递公司 */
|
||||
export function updateDeliveryExpress(
|
||||
data: MallDeliveryExpressApi.DeliveryExpress,
|
||||
) {
|
||||
return requestClient.put('/trade/delivery/express/update', data);
|
||||
}
|
||||
|
||||
/** 删除快递公司 */
|
||||
export function deleteDeliveryExpress(id: number) {
|
||||
return requestClient.delete(`/trade/delivery/express/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 导出快递公司 Excel */
|
||||
export function exportDeliveryExpress(params: PageParam) {
|
||||
return requestClient.download('/trade/delivery/express/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDeliveryExpressTemplateApi {
|
||||
/** 运费模板计费 */
|
||||
export interface TemplateCharge {
|
||||
/** 区域编号列表 */
|
||||
areaIds: number[];
|
||||
/** 首件数量 */
|
||||
startCount: number;
|
||||
/** 首件价格,单位:分 */
|
||||
startPrice: number;
|
||||
/** 续件数量 */
|
||||
extraCount: number;
|
||||
/** 续件价格,单位:分 */
|
||||
extraPrice: number;
|
||||
}
|
||||
|
||||
/** 运费模板包邮 */
|
||||
export interface TemplateFree {
|
||||
/** 区域编号列表 */
|
||||
areaIds: number[];
|
||||
/** 包邮件数 */
|
||||
freeCount: number;
|
||||
/** 包邮金额,单位:分 */
|
||||
freePrice: number;
|
||||
}
|
||||
|
||||
/** 快递运费模板 */
|
||||
export interface ExpressTemplate {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 模板名称 */
|
||||
name: string;
|
||||
/** 计费方式 */
|
||||
chargeMode: number;
|
||||
/** 排序 */
|
||||
sort: number;
|
||||
/** 计费区域列表 */
|
||||
templateCharge: TemplateCharge[];
|
||||
/** 包邮区域列表 */
|
||||
templateFree: TemplateFree[];
|
||||
}
|
||||
|
||||
/** 运费模板精简信息 */
|
||||
export interface SimpleTemplate {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 模板名称 */
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询快递运费模板列表 */
|
||||
export function getDeliveryExpressTemplatePage(params: PageParam) {
|
||||
return requestClient.get<
|
||||
PageResult<MallDeliveryExpressTemplateApi.ExpressTemplate>
|
||||
>('/trade/delivery/express-template/page', { params });
|
||||
}
|
||||
|
||||
/** 查询快递运费模板详情 */
|
||||
export function getDeliveryExpressTemplate(id: number) {
|
||||
return requestClient.get<MallDeliveryExpressTemplateApi.ExpressTemplate>(
|
||||
`/trade/delivery/express-template/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询快递运费模板详情 */
|
||||
export function getSimpleTemplateList() {
|
||||
return requestClient.get<MallDeliveryExpressTemplateApi.SimpleTemplate[]>(
|
||||
'/trade/delivery/express-template/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增快递运费模板 */
|
||||
export function createDeliveryExpressTemplate(
|
||||
data: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
||||
) {
|
||||
return requestClient.post('/trade/delivery/express-template/create', data);
|
||||
}
|
||||
|
||||
/** 修改快递运费模板 */
|
||||
export function updateDeliveryExpressTemplate(
|
||||
data: MallDeliveryExpressTemplateApi.ExpressTemplate,
|
||||
) {
|
||||
return requestClient.put('/trade/delivery/express-template/update', data);
|
||||
}
|
||||
|
||||
/** 删除快递运费模板 */
|
||||
export function deleteDeliveryExpressTemplate(id: number) {
|
||||
return requestClient.delete(
|
||||
`/trade/delivery/express-template/delete?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallDeliveryPickUpStoreApi {
|
||||
/** 自提门店 */
|
||||
export interface PickUpStore {
|
||||
/** 编号 */
|
||||
id: number;
|
||||
/** 门店名称 */
|
||||
name: string;
|
||||
/** 门店简介 */
|
||||
introduction: string;
|
||||
/** 联系电话 */
|
||||
phone: string;
|
||||
/** 区域编号 */
|
||||
areaId: number;
|
||||
/** 详细地址 */
|
||||
detailAddress: string;
|
||||
/** 门店 logo */
|
||||
logo: string;
|
||||
/** 营业开始时间 */
|
||||
openingTime: string;
|
||||
/** 营业结束时间 */
|
||||
closingTime: string;
|
||||
/** 纬度 */
|
||||
latitude: number;
|
||||
/** 经度 */
|
||||
longitude: number;
|
||||
/** 状态 */
|
||||
status: number;
|
||||
/** 绑定用户编号组数 */
|
||||
verifyUserIds: number[];
|
||||
}
|
||||
|
||||
/** 绑定自提店员请求 */
|
||||
export interface BindStaffRequest {
|
||||
id?: number;
|
||||
/** 门店名称 */
|
||||
name: string;
|
||||
/** 门店编号 */
|
||||
storeId: number;
|
||||
/** 用户编号列表 */
|
||||
userIds: number[];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询自提门店列表 */
|
||||
export function getDeliveryPickUpStorePage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallDeliveryPickUpStoreApi.PickUpStore>>(
|
||||
'/trade/delivery/pick-up-store/page',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询自提门店详情 */
|
||||
export function getDeliveryPickUpStore(id: number) {
|
||||
return requestClient.get<MallDeliveryPickUpStoreApi.PickUpStore>(
|
||||
`/trade/delivery/pick-up-store/get?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询自提门店精简列表 */
|
||||
export function getSimpleDeliveryPickUpStoreList() {
|
||||
return requestClient.get<MallDeliveryPickUpStoreApi.PickUpStore[]>(
|
||||
'/trade/delivery/pick-up-store/simple-list',
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增自提门店 */
|
||||
export function createDeliveryPickUpStore(
|
||||
data: MallDeliveryPickUpStoreApi.PickUpStore,
|
||||
) {
|
||||
return requestClient.post('/trade/delivery/pick-up-store/create', data);
|
||||
}
|
||||
|
||||
/** 修改自提门店 */
|
||||
export function updateDeliveryPickUpStore(
|
||||
data: MallDeliveryPickUpStoreApi.PickUpStore,
|
||||
) {
|
||||
return requestClient.put('/trade/delivery/pick-up-store/update', data);
|
||||
}
|
||||
|
||||
/** 删除自提门店 */
|
||||
export function deleteDeliveryPickUpStore(id: number) {
|
||||
return requestClient.delete(`/trade/delivery/pick-up-store/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 绑定自提店员 */
|
||||
export function bindStoreStaffId(
|
||||
data: MallDeliveryPickUpStoreApi.BindStaffRequest,
|
||||
) {
|
||||
return requestClient.post('/trade/delivery/pick-up-store/bind', data);
|
||||
}
|
||||
|
|
@ -0,0 +1,298 @@
|
|||
import type { PageParam, PageResult } from '@vben/request';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace MallOrderApi {
|
||||
/** 商品属性 */
|
||||
export interface ProductProperty {
|
||||
/** 属性的编号 */
|
||||
propertyId?: null | number;
|
||||
/** 属性的名称 */
|
||||
propertyName?: string;
|
||||
/** 属性值的编号 */
|
||||
valueId?: null | number;
|
||||
/** 属性值的名称 */
|
||||
valueName?: string;
|
||||
}
|
||||
|
||||
/** 订单项 */
|
||||
export interface OrderItem {
|
||||
/** 编号 */
|
||||
id?: null | number;
|
||||
/** 用户编号 */
|
||||
userId?: null | number;
|
||||
/** 订单编号 */
|
||||
orderId?: null | number;
|
||||
/** 商品 SPU 编号 */
|
||||
spuId?: null | number;
|
||||
/** 商品 SPU 名称 */
|
||||
spuName?: string;
|
||||
/** 商品 SKU 编号 */
|
||||
skuId?: null | number;
|
||||
/** 商品图片 */
|
||||
picUrl?: string;
|
||||
/** 购买数量 */
|
||||
count?: null | number;
|
||||
/** 商品原价(总) */
|
||||
originalPrice?: null | number;
|
||||
/** 商品原价(单) */
|
||||
originalUnitPrice?: null | number;
|
||||
/** 商品优惠(总) */
|
||||
discountPrice?: null | number;
|
||||
/** 商品实付金额(总) */
|
||||
payPrice?: null | number;
|
||||
/** 子订单分摊金额(总) */
|
||||
orderPartPrice?: null | number;
|
||||
/** 分摊后子订单实付金额(总) */
|
||||
orderDividePrice?: null | number;
|
||||
/** 售后状态 */
|
||||
afterSaleStatus?: null | number;
|
||||
/** 属性数组 */
|
||||
properties?: ProductProperty[];
|
||||
}
|
||||
|
||||
/** 订单日志 */
|
||||
export interface OrderLog {
|
||||
/** 日志内容 */
|
||||
content?: string;
|
||||
/** 创建时间 */
|
||||
createTime?: Date;
|
||||
/** 用户类型 */
|
||||
userType?: number;
|
||||
}
|
||||
|
||||
/** 订单 */
|
||||
export interface Order {
|
||||
/** 订单编号 */
|
||||
id?: null | number;
|
||||
/** 订单流水号 */
|
||||
no?: string;
|
||||
/** 下单时间 */
|
||||
createTime?: Date | null;
|
||||
/** 订单类型 */
|
||||
type?: null | number;
|
||||
/** 订单来源 */
|
||||
terminal?: null | number;
|
||||
/** 用户编号 */
|
||||
userId?: null | number;
|
||||
/** 用户 IP */
|
||||
userIp?: string;
|
||||
/** 用户备注 */
|
||||
userRemark?: string;
|
||||
/** 订单状态 */
|
||||
status?: null | number;
|
||||
/** 购买的商品数量 */
|
||||
productCount?: null | number;
|
||||
/** 订单完成时间 */
|
||||
finishTime?: Date | null;
|
||||
/** 订单取消时间 */
|
||||
cancelTime?: Date | null;
|
||||
/** 取消类型 */
|
||||
cancelType?: null | number;
|
||||
/** 商家备注 */
|
||||
remark?: string;
|
||||
/** 支付订单编号 */
|
||||
payOrderId?: null | number;
|
||||
/** 是否已支付 */
|
||||
payStatus?: boolean;
|
||||
/** 付款时间 */
|
||||
payTime?: Date | null;
|
||||
/** 支付渠道 */
|
||||
payChannelCode?: string;
|
||||
/** 商品原价(总) */
|
||||
totalPrice?: null | number;
|
||||
/** 订单优惠(总) */
|
||||
discountPrice?: null | number;
|
||||
/** 运费金额 */
|
||||
deliveryPrice?: null | number;
|
||||
/** 订单调价(总) */
|
||||
adjustPrice?: null | number;
|
||||
/** 应付金额(总) */
|
||||
payPrice?: null | number;
|
||||
/** 发货方式 */
|
||||
deliveryType?: null | number;
|
||||
/** 自提门店编号 */
|
||||
pickUpStoreId?: number;
|
||||
/** 自提核销码 */
|
||||
pickUpVerifyCode?: string;
|
||||
/** 配送模板编号 */
|
||||
deliveryTemplateId?: null | number;
|
||||
/** 发货物流公司编号 */
|
||||
logisticsId?: null | number;
|
||||
/** 发货物流单号 */
|
||||
logisticsNo?: string;
|
||||
/** 发货时间 */
|
||||
deliveryTime?: Date | null;
|
||||
/** 收货时间 */
|
||||
receiveTime?: Date | null;
|
||||
/** 收件人名称 */
|
||||
receiverName?: string;
|
||||
/** 收件人手机 */
|
||||
receiverMobile?: string;
|
||||
/** 收件人邮编 */
|
||||
receiverPostCode?: null | number;
|
||||
/** 收件人地区编号 */
|
||||
receiverAreaId?: null | number;
|
||||
/** 收件人地区名字 */
|
||||
receiverAreaName?: string;
|
||||
/** 收件人详细地址 */
|
||||
receiverDetailAddress?: string;
|
||||
/** 售后状态 */
|
||||
afterSaleStatus?: null | number;
|
||||
/** 退款金额 */
|
||||
refundPrice?: null | number;
|
||||
/** 优惠劵编号 */
|
||||
couponId?: null | number;
|
||||
/** 优惠劵减免金额 */
|
||||
couponPrice?: null | number;
|
||||
/** 积分抵扣的金额 */
|
||||
pointPrice?: null | number;
|
||||
/** VIP 减免金额 */
|
||||
vipPrice?: null | number;
|
||||
/** 订单项列表 */
|
||||
items?: OrderItem[];
|
||||
/** 下单用户信息 */
|
||||
user?: {
|
||||
/** 用户头像 */
|
||||
avatar?: string;
|
||||
/** 用户编号 */
|
||||
id?: null | number;
|
||||
/** 用户昵称 */
|
||||
nickname?: string;
|
||||
};
|
||||
/** 推广用户信息 */
|
||||
brokerageUser?: {
|
||||
/** 用户头像 */
|
||||
avatar?: string;
|
||||
/** 用户编号 */
|
||||
id?: null | number;
|
||||
/** 用户昵称 */
|
||||
nickname?: string;
|
||||
};
|
||||
/** 订单操作日志 */
|
||||
logs?: OrderLog[];
|
||||
}
|
||||
|
||||
/** 交易订单统计 */
|
||||
export interface OrderSummary {
|
||||
/** 订单数量 */
|
||||
orderCount: number;
|
||||
/** 订单金额 */
|
||||
orderPayPrice: number;
|
||||
/** 退款单数 */
|
||||
afterSaleCount: number;
|
||||
/** 退款金额 */
|
||||
afterSalePrice: number;
|
||||
}
|
||||
|
||||
/** 订单发货请求 */
|
||||
export interface DeliveryRequest {
|
||||
/** 订单编号 */
|
||||
id?: number;
|
||||
/** 发货方式 */
|
||||
expressType: string;
|
||||
/** 物流公司编号 */
|
||||
logisticsId: null | number;
|
||||
/** 物流编号 */
|
||||
logisticsNo: string;
|
||||
}
|
||||
|
||||
/** 订单备注请求 */
|
||||
export interface RemarkRequest {
|
||||
/** 订单编号 */
|
||||
id: number;
|
||||
/** 备注 */
|
||||
remark: string;
|
||||
}
|
||||
|
||||
/** 订单调价请求 */
|
||||
export interface PriceRequest {
|
||||
/** 订单编号 */
|
||||
id: number;
|
||||
/** 调整金额,单位:分 */
|
||||
adjustPrice: number;
|
||||
}
|
||||
|
||||
/** 订单地址请求 */
|
||||
export interface AddressRequest {
|
||||
/** 订单编号 */
|
||||
id: number;
|
||||
/** 收件人名称 */
|
||||
receiverName: string;
|
||||
/** 收件人手机 */
|
||||
receiverMobile: string;
|
||||
/** 收件人地区编号 */
|
||||
receiverAreaId: number;
|
||||
/** 收件人详细地址 */
|
||||
receiverDetailAddress: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询交易订单列表 */
|
||||
export function getOrderPage(params: PageParam) {
|
||||
return requestClient.get<PageResult<MallOrderApi.Order>>(
|
||||
'/trade/order/page',
|
||||
{
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询交易订单统计 */
|
||||
export function getOrderSummary(params: PageParam) {
|
||||
return requestClient.get<MallOrderApi.OrderSummary>('/trade/order/summary', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询交易订单详情 */
|
||||
export function getOrder(id: number) {
|
||||
return requestClient.get<MallOrderApi.Order>(
|
||||
`/trade/order/get-detail?id=${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询交易订单物流详情 */
|
||||
export function getExpressTrackList(id: number) {
|
||||
return requestClient.get(`/trade/order/get-express-track-list?id=${id}`);
|
||||
}
|
||||
|
||||
/** 订单发货 */
|
||||
export function deliveryOrder(data: MallOrderApi.DeliveryRequest) {
|
||||
return requestClient.put('/trade/order/delivery', data);
|
||||
}
|
||||
|
||||
/** 订单备注 */
|
||||
export function updateOrderRemark(data: MallOrderApi.RemarkRequest) {
|
||||
return requestClient.put('/trade/order/update-remark', data);
|
||||
}
|
||||
|
||||
/** 订单调价 */
|
||||
export function updateOrderPrice(data: MallOrderApi.PriceRequest) {
|
||||
return requestClient.put('/trade/order/update-price', data);
|
||||
}
|
||||
|
||||
/** 修改订单地址 */
|
||||
export function updateOrderAddress(data: MallOrderApi.AddressRequest) {
|
||||
return requestClient.put('/trade/order/update-address', data);
|
||||
}
|
||||
|
||||
/** 订单核销 */
|
||||
export function pickUpOrder(id: number) {
|
||||
return requestClient.put(`/trade/order/pick-up-by-id?id=${id}`);
|
||||
}
|
||||
|
||||
/** 订单核销 */
|
||||
export function pickUpOrderByVerifyCode(pickUpVerifyCode: string) {
|
||||
return requestClient.put('/trade/order/pick-up-by-verify-code', {
|
||||
params: { pickUpVerifyCode },
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询核销码对应的订单 */
|
||||
export function getOrderByPickUpVerifyCode(pickUpVerifyCode: string) {
|
||||
return requestClient.get<MallOrderApi.Order>(
|
||||
'/trade/order/get-by-pick-up-verify-code',
|
||||
{ params: { pickUpVerifyCode } },
|
||||
);
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ export namespace PayAppApi {
|
|||
status: number;
|
||||
}
|
||||
|
||||
export interface AppPageReqVO extends PageParam {
|
||||
export interface AppPageReq extends PageParam {
|
||||
name?: string;
|
||||
status?: number;
|
||||
remark?: string;
|
||||
|
|
@ -37,7 +37,7 @@ export namespace PayAppApi {
|
|||
}
|
||||
|
||||
/** 查询支付应用列表 */
|
||||
export function getAppPage(params: PayAppApi.AppPageReqVO) {
|
||||
export function getAppPage(params: PayAppApi.AppPageReq) {
|
||||
return requestClient.get<PageResult<PayAppApi.App>>('/pay/app/page', {
|
||||
params,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export namespace DemoOrderApi {
|
|||
createTime?: Date;
|
||||
}
|
||||
|
||||
export interface OrderPageReqVO extends PageParam {
|
||||
export interface OrderPageReq extends PageParam {
|
||||
spuId?: number;
|
||||
createTime?: Date[];
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ export function createDemoOrder(data: DemoOrderApi.Order) {
|
|||
}
|
||||
|
||||
/** 获得示例订单分页 */
|
||||
export function getDemoOrderPage(params: DemoOrderApi.OrderPageReqVO) {
|
||||
export function getDemoOrderPage(params: DemoOrderApi.OrderPageReq) {
|
||||
return requestClient.get<PageResult<DemoOrderApi.Order>>(
|
||||
'/pay/demo-order/page',
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export namespace PayOrderApi {
|
|||
}
|
||||
|
||||
/** 支付订单分页请求 */
|
||||
export interface OrderPageReqVO extends PageParam {
|
||||
export interface OrderPageReq extends PageParam {
|
||||
merchantId?: number;
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
|
|
@ -66,7 +66,7 @@ export namespace PayOrderApi {
|
|||
}
|
||||
|
||||
/** 支付订单导出请求 */
|
||||
export interface OrderExportReqVO {
|
||||
export interface OrderExportReq {
|
||||
merchantId?: number;
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
|
|
@ -93,7 +93,7 @@ export namespace PayOrderApi {
|
|||
}
|
||||
|
||||
/** 查询支付订单列表 */
|
||||
export function getOrderPage(params: PayOrderApi.OrderPageReqVO) {
|
||||
export function getOrderPage(params: PayOrderApi.OrderPageReq) {
|
||||
return requestClient.get<PageResult<PayOrderApi.Order>>('/pay/order/page', {
|
||||
params,
|
||||
});
|
||||
|
|
@ -120,6 +120,6 @@ export function submitOrder(data: any) {
|
|||
}
|
||||
|
||||
/** 导出支付订单 */
|
||||
export function exportOrder(params: PayOrderApi.OrderExportReqVO) {
|
||||
export function exportOrder(params: PayOrderApi.OrderExportReq) {
|
||||
return requestClient.download('/pay/order/export-excel', { params });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export namespace PayRefundApi {
|
|||
}
|
||||
|
||||
/** 退款订单分页请求 */
|
||||
export interface RefundPageReqVO extends PageParam {
|
||||
export interface RefundPageReq extends PageParam {
|
||||
merchantId?: number;
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
|
|
@ -64,7 +64,7 @@ export namespace PayRefundApi {
|
|||
}
|
||||
|
||||
/** 退款订单导出请求 */
|
||||
export interface RefundExportReqVO {
|
||||
export interface RefundExportReq {
|
||||
merchantId?: number;
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
|
|
@ -94,7 +94,7 @@ export namespace PayRefundApi {
|
|||
}
|
||||
|
||||
/** 查询退款订单列表 */
|
||||
export function getRefundPage(params: PayRefundApi.RefundPageReqVO) {
|
||||
export function getRefundPage(params: PayRefundApi.RefundPageReq) {
|
||||
return requestClient.get<PageResult<PayRefundApi.Refund>>(
|
||||
'/pay/refund/page',
|
||||
{
|
||||
|
|
@ -124,6 +124,6 @@ export function deleteRefund(id: number) {
|
|||
}
|
||||
|
||||
/** 导出退款订单 */
|
||||
export function exportRefund(params: PayRefundApi.RefundExportReqVO) {
|
||||
export function exportRefund(params: PayRefundApi.RefundExportReq) {
|
||||
return requestClient.download('/pay/refund/export-excel', { params });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export namespace PayTransferApi {
|
|||
}
|
||||
|
||||
/** 转账单分页请求 */
|
||||
export interface TransferPageReqVO extends PageParam {
|
||||
export interface TransferPageReq extends PageParam {
|
||||
appId?: number;
|
||||
channelId?: number;
|
||||
channelCode?: string;
|
||||
|
|
@ -36,7 +36,7 @@ export namespace PayTransferApi {
|
|||
}
|
||||
|
||||
/** 查询转账单列表 */
|
||||
export function getTransferPage(params: PayTransferApi.TransferPageReqVO) {
|
||||
export function getTransferPage(params: PayTransferApi.TransferPageReq) {
|
||||
return requestClient.get<PageResult<PayTransferApi.Transfer>>(
|
||||
'/pay/transfer/page',
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ import { requestClient } from '#/api/request';
|
|||
|
||||
export namespace PayWalletApi {
|
||||
/** 用户钱包查询参数 */
|
||||
export interface PayWalletUserReqVO {
|
||||
export interface PayWalletUserReq {
|
||||
userId: number;
|
||||
}
|
||||
|
||||
/** 钱包信息 */
|
||||
export interface WalletVO {
|
||||
export interface Wallet {
|
||||
id: number;
|
||||
userId: number;
|
||||
userType: number;
|
||||
|
|
@ -20,7 +20,7 @@ export namespace PayWalletApi {
|
|||
}
|
||||
|
||||
/** 钱包分页请求 */
|
||||
export interface WalletPageReqVO extends PageParam {
|
||||
export interface WalletPageReq extends PageParam {
|
||||
userId?: number;
|
||||
userType?: number;
|
||||
balance?: number;
|
||||
|
|
@ -31,15 +31,15 @@ export namespace PayWalletApi {
|
|||
}
|
||||
|
||||
/** 查询用户钱包详情 */
|
||||
export function getWallet(params: PayWalletApi.PayWalletUserReqVO) {
|
||||
return requestClient.get<PayWalletApi.WalletVO>('/pay/wallet/get', {
|
||||
export function getWallet(params: PayWalletApi.PayWalletUserReq) {
|
||||
return requestClient.get<PayWalletApi.Wallet>('/pay/wallet/get', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询会员钱包列表 */
|
||||
export function getWalletPage(params: PayWalletApi.WalletPageReqVO) {
|
||||
return requestClient.get<PageResult<PayWalletApi.WalletVO>>(
|
||||
export function getWalletPage(params: PayWalletApi.WalletPageReq) {
|
||||
return requestClient.get<PageResult<PayWalletApi.Wallet>>(
|
||||
'/pay/wallet/page',
|
||||
{
|
||||
params,
|
||||
|
|
@ -48,6 +48,6 @@ export function getWalletPage(params: PayWalletApi.WalletPageReqVO) {
|
|||
}
|
||||
|
||||
/** 修改会员钱包余额 */
|
||||
export function updateWalletBalance(data: PayWalletApi.WalletVO) {
|
||||
export function updateWalletBalance(data: PayWalletApi.Wallet) {
|
||||
return requestClient.put('/pay/wallet/update-balance', data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,3 +45,8 @@ export async function updateDept(data: SystemDeptApi.Dept) {
|
|||
export async function deleteDept(id: number) {
|
||||
return requestClient.delete(`/system/dept/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除部门 */
|
||||
export async function deleteDeptList(ids: number[]) {
|
||||
return requestClient.delete(`/system/dept/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,14 @@ export function deleteDictData(id: number) {
|
|||
return requestClient.delete(`/system/dict-data/delete?id=${id}`);
|
||||
}
|
||||
|
||||
// 批量删除字典数据
|
||||
export function deleteDictDataList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/dict-data/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
// 导出字典类型数据
|
||||
export function exportDictData(params: any) {
|
||||
return requestClient.download('/system/dict-data/export', { params });
|
||||
return requestClient.download('/system/dict-data/export-excel', { params });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,14 @@ export function deleteDictType(id: number) {
|
|||
return requestClient.delete(`/system/dict-type/delete?id=${id}`);
|
||||
}
|
||||
|
||||
// 批量删除字典
|
||||
export function deleteDictTypeList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/dict-type/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
// 导出字典类型
|
||||
export function exportDictType(params: any) {
|
||||
return requestClient.download('/system/dict-type/export', { params });
|
||||
return requestClient.download('/system/dict-type/export-excel', { params });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,13 @@ export function deleteMailAccount(id: number) {
|
|||
return requestClient.delete(`/system/mail-account/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除邮箱账号 */
|
||||
export function deleteMailAccountList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/mail-account/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获得邮箱账号精简列表 */
|
||||
export function getSimpleMailAccountList() {
|
||||
return requestClient.get<SystemMailAccountApi.MailAccount[]>(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export namespace SystemMailTemplateApi {
|
|||
}
|
||||
|
||||
/** 邮件发送信息 */
|
||||
export interface MailSendReqVO {
|
||||
export interface MailSendReq {
|
||||
mail: string;
|
||||
templateCode: string;
|
||||
templateParams: Record<string, any>;
|
||||
|
|
@ -56,7 +56,14 @@ export function deleteMailTemplate(id: number) {
|
|||
return requestClient.delete(`/system/mail-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除邮件模板 */
|
||||
export function deleteMailTemplateList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/mail-template/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 发送邮件 */
|
||||
export function sendMail(data: SystemMailTemplateApi.MailSendReqVO) {
|
||||
export function sendMail(data: SystemMailTemplateApi.MailSendReq) {
|
||||
return requestClient.post('/system/mail-template/send-mail', data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,3 +52,8 @@ export async function updateMenu(data: SystemMenuApi.Menu) {
|
|||
export async function deleteMenu(id: number) {
|
||||
return requestClient.delete(`/system/menu/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除菜单 */
|
||||
export async function deleteMenuList(ids: number[]) {
|
||||
return requestClient.delete(`/system/menu/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,13 @@ export function deleteNotice(id: number) {
|
|||
return requestClient.delete(`/system/notice/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除公告 */
|
||||
export function deleteNoticeList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/notice/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 推送公告 */
|
||||
export function pushNotice(id: number) {
|
||||
return requestClient.post(`/system/notice/push?id=${id}`);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export namespace SystemNotifyTemplateApi {
|
|||
}
|
||||
|
||||
/** 发送站内信请求 */
|
||||
export interface NotifySendReqVO {
|
||||
export interface NotifySendReq {
|
||||
userId: number;
|
||||
userType: number;
|
||||
templateCode: string;
|
||||
|
|
@ -59,6 +59,13 @@ export function deleteNotifyTemplate(id: number) {
|
|||
return requestClient.delete(`/system/notify-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除站内信模板 */
|
||||
export function deleteNotifyTemplateList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/notify-template/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出站内信模板 */
|
||||
export function exportNotifyTemplate(params: any) {
|
||||
return requestClient.download('/system/notify-template/export-excel', {
|
||||
|
|
@ -67,6 +74,6 @@ export function exportNotifyTemplate(params: any) {
|
|||
}
|
||||
|
||||
/** 发送站内信 */
|
||||
export function sendNotify(data: SystemNotifyTemplateApi.NotifySendReqVO) {
|
||||
export function sendNotify(data: SystemNotifyTemplateApi.NotifySendReq) {
|
||||
return requestClient.post('/system/notify-template/send-notify', data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { requestClient } from '#/api/request';
|
|||
/** OAuth2.0 授权信息响应 */
|
||||
export namespace SystemOAuth2ClientApi {
|
||||
/** 授权信息 */
|
||||
export interface AuthorizeInfoRespVO {
|
||||
export interface AuthorizeInfoResp {
|
||||
client: {
|
||||
logo: string;
|
||||
name: string;
|
||||
|
|
@ -17,7 +17,7 @@ export namespace SystemOAuth2ClientApi {
|
|||
|
||||
/** 获得授权信息 */
|
||||
export function getAuthorize(clientId: string) {
|
||||
return requestClient.get<SystemOAuth2ClientApi.AuthorizeInfoRespVO>(
|
||||
return requestClient.get<SystemOAuth2ClientApi.AuthorizeInfoResp>(
|
||||
`/system/oauth2/authorize?clientId=${clientId}`,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,3 +32,10 @@ export function deleteOAuth2Token(accessToken: string) {
|
|||
`/system/oauth2-token/delete?accessToken=${accessToken}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 批量删除 OAuth2.0 令牌 */
|
||||
export function deleteOAuth2TokenList(accessTokens: string[]) {
|
||||
return requestClient.delete(
|
||||
`/system/oauth2-token/delete-list?accessTokens=${accessTokens.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,19 +2,19 @@ import { requestClient } from '#/api/request';
|
|||
|
||||
export namespace SystemPermissionApi {
|
||||
/** 分配用户角色请求 */
|
||||
export interface AssignUserRoleReqVO {
|
||||
export interface AssignUserRoleReq {
|
||||
userId: number;
|
||||
roleIds: number[];
|
||||
}
|
||||
|
||||
/** 分配角色菜单请求 */
|
||||
export interface AssignRoleMenuReqVO {
|
||||
export interface AssignRoleMenuReq {
|
||||
roleId: number;
|
||||
menuIds: number[];
|
||||
}
|
||||
|
||||
/** 分配角色数据权限请求 */
|
||||
export interface AssignRoleDataScopeReqVO {
|
||||
export interface AssignRoleDataScopeReq {
|
||||
roleId: number;
|
||||
dataScope: number;
|
||||
dataScopeDeptIds: number[];
|
||||
|
|
@ -30,14 +30,14 @@ export async function getRoleMenuList(roleId: number) {
|
|||
|
||||
/** 赋予角色菜单权限 */
|
||||
export async function assignRoleMenu(
|
||||
data: SystemPermissionApi.AssignRoleMenuReqVO,
|
||||
data: SystemPermissionApi.AssignRoleMenuReq,
|
||||
) {
|
||||
return requestClient.post('/system/permission/assign-role-menu', data);
|
||||
}
|
||||
|
||||
/** 赋予角色数据权限 */
|
||||
export async function assignRoleDataScope(
|
||||
data: SystemPermissionApi.AssignRoleDataScopeReqVO,
|
||||
data: SystemPermissionApi.AssignRoleDataScopeReq,
|
||||
) {
|
||||
return requestClient.post('/system/permission/assign-role-data-scope', data);
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@ export async function getUserRoleList(userId: number) {
|
|||
|
||||
/** 赋予用户角色 */
|
||||
export async function assignUserRole(
|
||||
data: SystemPermissionApi.AssignUserRoleReqVO,
|
||||
data: SystemPermissionApi.AssignUserRoleReq,
|
||||
) {
|
||||
return requestClient.post('/system/permission/assign-user-role', data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,9 +50,14 @@ export function deletePost(id: number) {
|
|||
return requestClient.delete(`/system/post/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除岗位 */
|
||||
export function deletePostList(ids: number[]) {
|
||||
return requestClient.delete(`/system/post/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 导出岗位 */
|
||||
export function exportPost(params: any) {
|
||||
return requestClient.download('/system/post/export', {
|
||||
return requestClient.download('/system/post/export-excel', {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,11 @@ export function deleteRole(id: number) {
|
|||
return requestClient.delete(`/system/role/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除角色 */
|
||||
export function deleteRoleList(ids: number[]) {
|
||||
return requestClient.delete(`/system/role/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 导出角色 */
|
||||
export function exportRole(params: any) {
|
||||
return requestClient.download('/system/role/export-excel', {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,14 @@ export function deleteSmsChannel(id: number) {
|
|||
return requestClient.delete(`/system/sms-channel/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除短信渠道 */
|
||||
export function deleteSmsChannelList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/sms-channel/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出短信渠道 */
|
||||
export function exportSmsChannel(params: any) {
|
||||
return requestClient.download('/system/sms-channel/export', { params });
|
||||
return requestClient.download('/system/sms-channel/export-excel', { params });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ export namespace SystemSmsTemplateApi {
|
|||
}
|
||||
|
||||
/** 发送短信请求 */
|
||||
export interface SmsSendReqVO {
|
||||
export interface SmsSendReq {
|
||||
mobile: string;
|
||||
templateCode: string;
|
||||
templateParams: Record<string, any>;
|
||||
|
|
@ -57,6 +57,13 @@ export function deleteSmsTemplate(id: number) {
|
|||
return requestClient.delete(`/system/sms-template/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除短信模板 */
|
||||
export function deleteSmsTemplateList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/sms-template/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出短信模板 */
|
||||
export function exportSmsTemplate(params: any) {
|
||||
return requestClient.download('/system/sms-template/export-excel', {
|
||||
|
|
@ -65,6 +72,6 @@ export function exportSmsTemplate(params: any) {
|
|||
}
|
||||
|
||||
/** 发送短信 */
|
||||
export function sendSms(data: SystemSmsTemplateApi.SmsSendReqVO) {
|
||||
export function sendSms(data: SystemSmsTemplateApi.SmsSendReq) {
|
||||
return requestClient.post('/system/sms-template/send-sms', data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ export namespace SystemSocialUserApi {
|
|||
}
|
||||
|
||||
/** 社交绑定请求 */
|
||||
export interface SocialUserBindReqVO {
|
||||
export interface SocialUserBindReq {
|
||||
type: number;
|
||||
code: string;
|
||||
state: string;
|
||||
}
|
||||
|
||||
/** 取消社交绑定请求 */
|
||||
export interface SocialUserUnbindReqVO {
|
||||
export interface SocialUserUnbindReq {
|
||||
type: number;
|
||||
openid: string;
|
||||
}
|
||||
|
|
@ -49,12 +49,12 @@ export function getSocialUser(id: number) {
|
|||
}
|
||||
|
||||
/** 社交绑定,使用 code 授权码 */
|
||||
export function socialBind(data: SystemSocialUserApi.SocialUserBindReqVO) {
|
||||
export function socialBind(data: SystemSocialUserApi.SocialUserBindReq) {
|
||||
return requestClient.post<boolean>('/system/social-user/bind', data);
|
||||
}
|
||||
|
||||
/** 取消社交绑定 */
|
||||
export function socialUnbind(data: SystemSocialUserApi.SocialUserUnbindReqVO) {
|
||||
export function socialUnbind(data: SystemSocialUserApi.SocialUserUnbindReq) {
|
||||
return requestClient.delete<boolean>('/system/social-user/unbind', { data });
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,13 @@ export function deleteTenantPackage(id: number) {
|
|||
return requestClient.delete(`/system/tenant-package/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除租户套餐 */
|
||||
export function deleteTenantPackageList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/tenant-package/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取租户套餐精简信息列表 */
|
||||
export function getTenantPackageList() {
|
||||
return requestClient.get<SystemTenantPackageApi.TenantPackage[]>(
|
||||
|
|
|
|||
|
|
@ -61,6 +61,13 @@ export function deleteTenant(id: number) {
|
|||
return requestClient.delete(`/system/tenant/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除租户 */
|
||||
export function deleteTenantList(ids: number[]) {
|
||||
return requestClient.delete(
|
||||
`/system/tenant/delete-list?ids=${ids.join(',')}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 导出租户 */
|
||||
export function exportTenant(params: any) {
|
||||
return requestClient.download('/system/tenant/export-excel', {
|
||||
|
|
|
|||
|
|
@ -49,9 +49,14 @@ export function deleteUser(id: number) {
|
|||
return requestClient.delete(`/system/user/delete?id=${id}`);
|
||||
}
|
||||
|
||||
/** 批量删除用户 */
|
||||
export function deleteUserList(ids: number[]) {
|
||||
return requestClient.delete(`/system/user/delete-list?ids=${ids.join(',')}`);
|
||||
}
|
||||
|
||||
/** 导出用户 */
|
||||
export function exportUser(params: any) {
|
||||
return requestClient.download('/system/user/export', params);
|
||||
return requestClient.download('/system/user/export-excel', params);
|
||||
}
|
||||
|
||||
/** 下载用户导入模板 */
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { requestClient } from '#/api/request';
|
|||
|
||||
export namespace SystemUserProfileApi {
|
||||
/** 用户个人中心信息 */
|
||||
export interface UserProfileRespVO {
|
||||
export interface UserProfileResp {
|
||||
id: number;
|
||||
username: string;
|
||||
nickname: string;
|
||||
|
|
@ -19,13 +19,13 @@ export namespace SystemUserProfileApi {
|
|||
}
|
||||
|
||||
/** 更新密码请求 */
|
||||
export interface UpdatePasswordReqVO {
|
||||
export interface UpdatePasswordReq {
|
||||
oldPassword: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
/** 更新个人信息请求 */
|
||||
export interface UpdateProfileReqVO {
|
||||
export interface UpdateProfileReq {
|
||||
nickname?: string;
|
||||
email?: string;
|
||||
mobile?: string;
|
||||
|
|
@ -36,21 +36,19 @@ export namespace SystemUserProfileApi {
|
|||
|
||||
/** 获取登录用户信息 */
|
||||
export function getUserProfile() {
|
||||
return requestClient.get<SystemUserProfileApi.UserProfileRespVO>(
|
||||
return requestClient.get<SystemUserProfileApi.UserProfileResp>(
|
||||
'/system/user/profile/get',
|
||||
);
|
||||
}
|
||||
|
||||
/** 修改用户个人信息 */
|
||||
export function updateUserProfile(
|
||||
data: SystemUserProfileApi.UpdateProfileReqVO,
|
||||
) {
|
||||
export function updateUserProfile(data: SystemUserProfileApi.UpdateProfileReq) {
|
||||
return requestClient.put('/system/user/profile/update', data);
|
||||
}
|
||||
|
||||
/** 修改用户个人密码 */
|
||||
export function updateUserPassword(
|
||||
data: SystemUserProfileApi.UpdatePasswordReqVO,
|
||||
data: SystemUserProfileApi.UpdatePasswordReq,
|
||||
) {
|
||||
return requestClient.put('/system/user/profile/update-password', data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ interface DictTagProps {
|
|||
|
||||
const props = defineProps<DictTagProps>();
|
||||
|
||||
function isHexColor(color: string) {
|
||||
const reg = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
||||
return reg.test(color);
|
||||
}
|
||||
|
||||
/** 获取字典标签 */
|
||||
const dictTag = computed(() => {
|
||||
// 校验参数有效性
|
||||
|
|
@ -66,7 +71,16 @@ const dictTag = computed(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Tag v-if="dictTag" :color="dictTag.colorType">
|
||||
<Tag
|
||||
v-if="dictTag"
|
||||
:color="
|
||||
dictTag.colorType
|
||||
? dictTag.colorType
|
||||
: dictTag.cssClass && isHexColor(dictTag.cssClass)
|
||||
? dictTag.cssClass
|
||||
: ''
|
||||
"
|
||||
>
|
||||
{{ dictTag.label }}
|
||||
</Tag>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
<script lang="ts" setup>
|
||||
import { isDocAlertEnable } from '@vben/hooks';
|
||||
import { openWindow } from '@vben/utils';
|
||||
|
||||
import { Alert, Typography } from 'ant-design-vue';
|
||||
|
||||
export interface DocAlertProps {
|
||||
/**
|
||||
* 文档标题
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* 文档 URL 地址
|
||||
*/
|
||||
url: string;
|
||||
}
|
||||
|
||||
const props = defineProps<DocAlertProps>();
|
||||
|
||||
/** 跳转 URL 链接 */
|
||||
const goToUrl = () => {
|
||||
openWindow(props.url);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Alert v-if="isDocAlertEnable()" type="info" show-icon class="mb-2 rounded">
|
||||
<template #message>
|
||||
<Typography.Link @click="goToUrl">
|
||||
【{{ title }}】文档地址:{{ url }}
|
||||
</Typography.Link>
|
||||
</template>
|
||||
</Alert>
|
||||
</template>
|
||||
|
|
@ -1 +0,0 @@
|
|||
export { default as DocAlert } from './doc-alert.vue';
|
||||
|
|
@ -1,3 +1,9 @@
|
|||
import { defineAsyncComponent } from 'vue';
|
||||
|
||||
export const AsyncOperateLog = defineAsyncComponent(
|
||||
() => import('./operate-log.vue'),
|
||||
);
|
||||
|
||||
export { default as OperateLog } from './operate-log.vue';
|
||||
|
||||
export type { OperateLogProps } from './typing';
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<script setup lang="ts">
|
||||
import type { OperateLogProps } from './typing';
|
||||
|
||||
import { Timeline } from 'ant-design-vue';
|
||||
import { formatDateTime } from '@vben/utils';
|
||||
|
||||
import { Tag, Timeline } from 'ant-design-vue';
|
||||
|
||||
import { DICT_TYPE, getDictLabel, getDictObj } from '#/utils';
|
||||
|
||||
|
|
@ -38,8 +40,21 @@ function getUserTypeColor(userType: number) {
|
|||
:key="log.id"
|
||||
:color="getUserTypeColor(log.userType)"
|
||||
>
|
||||
<p>{{ log.createTime }}</p>
|
||||
<p>{{ getDictLabel(DICT_TYPE.USER_TYPE, log.userType)[0] }}</p>
|
||||
<template #dot>
|
||||
<p
|
||||
:style="{ backgroundColor: getUserTypeColor(log.userType) }"
|
||||
class="absolute left-[-5px] flex h-5 w-5 items-center justify-center rounded-full text-xs text-white"
|
||||
>
|
||||
{{ getDictLabel(DICT_TYPE.USER_TYPE, log.userType)[0] }}
|
||||
</p>
|
||||
</template>
|
||||
<p>{{ formatDateTime(log.createTime) }}</p>
|
||||
<p>
|
||||
<Tag :color="getUserTypeColor(log.userType)">
|
||||
{{ log.userName }}
|
||||
</Tag>
|
||||
{{ log.action }}
|
||||
</p>
|
||||
</Timeline.Item>
|
||||
</Timeline>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { ref } from 'vue';
|
|||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { handleTree } from '@vben/utils';
|
||||
|
||||
import { Button, Card, Col, Row, Tree } from 'ant-design-vue';
|
||||
import { Card, Col, Row, Tree } from 'ant-design-vue';
|
||||
|
||||
import { getSimpleDeptList } from '#/api/system/dept';
|
||||
|
||||
|
|
@ -41,24 +41,6 @@ const emit = defineEmits<{
|
|||
confirm: [deptList: SystemDeptApi.Dept[]];
|
||||
}>();
|
||||
|
||||
// 对话框配置
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
title: props.title,
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
resetData();
|
||||
return;
|
||||
}
|
||||
modalApi.setState({ loading: true });
|
||||
try {
|
||||
deptData.value = await getSimpleDeptList();
|
||||
deptTree.value = handleTree(deptData.value) as DataNode[];
|
||||
} finally {
|
||||
modalApi.setState({ loading: false });
|
||||
}
|
||||
},
|
||||
destroyOnClose: true,
|
||||
});
|
||||
type checkedKeys = number[] | { checked: number[]; halfChecked: number[] };
|
||||
// 部门树形结构
|
||||
const deptTree = ref<DataNode[]>([]);
|
||||
|
|
@ -67,25 +49,56 @@ const selectedDeptIds = ref<checkedKeys>([]);
|
|||
// 部门数据
|
||||
const deptData = ref<SystemDeptApi.Dept[]>([]);
|
||||
|
||||
/** 打开对话框 */
|
||||
const open = async (selectedList?: SystemDeptApi.Dept[]) => {
|
||||
modalApi.open();
|
||||
// // 设置已选择的部门
|
||||
if (selectedList?.length) {
|
||||
const selectedIds = selectedList
|
||||
.map((dept) => dept.id)
|
||||
.filter((id): id is number => id !== undefined);
|
||||
selectedDeptIds.value = props.checkStrictly
|
||||
? {
|
||||
checked: selectedIds,
|
||||
halfChecked: [],
|
||||
}
|
||||
: selectedIds;
|
||||
}
|
||||
};
|
||||
// 对话框配置
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
// 获取选中的部门ID
|
||||
const selectedIds: number[] = Array.isArray(selectedDeptIds.value)
|
||||
? selectedDeptIds.value
|
||||
: selectedDeptIds.value.checked || [];
|
||||
const deptArray = deptData.value.filter((dept) =>
|
||||
selectedIds.includes(dept.id!),
|
||||
);
|
||||
emit('confirm', deptArray);
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
},
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
deptTree.value = [];
|
||||
selectedDeptIds.value = [];
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData();
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
deptData.value = await getSimpleDeptList();
|
||||
deptTree.value = handleTree(deptData.value) as DataNode[];
|
||||
// // 设置已选择的部门
|
||||
if (data.selectedList?.length) {
|
||||
const selectedIds = data.selectedList
|
||||
.map((dept: SystemDeptApi.Dept) => dept.id)
|
||||
.filter((id: number) => id !== undefined);
|
||||
selectedDeptIds.value = props.checkStrictly
|
||||
? {
|
||||
checked: selectedIds,
|
||||
halfChecked: [],
|
||||
}
|
||||
: selectedIds;
|
||||
}
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
/** 处理选中状态变化 */
|
||||
const handleCheck = () => {
|
||||
function handleCheck() {
|
||||
if (!props.multiple) {
|
||||
// 单选模式下,只保留最后选择的节点
|
||||
if (Array.isArray(selectedDeptIds.value)) {
|
||||
|
|
@ -106,37 +119,10 @@ const handleCheck = () => {
|
|||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/** 提交选择 */
|
||||
const handleConfirm = async () => {
|
||||
// 获取选中的部门ID
|
||||
const selectedIds: number[] = Array.isArray(selectedDeptIds.value)
|
||||
? selectedDeptIds.value
|
||||
: selectedDeptIds.value.checked || [];
|
||||
const deptArray = deptData.value.filter((dept) =>
|
||||
selectedIds.includes(dept.id!),
|
||||
);
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('confirm', deptArray);
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
modalApi.close();
|
||||
};
|
||||
|
||||
/** 重置数据 */
|
||||
const resetData = () => {
|
||||
deptTree.value = [];
|
||||
selectedDeptIds.value = [];
|
||||
};
|
||||
|
||||
/** 提供 open 方法,用于打开对话框 */
|
||||
defineExpose({ open });
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<Modal>
|
||||
<Modal :title="title" key="dept-select-modal" class="w-[40%]">
|
||||
<Row class="h-full">
|
||||
<Col :span="24">
|
||||
<Card class="h-full">
|
||||
|
|
@ -153,9 +139,5 @@ defineExpose({ open });
|
|||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
<template #footer>
|
||||
<Button @click="handleCancel">{{ cancelText }}</Button>
|
||||
<Button type="primary" @click="handleConfirm">{{ confirmText }}</Button>
|
||||
</template>
|
||||
</Modal>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script lang="ts" setup>
|
||||
// TODO @芋艿:是否有更好的组织形式?!
|
||||
// TODO @xingyu:你感觉,这个放到每个 system、infra 模块下,然后新建一个 components,表示每个模块,有一些共享的组件?然后,全局只放通用的(无业务含义的),可以哇?
|
||||
import type { Key } from 'ant-design-vue/es/table/interface';
|
||||
|
||||
import type { SystemDeptApi } from '#/api/system/dept';
|
||||
|
|
@ -17,7 +18,6 @@ import {
|
|||
message,
|
||||
Pagination,
|
||||
Row,
|
||||
Spin,
|
||||
Transfer,
|
||||
Tree,
|
||||
} from 'ant-design-vue';
|
||||
|
|
@ -35,7 +35,7 @@ interface DeptTreeNode {
|
|||
|
||||
defineOptions({ name: 'UserSelectModal' });
|
||||
|
||||
const props = withDefaults(
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
cancelText?: string;
|
||||
confirmText?: string;
|
||||
|
|
@ -66,16 +66,66 @@ const expandedKeys = ref<Key[]>([]);
|
|||
const selectedDeptId = ref<number>();
|
||||
const deptSearchKeys = ref('');
|
||||
|
||||
// 加载状态
|
||||
const loading = ref(false);
|
||||
|
||||
// 用户数据管理
|
||||
const userList = ref<SystemUserApi.User[]>([]); // 存储所有已知用户
|
||||
const selectedUserIds = ref<string[]>([]);
|
||||
|
||||
// 弹窗配置
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
onCancel: handleCancel,
|
||||
onClosed: handleClosed,
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
if (!isOpen) {
|
||||
resetData();
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData();
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
modalApi.lock();
|
||||
try {
|
||||
// 加载部门数据
|
||||
const deptData = await getSimpleDeptList();
|
||||
deptList.value = deptData;
|
||||
const treeData = handleTree(deptData);
|
||||
deptTree.value = treeData.map((node) => processDeptNode(node));
|
||||
expandedKeys.value = deptTree.value.map((node) => node.key);
|
||||
|
||||
// 加载初始用户数据
|
||||
await loadUserData(1, leftListState.value.pagination.pageSize);
|
||||
|
||||
// 设置已选用户
|
||||
if (data.userIds?.length) {
|
||||
selectedUserIds.value = data.userIds.map(String);
|
||||
// 加载已选用户的完整信息 TODO 目前接口暂不支持 多个用户ID 查询, 需要后端支持
|
||||
const { list } = await getUserPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100, // 临时使用固定值确保能加载所有已选用户
|
||||
userIds: data.userIds,
|
||||
});
|
||||
// 使用 Map 来去重,以用户 ID 为 key
|
||||
const userMap = new Map(userList.value.map((user) => [user.id, user]));
|
||||
list.forEach((user) => {
|
||||
if (!userMap.has(user.id)) {
|
||||
userMap.set(user.id, user);
|
||||
}
|
||||
});
|
||||
userList.value = [...userMap.values()];
|
||||
updateRightListData();
|
||||
}
|
||||
|
||||
modalApi.open();
|
||||
} finally {
|
||||
modalApi.unlock();
|
||||
}
|
||||
},
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
// 左侧列表状态
|
||||
const leftListState = ref({
|
||||
loading: false,
|
||||
searchValue: '',
|
||||
dataSource: [] as SystemUserApi.User[],
|
||||
pagination: {
|
||||
|
|
@ -145,8 +195,7 @@ const filteredDeptTree = computed(() => {
|
|||
});
|
||||
|
||||
// 加载用户数据
|
||||
const loadUserData = async (pageNo: number, pageSize: number) => {
|
||||
leftListState.value.loading = true;
|
||||
async function loadUserData(pageNo: number, pageSize: number) {
|
||||
try {
|
||||
const { list, total } = await getUserPage({
|
||||
pageNo,
|
||||
|
|
@ -168,12 +217,12 @@ const loadUserData = async (pageNo: number, pageSize: number) => {
|
|||
userList.value.push(...newUsers);
|
||||
}
|
||||
} finally {
|
||||
leftListState.value.loading = false;
|
||||
//
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 更新右侧列表数据
|
||||
const updateRightListData = () => {
|
||||
function updateRightListData() {
|
||||
// 使用 Set 来去重选中的用户ID
|
||||
const uniqueSelectedIds = new Set(selectedUserIds.value);
|
||||
|
||||
|
|
@ -202,22 +251,22 @@ const updateRightListData = () => {
|
|||
const endIndex = startIndex + pageSize;
|
||||
|
||||
rightListState.value.dataSource = filteredUsers.slice(startIndex, endIndex);
|
||||
};
|
||||
}
|
||||
|
||||
// 处理左侧分页变化
|
||||
const handleLeftPaginationChange = async (page: number, pageSize: number) => {
|
||||
async function handleLeftPaginationChange(page: number, pageSize: number) {
|
||||
await loadUserData(page, pageSize);
|
||||
};
|
||||
}
|
||||
|
||||
// 处理右侧分页变化
|
||||
const handleRightPaginationChange = (page: number, pageSize: number) => {
|
||||
function handleRightPaginationChange(page: number, pageSize: number) {
|
||||
rightListState.value.pagination.current = page;
|
||||
rightListState.value.pagination.pageSize = pageSize;
|
||||
updateRightListData();
|
||||
};
|
||||
}
|
||||
|
||||
// 处理用户搜索
|
||||
const handleUserSearch = async (direction: string, value: string) => {
|
||||
async function handleUserSearch(direction: string, value: string) {
|
||||
if (direction === 'left') {
|
||||
leftListState.value.searchValue = value;
|
||||
leftListState.value.pagination.current = 1;
|
||||
|
|
@ -227,18 +276,18 @@ const handleUserSearch = async (direction: string, value: string) => {
|
|||
rightListState.value.pagination.current = 1;
|
||||
updateRightListData();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 处理用户选择变化
|
||||
const handleUserChange = (targetKeys: string[]) => {
|
||||
function handleUserChange(targetKeys: string[]) {
|
||||
// 使用 Set 来去重选中的用户ID
|
||||
selectedUserIds.value = [...new Set(targetKeys)];
|
||||
emit('update:value', selectedUserIds.value.map(Number));
|
||||
updateRightListData();
|
||||
};
|
||||
}
|
||||
|
||||
// 重置数据
|
||||
const resetData = () => {
|
||||
function resetData() {
|
||||
userList.value = [];
|
||||
selectedUserIds.value = [];
|
||||
|
||||
|
|
@ -249,7 +298,6 @@ const resetData = () => {
|
|||
selectedUserIds.value = [];
|
||||
|
||||
leftListState.value = {
|
||||
loading: false,
|
||||
searchValue: '',
|
||||
dataSource: [],
|
||||
pagination: {
|
||||
|
|
@ -268,61 +316,20 @@ const resetData = () => {
|
|||
total: 0,
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
// 打开弹窗
|
||||
const open = async (userIds: string[]) => {
|
||||
resetData();
|
||||
loading.value = true;
|
||||
try {
|
||||
// 加载部门数据
|
||||
const deptData = await getSimpleDeptList();
|
||||
deptList.value = deptData;
|
||||
const treeData = handleTree(deptData);
|
||||
deptTree.value = treeData.map((node) => processDeptNode(node));
|
||||
expandedKeys.value = deptTree.value.map((node) => node.key);
|
||||
|
||||
// 加载初始用户数据
|
||||
await loadUserData(1, leftListState.value.pagination.pageSize);
|
||||
|
||||
// 设置已选用户
|
||||
if (userIds?.length) {
|
||||
selectedUserIds.value = userIds.map(String);
|
||||
// 加载已选用户的完整信息 TODO 目前接口暂不支持 多个用户ID 查询, 需要后端支持
|
||||
const { list } = await getUserPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100, // 临时使用固定值确保能加载所有已选用户
|
||||
userIds,
|
||||
});
|
||||
// 使用 Map 来去重,以用户 ID 为 key
|
||||
const userMap = new Map(userList.value.map((user) => [user.id, user]));
|
||||
list.forEach((user) => {
|
||||
if (!userMap.has(user.id)) {
|
||||
userMap.set(user.id, user);
|
||||
}
|
||||
});
|
||||
userList.value = [...userMap.values()];
|
||||
updateRightListData();
|
||||
}
|
||||
|
||||
modalApi.open();
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// TODO 后端接口目前仅支持 username 检索, 筛选条件需要跟后端请求参数保持一致。
|
||||
const filterOption = (inputValue: string, option: any) => {
|
||||
function filterOption(inputValue: string, option: any) {
|
||||
return option.username.toLowerCase().includes(inputValue.toLowerCase());
|
||||
};
|
||||
}
|
||||
|
||||
// 处理部门树展开/折叠
|
||||
const handleExpand = (keys: Key[]) => {
|
||||
function handleExpand(keys: Key[]) {
|
||||
expandedKeys.value = keys;
|
||||
};
|
||||
}
|
||||
|
||||
// 处理部门搜索
|
||||
const handleDeptSearch = (value: string) => {
|
||||
function handleDeptSearch(value: string) {
|
||||
deptSearchKeys.value = value;
|
||||
|
||||
// 如果有搜索结果,自动展开所有节点
|
||||
|
|
@ -342,10 +349,10 @@ const handleDeptSearch = (value: string) => {
|
|||
// 清空搜索时,只展开第一级节点
|
||||
expandedKeys.value = deptTree.value.map((node) => node.key);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 处理部门选择
|
||||
const handleDeptSelect = async (selectedKeys: Key[], _info: any) => {
|
||||
async function handleDeptSelect(selectedKeys: Key[], _info: any) {
|
||||
// 更新选中的部门ID
|
||||
const newDeptId =
|
||||
selectedKeys.length > 0 ? Number(selectedKeys[0]) : undefined;
|
||||
|
|
@ -356,10 +363,10 @@ const handleDeptSelect = async (selectedKeys: Key[], _info: any) => {
|
|||
const { pageSize } = leftListState.value.pagination;
|
||||
leftListState.value.pagination.current = 1;
|
||||
await loadUserData(1, pageSize);
|
||||
};
|
||||
}
|
||||
|
||||
// 确认选择
|
||||
const handleConfirm = () => {
|
||||
function handleConfirm() {
|
||||
if (selectedUserIds.value.length === 0) {
|
||||
message.warning('请选择用户');
|
||||
return;
|
||||
|
|
@ -371,115 +378,101 @@ const handleConfirm = () => {
|
|||
),
|
||||
);
|
||||
modalApi.close();
|
||||
};
|
||||
}
|
||||
|
||||
// 取消选择
|
||||
const handleCancel = () => {
|
||||
function handleCancel() {
|
||||
emit('cancel');
|
||||
modalApi.close();
|
||||
// 确保在动画结束后再重置数据
|
||||
setTimeout(() => {
|
||||
resetData();
|
||||
}, 300);
|
||||
};
|
||||
}
|
||||
|
||||
// 关闭弹窗
|
||||
const handleClosed = () => {
|
||||
function handleClosed() {
|
||||
emit('closed');
|
||||
resetData();
|
||||
};
|
||||
|
||||
// 弹窗配置
|
||||
const [ModalComponent, modalApi] = useVbenModal({
|
||||
title: props.title,
|
||||
onCancel: handleCancel,
|
||||
onClosed: handleClosed,
|
||||
destroyOnClose: true,
|
||||
});
|
||||
}
|
||||
|
||||
// 递归处理部门树节点
|
||||
const processDeptNode = (node: any): DeptTreeNode => {
|
||||
function processDeptNode(node: any): DeptTreeNode {
|
||||
return {
|
||||
key: String(node.id),
|
||||
title: `${node.name} (${node.id})`,
|
||||
name: node.name,
|
||||
children: node.children?.map((child: any) => processDeptNode(child)),
|
||||
};
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<ModalComponent class="w-[1000px]" key="user-select-modal">
|
||||
<Spin :spinning="loading">
|
||||
<Row :gutter="[16, 16]">
|
||||
<Col :span="6">
|
||||
<div class="h-[500px] overflow-auto rounded border">
|
||||
<div class="border-b p-2">
|
||||
<Input
|
||||
v-model:value="deptSearchKeys"
|
||||
placeholder="搜索部门"
|
||||
allow-clear
|
||||
@input="(e) => handleDeptSearch(e.target?.value ?? '')"
|
||||
/>
|
||||
</div>
|
||||
<Tree
|
||||
:tree-data="filteredDeptTree"
|
||||
:expanded-keys="expandedKeys"
|
||||
:selected-keys="selectedDeptId ? [String(selectedDeptId)] : []"
|
||||
@select="handleDeptSelect"
|
||||
@expand="handleExpand"
|
||||
<Modal class="w-[40%]" key="user-select-modal" :title="title">
|
||||
<Row :gutter="[16, 16]">
|
||||
<Col :span="6">
|
||||
<div class="h-[500px] overflow-auto rounded border">
|
||||
<div class="border-b p-2">
|
||||
<Input
|
||||
v-model:value="deptSearchKeys"
|
||||
placeholder="搜索部门"
|
||||
allow-clear
|
||||
@input="(e) => handleDeptSearch(e.target?.value ?? '')"
|
||||
/>
|
||||
</div>
|
||||
</Col>
|
||||
<Col :span="18">
|
||||
<Transfer
|
||||
:row-key="(record) => String(record.id)"
|
||||
:data-source="transferDataSource"
|
||||
v-model:target-keys="selectedUserIds"
|
||||
:titles="['未选', '已选']"
|
||||
:show-search="true"
|
||||
:show-select-all="true"
|
||||
:filter-option="filterOption"
|
||||
@change="handleUserChange"
|
||||
@search="handleUserSearch"
|
||||
>
|
||||
<template #render="item">
|
||||
<span>{{ item?.nickname }} ({{ item?.username }})</span>
|
||||
</template>
|
||||
<Tree
|
||||
:tree-data="filteredDeptTree"
|
||||
:expanded-keys="expandedKeys"
|
||||
:selected-keys="selectedDeptId ? [String(selectedDeptId)] : []"
|
||||
@select="handleDeptSelect"
|
||||
@expand="handleExpand"
|
||||
/>
|
||||
</div>
|
||||
</Col>
|
||||
<Col :span="18">
|
||||
<Transfer
|
||||
:row-key="(record) => String(record.id)"
|
||||
:data-source="transferDataSource"
|
||||
v-model:target-keys="selectedUserIds"
|
||||
:titles="['未选', '已选']"
|
||||
:show-search="true"
|
||||
:show-select-all="true"
|
||||
:filter-option="filterOption"
|
||||
@change="handleUserChange"
|
||||
@search="handleUserSearch"
|
||||
>
|
||||
<template #render="item">
|
||||
<span>{{ item?.nickname }} ({{ item?.username }})</span>
|
||||
</template>
|
||||
|
||||
<template #footer="{ direction }">
|
||||
<div v-if="direction === 'left'">
|
||||
<Pagination
|
||||
v-model:current="leftListState.pagination.current"
|
||||
v-model:page-size="leftListState.pagination.pageSize"
|
||||
:total="leftListState.pagination.total"
|
||||
:show-size-changer="true"
|
||||
:show-total="(total) => `共 ${total} 条`"
|
||||
size="small"
|
||||
@change="handleLeftPaginationChange"
|
||||
/>
|
||||
</div>
|
||||
<template #footer="{ direction }">
|
||||
<div v-if="direction === 'left'">
|
||||
<Pagination
|
||||
v-model:current="leftListState.pagination.current"
|
||||
v-model:page-size="leftListState.pagination.pageSize"
|
||||
:total="leftListState.pagination.total"
|
||||
:show-size-changer="true"
|
||||
:show-total="(total) => `共 ${total} 条`"
|
||||
size="small"
|
||||
@change="handleLeftPaginationChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="direction === 'right'">
|
||||
<Pagination
|
||||
v-model:current="rightListState.pagination.current"
|
||||
v-model:page-size="rightListState.pagination.pageSize"
|
||||
:total="rightListState.pagination.total"
|
||||
:show-size-changer="true"
|
||||
:show-total="(total) => `共 ${total} 条`"
|
||||
size="small"
|
||||
@change="handleRightPaginationChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</Transfer>
|
||||
</Col>
|
||||
</Row>
|
||||
</Spin>
|
||||
<div v-if="direction === 'right'">
|
||||
<Pagination
|
||||
v-model:current="rightListState.pagination.current"
|
||||
v-model:page-size="rightListState.pagination.pageSize"
|
||||
:total="rightListState.pagination.total"
|
||||
:show-size-changer="true"
|
||||
:show-total="(total) => `共 ${total} 条`"
|
||||
size="small"
|
||||
@change="handleRightPaginationChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</Transfer>
|
||||
</Col>
|
||||
</Row>
|
||||
<template #footer>
|
||||
<Button
|
||||
type="primary"
|
||||
|
|
@ -490,7 +483,7 @@ defineExpose({
|
|||
</Button>
|
||||
<Button @click="handleCancel">{{ cancelText }}</Button>
|
||||
</template>
|
||||
</ModalComponent>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import type { SimpleFlowNode } from '../../consts';
|
||||
|
||||
import { ref, watch } from 'vue';
|
||||
import { nextTick, ref, watch } from 'vue';
|
||||
|
||||
import { useVbenDrawer } from '@vben/common-ui';
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
|
|
@ -53,8 +53,6 @@ const condition = ref<any>({
|
|||
},
|
||||
});
|
||||
|
||||
// 显示名称输入框
|
||||
const showInput = ref(false);
|
||||
const conditionRef = ref();
|
||||
const fieldOptions = useFormFieldsAndStartUser(); // 流程表单字段和发起人字段
|
||||
|
||||
|
|
@ -130,13 +128,24 @@ watch(
|
|||
currentNode.value = newValue;
|
||||
},
|
||||
);
|
||||
|
||||
// 显示名称输入框
|
||||
const showInput = ref(false);
|
||||
// 输入框的引用
|
||||
const inputRef = ref<HTMLInputElement | null>(null);
|
||||
// 监听 showInput 的变化,当变为 true 时自动聚焦
|
||||
watch(showInput, (value) => {
|
||||
if (value) {
|
||||
nextTick(() => {
|
||||
inputRef.value?.focus();
|
||||
});
|
||||
}
|
||||
});
|
||||
function clickIcon() {
|
||||
showInput.value = true;
|
||||
}
|
||||
|
||||
// 输入框失去焦点
|
||||
function blurEvent() {
|
||||
// 修改节点名称
|
||||
function changeNodeName() {
|
||||
showInput.value = false;
|
||||
currentNode.value.name =
|
||||
currentNode.value.name ||
|
||||
|
|
@ -153,10 +162,12 @@ defineExpose({ open }); // 提供 open 方法,用于打开弹窗
|
|||
<template #title>
|
||||
<div class="flex items-center">
|
||||
<Input
|
||||
ref="inputRef"
|
||||
v-if="showInput"
|
||||
type="text"
|
||||
class="mr-2 w-48"
|
||||
@blur="blurEvent()"
|
||||
@blur="changeNodeName()"
|
||||
@press-enter="changeNodeName()"
|
||||
v-model:value="currentNode.name"
|
||||
:placeholder="currentNode.name"
|
||||
/>
|
||||
|
|
@ -166,7 +177,7 @@ defineExpose({ open }); // 提供 open 方法,用于打开弹窗
|
|||
@click="clickIcon()"
|
||||
>
|
||||
{{ currentNode.name }}
|
||||
<IconifyIcon class="ml-1" icon="ep:edit-pen" />
|
||||
<IconifyIcon class="ml-1" icon="lucide:edit-3" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -27,14 +27,13 @@ import {
|
|||
TreeSelect,
|
||||
} from 'ant-design-vue';
|
||||
|
||||
import { BpmModelFormType } from '#/utils';
|
||||
import { BpmModelFormType, BpmNodeTypeEnum } from '#/utils';
|
||||
|
||||
import {
|
||||
CANDIDATE_STRATEGY,
|
||||
CandidateStrategy,
|
||||
FieldPermissionType,
|
||||
MULTI_LEVEL_DEPT,
|
||||
NodeType,
|
||||
} from '../../consts';
|
||||
import {
|
||||
useFormFieldsPermission,
|
||||
|
|
@ -76,9 +75,8 @@ const [Drawer, drawerApi] = useVbenDrawer({
|
|||
const currentNode = useWatchNode(props);
|
||||
|
||||
// 节点名称
|
||||
const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(
|
||||
NodeType.COPY_TASK_NODE,
|
||||
);
|
||||
const { nodeName, showInput, clickIcon, changeNodeName, inputRef } =
|
||||
useNodeName(BpmNodeTypeEnum.COPY_TASK_NODE);
|
||||
|
||||
// 激活的 Tab 标签页
|
||||
const activeTabName = ref('user');
|
||||
|
|
@ -137,7 +135,7 @@ const {
|
|||
getShowText,
|
||||
handleCandidateParam,
|
||||
parseCandidateParam,
|
||||
} = useNodeForm(NodeType.COPY_TASK_NODE);
|
||||
} = useNodeForm(BpmNodeTypeEnum.COPY_TASK_NODE);
|
||||
|
||||
const configForm = tempConfigForm as Ref<CopyTaskFormType>;
|
||||
// 抄送人策略, 去掉发起人自选 和 发起人自己
|
||||
|
|
@ -214,15 +212,17 @@ defineExpose({ showCopyTaskNodeConfig }); // 暴露方法给父组件
|
|||
<div class="config-header">
|
||||
<Input
|
||||
v-if="showInput"
|
||||
ref="inputRef"
|
||||
type="text"
|
||||
class="config-editable-input"
|
||||
@blur="blurEvent()"
|
||||
@blur="changeNodeName()"
|
||||
@press-enter="changeNodeName()"
|
||||
v-model:value="nodeName"
|
||||
:placeholder="nodeName"
|
||||
/>
|
||||
<div v-else class="node-name">
|
||||
{{ nodeName }}
|
||||
<IconifyIcon class="ml-1" icon="ep:edit-pen" @click="clickIcon()" />
|
||||
<IconifyIcon class="ml-1" icon="lucide:edit-3" @click="clickIcon()" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -22,10 +22,11 @@ import {
|
|||
SelectOption,
|
||||
} from 'ant-design-vue';
|
||||
|
||||
import { BpmNodeTypeEnum } from '#/utils';
|
||||
|
||||
import {
|
||||
DELAY_TYPE,
|
||||
DelayTypeEnum,
|
||||
NodeType,
|
||||
TIME_UNIT_TYPES,
|
||||
TimeUnitType,
|
||||
} from '../../consts';
|
||||
|
|
@ -44,9 +45,8 @@ const props = defineProps({
|
|||
// 当前节点
|
||||
const currentNode = useWatchNode(props);
|
||||
// 节点名称
|
||||
const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(
|
||||
NodeType.DELAY_TIMER_NODE,
|
||||
);
|
||||
const { nodeName, showInput, clickIcon, changeNodeName, inputRef } =
|
||||
useNodeName(BpmNodeTypeEnum.DELAY_TIMER_NODE);
|
||||
// 抄送人表单配置
|
||||
const formRef = ref(); // 表单 Ref
|
||||
|
||||
|
|
@ -157,9 +157,11 @@ defineExpose({ openDrawer }); // 暴露方法给父组件
|
|||
<div class="flex items-center">
|
||||
<Input
|
||||
v-if="showInput"
|
||||
ref="inputRef"
|
||||
type="text"
|
||||
class="mr-2 w-48"
|
||||
@blur="blurEvent()"
|
||||
@blur="changeNodeName()"
|
||||
@press-enter="changeNodeName()"
|
||||
v-model:value="nodeName"
|
||||
:placeholder="nodeName"
|
||||
/>
|
||||
|
|
@ -169,7 +171,7 @@ defineExpose({ openDrawer }); // 暴露方法给父组件
|
|||
@click="clickIcon()"
|
||||
>
|
||||
{{ nodeName }}
|
||||
<IconifyIcon class="ml-1" icon="ep:edit-pen" :size="16" />
|
||||
<IconifyIcon class="ml-1" icon="lucide:edit-3" :size="16" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -33,6 +33,18 @@ const [Modal, modalApi] = useVbenModal({
|
|||
title: '条件配置',
|
||||
destroyOnClose: true,
|
||||
draggable: true,
|
||||
onOpenChange(isOpen) {
|
||||
if (isOpen) {
|
||||
// 获取传递的数据
|
||||
const conditionObj = modalApi.getData();
|
||||
if (conditionObj) {
|
||||
conditionData.value.conditionType = conditionObj.conditionType;
|
||||
conditionData.value.conditionExpression =
|
||||
conditionObj.conditionExpression;
|
||||
conditionData.value.conditionGroups = conditionObj.conditionGroups;
|
||||
}
|
||||
}
|
||||
},
|
||||
async onConfirm() {
|
||||
// 校验表单
|
||||
if (!conditionRef.value) return;
|
||||
|
|
@ -50,17 +62,8 @@ const [Modal, modalApi] = useVbenModal({
|
|||
},
|
||||
});
|
||||
|
||||
// TODO: jason open 在 useVbenModal 中 onOpenChange 方法
|
||||
function open(conditionObj: any | undefined) {
|
||||
if (conditionObj) {
|
||||
conditionData.value.conditionType = conditionObj.conditionType;
|
||||
conditionData.value.conditionExpression = conditionObj.conditionExpression;
|
||||
conditionData.value.conditionGroups = conditionObj.conditionGroups;
|
||||
}
|
||||
modalApi.open();
|
||||
}
|
||||
// TODO: jason 不需要暴露expose,直接使用modalApi.setData(formSetting).open()
|
||||
defineExpose({ open });
|
||||
// TODO xingyu 暴露 modalApi 给父组件是否合适? trigger-node-config.vue 会有多个 conditionDialog 实例
|
||||
defineExpose({ modalApi });
|
||||
</script>
|
||||
<template>
|
||||
<Modal class="w-1/2">
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue