diff --git a/packages/client/src/components/wiki/setting/base/index.module.scss b/packages/client/src/components/wiki/setting/base/index.module.scss index ed89d589..28866aee 100644 --- a/packages/client/src/components/wiki/setting/base/index.module.scss +++ b/packages/client/src/components/wiki/setting/base/index.module.scss @@ -1,70 +1,15 @@ -.coverWrap { - display: flex; - flex-wrap: nowrap; +.cover { + margin-bottom: 12px; - .cover { - margin-right: 24px; - - img { - width: 104px; - height: 96px; - margin-bottom: 16px; - border-radius: 4px; - } - } - - .right { - display: flex; - flex: 1; - flex-direction: column; - justify-content: space-between; - overflow: auto; - - .placeholderWrapper { - display: flex; - flex-wrap: nowrap; - - .coverPlaceholder { - flex-shrink: 0; - width: 96px; - height: 96px; - cursor: pointer; - - & + .coverPlaceholder { - margin-left: 16px; - } - - img { - width: 96px; - height: 96px; - border-radius: 4px; - } - } - } + img { + width: 104px; + height: 96px; + border-radius: 4px; } } @media (max-width: 768px) { - .coverWrap { - flex-wrap: wrap; - - .cover { - width: 100%; - margin-right: 0; - } - } - - .right { + .cover { width: 100%; - - .placeholderWrapper { - width: 100%; - margin: 16px 0; - overflow: auto; - - .coverPlaceholder { - flex-shrink: 0; - } - } } } diff --git a/packages/client/src/components/wiki/setting/base/index.tsx b/packages/client/src/components/wiki/setting/base/index.tsx index 45a9d722..3adf4e67 100644 --- a/packages/client/src/components/wiki/setting/base/index.tsx +++ b/packages/client/src/components/wiki/setting/base/index.tsx @@ -1,12 +1,20 @@ -import { Button, Form, Toast } from '@douyinfe/semi-ui'; +import { Avatar, Button, Form, Toast } from '@douyinfe/semi-ui'; import { FormApi } from '@douyinfe/semi-ui/lib/es/form'; import { WIKI_AVATARS } from '@think/constants'; import type { IWiki } from '@think/domains'; -import { Upload } from 'components/upload'; +import { ImageUploader } from 'components/image-uploader'; import { useEffect, useRef, useState } from 'react'; import styles from './index.module.scss'; +const images = [ + { + key: 'placeholers', + title: '图库', + images: WIKI_AVATARS, + }, +]; + type IUpdateWIKI = Partial; interface IProps { @@ -60,23 +68,22 @@ export const Base: React.FC = ({ wiki, update }) => { rules={[{ required: true, message: '请输入知识库简介' }]} > -
-
- -
-
-
- {WIKI_AVATARS.map((cover) => { - return ( -
setCover(cover)}> - 系统默认图片 -
- ); - })} -
-
+
+ + {wiki && wiki.name.charAt(0)} +
- + + +