bug
This commit is contained in:
@@ -107,7 +107,9 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
values: {
|
values: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true, handler() {
|
deep: true, handler(v) {
|
||||||
|
|
||||||
|
console.log(v)
|
||||||
if (this.currentType == 'map') {
|
if (this.currentType == 'map') {
|
||||||
// this.renderMap()
|
// this.renderMap()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ export default {
|
|||||||
const keys = Object.keys(res.data[0])
|
const keys = Object.keys(res.data[0])
|
||||||
const list = res.data
|
const list = res.data
|
||||||
let dynamicData = []
|
let dynamicData = []
|
||||||
if (item.type === 'table') {
|
if (item.type === 'table' || item.type === 'AiDvTable') {
|
||||||
dynamicData = keys.map(v => {
|
dynamicData = keys.map(v => {
|
||||||
let obj = {}
|
let obj = {}
|
||||||
list.forEach((item, index) => {
|
list.forEach((item, index) => {
|
||||||
|
|||||||
@@ -85,7 +85,6 @@
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
init (value) {
|
init (value) {
|
||||||
console.log(this.config)
|
|
||||||
if (!value.length) {
|
if (!value.length) {
|
||||||
this.header = []
|
this.header = []
|
||||||
this.body = []
|
this.body = []
|
||||||
@@ -95,24 +94,19 @@
|
|||||||
|
|
||||||
const headerKey = Object.keys(value[0])[0]
|
const headerKey = Object.keys(value[0])[0]
|
||||||
const bodyKey = Object.keys(value[0]).filter(v => {
|
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 => {
|
this.header = value.map(v => {
|
||||||
return {
|
return {
|
||||||
v: v[headerKey],
|
v: v[headerKey]
|
||||||
align: v.align,
|
|
||||||
width: Number(v.width || 0) ? (Number(v.width || 0) + (this.isShowIndex === '1' ? 0 : 0)) : ''
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
this.body = bodyKey.map(v => {
|
this.body = bodyKey.map(v => {
|
||||||
return value.map(e => {
|
return value.map(e => {
|
||||||
return {
|
return {
|
||||||
v: e[v],
|
v: e[v]
|
||||||
color: e.color,
|
|
||||||
align: e.align,
|
|
||||||
width: e.width || ''
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user