大概可以看的一版
This commit is contained in:
@@ -67,7 +67,7 @@
|
||||
<ai-linkage-map v-else-if="currentType=='linkageMap'" :config="data" :instance="instance"/>
|
||||
<template v-else-if="currentType=='tabs'">
|
||||
<div slot="right" class="flex">
|
||||
<div class="tabItem" v-for="(tab,i) in data.tabs" :key="i" v-text="tab.label" @click="activeTab=i" :class="{active:activeTab==i}"/>
|
||||
<div class="tabItem" v-for="(tab,i) in data.tabs" :key="i" v-text="tab.label" @click="activeTab=i.toString()" :class="{active:activeTab==i}"/>
|
||||
</div>
|
||||
<ai-dv-tabs v-model="activeTab" :config="data" :values="values"/>
|
||||
</template>
|
||||
@@ -139,7 +139,9 @@ export default {
|
||||
const tab = meta.find(e => e.label === label)
|
||||
const comps = []
|
||||
if (Array.isArray(v.data)) {
|
||||
comps.push({label: "内容", ...tab})
|
||||
const origin = tab.comps?.[0] || {}
|
||||
delete origin.comps
|
||||
comps.push({...origin, label: "内容"})
|
||||
} else {
|
||||
Object.keys(v.data).map(name => {
|
||||
const layer = tab.comps.find(e => e.label === name)
|
||||
@@ -151,9 +153,9 @@ export default {
|
||||
} else if (this.currentType === 'AiDvTable') {
|
||||
this.dvTableConfig = this.data[this.data.dataType].map((v, i) => {
|
||||
return {
|
||||
color: this.data.config[i] ? (this.data.config[i].color || '') : '',
|
||||
width: this.data.config[i] ? (this.data.config[i].width || '') : '',
|
||||
align: this.data.config[i] ? (this.data.config[i].align || '') : ''
|
||||
color: this.data.config?.[i]?.color || '',
|
||||
width: this.data.config?.[i]?.width || '',
|
||||
align: this.data.config?.[i]?.align || '',
|
||||
}
|
||||
})
|
||||
this.data.config = this.dvTableConfig
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -65,7 +65,6 @@ export default {
|
||||
if (type == "530300000000") {
|
||||
this.geoData = json.map
|
||||
this.$refs.map.chart?.setOption({series: {data: this.mapData}})
|
||||
console.log(this.$refs.map.chart?.getOption()?.series)
|
||||
}
|
||||
this.config.summaryConfigs = json.sta?.map((e, i) => ({pos: ["rt", "lb", 'lt', 'rb'][i % 4], display: "summary20", ...e})) || []
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user