mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:38:51 +00:00
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:
parent
8e5334bc9d
commit
5f9d5436e7
@ -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();
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -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}>
|
||||
|
@ -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}>
|
||||
|
Loading…
Reference in New Issue
Block a user