mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 10:03:54 +08:00
feat: 完成音色克隆页面样式改造
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="$t('voiceClone.dialogTitle')" :visible.sync="visible" width="900px" top="10vh"
|
<CustomDialog
|
||||||
:before-close="handleClose" class="voice-clone-dialog">
|
:title="$t('voiceClone.dialogTitle')"
|
||||||
|
:visible.sync="innerVisible"
|
||||||
|
width="900px"
|
||||||
|
:footer="false"
|
||||||
|
@close="handleDialogClose"
|
||||||
|
>
|
||||||
<div class="dialog-content">
|
<div class="dialog-content">
|
||||||
<!-- 步骤指示器 -->
|
<!-- 步骤指示器 -->
|
||||||
<div class="steps-header">
|
<div class="steps-header">
|
||||||
@@ -73,22 +78,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="custom-footer">
|
||||||
<span slot="footer" class="dialog-footer">
|
<CustomButton @click="handleCancel">
|
||||||
<el-button @click="handleClose">{{ currentStep === 1 ? $t('voiceClone.cancel') : $t('voiceClone.prevStep')
|
{{ currentStep === 1 ? $t('voiceClone.cancel') : $t('voiceClone.prevStep') }}
|
||||||
}}</el-button>
|
</CustomButton>
|
||||||
<el-button type="primary" @click="handleNext" :loading="uploading">
|
<CustomButton type="confirm" :loading="uploading" @click="handleNext">
|
||||||
{{ currentStep === 1 ? $t('voiceClone.nextStep') : $t('voiceClone.upload') }}
|
{{ currentStep === 1 ? $t('voiceClone.nextStep') : $t('voiceClone.upload') }}
|
||||||
</el-button>
|
</CustomButton>
|
||||||
</span>
|
</div>
|
||||||
</el-dialog>
|
</CustomDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Api from "@/apis/api";
|
import Api from "@/apis/api";
|
||||||
|
import CustomDialog from './CustomDialog.vue';
|
||||||
|
import CustomButton from './CustomButton.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'VoiceCloneDialog',
|
name: 'VoiceCloneDialog',
|
||||||
|
components: {
|
||||||
|
CustomDialog,
|
||||||
|
CustomButton
|
||||||
|
},
|
||||||
props: {
|
props: {
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -122,6 +133,14 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
innerVisible: {
|
||||||
|
get() {
|
||||||
|
return this.visible;
|
||||||
|
},
|
||||||
|
set(val) {
|
||||||
|
this.$emit('update:visible', val);
|
||||||
|
}
|
||||||
|
},
|
||||||
selectedDuration() {
|
selectedDuration() {
|
||||||
if (this.selectionStart !== null && this.selectionEnd !== null && this.audioBuffer) {
|
if (this.selectionStart !== null && this.selectionEnd !== null && this.audioBuffer) {
|
||||||
const duration = this.audioBuffer.duration;
|
const duration = this.audioBuffer.duration;
|
||||||
@@ -146,14 +165,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleClose() {
|
handleCancel() {
|
||||||
if (this.currentStep === 2) {
|
if (this.currentStep === 2) {
|
||||||
this.currentStep = 1;
|
this.currentStep = 1;
|
||||||
} else {
|
} else {
|
||||||
this.resetDialog();
|
|
||||||
this.$emit('update:visible', false);
|
this.$emit('update:visible', false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleDialogClose() {
|
||||||
|
this.resetDialog();
|
||||||
|
},
|
||||||
resetDialog() {
|
resetDialog() {
|
||||||
this.currentStep = 1;
|
this.currentStep = 1;
|
||||||
this.audioFile = null;
|
this.audioFile = null;
|
||||||
@@ -509,13 +530,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.voice-clone-dialog {
|
|
||||||
::v-deep .el-dialog__body {
|
|
||||||
padding: 20px 30px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.steps-header {
|
.steps-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -578,7 +592,6 @@ export default {
|
|||||||
background: #e4e7ed;
|
background: #e4e7ed;
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.step-content {
|
.step-content {
|
||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
}
|
}
|
||||||
@@ -685,10 +698,7 @@ export default {
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
.custom-footer {
|
||||||
.dialog-footer {
|
text-align: right;
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user