|
@@ -74,6 +74,26 @@ const audiolist = ref<any[]>([])
|
|
|
const audioOptions = ref<any[]>([])
|
|
|
|
|
|
onMounted(async () => {
|
|
|
+ watchEffect(() => {
|
|
|
+ if (aiData.value.length > 0) {
|
|
|
+ list.value.forEach((item) => {
|
|
|
+ //@ts-ignore
|
|
|
+ const exist = aiData.value.find((i) => i.sid === item.sid)
|
|
|
+ if (exist) {
|
|
|
+ //@ts-ignore
|
|
|
+ item.audioFilePath = exist.audioFilePath
|
|
|
+ //@ts-ignore
|
|
|
+ item.audioId = exist.audioId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // const arrayUniqueByKey = [
|
|
|
+ // ...new Map(allData.map((item) => [item['sid'], item])).values()
|
|
|
+ // ]
|
|
|
+ //
|
|
|
+ // // list.value = arrayUniqueByKey.filter((item) => item.audioFilePath)
|
|
|
+ // console.log('arr', list.value)
|
|
|
+ }
|
|
|
+ })
|
|
|
active.value = true
|
|
|
const res = await fetchTtsList(main.sceneCode)
|
|
|
if (res) {
|
|
@@ -97,7 +117,7 @@ onMounted(async () => {
|
|
|
const videoData = JSON.parse(boxVideos.value)
|
|
|
const boxData = JSON.parse(boxModels.value)
|
|
|
console.log('boxVideos', videoData)
|
|
|
- if (videoData && aiData.value.length === 0) {
|
|
|
+ if (videoData) {
|
|
|
list.value = list.value.concat(
|
|
|
videoData.map((item) => {
|
|
|
return {
|
|
@@ -108,7 +128,7 @@ onMounted(async () => {
|
|
|
})
|
|
|
)
|
|
|
}
|
|
|
- if (videoData && aiData.value.length === 0) {
|
|
|
+ if (boxData) {
|
|
|
list.value = list.value.concat(
|
|
|
boxData.map((item) => {
|
|
|
return {
|
|
@@ -122,11 +142,7 @@ onMounted(async () => {
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
-watchEffect(() => {
|
|
|
- if (aiData.value.length > 0) {
|
|
|
- list.value = aiData.value
|
|
|
- }
|
|
|
-})
|
|
|
+
|
|
|
onUnmounted(() => {
|
|
|
// setWidthSceneRef(0)
|
|
|
})
|