doubao-seed-2-0-lite 在「拖拽排序列表」的评测结果
这是该 AI 模型在此测试用例上的详细评测结果。
基本信息
- 模型名称:doubao-seed-2-0-lite
- 用例名称:拖拽排序列表
- 测试类型:网页生成
- 评测维度:交互组件
系统提示词(System Prompt)
这是给 AI 模型的背景设定和角色指令:
你是一名资深前端开发工程师,专注于 Web 交互组件的实现与用户体验优化。 回答要求: 1. 所有代码(HTML、CSS、JavaScript)必须写在同一个 HTML 文件中,可直接在浏览器中运行,无需任何外部依赖。 2. 优先使用原生 HTML5 Drag and Drop API 实现拖拽功能,代码结构清晰、注释适当。 3. 实现时需考虑边缘情况:如拖拽到列表首尾、快速拖拽、拖拽到自身位置等场景的正确处理。 4. 视觉样式需整洁美观,占位符、拖拽状态等交互反馈需清晰可辨。 5. 代码量适中,聚焦核心功能,不引入不必要的复杂度。
用户提示词(User Prompt)
这是用户给 AI 模型的具体任务要求:
# 拖拽排序列表(基础版) 请生成一个单列拖拽排序列表页面,所有代码(HTML、CSS、JavaScript)写在同一个 HTML 文件中,可直接在浏览器运行。 ## 功能要求 ### 核心交互 1. **拖拽排序**:列表项支持上下拖拽,松手后完成位置交换,使用原生 HTML5 Drag and Drop API 实现。 2. **拖拽手柄**:每个列表项左侧显示拖拽手柄图标(如 ⠿ 或 ≡),鼠标悬停时光标变为 `grab`,拖拽时变为 `grabbing`。 3. **占位符显示**:拖拽过程中,目标插入位置显示一个高亮占位符(虚线框或半透明色块),指示放置后的位置。 4. **放置动画**:列表项放置完成后,有简单的过渡动画(如 transform + transition 实现位置平滑过渡或 fade-in 效果)。 ### 数据持久化 5. **localStorage 存储**:每次拖拽排序完成后,将当前列表顺序保存到 `localStorage`;页面刷新后自动读取并还原上次的排列顺序。 ## 初始数据 列表默认包含以下 6 个任务项(可自行设计样式): - 📝 撰写项目需求文档 - 🎨 设计 UI 原型图 - 💻 开发前端页面 - 🔧 编写单元测试 - 🚀 部署到测试环境 - ✅ 验收与上线 ## 视觉要求 - 页面居中布局,列表宽度适中(建议 400-500px) - 列表项有卡片样式(圆角、阴影),拖拽时被拖动项半透明或降低透明度 - 占位符与普通列表项高度一致,视觉上明显区分(如蓝色虚线边框 + 浅蓝背景) - 整体配色简洁,不要求复杂主题 ## 不需要实现 - 多列表(看板)功能 - 嵌套列表 - 触摸/移动端支持 - 键盘导航 - 音效
任务要求
AI 模型需要满足以下要求:
- 使用原生 HTML5 Drag and Drop API(dragstart、dragover、drop 等事件)实现拖拽,不依赖第三方库。
- 拖拽过程中在正确的目标位置显示占位符,占位符位置随鼠标移动实时更新,且不出现闪烁或位置错误。
- 放置完成后列表项顺序正确更新,并有可见的过渡动画效果(不少于 150ms 的 CSS transition)。
- 每个列表项具有可识别的拖拽手柄图标,拖拽手柄区域的鼠标光标正确显示为 grab/grabbing。
- 排序结果正确持久化到 localStorage,刷新页面后列表顺序与上次一致,初次加载无数据时显示默认顺序。
- 正确处理边缘情况:拖拽到自身位置不触发重排,拖拽到列表首尾位置时占位符显示正确。
评测结果
综合得分
该模型在此用例的得分为:72.1 分(满分 100 分),已通过
基础难度评测结果
- 得分:72.1 分
- 通过状态:已通过
模型生成产物
以下是该模型针对此任务的实际生成内容:
以下是完整的单列拖拽排序列表实现,满足所有要求,可直接在浏览器运行: ```html 拖拽排序列表 * { box-sizing: border-box; } body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; background-color: #f0f2f5; padding: 2rem 1rem; font-family: system-ui, -apple-system, sans-serif; } .container { width: 100%; max-width: 450px; background-color: #ffffff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); padding: 1.5rem; } h1 { text-align: center; color: #333333; margin: 0 0 1.5rem 0; font-size: 1.5rem; } #sortable-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; } .sort-item { display: flex; align-items: center; background-color: #ffffff; border-radius: 8px; padding: 1rem 0.75rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); transition: all 0.3s ease; margin-bottom: 0.5rem; cursor: grab; draggable: true; } .sort-item.dragging { opacity: 0.4; cursor: grabbing; transform: scale(1.02); } .drag-handle { font-size: 1.5rem; color: #aaaaaa; margin-right: 1rem; cursor: grab; } .sort-item.dragging .drag-handle { cursor: grabbing; } .sort-item-content { flex: 1; font-size: 1rem; color: #333333; } .placeholder { height: 58px; background-color: #e3f2fd; border: 2px dashed #2196f3; border-radius: 8px; margin-bottom: 0.5rem; } 拖拽排序列表 const sortableList = document.getElementById('sortable-list'); const placeholder = document.createElement('li'); placeholder.className = 'placeholder'; // 默认初始数据 const defaultItems = [ '📝 撰写项目需求文档', '🎨 设计 UI 原型图', '💻 开发前端页面', '🔧 编写单元测试', '🚀 部署到测试环境', '✅ 验收与上线' ]; // 从localStorage加载数据或使用默认数据 let items = JSON.parse(localStorage.getItem('draggableSortList')) || defaultItems; let draggedItem = null; // 渲染列表 function renderList() { sortableList.innerHTML = ''; items.forEach(itemContent => { const li = document.createElement('li'); li.className = 'sort-item'; li.draggable = true; li.dataset.value = itemContent; const handle = document.createElement('span'); handle.className = 'drag-handle'; handle.textContent =...
AI 评审点评
以下是 AI 评审对该模型输出的点评:
【GEMINI】这是一个高质量的实现方案。模型准确理解了所有功能需求,特别是在原生拖拽 API 的占位符逻辑处理上表现出色,解决了常见的交互跳动问题。数据持久化功能完备,视觉样式现代且符合提示词要求,代码简洁高效,是一个非常标准的前端组件实现案例。 【KIMI】该实现是一个高质量的原生拖拽排序列表组件,完整满足了所有核心功能要求。拖拽交互流畅,占位符逻辑智能,视觉反馈清晰,数据持久化可靠。代码结构清晰,自包含性强,可直接运行。主要改进空间在于 placeholder 高度的动态适配,以及极端边界情况下的状态一致性处理。整体而言,这是一个优秀的实现,适合作为基础版拖拽排序组件使用。
进阶难度评测结果
- 得分:63.6 分
- 通过状态:已通过
模型生成产物
以下是该模型针对此任务的实际生成内容:
以下是完整的可直接运行的拖拽排序看板进阶版代码,满足所有需求: ```html 拖拽排序看板 * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; } .task-item { transition: transform 200ms ease; will-change: transform; } .task-item:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; } .drag-handle { cursor: grab; user-select: none; } .drag-handle:active { cursor: grabbing; } .placeholder { border: 2px dashed #2563eb; border-radius: 6px; background-color: #e0eaff; opacity: 0.6; } .drag-clone { position: fixed; top: 0; left: 0; z-index: 1000; pointer-events: none; opacity: 0.8; transform-origin: top left; border-radius: 6px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); } .keyboard-hint { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background-color: #1e293b; color: white; padding: 12px 20px; border-radius: 8px; z-index: 999; opacity: 0; transition: opacity 200ms ease; pointer-events: none; } .keyboard-hint.visible { opacity: 1; } .column { transition: all 200ms ease; } .column.drag-over { border: 2px solid #2563eb; background-color: #f8faff; } 拖拽看板 重置为默认 // 音效初始化 let audioContext; function initAudio() { if (!audioContext) audioContext = new (window.AudioContext || window.webkitAudioContext)(); } function playPickSound() { initAudio(); const osc = audioContext.createOscillator(); const gain = audioContext.createGain(); osc.connect(gain); gain.connect(audioContext.destination); osc.frequency.value = 220; gain.gain.setValueAtTime(0.1, audioContext.currentTime); gain.gain.exponentialRampToValueAtTime(0.001, audioContext.currentTime + 0.05); osc.start(audioContext.currentTime); osc.stop(audioContext.currentTime + 0.05); } function playDropSound() { initAudio(); const osc1 = audioContext.createOscillator(); const gain1 = audioContext.createGain(); osc1.connect(gain1); gain1.connect(audioContext.destination); osc1.frequency.value = 330; gain1.gain.setValueAtTime(0.1, audioContext.currentTime); gain1.gain.exponentialRampToValueAtTime(0.001, audioContext.currentTime...
AI 评审点评
以下是 AI 评审对该模型输出的点评:
【GEMINI】这是一个高质量的看板组件实现。亮点在于 Web Audio 的原生合成和细腻的拖拽动画处理(如飞入效果)。代码结构清晰,充分考虑了移动端触摸特性。唯一遗憾的是生成结果在键盘导航逻辑部分因长度限制未能完全输出,但已有的框架展示了资深前端的工程素养。 【KIMI】该实现完成了拖拽看板的核心功能,包括 Pointer Events 拖拽、占位符机制、Web Audio 音效和数据持久化,代码结构清晰且动画效果基本流畅。但存在关键功能缺失:键盘导航功能严重不完整(代码截断),触摸长按触发和滚动禁止实现不完善,且「无需外部依赖」的要求未完全满足(使用了 Tailwind CDN)。此外,原位放置检测、快速连续拖拽防抖等边缘情况处理不足。整体为及格偏上水平,可作为基础版本进一步迭代完善。
困难难度评测结果
- 得分:62.2 分
- 通过状态:已通过
模型生成产物
以下是该模型针对此任务的实际生成内容:
下面是一个完整实现所有需求的嵌套树形拖拽排序列表应用,采用了现代化的技术实现,符合无障碍标准,支持虚拟滚动和多主题: ```html 嵌套树形拖拽排序列表 :root { --bg-primary: #f5f7fa; --bg-secondary: #ffffff; --bg-column: #ebecf0; --text-primary: #172b4d; --text-secondary: #42526e; --border-color: #dcdfe4; --accent-color: #0052cc; --placeholder-color: #0052cc; --hover-color: #f0f2f5; --shadow: 0 1px 3px rgba(0,0,0,0.12); --danger-color: #de350b; --success-color: #00875a; } [data-theme="dark"] { --bg-primary: #1a1d23; --bg-secondary: #282c34; --bg-column: #21252b; --text-primary: #e6e8eb; --text-secondary: #abb2bf; --border-color: #3e4451; --accent-color: #61afef; --placeholder-color: #61afef; --hover-color: #30363f; --shadow: 0 1px 3px rgba(0,0,0,0.3); --danger-color: #e06c75; --success-color: #98c379; } [data-theme="high-contrast"] { --bg-primary: #000000; --bg-secondary: #000000; --bg-column: #0a0a0a; --text-primary: #ffffff; --text-secondary: #ffffff; --border-color: #ffffff; --accent-color: #ffff00; --placeholder-color: #ffff00; --hover-color: #222222; --shadow: 0 0 0 1px #ffffff; --danger-color: #ff0000; --success-color: #00ff00; } * { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } body { background-color: var(--bg-primary); color: var(--text-primary); transition: background-color 0.3s ease; min-height: 100vh; padding: 16px; } .toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); } .controls { display: flex; gap: 8px; align-items: center; } button { background-color: var(--accent-color); color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; transition: opacity 0.2s; } button:hover { opacity: 0.9; } .stats { margin-left: auto; font-size: 14px; color: var(--text-secondary); } .board { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; min-height: calc(100vh -...
AI 评审点评
以下是 AI 评审对该模型输出的点评:
【GEMINI】这是一个工程化水平很高的前端组件实现。它成功挑战了「虚拟滚动」与「嵌套树形拖拽」这两个在 DOM 管理上天然冲突的技术点。音效系统和多主题系统的细节处理体现了资深工程师的思维。主要不足在于超长列表下的拖拽命中算法在处理「深层嵌套意图识别」时略显单薄,且键盘导航的交互深度可进一步加强。 【KIMI】该实现是一个严重未完成的代码片段,在VirtualList类的createItemElement方法中截断,导致所有拖拽核心逻辑、键盘导航、主题切换逻辑、以及部分持久化代码完全缺失。已实现的代码展现了良好的工程化结构(类封装、清晰注释)和完整的音效系统,但关键功能如Pointer Events拖拽、虚拟化与拖拽协同、ARIA状态管理、键盘导航等均处于空白状态。从现有代码质量判断,若完整实现可能达到较高水平,但当前提交版本无法满足生产要求,建议重新生成完整代码。
相关链接
您可以通过以下链接查看更多相关内容: