表格调整完毕

This commit is contained in:
aixianling
2024-04-16 17:42:57 +08:00
parent 8f21db5ca3
commit 7393eeb858
5 changed files with 66 additions and 75 deletions

View File

@@ -1,9 +1,10 @@
<template>
<div class="AiDvRender" style="width: 100%; height: 100%;">
<ai-dv-display v-if="currentType === 'display'" :title="data.title" :list="values"/>
<ai-dv-tabs v-else-if="currentType=='tabs'" :config="data" :theme="theme"/>
<ai-dv-panel
style="height: 100%; width: 100%;"
v-if="currentType !== 'display'"
v-else
:padding="data.padding"
:title="data.title"
:theme="theme"
@@ -33,7 +34,7 @@
:stripe="data.stripe"
:theme="theme"
:isShowIndex="data.isShowIndex"
:config="dvTableConfig"
:config="data.config"
:data="values" :simple="data.simple==1">
</AiDvTable>
<AiRanking
@@ -65,12 +66,6 @@
<ai-dv-plot v-else-if="currentType=='plot'" :options="data.charts" :instance="instance"/>
<ai-assist v-else-if="currentType=='aiAssist'"/>
<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.toString()" :class="{active:activeTab==i}"/>
</div>
<ai-dv-tabs v-model="activeTab" :config="data" :values="values"/>
</template>
</ai-dv-panel>
</div>
</template>
@@ -116,7 +111,6 @@ export default {
map: null,
lib: null,
timer: null,
dvTableConfig: [],
mapDialog: false,
activeTab: '0'
}
@@ -132,33 +126,6 @@ export default {
deep: true, handler() {
if (this.currentType == 'map') {
this.renderMap()
} else if (this.currentType === 'tabs') {
//数据驱动内容生成,新增tab中的内容由设置的数据来生成
const meta = this.$copy(this.data.tabs)
this.data.tabs = Object.entries(this.values).map(([label, v]) => {
const tab = meta.find(e => e.label === label)
const comps = []
if (Array.isArray(v.data)) {
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)
comps.push({label: name, ...layer})
})
}
return {label, comps}
})
} else if (this.currentType === 'AiDvTable') {
this.dvTableConfig = this.data[this.data.dataType].map((v, i) => {
return {
color: this.data.config?.[i]?.color || '',
width: this.data.config?.[i]?.width || '',
align: this.data.config?.[i]?.align || '',
}
})
this.data.config = this.dvTableConfig
}
}
}
@@ -394,20 +361,5 @@ export default {
right: 32px;
backdrop-filter: blur(10px);
}
.tabItem {
color: #1FBECC;
background: #1f9ecc29;
padding: 0 10px;
line-height: 20px;
margin-left: 4px;
font-size: 12px;
user-select: none;
&.active {
border: 1px solid #20B4C5;
color: #02FEFF;
}
}
}
</style>