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.
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
1 year ago
|
/*
|
||
|
* @Author: donghao donghao@supervision.ltd
|
||
|
* @Date: 2024-01-17 13:54:43
|
||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||
|
* @LastEditTime: 2024-03-20 14:50:57
|
||
|
* @FilePath: \General-AI-Platform-Web-Client\mock\alarm.ts
|
||
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||
|
*/
|
||
|
import { MockMethod } from "vite-plugin-mock";
|
||
|
import {
|
||
|
deviceSceneListData,
|
||
|
deviceSceneItemsData
|
||
|
} from "./pools/deviceSceneData";
|
||
|
import {
|
||
|
fetchCurrPageByList,
|
||
|
fetchMockSuccessFullByOther
|
||
|
} from "./utils/apiMock";
|
||
|
|
||
|
export default [
|
||
|
{
|
||
|
url: "/getDeviceSceneList",
|
||
|
method: "post",
|
||
|
response: () => {
|
||
|
return fetchMockSuccessFullByOther({ data: deviceSceneListData.data });
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
url: "/getDeviceSceneItemsList",
|
||
|
method: "post",
|
||
|
response: req => {
|
||
|
const { page, pageSize } = req.body;
|
||
|
// console.log(req);
|
||
|
return {
|
||
|
...fetchCurrPageByList({
|
||
|
...deviceSceneItemsData,
|
||
|
data: {
|
||
|
...deviceSceneItemsData.data,
|
||
|
page,
|
||
|
pageSize: pageSize || 10
|
||
|
}
|
||
|
})
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
] as MockMethod[];
|