234 lines
7.1 KiB
JavaScript
234 lines
7.1 KiB
JavaScript
|
|
export default [
|
||
|
|
{
|
||
|
|
url: '/api/users',
|
||
|
|
method: 'get',
|
||
|
|
response: () => {
|
||
|
|
return {
|
||
|
|
code: 200,
|
||
|
|
message: 'success',
|
||
|
|
data: [
|
||
|
|
{ id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin', status: 'Active' },
|
||
|
|
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'User', status: 'Inactive' },
|
||
|
|
{ id: 3, name: 'Bob Johnson', email: 'bob@example.com', role: 'Editor', status: 'Active' },
|
||
|
|
{ id: 4, name: 'Alice Williams', email: 'alice@example.com', role: 'User', status: 'Active' },
|
||
|
|
{ id: 5, name: 'Charlie Brown', email: 'charlie@example.com', role: 'User', status: 'Inactive' },
|
||
|
|
{ id: 6, name: 'David Miller', email: 'david@example.com', role: 'Admin', status: 'Active' },
|
||
|
|
{ id: 7, name: 'Eva Davis', email: 'eva@example.com', role: 'Editor', status: 'Active' },
|
||
|
|
{ id: 8, name: 'Frank Wilson', email: 'frank@example.com', role: 'User', status: 'Inactive' },
|
||
|
|
{ id: 9, name: 'Grace Taylor', email: 'grace@example.com', role: 'User', status: 'Active' },
|
||
|
|
{ id: 10, name: 'Henry Anderson', email: 'henry@example.com', role: 'User', status: 'Active' },
|
||
|
|
],
|
||
|
|
}
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
url: '/api/i18n/manifest',
|
||
|
|
method: 'get',
|
||
|
|
response: () => {
|
||
|
|
return {
|
||
|
|
code: 200,
|
||
|
|
message: 'success',
|
||
|
|
data: {
|
||
|
|
languages: [
|
||
|
|
{ code: 'en-US', name: 'English', version: '1.2' },
|
||
|
|
{ code: 'zh-CN', name: '简体中文', version: '1.3' }
|
||
|
|
]
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
url: '/api/i18n/lang/en-US',
|
||
|
|
method: 'get',
|
||
|
|
response: () => {
|
||
|
|
return {
|
||
|
|
code: 200,
|
||
|
|
message: 'success',
|
||
|
|
data: {
|
||
|
|
common: {
|
||
|
|
login: 'Sign in',
|
||
|
|
loginDesc: 'Enter your email below to login to your account',
|
||
|
|
email: 'Email',
|
||
|
|
password: 'Password',
|
||
|
|
submitLogin: 'Sign In',
|
||
|
|
loggingIn: 'Signing in...',
|
||
|
|
logout: 'Logout',
|
||
|
|
dashboard: 'Dashboard',
|
||
|
|
users: 'Users',
|
||
|
|
settings: 'Settings',
|
||
|
|
requisitions: 'Requisitions'
|
||
|
|
},
|
||
|
|
dashboard: {
|
||
|
|
title: 'Dashboard',
|
||
|
|
totalRevenue: 'Total Revenue',
|
||
|
|
subscriptions: 'Subscriptions',
|
||
|
|
sales: 'Sales',
|
||
|
|
activeNow: 'Active Now'
|
||
|
|
},
|
||
|
|
users: {
|
||
|
|
title: 'Users',
|
||
|
|
refresh: 'Refresh Data'
|
||
|
|
},
|
||
|
|
settings: {
|
||
|
|
title: 'Settings',
|
||
|
|
desc: 'System settings will be here.'
|
||
|
|
},
|
||
|
|
requisitions: {
|
||
|
|
title: 'Purchase Requisitions',
|
||
|
|
listTitle: 'Requisition List',
|
||
|
|
create: 'Create Requisition',
|
||
|
|
edit: 'Edit Requisition',
|
||
|
|
id: 'ID',
|
||
|
|
reqNo: 'Request No',
|
||
|
|
requester: 'Requester',
|
||
|
|
department: 'Department',
|
||
|
|
date: 'Date',
|
||
|
|
status: 'Status',
|
||
|
|
description: 'Description',
|
||
|
|
items: 'Items',
|
||
|
|
itemName: 'Item Name',
|
||
|
|
quantity: 'Quantity',
|
||
|
|
price: 'Price',
|
||
|
|
total: 'Total',
|
||
|
|
actions: 'Actions',
|
||
|
|
addItem: 'Add Item',
|
||
|
|
save: 'Save',
|
||
|
|
cancel: 'Cancel',
|
||
|
|
delete: 'Delete'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
url: '/api/i18n/lang/zh-CN',
|
||
|
|
method: 'get',
|
||
|
|
response: () => {
|
||
|
|
return {
|
||
|
|
code: 200,
|
||
|
|
message: 'success',
|
||
|
|
data: {
|
||
|
|
common: {
|
||
|
|
login: '登录',
|
||
|
|
loginDesc: '请输入您的邮箱登录账户',
|
||
|
|
email: '邮箱',
|
||
|
|
password: '密码',
|
||
|
|
submitLogin: '登录',
|
||
|
|
loggingIn: '登录中...',
|
||
|
|
logout: '退出登录',
|
||
|
|
dashboard: '仪表盘',
|
||
|
|
users: '用户管理',
|
||
|
|
settings: '系统设置',
|
||
|
|
requisitions: '请购单'
|
||
|
|
},
|
||
|
|
dashboard: {
|
||
|
|
title: '仪表盘',
|
||
|
|
totalRevenue: '总收入',
|
||
|
|
subscriptions: '订阅数',
|
||
|
|
sales: '销售额',
|
||
|
|
activeNow: '当前在线'
|
||
|
|
},
|
||
|
|
users: {
|
||
|
|
title: '用户管理',
|
||
|
|
refresh: '刷新数据'
|
||
|
|
},
|
||
|
|
settings: {
|
||
|
|
title: '系统设置',
|
||
|
|
desc: '这里将显示系统设置内容。'
|
||
|
|
},
|
||
|
|
requisitions: {
|
||
|
|
title: '请购单',
|
||
|
|
listTitle: '请购单列表',
|
||
|
|
create: '新建请购单',
|
||
|
|
edit: '编辑请购单',
|
||
|
|
id: 'ID',
|
||
|
|
reqNo: '单号',
|
||
|
|
requester: '申请人',
|
||
|
|
department: '部门',
|
||
|
|
date: '日期',
|
||
|
|
status: '状态',
|
||
|
|
description: '描述',
|
||
|
|
items: '明细项',
|
||
|
|
itemName: '物品名称',
|
||
|
|
quantity: '数量',
|
||
|
|
price: '单价',
|
||
|
|
total: '总价',
|
||
|
|
actions: '操作',
|
||
|
|
addItem: '添加明细',
|
||
|
|
save: '保存',
|
||
|
|
cancel: '取消',
|
||
|
|
delete: '删除'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// Requisition APIs
|
||
|
|
{
|
||
|
|
url: '/api/requisitions',
|
||
|
|
method: 'get',
|
||
|
|
response: () => {
|
||
|
|
// Generate some dummy data
|
||
|
|
return {
|
||
|
|
code: 200,
|
||
|
|
message: 'success',
|
||
|
|
data: [
|
||
|
|
{ id: 101, reqNo: 'PR-2023001', requester: 'John Doe', department: 'IT', date: '2023-10-25', status: 'Approved', totalAmount: 5000 },
|
||
|
|
{ id: 102, reqNo: 'PR-2023002', requester: 'Jane Smith', department: 'HR', date: '2023-10-26', status: 'Pending', totalAmount: 1200 },
|
||
|
|
{ id: 103, reqNo: 'PR-2023003', requester: 'Bob Johnson', department: 'Sales', date: '2023-10-27', status: 'Draft', totalAmount: 3500 },
|
||
|
|
]
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
url: '/api/requisitions/:id',
|
||
|
|
method: 'get',
|
||
|
|
response: ({ query }) => {
|
||
|
|
const id = query.id
|
||
|
|
return {
|
||
|
|
code: 200,
|
||
|
|
message: 'success',
|
||
|
|
data: {
|
||
|
|
id: id,
|
||
|
|
reqNo: 'PR-202300' + id,
|
||
|
|
requester: 'John Doe',
|
||
|
|
department: 'IT',
|
||
|
|
date: '2023-10-25',
|
||
|
|
status: 'Pending',
|
||
|
|
description: 'Purchase of new laptops for the development team.',
|
||
|
|
items: [
|
||
|
|
{ id: 1, itemName: 'MacBook Pro 16', quantity: 2, price: 2400 },
|
||
|
|
{ id: 2, itemName: 'Dell Monitor 27', quantity: 5, price: 300 }
|
||
|
|
]
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
url: '/api/requisitions',
|
||
|
|
method: 'post',
|
||
|
|
response: () => {
|
||
|
|
return {
|
||
|
|
code: 200,
|
||
|
|
message: 'success'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
url: '/api/menus',
|
||
|
|
method: 'get',
|
||
|
|
response: () => {
|
||
|
|
return {
|
||
|
|
code: 200,
|
||
|
|
message: 'success',
|
||
|
|
data: [
|
||
|
|
{ name: 'common.dashboard', path: '/', icon: 'LayoutDashboard' },
|
||
|
|
{ name: 'common.requisitions', path: '/requisitions', icon: 'FileText' },
|
||
|
|
{ name: 'common.users', path: '/users', icon: 'Users' },
|
||
|
|
{ name: 'common.settings', path: '/settings', icon: 'Settings' }
|
||
|
|
]
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
]
|