feat: fix time and collection pagination (#618)

* feat: fix time and collection pagination

* fix: timepicker read pretty

Co-authored-by: chenos <chenlinxh@gmail.com>
This commit is contained in:
金昶 2022-07-12 15:06:02 +08:00 committed by GitHub
parent 8e5334bc9d
commit 5f9d5436e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 10 deletions

View File

@ -285,8 +285,8 @@ export const useCreateActionAndRefreshCM = () => {
const { refreshCM } = useCollectionManager();
return {
async run() {
await run();
await refreshCM();
await run();
},
};
};
@ -296,8 +296,8 @@ export const useUpdateActionAndRefreshCM = () => {
const { refreshCM } = useCollectionManager();
return {
async run() {
await run();
await refreshCM();
await run();
},
};
};
@ -307,8 +307,8 @@ export const useDestroyActionAndRefreshCM = () => {
const { refreshCM } = useCollectionManager();
return {
async run() {
await run();
await refreshCM();
await run();
},
};
};
@ -318,8 +318,8 @@ export const useBulkDestroyActionAndRefreshCM = () => {
const { refreshCM } = useCollectionManager();
return {
async run() {
await run();
await refreshCM();
await run();
},
};
};

View File

@ -31,7 +31,7 @@ const useTableColumns = () => {
key: s.name,
render: (v, record) => {
const index = field.value?.indexOf(record);
console.log((Date.now() - start) / 1000);
// console.log((Date.now() - start) / 1000);
return (
<RecordIndexProvider index={index}>
<RecordProvider record={record}>

View File

@ -1,15 +1,17 @@
import { formatMomentValue, usePrefixCls } from '@formily/antd/lib/__builtins__';
import { isArr } from '@formily/shared';
import { usePrefixCls } from '@formily/antd/lib/__builtins__';
import { toArr } from '@formily/shared';
import { TimeRangePickerProps } from 'antd/lib/time-picker';
import cls from 'classnames';
import moment from 'moment';
import React from 'react';
export const ReadPretty: React.FC<TimeRangePickerProps> = (props: any) => {
const { placeholder } = props;
const { value, format = 'HH:mm:ss' } = props;
const prefixCls = usePrefixCls('description-text', props);
const values = toArr(value);
const getLabels = () => {
const labels = formatMomentValue(props.value, props.format, placeholder);
return isArr(labels) ? labels.join('~') : labels;
const labels = values.map((v) => moment(v, 'HH:mm:ss').format(format));
return labels.join('~');
};
return (
<div className={cls(prefixCls, props.className)} style={props.style}>