mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 04:57:28 +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 ShowCase from '../ShowCase';
|
||||
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 = {
|
||||
token?: string;
|
||||
@@ -377,6 +382,7 @@ const Chat: ForwardRefRenderFunction<any, Props> = (
|
||||
});
|
||||
|
||||
return (
|
||||
<ConfigProvider locale={locale}>
|
||||
<div className={chatClass}>
|
||||
<div className={styles.chatSection}>
|
||||
{!isMobile && agentList.length > 1 && agentListVisible && (
|
||||
@@ -511,6 +517,7 @@ const Chat: ForwardRefRenderFunction<any, Props> = (
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</ConfigProvider>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -9,8 +9,13 @@ import MarkDown from '../ChatMsg/MarkDown';
|
||||
import classNames from 'classnames';
|
||||
import { isMobile } from '../../utils/utils';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import locale from 'antd/locale/zh_CN';
|
||||
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
|
||||
|
||||
import 'dayjs/locale/zh-cn';
|
||||
|
||||
dayjs.extend(quarterOfYear);
|
||||
dayjs.locale('zh-cn');
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
@@ -257,24 +262,17 @@ const ParseTip: React.FC<Props> = ({
|
||||
<RangePicker
|
||||
value={[dayjs(startDate), dayjs(endDate)]}
|
||||
onChange={onDateInfoChange}
|
||||
format="YYYY/MM/DD"
|
||||
format="YYYY-MM-DD"
|
||||
renderExtraFooter={() => (
|
||||
<Row gutter={[28, 28]}>
|
||||
{Object.keys(ranges).map(key => (
|
||||
<Col key={key}>
|
||||
<label
|
||||
style={{
|
||||
backgroundColor: '#F0FDFF',
|
||||
borderColor: '#33BDFC',
|
||||
color: '#33BDFC',
|
||||
borderWidth: 1,
|
||||
borderStyle: 'solid',
|
||||
cursor: 'pointer',
|
||||
}}
|
||||
<Button
|
||||
size="small"
|
||||
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
|
||||
>
|
||||
{key}
|
||||
</label>
|
||||
</Button>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
Reference in New Issue
Block a user