@@ -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 {
};