ai-manus/chat-client/mock/controller/WeeklySummary.js

33 lines
902 B
JavaScript
Raw Permalink Normal View History

2025-07-18 16:38:18 +08:00
const { mock } = require('mockjs')
const List = []
const count = 50
for (let i = 0; i < count; i++) {
List.push(
mock({
id: '@id',
weekperiod: '20250303-25050309',
title: '@title(1, 2)',
fileurl: '@title(1, 2)' + '.doc',
keytasksmonitoring: '@cname' + '.doc',
attachmenturls: '@title(1, 2)' + '.doc',
departmentnames: '@integer(300, 5000)',
})
)
}
module.exports = [
{
url: '/WeeklySummary/getList',
type: 'get',
response(config) {
const { title, pageNo = 1, pageSize = 20 } = config.query
const mockList = List.filter((item) => !(title && item.title.indexOf(title) < 0))
const list = mockList.filter((item, index) => index < pageSize * pageNo && index >= pageSize * (pageNo - 1))
return {
code: 200,
msg: 'success',
data: { list, ...{ total: mockList.length } },
}
},
},
]