fix:修复表格不显示的bug

This commit is contained in:
xcool
2022-10-12 00:56:17 +08:00
parent 8de9f57ebb
commit c9e4231d2d
2 changed files with 17 additions and 5 deletions

View File

@@ -111,11 +111,13 @@
<div v-if="text.value!='3'&&text.value!='2'&&text.value!='1'">
{{ text.value }}</div>
</div>
<div v-else-if="col.dataIndex === 'option_title'">
<div class="mxd-lc-detail-table-row"
v-if="text.type === 0 || text.type === 1"
v-if="text.type == 0 || text.type == 1"
v-html="text.value"></div>
<img v-if="text.type === 2"
<img v-if="text.type == 2"
:src="text.value"
style="width: 40px; height: 40px" />
</div>
@@ -154,11 +156,12 @@
<div v-if="text.value!='3'&&text.value!='2'&&text.value!='1'">
{{ text.value }}</div>
</div>
<div v-else-if="col.dataIndex === 'option_title'">
<div class="mxd-lc-detail-table-row"
v-if="text.type === 0 || text.type === 1"
v-if="text.type == 0 || text.type == 1"
v-html="text.value"></div>
<img v-if="text.type === 2"
<img v-if="text.type == 2"
:src="text.value"
style="width: 40px; height: 40px" />
</div>
@@ -305,13 +308,18 @@ watch(() => props.info, (info) => {
const _c1 = [].concat(info.raw_data.columns)
c1.value = []
c1.value = _c1.map((item) => {
if (item?.children) {
item.children.map((e) => { e.dataIndex = e.key; childrenlist.push(e.key) })
}
if (item?.children) {
item.children.map((e) => { e.dataIndex = e.key; childrenlist.push(e.key) })
} else {
item.slots = { customRender: item.key }
item.dataIndex = item.key
item.fixed = item.key === 'sort' ? 'left' : null
// childrenlist.push(item.key )
}
// }
return {
...item,
width: 200,
@@ -319,6 +327,7 @@ watch(() => props.info, (info) => {
}
})
// 处理表格data数据
debugger;
d1.value = info.raw_data.data.map((item, index) => {
for (let i in item) {
if (childrenlist.indexOf(i) > -1 && item[i].value == 0) {
@@ -337,6 +346,7 @@ watch(() => props.info, (info) => {
const _c2 = [].concat(info.zero_data.columns)
c2.value = []
// 带children的key存进去
c2.value = _c2.map(item => {
if (item?.children) {
item.children.map((e) => { e.dataIndex = e.key; childrenlist2.push(e.key) })
@@ -344,6 +354,7 @@ watch(() => props.info, (info) => {
item.slots = { customRender: item.key }
item.dataIndex = item.key
item.fixed = item.key === 'sort' ? 'left' : null
// childrenlist2.push(item.key)
}
return {
...item,
@@ -351,6 +362,7 @@ watch(() => props.info, (info) => {
align: 'center'
}
})
debugger;
d2.value = info.zero_data.data.map((item, index) => {
for (let i in item) {
if (childrenlist2.indexOf(i) > -1 && item[i].value == 0) {