AudioPreviewTest.vue 2.41 KB
Newer Older
litzh's avatar
litzh committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
  <div class="p-6">
    <h2 class="text-xl font-bold text-white mb-4">音频预览测试</h2>

    <!-- 测试音频模板预览 -->
    <div class="mb-6">
      <h3 class="text-lg text-white mb-2">音频模板预览测试</h3>
      <div class="space-y-2">
        <div v-for="template in audioTemplates" :key="template.filename"
             class="flex items-center gap-4 p-3 bg-dark-light rounded-lg">
          <span class="text-white">{{ template.filename }}</span>
          <button @click="previewAudioTemplate(template)"
                  class="px-3 py-1 bg-laser-purple text-white rounded hover:bg-laser-purple/80">
            预览
          </button>
        </div>
        <div v-if="audioTemplates.length === 0" class="text-gray-400">
          暂无音频模板
        </div>
      </div>
    </div>

    <!-- 测试音频历史预览 -->
    <div class="mb-6">
      <h3 class="text-lg text-white mb-2">音频历史预览测试</h3>
      <div class="space-y-2">
        <div v-for="history in audioHistory" :key="history.filename"
             class="flex items-center gap-4 p-3 bg-dark-light rounded-lg">
          <span class="text-white">{{ history.filename }}</span>
          <button @click="previewAudioHistory(history)"
                  class="px-3 py-1 bg-laser-purple text-white rounded hover:bg-laser-purple/80">
            预览
          </button>
        </div>
        <div v-if="audioHistory.length === 0" class="text-gray-400">
          暂无音频历史
        </div>
      </div>
    </div>

    <!-- 调试信息 -->
    <div class="mt-6 p-4 bg-gray-800 rounded-lg">
      <h3 class="text-lg text-white mb-2">调试信息</h3>
      <div class="text-sm text-gray-300">
        <p>音频模板数量: {{ audioTemplates.length }}</p>
        <p>音频历史数量: {{ audioHistory.length }}</p>
        <div v-if="audioTemplates.length > 0">
          <p>第一个音频模板:</p>
          <pre class="text-xs bg-gray-900 p-2 rounded mt-1">{{ JSON.stringify(audioTemplates[0], null, 2) }}</pre>
        </div>
        <div v-if="audioHistory.length > 0">
          <p>第一个音频历史:</p>
          <pre class="text-xs bg-gray-900 p-2 rounded mt-1">{{ JSON.stringify(audioHistory[0], null, 2) }}</pre>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import {
  audioTemplates,
  audioHistory,
  previewAudioTemplate,
  previewAudioHistory
} from '../utils/other'
</script>