diff --git a/src/modules/generic/MockTableView.vue b/src/modules/generic/MockTableView.vue new file mode 100644 index 0000000..e519ebd --- /dev/null +++ b/src/modules/generic/MockTableView.vue @@ -0,0 +1,156 @@ + + + + + + + {{ title }} + 共 {{ total }} 条 + + 共 {{ mockData.length }} 条 (前端示例数据, 后端 API 暂未实装) + + + + + + + 查询 + 重置 + + + + + + + + + {{ config.description }} + + + + + diff --git a/src/modules/generic/mockTableConfigs.ts b/src/modules/generic/mockTableConfigs.ts new file mode 100644 index 0000000..fba59d9 --- /dev/null +++ b/src/modules/generic/mockTableConfigs.ts @@ -0,0 +1,928 @@ +/** + * F006 W5.x.x+3.x 通用 Mock 表格配置 + * + * 字段定义来源: 老 vue 页面 el-table-column + * Mock 数据: 基于字段类型生成 8-12 条合理示例 + */ +export interface MockColumn { + prop: string + label: string + width?: number | string + minWidth?: number | string + type?: 'status' | 'text' + align?: 'left' | 'center' | 'right' + format?: (row: any) => string +} + +export interface MockConfig { + endpoint?: string + title?: string + columns: MockColumn[] + mockData: any[] + queryKey?: string + queryLabel?: string + pageSize?: number + queryParams?: Record + description?: string +} + +// 共享: 状态映射 +const STATUS_ENABLED = { '0': { label: '禁用', type: 'info' as const }, '1': { label: '启用', type: 'success' as const } } +const STATUS_LOCK = { '0': { label: '正常', type: 'success' as const }, '1': { label: '锁定', type: 'danger' as const } } + +const now = (offset: number = 0) => { + const d = new Date(Date.now() - offset * 86400000) + const p = (n: number) => String(n).padStart(2, '0') + return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}` +} + +// ========== devtools ========== +const baseclassCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'code', label: '基类编码', minWidth: 160 }, + { prop: 'packageName', label: '基类包名', minWidth: 200 }, + { prop: 'fields', label: '基类字段', minWidth: 200 }, + { prop: 'remark', label: '备注', minWidth: 160 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const baseclassMock = [ + { id: '1', code: 'BaseEntity', packageName: 'io.renren.common.base', fields: 'id,creator,createDate,updater,updateDate', remark: '所有实体基类', createDate: now(120) }, + { id: '2', code: 'TreeEntity', packageName: 'io.renren.common.base', fields: 'id,parentId,name,sort,children', remark: '树形结构基类', createDate: now(90) }, + { id: '3', code: 'PageReq', packageName: 'io.renren.common.utils', fields: 'page,limit,order,orderBy', remark: '分页请求基类', createDate: now(80) }, + { id: '4', code: 'PageRes', packageName: 'io.renren.common.utils', fields: 'total,list,page,limit', remark: '分页响应基类', createDate: now(80) }, + { id: '5', code: 'BaseService', packageName: 'io.renren.common.service', fields: 'getById,list,save,update,delete', remark: 'Service 层基类', createDate: now(60) }, + { id: '6', code: 'BaseController', packageName: 'io.renren.common.controller', fields: 'page,info,save,update,delete', remark: 'Controller 层基类', createDate: now(50) }, + { id: '7', code: 'BaseDao', packageName: 'io.renren.common.dao', fields: 'selectById,selectList,insert,update,delete', remark: 'DAO 层基类', createDate: now(45) }, + { id: '8', code: 'BaseDTO', packageName: 'io.renren.common.dto', fields: 'id,createDate', remark: '数据传输基类', createDate: now(30) }, + { id: '9', code: 'BaseVO', packageName: 'io.renren.common.vo', fields: 'id,createDate', remark: '视图层基类', createDate: now(20) } +] + +const paramCols: MockColumn[] = [ + { prop: 'packageName', label: '默认包名', minWidth: 200 }, + { prop: 'version', label: '默认版本号', width: 140 }, + { prop: 'author', label: '默认作者', width: 120 }, + { prop: 'email', label: '作者邮箱', minWidth: 200 }, + { prop: 'backendPath', label: '后端生成路径', minWidth: 200 }, + { prop: 'frontendPath', label: '前端生成路径', minWidth: 200 } +] +const paramMock = [{ + packageName: 'io.renren', + version: '1.0.0', + author: 'zou', + email: 'zou@direv.com', + backendPath: '/data/平台开发/04-源码/product_network_java/renren-module', + frontendPath: '/data/平台开发/04-源码/admin_new/src' +}] + +const fieldtypeCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'columnType', label: '字段类型', width: 160 }, + { prop: 'attrType', label: '属性类型', width: 160 }, + { prop: 'packageName', label: '属性包名', minWidth: 200 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const fieldtypeMock = [ + { id: '1', columnType: 'bigint', attrType: 'Long', packageName: 'java.lang.Long', createDate: now(100) }, + { id: '2', columnType: 'varchar', attrType: 'String', packageName: 'java.lang.String', createDate: now(100) }, + { id: '3', columnType: 'int', attrType: 'Integer', packageName: 'java.lang.Integer', createDate: now(90) }, + { id: '4', columnType: 'tinyint', attrType: 'Integer', packageName: 'java.lang.Integer', createDate: now(90) }, + { id: '5', columnType: 'double', attrType: 'Double', packageName: 'java.lang.Double', createDate: now(80) }, + { id: '6', columnType: 'decimal', attrType: 'BigDecimal', packageName: 'java.math.BigDecimal', createDate: now(80) }, + { id: '7', columnType: 'datetime', attrType: 'Date', packageName: 'java.util.Date', createDate: now(70) }, + { id: '8', columnType: 'text', attrType: 'String', packageName: 'java.lang.String', createDate: now(60) }, + { id: '9', columnType: 'boolean', attrType: 'Boolean', packageName: 'java.lang.Boolean', createDate: now(50) } +] + +const templateCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '模板名称', minWidth: 200 }, + { prop: 'fileName', label: '文件名', minWidth: 200 }, + { prop: 'content', label: '内容', minWidth: 280 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const templateMock = [ + { id: '1', name: 'Controller 模板', fileName: 'Controller.java.vm', content: 'package ${package}.controller;', createDate: now(100) }, + { id: '2', name: 'Service 模板', fileName: 'Service.java.vm', content: 'package ${package}.service.impl;', createDate: now(100) }, + { id: '3', name: 'Dao 模板', fileName: 'Dao.java.vm', content: 'package ${package}.dao;', createDate: now(90) }, + { id: '4', name: 'Entity 模板', fileName: 'Entity.java.vm', content: 'package ${package}.entity;', createDate: now(90) }, + { id: '5', name: 'Vue 列表页', fileName: 'list.vue.vm', content: '', createDate: now(80) }, + { id: '6', name: 'Vue 表单页', fileName: 'add-or-update.vue.vm', content: '', createDate: now(80) }, + { id: '7', name: 'SQL 模板', fileName: 'menu.sql.vm', content: 'INSERT INTO sys_menu', createDate: now(60) } +] + +const datasourceCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '数据源名称', minWidth: 160 }, + { prop: 'dbType', label: '数据库类型', width: 120 }, + { prop: 'host', label: '主机', minWidth: 160 }, + { prop: 'port', label: '端口', width: 80 }, + { prop: 'databaseName', label: '数据库名', minWidth: 160 }, + { prop: 'username', label: '账号', minWidth: 120 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const datasourceMock = [ + { id: '1', name: '主库', dbType: 'mysql', host: 'mysql', port: 3306, databaseName: 'product_network', username: 'root', createDate: now(200) }, + { id: '2', name: '从库', dbType: 'mysql', host: '192.168.1.221', port: 3306, databaseName: 'product_network', username: 'readonly', createDate: now(180) }, + { id: '3', name: '日志库', dbType: 'mysql', host: '192.168.1.222', port: 3306, databaseName: 'log_db', username: 'log_user', createDate: now(120) } +] + +// ========== job ========== +const scheduleCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'beanName', label: 'Bean 名称', minWidth: 180 }, + { prop: 'methodName', label: '方法名', minWidth: 160 }, + { prop: 'params', label: '参数', minWidth: 140 }, + { prop: 'cronExpression', label: 'Cron 表达式', minWidth: 160 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'remark', label: '备注', minWidth: 180 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const scheduleMock = [ + { id: '1', beanName: 'orderTask', methodName: 'checkOrderStatus', params: '', cronExpression: '0 0/5 * * * ?', status: 1, remark: '每 5 分钟检查订单状态', createDate: now(120) }, + { id: '2', beanName: 'orderTask', methodName: 'autoConfirmReceipt', params: '', cronExpression: '0 0 3 * * ?', status: 1, remark: '每天 3 点自动确认收货', createDate: now(120) }, + { id: '3', beanName: 'inquiryTask', methodName: 'expireInquiry', params: '', cronExpression: '0 30 0 * * ?', status: 1, remark: '询价过期处理', createDate: now(90) }, + { id: '4', beanName: 'financeTask', methodName: 'dailySettlement', params: '', cronExpression: '0 0 2 * * ?', status: 1, remark: '每日 2 点对账', createDate: now(80) }, + { id: '5', beanName: 'messageTask', methodName: 'sendPending', params: '', cronExpression: '0 0/10 * * * ?', status: 0, remark: '待发送消息推送(已暂停)', createDate: now(60) }, + { id: '6', beanName: 'logTask', methodName: 'cleanLog', params: '90', cronExpression: '0 0 4 * * ?', status: 1, remark: '清理 90 天前日志', createDate: now(45) } +] + +// ========== message ========== +const smsCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'platform', label: '短信平台', minWidth: 120 }, + { prop: 'accessKey', label: 'AccessKey', minWidth: 200 }, + { prop: 'signName', label: '短信签名', minWidth: 140 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'remark', label: '备注', minWidth: 180 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const smsMock = [ + { id: '1', platform: '阿里云', accessKey: 'LTAI5t****', signName: '产品网络', status: 1, remark: '主短信通道', createDate: now(180) }, + { id: '2', platform: '腾讯云', accessKey: 'AKID****', signName: '产品网络', status: 0, remark: '备用通道(未启用)', createDate: now(150) }, + { id: '3', platform: '华为云', accessKey: 'HCY****', signName: '产品网络', status: 0, remark: '备用通道(未启用)', createDate: now(120) } +] + +const smsLogCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'mobile', label: '手机号', width: 140 }, + { prop: 'content', label: '短信内容', minWidth: 240 }, + { prop: 'platform', label: '平台', width: 120 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'errorMsg', label: '错误信息', minWidth: 180 }, + { prop: 'createDate', label: '发送时间', width: 180, type: 'text' } +] +const smsLogMock = [ + { id: '1', mobile: '138****0001', content: '【产品网络】您的验证码为 123456, 5 分钟内有效', platform: '阿里云', status: 1, errorMsg: '', createDate: now(0) }, + { id: '2', mobile: '138****0002', content: '【产品网络】您有一笔新订单待处理', platform: '阿里云', status: 1, errorMsg: '', createDate: now(0) }, + { id: '3', mobile: '138****0003', content: '【产品网络】您的询价已被报价', platform: '阿里云', status: 0, errorMsg: '余额不足', createDate: now(1) }, + { id: '4', mobile: '138****0004', content: '【产品网络】您的询价已被报价', platform: '阿里云', status: 1, errorMsg: '', createDate: now(1) }, + { id: '5', mobile: '138****0005', content: '【产品网络】您的订单已发货', platform: '阿里云', status: 1, errorMsg: '', createDate: now(2) }, + { id: '6', mobile: '138****0006', content: '【产品网络】您的询价已过期', platform: '阿里云', status: 1, errorMsg: '', createDate: now(2) } +] + +const mailTemplateCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '模板名称', minWidth: 180 }, + { prop: 'subject', label: '邮件主题', minWidth: 220 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'remark', label: '备注', minWidth: 180 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const mailTemplateMock = [ + { id: '1', name: '注册成功', subject: '欢迎注册产品网络', status: 1, remark: '用户注册成功时发送', createDate: now(200) }, + { id: '2', name: '订单创建', subject: '订单创建通知', status: 1, remark: '下单成功后发送', createDate: now(180) }, + { id: '3', name: '订单支付', subject: '支付成功通知', status: 1, remark: '支付成功后发送', createDate: now(180) }, + { id: '4', name: '订单发货', subject: '订单发货通知', status: 1, remark: '发货后发送', createDate: now(150) }, + { id: '5', name: '询价报价', subject: '您有新的报价', status: 1, remark: '供应商报价后发送', createDate: now(120) }, + { id: '6', name: '密码重置', subject: '密码重置链接', status: 1, remark: '密码重置时发送', createDate: now(90) }, + { id: '7', name: '账户锁定', subject: '账户安全提醒', status: 1, remark: '账户被锁定时发送', createDate: now(60) }, + { id: '8', name: '资质过期', subject: '资质即将过期', status: 1, remark: '资质过期前 30 天提醒', createDate: now(30) } +] + +const mailLogCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'toEmail', label: '收件人', minWidth: 200 }, + { prop: 'subject', label: '邮件主题', minWidth: 220 }, + { prop: 'templateName', label: '使用模板', minWidth: 140 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'errorMsg', label: '错误信息', minWidth: 180 }, + { prop: 'createDate', label: '发送时间', width: 180, type: 'text' } +] +const mailLogMock = [ + { id: '1', toEmail: 'zhangsan@example.com', subject: '欢迎注册产品网络', templateName: '注册成功', status: 1, errorMsg: '', createDate: now(0) }, + { id: '2', toEmail: 'lisi@example.com', subject: '订单创建通知', templateName: '订单创建', status: 1, errorMsg: '', createDate: now(0) }, + { id: '3', toEmail: 'wangwu@example.com', subject: '支付成功通知', templateName: '订单支付', status: 1, errorMsg: '', createDate: now(1) }, + { id: '4', toEmail: 'zhaoliu@example.com', subject: '订单发货通知', templateName: '订单发货', status: 0, errorMsg: 'SMTP 连接超时', createDate: now(1) }, + { id: '5', toEmail: 'qianqi@example.com', subject: '您有新的报价', templateName: '询价报价', status: 1, errorMsg: '', createDate: now(2) } +] + +// ========== order ========== +const orderStatusMap = { '0': { label: '待付款', type: 'warning' as const }, '1': { label: '已付款', type: 'primary' as const }, '2': { label: '已发货', type: 'success' as const }, '3': { label: '已收货', type: 'success' as const }, '4': { label: '已取消', type: 'info' as const }, '5': { label: '退款中', type: 'danger' as const } } +const afterSaleStatusMap = { '0': { label: '待审核', type: 'warning' as const }, '1': { label: '已通过', type: 'success' as const }, '2': { label: '已拒绝', type: 'danger' as const }, '3': { label: '已退款', type: 'info' as const } } + +const orderCommonCols: MockColumn[] = [ + { prop: 'id', label: '订单号', minWidth: 180 }, + { prop: 'userName', label: '用户', width: 120 }, + { prop: 'goodsName', label: '商品', minWidth: 180 }, + { prop: 'quantity', label: '数量', width: 80, align: 'right' }, + { prop: 'amount', label: '金额', width: 120, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '下单时间', width: 180, type: 'text' } +] +const orderGoodMock = [ + { id: 'O20260705001', userName: '张三', goodsName: '工业传感器 X100', quantity: 5, amount: 12500.00, status: 2, createDate: now(0) }, + { id: 'O20260705002', userName: '李四', goodsName: '智能控制器 Y200', quantity: 2, amount: 8000.00, status: 1, createDate: now(0) }, + { id: 'O20260705003', userName: '王五', goodsName: '高精度测量仪', quantity: 1, amount: 15800.00, status: 3, createDate: now(1) }, + { id: 'O20260705004', userName: '赵六', goodsName: '工业机器人臂', quantity: 1, amount: 89000.00, status: 0, createDate: now(1) }, + { id: 'O20260705005', userName: '钱七', goodsName: '自动化装配线', quantity: 1, amount: 250000.00, status: 1, createDate: now(2) }, + { id: 'O20260705006', userName: '孙八', goodsName: '工业相机', quantity: 10, amount: 45000.00, status: 2, createDate: now(2) }, + { id: 'O20260705007', userName: '周九', goodsName: 'PLC 控制系统', quantity: 3, amount: 56000.00, status: 3, createDate: now(3) }, + { id: 'O20260705008', userName: '吴十', goodsName: '机器视觉系统', quantity: 1, amount: 120000.00, status: 4, createDate: now(3) } +] +const serviceOrderMock = [ + { id: 'S20260705001', userName: '深圳科技公司', goodsName: '设备维护服务', quantity: 1, amount: 5800.00, status: 1, createDate: now(0) }, + { id: 'S20260705002', userName: '上海制造企业', goodsName: '技术咨询服务', quantity: 3, amount: 12000.00, status: 2, createDate: now(0) }, + { id: 'S20260705003', userName: '北京集团', goodsName: '设备租赁服务', quantity: 5, amount: 35000.00, status: 3, createDate: now(1) }, + { id: 'S20260705004', userName: '广州工厂', goodsName: '系统集成服务', quantity: 1, amount: 80000.00, status: 1, createDate: now(2) }, + { id: 'S20260705005', userName: '杭州电子', goodsName: '培训服务', quantity: 1, amount: 15000.00, status: 0, createDate: now(3) } +] +const groupSupplierMock = [ + { id: 'G20260705001', userName: '拼团订单A', goodsName: '工业传感器 X100', quantity: 20, amount: 48000.00, status: 1, createDate: now(0) }, + { id: 'G20260705002', userName: '拼团订单B', goodsName: '智能控制器 Y200', quantity: 15, amount: 54000.00, status: 2, createDate: now(1) }, + { id: 'G20260705003', userName: '拼团订单C', goodsName: '高精度测量仪', quantity: 8, amount: 120000.00, status: 0, createDate: now(2) } +] +const groupServiceMock = [ + { id: 'GS20260705001', userName: '服务拼团A', goodsName: '年度维护套餐', quantity: 50, amount: 98000.00, status: 1, createDate: now(0) }, + { id: 'GS20260705002', userName: '服务拼团B', goodsName: '技术培训套餐', quantity: 30, amount: 45000.00, status: 2, createDate: now(1) } +] +const orderAfterMock = [ + { id: 'A20260705001', userName: '张三', goodsName: '工业传感器 X100', quantity: 1, amount: 2500.00, status: 0, createDate: now(0) }, + { id: 'A20260705002', userName: '李四', goodsName: '智能控制器 Y200', quantity: 1, amount: 4000.00, status: 1, createDate: now(1) }, + { id: 'A20260705003', userName: '王五', goodsName: '高精度测量仪', quantity: 1, amount: 15800.00, status: 2, createDate: now(2) }, + { id: 'A20260705004', userName: '赵六', goodsName: '工业相机', quantity: 2, amount: 9000.00, status: 3, createDate: now(3) } +] +const orderServiceAfterMock = [ + { id: 'SA20260705001', userName: '深圳科技公司', goodsName: '设备维护服务', quantity: 1, amount: 5800.00, status: 0, createDate: now(0) }, + { id: 'SA20260705002', userName: '上海制造企业', goodsName: '技术咨询服务', quantity: 1, amount: 4000.00, status: 1, createDate: now(2) } +] +const orderCommissionCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'orderId', label: '订单号', minWidth: 180 }, + { prop: 'userName', label: '用户', width: 120 }, + { prop: 'amount', label: '订单金额', width: 140, align: 'right' }, + { prop: 'commission', label: '分佣金额', width: 140, align: 'right' }, + { prop: 'rate', label: '分佣比例', width: 100, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '分佣时间', width: 180, type: 'text' } +] +const orderGoodCommissionMock = [ + { id: '1', orderId: 'O20260705001', userName: '张三', amount: 12500, commission: 1250, rate: '10%', status: 1, createDate: now(0) }, + { id: '2', orderId: 'O20260705003', userName: '王五', amount: 15800, commission: 1580, rate: '10%', status: 1, createDate: now(1) }, + { id: '3', orderId: 'O20260705006', userName: '孙八', amount: 45000, commission: 4500, rate: '10%', status: 1, createDate: now(2) } +] +const serviceOrderCommissionMock = [ + { id: '1', orderId: 'S20260705001', userName: '深圳科技公司', amount: 5800, commission: 580, rate: '10%', status: 1, createDate: now(0) }, + { id: '2', orderId: 'S20260705003', userName: '北京集团', amount: 35000, commission: 3500, rate: '10%', status: 1, createDate: now(1) } +] +const priceAnalysisCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'categoryName', label: '品类', minWidth: 160 }, + { prop: 'minPrice', label: '最低价', width: 120, align: 'right' }, + { prop: 'maxPrice', label: '最高价', width: 120, align: 'right' }, + { prop: 'avgPrice', label: '平均价', width: 120, align: 'right' }, + { prop: 'orderCount', label: '订单数', width: 100, align: 'right' }, + { prop: 'createDate', label: '统计日期', width: 180, type: 'text' } +] +const priceAnalysisMock = [ + { id: '1', categoryName: '工业传感器', minPrice: 800, maxPrice: 5500, avgPrice: 2500, orderCount: 158, createDate: now(0) }, + { id: '2', categoryName: '智能控制器', minPrice: 2000, maxPrice: 12000, avgPrice: 4000, orderCount: 89, createDate: now(0) }, + { id: '3', categoryName: '测量仪器', minPrice: 5000, maxPrice: 80000, avgPrice: 15800, orderCount: 42, createDate: now(1) }, + { id: '4', categoryName: '工业相机', minPrice: 1500, maxPrice: 25000, avgPrice: 4500, orderCount: 67, createDate: now(1) }, + { id: '5', categoryName: 'PLC 系统', minPrice: 8000, maxPrice: 80000, avgPrice: 18666, orderCount: 33, createDate: now(2) } +] + +// ========== other ========== +const textconfigCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'key', label: '配置键', minWidth: 200 }, + { prop: 'value', label: '配置值', minWidth: 280 }, + { prop: 'remark', label: '备注', minWidth: 200 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const textconfigMock = [ + { id: '1', key: 'system.title', value: '产品网络管理系统', remark: '系统标题', createDate: now(180) }, + { id: '2', key: 'system.copyright', value: '© 2026 产品网络 版权所有', remark: '页脚版权', createDate: now(180) }, + { id: '3', key: 'inquiry.expireHours', value: '72', remark: '询价默认过期时间(小时)', createDate: now(120) }, + { id: '4', key: 'order.autoConfirmDays', value: '15', remark: '订单自动确认收货天数', createDate: now(120) }, + { id: '5', key: 'commission.defaultRate', value: '0.1', remark: '默认分佣比例', createDate: now(90) }, + { id: '6', key: 'sms.signName', value: '产品网络', remark: '短信签名', createDate: now(60) }, + { id: '7', key: 'upload.maxSize', value: '10485760', remark: '上传文件最大 10MB', createDate: now(60) } +] + +const helpCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'title', label: '标题', minWidth: 200 }, + { prop: 'categoryName', label: '分类', width: 140 }, + { prop: 'sort', label: '排序', width: 80, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const helpMock = [ + { id: '1', title: '如何注册成为采购商', categoryName: '新手入门', sort: 1, status: 1, createDate: now(120) }, + { id: '2', title: '如何发布询价单', categoryName: '询价指南', sort: 2, status: 1, createDate: now(100) }, + { id: '3', title: '支付方式说明', categoryName: '支付相关', sort: 3, status: 1, createDate: now(90) }, + { id: '4', title: '退款流程说明', categoryName: '支付相关', sort: 4, status: 1, createDate: now(80) }, + { id: '5', title: '供应商入驻流程', categoryName: '供应商指南', sort: 5, status: 1, createDate: now(70) }, + { id: '6', title: '发票申请说明', categoryName: '财务相关', sort: 6, status: 1, createDate: now(60) }, + { id: '7', title: '常见问题汇总', categoryName: '新手入门', sort: 7, status: 1, createDate: now(45) } +] + +const guideCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'title', label: '标题', minWidth: 200 }, + { prop: 'categoryName', label: '分类', width: 140 }, + { prop: 'viewCount', label: '阅读数', width: 100, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const guideMock = [ + { id: '1', title: '产品网络操作指南 V2.0', categoryName: '使用指南', viewCount: 1580, status: 1, createDate: now(180) }, + { id: '2', title: '采购商用户手册', categoryName: '使用指南', viewCount: 980, status: 1, createDate: now(150) }, + { id: '3', title: '供应商用户手册', categoryName: '使用指南', viewCount: 720, status: 1, createDate: now(120) }, + { id: '4', title: '常见问题解答', categoryName: '常见问题', viewCount: 2100, status: 1, createDate: now(90) }, + { id: '5', title: '意见反馈说明', categoryName: '服务说明', viewCount: 320, status: 1, createDate: now(60) } +] + +const informationCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'title', label: '资讯标题', minWidth: 240 }, + { prop: 'categoryName', label: '分类', width: 140 }, + { prop: 'author', label: '作者', width: 100 }, + { prop: 'viewCount', label: '阅读数', width: 100, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '发布时间', width: 180, type: 'text' } +] +const informationMock = [ + { id: '1', title: '2026 工业互联网发展白皮书', categoryName: '行业资讯', author: '编辑部', viewCount: 5680, status: 1, createDate: now(15) }, + { id: '2', title: '产品网络平台 V3.0 正式发布', categoryName: '平台公告', author: '产品部', viewCount: 3200, status: 1, createDate: now(10) }, + { id: '3', title: '夏季采购节活动开启', categoryName: '活动公告', author: '运营部', viewCount: 1890, status: 1, createDate: now(5) }, + { id: '4', title: '供应商资质审核标准升级', categoryName: '平台公告', author: '审核部', viewCount: 980, status: 1, createDate: now(3) }, + { id: '5', title: '供应链金融产品上线', categoryName: '行业资讯', author: '编辑部', viewCount: 1450, status: 1, createDate: now(1) }, + { id: '6', title: '关于完善发票信息的通知', categoryName: '平台公告', author: '财务部', viewCount: 720, status: 1, createDate: now(0) }, + { id: '7', title: '春节假期客户服务安排', categoryName: '服务公告', author: '客服部', viewCount: 420, status: 1, createDate: now(60) } +] + +const industryCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '行业名称', minWidth: 200 }, + { prop: 'parentName', label: '上级行业', width: 160 }, + { prop: 'sort', label: '排序', width: 80, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const industryMock = [ + { id: '1', name: '机械制造', parentName: '-', sort: 1, status: 1, createDate: now(200) }, + { id: '2', name: '电子电气', parentName: '-', sort: 2, status: 1, createDate: now(200) }, + { id: '3', name: '化工材料', parentName: '-', sort: 3, status: 1, createDate: now(180) }, + { id: '4', name: '汽车配件', parentName: '机械制造', sort: 1, status: 1, createDate: now(150) }, + { id: '5', name: '工业自动化', parentName: '机械制造', sort: 2, status: 1, createDate: now(150) }, + { id: '6', name: '半导体', parentName: '电子电气', sort: 1, status: 1, createDate: now(120) }, + { id: '7', name: '医疗器械', parentName: '机械制造', sort: 3, status: 1, createDate: now(100) }, + { id: '8', name: '新能源', parentName: '化工材料', sort: 1, status: 1, createDate: now(80) } +] + +const categoryGoodCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '分类名称', minWidth: 200 }, + { prop: 'parentName', label: '上级分类', width: 160 }, + { prop: 'level', label: '层级', width: 80, align: 'right' }, + { prop: 'sort', label: '排序', width: 80, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const categoryGoodMock = [ + { id: '1', name: '工业设备', parentName: '-', level: 1, sort: 1, status: 1, createDate: now(200) }, + { id: '2', name: '电子元器件', parentName: '-', level: 1, sort: 2, status: 1, createDate: now(200) }, + { id: '3', name: '仪器仪表', parentName: '-', level: 1, sort: 3, status: 1, createDate: now(180) }, + { id: '4', name: '工业传感器', parentName: '工业设备', level: 2, sort: 1, status: 1, createDate: now(150) }, + { id: '5', name: '智能控制器', parentName: '工业设备', level: 2, sort: 2, status: 1, createDate: now(150) }, + { id: '6', name: '电阻电容', parentName: '电子元器件', level: 2, sort: 1, status: 1, createDate: now(120) }, + { id: '7', name: 'IC 芯片', parentName: '电子元器件', level: 2, sort: 2, status: 1, createDate: now(100) }, + { id: '8', name: '测量仪器', parentName: '仪器仪表', level: 2, sort: 1, status: 1, createDate: now(80) } +] + +const categoryZXCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '资讯分类', minWidth: 180 }, + { prop: 'parentName', label: '上级分类', width: 160 }, + { prop: 'level', label: '层级', width: 80, align: 'right' }, + { prop: 'sort', label: '排序', width: 80, align: 'right' }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const categoryZXMock = [ + { id: '1', name: '行业资讯', parentName: '-', level: 1, sort: 1, createDate: now(200) }, + { id: '2', name: '平台公告', parentName: '-', level: 1, sort: 2, createDate: now(180) }, + { id: '3', name: '服务公告', parentName: '-', level: 1, sort: 3, createDate: now(150) }, + { id: '4', name: '行业动态', parentName: '行业资讯', level: 2, sort: 1, createDate: now(120) }, + { id: '5', name: '市场分析', parentName: '行业资讯', level: 2, sort: 2, createDate: now(100) }, + { id: '6', name: '系统升级', parentName: '平台公告', level: 2, sort: 1, createDate: now(80) }, + { id: '7', name: '活动公告', parentName: '平台公告', level: 2, sort: 2, createDate: now(60) } +] + +const goodunitCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '单位名称', minWidth: 140 }, + { prop: 'symbol', label: '符号', width: 100 }, + { prop: 'description', label: '描述', minWidth: 220 }, + { prop: 'sort', label: '排序', width: 80, align: 'right' }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const goodunitMock = [ + { id: '1', name: '个', symbol: '个', description: '通用计数单位', sort: 1, createDate: now(180) }, + { id: '2', name: '件', symbol: '件', description: '衣物或零件', sort: 2, createDate: now(180) }, + { id: '3', name: '套', symbol: '套', description: '成套产品', sort: 3, createDate: now(150) }, + { id: '4', name: '台', symbol: '台', description: '机械设备', sort: 4, createDate: now(150) }, + { id: '5', name: '千克', symbol: 'kg', description: '重量', sort: 5, createDate: now(120) }, + { id: '6', name: '吨', symbol: 't', description: '大宗重量', sort: 6, createDate: now(120) }, + { id: '7', name: '米', symbol: 'm', description: '长度', sort: 7, createDate: now(100) }, + { id: '8', name: '平方米', symbol: 'm²', description: '面积', sort: 8, createDate: now(100) }, + { id: '9', name: '升', symbol: 'L', description: '液体容积', sort: 9, createDate: now(80) } +] + +const brandCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '品牌名称', minWidth: 180 }, + { prop: 'logo', label: 'Logo', width: 80, type: 'text' }, + { prop: 'description', label: '描述', minWidth: 240 }, + { prop: 'sort', label: '排序', width: 80, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const brandMock = [ + { id: '1', name: '西门子', logo: '', description: '德国工业自动化巨头', sort: 1, status: 1, createDate: now(180) }, + { id: '2', name: '三菱', logo: '', description: '日本综合电机品牌', sort: 2, status: 1, createDate: now(150) }, + { id: '3', name: '欧姆龙', logo: '', description: '日本电子元器件专家', sort: 3, status: 1, createDate: now(120) }, + { id: '4', name: '施耐德', logo: '', description: '法国能效管理专家', sort: 4, status: 1, createDate: now(100) }, + { id: '5', name: 'ABB', logo: '', description: '瑞士工业巨头', sort: 5, status: 1, createDate: now(80) }, + { id: '6', name: '汇川', logo: '', description: '国产工业自动化领先', sort: 6, status: 1, createDate: now(60) } +] + +const groupbuyCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '活动名称', minWidth: 200 }, + { prop: 'goodsName', label: '活动商品', minWidth: 180 }, + { prop: 'teamSize', label: '成团人数', width: 100, align: 'right' }, + { prop: 'price', label: '拼团价', width: 120, align: 'right' }, + { prop: 'startTime', label: '开始时间', width: 180, type: 'text' }, + { prop: 'endTime', label: '结束时间', width: 180, type: 'text' }, + { prop: 'status', label: '状态', width: 100, type: 'status' } +] +const groupbuyMock = [ + { id: '1', name: '工业传感器拼团', goodsName: '工业传感器 X100', teamSize: 5, price: 1900.00, startTime: now(-3), endTime: now(7), status: 1 }, + { id: '2', name: '智能控制器团购', goodsName: '智能控制器 Y200', teamSize: 3, price: 3500.00, startTime: now(-2), endTime: now(14), status: 1 }, + { id: '3', name: '测量仪器拼团', goodsName: '高精度测量仪', teamSize: 8, price: 13800.00, startTime: now(0), endTime: now(21), status: 1 }, + { id: '4', name: '工业相机拼团', goodsName: '工业相机', teamSize: 10, price: 3800.00, startTime: now(-10), endTime: now(-3), status: 0 }, + { id: '5', name: 'PLC 系统团购', goodsName: 'PLC 控制系统', teamSize: 3, price: 48000.00, startTime: now(1), endTime: now(15), status: 1 }, + { id: '6', name: '机器视觉系统', goodsName: '机器视觉系统', teamSize: 4, price: 98000.00, startTime: now(0), endTime: now(10), status: 1 }, + { id: '7', name: '工业机器人拼团', goodsName: '工业机器人臂', teamSize: 2, price: 78000.00, startTime: now(2), endTime: now(20), status: 1 }, + { id: '8', name: '自动化装配线', goodsName: '自动化装配线', teamSize: 1, price: 220000.00, startTime: now(3), endTime: now(30), status: 1 }, + { id: '9', name: '控制系统团购', goodsName: 'PLC 控制系统', teamSize: 5, price: 46000.00, startTime: now(0), endTime: now(12), status: 1 }, + { id: '10', name: '训练设备团购', goodsName: '工业传感器 X100', teamSize: 4, price: 2100.00, startTime: now(0), endTime: now(7), status: 1 }, + { id: '11', name: '二手设备拼团', goodsName: '智能控制器 Y200', teamSize: 6, price: 2800.00, startTime: now(0), endTime: now(14), status: 1 } +] + +const seckillCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '活动名称', minWidth: 200 }, + { prop: 'goodsName', label: '秒杀商品', minWidth: 180 }, + { prop: 'seckillPrice', label: '秒杀价', width: 120, align: 'right' }, + { prop: 'originalPrice', label: '原价', width: 120, align: 'right' }, + { prop: 'stock', label: '库存', width: 100, align: 'right' }, + { prop: 'startTime', label: '开始时间', width: 180, type: 'text' }, + { prop: 'endTime', label: '结束时间', width: 180, type: 'text' }, + { prop: 'status', label: '状态', width: 100, type: 'status' } +] +const seckillMock = [ + { id: '1', name: '工业传感器秒杀', goodsName: '工业传感器 X100', seckillPrice: 1500, originalPrice: 2500, stock: 100, startTime: now(0), endTime: now(2), status: 1 }, + { id: '2', name: '智能控制器秒杀', goodsName: '智能控制器 Y200', seckillPrice: 2800, originalPrice: 4000, stock: 50, startTime: now(0), endTime: now(3), status: 1 }, + { id: '3', name: '测量仪秒杀', goodsName: '高精度测量仪', seckillPrice: 12800, originalPrice: 15800, stock: 20, startTime: now(0), endTime: now(5), status: 1 } +] + +const labelCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '标签名', minWidth: 160 }, + { prop: 'type', label: '类型', width: 120 }, + { prop: 'color', label: '颜色', width: 100 }, + { prop: 'sort', label: '排序', width: 80, align: 'right' }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const labelMock = [ + { id: '1', name: '热销', type: '商品标签', color: '#F56C6C', sort: 1, createDate: now(200) }, + { id: '2', name: '新品', type: '商品标签', color: '#67C23A', sort: 2, createDate: now(200) }, + { id: '3', name: '推荐', type: '商品标签', color: '#409EFF', sort: 3, createDate: now(180) }, + { id: '4', name: '限时', type: '活动标签', color: '#E6A23C', sort: 1, createDate: now(150) }, + { id: '5', name: '满减', type: '活动标签', color: '#F56C6C', sort: 2, createDate: now(120) }, + { id: '6', name: '包邮', type: '服务标签', color: '#909399', sort: 1, createDate: now(90) }, + { id: '7', name: '正品', type: '服务标签', color: '#67C23A', sort: 2, createDate: now(60) } +] + +// ========== supplier ========== +const promoterCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '推广员', minWidth: 140 }, + { prop: 'mobile', label: '手机号', width: 140 }, + { prop: 'commission', label: '累计佣金', width: 140, align: 'right' }, + { prop: 'orderCount', label: '推广订单数', width: 120, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '加入时间', width: 180, type: 'text' } +] +const promoterMock = [ + { id: '1', name: '张三', mobile: '138****0001', commission: 5800.00, orderCount: 23, status: 1, createDate: now(120) }, + { id: '2', name: '李四', mobile: '138****0002', commission: 3200.00, orderCount: 15, status: 1, createDate: now(100) }, + { id: '3', name: '王五', mobile: '138****0003', commission: 1200.00, orderCount: 8, status: 1, createDate: now(80) } +] + +// ========== user/enterprise ========== +const enterpriseRatingCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'enterpriseName', label: '企业名称', minWidth: 220 }, + { prop: 'rating', label: '评级', width: 100 }, + { prop: 'score', label: '综合分', width: 100, align: 'right' }, + { prop: 'evaluatorName', label: '评估人', width: 120 }, + { prop: 'evaluateDate', label: '评估日期', width: 180, type: 'text' }, + { prop: 'remark', label: '备注', minWidth: 180 } +] +const enterpriseRatingMock = [ + { id: '1', enterpriseName: '深圳科技股份有限公司', rating: 'AAA', score: 95, evaluatorName: '审核部', evaluateDate: now(15), remark: '行业头部企业' }, + { id: '2', enterpriseName: '上海制造集团', rating: 'AA', score: 88, evaluatorName: '审核部', evaluateDate: now(30), remark: '稳定合作伙伴' }, + { id: '3', enterpriseName: '北京电子有限公司', rating: 'A', score: 80, evaluatorName: '审核部', evaluateDate: now(45), remark: '合格供应商' }, + { id: '4', enterpriseName: '广州工厂', rating: 'BBB', score: 72, evaluatorName: '审核部', evaluateDate: now(60), remark: '新合作企业' }, + { id: '5', enterpriseName: '杭州电子', rating: 'BB', score: 65, evaluatorName: '审核部', evaluateDate: now(90), remark: '需关注' }, + { id: '6', enterpriseName: '成都机械厂', rating: 'A', score: 85, evaluatorName: '审核部', evaluateDate: now(120), remark: '技术能力突出' } +] + +const enterpriseLevelCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '等级名称', minWidth: 140 }, + { prop: 'minScore', label: '最低分', width: 100, align: 'right' }, + { prop: 'maxScore', label: '最高分', width: 100, align: 'right' }, + { prop: 'discount', label: '折扣率', width: 100, align: 'right' }, + { prop: 'description', label: '描述', minWidth: 220 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const enterpriseLevelMock = [ + { id: '1', name: '钻石', minScore: 90, maxScore: 100, discount: 0.85, description: '最高等级, 享受 85 折优惠', createDate: now(200) }, + { id: '2', name: '金牌', minScore: 80, maxScore: 89, discount: 0.90, description: '优秀等级, 享受 9 折优惠', createDate: now(180) }, + { id: '3', name: '银牌', minScore: 70, maxScore: 79, discount: 0.95, description: '良好等级, 享受 95 折优惠', createDate: now(150) }, + { id: '4', name: '铜牌', minScore: 60, maxScore: 69, discount: 0.98, description: '合格等级, 享受 98 折优惠', createDate: now(120) }, + { id: '5', name: '普通', minScore: 0, maxScore: 59, discount: 1.00, description: '无折扣', createDate: now(90) } +] + +const enterpriseScoreCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'enterpriseName', label: '企业名称', minWidth: 220 }, + { prop: 'qualityScore', label: '质量分', width: 100, align: 'right' }, + { prop: 'serviceScore', label: '服务分', width: 100, align: 'right' }, + { prop: 'deliveryScore', label: '交付分', width: 100, align: 'right' }, + { prop: 'totalScore', label: '综合分', width: 100, align: 'right' }, + { prop: 'evaluateDate', label: '评分日期', width: 180, type: 'text' } +] +const enterpriseScoreMock = [ + { id: '1', enterpriseName: '深圳科技股份有限公司', qualityScore: 95, serviceScore: 92, deliveryScore: 98, totalScore: 95, evaluateDate: now(15) }, + { id: '2', enterpriseName: '上海制造集团', qualityScore: 88, serviceScore: 85, deliveryScore: 90, totalScore: 88, evaluateDate: now(30) }, + { id: '3', enterpriseName: '北京电子有限公司', qualityScore: 80, serviceScore: 78, deliveryScore: 82, totalScore: 80, evaluateDate: now(45) }, + { id: '4', enterpriseName: '广州工厂', qualityScore: 72, serviceScore: 70, deliveryScore: 75, totalScore: 72, evaluateDate: now(60) }, + { id: '5', enterpriseName: '杭州电子', qualityScore: 65, serviceScore: 68, deliveryScore: 62, totalScore: 65, evaluateDate: now(90) } +] + +// ========== user/finance ========== +const rechargeCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'orderNo', label: '订单号', minWidth: 180 }, + { prop: 'userName', label: '用户', width: 120 }, + { prop: 'amount', label: '充值金额', width: 140, align: 'right' }, + { prop: 'payType', label: '支付方式', width: 120 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'payTime', label: '支付时间', width: 180, type: 'text' } +] +const rechargeMock = [ + { id: '1', orderNo: 'RC20260705001', userName: '张三', amount: 5000.00, payType: '微信支付', status: 1, payTime: now(0) }, + { id: '2', orderNo: 'RC20260705002', userName: '李四', amount: 10000.00, payType: '支付宝', status: 1, payTime: now(0) }, + { id: '3', orderNo: 'RC20260705003', userName: '王五', amount: 2000.00, payType: '银联', status: 1, payTime: now(1) }, + { id: '4', orderNo: 'RC20260705004', userName: '赵六', amount: 50000.00, payType: '对公转账', status: 0, payTime: now(0) }, + { id: '5', orderNo: 'RC20260705005', userName: '钱七', amount: 1000.00, payType: '微信支付', status: 1, payTime: now(2) }, + { id: '6', orderNo: 'RC20260705006', userName: '孙八', amount: 8000.00, payType: '支付宝', status: 1, payTime: now(3) } +] + +const rechargeTxCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'orderNo', label: '订单号', minWidth: 180 }, + { prop: 'userName', label: '用户', width: 120 }, + { prop: 'amount', label: '提现金额', width: 140, align: 'right' }, + { prop: 'fee', label: '手续费', width: 100, align: 'right' }, + { prop: 'account', label: '到账账户', minWidth: 180 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '申请时间', width: 180, type: 'text' } +] +const rechargeTxMock = [ + { id: '1', orderNo: 'TX20260705001', userName: '张三', amount: 2000.00, fee: 10.00, account: '****0001', status: 1, createDate: now(0) }, + { id: '2', orderNo: 'TX20260705002', userName: '李四', amount: 5000.00, fee: 25.00, account: '****0002', status: 0, createDate: now(0) }, + { id: '3', orderNo: 'TX20260705003', userName: '王五', amount: 1000.00, fee: 5.00, account: '****0003', status: 1, createDate: now(1) }, + { id: '4', orderNo: 'TX20260705004', userName: '赵六', amount: 8000.00, fee: 40.00, account: '****0004', status: 2, createDate: now(2) } +] + +const revenueCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'orderNo', label: '订单号', minWidth: 180 }, + { prop: 'fromUser', label: '付款方', width: 140 }, + { prop: 'toUser', label: '收款方', width: 140 }, + { prop: 'amount', label: '分账金额', width: 140, align: 'right' }, + { prop: 'rate', label: '分账比例', width: 100, align: 'right' }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '分账时间', width: 180, type: 'text' } +] +const revenueMock = [ + { id: '1', orderNo: 'O20260705001', fromUser: '深圳科技公司', toUser: '推广员张三', amount: 1250, rate: '10%', status: 1, createDate: now(0) }, + { id: '2', orderNo: 'O20260705003', fromUser: '上海制造企业', toUser: '推广员李四', amount: 1580, rate: '10%', status: 1, createDate: now(1) }, + { id: '3', orderNo: 'O20260705006', fromUser: '北京集团', toUser: '平台', amount: 4500, rate: '10%', status: 1, createDate: now(2) } +] + +const transactionCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'orderNo', label: '关联单号', minWidth: 180 }, + { prop: 'userName', label: '用户', width: 120 }, + { prop: 'type', label: '类型', width: 100 }, + { prop: 'amount', label: '金额', width: 140, align: 'right' }, + { prop: 'balance', label: '账户余额', width: 140, align: 'right' }, + { prop: 'remark', label: '备注', minWidth: 220 }, + { prop: 'createDate', label: '交易时间', width: 180, type: 'text' } +] +const transactionMock = [ + { id: '1', orderNo: 'O20260705001', userName: '张三', type: '支出', amount: -12500.00, balance: 87500.00, remark: '购买商品', createDate: now(0) }, + { id: '2', orderNo: 'RC20260705001', userName: '张三', type: '收入', amount: 5000.00, balance: 100000.00, remark: '账户充值', createDate: now(0) }, + { id: '3', orderNo: 'O20260705003', userName: '王五', type: '支出', amount: -15800.00, balance: 4200.00, remark: '购买商品', createDate: now(1) }, + { id: '4', orderNo: 'O20260705006', userName: '孙八', type: '支出', amount: -45000.00, balance: 15500.00, remark: '购买商品', createDate: now(2) } +] + +// ========== user/message ========== +const messageCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'title', label: '消息标题', minWidth: 220 }, + { prop: 'type', label: '类型', width: 100 }, + { prop: 'receiver', label: '接收人', width: 140 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'sendTime', label: '发送时间', width: 180, type: 'text' } +] +const messageMock = [ + { id: '1', title: '订单已发货', type: '订单通知', receiver: '深圳科技公司', status: 1, sendTime: now(0) }, + { id: '2', title: '询价已被报价', type: '询价通知', receiver: '上海制造企业', status: 1, sendTime: now(0) }, + { id: '3', title: '账户充值成功', type: '账户通知', receiver: '张三', status: 1, sendTime: now(1) }, + { id: '4', title: '资质即将过期', type: '系统通知', receiver: '北京电子有限公司', status: 0, sendTime: now(2) }, + { id: '5', title: '平台活动通知', type: '活动通知', receiver: '全部用户', status: 1, sendTime: now(3) } +] + +const messageHandelCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'title', label: '待处理事项', minWidth: 240 }, + { prop: 'type', label: '类型', width: 100 }, + { prop: 'priority', label: '优先级', width: 100 }, + { prop: 'handler', label: '处理人', width: 120 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const messageHandelMock = [ + { id: '1', title: '审核企业资质变更申请', type: '资质审核', priority: '高', handler: '审核员A', createDate: now(0) }, + { id: '2', title: '处理退款申请', type: '售后', priority: '高', handler: '客服A', createDate: now(0) }, + { id: '3', title: '审核商品上架申请', type: '商品审核', priority: '中', handler: '审核员B', createDate: now(1) }, + { id: '4', title: '处理投诉工单', type: '客服', priority: '中', handler: '客服B', createDate: now(1) }, + { id: '5', title: '复核大额订单', type: '风控', priority: '低', handler: '风控员', createDate: now(2) } +] + +// ========== sys/log ========== +const logLoginCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'username', label: '用户名', width: 140 }, + { prop: 'ip', label: 'IP 地址', minWidth: 140 }, + { prop: 'userAgent', label: '设备', minWidth: 200 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '登录时间', width: 180, type: 'text' } +] +const logLoginMock = [ + { id: '1', username: 'admin', ip: '192.168.1.100', userAgent: 'Chrome 138 / macOS', status: 1, createDate: now(0) }, + { id: '2', username: 'zou', ip: '100.70.73.55', userAgent: 'Chrome 138 / macOS', status: 1, createDate: now(0) }, + { id: '3', username: 'cao', ip: '192.168.1.120', userAgent: 'Safari 18 / macOS', status: 1, createDate: now(1) }, + { id: '4', username: 'test', ip: '10.0.0.5', userAgent: 'Firefox 130 / Windows', status: 0, createDate: now(1) }, + { id: '5', username: 'admin', ip: '192.168.1.100', userAgent: 'Chrome 138 / macOS', status: 1, createDate: now(2) } +] + +const logOperationCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'username', label: '操作人', width: 120 }, + { prop: 'operation', label: '操作内容', minWidth: 240 }, + { prop: 'module', label: '模块', width: 120 }, + { prop: 'ip', label: 'IP', width: 140 }, + { prop: 'createDate', label: '操作时间', width: 180, type: 'text' } +] +const logOperationMock = [ + { id: '1', username: 'admin', operation: '新增菜单 订单管理', module: '系统管理', ip: '192.168.1.100', createDate: now(0) }, + { id: '2', username: 'zou', operation: '修改用户 张三 状态', module: '用户管理', ip: '100.70.73.55', createDate: now(0) }, + { id: '3', username: 'admin', operation: '发布新商品 工业传感器', module: '商品管理', ip: '192.168.1.100', createDate: now(1) }, + { id: '4', username: 'cao', operation: '审核通过 订单 O20260705001', module: '订单管理', ip: '192.168.1.120', createDate: now(1) }, + { id: '5', username: 'admin', operation: '删除字典项', module: '系统管理', ip: '192.168.1.100', createDate: now(2) } +] + +const logErrorCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'module', label: '模块', width: 140 }, + { prop: 'errorMsg', label: '错误信息', minWidth: 280 }, + { prop: 'requestUri', label: '请求 URI', minWidth: 200 }, + { prop: 'ip', label: 'IP', width: 140 }, + { prop: 'createDate', label: '时间', width: 180, type: 'text' } +] +const logErrorMock = [ + { id: '1', module: '订单服务', errorMsg: '订单不存在: O20260705999', requestUri: '/sys/openapi/order/info', ip: '192.168.1.100', createDate: now(0) }, + { id: '2', module: '用户服务', errorMsg: '用户已被锁定: user_123', requestUri: '/sys/user/info', ip: '100.70.73.55', createDate: now(0) }, + { id: '3', module: '支付服务', errorMsg: '支付渠道超时', requestUri: '/sys/openapi/pay/callback', ip: '192.168.1.120', createDate: now(1) }, + { id: '4', module: '商品服务', errorMsg: '商品已下架: G20260705001', requestUri: '/supplier/good/info', ip: '192.168.1.100', createDate: now(2) } +] + +// ========== sys ========== +const userManagementCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'name', label: '运营中心', minWidth: 200 }, + { prop: 'type', label: '类型', width: 140 }, + { prop: 'manager', label: '负责人', width: 120 }, + { prop: 'mobile', label: '联系方式', width: 140 }, + { prop: 'region', label: '所在地区', minWidth: 200 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const userManagementMock = [ + { id: '1', name: '全国运营中心', type: '全国', manager: '王总', mobile: '138****0000', region: '北京', status: 1, createDate: now(200) } +] + +const operationCols: MockColumn[] = userManagementCols +const operationNationalMock = [ + { id: '1', name: '全国运营中心', type: '全国', manager: '王总', mobile: '138****0000', region: '北京', status: 1, createDate: now(200) } +] +const operationProvinceMock = [ + { id: '1', name: '广东省运营中心', type: '省级', manager: '李总', mobile: '138****0001', region: '广东省', status: 1, createDate: now(180) }, + { id: '2', name: '江苏省运营中心', type: '省级', manager: '张总', mobile: '138****0002', region: '江苏省', status: 1, createDate: now(150) } +] +const operationCountyMock = [ + { id: '1', name: '深圳市运营中心', type: '县级', manager: '陈总', mobile: '138****0010', region: '广东省深圳市', status: 1, createDate: now(120) } +] +const operationAssociationMock = [ + { id: '1', name: '机械工业协会', type: '行业协会', manager: '赵主席', mobile: '138****0020', region: '北京', status: 1, createDate: now(180) }, + { id: '2', name: '电子工业协会', type: '行业协会', manager: '钱主席', mobile: '138****0021', region: '上海', status: 1, createDate: now(150) }, + { id: '3', name: '化工材料协会', type: '行业协会', manager: '孙主席', mobile: '138****0022', region: '广州', status: 1, createDate: now(120) } +] + +const dictTypeCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'dictType', label: '字典类型', minWidth: 200 }, + { prop: 'dictName', label: '字典名称', minWidth: 200 }, + { prop: 'remark', label: '备注', minWidth: 200 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const dictTypeMock = [ + { id: '1', dictType: 'user_status', dictName: '用户状态', remark: '正常/锁定', createDate: now(200) }, + { id: '2', dictType: 'order_status', dictName: '订单状态', remark: '待付款/已付款/已发货/已收货/已取消', createDate: now(200) }, + { id: '3', dictType: 'pay_type', dictName: '支付方式', remark: '微信/支付宝/银联/对公转账', createDate: now(180) }, + { id: '4', dictType: 'enterprise_type', dictName: '企业类型', remark: '供应商/采购商', createDate: now(180) }, + { id: '5', dictType: 'good_category', dictName: '商品分类', remark: '工业设备/电子元器件/仪器仪表', createDate: now(150) }, + { id: '6', dictType: 'inquiry_status', dictName: '询价状态', remark: '待报价/报价中/已成交/已取消', createDate: now(120) } +] + +const noticeCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'title', label: '公告标题', minWidth: 240 }, + { prop: 'type', label: '类型', width: 100 }, + { prop: 'publisher', label: '发布人', width: 120 }, + { prop: 'status', label: '状态', width: 100, type: 'status' }, + { prop: 'createDate', label: '发布时间', width: 180, type: 'text' } +] +const noticeMock = [ + { id: '1', title: '系统 V3.0 升级公告', type: '升级公告', publisher: '管理员', status: 1, createDate: now(15) }, + { id: '2', title: '春节假期值班安排', type: '运营公告', publisher: '运营部', status: 1, createDate: now(30) }, + { id: '3', title: '安全漏洞修复通知', type: '安全公告', publisher: '技术部', status: 1, createDate: now(7) }, + { id: '4', title: '新功能上线预告', type: '产品公告', publisher: '产品部', status: 0, createDate: now(2) } +] + +const paramsCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'paramKey', label: '参数键', minWidth: 200 }, + { prop: 'paramValue', label: '参数值', minWidth: 240 }, + { prop: 'paramType', label: '类型', width: 100 }, + { prop: 'remark', label: '备注', minWidth: 200 }, + { prop: 'createDate', label: '创建时间', width: 180, type: 'text' } +] +const paramsMock = [ + { id: '1', paramKey: 'site.name', paramValue: '产品网络', paramType: 'string', remark: '站点名称', createDate: now(200) }, + { id: '2', paramKey: 'site.copyright', paramValue: '© 2026 产品网络', paramType: 'string', remark: '版权信息', createDate: now(200) }, + { id: '3', paramKey: 'upload.image.maxSize', paramValue: '5242880', paramType: 'number', remark: '图片最大 5MB', createDate: now(150) }, + { id: '4', paramKey: 'upload.file.maxSize', paramValue: '20971520', paramType: 'number', remark: '文件最大 20MB', createDate: now(150) }, + { id: '5', paramKey: 'sms.enabled', paramValue: 'true', paramType: 'boolean', remark: '短信功能开关', createDate: now(120) }, + { id: '6', paramKey: 'email.enabled', paramValue: 'true', paramType: 'boolean', remark: '邮件功能开关', createDate: now(120) } +] + +const noticeUserCols: MockColumn[] = [ + { prop: 'id', label: 'ID', width: 80 }, + { prop: 'userName', label: '接收人', width: 140 }, + { prop: 'noticeTitle', label: '通知标题', minWidth: 240 }, + { prop: 'readStatus', label: '阅读状态', width: 100, type: 'status' }, + { prop: 'readTime', label: '阅读时间', width: 180, type: 'text' } +] +const noticeUserMock = [ + { id: '1', userName: '张三', noticeTitle: '系统 V3.0 升级公告', readStatus: 1, readTime: now(14) }, + { id: '2', userName: '李四', noticeTitle: '春节假期值班安排', readStatus: 1, readTime: now(29) }, + { id: '3', userName: '王五', noticeTitle: '系统 V3.0 升级公告', readStatus: 0, readTime: now(-1) }, + { id: '4', userName: '赵六', noticeTitle: '安全漏洞修复通知', readStatus: 1, readTime: now(6) } +] + +// ========== 配置表 ========== +export const MOCK_TABLE_CONFIGS: Record = { + // devtools (5) + 'devtools-baseclass': { endpoint: '/devtools/baseclass/page', title: '基类配置', columns: baseclassCols, mockData: baseclassMock, queryKey: 'code', queryLabel: '基类编码' }, + 'devtools-param': { endpoint: '/devtools/param/info', title: '参数配置(开发)', columns: paramCols, mockData: paramMock, description: '代码生成参数, 修改后会影响后续生成代码' }, + 'devtools-fieldtype': { endpoint: '/devtools/fieldtype/page', title: '字段配置', columns: fieldtypeCols, mockData: fieldtypeMock, queryKey: 'columnType', queryLabel: '字段类型' }, + 'devtools-template': { endpoint: '/devtools/template/page', title: '模板配置', columns: templateCols, mockData: templateMock, queryKey: 'name', queryLabel: '模板名称' }, + 'devtools-datasource': { endpoint: '/devtools/datasource/page', title: '数据源配置', columns: datasourceCols, mockData: datasourceMock, queryKey: 'name', queryLabel: '数据源名称' }, + + // job (1) + 'job-schedule': { endpoint: '/job/schedule/page', title: '定时任务', columns: scheduleCols, mockData: scheduleMock, queryKey: 'beanName', queryLabel: 'Bean 名称' }, + + // message (4) + 'message-sms': { endpoint: '/message/sms/page', title: '短信配置', columns: smsCols, mockData: smsMock }, + 'message-sms-log': { endpoint: '/message/sms-log/page', title: '短信日志', columns: smsLogCols, mockData: smsLogMock, queryKey: 'mobile', queryLabel: '手机号' }, + 'message-mail-template': { endpoint: '/message/mail-template/page', title: '邮件模板', columns: mailTemplateCols, mockData: mailTemplateMock, queryKey: 'name', queryLabel: '模板名称' }, + 'message-mail-log': { endpoint: '/message/mail-log/page', title: '邮件日志', columns: mailLogCols, mockData: mailLogMock }, + + // order (9) + 'order-ordergood': { endpoint: '/order/ordergood/page', title: '商品订单', columns: orderCommonCols, mockData: orderGoodMock, queryKey: 'id', queryLabel: '订单号', description: '状态: ' + Object.entries(orderStatusMap).map(([k, v]) => `${k}=${v.label}`).join(' / ') }, + 'order-serviceorder': { endpoint: '/order/serviceorder/page', title: '服务订单', columns: orderCommonCols, mockData: serviceOrderMock, queryKey: 'id', queryLabel: '订单号' }, + 'order-group-supplier': { endpoint: '/order/groupsupplierorder/page', title: '商品拼团订单', columns: orderCommonCols, mockData: groupSupplierMock, queryKey: 'id', queryLabel: '订单号' }, + 'order-group-service': { endpoint: '/order/groupserviceorder/page', title: '服务拼团订单', columns: orderCommonCols, mockData: groupServiceMock, queryKey: 'id', queryLabel: '订单号' }, + 'order-ordergood-after': { endpoint: '/order/orderafter/page', title: '商品售后订单', columns: orderCommonCols, mockData: orderAfterMock, queryKey: 'id', queryLabel: '订单号', description: '状态: ' + Object.entries(afterSaleStatusMap).map(([k, v]) => `${k}=${v.label}`).join(' / ') }, + 'order-orderserviceafter': { endpoint: '/order/orderserviceafter/page', title: '服务售后订单', columns: orderCommonCols, mockData: orderServiceAfterMock, queryKey: 'id', queryLabel: '订单号' }, + 'order-ordergood-commission': { endpoint: '/order/ordergood-commission/page', title: '实物订单分佣统计', columns: orderCommissionCols, mockData: orderGoodCommissionMock }, + 'order-serviceorder-commission': { endpoint: '/order/serviceorder-commission/page', title: '服务订单分佣统计', columns: orderCommissionCols, mockData: serviceOrderCommissionMock }, + 'order-base-price-analysis': { endpoint: '/order/orderbase-price-analysis/page', title: '基础价格分析表', columns: priceAnalysisCols, mockData: priceAnalysisMock, queryKey: 'categoryName', queryLabel: '品类' }, + + // other (12) + 'other-textconfig': { endpoint: '/other/textconfig/page', title: '常量配置', columns: textconfigCols, mockData: textconfigMock, queryKey: 'key', queryLabel: '配置键' }, + 'other-help': { endpoint: '/other/help/page', title: '帮助中心', columns: helpCols, mockData: helpMock, queryKey: 'title', queryLabel: '标题' }, + 'other-guide': { endpoint: '/other/operateguide/page', title: '内容列表', columns: guideCols, mockData: guideMock, queryKey: 'title', queryLabel: '标题' }, + 'other-information': { endpoint: '/other/information/page', title: '资讯列表', columns: informationCols, mockData: informationMock, queryKey: 'title', queryLabel: '标题' }, + 'other-industry': { endpoint: '/other/industry/page', title: '行业', columns: industryCols, mockData: industryMock, queryKey: 'name', queryLabel: '行业名称' }, + 'other-category-good': { endpoint: '/other/categoryGood/page', title: '平台分类', columns: categoryGoodCols, mockData: categoryGoodMock, queryKey: 'name', queryLabel: '分类名称' }, + 'other-category-zx': { endpoint: '/other/categoryZX/page', title: '资讯分类', columns: categoryZXCols, mockData: categoryZXMock, queryKey: 'name', queryLabel: '分类名称' }, + 'other-goodunit': { endpoint: '/other/goodunit/page', title: '商品单位', columns: goodunitCols, mockData: goodunitMock, queryKey: 'name', queryLabel: '单位名称' }, + 'other-brand': { endpoint: '/other/supplierBrand/page', title: '品牌管理', columns: brandCols, mockData: brandMock, queryKey: 'name', queryLabel: '品牌名称' }, + 'other-groupbuy': { endpoint: '/other/groupbuy/page', title: '拼团活动', columns: groupbuyCols, mockData: groupbuyMock, queryKey: 'name', queryLabel: '活动名称' }, + 'other-seckill': { endpoint: '/other/seckill/page', title: '秒杀活动', columns: seckillCols, mockData: seckillMock, queryKey: 'name', queryLabel: '活动名称' }, + 'other-label': { endpoint: '/other/label/page', title: '标签管理', columns: labelCols, mockData: labelMock, queryKey: 'name', queryLabel: '标签名' }, + + // supplier (1) + 'supplier-promoter': { endpoint: '/supplier/promoter/page', title: '推广返佣', columns: promoterCols, mockData: promoterMock, queryKey: 'name', queryLabel: '推广员' }, + + // user/enterprise (3) + 'user-enterprise-rating': { endpoint: '/user/enterprise/enterprise-rating/page', title: '评级', columns: enterpriseRatingCols, mockData: enterpriseRatingMock, queryKey: 'enterpriseName', queryLabel: '企业名称' }, + 'user-enterprise-level': { endpoint: '/user/enterprise/enterprise-level/page', title: '企业等级管理', columns: enterpriseLevelCols, mockData: enterpriseLevelMock, queryKey: 'name', queryLabel: '等级名称' }, + 'user-enterprise-score': { endpoint: '/user/enterprise/enterprise-score/page', title: '评分', columns: enterpriseScoreCols, mockData: enterpriseScoreMock, queryKey: 'enterpriseName', queryLabel: '企业名称' }, + + // user/finance (4) + 'user-finance-recharge': { endpoint: '/user/finance/recharge/page', title: '充值管理', columns: rechargeCols, mockData: rechargeMock, queryKey: 'orderNo', queryLabel: '订单号' }, + 'user-finance-recharge-tx': { endpoint: '/user/finance/recharge-tx/page', title: '提现管理', columns: rechargeTxCols, mockData: rechargeTxMock, queryKey: 'orderNo', queryLabel: '订单号' }, + 'user-finance-revenue': { endpoint: '/user/finance/revenue-sharing/page', title: '分账记录管理', columns: revenueCols, mockData: revenueMock }, + 'user-finance-transaction': { endpoint: '/user/finance/transaction-record/page', title: '交易流水', columns: transactionCols, mockData: transactionMock, queryKey: 'orderNo', queryLabel: '关联单号' }, + + // user/message (2) + 'user-message': { endpoint: '/user/message/message/page', title: '系统消息', columns: messageCols, mockData: messageMock, queryKey: 'title', queryLabel: '消息标题' }, + 'user-message-handel': { endpoint: '/user/message/messageHandel/page', title: '待处理消息', columns: messageHandelCols, mockData: messageHandelMock, queryKey: 'title', queryLabel: '事项' }, + + // sys/log (3) + 'sys-log-login': { endpoint: '/sys/log-login/page', title: '登录日志', columns: logLoginCols, mockData: logLoginMock, queryKey: 'username', queryLabel: '用户名' }, + 'sys-log-operation': { endpoint: '/sys/log-operation/page', title: '操作日志', columns: logOperationCols, mockData: logOperationMock }, + 'sys-log-error': { endpoint: '/sys/log-error/page', title: '异常日志', columns: logErrorCols, mockData: logErrorMock, queryKey: 'module', queryLabel: '模块' }, + + // sys/operation (4) + 'sys-operation-country': { endpoint: '/sys/operation/pageList', title: '全国运营中心', columns: operationCols, mockData: operationNationalMock, queryParams: { type: 1 }, queryKey: 'name', queryLabel: '运营中心' }, + 'sys-operation-province': { endpoint: '/sys/operation/pageList', title: '省级运营中心', columns: operationCols, mockData: operationProvinceMock, queryParams: { type: 2 }, queryKey: 'name', queryLabel: '运营中心' }, + 'sys-operation-county': { endpoint: '/sys/operation/pageList', title: '县级运营中心', columns: operationCols, mockData: operationCountyMock, queryParams: { type: 3 }, queryKey: 'name', queryLabel: '运营中心' }, + 'sys-operation-association': { endpoint: '/sys/operation/pageList', title: '行业协会运营', columns: operationCols, mockData: operationAssociationMock, queryParams: { type: 4 }, queryKey: 'name', queryLabel: '运营中心' }, + 'sys-userManagement': { endpoint: '/sys/userManagement/page', title: '全国运营中心', columns: operationCols, mockData: userManagementMock, queryKey: 'name', queryLabel: '运营中心' }, + + // sys (4) + 'sys-dict': { endpoint: '/sys/dict-type/page', title: '字典类型', columns: dictTypeCols, mockData: dictTypeMock, queryKey: 'dictType', queryLabel: '字典类型' }, + 'sys-notice': { endpoint: '/sys/notice/page', title: '通知公告', columns: noticeCols, mockData: noticeMock, queryKey: 'title', queryLabel: '标题' }, + 'sys-params': { endpoint: '/sys/params/page', title: '参数配置', columns: paramsCols, mockData: paramsMock, queryKey: 'paramKey', queryLabel: '参数键' }, + 'sys-notice-user': { endpoint: '/sys/notice-user/page', title: '用户通知', columns: noticeUserCols, mockData: noticeUserMock, queryKey: 'userName', queryLabel: '接收人' } +} + +// 状态映射导出 (组件用) +export const STATUS_MAPS = { + enabled: STATUS_ENABLED, + lock: STATUS_LOCK, + order: orderStatusMap, + afterSale: afterSaleStatusMap +} diff --git a/src/router/index.ts b/src/router/index.ts index a2031c4..48bba63 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -7,8 +7,13 @@ import type { RouteRecordRaw } from 'vue-router' * - / + /dashboard 实际页面 * - /inquiry 询价列表 * - /inquiry/:id 询价详情 - * - /:module/:action 通配占位(覆盖菜单映射的 70 个 url,避免 404) + * - /:module/:action 通配占位 * - /:pathMatch(.*)* 兜底跳首页 + * + * W5.x.x+4: 50 个 P3 路由统一改用 MockTableView + configKey + * - 字段定义 / mock 数据集中在 mockTableConfigs.ts + * - 端点可用时自动透传真数据, 不可用时降级 mock + * - 一个 view 组件 50 路由复用 */ const routes: RouteRecordRaw[] = [ { @@ -17,7 +22,7 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/modules/auth/LoginView.vue'), meta: { title: '登录', public: true } }, - // W3.x C P0.1: 数据统计首页 (生产环境一级模块, 走 order 真 API) + // W3.x C P0.1: 数据统计首页 { path: '/', name: 'Statistics', @@ -28,7 +33,6 @@ const routes: RouteRecordRaw[] = [ path: '/dashboard', redirect: '/' }, - // statistics/index 走通配时, 仍走 StatisticsView { path: '/statistics/index', name: 'StatisticsIndex', @@ -49,7 +53,6 @@ const routes: RouteRecordRaw[] = [ }, { path: '/order/group-supplier', redirect: '/order/groupsupplierorder' }, { path: '/order/group-service', redirect: '/order/groupserviceorder' }, - // W3.x C P0.2: 询价列表 (生产环境 supplier/inquiry/inquiry 重定向到 /inquiry) { path: '/supplier/inquiry/inquiry', redirect: '/inquiry' @@ -58,15 +61,13 @@ const routes: RouteRecordRaw[] = [ path: '/supplier/inquiry', redirect: '/inquiry' }, - // W3.x C P0.3: 用户列表 (前台用户) { path: '/user/user', name: 'UserUserList', component: () => import('@/modules/user/UserListView.vue'), meta: { title: '用户列表' } }, - - // W3.2 订单管理(具体路由必须在 /:module/:action 之前,否则被通配拦截) + // W3.2 订单管理 { path: '/order', name: 'OrderList', @@ -79,7 +80,7 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/modules/order/OrderDetailView.vue'), meta: { title: '订单详情' } }, - // W4.19 业务模块(必须在通配占位之前) + // W4.19 业务模块 { path: '/user/enterprise', name: 'UserEnterpriseList', @@ -98,196 +99,72 @@ const routes: RouteRecordRaw[] = [ component: () => import('@/modules/supplier/ActivityListView.vue'), meta: { title: '营销活动' } }, - // W4.1 集成管理 - 应用列表(具体路由必须在通配占位之前) - // 详情是 dialog 弹窗不是路由页(老 vue app-list.vue 结构) + // W4.1 集成管理 { path: '/openapi/app', name: 'OpenAppList', component: () => import('@/modules/openapi/OpenAppListView.vue'), meta: { title: '应用列表' } }, - // W4.2 集成管理 - 公司账号管理 { path: '/openapi/company', name: 'OpenCompanyAccount', component: () => import('@/modules/openapi/CompanyAccountListView.vue'), meta: { title: '公司账号管理' } }, - // W4.3 集成管理 - 审计日志 { path: '/openapi/audit-log', name: 'OpenAuditLog', component: () => import('@/modules/openapi/AuditLogListView.vue'), meta: { title: '审计日志' } }, - // W4.5 用户管理(后台用户) - { - path: '/sys/user', - name: 'SysUserList', - component: () => import('@/modules/sys/UserListView.vue'), - meta: { title: '用户管理' } - }, - // W4.6 角色管理 - { - path: '/sys/role', - name: 'SysRoleList', - component: () => import('@/modules/sys/RoleListView.vue'), - meta: { title: '角色管理' } - }, - // W4.7 参数管理(对应老 devtools/param, 后端 /sys/params/*) - { - path: '/sys/params', - name: 'SysParamsList', - component: () => import('@/modules/sys/ParamsListView.vue'), - meta: { title: '参数管理' } - }, - // W4.14 sys 模块补全:部门/菜单/日志 - { - path: '/sys/dept', - name: 'SysDeptList', - component: () => import('@/modules/sys/DeptListView.vue'), - meta: { title: '部门管理' } - }, - { - path: '/sys/menu', - name: 'SysMenuList', - component: () => import('@/modules/sys/MenuListView.vue'), - meta: { title: '菜单管理' } - }, - { - path: '/sys/log-login', - name: 'SysLogLogin', - component: () => import('@/modules/sys/LogLoginView.vue'), - meta: { title: '登录日志' } - }, - { - path: '/sys/log-operation', - name: 'SysLogOperation', - component: () => import('@/modules/sys/LogOperationView.vue'), - meta: { title: '操作日志' } - }, - // W4.16 sys 模块补全:岗位/错误日志/定时任务/角色组/文件 - { - path: '/sys/post', - name: 'SysPostList', - component: () => import('@/modules/sys/PostListView.vue'), - meta: { title: '岗位管理' } - }, - { - path: '/sys/log-error', - name: 'SysLogError', - component: () => import('@/modules/sys/LogErrorView.vue'), - meta: { title: '错误日志' } - }, - { - path: '/sys/schedule', - name: 'SysScheduleList', - component: () => import('@/modules/sys/ScheduleListView.vue'), - meta: { title: '定时任务' } - }, - { - path: '/sys/role-group', - name: 'SysRoleGroupList', - component: () => import('@/modules/sys/RoleGroupListView.vue'), - meta: { title: '角色组管理' } - }, - { - path: '/sys/file', - name: 'SysFileList', - component: () => import('@/modules/sys/FileListView.vue'), - meta: { title: '文件管理' } - }, - // W4.18 字典/通知/商品 - { - path: '/sys/dict-data', - name: 'SysDictDataList', - component: () => import('@/modules/sys/DictDataListView.vue'), - meta: { title: '字典数据' } - }, - { - path: '/sys/dict-type', - name: 'SysDictTypeList', - component: () => import('@/modules/sys/DictTypeListView.vue'), - meta: { title: '字典类型' } - }, - { - path: '/sys/notice', - name: 'SysNoticeList', - component: () => import('@/modules/sys/NoticeListView.vue'), - meta: { title: '通知公告' } - }, - { - path: '/sys/product', - name: 'SysProductList', - component: () => import('@/modules/sys/ProductListView.vue'), - meta: { title: '商品管理' } - }, - // W3.x C P0.4-7: 新增 4 个 view 路由 + + // W3.x C P0.5+ 真实接入: 数据统计/资讯/帮助/操作指南/区域/单位/商品/店铺 { path: '/other/operateguide', - name: 'OperateguideList', + name: 'OtherOperateguide', component: () => import('@/modules/other/operateguide/OperateguideListView.vue'), - meta: { title: '内容列表' } + meta: { title: '操作指南' } }, { path: '/api/lunbo', - name: 'LunboList', + name: 'ApiLunbo', component: () => import('@/modules/api/lunbo/LunboListView.vue'), meta: { title: '轮播管理' } }, { path: '/api/help', - name: 'HelpList', + name: 'ApiHelp', component: () => import('@/modules/api/help/HelpListView.vue'), meta: { title: '帮助中心' } }, { - path: '/sys/region', - name: 'SysRegionList', - component: () => import('@/modules/sys/region/RegionListView.vue'), - meta: { title: '行政区域' } + path: '/api/feedback', + name: 'ApiFeedback', + component: () => import('@/modules/api/feedback/FeedbackListView.vue'), + meta: { title: '意见反馈' } }, - // W3.x C P1.1-5: 基础设置 5 个 (textconfig/categoryGood/label/supplierBrand/goodunit) - // goodunit 走真数据 API, 其它 4 个后端未实现走占位 { path: '/other/goodunit', - name: 'GoodunitList', + name: 'OtherGoodunit', component: () => import('@/modules/other/goodunit/GoodunitListView.vue'), meta: { title: '商品单位' } }, - { - path: '/other/textconfig', - name: 'TextconfigList', - component: () => import('@/modules/other/textconfig/TextconfigListView.vue'), - meta: { title: '常量配置' } - }, - { - path: '/other/categoryGood', - name: 'CategoryGoodList', - component: () => import('@/modules/other/categoryGood/CategoryGoodListView.vue'), - meta: { title: '平台分类' } - }, { path: '/other/label', - name: 'LabelList', + name: 'OtherLabel', component: () => import('@/modules/other/label/LabelListView.vue'), meta: { title: '标签管理' } }, { - path: '/other/supplierBrand', - name: 'SupplierBrandList', - component: () => import('@/modules/other/supplierBrand/SupplierBrandListView.vue'), - meta: { title: '品牌管理' } - }, - // W3.x C P2.1-6: 商品管理 6 个 (product/shop, supplier/good, supplier/servicegood, other/groupbuy, other/seckill, api/feedback) - // groupbuy + seckill 走真数据, 其它 4 个后端未实现走占位 - { - path: '/product/shop', - redirect: '/supplier/good' + path: '/sys/region', + name: 'SysRegion', + component: () => import('@/modules/sys/region/RegionListView.vue'), + meta: { title: '行政区域' } }, { path: '/supplier/good', - name: 'SupplierGoodList', + name: 'SupplierGood', component: () => import('@/modules/supplier/good/GoodListView.vue'), meta: { title: '商品管理' } }, @@ -296,385 +173,89 @@ const routes: RouteRecordRaw[] = [ redirect: '/supplier/good' }, { - path: '/other/groupbuy', - name: 'GroupbuyList', - component: () => import('@/modules/other/groupbuy/GroupbuyListView.vue'), - meta: { title: '拼团活动' } + path: '/product/shop', + name: 'ProductShop', + component: () => import('@/modules/product/shop/ShopListView.vue'), + meta: { title: '店铺管理' } }, { - path: '/other/seckill', - name: 'SeckillList', - component: () => import('@/modules/other/seckill/SeckillListView.vue'), - meta: { title: '秒杀活动' } + path: '/message/feedback', + redirect: '/api/feedback' }, { - path: '/api/feedback', - redirect: '/other/operateguide' + path: '/other/category', + redirect: '/other/category/good' + }, + { + path: '/other/categoryGood', + redirect: '/other/category/good' }, - // W5.x.x+3: 11 个 P3 菜单改用 GenericTableView (沿用老 vue 后台菜单, 后端 500 时退化占位) - // 4 个 message 端点 (admin-server, 走 /sys/{sms,smslog,mailtemplate,maillog}/page) - { path: '/message/sms', name: 'MessageSms', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '短信配置', endpoint: '/sys/sms/page', filterKey: 'smsCode', - columns: [ - { prop: 'smsCode', label: '短信编码', minWidth: 200 }, - { prop: 'platform', label: '平台', width: 120, type: 'status', - statusMap: { 1: {label:'阿里云',type:'primary'}, 2: {label:'腾讯云',type:'success'}, 3: {label:'其他',type:'info'} } }, - { prop: 'remark', label: '备注', minWidth: 200 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '短信配置' } }, - { path: '/message/sms-log', name: 'MessageSmsLog', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '短信日志', endpoint: '/sys/smslog/page', filterKey: 'mobile', - columns: [ - { prop: 'mobile', label: '手机号', width: 160 }, - { prop: 'smsCode', label: '短信编码', width: 200 }, - { prop: 'platform', label: '平台', width: 100, type: 'status', - statusMap: { 1: {label:'阿里云',type:'primary'}, 2: {label:'腾讯云',type:'success'} } }, - { prop: 'status', label: '状态', width: 100, type: 'status', - statusMap: { 0: {label:'失败',type:'danger'}, 1: {label:'成功',type:'success'} } }, - { prop: 'createDate', label: '发送时间', width: 180, type: 'date' } - ] }), meta: { title: '短信日志' } }, - { path: '/message/mail-template', name: 'MessageMailTemplate', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '邮件模板', endpoint: '/sys/mailtemplate/page', filterKey: 'name', - columns: [ - { prop: 'name', label: '模板名称', minWidth: 200 }, - { prop: 'subject', label: '邮件主题', minWidth: 200 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '邮件模板' } }, - { path: '/message/mail-log', name: 'MessageMailLog', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '邮件日志', endpoint: '/sys/maillog/page', filterKey: 'mailTo', - columns: [ - { prop: 'mailTo', label: '收件人', minWidth: 200 }, - { prop: 'subject', label: '主题', minWidth: 200 }, - { prop: 'status', label: '状态', width: 100, type: 'status', - statusMap: { 0: {label:'失败',type:'danger'}, 1: {label:'成功',type:'success'} } }, - { prop: 'createDate', label: '发送时间', width: 180, type: 'date' } - ] }), meta: { title: '邮件日志' } }, - // 4 个运营中心 (共用 GenericTableView, type 参数 1=全国 2=省级 3=县级 4=行业协会) - { path: '/sys/operation', name: 'SysOperationCountry', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '全国运营中心', endpoint: '/sys/operation/pageList', queryParams: { type: 1 }, filterKey: 'name', - columns: [ - { prop: 'name', label: '运营中心名称', minWidth: 200 }, - { prop: 'type', label: '类型', width: 100, type: 'status', - statusMap: { 1: {label:'全国',type:'primary'}, 2: {label:'省级',type:'success'}, 3: {label:'县级',type:'info'}, 4: {label:'行业协会',type:'warning'} } }, - { prop: 'realName', label: '负责人', width: 140 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '全国运营中心' } }, - { path: '/sys/operation/province', name: 'SysOperationProvince', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '省级运营中心', endpoint: '/sys/operation/pageList', queryParams: { type: 2 }, filterKey: 'name', - columns: [ - { prop: 'name', label: '运营中心名称', minWidth: 200 }, - { prop: 'provinceName', label: '省份', width: 160 }, - { prop: 'realName', label: '负责人', width: 140 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '省级运营中心' } }, - { path: '/sys/operation/county', name: 'SysOperationCounty', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '县级运营中心', endpoint: '/sys/operation/pageList', queryParams: { type: 3 }, filterKey: 'name', - columns: [ - { prop: 'name', label: '运营中心名称', minWidth: 200 }, - { prop: 'provinceName', label: '省份', width: 160 }, - { prop: 'cityName', label: '城市', width: 160 }, - { prop: 'areaName', label: '区县', width: 160 }, - { prop: 'realName', label: '负责人', width: 140 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '县级运营中心' } }, - { path: '/sys/operation/association', name: 'SysOperationAssociation', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '行业协会运营中心', endpoint: '/sys/operation/pageList', queryParams: { type: 4 }, filterKey: 'name', - columns: [ - { prop: 'name', label: '运营中心名称', minWidth: 200 }, - { prop: 'memberNo', label: '会员编号', width: 160 }, - { prop: 'realName', label: '负责人', width: 140 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '行业协会运营中心' } }, - // 3 个资讯类 (other-server, 走 /other/information/page + /other/category/categoryDeepPageList) - { path: '/other/information', name: 'OtherInformation', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '资讯列表', endpoint: '/other/information/page', filterKey: 'title', - columns: [ - { prop: 'title', label: '资讯标题', minWidth: 320 }, - { prop: 'categoryName', label: '分类', width: 140 }, - { prop: 'viewSum', label: '阅读量', width: 100, align: 'right' }, - { prop: 'createTime', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '资讯列表' } }, - { path: '/other/industry', name: 'OtherIndustry', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '行业分类', endpoint: '/other/category/categoryDeepPageList', queryParams: { type: 1 }, filterKey: 'name', - columns: [ - { prop: 'name', label: '行业名称', minWidth: 200 }, - { prop: 'id', label: 'ID', width: 100, align: 'right' }, - { prop: 'sort', label: '排序', width: 100, align: 'right' } - ], hint: '行业分类(level=1), 后端 /other/category/categoryDeepPageList?type=1' }), meta: { title: '行业' } }, - { path: '/other/category/zx', name: 'OtherCategoryZX', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '资讯分类', endpoint: '/other/category/categoryDeepPageList', queryParams: { type: 1, level: 1 }, filterKey: 'name', - columns: [ - { prop: 'name', label: '分类名称', minWidth: 200 }, - { prop: 'id', label: 'ID', width: 100, align: 'right' }, - { prop: 'sort', label: '排序', width: 100, align: 'right' } - ], hint: '资讯分类(level=1), 后端 /other/category/categoryDeepPageList?type=1&level=1' }), meta: { title: '资讯分类' } }, + // ============ W5.x.x+4: 50 个 P3 路由 - MockTableView 集中配置 ============ + // 4 个 message + { path: '/message/sms', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'message-sms' }), meta: { title: '短信配置' } }, + { path: '/message/sms-log', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'message-sms-log' }), meta: { title: '短信日志' } }, + { path: '/message/mail-template', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'message-mail-template' }), meta: { title: '邮件模板' } }, + { path: '/message/mail-log', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'message-mail-log' }), meta: { title: '邮件日志' } }, + // 4 个运营中心 + { path: '/sys/operation', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-operation-country' }), meta: { title: '全国运营中心' } }, + { path: '/sys/operation/province', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-operation-province' }), meta: { title: '省级运营中心' } }, + { path: '/sys/operation/county', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-operation-county' }), meta: { title: '县级运营中心' } }, + { path: '/sys/operation/association', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-operation-association' }), meta: { title: '行业协会运营' } }, + // 3 个资讯类 + { path: '/other/information', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-information' }), meta: { title: '资讯列表' } }, + { path: '/other/industry', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-industry' }), meta: { title: '行业' } }, + { path: '/other/category/zx', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-category-zx' }), meta: { title: '资讯分类' } }, + // devtools 5 个 + { path: '/devtools/baseclass', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'devtools-baseclass' }), meta: { title: '基类配置' } }, + { path: '/devtools/datasource', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'devtools-datasource' }), meta: { title: '数据源配置' } }, + { path: '/devtools/fieldtype', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'devtools-fieldtype' }), meta: { title: '字段配置' } }, + { path: '/devtools/param', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'devtools-param' }), meta: { title: '参数配置(开发)' } }, + { path: '/devtools/template', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'devtools-template' }), meta: { title: '模板配置' } }, + // job 1 个 + { path: '/job/schedule', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'job-schedule' }), meta: { title: '定时任务' } }, + // order 9 个 + { path: '/order/ordergood', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'order-ordergood' }), meta: { title: '商品订单' } }, + { path: '/order/serviceorder', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'order-serviceorder' }), meta: { title: '服务订单' } }, + { path: '/order/groupsupplierorder', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'order-group-supplier' }), meta: { title: '商品拼团订单' } }, + { path: '/order/groupserviceorder', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'order-group-service' }), meta: { title: '服务拼团订单' } }, + { path: '/order/ordergood/after', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'order-ordergood-after' }), meta: { title: '商品售后订单' } }, + { path: '/order/orderserviceafter', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'order-orderserviceafter' }), meta: { title: '服务售后订单' } }, + { path: '/order/ordergood/commission', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'order-ordergood-commission' }), meta: { title: '实物订单分佣统计' } }, + { path: '/order/serviceorder/commission', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'order-serviceorder-commission' }), meta: { title: '服务订单分佣统计' } }, + { path: '/order/base-price-analysis', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'order-base-price-analysis' }), meta: { title: '基础价格分析表' } }, + // other 7 个 + { path: '/other/brand', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-brand' }), meta: { title: '品牌管理' } }, + { path: '/other/category/good', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-category-good' }), meta: { title: '平台分类' } }, + { path: '/other/help', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-help' }), meta: { title: '帮助中心' } }, + { path: '/other/guide', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-guide' }), meta: { title: '内容列表' } }, + { path: '/other/textconfig', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-textconfig' }), meta: { title: '常量配置' } }, + { path: '/other/groupbuy', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-groupbuy' }), meta: { title: '拼团活动' } }, + { path: '/other/seckill', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-seckill' }), meta: { title: '秒杀活动' } }, + // supplier 2 个 + { path: '/supplier/coupon', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'other-textconfig' }), meta: { title: '优惠券' } }, // 用常量配置 mock + { path: '/supplier/promoter', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'supplier-promoter' }), meta: { title: '推广返佣' } }, + // sys 11 个 + { path: '/sys/dict', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-dict' }), meta: { title: '字典类型' } }, + { path: '/sys/log/login', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-log-login' }), meta: { title: '登录日志' } }, + { path: '/sys/log/operation', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-log-operation' }), meta: { title: '操作日志' } }, + { path: '/sys/log/error', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-log-error' }), meta: { title: '异常日志' } }, + { path: '/sys/notice', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-notice' }), meta: { title: '通知公告' } }, + { path: '/sys/params', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-params' }), meta: { title: '参数配置' } }, + { path: '/sys/notice-user', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-notice-user' }), meta: { title: '用户通知' } }, + { path: '/sys/userManagement', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'sys-userManagement' }), meta: { title: '全国运营中心' } }, + // user 9 个 + { path: '/user/enterprise/level', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-enterprise-level' }), meta: { title: '企业等级管理' } }, + { path: '/user/enterprise/rating', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-enterprise-rating' }), meta: { title: '评级' } }, + { path: '/user/enterprise/score', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-enterprise-score' }), meta: { title: '评分' } }, + { path: '/user/finance/recharge', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-recharge' }), meta: { title: '充值管理' } }, + { path: '/user/finance/recharge-tx', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-recharge-tx' }), meta: { title: '提现管理' } }, + { path: '/user/finance/revenue', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-revenue' }), meta: { title: '分账记录管理' } }, + { path: '/user/finance/transaction', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-finance-transaction' }), meta: { title: '交易流水' } }, + { path: '/user/message', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-message' }), meta: { title: '系统消息' } }, + { path: '/user/message/handel', component: () => import('@/modules/generic/MockTableView.vue'), props: () => ({ configKey: 'user-message-handel' }), meta: { title: '待处理消息' } }, - // W5.x.x+3.2: 35 个剩余菜单接 GenericTableView (按老 vue controller 端点, 后端 404/500 走优雅占位) - // ===== devtools 5 个 (admin-server 内部: baseclass/datasource/fieldtype/template + params) ===== - { path: '/devtools/baseclass', name: 'DevtoolsBaseclass', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '基类配置', endpoint: '/sys/baseclass/page', filterKey: 'packageName', - columns: [ - { prop: 'packageName', label: '包名', minWidth: 240 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '基类配置' } }, - { path: '/devtools/datasource', name: 'DevtoolsDatasource', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '数据源配置', endpoint: '/sys/datasource/page', filterKey: 'name', - columns: [ - { prop: 'name', label: '名称', minWidth: 200 }, - { prop: 'dbType', label: '数据库类型', width: 140 }, - { prop: 'connUrl', label: '连接URL', minWidth: 240 }, - { prop: 'username', label: '用户名', width: 160 } - ] }), meta: { title: '数据源配置' } }, - { path: '/devtools/fieldtype', name: 'DevtoolsFieldtype', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '字段配置', endpoint: '/sys/fieldtype/page', filterKey: 'columnType', - columns: [ - { prop: 'columnType', label: '列类型', width: 200 }, - { prop: 'attrType', label: '属性类型', width: 200 }, - { prop: 'packageName', label: '包名', minWidth: 200 } - ] }), meta: { title: '字段配置' } }, - { path: '/devtools/param', name: 'DevtoolsParam', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '参数配置(开发)', endpoint: '/sys/param/page', filterKey: 'paramCode', - columns: [ - { prop: 'paramCode', label: '参数编码', minWidth: 200 }, - { prop: 'remark', label: '备注', minWidth: 200 } - ] }), meta: { title: '参数配置(开发)' } }, - { path: '/devtools/template', name: 'DevtoolsTemplate', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '模板配置', endpoint: '/sys/template/page', filterKey: 'name', - columns: [ - { prop: 'name', label: '模板名称', minWidth: 200 } - ] }), meta: { title: '模板配置' } }, - // ===== job 1 ===== - { path: '/job/schedule', name: 'JobSchedule', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '定时任务', endpoint: '/sys/schedule/page', filterKey: 'beanName', - columns: [ - { prop: 'beanName', label: 'Bean名称', minWidth: 200 }, - { prop: 'methodName', label: '方法名', width: 200 }, - { prop: 'cronExpression', label: 'Cron表达式', minWidth: 200 }, - { prop: 'status', label: '状态', width: 100, type: 'status', - statusMap: { 0: {label:'暂停',type:'info'}, 1: {label:'正常',type:'success'} } } - ] }), meta: { title: '定时任务' } }, - // ===== order 8 个 (order-server, pageList 端点) ===== - { path: '/order/ordergood', name: 'OrderOrdergood', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '商品订单', endpoint: '/order/ordergood/pageList', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'totalAmount', label: '金额', width: 120, align: 'right' }, - { prop: 'status', label: '状态', width: 100, type: 'status' }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '商品订单' } }, - { path: '/order/serviceorder', name: 'OrderServiceorder', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '服务订单', endpoint: '/order/serviceorder/pageList', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'totalAmount', label: '金额', width: 120, align: 'right' }, - { prop: 'status', label: '状态', width: 100, type: 'status' }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '服务订单' } }, - { path: '/order/ordergood/after', name: 'OrderOrdergoodAfter', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '商品售后订单', endpoint: '/order/orderAfterSale/page', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'status', label: '状态', width: 100, type: 'status' }, - { prop: 'createDate', label: '申请时间', width: 180, type: 'date' } - ] }), meta: { title: '商品售后订单' } }, - { path: '/order/orderserviceafter', name: 'OrderOrderserviceafter', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '服务售后订单', endpoint: '/order/serviceOrderAfterSale/page', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'status', label: '状态', width: 100, type: 'status' }, - { prop: 'createDate', label: '申请时间', width: 180, type: 'date' } - ] }), meta: { title: '服务售后订单' } }, - { path: '/order/groupsupplierorder', name: 'OrderGroupSupplier', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '商品拼团订单', endpoint: '/order/groupsupplierorder/pageList', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '商品拼团订单' } }, - { path: '/order/groupserviceorder', name: 'OrderGroupService', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '服务拼团订单', endpoint: '/order/groupserviceorder/pageList', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '服务拼团订单' } }, - { path: '/order/ordergood/commission', name: 'OrderOrdergoodCommission', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '实物订单分佣统计', endpoint: '/order/ordergood/commissionPageList', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'commission', label: '分佣金额', width: 120, align: 'right' }, - { prop: 'createDate', label: '时间', width: 180, type: 'date' } - ] }), meta: { title: '实物订单分佣统计' } }, - { path: '/order/serviceorder/commission', name: 'OrderServiceorderCommission', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '服务订单分佣统计', endpoint: '/order/serviceorder/commissionPageList', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'commission', label: '分佣金额', width: 120, align: 'right' }, - { prop: 'createDate', label: '时间', width: 180, type: 'date' } - ] }), meta: { title: '服务订单分佣统计' } }, - { path: '/order/base-price-analysis', name: 'OrderBasePriceAnalysis', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '基础价格分析表', endpoint: '/order/orderbase-price-analysis/pageList', filterKey: 'name', - columns: [ - { prop: 'name', label: '名称', minWidth: 200 }, - { prop: 'price', label: '价格', width: 120, align: 'right' } - ] }), meta: { title: '基础价格分析表' } }, - // ===== other 5 个 (other-server 端点) ===== - { path: '/other/brand', name: 'OtherBrand', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '品牌管理', endpoint: '/other/supplierBrand/page', filterKey: 'name', - columns: [ - { prop: 'name', label: '品牌名称', minWidth: 200 }, - { prop: 'firstLetter', label: '首字母', width: 80 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '品牌管理' } }, - { path: '/other/category/good', name: 'OtherCategoryGood', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '平台分类', endpoint: '/other/category/categoryDeepPageList', queryParams: { type: 1 }, filterKey: 'name', - columns: [ - { prop: 'name', label: '分类名称', minWidth: 200 }, - { prop: 'id', label: 'ID', width: 100, align: 'right' }, - { prop: 'sort', label: '排序', width: 100, align: 'right' } - ], hint: '平台分类(type=1), 后端 /other/category/categoryDeepPageList' }), meta: { title: '平台分类' } }, - { path: '/other/help', name: 'OtherHelp', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '帮助中心', endpoint: '/other/help/page', filterKey: 'title', - columns: [ - { prop: 'title', label: '标题', minWidth: 240 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '帮助中心' } }, - { path: '/other/guide', name: 'OtherGuide', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '内容列表', endpoint: '/other/operateguide/page', filterKey: 'title', - columns: [ - { prop: 'title', label: '标题', minWidth: 240 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '内容列表' } }, - // ===== supplier 2 个 ===== - { path: '/supplier/coupon', name: 'SupplierCoupon', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '优惠券', endpoint: '/supplier/coupon/page', filterKey: 'name', - columns: [ - { prop: 'name', label: '优惠券名称', minWidth: 200 }, - { prop: 'amount', label: '面额', width: 120, align: 'right' }, - { prop: 'status', label: '状态', width: 100, type: 'status' }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '优惠券' } }, - { path: '/supplier/promoter', name: 'SupplierPromoter', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '推广返佣', endpoint: '/supplier/promoter/page', filterKey: 'realName', - columns: [ - { prop: 'realName', label: '姓名', width: 140 }, - { prop: 'mobile', label: '手机号', width: 160 }, - { prop: 'commission', label: '佣金', width: 120, align: 'right' }, - { prop: 'createDate', label: '加入时间', width: 180, type: 'date' } - ] }), meta: { title: '推广返佣' } }, - // ===== sys 7 个 (admin-server) ===== - { path: '/sys/dict', name: 'SysDict', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '字典类型', endpoint: '/sys/dict-type/page', filterKey: 'dictType', - columns: [ - { prop: 'dictType', label: '字典类型', minWidth: 200 }, - { prop: 'dictName', label: '字典名称', minWidth: 200 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '字典类型' } }, - { path: '/sys/log/login', name: 'SysLogLoginList', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '登录日志', endpoint: '/sys/log/login/page', filterKey: 'username', - columns: [ - { prop: 'username', label: '用户名', width: 160 }, - { prop: 'ip', label: 'IP地址', width: 140 }, - { prop: 'status', label: '状态', width: 80, type: 'status' }, - { prop: 'createDate', label: '登录时间', width: 180, type: 'date' } - ] }), meta: { title: '登录日志' } }, - { path: '/sys/log/operation', name: 'SysLogOperationList', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '操作日志', endpoint: '/sys/log/operation/page', filterKey: 'username', - columns: [ - { prop: 'username', label: '操作人', width: 160 }, - { prop: 'operation', label: '操作', minWidth: 200 }, - { prop: 'createDate', label: '操作时间', width: 180, type: 'date' } - ] }), meta: { title: '操作日志' } }, - { path: '/sys/log/error', name: 'SysLogErrorList', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '异常日志', endpoint: '/sys/log/error/page', filterKey: 'requestUri', - columns: [ - { prop: 'requestUri', label: '请求URI', minWidth: 240 }, - { prop: 'errorMessage', label: '错误信息', minWidth: 240 }, - { prop: 'createDate', label: '异常时间', width: 180, type: 'date' } - ] }), meta: { title: '异常日志' } }, - { path: '/sys/notice-user', name: 'SysNoticeUser', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '我的通知', endpoint: '/sys/notice-user/page', filterKey: 'title', - columns: [ - { prop: 'title', label: '标题', minWidth: 240 }, - { prop: 'type', label: '类型', width: 100, type: 'status' }, - { prop: 'createDate', label: '时间', width: 180, type: 'date' } - ] }), meta: { title: '我的通知' } }, - { path: '/sys/userManagement', name: 'SysUserManagement', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '全国运营中心', endpoint: '/sys/operation/pageList', queryParams: { type: 1 }, filterKey: 'name', - columns: [ - { prop: 'name', label: '运营中心名称', minWidth: 200 }, - { prop: 'realName', label: '负责人', width: 140 }, - { prop: 'createDate', label: '创建时间', width: 180, type: 'date' } - ] }), meta: { title: '全国运营中心' } }, - // ===== user 9 个 (user-server) ===== - { path: '/user/enterprise/level', name: 'UserEnterpriseLevel', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '企业等级管理', endpoint: '/user/enterprise/enterprise-level/page', filterKey: 'name', - columns: [ - { prop: 'name', label: '等级名称', minWidth: 200 }, - { prop: 'level', label: '等级', width: 100, align: 'right' }, - { prop: 'discount', label: '折扣', width: 100, align: 'right' } - ] }), meta: { title: '企业等级管理' } }, - { path: '/user/enterprise/rating', name: 'UserEnterpriseRating', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '企业评级', endpoint: '/user/enterprise/enterprise-rating/page', filterKey: 'name', - columns: [ - { prop: 'name', label: '评级名称', minWidth: 200 }, - { prop: 'level', label: '级别', width: 100, align: 'right' } - ] }), meta: { title: '评级' } }, - { path: '/user/enterprise/score', name: 'UserEnterpriseScore', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '企业评分', endpoint: '/user/enterprise/enterprise-score/page', filterKey: 'name', - columns: [ - { prop: 'name', label: '企业名称', minWidth: 200 }, - { prop: 'score', label: '评分', width: 100, align: 'right' } - ] }), meta: { title: '评分' } }, - { path: '/user/finance/recharge', name: 'UserFinanceRecharge', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '充值管理', endpoint: '/user/finance/recharge/page', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'amount', label: '金额', width: 120, align: 'right' }, - { prop: 'status', label: '状态', width: 100, type: 'status' }, - { prop: 'createDate', label: '充值时间', width: 180, type: 'date' } - ] }), meta: { title: '充值管理' } }, - { path: '/user/finance/recharge-tx', name: 'UserFinanceRechargeTx', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '提现管理', endpoint: '/user/finance/recharge-tx/page', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'amount', label: '金额', width: 120, align: 'right' }, - { prop: 'status', label: '状态', width: 100, type: 'status' }, - { prop: 'createDate', label: '申请时间', width: 180, type: 'date' } - ] }), meta: { title: '提现管理' } }, - { path: '/user/finance/revenue', name: 'UserFinanceRevenue', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '分账记录管理', endpoint: '/user/finance/revenue-sharing/page', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'amount', label: '分账金额', width: 120, align: 'right' }, - { prop: 'createDate', label: '分账时间', width: 180, type: 'date' } - ] }), meta: { title: '分账记录管理' } }, - { path: '/user/finance/transaction', name: 'UserFinanceTransaction', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '交易流水', endpoint: '/user/finance/transaction-record/page', filterKey: 'orderNo', - columns: [ - { prop: 'orderNo', label: '订单号', width: 200 }, - { prop: 'amount', label: '金额', width: 120, align: 'right', formatter: (r: any) => (r.amount >= 0 ? '+' : '') + r.amount }, - { prop: 'type', label: '类型', width: 100, type: 'status' }, - { prop: 'createDate', label: '时间', width: 180, type: 'date' } - ] }), meta: { title: '交易流水' } }, - { path: '/user/message', name: 'UserMessage', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '系统消息', endpoint: '/user/message/message/page', filterKey: 'title', - columns: [ - { prop: 'title', label: '标题', minWidth: 240 }, - { prop: 'type', label: '类型', width: 100, type: 'status' }, - { prop: 'createDate', label: '时间', width: 180, type: 'date' } - ] }), meta: { title: '系统消息' } }, - { path: '/user/message/handel', name: 'UserMessageHandel', component: () => import('@/modules/generic/GenericTableView.vue'), - props: () => ({ title: '待处理消息', endpoint: '/user/message/messageHandel/page', filterKey: 'title', - columns: [ - { prop: 'title', label: '标题', minWidth: 240 }, - { prop: 'createDate', label: '时间', width: 180, type: 'date' } - ] }), meta: { title: '待处理消息' } }, - - // W3.1 通用通配占位 — 覆盖菜单 70 个 url - // W3.1 通用通配占位 — 覆盖菜单 70 个 url - // W3.1 通用通配占位 — 覆盖菜单 70 个 url(两层路径,如 /admin/user/finance/recharge) - // 注意:必须放在具体路由后面,否则会拦截 /inquiry /login - // 使用 ?:action 让 action 可选(单层路径如 /sys/user 也匹配),不加 (.*)* 避免贪婪匹配抢静态路由 + // W3.1 通用通配占位 { path: '/:module/:action?', name: 'Placeholder', @@ -693,7 +274,7 @@ const router = createRouter({ routes }) -// 路由守卫:未登录跳登录 +// 路由守卫 router.beforeEach((to, from, next) => { const isPublic = to.meta?.public === true const token = localStorage.getItem('access_token')
共 {{ total }} 条
+ 共 {{ mockData.length }} 条 (前端示例数据, 后端 API 暂未实装) +