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

@@ -128,7 +128,7 @@ export default defineComponent({
canvas.height = img.height canvas.height = img.height
canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height); canvas.getContext('2d').drawImage(img, 0, 0, img.width, img.height);
dataURL = canvas.toDataURL('image/png'); dataURL = canvas.toDataURL('image/png');
dataArr[index].param.nodePicBase64 = dataURL //dataArr[index].param.nodePicBase64 = dataURL
} }
xData[index].label.backgroundColor = { image: title + '?time=' + new Date() } xData[index].label.backgroundColor = { image: title + '?time=' + new Date() }
title = '' title = ''

View File

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