feat: 数据结构修改

master
JINGYJ 2 days ago
parent 596e5e46ec
commit a8efdbec6c

@ -34,16 +34,15 @@
<span>语音角色</span> <span>语音角色</span>
<p v-for="(v, k) in item['语音角色']" :key="k"> <p v-for="(v, k) in item['语音角色']" :key="k">
<span>角色{{Number( k ) + 1}}</span> <span>角色{{Number( k ) + 1}}</span>
<span style="font-weight: normal">{{ v }}</span> <span style="font-weight: normal">{{ transformKeyframes(v) }}</span>
</p> </p>
<!-- <span style="font-weight: normal">{{ item["语音角色"] }}</span> --> <!-- <span style="font-weight: normal">{{ item["语音角色"] }}</span> -->
</div> </div>
<div class="type-first-mid-box-text" v-else> <div class="type-first-mid-box-text" v-else>
<span>关键帧:</span> <span>关键帧:</span>
<span <span
v-for="item1 in item[`${title}时间`]"
style="font-weight: normal" style="font-weight: normal"
>{{ item1 }}</span >{{ transformKeyframes(item[`${title}时间`]) }}</span
> >
</div> </div>
</div> </div>
@ -85,6 +84,19 @@ const pagination = ref({ page: 1, pageSize: 8 });
function changePage({ page, pageSize }) { function changePage({ page, pageSize }) {
pagination.value = { page, pageSize }; pagination.value = { page, pageSize };
} }
function transformKeyframes(data) {
//
const result = data.map(item => {
// item [, ]
if (Array.isArray(item) && item.length === 2) {
return `${item[0]}-${item[1]}`;
}
return ''; //
});
//
return `["${result.filter(Boolean).join('", "')}"]`;
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.type-first { .type-first {

Loading…
Cancel
Save