mirror of
https://github.com/Dichgrem/Vue.git
synced 2026-02-05 04:31:56 -05:00
fix:css&&select
This commit is contained in:
@@ -148,8 +148,32 @@ function mockPlugin() {
|
||||
req.method === "GET"
|
||||
)
|
||||
return sendJSON("yearScore.json");
|
||||
if (pathname.startsWith("/api/service/list") && req.method === "GET")
|
||||
return sendJSON("serviceList.json");
|
||||
if (pathname.startsWith("/api/service/list") && req.method === "GET") {
|
||||
const sl = readJson("serviceList.json", {
|
||||
error: 0,
|
||||
data: { current: 1, pageSize: 10, pageCount: 1, list: [] },
|
||||
});
|
||||
const url = new URL(req.url, `http://${req.headers.host}`);
|
||||
const year = url.searchParams.get("year");
|
||||
let list = sl.data?.list || [];
|
||||
if (year && year !== "all") {
|
||||
const yearNum = Number(year);
|
||||
list = list.filter((item) => {
|
||||
const date = new Date(item.time);
|
||||
return date.getFullYear() === yearNum;
|
||||
});
|
||||
}
|
||||
const result = {
|
||||
error: 0,
|
||||
data: {
|
||||
...sl.data,
|
||||
list,
|
||||
current: 1,
|
||||
pageCount: 1,
|
||||
},
|
||||
};
|
||||
return send(res, result);
|
||||
}
|
||||
if (pathname.startsWith("/api/service/details") && req.method === "GET")
|
||||
return sendJSON("recordDetails.json");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user