fix: 功能优化,新增数据查询、设备属性、报警设置3个按钮及对应功能修改。

This commit is contained in:
tianyongbao
2026-01-19 18:27:12 +08:00
parent 3740e7fe52
commit 4e4243d5e2
6 changed files with 782 additions and 36 deletions

View File

@@ -335,6 +335,37 @@
</template>
</nut-empty>
</view>
<!-- 功能按钮区域 -->
<nut-row class="action-buttons" v-if="doList.length > 0">
<nut-col :span="24">
<view class="button-wrapper">
<nut-button
type="primary"
class="action-btn"
size="small"
@click="goDeviceInfo"
>
设备属性
</nut-button>
<nut-button
type="primary"
class="action-btn"
size="small"
@click="goAlarmSettings"
>
报警设置
</nut-button>
<nut-button
type="primary"
class="action-btn"
size="small"
@click="goDataQuery"
>
数据查询
</nut-button>
</view>
</nut-col>
</nut-row>
</nut-col>
</nut-row>
</nut-row>
@@ -1850,6 +1881,72 @@ function submit() {
state.show = true;
});
}
// 跳转到设备信息页面(设备属性)
function goDeviceInfo() {
const currentDevice = doList.value.find(
(item: any) => item.id === doDev.value
);
if (!currentDevice) {
state.show = true;
state.msg = '设备信息不存在';
state.type = 'fail';
return;
}
// 跳转到 wqm 页面,带上 deviceInfo 参数表示跳到设备信息区域
Taro.navigateTo({
url: `/home/wqm?id=${currentDevice.id}&name=${currentDevice.deviceName}&page=home&section=deviceInfo`,
});
}
// 跳转到报警设置页面(溶解氧配置)
function goAlarmSettings() {
const currentDevice = doList.value.find(
(item: any) => item.id === doDev.value
);
if (!currentDevice) {
state.show = true;
state.msg = '设备信息不存在';
state.type = 'fail';
return;
}
// 跳转到 wqm 页面,带上 alarmSettings 参数表示跳到溶解氧配置区域
Taro.navigateTo({
url: `/home/wqm?id=${currentDevice.id}&name=${currentDevice.deviceName}&page=home&section=alarmSettings`,
});
}
// 跳转到数据查询页面
function goDataQuery() {
const currentDevice = doList.value.find(
(item: any) => item.id === doDev.value
);
if (!currentDevice) {
state.show = true;
state.msg = '设备信息不存在';
state.type = 'fail';
return;
}
// 获取设备序列号
const serialNum = currentDevice.serialNum || currentDevice.serialNumber || currentDevice.deviceSerialNum || currentDevice.sn;
if (!serialNum) {
state.show = true;
state.msg = '设备序列号不存在';
state.type = 'fail';
return;
}
// 跳转到数据查询页面(横屏显示)
Taro.navigateTo({
url: `/components/other/dataQuery?serialNum=${serialNum}&dataType=${prDev.value}&deviceName=${currentDevice.deviceName}&oxyWarnLower=${oxyWarnLower.value || ''}&tempWarnUpper=${tempWarnUpper.value || ''}&tempWarnLower=${tempWarnLower.value || ''}`,
});
}
/** -----------------method end------------------- */
defineExpose({
getDeviceList,
@@ -2050,4 +2147,42 @@ defineExpose({
.nut-grid-item__content {
background: #fff;
}
// 功能按钮区域样式
.action-buttons {
margin-top: 20rpx;
padding: 0;
width: 100%;
.nut-col {
padding: 0 !important;
}
.button-wrapper {
display: flex;
justify-content: center;
align-items: center;
gap: 20rpx;
padding: 0 20rpx;
.action-btn {
flex: 0 0 auto;
width: 180rpx;
height: 70rpx;
font-size: 28rpx;
border-radius: 8rpx;
background: linear-gradient(135deg, #09b8c2 0%, #06a0a9 100%);
border: none;
color: #fff;
font-weight: 500;
box-shadow: 0 4rpx 12rpx rgba(9, 184, 194, 0.3);
transition: all 0.3s ease;
&:active {
transform: scale(0.95);
box-shadow: 0 2rpx 8rpx rgba(9, 184, 194, 0.4);
}
}
}
}
</style>