From 77536cfa95b1e3c5e60f94dce3a53aa2e93f121a Mon Sep 17 00:00:00 2001
From: zhangxiaoxu123 <819527061@qq.com>
Date: 星期三, 14 九月 2022 17:35:54 +0800
Subject: [PATCH] echarts添加显示隐藏按钮
---
src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoChikaRenshu.vue | 74 ++++++++++++++++++++++++++++++++-----
1 files changed, 64 insertions(+), 10 deletions(-)
diff --git a/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoChikaRenshu.vue b/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoChikaRenshu.vue
index 05a9df6..a653ca2 100644
--- a/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoChikaRenshu.vue
+++ b/src/pages/show/shehuiBaozhang/shehuiBaozhangChildren/shebaoChikaRenshu.vue
@@ -2,18 +2,25 @@
<div class="shebaoChikaRenshu-wrap">
<h1>鍚勫幙锛堝競銆佸尯锛�2021骞村氨涓氭儏鍐电粺璁¤〃</h1>
<el-table
+ :cell-style="handleCellStyle"
+ :max-height="tableHeight"
:data="tableData"
stripe
border
style="width: 100%">
- <el-table-column
- align="center"
- prop="dataName"
- label="鎸囨爣鍚嶇О"
- fixed="left"
- width="220">
- </el-table-column>
- <el-table-column
+ <template v-for="(item,index) in headerArry">
+ <el-table-column
+ :key="index"
+ align="center"
+ :prop="item.val"
+ :label="item.time">
+ <template slot-scope="scope">
+ <span>{{scope.row[index].val}}</span>
+ </template>
+ </el-table-column>
+ </template>
+
+ <!--<el-table-column
prop="yearFinish"
align="center"
label="鍘诲勾瀹屾垚"
@@ -78,13 +85,15 @@
prop="december"
align="center"
label="12鏈�">
- </el-table-column>
+ </el-table-column>-->
</el-table>
</div>
</template>
<script>
- import baoxianForm from "../../../components/juminYanglaoBaoxian/baoxianForm";
+ import {getCardNumsTable} from '@/api/shehuiBaozhang'
+ import baoxianForm from "../../../components/juminYanglaoBaoxian/baoxianForm";
+ import nowSize from "../../../../libs/nowSize";
export default {
name: "shebaoChikaRenshu",
components: {
@@ -93,7 +102,49 @@
data() {
return {
tableData: [],
+ headerArry: [],
+ tableHeight: window.innerHeight - nowSize(250)
}
+ },
+ mounted() {
+ this.getCardNumsTable()
+ },
+ methods: {
+ getCardNumsTable(){
+ getCardNumsTable().then(res => {
+ if(res.code == 1000) {
+ let result = res.list
+ let data = []
+ result.forEach((item,index) => {
+ let row = item.dataList
+ row.unshift({
+ time: '鎸囨爣',
+ val: item.name
+ })
+ data.push(row)
+ if(index == 0) {
+ this.headerArry = row
+ }
+
+ })
+ this.tableData = data
+ }
+ })
+ },
+ getHeight() {
+ this.tableHeight = window.innerHeight - nowSize(250)
+ },
+ handleCellStyle({rowIndex, columnIndex}) {
+ if(columnIndex == 0) {
+ return { background:'#51D2FF' }
+ }
+ }
+ },
+ created() {
+ window.addEventListener('resize', this.getHeight)
+ },
+ destroy() {
+ window.addEventListener('resize', this.getHeight)
}
}
</script>
@@ -133,6 +184,9 @@
color: $color-darkGrey;
font-weight: 300;
line-height: 1;
+ span{
+ font-size: $fontSize-28;
+ }
}
}
</style>
--
Gitblit v1.9.1