新增: 资料导入增强+剪贴板+框选多选+未保存自动暂存+图片占位
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
===================================================================== -->
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
|
||||
import { store } from '../core/store'
|
||||
import type { LibItem } from '../core/types'
|
||||
|
||||
@@ -46,6 +47,16 @@ function firstSlideTitle(item: LibItem): string {
|
||||
const el = item?.deck?.slides?.[0]?.elements?.[0]
|
||||
return el?.type === 'title' ? (el.content || '无标题') : '无标题'
|
||||
}
|
||||
|
||||
/* 上次未入库的工作区草稿(改了没保存就关/刷新),提示继续编辑 */
|
||||
const workDraft = computed(() => {
|
||||
if (!store.getActiveLibId() && store.hasWorkDeck()) {
|
||||
const d = store.getDeck()
|
||||
const t = d.slides[0]?.elements.find(e => e.type === 'title')
|
||||
return { title: t?.content || '未命名草稿', pages: d.slides.length }
|
||||
}
|
||||
return null
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -64,6 +75,15 @@ function firstSlideTitle(item: LibItem): string {
|
||||
<p class="home-desc">轻量在线演示工具 · 支持 AI 创作与本地资料导入</p>
|
||||
</header>
|
||||
|
||||
<!-- 未保存草稿恢复 -->
|
||||
<button v-if="workDraft" class="draft-resume" @click="emit('open-deck')">
|
||||
<span class="draft-icon">⏵</span>
|
||||
<span class="draft-info">
|
||||
<strong>继续编辑「{{ workDraft.title }}」</strong>
|
||||
<span>{{ workDraft.pages }} 页 · 上次未保存的草稿已自动暂存</span>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<!-- 快捷入口 -->
|
||||
<div class="home-actions">
|
||||
<button class="action-card" @click="emit('new-blank')">
|
||||
@@ -171,6 +191,27 @@ function firstSlideTitle(item: LibItem): string {
|
||||
color: var(--ui-muted, #64748b);
|
||||
}
|
||||
|
||||
/* 未保存草稿恢复卡片 */
|
||||
.draft-resume {
|
||||
display: flex; align-items: center; gap: 14px;
|
||||
width: 100%; padding: 14px 18px;
|
||||
border: 1px solid var(--ui-primary, #4f46e5);
|
||||
border-radius: 12px;
|
||||
background: color-mix(in srgb, var(--ui-primary, #4f46e5) 6%, var(--ui-panel, #fff));
|
||||
cursor: pointer; text-align: left;
|
||||
transition: box-shadow .15s, transform .15s;
|
||||
}
|
||||
.draft-resume:hover { box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.08)); transform: translateY(-1px); }
|
||||
.draft-icon {
|
||||
width: 36px; height: 36px; border-radius: 50%;
|
||||
background: var(--ui-primary, #4f46e5); color: #fff;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
font-size: 16px; flex-shrink: 0;
|
||||
}
|
||||
.draft-info { display: flex; flex-direction: column; gap: 2px; }
|
||||
.draft-info strong { font-size: 14px; color: var(--ui-text, #1e293b); }
|
||||
.draft-info span { font-size: 12px; color: var(--ui-muted, #64748b); }
|
||||
|
||||
/* 快捷入口网格 */
|
||||
.home-actions {
|
||||
display: grid;
|
||||
|
||||
Reference in New Issue
Block a user