From b55d1c67769dcc8d90eed2bb4f8a7dfd51e7303a Mon Sep 17 00:00:00 2001 From: zhangxiaoxu123456 <zxx19900626> Date: 星期三, 27 四月 2022 11:31:35 +0800 Subject: [PATCH] 细节样式 --- src/pages/components/qiyezhigongShebao/zhigongShebao.vue | 77 ++++++++++++++++++++++++-------------- 1 files changed, 48 insertions(+), 29 deletions(-) diff --git a/src/pages/components/qiyezhigongShebao/zhigongShebao.vue b/src/pages/components/qiyezhigongShebao/zhigongShebao.vue index 18312e0..06a042d 100644 --- a/src/pages/components/qiyezhigongShebao/zhigongShebao.vue +++ b/src/pages/components/qiyezhigongShebao/zhigongShebao.vue @@ -1,33 +1,44 @@ <template> <div class="zhigongShebao-wrap"> <el-table + :cell-style="handleCellStyle" + :height="tableHeight" border :data="tableData" :header-cell-style="handleheader" - :default-sort = "{prop: 'name', order: 'descending'}" style="width: 100%"> <el-table-column - prop="shiqu" + prop="area" label="鍘匡紙甯傘�佸尯锛�" align="center" width="250"> </el-table-column> <el-table-column sortable - prop="name" - label="浼佷笟鑱屽伐鍏昏�佷繚闄╁弬淇濅汉鏁�" + :sort-method="(a,b) => {return a.insuredNums - b.insuredNums}" + prop="insuredNums" + :label="dataType" align="center"> </el-table-column> <el-table-column sortable - prop="address" + :sort-method="(a,b) => {return a.inJobs - b.inJobs}" + prop="inJobs" label="鍦ㄨ亴鑱屽伐" align="center"> </el-table-column> <el-table-column - prop="name" sortable + :sort-method="(a,b) => {return a.outJobs - b.outJobs}" + prop="outJobs" label="绂婚��浼�" + align="center"> + </el-table-column> + <el-table-column + sortable + :sort-method="(a,b) => {return a.proportion - b.proportion}" + prop="proportion" + label="渚涘吇姣�" align="center"> </el-table-column> <el-table-column @@ -44,50 +55,58 @@ </template> <script> + import {getSecurityTable} from '@/api/shehuiBaozhang' import zhigongshebaoForm from "./zhigongshebaoForm"; + import nowSize from "../../../libs/nowSize"; export default { name: "chengzhenXinzengJiuye", components: { zhigongshebaoForm }, + props: ['type','dataType'], data() { return { zhigongshebaoVisiable: false, //寮规 - tableData: [{ - shiqu:'鍏ㄥ競', - date: '1', - name: '1', - address: '1' - }, { - shiqu:'闀垮畨鍖�', - date: '1', - name: '2', - address: '2' - }, { - shiqu:'妗ヨタ鍖�', - date: '3', - name: '3', - address: '4' - }, { - shiqu:'鏂板崕鍖�', - date: '4', - name: '4', - address: '1 ' - }] + tableData: [], + tableHeight: window.innerHeight - nowSize(230) } }, + mounted() { + this.getSecurityTable() + }, methods: { + getSecurityTable() { + getSecurityTable({type: this.type}).then(res => { + if(res.code == 1000) { + this.tableData = res.list + } + }) + }, handleClick(row) { this.zhigongshebaoVisiable = true this.$nextTick(() => { - this.$refs.zhigongshebaoForm.init() + this.$refs.zhigongshebaoForm.init(this.type,row.area) }) }, handleheader(data) { return { lineHeight: '2.5', } - } + }, + getHeight() { + this.tableHeight = window.innerHeight - nowSize(230) + }, + handleCellStyle({rowIndex, columnIndex}) { + if(columnIndex == 0) { + return { background:'#51D2FF' } + } + }, + }, + created() { + window.addEventListener('resize', this.getHeight) + }, + destroyed() { + window.addEventListener('resize', this.getHeight) } } </script> -- Gitblit v1.9.1