This commit is contained in:
yanran200730
2023-03-15 16:10:33 +08:00
parent 529e0ddccf
commit fe682e7a2b
3 changed files with 7 additions and 11 deletions

View File

@@ -107,7 +107,9 @@ export default {
watch: {
values: {
immediate: true,
deep: true, handler() {
deep: true, handler(v) {
console.log(v)
if (this.currentType == 'map') {
// this.renderMap()
}

View File

@@ -115,7 +115,7 @@ export default {
const keys = Object.keys(res.data[0])
const list = res.data
let dynamicData = []
if (item.type === 'table') {
if (item.type === 'table' || item.type === 'AiDvTable') {
dynamicData = keys.map(v => {
let obj = {}
list.forEach((item, index) => {

View File

@@ -85,7 +85,6 @@
methods: {
init (value) {
console.log(this.config)
if (!value.length) {
this.header = []
this.body = []
@@ -95,24 +94,19 @@
const headerKey = Object.keys(value[0])[0]
const bodyKey = Object.keys(value[0]).filter(v => {
return v !== headerKey && ['color', 'width', 'align'].indexOf(v) === -1
return v !== headerKey
})
this.header = value.map(v => {
return {
v: v[headerKey],
align: v.align,
width: Number(v.width || 0) ? (Number(v.width || 0) + (this.isShowIndex === '1' ? 0 : 0)) : ''
v: v[headerKey]
}
})
this.body = bodyKey.map(v => {
return value.map(e => {
return {
v: e[v],
color: e.color,
align: e.align,
width: e.width || ''
v: e[v]
}
})
})