提交一波,继续处理数据结构

This commit is contained in:
aixianling
2024-04-15 14:31:13 +08:00
parent e72f7c5e9f
commit fdfbaad6d8
9 changed files with 392 additions and 255 deletions

38
ui/dv/AiDvTabs.vue Normal file
View File

@@ -0,0 +1,38 @@
<script>
import AiDvRender from "./AiDvRender";
export default {
name: "AiDvTabs",
model: {
prop: "active",
event: "input"
},
props: {
active: String,
config: Object,
values: Object
},
components: {AiDvRender},
computed: {
layers: v => {
const tab = v.config?.tabs[v.active]
const values = v.values[tab.label]
return tab.comps?.map(e => ({dataType: "staticData", ...e, staticData: values[e.label]}))?.filter(e => e.type) || []
}
}
}
</script>
<template>
<section class="AiDvTabs">
<ai-dv-render class="fill" v-for="(e,i) in layers" :key="i" :data="e"/>
</section>
</template>
<style scoped lang="scss">
.AiDvTabs {
display: flex;
flex-direction: column;
gap: 16px
}
</style>