diff --git a/src/assets/core.scss b/src/assets/core.scss index 08985b6..6645207 100644 --- a/src/assets/core.scss +++ b/src/assets/core.scss @@ -27,12 +27,12 @@ } ::-webkit-scrollbar-thumb { - background: #999; + background: #ccc; height: 10px; border-radius: 5px; &:hover { - background: #666; + background: #999; cursor: pointer; } } diff --git a/src/components/article/group.tsx b/src/components/article/group.tsx index cf2158d..92fcb9f 100644 --- a/src/components/article/group.tsx +++ b/src/components/article/group.tsx @@ -11,19 +11,46 @@ type Props = { errorMessage?: string; } + +function pushBlocksToGroup(blocks: BlockContent[],groups: BlockContent[][]){ + const lastGroup = groups[groups.length - 1] + if (lastGroup && lastGroup.filter(s=>s.type == 'text') == 0) { + // 如果上一个group中没有文本则直接合并 + lastGroup.push(...blocks) + } else { + groups.push(blocks) + } +} + function rebuildGroups(groups: BlockContent[][]) { - if (groups.length < 2) { - Array(2 - groups.length).fill([{type: 'text', content: ''}]).forEach((it) => { - groups.push(it) + const _groups: BlockContent[][] = []; + if (!groups || groups.length == 0) return _groups; + groups.forEach((blocks,index) => { + if(!blocks) return; + if (blocks.length == 1) { + if(index == 0) _groups.push(blocks) + else pushBlocksToGroup(blocks,_groups) + } else { + if(index == 0){ + _groups.push([blocks[0]]) + _groups.push(blocks.slice(1)) + }else{ + pushBlocksToGroup(blocks,_groups) + } + } + }); + if (_groups.length < 2) { + Array(2 - _groups.length).fill([{type: 'text', content: ''}]).forEach((it) => { + _groups.push(it) }) } - - return groups; + console.log('rebuildGroups', _groups) + return _groups; } -export default function ArticleGroup({groups: _groups, editable, onChange,errorMessage}: Props) { +export default function ArticleGroup({groups: _groups, editable, onChange, errorMessage}: Props) { const groups = rebuildGroups(_groups) /** * 添加一个组 diff --git a/src/components/video/video-list-item.tsx b/src/components/video/video-list-item.tsx index b85f009..ec647f3 100644 --- a/src/components/video/video-list-item.tsx +++ b/src/components/video/video-list-item.tsx @@ -2,7 +2,7 @@ import {useSortable} from "@dnd-kit/sortable"; import {useSetState} from "ahooks"; import React, {useEffect} from "react"; import {clsx} from "clsx"; -import {Popconfirm} from "antd"; +import {Image, Popconfirm} from "antd"; import {CheckCircleFilled, MenuOutlined, MinusCircleFilled} from "@ant-design/icons"; import ImageCover from '@/assets/images/cover.png' @@ -50,8 +50,8 @@ export const VideoListItem = (