|
@@ -12,7 +12,7 @@
|
|
|
<div style="display: flex;align-items: center;">
|
|
|
<!-- <el-button type="primary" size="small" @click="exportHtml" style="margin-right: 10px;">导出html</el-button> -->
|
|
|
<el-button type="primary" size="small" @click="exportExcel" style="margin-right: 10px;">导出Excel</el-button>
|
|
|
- <el-switch v-model="mode" active-text="详情模式" inactive-text="简易模式">
|
|
|
+ <el-switch v-model="mode" active-text="详情模式" inactive-text="简易模式" @change="changeMode">
|
|
|
</el-switch>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -42,7 +42,7 @@
|
|
|
<div class="cd_table">
|
|
|
<el-table ref="table" :data="tableData" border :fit="true" v-loading="isLoading" style="width: 100%"
|
|
|
:header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }" :row-class-name="tableRowClassName"
|
|
|
- class="table">
|
|
|
+ class="table" :height="tableHeight" :key="mode">
|
|
|
<el-table-column label="序号" prop="number" width="70px" align="center">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="项目" width="150px" align="center">
|
|
@@ -256,7 +256,7 @@
|
|
|
<div>{{ scope.row.psType == '1' ? '造型结构' : scope.row.psType == '2' ? '开源硬件' : scope.row.psType == '3' ? '软件设计' : scope.row.psType == '4' ? '总分' : '—' }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="150px" align="center">
|
|
|
+ <el-table-column fixed="right" label="操作" width="180px" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <div
|
|
|
@click="getAll(scope.row)"
|
|
@@ -348,6 +348,7 @@ export default {
|
|
|
total: 0,
|
|
|
page: 1,
|
|
|
pageSize: 10,
|
|
|
+ tableHeight:"500px",
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -617,6 +618,13 @@ export default {
|
|
|
this.dataArray = a;
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
+ changeMode(){
|
|
|
+ this.tableHeight =
|
|
|
+ window.innerHeight - this.$refs.table.$el.offsetTop - 50;
|
|
|
+ if (this.tableHeight <= 530) {
|
|
|
+ this.tableHeight = 530;
|
|
|
+ }
|
|
|
+ },
|
|
|
exportExcel() {
|
|
|
if (!this.tableData.length) {
|
|
|
this.$message.error('请等待加载数据')
|
|
@@ -821,6 +829,22 @@ export default {
|
|
|
this.timer = null;
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.$nextTick(function () {
|
|
|
+ this.tableHeight =
|
|
|
+ window.innerHeight - this.$refs.table.$el.offsetTop - 50;
|
|
|
+ if (this.tableHeight <= 530) {
|
|
|
+ this.tableHeight = 530;
|
|
|
+ }
|
|
|
+ // 监听窗口大小变化
|
|
|
+ let self = this;
|
|
|
+ window.onresize = function () {
|
|
|
+ self.tableHeight =
|
|
|
+ window.innerHeight - self.$refs.table.$el.offsetTop - 50;
|
|
|
+ if (self.tableHeight <= 530) {
|
|
|
+ self.tableHeight = 530;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ });
|
|
|
this.isLoading = true;
|
|
|
this.getData();
|
|
|
this.selectAllType();
|