修改测试问题

This commit is contained in:
guanj
2026-07-02 09:55:30 +08:00
parent 1d73755a43
commit 40899e6d55
21 changed files with 380 additions and 157 deletions

View File

@@ -21,7 +21,7 @@
</view>
</view>
<view class="monitor-section-header">
<view class="monitor-section-header mb16">
<view class="section-title-row section-title-row--no-mb">
<uni-icons type="settings" size="18" color="#376cf3" />
<text class="section-title">已选展示指标</text>
@@ -53,9 +53,13 @@
</view>
</view>
</view>
<view class="monitor-search">
<uni-search-bar v-model="filterKeyword" bgColor="#fff" placeholder="搜索项目、设备、监测点"
cancelButton="none" />
</view>
<view class="monitor-list">
<view class="monitor-card card" v-for="(point, idx) in monitoringPoints" :key="idx">
<view class="monitor-card card" v-for="(point, idx) in filteredMonitoringPoints" :key="idx">
<view class="card-header">
<view class="event-icon">
<Cn-icon-transient name="监测点" />
@@ -63,8 +67,8 @@
<view class="card-header-info">
<view class="point-name-row">
<text class="point-name ellipsis">{{ point.pointName }}</text>
<text class="event-tag" :class="point.runStatus == 1 ? 'lx-tag' : 'zx-tag'">
{{ point.runStatus == 1 ? '线' : '线' }}
<text class="event-tag" :class="point.runStatus == 0 ? 'zx-tag' : 'lx-tag'">
{{ point.runStatus == 0 ? '线' : '线' }}
</text>
</view>
<view class="meta-row">
@@ -84,7 +88,7 @@
</view>
<view v-if="hasTPhaseData(child)" class="phase-single">
<text class="phase-value-vertical phase-value-vertical--neutral">{{ child.T
}}</text>
}}</text>
</view>
<view v-else class="phase-vertical">
<view class="phase-item-vertical">
@@ -111,9 +115,9 @@
<text>更多指标</text>
</view>
</view>
<uni-load-more v-if="listStatus == 'loading' || monitoringPoints.length > 0"
<uni-load-more v-if="listStatus == 'loading' || filteredMonitoringPoints.length > 0"
:status="listStatus"></uni-load-more>
<Cn-empty v-else style="top: 35%"></Cn-empty>
<Cn-empty v-else-if="listStatus !== 'loading'" style="top: 45%"></Cn-empty>
</view>
</view>
</view>
@@ -175,29 +179,51 @@ export default {
],
selectedIndicators: [],
phaseColors: [
{ name: 'A相', color: '#F1B22E' },
{ name: 'B相', color: '#2BA471' },
{ name: 'A相', color: '#DAA520' },
{ name: 'B相', color: '#2E8B57' },
{ name: 'C相', color: '#D54941' },
],
monitoringPoints: [],
filterKeyword: '',
listStatus: 'noMore',
lineDataRequestId: 0,
showBackTop: false,
indicatorPopupShow: false,
skipRefreshOnShow: false,
}
},
computed: {
filteredMonitoringPoints() {
const keyword = (this.filterKeyword || '').trim().toLowerCase()
if (!keyword) return this.monitoringPoints
return this.monitoringPoints.filter((point) => {
const projectName = String(point.projectName || '').toLowerCase()
const deviceName = String(point.deviceName || '').toLowerCase()
const pointName = String(point.pointName || '').toLowerCase()
return (
projectName.indexOf(keyword) !== -1 ||
deviceName.indexOf(keyword) !== -1 ||
pointName.indexOf(keyword) !== -1
)
})
},
},
onPageScroll(e) {
this.showBackTop = e.scrollTop > 200
},
// 页面显示时同步工程名称
// 页面显示时同步工程名称;从指标详情返回时不刷新
onShow() {
const engineering = uni.getStorageSync('engineering')
const skipRefresh = this.skipRefreshOnShow
this.skipRefreshOnShow = false
if (engineering?.id) {
this.engineeringName = engineering.name || ''
this.engineeringId = engineering.id
this.info()
if (!skipRefresh) {
this.info()
}
}
if (this.targetLists.length) {
if (this.targetLists.length && !skipRefresh) {
this.loadSelectedIndicators()
}
},
@@ -235,6 +261,7 @@ export default {
loadLineData() {
this.listStatus = 'loading'
this.monitoringPoints = []
this.filterKeyword = ''
const requestId = ++this.lineDataRequestId
const engineerId = this.engineeringId
getLineDataByEngineer({ id: engineerId })
@@ -265,6 +292,7 @@ export default {
pointName: point.pointName || '',
dataTime: point.dataTime || '',
lineType: point.lineType,
runStatus: point.runStatus,
children: this.groupChildren(point.children || []),
}))
},
@@ -401,6 +429,7 @@ export default {
},
// 跳转指标详情页,展示该监测点全部指标
onMoreIndicators(point) {
this.skipRefreshOnShow = true
uni.setStorageSync('monitorPointDetail', {
...point,
engineeringName: this.engineeringName,
@@ -614,7 +643,7 @@ export default {
justify-content: space-between;
flex-wrap: wrap;
gap: 12rpx;
padding: 0 10px 16rpx;
padding: 0 10px 0rpx;
}
.legend-row {
@@ -640,6 +669,18 @@ export default {
color: #666666;
}
.monitor-search {
position: sticky;
top: 0;
z-index: 10;
padding: 16rpx 10px 16rpx;
background: #f7f8fa;
/deep/ .uni-searchbar {
padding: 0;
}
}
.monitor-list {
display: flex;
flex-direction: column;
@@ -695,8 +736,8 @@ export default {
flex-shrink: 0;
padding: 4rpx 12rpx;
font-size: 22rpx;
color: #2ba471;
background: #2ba47115;
color: #2E8B57;
background: #2E8B5715;
border-radius: 8rpx;
line-height: 1.2;
}
@@ -771,7 +812,7 @@ export default {
}
.phase-value-vertical {
font-size: 28rpx;
font-size: 26rpx;
font-weight: 700;
&--neutral {
@@ -880,4 +921,8 @@ export default {
background-color: #ff3b3020;
color: #ff3b30;
}
/deep/ .uni-searchbar__box {
justify-content: left;
}
</style>