You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
5 days ago
|
/*
|
||
|
* @Author: donghao donghao@supervision.ltd
|
||
|
* @Date: 2025-03-07 14:57:20
|
||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||
|
* @LastEditTime: 2025-03-14 15:11:04
|
||
|
* @FilePath: \5G-Loading-Bay-Web\mock\deviceStatus.ts
|
||
|
* @Description: 设备状态
|
||
|
*/
|
||
|
import { MockMethod } from "vite-plugin-mock";
|
||
|
import { deviceStatusListData, deviceHistoryListData } from "./pools/deviceStatusData";
|
||
|
import { fetchCurrPageByList, fetchMockSuccessFullByOther } from "./utils/apiMock";
|
||
|
|
||
|
export default [
|
||
|
{
|
||
|
url: "/api/v1/device/device/",
|
||
|
method: "post",
|
||
|
response: req => {
|
||
|
const { page, pageSize } = req.body;
|
||
|
// console.log(req);
|
||
|
return {
|
||
|
...fetchCurrPageByList({
|
||
|
...deviceStatusListData,
|
||
|
data: {
|
||
|
...deviceStatusListData.data,
|
||
|
page,
|
||
|
pageSize: pageSize || 10
|
||
|
}
|
||
|
})
|
||
|
};
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
url: "/api/v1/device/device_history/",
|
||
|
method: "post",
|
||
|
response: req => {
|
||
|
// console.log(req);
|
||
|
return {...fetchMockSuccessFullByOther(deviceHistoryListData)}
|
||
|
}
|
||
|
}
|
||
|
] as MockMethod[];
|