From 1c1cdaeec371e8c838da010e22a4797be2388462 Mon Sep 17 00:00:00 2001 From: Rain_ <904416525@qq.com> Date: Thu, 27 Nov 2025 17:15:44 +0800 Subject: [PATCH] =?UTF-8?q?flx=EF=BC=9A=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/g-picker/g-picker.vue | 117 +++++++++++++++--- main.js | 4 +- pages/alarmPage/disposition/disposition.vue | 30 ++++- .../carViolation/disposition/disposition.vue | 28 ++++- pages/carViolation/indexTwo.vue | 67 +++++----- pages/carViolation/manualCapture/index.vue | 52 ++++++-- 6 files changed, 221 insertions(+), 77 deletions(-) diff --git a/components/g-picker/g-picker.vue b/components/g-picker/g-picker.vue index 5872eab..2510199 100644 --- a/components/g-picker/g-picker.vue +++ b/components/g-picker/g-picker.vue @@ -15,17 +15,38 @@ 确认 - - - - {{ col[filter.label] }} - + + + + + {{ col[filter.label] }} + + + + + + 加载中... + 没有更多了 - @@ -90,6 +111,11 @@ placeholder: { type: String, default: "请选择" + }, + // 每页加载数量 + pageSize: { + type: Number, + default: 50 } }, data() { @@ -98,6 +124,9 @@ columnsList: [], value_chx: [], searchName: "", + // 滚动加载相关状态 + currentPage: 1, + isLoading: false } }, watch: { @@ -115,21 +144,55 @@ this.$set(val, '_check', false) } } + // 重置页码 + this.currentPage = 1 }, immediate: true }, + // 监听搜索关键词变化,重置页码 + searchName: { + handler() { + this.currentPage = 1 + } + }, + // 监听弹窗显示状态 + show: { + handler(newVal) { + if (newVal) { + this.$nextTick(() => { + // 弹窗打开时确保滚动到顶部 + if (this.$refs.scrollView) { + this.$refs.scrollView.scrollTop = 0 + } + }) + } + } + } }, computed: { - searchList() { - const resultList = this.columnsList.filter(item => this.searchName ? item[this.filter.label].includes(this.searchName) : true) + // 计算过滤后的数据 + filteredData() { + const resultList = this.columnsList.filter(item => + this.searchName ? item[this.filter.label].includes(this.searchName) : true + ) + // 处理默认选中项 this.defaultList.forEach(item => { const find = resultList.find(ele => ele[this.filter.value] == item); if(find) { find._check = true; } }) - // console.log(resultList, 1111) return resultList; + }, + // 计算当前应该显示的数据(使用计算属性实现滚动加载) + displayData() { + // 根据当前页码和每页数量计算显示的数据范围 + const endIndex = this.currentPage * this.pageSize; + return this.filteredData.slice(0, endIndex); + }, + // 判断是否还有更多数据 + hasMoreData() { + return this.displayData.length < this.filteredData.length; } }, methods: { @@ -137,6 +200,20 @@ if (this.disabled) return this.show = true }, + // 滚动到底部加载更多 + loadMore() { + // 如果正在加载或没有更多数据,则不执行操作 + if (this.isLoading || !this.hasMoreData) return; + + this.isLoading = true; + + // 模拟异步加载延迟 + setTimeout(() => { + // 增加页码,触发计算属性重新计算显示数据 + this.currentPage++; + this.isLoading = false; + }, 100); + }, reShow() { let data = this.value.split(",") setTimeout(() => { @@ -148,14 +225,11 @@ checkItem(col, inx) { col._check = !col._check }, - // close() { - // this.show = false - // this.$emit("close") - // }, confirm() { let value = [], label = [] - this.value_chx = this.columns.filter(v => v._check) + // 从完整数据源中获取所有选中项 + this.value_chx = this.columnsList.filter(v => v._check) for (let val of this.value_chx) { value.push(val[this.filter.value]) label.push(val[this.filter.label]) @@ -216,7 +290,6 @@ .g-picker-list { min-height: 30vh; max-height: 60vh; - // overflow-y: scroll; .g-picker-item { position: relative; @@ -244,6 +317,14 @@ transform: translateY(-50%); } } + + // 加载更多提示样式 + .load-more { + text-align: center; + padding: 20rpx 0; + font-size: 24rpx; + color: #999; + } } } } diff --git a/main.js b/main.js index 4f05cc5..3f8bff2 100644 --- a/main.js +++ b/main.js @@ -88,8 +88,8 @@ export function createApp() { // app.config.globalProperties.url_config = 'http://182.90.224.237:51234/' //雄哥内网穿透地址 // app.config.globalProperties.url_config = 'http://jxj.zhgdyun.com:61212/' //杰哥内网穿透地址 // app.config.globalProperties.url_config = 'http://192.168.34.221:28888/' //郭圣雄本地 - // app.config.globalProperties.url_config = 'http://192.168.34.221:9111/' //郭圣雄本地 - app.config.globalProperties.url_config = 'http://101.43.164.214:11000/' //包头映射 + app.config.globalProperties.url_config = 'http://192.168.34.221:19113/' //郭圣雄本地 + // app.config.globalProperties.url_config = 'http://101.43.164.214:11000/' //包头映射 app.config.globalProperties.work_url = 'http://192.168.34.133:5173/wflowApp/#/' // 工作流地址 // app.config.globalProperties.url_config = 'http://182.90.224.237:51234/' //郭圣雄本地 // app.config.globalProperties.url_config = 'http://192.168.34.155:19111/' //彭洁本地 diff --git a/pages/alarmPage/disposition/disposition.vue b/pages/alarmPage/disposition/disposition.vue index 2780021..2ec8e68 100644 --- a/pages/alarmPage/disposition/disposition.vue +++ b/pages/alarmPage/disposition/disposition.vue @@ -1,16 +1,20 @@