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

refactor: 1.13.4
perf: 服务端过滤示例
This commit is contained in:
GitHub Actions Bot
2023-05-06 19:24:02 +00:00
parent 49487419d2
commit c9ac5ae963
4 changed files with 52 additions and 11 deletions
@@ -27,8 +27,16 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
table: {
// 表头过滤改变事件
onFilterChange(e: any) {
console.log("onFilterChange", e);
onFilterChange(filters: any) {
console.log("onFilterChange", filters);
if (filters.remote != null) {
crudExpose.setSearchFormData({
form: {
remote: filters.remote
}
});
crudExpose.doRefresh();
}
}
},
columns: {
@@ -44,7 +52,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
}
},
radio: {
title: "状态",
title: "本地过滤",
search: { show: true },
type: "dict-radio",
dict: dict({
@@ -64,6 +72,26 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
sorter: (a: any, b: any) => a.radio - b.radio,
sortDirections: ["descend"]
}
},
remote: {
title: "支持服务端过滤",
search: {
show: true,
component: {
mode: "multiple"
}
},
type: "dict-radio",
dict: dict({
url: "/mock/dicts/OpenStatusEnum?single"
}),
column: {
filters: [
{ text: "开", value: "1" },
{ text: "关", value: "0" },
{ text: "停", value: "2" }
]
}
}
}
}
@@ -5,13 +5,16 @@ const options: any = {
};
const list = [
{
radio: "1"
radio: "1",
remote: "0"
},
{
radio: "2"
radio: "2",
remote: "1"
},
{
radio: "0"
radio: "0",
remote: "2"
}
];
options.list = list;