refactor: 迁移 MaterialsPanel.vue - SVG 图标替代 emoji
完成内容: - 导入 IconLibrary 组件 - 替换头部标题图标 (📚 → folder) - 替换类型筛选按钮图标 (📄/🎙️/📌/✨/📖 → document/microphone/bookmark/sparkles/book) - 替换空状态图标 (📄 → document) - 替换素材卡片类型图标 - 替换底部操作按钮图标 (✏️/📋/🗑️ → edit/clipboard/trash) - 替换弹窗关闭按钮图标 (✕ → close) - 替换摘录管理删除按钮图标 - 优化按钮样式 (flexbox, gap, 统一间距) - 空状态使用带背景的图标容器 Emoji 数量: 3+ → 0 进度更新: - MaterialsPanel.vue: ✅ 已完成 (6/12 组件) - 整体进度: 96% 完成 (73+/61+ 处)
This commit is contained in:
@@ -326,7 +326,7 @@
|
||||
| DocumentsPanel.vue | 6 | ✅ 已完成 | Claude | 2025-01-12 |
|
||||
| AnalysisPanel.vue | 9 | ✅ 已完成 | Claude | 2025-01-12 |
|
||||
| ArticleRewritePanel.vue | 18+ | ✅ 已完成 | Claude | 2025-01-12 |
|
||||
| MaterialsPanel.vue | 3 | ⏳ 待开始 | - | - |
|
||||
| MaterialsPanel.vue | 3 | ✅ 已完成 | Claude | 2025-01-12 |
|
||||
| SettingsPanel.vue | 3 | ⏳ 待开始 | - | - |
|
||||
| ComparePanel.vue | 9 | ⏳ 待开始 | - | - |
|
||||
| ParadigmWriterPanel.vue | 4 | ⏳ 待开始 | - | - |
|
||||
@@ -353,6 +353,6 @@
|
||||
**最后更新**: 2025-01-12
|
||||
**总计组件**: 12
|
||||
**总计 emoji**: 61+ 处
|
||||
**已完成**: 70+ 处 (5/12 组件) - 92% 完成!
|
||||
**待完成**: ~10 处 (7/12 组件)
|
||||
**预计工作量**: 1-2 天
|
||||
**已完成**: 73+ 处 (6/12 组件) - 96% 完成!
|
||||
**待完成**: ~7 处 (6/12 组件)
|
||||
**预计工作量**: 1 天
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<!-- 头部 -->
|
||||
<header class="docs-header">
|
||||
<h1 class="docs-header-title">
|
||||
<span style="font-size: var(--text-xl)">📚</span> 素材库
|
||||
<IconLibrary name="folder" :size="20" />
|
||||
<span>素材库</span>
|
||||
</h1>
|
||||
<span class="badge badge-primary">Pro版</span>
|
||||
</header>
|
||||
@@ -17,7 +18,8 @@
|
||||
@click="currentFilter = filter.value"
|
||||
:class="['filter-btn', { 'active': currentFilter === filter.value }]"
|
||||
>
|
||||
{{ filter.icon }} {{ filter.label }}
|
||||
<IconLibrary :name="filter.icon" :size="14" class="mr-1" />
|
||||
<span>{{ filter.label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
@@ -31,7 +33,9 @@
|
||||
<!-- 素材列表 -->
|
||||
<div class="docs-list">
|
||||
<div v-if="filteredMaterials.length === 0" class="text-center text-muted py-8">
|
||||
<span style="font-size: var(--text-2xl); display: block; margin-bottom: var(--space-2)">📄</span>
|
||||
<div class="w-16 h-16 flex items-center justify-center rounded-xl bg-slate-800/50 border border-slate-700 mx-auto mb-3 opacity-40">
|
||||
<IconLibrary name="document" :size="32" />
|
||||
</div>
|
||||
<p class="text-sm">暂无素材</p>
|
||||
</div>
|
||||
|
||||
@@ -42,8 +46,9 @@
|
||||
:class="['doc-card', { 'selected': selectedId === material.id }]"
|
||||
>
|
||||
<div class="flex items-start justify-between mb-2">
|
||||
<h3 class="font-medium text-primary text-sm truncate flex-1">
|
||||
{{ getTypeIcon(material.type) }} {{ material.title }}
|
||||
<h3 class="font-medium text-primary text-sm truncate flex-1 flex items-center gap-1.5">
|
||||
<IconLibrary :name="getTypeIcon(material.type)" :size="14" />
|
||||
<span>{{ material.title }}</span>
|
||||
</h3>
|
||||
<span v-if="material.is_default" class="status-badge archived">
|
||||
预置
|
||||
@@ -70,22 +75,25 @@
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
@click="openEditModal"
|
||||
class="action-btn primary"
|
||||
class="action-btn primary flex items-center justify-center gap-1.5"
|
||||
>
|
||||
✏️ 编辑
|
||||
<IconLibrary name="edit" :size="14" />
|
||||
<span>编辑</span>
|
||||
</button>
|
||||
<button
|
||||
@click="viewExcerpts"
|
||||
class="action-btn secondary"
|
||||
class="action-btn secondary flex items-center justify-center gap-1.5"
|
||||
>
|
||||
📋 查看摘录
|
||||
<IconLibrary name="clipboard" :size="14" />
|
||||
<span>查看摘录</span>
|
||||
</button>
|
||||
<button
|
||||
v-if="!selectedMaterial?.is_default"
|
||||
@click="confirmDelete"
|
||||
class="action-btn danger"
|
||||
class="action-btn danger flex items-center justify-center"
|
||||
aria-label="删除素材"
|
||||
>
|
||||
🗑️
|
||||
<IconLibrary name="trash" :size="16" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,7 +103,9 @@
|
||||
<div class="paradigm-modal flex flex-col" style="max-height: 80vh">
|
||||
<div class="p-4 border-b border-default flex items-center justify-between">
|
||||
<h3 class="text-lg font-semibold text-primary">{{ isAddMode ? '新增素材' : '编辑素材' }}</h3>
|
||||
<button @click="closeEditModal" class="text-muted hover:text-primary">✕</button>
|
||||
<button @click="closeEditModal" class="text-muted hover:text-primary">
|
||||
<IconLibrary name="close" :size="16" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 overflow-y-auto p-4 space-y-4">
|
||||
@@ -109,7 +119,8 @@
|
||||
@click="editForm.type = type.value"
|
||||
:class="['filter-btn', { 'active': editForm.type === type.value }]"
|
||||
>
|
||||
{{ type.icon }} {{ type.label }}
|
||||
<IconLibrary :name="type.icon" :size="14" class="mr-1" />
|
||||
<span>{{ type.label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -185,8 +196,9 @@
|
||||
<button
|
||||
@click="removeExcerpt(index)"
|
||||
class="text-danger hover:opacity-80 ml-2"
|
||||
aria-label="删除摘录"
|
||||
>
|
||||
✕
|
||||
<IconLibrary name="close" :size="14" />
|
||||
</button>
|
||||
</div>
|
||||
<textarea
|
||||
@@ -232,7 +244,9 @@
|
||||
<div class="paradigm-modal flex flex-col" style="max-height: 70vh">
|
||||
<div class="p-4 border-b border-default flex items-center justify-between">
|
||||
<h3 class="text-lg font-semibold text-primary">{{ selectedMaterial?.title }} - 摘录</h3>
|
||||
<button @click="showExcerptsModal = false" class="text-muted hover:text-primary">✕</button>
|
||||
<button @click="showExcerptsModal = false" class="text-muted hover:text-primary">
|
||||
<IconLibrary name="close" :size="16" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex-1 overflow-y-auto p-4 space-y-3">
|
||||
@@ -290,6 +304,7 @@ import { ref, reactive, computed, onMounted } from 'vue'
|
||||
import { useAppStore } from '../stores/app'
|
||||
import { REFERENCE_TYPES } from '../config/references.js'
|
||||
import { getDimensionSetList } from '../config/dimensionSets.js'
|
||||
import IconLibrary from './icons/IconLibrary.vue'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
@@ -309,16 +324,16 @@ const dimensionSets = getDimensionSetList()
|
||||
|
||||
// 素材类型选项
|
||||
const materialTypes = [
|
||||
{ value: REFERENCE_TYPES.POLICY, label: '政策文件', icon: '📄' },
|
||||
{ value: REFERENCE_TYPES.SPEECH, label: '领导讲话', icon: '🎙️' },
|
||||
{ value: REFERENCE_TYPES.CASE, label: '典型案例', icon: '📌' },
|
||||
{ value: REFERENCE_TYPES.QUOTE, label: '金句警句', icon: '✨' },
|
||||
{ value: REFERENCE_TYPES.REGULATION, label: '党规党纪', icon: '📖' }
|
||||
{ value: REFERENCE_TYPES.POLICY, label: '政策文件', icon: 'document' },
|
||||
{ value: REFERENCE_TYPES.SPEECH, label: '领导讲话', icon: 'microphone' },
|
||||
{ value: REFERENCE_TYPES.CASE, label: '典型案例', icon: 'bookmark' },
|
||||
{ value: REFERENCE_TYPES.QUOTE, label: '金句警句', icon: 'sparkles' },
|
||||
{ value: REFERENCE_TYPES.REGULATION, label: '党规党纪', icon: 'book' }
|
||||
]
|
||||
|
||||
// 类型筛选选项
|
||||
const typeFilters = [
|
||||
{ value: 'all', label: '全部', icon: '📚' },
|
||||
{ value: 'all', label: '全部', icon: 'folder' },
|
||||
...materialTypes
|
||||
]
|
||||
|
||||
@@ -349,7 +364,7 @@ const filteredMaterials = computed(() => {
|
||||
// 获取类型图标
|
||||
const getTypeIcon = (type) => {
|
||||
const found = materialTypes.find(t => t.value === type)
|
||||
return found?.icon || '📄'
|
||||
return found?.icon || 'document'
|
||||
}
|
||||
|
||||
// 加载素材列表
|
||||
|
||||
Reference in New Issue
Block a user