Commit 10705f77 by haojie

1

parent 581b5739
...@@ -84,13 +84,16 @@ ...@@ -84,13 +84,16 @@
<template v-else-if="it.type == 'select'"> <template v-else-if="it.type == 'select'">
<CustomSelect <CustomSelect
:options="it.options" :options="it.options"
:name="it.name"
v-model="it.value" v-model="it.value"
:item="{}" :item="{}"
:align="it.align" :align="it.align"
:audio="it.audio" :audio="it.audio"
:audio_list="[]"
:is_watch="it.watch ? it.watch : false" :is_watch="it.watch ? it.watch : false"
width="100%" width="100%"
@change="SelectChange" @change="SelectChange"
@ValueChange="SelectValueChange"
></CustomSelect> ></CustomSelect>
</template> </template>
<template v-else-if="it.type == 'textarea'"> <template v-else-if="it.type == 'textarea'">
...@@ -191,7 +194,7 @@ import ManualResponseSvg from '@/assets/svg/form/ManualResponse.svg'; ...@@ -191,7 +194,7 @@ import ManualResponseSvg from '@/assets/svg/form/ManualResponse.svg';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { show_message } from '@/utils/tdesign_tool'; import { show_message } from '@/utils/tdesign_tool';
import { getFormParams } from '@/constants/admin_form'; import { getFormParams } from '@/constants/admin_form';
import { ref } from 'vue'; import { reactive, ref } from 'vue';
const props = defineProps<{ const props = defineProps<{
form: any; form: any;
}>(); }>();
...@@ -273,6 +276,18 @@ const onDelete = async () => { ...@@ -273,6 +276,18 @@ const onDelete = async () => {
realDelete(); realDelete();
} }
}; };
// 记录当前语音和语言
const CurrentConfig = reactive({
language: '',
voice: '',
});
// 语音列表
const SelectValueChange = (name: string, value: string) => {
if (name == 'language' || name == 'voice') {
CurrentConfig[name] = value;
}
};
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
></t-option> ></t-option>
</TSelect> </TSelect>
<template v-if="audio"> <template v-if="audio">
<CustomAudio></CustomAudio> <CustomAudio :url="audio_list"></CustomAudio>
</template> </template>
</div> </div>
</template> </template>
...@@ -47,6 +47,8 @@ const props = withDefaults( ...@@ -47,6 +47,8 @@ const props = withDefaults(
audio?: boolean; audio?: boolean;
is_watch?: any; is_watch?: any;
filterable?: boolean; filterable?: boolean;
audio_list?: string[];
name?: string;
}>(), }>(),
{ {
width: '357px', width: '357px',
...@@ -54,15 +56,17 @@ const props = withDefaults( ...@@ -54,15 +56,17 @@ const props = withDefaults(
audio: false, audio: false,
is_watch: false, is_watch: false,
filterable: false, filterable: false,
audio_list: () => [],
} }
); );
const emit = defineEmits(['update:modelValue', 'change']); const emit = defineEmits(['update:modelValue', 'change', 'ValueChange']);
const SelectValue = ref(props.modelValue); const SelectValue = ref(props.modelValue);
watch( watch(
() => SelectValue.value, () => SelectValue.value,
(v) => { (v) => {
emit('update:modelValue', v); emit('update:modelValue', v);
emit('ValueChange', props.name, v);
if (props.is_watch) { if (props.is_watch) {
emit('change', v, props.is_watch); emit('change', v, props.is_watch);
} }
......
...@@ -44,6 +44,8 @@ const ManagementForm = reactive({ ...@@ -44,6 +44,8 @@ const ManagementForm = reactive({
// 删除api // 删除api
delete_api: '1', delete_api: '1',
submit_api: '1', submit_api: '1',
// 是否试听
//能否重置 //能否重置
reset: true, reset: true,
// 是否转换为语音 -- 自定义方法 // 是否转换为语音 -- 自定义方法
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment