mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
(improvement)(chat-sdk) set ant locale to zh-cn and optimize range picker style (#1489)
This commit is contained in:
@@ -22,7 +22,12 @@ import { HistoryMsgItemType, MsgDataType, SendMsgParamsType } from '../common/ty
|
|||||||
import { getHistoryMsg } from '../service';
|
import { getHistoryMsg } from '../service';
|
||||||
import ShowCase from '../ShowCase';
|
import ShowCase from '../ShowCase';
|
||||||
import { jsonParse } from '../utils/utils';
|
import { jsonParse } from '../utils/utils';
|
||||||
import { Drawer, Modal, Row, Col, Space, Switch, Tooltip } from 'antd';
|
import { ConfigProvider, Drawer, Modal, Row, Col, Space, Switch, Tooltip } from 'antd';
|
||||||
|
import locale from 'antd/locale/zh_CN';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import 'dayjs/locale/zh-cn';
|
||||||
|
|
||||||
|
dayjs.locale('zh-cn');
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
token?: string;
|
token?: string;
|
||||||
@@ -377,6 +382,7 @@ const Chat: ForwardRefRenderFunction<any, Props> = (
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<ConfigProvider locale={locale}>
|
||||||
<div className={chatClass}>
|
<div className={chatClass}>
|
||||||
<div className={styles.chatSection}>
|
<div className={styles.chatSection}>
|
||||||
{!isMobile && agentList.length > 1 && agentListVisible && (
|
{!isMobile && agentList.length > 1 && agentListVisible && (
|
||||||
@@ -511,6 +517,7 @@ const Chat: ForwardRefRenderFunction<any, Props> = (
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</ConfigProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,13 @@ import MarkDown from '../ChatMsg/MarkDown';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { isMobile } from '../../utils/utils';
|
import { isMobile } from '../../utils/utils';
|
||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
|
import locale from 'antd/locale/zh_CN';
|
||||||
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
|
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
|
||||||
|
|
||||||
|
import 'dayjs/locale/zh-cn';
|
||||||
|
|
||||||
dayjs.extend(quarterOfYear);
|
dayjs.extend(quarterOfYear);
|
||||||
|
dayjs.locale('zh-cn');
|
||||||
|
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
|
|
||||||
@@ -257,24 +262,17 @@ const ParseTip: React.FC<Props> = ({
|
|||||||
<RangePicker
|
<RangePicker
|
||||||
value={[dayjs(startDate), dayjs(endDate)]}
|
value={[dayjs(startDate), dayjs(endDate)]}
|
||||||
onChange={onDateInfoChange}
|
onChange={onDateInfoChange}
|
||||||
format="YYYY/MM/DD"
|
format="YYYY-MM-DD"
|
||||||
renderExtraFooter={() => (
|
renderExtraFooter={() => (
|
||||||
<Row gutter={[28, 28]}>
|
<Row gutter={[28, 28]}>
|
||||||
{Object.keys(ranges).map(key => (
|
{Object.keys(ranges).map(key => (
|
||||||
<Col key={key}>
|
<Col key={key}>
|
||||||
<label
|
<Button
|
||||||
style={{
|
size="small"
|
||||||
backgroundColor: '#F0FDFF',
|
|
||||||
borderColor: '#33BDFC',
|
|
||||||
color: '#33BDFC',
|
|
||||||
borderWidth: 1,
|
|
||||||
borderStyle: 'solid',
|
|
||||||
cursor: 'pointer',
|
|
||||||
}}
|
|
||||||
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
|
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
|
||||||
>
|
>
|
||||||
{key}
|
{key}
|
||||||
</label>
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
))}
|
))}
|
||||||
</Row>
|
</Row>
|
||||||
|
|||||||
Reference in New Issue
Block a user