大概可以看的一版

This commit is contained in:
aixianling
2024-04-15 15:35:57 +08:00
parent fdfbaad6d8
commit 7a0538dff0
5 changed files with 244 additions and 216 deletions

View File

@@ -1,6 +1,4 @@
<script>
import AiDvRender from "./AiDvRender";
export default {
name: "AiDvTabs",
model: {
@@ -12,12 +10,17 @@ export default {
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) || []
layers: {
set(settings) {
console.log(settings)
},
get() {
const v = this
const tab = v.config?.tabs[v.active]
const values = v.values[tab.label]?.data || {}
return tab.comps?.map(e => ({dataType: "staticData", ...e, staticData: Array.isArray(values) ? values : values[e.label]}))?.filter(e => e.type) || []
}
}
}
}
@@ -25,7 +28,7 @@ export default {
<template>
<section class="AiDvTabs">
<ai-dv-render class="fill" v-for="(e,i) in layers" :key="i" :data="e"/>
<ai-dv-render class="fill" v-for="(e,i) in layers" :key="i" :data="layers[i]" :index="i"/>
</section>
</template>
@@ -33,6 +36,7 @@ export default {
.AiDvTabs {
display: flex;
flex-direction: column;
gap: 16px
gap: 16px;
height: 100%;
}
</style>