zhangxiaoxu123
2022-09-13 08b5ddfa9a0a2ed52bd7d7b98ca16ef4dcc610a6
src/pages/components/shebaoZhengjiShouru/shebaoZhengjiShouruTotal.vue
@@ -3,6 +3,8 @@
     <div class="danwei-box">单位:人</div>
     <div class="shebaoZhengjiShouruForm-table">
       <el-table
         :cell-style="handleCellStyle"
         :max-height="tableHeight"
         border
         style="width: 100%"
         :data="totalTableData">
@@ -38,6 +40,7 @@
</template>
<script>
  import nowSize from "../../../libs/nowSize";
    export default {
        name: "shebaoZhengjiShouruTotal",
        props: {
@@ -50,7 +53,24 @@
        },
        data() {
            return {
                tableHeight: window.innerHeight - nowSize(380)
            }
        },
        methods: {
            getHeight() {
                this.tableHeight = window.innerHeight - nowSize(350)
            },
            handleCellStyle({rowIndex, columnIndex}) {
                if(columnIndex == 0) {
                    return { background:'#51D2FF' }
                }
            },
        },
        created() {
            window.addEventListener('resize', this.getHeight)
        },
        destroy() {
            window.addEventListener('resize', this.getHeight)
        }
    }
</script>