|
@@ -111,6 +111,7 @@ import { useMainStore } from '@/store'
|
|
const main = useMainStore()
|
|
const main = useMainStore()
|
|
const showModal = ref(false)
|
|
const showModal = ref(false)
|
|
|
|
|
|
|
|
+const formId = ref()
|
|
const form = reactive({
|
|
const form = reactive({
|
|
document: '',
|
|
document: '',
|
|
voiceType: 0,
|
|
voiceType: 0,
|
|
@@ -118,12 +119,20 @@ const form = reactive({
|
|
volume: 0.5
|
|
volume: 0.5
|
|
})
|
|
})
|
|
|
|
|
|
-const emits = defineEmits(['close','submit'])
|
|
|
|
|
|
+const emits = defineEmits(['close', 'submit'])
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
show: {
|
|
show: {
|
|
type: Boolean,
|
|
type: Boolean,
|
|
default: false
|
|
default: false
|
|
|
|
+ },
|
|
|
|
+ isEditing: {
|
|
|
|
+ type: Boolean,
|
|
|
|
+ default: false
|
|
|
|
+ },
|
|
|
|
+ data: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: () => {}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
const handleShow = (show: boolean) => {
|
|
const handleShow = (show: boolean) => {
|
|
@@ -177,6 +186,12 @@ const activeType = computed(() => (type) => form.voiceType === type)
|
|
|
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
showModal.value = props.show
|
|
showModal.value = props.show
|
|
|
|
+ if (props.isEditing) {
|
|
|
|
+ formId.value = props.data.id
|
|
|
|
+ console.log('props.data', props.data)
|
|
|
|
+ form.document = props.data.document
|
|
|
|
+ // form.document = props.data.document
|
|
|
|
+ }
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|