mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
🔱: [client] sync upgrade with 3 commits [trident-sync]
refactor: 1.13.4 perf: 服务端过滤示例
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user