添加文件
This commit is contained in:
86
mock/store-inspection.ts
Normal file
86
mock/store-inspection.ts
Normal file
@@ -0,0 +1,86 @@
|
||||
import { MockMethod } from 'vite-plugin-mock'
|
||||
|
||||
const inspections = [
|
||||
{
|
||||
id: 1,
|
||||
storeName: '百年神厨 (格林店)',
|
||||
templateName: '2023 Q4 标准巡检模板',
|
||||
inspectors: ['陈经理', '张欣欣', '李雷', '韩梅梅'],
|
||||
date: '2023-10-20 13:00 至 2023-10-20 15:00',
|
||||
totalScore: 400.0,
|
||||
scoreRate: 50.5,
|
||||
rating: '非常的优秀',
|
||||
score: 200.0,
|
||||
totalDeduction: 199.0,
|
||||
naScore: 1,
|
||||
totalItems: 999,
|
||||
status: 'completed',
|
||||
modules: [
|
||||
{ name: '01 产品', rating: '非常的优秀', score: 20, deduction: 10, rate: 33.33 },
|
||||
{ name: '02 服务', rating: '优秀', score: 10, deduction: 100, rate: 50.00 },
|
||||
{ name: '03 安全', rating: 'B', score: 5, deduction: 10, rate: 33.33 },
|
||||
{ name: '04 生产生产', rating: 'C', score: 1, deduction: 5, rate: 83.41 },
|
||||
{ name: '05 内容显示', rating: 'D', score: 0, deduction: 10, rate: 100.00 },
|
||||
],
|
||||
redLine: {
|
||||
deduction: 12,
|
||||
total: 20
|
||||
},
|
||||
recheck: {
|
||||
lastIssues: 3,
|
||||
recurringIssues: 4,
|
||||
rate: 30
|
||||
},
|
||||
na: {
|
||||
count: 1,
|
||||
totalCount: 20,
|
||||
score: 5,
|
||||
totalScore: 100
|
||||
},
|
||||
additional: {
|
||||
suddenIssues: 18,
|
||||
highlights: 24
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
storeName: '百年神厨 (万达店)',
|
||||
templateName: '2023 Q4 标准巡检模板',
|
||||
inspectors: ['王督导'],
|
||||
date: '2023-10-21 09:00 至 2023-10-21 11:00',
|
||||
totalScore: 95.0,
|
||||
scoreRate: 95.0,
|
||||
rating: '优秀',
|
||||
status: 'pending'
|
||||
}
|
||||
]
|
||||
|
||||
export default [
|
||||
{
|
||||
url: '/api/inspections',
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return {
|
||||
code: 0,
|
||||
message: 'ok',
|
||||
data: inspections
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
url: '/api/inspections/detail',
|
||||
method: 'get',
|
||||
response: ({ query }: { query: any }) => {
|
||||
const id = Number(query.id)
|
||||
const item = inspections.find(i => i.id === id)
|
||||
if (!item) {
|
||||
return { code: 1, message: 'Inspection not found' }
|
||||
}
|
||||
return {
|
||||
code: 0,
|
||||
message: 'ok',
|
||||
data: item
|
||||
}
|
||||
}
|
||||
}
|
||||
] as MockMethod[]
|
||||
Reference in New Issue
Block a user