🔱: [client] sync upgrade with 3 commits [trident-sync]

perf: dict.getNodesByValues 修改为单例模式也可以运行,无需配置prototype,优化性能
chore: 各ui支持table-select
This commit is contained in:
GitHub Actions Bot
2023-09-09 19:24:09 +00:00
parent 9788aefcc1
commit 8701303012
98 changed files with 322 additions and 99 deletions
+25 -7
View File
@@ -39,6 +39,17 @@ function findById(id: any, list: any) {
}
}
}
function findByIds(ids: any[], list: any) {
const res = [];
for (const id of ids) {
const item = findById(id, list);
if (item != null) {
res.push(item);
}
}
console.log("findbyids", res, ids);
return res;
}
const mockUtil: any = {
findById,
buildMock(options: any) {
@@ -173,13 +184,7 @@ const mockUtil: any = {
handle(req: any) {
let id = req.params.id;
id = parseInt(id);
let current = null;
for (const item of list) {
if (item.id === id) {
current = item;
break;
}
}
const current = findById(req.body.id, list);
return {
code: 0,
msg: "success",
@@ -187,6 +192,19 @@ const mockUtil: any = {
};
}
},
{
path: "/mock/" + name + "/byIds",
method: "post",
handle(req: any) {
const ids = req.body.ids;
const res = findByIds(ids, list);
return {
code: 0,
msg: "success",
data: res
};
}
},
{
path: "/mock/" + name + "/add",
method: "post",