diff --git a/src/assets/css/global_table.css b/src/assets/css/global_table.css index 7c9efae..e52c145 100644 --- a/src/assets/css/global_table.css +++ b/src/assets/css/global_table.css @@ -72,7 +72,8 @@ /* 设置表体样式 */ .el-table td.el-table__cell, -.plTableBox .el-table td.is-center { +.plTableBox .el-table td.is-center, +.plTableBox .el-table td { padding: 0; color: #52555F; /* 设置表体文字颜色 */ diff --git a/src/components/doctorCheck/PatientRegisterList.vue b/src/components/doctorCheck/PatientRegisterList.vue index 5e8bc76..afef860 100644 --- a/src/components/doctorCheck/PatientRegisterList.vue +++ b/src/components/doctorCheck/PatientRegisterList.vue @@ -90,28 +90,28 @@ - - - + :row-class-name="tableRowClassName" @table-body-scroll="scrollFull" use-virtual :row-height="23" big-data-checkbox :data-changes-scroll-top="false"> + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - + + + - - + + - - + + - - + + - - - - - - + + + + + +
@@ -194,13 +194,15 @@ import moment from "moment"; import { mapState, mapMutations } from "vuex"; import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { dddw, objCopy, arrayReduce, deepCopy } from "../../utlis/proFunc" - +import { UTable, UTableColumn } from "umy-ui"; import CusOrgOCX from "../../components/report/CusOrgOCX.vue" export default { components: { CusOrgOCX, + UTable, + UTableColumn, }, props: ['win', 'winAbsolute'], data() { @@ -262,9 +264,9 @@ export default { //挂载完成 mounted() { - this.$nextTick(() => { - this.scrollFull() - }) + // this.$nextTick(() => { + // this.scrollFull() + // }) }, computed: { ...mapState(["window", "dataTransOpts", "dict", "customerOrg", "patientRegister", "doctorCheck", "sumDoctorCheck", "report"]), @@ -544,28 +546,47 @@ export default { async load() { this.loadOpts.skipCount++ await this.getPrList() + this.lazyLoading = false; }, //滚动加载数据 - scrollFull() { - this.dom = this.$refs['info'].bodyWrapper - console.log('this.dom', this.dom) - - this.dom.addEventListener('scroll', async () => { - // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight); - if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) { - // 获取到的不是全部数据 当滚动到底部 - console.log('scrollTop', this.dom.scrollTop, 'clientHeight', this.dom.clientHeight, 'scrollHeight', this.dom.scrollHeight); - if ((Number(this.loadOpts.skipCount) + 1) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) { - this.lazyLoading = false - } else { - this.lazyLoading = true - await this.load() - this.lazyLoading = false - // this.dom.scrollTop = this.dom.scrollTop - 100 - } - } - }) + async scrollFull(scroll, event) { + if (!scroll.judgeFlse) return; + + // 正在加载时阻止重复触发 + if (this.lazyLoading) return; + if ( + (Number(this.loadOpts.skipCount) + 1) * + Number(this.loadOpts.maxResultCount) >= + Number(this.loadOpts.totalCount) + ) { + return; + } + + this.lazyLoading = true; + try { + await this.load(); + } catch (e) { + console.error('scrollFull load error', e); + } + // this.dom = this.$refs['info'].bodyWrapper + // console.log('this.dom', this.dom) + + // this.dom.addEventListener('scroll', async () => { + // // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight); + // if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) { + // // 获取到的不是全部数据 当滚动到底部 + // console.log('scrollTop', this.dom.scrollTop, 'clientHeight', this.dom.clientHeight, 'scrollHeight', this.dom.scrollHeight); + // if ((Number(this.loadOpts.skipCount) + 1) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) { + // this.lazyLoading = false + // } else { + // this.lazyLoading = true + // await this.load() + // this.lazyLoading = false + // // this.dom.scrollTop = this.dom.scrollTop - 100 + // } + // } + // }) }, //关闭 diff --git a/src/components/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index 01b9ccd..a3b1bd4 100644 --- a/src/components/patientRegister/PatientRegisterList.vue +++ b/src/components/patientRegister/PatientRegisterList.vue @@ -9,7 +9,7 @@ : Math.floor(((window.pageHeight - 250) * 2) / 3) " highlight-current-row @row-click="rowClick" @row-dblclick="dblClick" size="small" row-key="id" @selection-change="handleSelectionChange" @row-contextmenu="onCellRightClick" ref="info" id="info" - :row-class-name="handleRowClassName" use-virtual :row-height="25" @table-body-scroll="scrollFull" + :row-class-name="handleRowClassName" use-virtual :row-height="35" @table-body-scroll="scrollFull" big-data-checkbox :data-changes-scroll-top="false"> = - Number(this.loadOpts.totalCount) - ) { - return; - } else { - await this.load(); - } + if (!scroll.judgeFlse) return; + + // 正在加载时阻止重复触发 + if (this.lazyLoading) return; + if ( + (Number(this.loadOpts.skipCount) + 1) * + Number(this.loadOpts.maxResultCount) >= + Number(this.loadOpts.totalCount) + ) { + return; + } + + this.lazyLoading = true; + try { + await this.load(); + } catch (e) { + console.error('scrollFull load error', e); } // this.dom = this.$refs.info.bodyWrapper // console.log('this.dom', this.dom) diff --git a/src/components/patientRegister/PatientRegisterRecoverList.vue b/src/components/patientRegister/PatientRegisterRecoverList.vue index b2b2109..881f108 100644 --- a/src/components/patientRegister/PatientRegisterRecoverList.vue +++ b/src/components/patientRegister/PatientRegisterRecoverList.vue @@ -1,44 +1,44 @@