|
@@ -82,7 +82,7 @@
|
|
|
<div class="form">
|
|
|
<div class="label">申请信息:</div>
|
|
|
<div class="text">
|
|
|
- <el-table border :data="detail.use_data" style="width: 100%">
|
|
|
+ <el-table border :data="filteredData" style="width: 100%">
|
|
|
<el-table-column
|
|
|
label="实验室名称"
|
|
|
min-width="200"
|
|
@@ -100,6 +100,13 @@
|
|
|
<template #default="{ row }">{{ row.time_name }}</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <el-button
|
|
|
+ v-if="detail.use_data.length > 3"
|
|
|
+ style="width: 100%; border-top: none"
|
|
|
+ @click="showAllData"
|
|
|
+ >
|
|
|
+ {{ showButtonText }}
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="item">
|
|
@@ -126,7 +133,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="handleClose">确 定</el-button>
|
|
|
</span>
|
|
|
<enclosureDetail ref="enclosure-detil" />
|
|
|
</el-dialog>
|
|
@@ -147,15 +154,37 @@
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
detail: '',
|
|
|
+ visibleData: [], // 仅显示的前三行数据
|
|
|
+ showAll: false, // 控制是否显示全部数据
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
computed: {
|
|
|
...mapGetters({
|
|
|
token: 'user/token',
|
|
|
}),
|
|
|
+ // 计算属性,根据showAll状态切换显示的数据
|
|
|
+ filteredData() {
|
|
|
+ return this.showAll
|
|
|
+ ? this.detail.use_data
|
|
|
+ : this.detail.use_data.slice(0, 3)
|
|
|
+ },
|
|
|
+ showButtonText() {
|
|
|
+ return this.showAll ? '收起' : '更多'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 监听showAll状态的变化,切换visibleData数据
|
|
|
+ showAll(newVal) {
|
|
|
+ this.visibleData = newVal
|
|
|
+ ? this.detail.use_data
|
|
|
+ : this.detail.use_data.slice(0, 3)
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
+ showAllData() {
|
|
|
+ // 点击更多按钮时切换showAll状态
|
|
|
+ this.showAll = !this.showAll
|
|
|
+ },
|
|
|
//查看文件
|
|
|
lookEnclosure(row, type) {
|
|
|
this.$refs['enclosure-detil'].showEdit(row, type)
|
|
@@ -169,6 +198,7 @@
|
|
|
},
|
|
|
handleClose() {
|
|
|
this.dialogVisible = false
|
|
|
+ this.showAll = false
|
|
|
},
|
|
|
showEdit(id) {
|
|
|
this.recordDetail(id)
|