|
|
|
@ -129,6 +129,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="pc-actions">
|
|
|
|
<div class="pc-actions">
|
|
|
|
<button class="pc-btn preview" @click.stop="openPreview(i)">预览</button>
|
|
|
|
<button class="pc-btn preview" @click.stop="openPreview(i)">预览</button>
|
|
|
|
|
|
|
|
<button class="pc-btn export" @click.stop="exportSingleScheme(i)">📥 导出</button>
|
|
|
|
<button class="pc-btn select" @click.stop="selectScheme(i)">选择此方案</button>
|
|
|
|
<button class="pc-btn select" @click.stop="selectScheme(i)">选择此方案</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -143,8 +144,11 @@
|
|
|
|
<span class="pc-badge" :class="getBadgeClass(previewIndex)">{{ getSchemeLabel(previewIndex) }}</span>
|
|
|
|
<span class="pc-badge" :class="getBadgeClass(previewIndex)">{{ getSchemeLabel(previewIndex) }}</span>
|
|
|
|
<h2>{{ previewScheme.name }}</h2>
|
|
|
|
<h2>{{ previewScheme.name }}</h2>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-header-actions">
|
|
|
|
|
|
|
|
<button class="btn-sm outline" @click="exportPreviewScheme">📥 导出</button>
|
|
|
|
<button class="modal-close" @click="closePreview">×</button>
|
|
|
|
<button class="modal-close" @click="closePreview">×</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="modal-meta">
|
|
|
|
<div class="modal-meta">
|
|
|
|
<span>{{ previewScheme.days }}天</span>
|
|
|
|
<span>{{ previewScheme.days }}天</span>
|
|
|
|
@ -223,6 +227,7 @@
|
|
|
|
import { ref, computed, onMounted } from 'vue'
|
|
|
|
import { ref, computed, onMounted } from 'vue'
|
|
|
|
import { useItineraryStore } from '../stores/itinerary'
|
|
|
|
import { useItineraryStore } from '../stores/itinerary'
|
|
|
|
import { quickPlan } from '../services/aiService'
|
|
|
|
import { quickPlan } from '../services/aiService'
|
|
|
|
|
|
|
|
import { exportToMarkdown } from '../services/exportService'
|
|
|
|
|
|
|
|
|
|
|
|
const store = useItineraryStore()
|
|
|
|
const store = useItineraryStore()
|
|
|
|
|
|
|
|
|
|
|
|
@ -393,6 +398,12 @@ function regeneratePlan() {
|
|
|
|
generatePlan()
|
|
|
|
generatePlan()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function exportSingleScheme(index) {
|
|
|
|
|
|
|
|
const scheme = allSchemes.value[index]
|
|
|
|
|
|
|
|
if (!scheme) return
|
|
|
|
|
|
|
|
exportToMarkdown(scheme, `${scheme.name || '行程规划'}.md`)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function selectScheme(index) {
|
|
|
|
function selectScheme(index) {
|
|
|
|
const scheme = allSchemes.value[index]
|
|
|
|
const scheme = allSchemes.value[index]
|
|
|
|
if (!scheme) {
|
|
|
|
if (!scheme) {
|
|
|
|
@ -424,6 +435,13 @@ function closePreview() {
|
|
|
|
previewIndex.value = -1
|
|
|
|
previewIndex.value = -1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function exportPreviewScheme() {
|
|
|
|
|
|
|
|
if (previewIndex.value < 0) return
|
|
|
|
|
|
|
|
const scheme = previewScheme.value
|
|
|
|
|
|
|
|
if (!scheme) return
|
|
|
|
|
|
|
|
exportToMarkdown(scheme, `${scheme.name || '行程规划'}.md`)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
if (store.quickSchemes.length > 0) {
|
|
|
|
if (store.quickSchemes.length > 0) {
|
|
|
|
// Stay in list view to show existing schemes
|
|
|
|
// Stay in list view to show existing schemes
|
|
|
|
@ -832,6 +850,16 @@ onMounted(() => {
|
|
|
|
background: #f0f0f5;
|
|
|
|
background: #f0f0f5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.pc-btn.export {
|
|
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
|
|
border: 1.5px solid #00b894;
|
|
|
|
|
|
|
|
color: #00b894;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.pc-btn.export:hover {
|
|
|
|
|
|
|
|
background: #f0f0f5;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.pc-btn.select {
|
|
|
|
.pc-btn.select {
|
|
|
|
background: linear-gradient(135deg, #6c5ce7, #a29bfe);
|
|
|
|
background: linear-gradient(135deg, #6c5ce7, #a29bfe);
|
|
|
|
color: #fff;
|
|
|
|
color: #fff;
|
|
|
|
@ -888,6 +916,12 @@ onMounted(() => {
|
|
|
|
border-bottom: 1px solid #eee;
|
|
|
|
border-bottom: 1px solid #eee;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.modal-header-actions {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
gap: 8px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.modal-header h2 {
|
|
|
|
.modal-header h2 {
|
|
|
|
font-size: 20px;
|
|
|
|
font-size: 20px;
|
|
|
|
font-weight: 700;
|
|
|
|
font-weight: 700;
|
|
|
|
|