diff --git a/api/api.js b/api/api.js
index d4453bd..9956122 100644
--- a/api/api.js
+++ b/api/api.js
@@ -336,6 +336,9 @@ const api = {
applyList(data){
return request('/expertAPI/applyList', data, 'post', false);
},
+ patientListByGBKPage(data){
+ return request('/expertAPI/patientListByGBKPage', data, 'post', false);
+ },
patientListByGBK(data){
return request('/expertAPI/patientListByGBK', data, 'post', false);
},
diff --git a/pages.json b/pages.json
index 232a597..5503b61 100644
--- a/pages.json
+++ b/pages.json
@@ -752,6 +752,36 @@
}
}
},
+ {
+ "path": "patientMsg/patientList",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": "uni-app分页",
+ "app": {
+ "bounce": "none"
+ }
+ }
+ },
+ {
+ "path": "patientMsg/patientPlan",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": "uni-app分页",
+ "app": {
+ "bounce": "none"
+ }
+ }
+ },
+ {
+ "path": "patientMsg/patientListPerf",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": "uni-app分页",
+ "app": {
+ "bounce": "none"
+ }
+ }
+ },
{
"path": "patientGroup/patientGroup",
"style": {
diff --git a/pages_app/patientMsg/patientList.vue b/pages_app/patientMsg/patientList.vue
new file mode 100644
index 0000000..338376d
--- /dev/null
+++ b/pages_app/patientMsg/patientList.vue
@@ -0,0 +1,825 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 正在整理患者数据,请稍候...
+
+
+
+
+
+
+
+
+
+ 新的患者(待审核{{ applyList.length }}人)
+
+
+
+
+
+
+
+
+
+
+
+
+ 患者分组 (随访{{ patientListTotal }}人)
+
+
+
+
+
+
+
+
+
+
+ {{ item.nickname || item.realName }}
+
+
+
+
+
+ 随访于{{ item.joinDateYMD }}
+
+
+
+
+ 加载中...
+
+
+ 没有更多了
+
+
+
+
+
+ {{ letter }}
+
+
+
+
+
+
+
+
+
+
+ 新的患者(待审核{{ applyList.length }}人)
+
+
+
+
+
+
+
+
+
+
+
+ 患者分组
+
+
+
+
+
+
+
+
+
+ 患者消息
+
+
+ 患者列表
+
+
+
+ 随访计划
+
+
+
+
+
+
+
+
+
diff --git a/pages_app/patientMsg/patientListPerf.vue b/pages_app/patientMsg/patientListPerf.vue
new file mode 100644
index 0000000..7b82f6f
--- /dev/null
+++ b/pages_app/patientMsg/patientListPerf.vue
@@ -0,0 +1,430 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 加载真实数据
+ 强制刷新
+ 清空
+
+ 当前数据量: {{ patientList.length }},分组: {{ patientGroups.length }},当前字母: {{ activeLetter || '-' }}
+
+
+ 正在生成并整理模拟数据...
+
+
+
+
+
+
+
+ 新的患者(模拟)
+
+
+
+
+
+
+
+
+
+ {{ item.nickname || item.realName }}
+
+
+ 随访于{{ item.joinDateYMD }}
+
+
+
+
+
+
+
+ {{ letter }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages_app/patientMsg/patientMsg.vue b/pages_app/patientMsg/patientMsg.vue
index 1534209..57222fd 100644
--- a/pages_app/patientMsg/patientMsg.vue
+++ b/pages_app/patientMsg/patientMsg.vue
@@ -1,1423 +1,201 @@
-
+
-
+
-
-
-
-
-
- 添加
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 新的患者(待审核{{ applyList.length }}人)
-
-
-
-
-
-
-
-
-
-
-
- 患者分组 (随访{{ patientList.length }}人)
-
-
-
-
-
-
-
-
-
-
- {{ item.nickname || item.realName }}
-
- {{ item.badge }}
-
-
-
-
- 随访于{{ item.joinDateYMD }}
-
-
-
-
-
-
- {{ letter }}
-
-
-
-
-
-
-
-
- 新的患者(待审核{{ applyList.length }}人)
-
-
-
-
-
-
-
-
-
-
-
-
- 患者分组 (随访{{ patientList.length }}人)
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ formatDay(item.datetime) }}
-
-
-
-
-
-
- {{ item.note }}
- {{ item.patientname }}
-
-
-
-
-
-
-
-
-
- 加载中...
-
-
-
-
- 没有更多数据了
-
-
-
-
-
-
-
-
-
-
-
-
+
患者消息
-
+
患者列表
-
+
+
+
-
+
随访计划
-
-
\ No newline at end of file
+.tab-dot {
+ position: absolute;
+ top: 18rpx;
+ right: 28rpx;
+}
+
diff --git a/pages_app/patientMsg/patientPlan.vue b/pages_app/patientMsg/patientPlan.vue
new file mode 100644
index 0000000..9b0cd85
--- /dev/null
+++ b/pages_app/patientMsg/patientPlan.vue
@@ -0,0 +1,378 @@
+
+
+
+
+
+
+
+ 添加
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ formatDay(item.datetime) }}
+
+
+
+
+
+
+ {{ item.note }}
+ {{ item.patientname }}
+
+
+
+
+
+
+
+
+ 加载中...
+
+
+
+ 没有更多数据了
+
+
+
+
+
+
+
+
+
+
+ 患者消息
+
+
+ 患者列表
+
+
+
+ 随访计划
+
+
+
+
+
+
+
+
diff --git a/pages_app/selectPatient/selectPatient.vue b/pages_app/selectPatient/selectPatient.vue
index b31cdcd..f319157 100644
--- a/pages_app/selectPatient/selectPatient.vue
+++ b/pages_app/selectPatient/selectPatient.vue
@@ -29,7 +29,7 @@
-
+
{{ p.realName || p.nickname}}
@@ -60,6 +60,11 @@
const patientList = ref([])
const selectedDetail = ref([])
const availablePatientList = ref([])
+ const patientListPage = ref(1)
+ const patientListPageSize = ref(200)
+ const patientListHasMore = ref(true)
+ const patientListLoading = ref(false)
+ const patientListLoadingMore = ref(false)
const isAllSelected = computed(() => {
const total = patientList.value.length
return total > 0 && selectedIds.value.length === total
@@ -68,25 +73,103 @@
// const availablePatientList = computed(() => {
// return patientList.value
// })
- const patientListByGBK = async () => {
-
- const res = await api.patientListByGBK();
- if(res.code == 1){
- patientList.value = res.data;
- availablePatientList.value = res.data;
- nextTick(() => {
- uni.hideLoading();
- });
- // if(res.data.length > 1000){
- // setTimeout(() => {
- // uni.hideLoading();
- // }, 5000);
- // }else{
- // uni.hideLoading();
- // }
+ const isApiSuccess = (res) => Number(res?.code) === 1 || Number(res?.code) === 200
+ const parsePagedPatients = (res) => {
+ const data = res?.data
+ if (Array.isArray(data)) {
+ return { list: data, total: undefined, pageNum: undefined, pages: undefined, isLastPage: undefined }
}
-
- };
+ const list =
+ (Array.isArray(data?.list) && data.list) ||
+ (Array.isArray(data?.records) && data.records) ||
+ (Array.isArray(data?.rows) && data.rows) ||
+ (Array.isArray(data?.data) && data.data) ||
+ []
+ const total = Number(data?.total ?? data?.count ?? data?.totalCount ?? undefined)
+ const pageNum = Number(data?.pageNum ?? data?.page ?? data?.current ?? undefined)
+ const pages = Number(data?.pages ?? data?.pageCount ?? undefined)
+ const isLastPage = typeof data?.isLastPage === 'boolean' ? data.isLastPage : undefined
+ return {
+ list,
+ total: Number.isFinite(total) ? total : undefined,
+ pageNum: Number.isFinite(pageNum) ? pageNum : undefined,
+ pages: Number.isFinite(pages) ? pages : undefined,
+ isLastPage
+ }
+ }
+ const mergePatientListUnique = (base = [], incoming = []) => {
+ if (!incoming.length) return base
+ const seen = new Set()
+ const merged = []
+ const pushUnique = (item) => {
+ const key = String(item?.uuid || item?.id || item?.mobile || '')
+ if (!key) {
+ merged.push(item)
+ return
+ }
+ if (seen.has(key)) return
+ seen.add(key)
+ merged.push(item)
+ }
+ base.forEach(pushUnique)
+ incoming.forEach(pushUnique)
+ return merged
+ }
+ const applyPatientList = (list = []) => {
+ patientList.value = list
+ onSearch()
+ }
+ const patientListByGBKPage = async ({ reset = false, showLoading = false } = {}) => {
+ if (patientListLoading.value || patientListLoadingMore.value) return
+ if (!reset && !patientListHasMore.value) return
+ if (reset) {
+ patientListLoading.value = true
+ patientListPage.value = 1
+ patientListHasMore.value = true
+ } else {
+ patientListLoadingMore.value = true
+ }
+ if (showLoading) {
+ uni.showLoading({ title: '加载中...', mask: true })
+ }
+ try {
+ const requestPage = patientListPage.value
+ const res = await api.patientListByGBKPage({
+ page: requestPage,
+ pageNum: requestPage,
+ current: requestPage,
+ pageSize: patientListPageSize.value,
+ size: patientListPageSize.value
+ })
+ if (!isApiSuccess(res)) return
+ const { list, total, pageNum, pages, isLastPage } = parsePagedPatients(res)
+ const merged = reset ? list : mergePatientListUnique(patientList.value, list)
+ applyPatientList(merged)
+ if (typeof isLastPage === 'boolean') {
+ patientListHasMore.value = !isLastPage
+ } else if (typeof pages === 'number' && typeof pageNum === 'number') {
+ patientListHasMore.value = pageNum < pages
+ } else if (typeof total === 'number') {
+ patientListHasMore.value = merged.length < total
+ } else {
+ patientListHasMore.value = list.length >= patientListPageSize.value
+ }
+ if (patientListHasMore.value) {
+ patientListPage.value = typeof pageNum === 'number' ? pageNum + 1 : requestPage + 1
+ }
+ } finally {
+ patientListLoading.value = false
+ patientListLoadingMore.value = false
+ if (showLoading) {
+ nextTick(() => {
+ uni.hideLoading()
+ })
+ }
+ }
+ }
+ const onScrollToLower = () => {
+ void patientListByGBKPage({ reset: false, showLoading: false })
+ }
onLoad((options) => {
uni.showLoading({
title: '加载中...',
@@ -104,7 +187,7 @@
uni.removeStorageSync('preSelectedIds')
}
} catch (e) {}
- patientListByGBK();
+ void patientListByGBKPage({ reset: true, showLoading: true });
})
onShow(() => {