提交 f1c552ff authored 作者: junjie's avatar junjie

feat(chart):表格chart增加id

上级 d43f6b0d
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div ref="tableContainer" :style="bg_class"> <div ref="tableContainer" :style="bg_class">
<p v-show="title_show" ref="title" :style="title_class">{{ chart.title }}</p> <p v-show="title_show" ref="title" :style="title_class">{{ chart.title }}</p>
<ux-grid <ux-grid
:id="chart.id"
ref="plxTable" ref="plxTable"
size="mini" size="mini"
style="width: 100%;" style="width: 100%;"
...@@ -109,7 +110,9 @@ export default { ...@@ -109,7 +110,9 @@ export default {
datas = [] datas = []
} }
this.$refs.plxTable.reloadData(datas) this.$refs.plxTable.reloadData(datas)
this.$nextTick(() => {
this.initStyle() this.initStyle()
})
window.onresize = function() { window.onresize = function() {
that.calcHeight() that.calcHeight()
} }
...@@ -165,15 +168,18 @@ export default { ...@@ -165,15 +168,18 @@ export default {
this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha) this.bg_class.background = hexColorToRGBA(customStyle.background.color, customStyle.background.alpha)
} }
} }
// 修改footer合计样式 // 修改footer合计样式
const s_table = document.getElementsByClassName('elx-table--footer')[0] const table = document.getElementById(this.chart.id)
const s_table = table.getElementsByClassName('elx-table--footer')
// console.log(s_table) // console.log(s_table)
let s = '' let s = ''
for (const i in this.table_header_class) { for (const i in this.table_header_class) {
s += (i === 'fontSize' ? 'font-size' : i) + ':' + this.table_header_class[i] + ';' s += (i === 'fontSize' ? 'font-size' : i) + ':' + this.table_header_class[i] + ';'
} }
s_table.setAttribute('style', s) console.log(s_table)
for (let i = 0; i < s_table.length; i++) {
s_table[i].setAttribute('style', s)
}
}, },
getRowStyle({ row, rowIndex }) { getRowStyle({ row, rowIndex }) {
if (rowIndex % 2 === 0) { if (rowIndex % 2 === 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论