Commit cbcda931 by luyt

fix;调试处理table多级表头的顺序问题

1 parent 63132d83
This diff could not be displayed because it is too large.
...@@ -189,14 +189,32 @@ export default { ...@@ -189,14 +189,32 @@ export default {
// addHtml: 'shareImgUrl', // addHtml: 'shareImgUrl',
children: [ children: [
{ {
label: '直播状态3', label: '直播状态1-1',
prop: 'liveStatus3', prop: 'aiveStatus3',
line: 1
// addHtml: 'shareImgUrl'
},
{
label: '直播状态1-2',
prop: 'yiveStatus4',
line: 1 line: 1
// addHtml: 'shareImgUrl' // addHtml: 'shareImgUrl'
}, },
{ {
label: '直播状态4', label: '直播状态1-3',
prop: 'liveStatus4', prop: 'civeStatus3',
line: 1
// addHtml: 'shareImgUrl'
},
{
label: '直播状态1-4',
prop: 'diveStatus4',
line: 1
// addHtml: 'shareImgUrl'
},
{
label: '直播状态1-5',
prop: 'kiveStatus4',
line: 1 line: 1
// addHtml: 'shareImgUrl' // addHtml: 'shareImgUrl'
} }
...@@ -209,10 +227,42 @@ export default { ...@@ -209,10 +227,42 @@ export default {
// addHtml: 'shareImgUrl', // addHtml: 'shareImgUrl',
children: [ children: [
{ {
label: '直播状态3', label: '直播状态2-1',
prop: 'liveStatus3', prop: 'liveStatus3',
line: 1 line: 1
// addHtml: 'shareImgUrl' // addHtml: 'shareImgUrl'
},
{
label: '直播状态2-2',
prop: 'kiveStatus3',
line: 1
// addHtml: 'shareImgUrl'
}
]
},
{
label: '直播状态3',
prop: 'liveStatus2',
line: 1,
// addHtml: 'shareImgUrl',
children: [
{
label: '直播状3-1',
prop: 'liveStatus3',
line: 1
// addHtml: 'shareImgUrl'
},
{
label: '直播状态3-2',
prop: 'kiveStatus3',
line: 1
// addHtml: 'shareImgUrl'
},
{
label: '直播状态3-3',
prop: 'oiveStatus3',
line: 1
// addHtml: 'shareImgUrl'
} }
] ]
} }
......
...@@ -45,10 +45,12 @@ ...@@ -45,10 +45,12 @@
<template v-if="item.addSymbol"> <template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span> <span v-text="item.addSymbol"></span>
</template> </template>
</template>
<!-- 递归 --> </template>
<!-- 递归 -->
<sub-el-table-column v-if="item.children" :data="item.children" :tableData="tableData" :getListApi="getListApi"></sub-el-table-column> <sub-el-table-column v-if="item.children" :data="item.children" :tableData="tableData" :getListApi="getListApi"></sub-el-table-column>
</el-table-column> </el-table-column>
<el-table-column v-if="tableParams.tableOption" label="操作" :align="tableParams.tableOption.align || 'left'" :width="tableParams.tableOption.width || '200'" fixed="right"> <el-table-column v-if="tableParams.tableOption" label="操作" :align="tableParams.tableOption.align || 'left'" :width="tableParams.tableOption.width || '200'" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
......
<template> <template>
<div class="sub-el-table-column"> <div class="sub-el-table-column">
<el-table-column v-for="(item, index) in reverseData" :key="index" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'left'" :sortable="item.sortable" :render-header="item.renderHeader" v-bind="item.columnattrs ? item.columnattrs : {}" v-on="item.columnlisteners ? item.columnlisteners : {}" > <el-table-column v-for="(item, index) in reverseData" :key="index+'child'" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'left'" :sortable="item.sortable" :render-header="item.renderHeader" v-bind="item.columnattrs ? item.columnattrs : {}" v-on="item.columnlisteners ? item.columnlisteners : {}" >
<template slot-scope="scope"> <template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
...@@ -31,15 +31,16 @@ ...@@ -31,15 +31,16 @@
</el-popover> </el-popover>
<!-- <span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span> --> <!-- <span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span> -->
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }"> <span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ tableData[scope.$index][item.prop] || '--' }} {{ tableData[scope.$index][item.prop] || '--' }}-{{scope.$index}}
</span> </span>
</template> </template>
<template v-if="item.addSymbol"> <template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span> <span v-text="item.addSymbol"></span>
</template> </template>
</template> </template>
<!-- 递归 --> <!-- 递归 -->
<sub-el-table-column v-if="item.children" :data="item.children" :tableData="tableData" :getListApi="getListApi"></sub-el-table-column> <sub-el-table-column v-if="item.children" :data="item.children" :tableData="tableData" :getListApi="getListApi"></sub-el-table-column>
</el-table-column> </el-table-column>
</div> </div>
...@@ -67,7 +68,10 @@ export default { ...@@ -67,7 +68,10 @@ export default {
}, },
computed: { computed: {
reverseData() { reverseData() {
return [...this.data].reverse() let arr = [...this.data]
let temp = arr.pop()
arr.unshift(temp)
return arr
} }
}, },
components: { components: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!