|
|
@@ -29,7 +29,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="ready-footer">
|
|
|
- <button class="start-btn" :disabled="sessionCreating" @click="startDialogue">
|
|
|
+ <button class="start-btn" :disabled="sessionCreating || topicMissing" @click="startDialogue">
|
|
|
<svg v-if="!sessionCreating" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
|
<path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" />
|
|
|
@@ -40,7 +40,8 @@
|
|
|
<span v-else class="start-btn-spinner" />
|
|
|
{{ sessionCreating ? '创建中…' : '开始对话' }}
|
|
|
</button>
|
|
|
- <p v-if="sessionError" class="session-error-text">{{ sessionError }}</p>
|
|
|
+ <p v-if="topicMissing" class="session-error-text">至少设置topic</p>
|
|
|
+ <p v-else-if="sessionError" class="session-error-text">{{ sessionError }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -105,6 +106,8 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
configId: '',
|
|
|
})
|
|
|
|
|
|
+const speakingStore = useSpeakingStore()
|
|
|
+
|
|
|
const dialogueState = ref<PreviewDialogueState>('ready')
|
|
|
const sessionCreating = ref(false)
|
|
|
const sessionError = ref<string | null>(null)
|
|
|
@@ -112,6 +115,8 @@ const preparedSession = ref<SessionStartInfo | null>(null)
|
|
|
const historyChecked = ref(false)
|
|
|
const historyLoadToken = ref(0)
|
|
|
|
|
|
+const topicMissing = computed(() => !(speakingStore.config.topic ?? '').trim())
|
|
|
+
|
|
|
const runtimeParams = computed(() => {
|
|
|
const params = new URLSearchParams(window.location.search)
|
|
|
return {
|
|
|
@@ -409,8 +414,6 @@ function resetPreview() {
|
|
|
}
|
|
|
|
|
|
// ── Sync with speakingStore (让 CanvasTool 可以驱动"重置预览") ──
|
|
|
-const speakingStore = useSpeakingStore()
|
|
|
-
|
|
|
watch(dialogueState, (s) => { speakingStore.setPreviewState(s) }, { immediate: true })
|
|
|
|
|
|
watch(
|