Skip to content

Commit bddda55

Browse files
committed
chore: 优化音频源文件选择器,添加文件格式提示和成功通知
1 parent bbad67c commit bddda55

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

frontend/src/components/Keytone_album.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,23 @@
104104
<q-card>
105105
<q-card-section class="row items-center q-pb-none text-h6"> 载入新的音频源文件 </q-card-section>
106106

107-
<q-card-section> <div>文件类型可以是WAV、MP3、OGG。</div></q-card-section>
107+
<!-- <q-card-section> <div>文件类型可以是WAV、MP3、OGG。</div></q-card-section> -->
108108

109109
<q-card-section>
110+
<div class="text-gray-600 text-xs">点击选择或直接往此处拖放文件</div>
110111
<q-file
111112
:class="['w-56', 'zl-ll']"
112113
dense
113114
v-model="files"
114-
label="点此选择文件"
115+
label="音频源文件"
115116
outlined
116117
use-chips
117118
multiple
118119
append
119120
accept=".wav,.mp3,.ogg"
120121
excludeAcceptAllOption
121122
style="max-width: 300px"
123+
hint="支持 WAV、MP3、OGG 格式"
122124
/>
123125
</q-card-section>
124126

@@ -160,6 +162,7 @@
160162
161163
timeout: 5,
162164
});
165+
return;
163166
}
164167
} catch (error) {
165168
console.error(`Error uploading file ${file.name}:`, error);
@@ -172,8 +175,17 @@
172175
173176
timeout: 5,
174177
});
178+
return;
175179
}
176180
}
181+
nextTick(() => {
182+
q.notify({
183+
type: 'positive',
184+
position: 'top',
185+
message: `添加成功`,
186+
timeout: 5,
187+
});
188+
});
177189
}
178190
"
179191
color="primary"

0 commit comments

Comments
 (0)