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 + // } + // } + // }) }, //关闭