diff --git a/.eslintrc.js b/.eslintrc.js index 3ac39ef..ef691b4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,17 @@ module.exports = { - extends: [require.resolve('@umijs/lint/dist/config/eslint')], + extends: [ + require.resolve('@umijs/lint/dist/config/eslint'), + 'eslint:recommended', + 'plugin:react/recommended', + ], globals: { page: true, REACT_APP_ENV: true, }, + parser: '@typescript-eslint/parser', + plugins: ['react', '@typescript-eslint'], + rules: { + 'react/self-closing-comp': ['error'], + eqeqeq: 'off', + }, }; diff --git a/package.json b/package.json index 35229b1..0a07f69 100644 --- a/package.json +++ b/package.json @@ -49,9 +49,12 @@ "@ant-design/icons": "^5.0.1", "@ant-design/pro-components": "^2.3.57", "@ant-design/use-emotion-css": "1.0.4", + "@typescript-eslint/eslint-plugin": "^5.59.0", + "@typescript-eslint/parser": "^5.59.0", "@umijs/route-utils": "^4.0.1", "antd": "^5.2.2", "classnames": "^2.3.2", + "eslint-plugin-react": "^7.32.2", "lodash": "^4.17.21", "moment": "^2.29.4", "omit.js": "^2.0.2", @@ -94,4 +97,4 @@ "engines": { "node": ">=12.0.0" } -} \ No newline at end of file +} diff --git a/src/app.tsx b/src/app.tsx index a347094..4e59705 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -4,7 +4,7 @@ import { Settings as LayoutSettings } from '@ant-design/pro-components'; import type { RequestConfig, RunTimeLayoutConfig } from '@umijs/max'; import { history, Link } from '@umijs/max'; import { App } from 'antd'; -import React, { useEffect } from 'react'; +import React from 'react'; import defaultSettings from '../config/defaultSettings'; import AvatarSvg from '../public/avatar.svg'; import { AvatarDropdown, AvatarName } from './components/RightContent/AvatarDropdown'; @@ -54,15 +54,15 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = const { notification } = App.useApp(); window.NotificationCF = notification; - useEffect(() => { - // 小屏幕刷新页面 - // if (window.matchMedia) { - // const mql = window.matchMedia('(max-width: 768px)'); - // mql.addEventListener('change', () => { - // location.reload(); - // }); - // } - }, []); + // useEffect(() => { + // 小屏幕刷新页面 + // if (window.matchMedia) { + // const mql = window.matchMedia('(max-width: 768px)'); + // mql.addEventListener('change', () => { + // location.reload(); + // }); + // } + // }, []); return { // actionsRender: () => [, ], diff --git a/src/components/RightContent/EditPassWord.tsx b/src/components/RightContent/EditPassWord.tsx index c5332f4..3f5d745 100644 --- a/src/components/RightContent/EditPassWord.tsx +++ b/src/components/RightContent/EditPassWord.tsx @@ -42,16 +42,13 @@ const StrokeCheck: React.FC = (props) => { return (
-
-
-
-
-
+
+
+
+
+
{strokeColor.map((item) => { - return
; + return
; })}
); diff --git a/src/components/SearchBarPlugin/index.tsx b/src/components/SearchBarPlugin/index.tsx index 633477f..0ff6ba7 100644 --- a/src/components/SearchBarPlugin/index.tsx +++ b/src/components/SearchBarPlugin/index.tsx @@ -1,7 +1,7 @@ import { getDevice } from '@/services/utils'; import { Button, Drawer } from 'antd'; -import React, { useRef, useState } from 'react'; +import React, { useState } from 'react'; interface IProps { body: React.ReactNode; @@ -12,7 +12,7 @@ export const SearchBarPlugin: React.FC = (props) => { // const [device, setDevice] = useState(window.innerWidth); const isPhone = getDevice() === 'phone'; const [open, setOpen] = useState(false); - const [searchBarText, setSearchBarText] = useState('展开'); + // const [searchBarText, setSearchBarText] = useState('展开'); // useEffect(() => { // const handleResize = (e: any) => { // const currDevice = e && e.target && e.target.innerWidth; @@ -24,20 +24,20 @@ export const SearchBarPlugin: React.FC = (props) => { // window.addEventListener('optimizedResize', handleResize); // return () => window.removeEventListener('optimizedResize', handleResize); // }, [device]); - const searchBarContentRef = useRef(null); - const changeSearchbar = () => { - if (searchBarText === '展开') { - setSearchBarText('收起'); - searchBarContentRef.current.style.height = `${ - searchBarContentRef.current.children[0].clientHeight + 10 - }px`; - searchBarContentRef.current.style.transition = 'height .4s'; - } else { - setSearchBarText('展开'); - searchBarContentRef.current.style.height = `${isPhone ? 76 : 94}px`; - searchBarContentRef.current.style.transition = 'height .4s'; - } - }; + // const searchBarContentRef = useRef(null); + // const changeSearchbar = () => { + // if (searchBarText === '展开') { + // setSearchBarText('收起'); + // searchBarContentRef.current.style.height = `${ + // searchBarContentRef.current.children[0].clientHeight + 10 + // }px`; + // searchBarContentRef.current.style.transition = 'height .4s'; + // } else { + // setSearchBarText('展开'); + // searchBarContentRef.current.style.height = `${isPhone ? 76 : 94}px`; + // searchBarContentRef.current.style.transition = 'height .4s'; + // } + // }; return ( <> @@ -79,9 +79,9 @@ export const SearchBarPlugin: React.FC = (props) => { style={{ background: '#fff', padding: 16, paddingBottom: 0, borderRadius: 6 }} >
{props.body}
diff --git a/src/global.tsx b/src/global.tsx index 644a54c..e03801c 100644 --- a/src/global.tsx +++ b/src/global.tsx @@ -1,4 +1,5 @@ import { Button, message, notification } from 'antd'; +import React from 'react'; import defaultSettings from '../config/defaultSettings'; const { pwa } = defaultSettings; @@ -53,7 +54,7 @@ if (pwa) { return true; }; const key = `open${Date.now()}`; - const btn = ( + const btn: React.ReactNode = (
)}
- ) : ( - <> - ); + ) : null; })}
); diff --git a/src/pages/ChatLogs/GroupList.tsx b/src/pages/ChatLogs/GroupList.tsx index 69f82d9..19231c7 100644 --- a/src/pages/ChatLogs/GroupList.tsx +++ b/src/pages/ChatLogs/GroupList.tsx @@ -1,19 +1,17 @@ import { groupStatus } from '@/services/config'; import { DownOutlined, UpOutlined } from '@ant-design/icons'; -import { useEffect, useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { IGroup } from './ChatLogsType'; import { GroupIcon } from './ChatUtils'; import styles from './index.module.scss'; -type IGroupAvatar = { - avatar: string; - name: string; -}; + type IProps = { groupList: IGroup[]; searchWord: string; selectGroup: IGroup | undefined; - onClick: Function; - groupAvatar: {}; + // eslint-disable-next-line no-unused-vars + onClick: (arg0: IGroup) => any; + groupAvatar: any; }; type IGroupObj = { diff --git a/src/pages/ChatLogs/components/ChatAgreeOrNot.tsx b/src/pages/ChatLogs/components/ChatAgreeOrNot.tsx index 2057e22..06c45e1 100644 --- a/src/pages/ChatLogs/components/ChatAgreeOrNot.tsx +++ b/src/pages/ChatLogs/components/ChatAgreeOrNot.tsx @@ -1,3 +1,4 @@ +import React from 'react'; interface IProps { msg_type: string; } diff --git a/src/pages/ChatLogs/components/ChatBar.tsx b/src/pages/ChatLogs/components/ChatBar.tsx index dfd804f..fe4fd40 100644 --- a/src/pages/ChatLogs/components/ChatBar.tsx +++ b/src/pages/ChatLogs/components/ChatBar.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { IChatItem } from '../ChatLogsType'; import { ChatAgreeOrNot } from './ChatAgreeOrNot'; import { ChatCard } from './ChatCard'; @@ -26,50 +27,50 @@ export const ChatBar: React.FC = (props) => { const chatContent = () => { if (chat?.msg_type == 'text') { - return ; + return ; } else if (chat?.msg_type == 'file') { - return ; + return ; } else if (chat?.msg_type == 'emotion') { - return ; + return ; } else if (chat?.msg_type == 'card') { - return ; + return ; } else if (chat?.msg_type == 'external_redpacket' || chat?.msg_type == 'redpacket') { - return ; + return ; } else if (chat?.msg_type == 'image') { - return ; + return ; } else if (chat?.msg_type == 'link') { - return ; + return ; } else if (chat?.msg_type == 'location') { - return ; + return ; } else if (chat?.msg_type == 'video') { - return ; + return ; } else if (chat?.msg_type == 'voice') { - return ; + return ; } else if (chat?.msg_type == 'chatrecord') { - return ; + return ; } else if (chat?.msg_type == 'meeting_voice_call') { - return ; + return ; } else if (chat?.msg_type == 'voiptext') { - return ; + return ; } else if (chat?.msg_type == 'weapp') { - return ; + return ; } else if (chat?.msg_type == 'todo') { - return ; + return ; } else if (chat?.msg_type == 'vote') { - return ; + return ; } else if (chat?.msg_type == 'collect') { - return ; + return ; } else if (chat?.msg_type == 'docmsg') { - return ; + return ; } else { return <>未解析的数据类型; } }; if (chat?.msg_type == 'revoke') { - return ; + return ; } else if (chat?.msg_type == 'agree' || chat?.msg_type == 'disagree') { - return ; + return ; } else { return ( <> diff --git a/src/pages/ChatLogs/components/ChatCard.tsx b/src/pages/ChatLogs/components/ChatCard.tsx index 12f17ce..fe8a6a8 100644 --- a/src/pages/ChatLogs/components/ChatCard.tsx +++ b/src/pages/ChatLogs/components/ChatCard.tsx @@ -1,18 +1,7 @@ +import React from 'react'; import { IChatItem } from '../ChatLogsType'; export const ChatCard: React.FC = (props) => { function content() { - //
- //
- // - //
- //
腾讯
- //
- //
corpname
- //
corpname2
- //
个人名片
try { const msg = JSON.parse(props.chat?.content as string); return ( diff --git a/src/pages/ChatLogs/components/ChatCollect.tsx b/src/pages/ChatLogs/components/ChatCollect.tsx index 89b9196..ced5137 100644 --- a/src/pages/ChatLogs/components/ChatCollect.tsx +++ b/src/pages/ChatLogs/components/ChatCollect.tsx @@ -1,5 +1,5 @@ +import React from 'react'; import { IChatItem } from '../ChatLogsType'; - export const ChatCollect: React.FC = (props) => { function content() { try { diff --git a/src/pages/ChatLogs/components/ChatDocmsg.tsx b/src/pages/ChatLogs/components/ChatDocmsg.tsx index b3f1234..dacb7c0 100644 --- a/src/pages/ChatLogs/components/ChatDocmsg.tsx +++ b/src/pages/ChatLogs/components/ChatDocmsg.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { IChatItem } from '../ChatLogsType'; export const ChatDocmsg: React.FC = (props) => { @@ -5,7 +6,7 @@ export const ChatDocmsg: React.FC = (props) => { try { const msg = JSON.parse(props.chat?.doc as string); return ( - +
标题:{msg.title}
链接:{msg.link_url}
diff --git a/src/pages/ChatLogs/components/ChatFile.tsx b/src/pages/ChatLogs/components/ChatFile.tsx index 14fcd9a..520f922 100644 --- a/src/pages/ChatLogs/components/ChatFile.tsx +++ b/src/pages/ChatLogs/components/ChatFile.tsx @@ -1,4 +1,5 @@ import { FileTextFilled } from '@ant-design/icons'; +import React from 'react'; import { IChatItem } from '../ChatLogsType'; export const ChatFile: React.FC = (props) => { diff --git a/src/pages/ChatLogs/components/ChatImage.tsx b/src/pages/ChatLogs/components/ChatImage.tsx index d776dd4..b494e77 100644 --- a/src/pages/ChatLogs/components/ChatImage.tsx +++ b/src/pages/ChatLogs/components/ChatImage.tsx @@ -1,8 +1,7 @@ import { Image } from 'antd'; -import { useState } from 'react'; +import React, { useState } from 'react'; import { IChatItem } from '../ChatLogsType'; import styles from './index.module.scss'; - export const ChatImage: React.FC = (props) => { const [visible, setVisible] = useState(false); function content() { @@ -23,7 +22,7 @@ export const ChatImage: React.FC = (props) => { { + onVisibleChange: (value) => { setVisible(value); }, }} diff --git a/src/pages/ChatLogs/components/ChatLink.tsx b/src/pages/ChatLogs/components/ChatLink.tsx index a98f346..ad07640 100644 --- a/src/pages/ChatLogs/components/ChatLink.tsx +++ b/src/pages/ChatLogs/components/ChatLink.tsx @@ -1,4 +1,5 @@ import { IeSquareFilled } from '@ant-design/icons'; +import React from 'react'; import { IChatItem } from '../ChatLogsType'; export const ChatLink: React.FC = (props) => { @@ -11,7 +12,7 @@ export const ChatLink: React.FC = (props) => {
diff --git a/src/pages/ChatLogs/components/ChatLocation.tsx b/src/pages/ChatLogs/components/ChatLocation.tsx index ad1653d..e474f85 100644 --- a/src/pages/ChatLogs/components/ChatLocation.tsx +++ b/src/pages/ChatLogs/components/ChatLocation.tsx @@ -1,4 +1,5 @@ import { EnvironmentFilled } from '@ant-design/icons'; +import React from 'react'; import { IChatItem } from '../ChatLogsType'; export const ChatLocation: React.FC = (props) => { diff --git a/src/pages/ChatLogs/components/ChatMeetingVoiceCall.tsx b/src/pages/ChatLogs/components/ChatMeetingVoiceCall.tsx index 122cdca..a7060d4 100644 --- a/src/pages/ChatLogs/components/ChatMeetingVoiceCall.tsx +++ b/src/pages/ChatLogs/components/ChatMeetingVoiceCall.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { IChatItem } from '../ChatLogsType'; export const ChatMeetingVoiceCall: React.FC = (props) => { @@ -18,7 +19,7 @@ export const ChatMeetingVoiceCall: React.FC = (props) => { }); } }} - > + /> ); } catch (e) { return
{props.chat?.content}
; diff --git a/src/pages/ChatLogs/components/ChatRecord.tsx b/src/pages/ChatLogs/components/ChatRecord.tsx index 70c263e..befcec5 100644 --- a/src/pages/ChatLogs/components/ChatRecord.tsx +++ b/src/pages/ChatLogs/components/ChatRecord.tsx @@ -1,5 +1,5 @@ import { Modal } from 'antd'; -import { useEffect, useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { IChatItem } from '../ChatLogsType'; import { EmojiFormat } from './EmojiFormat'; @@ -45,7 +45,9 @@ export const ChatRecord: React.FC = (props) => { try { const msg = JSON.parse(props.chat?.content as string); setRecord(msg); - } catch (e) {} + } catch (e) { + /* empty */ + } }, [props.chat]); function content() { diff --git a/src/pages/ChatLogs/components/ChatRedpacket.tsx b/src/pages/ChatLogs/components/ChatRedpacket.tsx index 7cbd23e..046dc05 100644 --- a/src/pages/ChatLogs/components/ChatRedpacket.tsx +++ b/src/pages/ChatLogs/components/ChatRedpacket.tsx @@ -1,4 +1,5 @@ import { RedEnvelopeFilled } from '@ant-design/icons'; +import React from 'react'; import { IChatItem } from '../ChatLogsType'; export const ChatRedpacket: React.FC = (props) => { diff --git a/src/pages/ChatLogs/components/ChatRevoke.tsx b/src/pages/ChatLogs/components/ChatRevoke.tsx index 39b7450..c4b4fea 100644 --- a/src/pages/ChatLogs/components/ChatRevoke.tsx +++ b/src/pages/ChatLogs/components/ChatRevoke.tsx @@ -1,3 +1,4 @@ +import React from 'react'; export const ChatRevoke: React.FC = () => { return (
diff --git a/src/pages/ChatLogs/components/ChatText.tsx b/src/pages/ChatLogs/components/ChatText.tsx index c78479a..de2c34d 100644 --- a/src/pages/ChatLogs/components/ChatText.tsx +++ b/src/pages/ChatLogs/components/ChatText.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { IChatItem } from '../ChatLogsType'; import { EmojiFormat } from './EmojiFormat'; diff --git a/src/pages/ChatLogs/components/ChatTime.tsx b/src/pages/ChatLogs/components/ChatTime.tsx index ff8ec19..ee8fad7 100644 --- a/src/pages/ChatLogs/components/ChatTime.tsx +++ b/src/pages/ChatLogs/components/ChatTime.tsx @@ -1,3 +1,4 @@ +import React from 'react'; interface IChatTimeProps { msgtime: string; } diff --git a/src/pages/ChatLogs/components/ChatTodo.tsx b/src/pages/ChatLogs/components/ChatTodo.tsx index 61b5ab7..ee5485c 100644 --- a/src/pages/ChatLogs/components/ChatTodo.tsx +++ b/src/pages/ChatLogs/components/ChatTodo.tsx @@ -1,5 +1,5 @@ +import React from 'react'; import { IChatItem } from '../ChatLogsType'; - export const ChatTodo: React.FC = (props) => { function content() { return ( diff --git a/src/pages/ChatLogs/components/ChatVideo.tsx b/src/pages/ChatLogs/components/ChatVideo.tsx index 9c78b29..cbffabc 100644 --- a/src/pages/ChatLogs/components/ChatVideo.tsx +++ b/src/pages/ChatLogs/components/ChatVideo.tsx @@ -1,9 +1,8 @@ import { CloseOutlined, PlayCircleOutlined } from '@ant-design/icons'; -import { useRef, useState } from 'react'; +import React, { useRef, useState } from 'react'; import { IChatItem } from '../ChatLogsType'; import styles from './index.module.scss'; - export const ChatVideo: React.FC = (props) => { const [open, setOpen] = useState(false); const videoRef = useRef(); @@ -36,7 +35,7 @@ export const ChatVideo: React.FC = (props) => { }); } setTimeout(() => { - videoRef.current.play().catch((error) => { + videoRef.current.play().catch((error: any) => { console.log(error); }); }, 100); @@ -58,7 +57,7 @@ export const ChatVideo: React.FC = (props) => { justifyContent: 'center', alignItems: 'center', }} - onClick={(e) => { + onClick={() => { setOpen(false); videoRef.current.pause(); }} @@ -81,7 +80,7 @@ export const ChatVideo: React.FC = (props) => { onClick={(e) => { e.stopPropagation(); }} - > + />
); diff --git a/src/pages/ChatLogs/components/ChatVoice.tsx b/src/pages/ChatLogs/components/ChatVoice.tsx index 856fb38..14d206d 100644 --- a/src/pages/ChatLogs/components/ChatVoice.tsx +++ b/src/pages/ChatLogs/components/ChatVoice.tsx @@ -1,15 +1,17 @@ import { FileTextFilled } from '@ant-design/icons'; -import { useRef, useState } from 'react'; +import React, { useRef, useState } from 'react'; import { IChatItem } from '../ChatLogsType'; export const ChatVoice: React.FC = (props) => { const [open, setOpen] = useState(false); const audioRef = useRef(); - function readBlob(blob: Blob, callback: Function) { + function readBlob(blob: Blob, callback: any) { const reader = new FileReader(); reader.onload = function (e) { - const data = new Uint8Array(e.target.result); - callback(data); + if (e.target && e.target.result) { + const data = new Uint8Array(e.target.result as ArrayBuffer); + callback(data); + } }; reader.readAsArrayBuffer(blob); } @@ -42,8 +44,8 @@ export const ChatVoice: React.FC = (props) => { let blob = new Blob([res]); readBlob(blob, function (data: any) { if (window.AMR) { - var buffer = window.AMR.toWAV(data); - var url = URL.createObjectURL(new Blob([buffer], { type: 'audio/x-wav' })); + let buffer = window.AMR.toWAV(data); + let url = URL.createObjectURL(new Blob([buffer], { type: 'audio/x-wav' })); audioRef.current.src = url; audioRef.current.play().catch((err: any) => { console.log(err); @@ -60,20 +62,20 @@ export const ChatVoice: React.FC = (props) => { }} > - {msg.play_length}" + {msg.play_length}" + />
+ />
); } catch (_e) { diff --git a/src/pages/ChatLogs/components/ChatVoiptext.tsx b/src/pages/ChatLogs/components/ChatVoiptext.tsx index a81f6e7..b7bd45e 100644 --- a/src/pages/ChatLogs/components/ChatVoiptext.tsx +++ b/src/pages/ChatLogs/components/ChatVoiptext.tsx @@ -1,6 +1,6 @@ import { durationFormat } from '@/services/utils'; +import React from 'react'; import { IChatItem } from '../ChatLogsType'; - export const ChatVoiptext: React.FC = (props) => { const invitetype: any = { '1': '单人视频通话', diff --git a/src/pages/ChatLogs/components/ChatVote.tsx b/src/pages/ChatLogs/components/ChatVote.tsx index 1748c22..bfb98e6 100644 --- a/src/pages/ChatLogs/components/ChatVote.tsx +++ b/src/pages/ChatLogs/components/ChatVote.tsx @@ -1,6 +1,6 @@ import { SignalFilled } from '@ant-design/icons'; import { Modal } from 'antd'; -import { useEffect, useState } from 'react'; +import React, { useEffect, useState } from 'react'; import { IChatItem } from '../ChatLogsType'; import styles from './index.module.scss'; @@ -13,7 +13,9 @@ export const ChatVote: React.FC = (props) => { try { const msg = JSON.parse(props.chat?.content as string); setVoteitem(msg?.voteitem); - } catch (e) {} + } catch (e) { + /* empty */ + } }, [props.chat]); function content() { @@ -70,7 +72,9 @@ export const ChatVote: React.FC = (props) => { ); - } catch (e) {} + } catch (e) { + /* empty */ + } return (
diff --git a/src/pages/ChatLogs/components/ChatWeapp.tsx b/src/pages/ChatLogs/components/ChatWeapp.tsx index 01c09f5..847c39f 100644 --- a/src/pages/ChatLogs/components/ChatWeapp.tsx +++ b/src/pages/ChatLogs/components/ChatWeapp.tsx @@ -1,5 +1,5 @@ +import React from 'react'; import { IChatItem } from '../ChatLogsType'; - export const ChatWeapp: React.FC = (props) => { function content() { try { @@ -9,7 +9,7 @@ export const ChatWeapp: React.FC = (props) => { return (
- +
{msg.title}
@@ -21,7 +21,7 @@ export const ChatWeapp: React.FC = (props) => { return (
- +
{props.chat?.content}
diff --git a/src/pages/ChatLogs/components/EmojiFormat.tsx b/src/pages/ChatLogs/components/EmojiFormat.tsx index 659c13b..38d0f47 100644 --- a/src/pages/ChatLogs/components/EmojiFormat.tsx +++ b/src/pages/ChatLogs/components/EmojiFormat.tsx @@ -23,7 +23,7 @@ export const EmojiFormat: React.FC = (props) => { return ( <> {typeof props.content === 'string' ? ( -
+
) : ( props.content )} diff --git a/src/pages/ChatLogs/components/Gender.tsx b/src/pages/ChatLogs/components/Gender.tsx index a0dbb82..ccf6b1d 100644 --- a/src/pages/ChatLogs/components/Gender.tsx +++ b/src/pages/ChatLogs/components/Gender.tsx @@ -1,3 +1,4 @@ +import React from 'react'; type IProps = { gender: string | undefined | number; }; @@ -12,7 +13,7 @@ export const Gender: React.FC = (props) => { + /> ) : ( @@ -21,7 +22,7 @@ export const Gender: React.FC = (props) => { + /> )} @@ -32,7 +33,7 @@ export const Gender: React.FC = (props) => { + /> )} diff --git a/src/pages/ChatLogs/components/Svgs.tsx b/src/pages/ChatLogs/components/Svgs.tsx index 0b6307f..e80d853 100644 --- a/src/pages/ChatLogs/components/Svgs.tsx +++ b/src/pages/ChatLogs/components/Svgs.tsx @@ -1,4 +1,5 @@ -export const OwnerSvg = () => { +import React from 'react'; +export const OwnerSvg: React.FC = () => { return ( { + /> ); }; -export const AdminSvg = () => { +export const AdminSvg: React.FC = () => { return ( { + /> ); diff --git a/src/pages/CustomList/index.tsx b/src/pages/CustomList/index.tsx index 760baa8..d0d205c 100644 --- a/src/pages/CustomList/index.tsx +++ b/src/pages/CustomList/index.tsx @@ -240,14 +240,14 @@ const CustomList: React.FC = () => { e.stopPropagation(); }} > - +
{value}[{record.remark}]
- + @{CustType[record.type]} @@ -337,7 +337,9 @@ const CustomList: React.FC = () => { ); } - } catch (e) {} + } catch (e) { + /* empty */ + } return
无标签
; }} dataIndex={'tags'} diff --git a/src/pages/DepartmentsList/components/DepartmentMemberDetail.tsx b/src/pages/DepartmentsList/components/DepartmentMemberDetail.tsx index ea7de5d..f5b9577 100644 --- a/src/pages/DepartmentsList/components/DepartmentMemberDetail.tsx +++ b/src/pages/DepartmentsList/components/DepartmentMemberDetail.tsx @@ -1,8 +1,8 @@ import { IStaffsItem } from '@/pages/ChatLogs/ChatLogsType'; import { Gender } from '@/pages/ChatLogs/components/Gender'; import { Image } from 'antd'; +import React from 'react'; import styles from '../index.module.scss'; - type IProps = { record: IStaffsItem; }; @@ -23,7 +23,7 @@ export const DepartmentMembersDetail: React.FC = (props) => {
{record?.avatar ? ( - + ) : (
= (props) => {
{record?.name} - +
别名:{fomatStr(record?.alias)}
{record?.qr_code ? ( - + ) : null}
diff --git a/src/pages/DepartmentsList/index.tsx b/src/pages/DepartmentsList/index.tsx index f7ad979..2404ac3 100644 --- a/src/pages/DepartmentsList/index.tsx +++ b/src/pages/DepartmentsList/index.tsx @@ -320,7 +320,7 @@ const DepartmentsList: React.FC = () => { } - > + /> = (props) => { const [loading, setLoading] = useState(false); const groupMembersObjRef = useRef({}); - useEffect(() => { - record.adminUserIDs = getAdminList(record.admin_list); - getList(); - }, [props.record]); - const getList = () => { setLoading(true); post({ @@ -59,6 +54,11 @@ export const GroupDetailContent: React.FC = (props) => { }); }; + useEffect(() => { + record.adminUserIDs = getAdminList(record.admin_list); + getList(); + }, [props.record]); + return ( {groupMembersList.length ? ( diff --git a/src/pages/User/Login/index.tsx b/src/pages/User/Login/index.tsx index 5d123e4..8146c1d 100644 --- a/src/pages/User/Login/index.tsx +++ b/src/pages/User/Login/index.tsx @@ -101,7 +101,7 @@ const Login: React.FC = () => { }} logo={logo} title="scrm.antd" - subTitle={
} + subTitle={
} initialValues={{ autoLogin: true, }} @@ -268,7 +268,7 @@ const Login: React.FC = () => {
-
+
); }; diff --git a/src/pages/Workbench/components/DataItemCard.tsx b/src/pages/Workbench/components/DataItemCard.tsx index f387e64..1fa09c1 100644 --- a/src/pages/Workbench/components/DataItemCard.tsx +++ b/src/pages/Workbench/components/DataItemCard.tsx @@ -20,7 +20,7 @@ export const DataItemCard: React.FC = (props) => {
- +
); diff --git a/src/services/utils.ts b/src/services/utils.ts index 0187fe5..5e4098b 100644 --- a/src/services/utils.ts +++ b/src/services/utils.ts @@ -1,3 +1,4 @@ +import React from 'react'; interface IGetDevice { (): 'phone' | 'tablet' | 'desktop'; }