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/patientRegister/PatientRegisterList.vue b/src/components/patientRegister/PatientRegisterList.vue index 01b9ccd..74f801d 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">
- - - - + + + + - - + + - - + + - - + + - - + + - - - - - - - - - + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - + + + - - + + - + - +
@@ -142,10 +142,13 @@ import { savePeoplePhoto } from "../../utlis/proApi"; import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue"; import Camera from "../../components/patientRegister/Camera.vue"; +import { UTable, UTableColumn } from "umy-ui"; export default { components: { PatientRegisterEdit, Camera, + UTable, + UTableColumn, }, data() { return { @@ -236,9 +239,9 @@ export default { //挂载完成 mounted() { - this.$nextTick(() => { - this.scrollFull() - }) + // this.$nextTick(() => { + // this.scrollFull() + // }) }, computed: { ...mapState(["window", "dict", "patientRegister", "customerOrg"]), @@ -585,24 +588,42 @@ export default { //滚动加载数据 - scrollFull() { - this.dom = this.$refs['dataList'].bodyWrapper - console.log('obj', 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', obj.scrollTop, 'clientHeight', obj.clientHeight, 'scrollHeight', obj.scrollHeight); - if (Number(this.loadOpts.skipCount) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) { - this.lazyLoading = false - } else { - this.lazyLoading = true - this.load() - // 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['dataList'].bodyWrapper + // console.log('obj', 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', obj.scrollTop, 'clientHeight', obj.clientHeight, 'scrollHeight', obj.scrollHeight); + // if (Number(this.loadOpts.skipCount) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) { + // this.lazyLoading = false + // } else { + // this.lazyLoading = true + // this.load() + // // this.dom.scrollTop = this.dom.scrollTop - 100 + // } + // } + // }) }, btnExport(elId) { let tableDatas = deepCopy(this.tableData) @@ -637,6 +658,7 @@ export default { };