feat: 数据结构修改

master
JINGYJ 1 day ago
parent 596e5e46ec
commit a8efdbec6c

@ -34,16 +34,15 @@
<span>语音角色</span>
<p v-for="(v, k) in item['语音角色']" :key="k">
<span>角色{{Number( k ) + 1}}</span>
<span style="font-weight: normal">{{ v }}</span>
<span style="font-weight: normal">{{ transformKeyframes(v) }}</span>
</p>
<!-- <span style="font-weight: normal">{{ item["语音角色"] }}</span> -->
</div>
<div class="type-first-mid-box-text" v-else>
<span>关键帧:</span>
<span
v-for="item1 in item[`${title}时间`]"
style="font-weight: normal"
>{{ item1 }}</span
>{{ transformKeyframes(item[`${title}时间`]) }}</span
>
</div>
</div>
@ -85,6 +84,19 @@ const pagination = ref({ page: 1, pageSize: 8 });
function changePage({ 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>
<style lang="scss" scoped>
.type-first {

Loading…
Cancel
Save