From ee9021b6af8750f9abab49fef2021e488a1f6a0e Mon Sep 17 00:00:00 2001 From: liyuanchao <438964165@qq.com> Date: Sat, 23 Aug 2025 17:35:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=20=E5=91=8A=E8=AD=A6=20=20?= =?UTF-8?q?=E6=8A=A5=E4=BA=8B=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/http.api.js | 3 +- pages/sys/user/myRepair/addRepair.vue | 1 - pages/sys/user/myVisitor/myVisitor.vue | 78 +- .../workbench/earlyWarning/earlyWarning.vue | 151 +-- .../sys/workbench/earlyWarning/warnDetail.vue | 12 +- pages/sys/workbench/meet/meet.vue | 157 ++- pages/sys/workbench/monitor/monitorplay.vue | 1 - pages/sys/workbench/oa/oa.vue | 86 +- pages/sys/workbench/order/order.vue | 960 +++++++++--------- pages/sys/workbench/order/orderDetail.vue | 66 +- 10 files changed, 866 insertions(+), 649 deletions(-) diff --git a/common/http.api.js b/common/http.api.js index 854394e..4694ebe 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -60,7 +60,8 @@ const install = (Vue, vm) => { getWarnDetail:(params = {}, id) => vm.$u.get(config.adminPath+`/sis/alarmEvents/${id}`,params), getWarnEventInfo:(params = {}, alarmId) => vm.$u.get(config.adminPath+`/sis/alarmEventProcess/query/result/${alarmId}`,params), - + + getImageUrl:(params = {}, ossIds) => vm.$u.get(config.adminPath+`/resource/oss/listByIds/${ossIds}`,params), //巡检任务列表 getInspection:(params = {})=>vm.$u.get(config.adminPath+'/property/item/list',params), diff --git a/pages/sys/user/myRepair/addRepair.vue b/pages/sys/user/myRepair/addRepair.vue index 7a7e1f2..45077f6 100644 --- a/pages/sys/user/myRepair/addRepair.vue +++ b/pages/sys/user/myRepair/addRepair.vue @@ -101,7 +101,6 @@ this.realSubmit() return } - console.log("t1", this.selectedImages) const images = this.selectedImages .map(item => item?.path?.replace('file://', '') || item?.url || null) .filter(path => path !== null); diff --git a/pages/sys/user/myVisitor/myVisitor.vue b/pages/sys/user/myVisitor/myVisitor.vue index c3ce041..cdeb2e4 100644 --- a/pages/sys/user/myVisitor/myVisitor.vue +++ b/pages/sys/user/myVisitor/myVisitor.vue @@ -9,19 +9,27 @@ - - - - {{ item.visitorUnit }} - {{ getStatusLabel(item.serveStatus) }} + + + + + {{ item.visitorUnit }} + {{ getStatusLabel(item.serveStatus) }} + + {{ item.visitorName }} + {{ item.visitorPhone }} + + {{ item.visitorUnit }} + + {{ item.createTime }} - {{ item.visitorName }} - {{ item.visitorPhone }} - - {{ item.visitorUnit }} - - {{ item.createTime }} - + @@ -70,7 +78,7 @@ } }, created() { - this.loadTabData(this.activeTab); // 初始化加载当前tab数据 + this.loadAllTabsData(); // 预加载所有标签页数据 }, methods: { goBack() { @@ -84,9 +92,12 @@ async changeTab(idx) { this.activeTab = idx; + // 移除切换标签时的加载逻辑,避免重复调用接口 + /* if (!this.tabLoaded[idx]) { await this.loadTabData(idx); } + */ }, async loadTabData(idx) { this.loading = true; @@ -109,6 +120,13 @@ this.$set(this.tabLoaded, idx, true); this.loading = false; }, + async loadAllTabsData() { + for (let i = 0; i < this.tabs.length; i++) { + if (!this.tabLoaded[i]) { + await this.loadTabData(i); + } + } + }, showVisitorDetail(item) { this.detailData = item; this.showDetail = true; @@ -134,6 +152,19 @@ 3: '已完成' }; return statusMap[status] || ''; + }, + + // 添加预加载所有标签页数据的方法 + async loadAllTabsData() { + // 并行加载所有标签页数据,提高加载速度 + const loadPromises = [0, 1, 2].map((index) => { + return this.loadTabData(index); + }); + + await Promise.all(loadPromises); + + // 标记所有标签页已加载 + this.tabLoaded = [true, true, true]; } } } @@ -145,6 +176,7 @@ background: #f7f7f7; display: flex; flex-direction: column; + overflow: hidden; } .visitor-tabs { @@ -157,6 +189,15 @@ flex-shrink: 0; /* 防止被压缩 */ } + + .visitor-list-container { + flex: 1; + position: relative; + margin: 25rpx 0 0 0; + padding: 0 35rpx; + padding-bottom: 200rpx; + /* 为底部按钮留出空间 */ + } .visitor-tab { flex: 1; @@ -185,14 +226,17 @@ } .visitor-list { - margin: 25rpx 0 0 0; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; padding: 0 35rpx; - flex: 1; - /* 占据所有剩余空间 */ overflow-y: auto; - /* 内容超出时,开启垂直滚动 */ padding-bottom: 200rpx; /* 为底部按钮留出空间 */ + height: calc(100vh - 80rpx - 32rpx - 80rpx); /* 减去顶部tab区域和底部按钮高度 */ + box-sizing: border-box; } .visitor-card { diff --git a/pages/sys/workbench/earlyWarning/earlyWarning.vue b/pages/sys/workbench/earlyWarning/earlyWarning.vue index 4c80160..418efa2 100644 --- a/pages/sys/workbench/earlyWarning/earlyWarning.vue +++ b/pages/sys/workbench/earlyWarning/earlyWarning.vue @@ -1,50 +1,61 @@ - - \ No newline at end of file diff --git a/pages/sys/workbench/order/orderDetail.vue b/pages/sys/workbench/order/orderDetail.vue index a8d0e63..c983582 100644 --- a/pages/sys/workbench/order/orderDetail.vue +++ b/pages/sys/workbench/order/orderDetail.vue @@ -28,10 +28,10 @@ 发起单位/人:{{ detail.initiatorPeople }} 备注:{{ detail.remark }} 工单图片: - - + @@ -65,7 +65,8 @@ detail: {}, isManager: false, showSelect: false, - users: [] + users: [], + orderImgUrls: [] // 添加用于存储处理后的图片URL数组 }; }, onLoad(options) { @@ -76,6 +77,9 @@ // 现在可以使用item对象了 // 进度映射 this.getStepInfo() + // 处理图片URL + + this.getImageUrl() } if ((this.isManager && this.detailStep == 0) || (!this.isManager && this.detailStep == 1)) { this.getHandler() @@ -85,26 +89,37 @@ goBack() { uni.navigateBack(); }, + async getImageUrl() { + if (!this.detail.orderImgUrl) return; + + const imgIds = this.detail.orderImgUrl.split(','); + const res = await this.$u.api.getImageUrl({}, imgIds); + if (res.code == 200 && res.data) { + // 提取res.data数组中每个对象的url字段 + this.orderImgUrls = res.data.map(item => item.url); + } + }, + async getHandler() { let handlers = await this.$u.api.getHandler3({}, this.detail.type); if (handlers.code === 200) { this.users = [...this.users, ...handlers.data]; } - }, - getStepInfo(){ - if (this.detail.status == 0) { - this.detailStep = 0; - this.detailStatus = '创建工单'; - } else if (this.detail.status == 4) { - this.detailStep = 3; - this.detailStatus = '已结束'; - } else if (this.detail.status == 3) { - this.detailStep = 2; - this.detailStatus = '处理中'; - } else { - this.detailStep = 1; - this.detailStatus = '已接单'; - } + }, + getStepInfo(){ + if (this.detail.status == 0) { + this.detailStep = 0; + this.detailStatus = '创建工单'; + } else if (this.detail.status == 4) { + this.detailStep = 3; + this.detailStatus = '已结束'; + } else if (this.detail.status == 3) { + this.detailStep = 2; + this.detailStatus = '处理中'; + } else { + this.detailStep = 1; + this.detailStatus = '已接单'; + } }, previewImage(urls, index) { // 使用uView的图片预览组件 @@ -122,23 +137,22 @@ // 关闭页面前发送事件通知前页面刷新 uni.$emit('refreshData', ''); this.detail.handler = selected.value - this.detail.status = 1 + this.detail.status = 1 this.getStepInfo() } }, async submit() { let params = this.detail - if(this.detail.status == 1||this.detail.status == 2){ - params.status = 3 - }else { - params.status = 4 + if(this.detail.status == 1||this.detail.status == 2){ + params.status = 3 + }else { + params.status = 4 } let res = await this.$u.api.updateOrder2(params); if (res.code == '200') { // 关闭页面前发送事件通知前页面刷新 uni.$emit('refreshData', ''); - this.detail.status = params.status - console.log("t1", params.status) + this.detail.status = params.status this.getStepInfo() } },