Files
NapCatQQ/.pnpm-store/v3/files/e4/c73449aa885eb3e8ed9c7db4c73cca1e706f1d2e1329a969a4e503693dc58aed36334a1f00877223760cb380bdb7007e193ce364d79542fe974b14829d6c6c
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

38 lines
1.6 KiB
Plaintext

import { __assign } from "tslib";
export var fieldAdapter = function (field) {
return ({
getFieldInstance: function (name) { return field.getNames().includes(name); },
setFieldsValue: field.setValues,
getFieldsValue: field.getValues,
resetFields: field.resetToDefault,
validateFields: function (fields, callback) {
field.validate(fields, callback);
},
});
};
export var resultAdapter = function (result) {
var tableProps = {
dataSource: result.tableProps.dataSource,
loading: result.tableProps.loading,
onSort: function (dataIndex, order) {
var _a;
result.tableProps.onChange({ current: result.pagination.current, pageSize: result.pagination.pageSize }, (_a = result.params[0]) === null || _a === void 0 ? void 0 : _a.filters, {
field: dataIndex,
order: order,
});
},
onFilter: function (filterParams) {
var _a;
result.tableProps.onChange({ current: result.pagination.current, pageSize: result.pagination.pageSize }, filterParams, (_a = result.params[0]) === null || _a === void 0 ? void 0 : _a.sorter);
},
};
var paginationProps = {
onChange: result.pagination.changeCurrent,
onPageSizeChange: result.pagination.changePageSize,
current: result.pagination.current,
pageSize: result.pagination.pageSize,
total: result.pagination.total,
};
return __assign(__assign({}, result), { tableProps: tableProps, paginationProps: paginationProps });
};