| | |
| | | } |
| | | </style> |
| | | <template> |
| | | <div class="below-standard-main"> |
| | | <div class="below-standard-main bg-1"> |
| | | <div style="width: 100%; height: 100%"> |
| | | <div> |
| | | <el-row class="title"> |
| | |
| | | :tableData="tableData" |
| | | :column="column" |
| | | :tableLoading="tableLoading" |
| | | :height="'calc(100vh - 270px)'" |
| | | :parentSpanMethod="spanMethod" |
| | | :height="tableHeight+''" |
| | | :page="page" |
| | | @pagination="pagination" |
| | | ></lims-table> |
| | |
| | | this.entityCopy = this.HaveJson(this.entity); |
| | | this.refreshTable(); |
| | | }, |
| | | created() { |
| | | this.getTableHeight(); |
| | | }, |
| | | methods: { |
| | | // 表格合并 |
| | | spanMethod({row,column,rowIndex,columnIndex}) { |
| | | // 需要合并的列 |
| | | const needSpan = [1] |
| | | if(needSpan.includes(columnIndex)) { |
| | | // 如果是第一行 或者 当前行的值和上一行的值不一样 就要开始进行计算合并 |
| | | if(rowIndex == 0 || row.entrustCode != this.tableData[rowIndex -1 ].entrustCode) { |
| | | // 向下找到和当前行不一样的行数 |
| | | let rowSpan = 1; |
| | | while(rowIndex + rowSpan < this.tableData.length && row.entrustCode == this.tableData[rowIndex + rowSpan].entrustCode) { |
| | | rowSpan++ |
| | | } |
| | | return [rowSpan,1] |
| | | }else { |
| | | // 如果和上一行的值一样 就隐藏 |
| | | return [0,0] |
| | | } |
| | | }else{ |
| | | return [1,1] |
| | | } |
| | | }, |
| | | getTableHeight() { |
| | | this.tableHeight = window.innerHeight - 50 - 46 - 60 - 80 - 30 - 30 - 32; |
| | | }, |
| | | getData() { |
| | | this.tableLoading = true; |
| | | pageInsUnPass({ |
| | | current: this.page.current, |
| | | limit: this.page.size, |
| | | size: this.page.size, |
| | | model: this.entity.model, |
| | | sample: this.entity.sample, |
| | | }).then((res) => { |
| | |
| | | this.page.total = res.data.total; |
| | | }); |
| | | }, |
| | | pagination({current,limit}) { |
| | | this.page.current = current; |
| | | pagination({page,limit}) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getData(); |
| | | }, |