refactor: ScriptView 删除 read 模式 + 兼容旧模式,统一对话流入口
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<!-- 短消息气泡(chat/system 短消息) -->
|
||||
<view v-if="isShortMessage && messageType !== 'script'" class="chat-bubble system">
|
||||
<!-- 短消息气泡(短消息) -->
|
||||
<view v-if="isShortMessage" class="chat-bubble system">
|
||||
<text>{{ content }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 长文本卡片(story-card),按 messageType 渲染不同按钮 -->
|
||||
<!-- 长文本卡片(story-card) -->
|
||||
<view v-else class="story-card" :class="{ collapsed }">
|
||||
<view class="story-head">
|
||||
<view class="story-title-wrap">
|
||||
@@ -45,23 +45,14 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- script 专属按钮组 -->
|
||||
<view v-if="messageType === 'script'" class="script-actions">
|
||||
<button v-if="canRewrite" class="action-btn" @click="$emit('rewrite')">改写</button>
|
||||
<button v-if="canContinue" class="action-btn" @click="$emit('continue-script')">续写</button>
|
||||
<button v-if="hasChildren" class="action-btn" @click="$emit('view-versions')">查看历史版本</button>
|
||||
<button v-if="canDelete" class="action-btn danger" @click="$emit('delete-version')">删除版本</button>
|
||||
<button class="action-btn primary" @click="$emit('play-tts')">
|
||||
<text class="action-icon">{{ ttsIcon || '▶' }}</text>
|
||||
<text>{{ ttsText || '播放' }}</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
<!-- chat / 旧版兼容按钮组 -->
|
||||
<view v-else class="result-actions">
|
||||
<!-- 按旧版布局统一按钮组 -->
|
||||
<view class="result-actions">
|
||||
<button class="action-btn" @click="$emit('change-direction')">换个方向</button>
|
||||
<button class="action-btn" @click="$emit('not-like-me')">不像我</button>
|
||||
<button class="action-btn" @click="$emit('continue')">继续生成</button>
|
||||
<button v-if="canContinue" class="action-btn" @click="$emit('continue-script')">续写</button>
|
||||
<button v-if="canRewrite" class="action-btn" @click="$emit('rewrite')">改写</button>
|
||||
<button v-if="hasChildren" class="action-btn" @click="$emit('view-versions')">查看历史版本</button>
|
||||
<button v-if="canDelete" class="action-btn danger" @click="$emit('delete-version')">删除版本</button>
|
||||
<button class="action-btn primary" @click="$emit('play-tts')">
|
||||
<text class="action-icon">{{ ttsIcon || '▶' }}</text>
|
||||
<text>{{ ttsText || '播放' }}</text>
|
||||
@@ -81,7 +72,6 @@ const props = defineProps({
|
||||
ttsIcon: { type: String, default: '▶' },
|
||||
ttsText: { type: String, default: '播放' },
|
||||
// 新增
|
||||
messageType: { type: String, default: 'script', validator: v => ['script', 'chat', 'system'].includes(v) },
|
||||
versionLabel: { type: String, default: '' },
|
||||
hasChildren: { type: Boolean, default: false },
|
||||
canDelete: { type: Boolean, default: false },
|
||||
|
||||
Reference in New Issue
Block a user