fix: 🪲️修复空素材编辑验证
This commit is contained in:
parent
fcf31294b7
commit
de7088f642
@ -218,7 +218,7 @@
|
||||
|
||||
.operation {
|
||||
@apply flex items-center ml-2 text-lg text-gray-400 justify-center;
|
||||
width: 150px;
|
||||
width: 180px;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,11 @@ function groupHasImageAndText(blocks: BlockContent[]) {
|
||||
return blocks.some(s=>s.type == 'image' && s.content.trim().length > 0) && blocks.some(s=>s.type == 'text' && s.content.trim().length > 0)
|
||||
}
|
||||
// 验证分组数据是否合法
|
||||
function checkGroupsValid(groups: BlockContent[][]) {
|
||||
function checkGroupsValid(_groups: BlockContent[][]) {
|
||||
const groups = _groups.filter((_,index)=>{
|
||||
if (index == 0) return true;
|
||||
return _.length>1;
|
||||
})
|
||||
if (groups.length == 1) return true;
|
||||
for (let index = 1;index< groups.length; index ++) {
|
||||
if(!groupHasImageAndText(groups[index])) return false;
|
||||
|
@ -127,7 +127,7 @@ export default function NewEdit() {
|
||||
return <div key={i} className={clsx("row flex", {checked})}>
|
||||
<div className="col title cursor-pointer" onClick={() => setEditId(item.id)}>
|
||||
<div className="flex-1">
|
||||
<div className="text-base">{item.title}</div>
|
||||
<div className="text-base line-clamp-1">{item.title}</div>
|
||||
<div
|
||||
className="summary text-xs text-gray-400 line-clamp-1">{item.summary}</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user