diff --git a/pages/login/index.vue b/pages/login/index.vue index dae9952..282ca87 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -220,8 +220,8 @@ export default { uni.switchTab({ url: "/pages/conversation/conversationList/index", }); - await getSMSCodeFromOa(this.loginInfo.phoneNumber); - await loginOaByPhone(this.loginInfo.phoneNumber) + await getSMSCodeFromOa(this.loginInfo.phoneNumber); + await loginOaByPhone(this.loginInfo.phoneNumber) this.loginInfo.password = ""; this.loading = false; diff --git a/pages/workbench/construction/construction.vue b/pages/workbench/construction/construction.vue index 7342f3a..b9ac424 100644 --- a/pages/workbench/construction/construction.vue +++ b/pages/workbench/construction/construction.vue @@ -3,38 +3,53 @@ - 点击对应的行可以查看详情 + 点击对应的卡片可以查看详情 + + + + + + + 新增汇报 + - - - - - 汇报标题 - 最近汇报时间 - 汇报日期 - 汇报人 - 涉及项目 - 备注 + + + {{ item.reportTitle || '-' }} + + + 最近汇报时间: + {{ formatDate(item.lastUpdateTime) }} - - - {{ item.reportTitle || '-' }} - {{ formatDate(item.lastUpdateTime) }} - {{ formatDate(item.reportDate) }} - {{ item.reporter || '-' }} - {{ item.projectName || '-' }} - {{ item.remark || '-' }} - + + 汇报日期: + {{ formatDate(item.reportDate) }} + + + 汇报人: + {{ item.reporter || '-' }} + + + 涉及项目: + {{ item.projectName || '-' }} + + + 备注: + {{ item.remark || '-' }} - + @@ -44,13 +59,75 @@ @loadmore="loadMore" > + + + + + 新增汇报 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 取消 + 确定 + + + @@ -180,62 +359,48 @@ export default { } } - -.table-wrapper { - background-color: #fff; - border-radius: 10rpx; - overflow: hidden; +.add-button-container { + display: flex; + justify-content: center; + margin-bottom: 30rpx; } -.table-scroll { - width: 100%; +.masonry-list { + column-count: 2; + column-gap: 24rpx; + padding: 10rpx 0; } -.table-container { - min-width: 1200rpx; // 设置最小宽度,确保表格内容不会被压缩 - .table-header { - display: flex; - background-color: #f8f9fa; - border-bottom: 1rpx solid #e9ecef; - .header-cell { - width: 200rpx; // 固定列宽 - padding: 20rpx 10rpx; - text-align: center; - font-weight: bold; - font-size: 28rpx; - flex-shrink: 0; // 防止列被压缩 - &.checkbox { - width: 100rpx; // 复选框列宽度 - } - } +.masonry-card { + width: calc(100%% - 18rpx); + margin-bottom: 24rpx; + background: #fff; + border-radius: 16rpx; + box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.06); + display: inline-block; + break-inside: avoid; + padding: 32rpx 24rpx; + cursor: pointer; + transition: box-shadow 0.2s; + &:active { + box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.10); + background: #f8f9fa; } - .table-body { - .table-row { + .card-title { + font-size: 32rpx; + font-weight: bold; + margin-bottom: 16rpx; + color: #007bff; + } + .card-info { + display: flex; + flex-direction: column; + gap: 8rpx; + .info-row { display: flex; - border-bottom: 1rpx solid #e9ecef; - cursor: pointer; - transition: background-color 0.2s; - - &:hover { - background-color: #f8f9fa; - } - - &:active { - background-color: #e9ecef; - } - .table-cell { - width: 200rpx; // 固定列宽 - padding: 20rpx 10rpx; - text-align: center; - font-size: 26rpx; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; // 防止列被压缩 - word-break: break-all; // 长文本换行 - &.checkbox { - width: 100rpx; // 复选框列宽度 - } + .label { + color: #888; + min-width: 120rpx; } } } diff --git a/pages/workbench/construction/detail.vue b/pages/workbench/construction/detail.vue index ab5e1b2..f35a4ab 100644 --- a/pages/workbench/construction/detail.vue +++ b/pages/workbench/construction/detail.vue @@ -22,69 +22,49 @@ - - - 新增 - 删除 - + - - - - - - + + + + + + 设备编号: + {{ item.deviceCode || '-' }} - 设备编号 - 设备类别 - 汇报详情内容 - 图片概况 - 备注 - 操作 - - - - - - - - - {{ item.deviceCode || '-' }} - {{ item.category || '-' }} - - {{ item.reportDetail || '-' }} - - - - - - - {{ item.remark || '-' }} - - 删除 - + + 设备类别: + {{ item.category || '-' }} + + + 汇报详情内容: + {{ item.reportDetail || '-' }} + + + 图片概况: + + + - - - - + + 备注: + {{ item.remark || '-' }} + + + + @@ -94,6 +74,13 @@ @loadmore="loadMore" > + + + + + + + @@ -269,6 +256,9 @@ export default { this.reportDetailList = response.rows || []; this.total = response.total || 0; this.loading = false; + if (this.reportDetailList.length >= this.total) { + this.loadMoreStatus = 'nomore'; + } // 重置选中状态 this.selectedIds = []; this.selectAll = false; @@ -450,7 +440,8 @@ export default { this.reportDetailList = [...this.reportDetailList, ...newData]; this.total = response.total || 0; - if (newData.length < this.queryParams.pageSize) { + // 判断是否还有更多数据:当前获取的数据总数 >= 总数据量 + if (this.reportDetailList.length >= this.total) { this.loadMoreStatus = 'nomore'; } else { this.loadMoreStatus = 'loadmore'; @@ -549,76 +540,32 @@ export default { } } -.action-buttons { - display: flex; - gap: 20rpx; - margin-bottom: 20rpx; -} -.table-wrapper { - background-color: #fff; + +.list-wrapper { + background: #fff; border-radius: 10rpx; - overflow: hidden; + padding: 10rpx 0; } -.table-scroll { - width: 100%; -} - -.table-container { - min-width: 1400rpx; // 设置最小宽度,确保表格内容不会被压缩 - .table-header { +.detail-list-item { + padding: 32rpx 24rpx; + background: #fff; + border-radius: 12rpx; + margin-bottom: 16rpx; + border: 1rpx solid #e9ecef; + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.06); + .item-row { display: flex; - background-color: #f8f9fa; - border-bottom: 1rpx solid #e9ecef; - - .header-cell { - width: 200rpx; // 固定列宽 - padding: 20rpx 10rpx; - text-align: center; - font-weight: bold; - font-size: 28rpx; - flex-shrink: 0; // 防止列被压缩 - - &.checkbox { - width: 100rpx; // 复选框列宽度 - } + align-items: center; + margin-bottom: 8rpx; + .item-label { + color: #888; + min-width: 140rpx; } - } - - .table-body { - .table-row { - display: flex; - border-bottom: 1rpx solid #e9ecef; - - &:hover { - background-color: #f8f9fa; - } - - .table-cell { - width: 200rpx; // 固定列宽 - padding: 20rpx 10rpx; - text-align: center; - font-size: 26rpx; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; // 防止列被压缩 - word-break: break-all; // 长文本换行 - - &.checkbox { - width: 100rpx; // 复选框列宽度 - } - - &.content-cell { - .content-text { - max-width: 180rpx; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - } - } + .item-value { + color: #333; + flex: 1; } } } @@ -696,4 +643,28 @@ export default { text-overflow: ellipsis; display: block; } + +.add-button-wrapper { + position: fixed; + bottom: 40rpx; + right: 40rpx; + z-index: 999; +} + +.add-button { + width: 120rpx; + height: 120rpx; + background: linear-gradient(135deg, #007bff, #0056b3); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + box-shadow: 0 4rpx 16rpx rgba(0, 123, 255, 0.3); + transition: all 0.3s ease; + + &:active { + transform: scale(0.95); + box-shadow: 0 2rpx 8rpx rgba(0, 123, 255, 0.4); + } +} \ No newline at end of file diff --git a/util/oaRequest.js b/util/oaRequest.js index 2de495e..4d3b5d1 100644 --- a/util/oaRequest.js +++ b/util/oaRequest.js @@ -1,6 +1,7 @@ import { getToken } from './auth' import errorCode from './errorCode' import { toast, showConfirm, tansParams } from './common' +import { getSMSCodeFromOa, loginOaByPhone } from '../api/oa/login' let timeout = 10000 const baseUrl = 'http://110.41.139.73:8080' @@ -42,8 +43,23 @@ const request = config => { const code = res.data.code || 200 const msg = errorCode[code] || res.data.msg || errorCode['default'] if (code === 401) { - showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => { + showConfirm('登录状态已过期,是否刷新登录状态').then(async res => { if (res.confirm) { + // 从store中获取phoneNumber,并依次调用getSMSCodeFromOa和loginOaByPhone + const store = require('@/store').default + const phoneNumber = store.getters.storeSelfInfo?.phoneNumber + if (phoneNumber) { + try { + await getSMSCodeFromOa(phoneNumber) + await loginOaByPhone(phoneNumber) + } catch (e) { + console.log('OA自动登录失败', e) + toast('OA自动登录失败') + } + } else { + toast('无法获取手机号,OA自动登录失败') + } + // 登录 // store.dispatch('LogOut').then(res => { // uni.reLaunch({ url: '/pages/login' }) // })