From 7653c5fe2d7d5a835e8b7d2b07a3eb747584ff4c Mon Sep 17 00:00:00 2001 From: zpc Date: Sun, 29 Mar 2026 22:29:12 +0800 Subject: [PATCH] 21 --- odf-uniapp/pages/rack-detail/index.vue | 51 ++++++++++-------- odf-uniapp/pages/rack/index.vue | 33 ++++++++++++ odf-uniapp/pages/search/index.vue | 19 ++++--- odf-uniapp/services/search.js | 7 ++- odf-uniapp/unpackage/release/apk/odf_new.apk | Bin 17869261 -> 17869261 bytes .../Business/OdfPortsController.cs | 14 ++++- server/ZR.Model/Business/Dto/OdfPortsDto.cs | 1 + 7 files changed, 93 insertions(+), 32 deletions(-) diff --git a/odf-uniapp/pages/rack-detail/index.vue b/odf-uniapp/pages/rack-detail/index.vue index da2e372..5fda85f 100644 --- a/odf-uniapp/pages/rack-detail/index.vue +++ b/odf-uniapp/pages/rack-detail/index.vue @@ -44,28 +44,30 @@ {{ frame.name }} - - - {{ row.name }} - - - + + + + + {{ row.name }} + - {{ port.tips }} + + {{ port.tips }} + + {{ port.name }} - {{ port.name }} - - + + @@ -267,6 +269,16 @@ onLoad((options) => { margin-bottom: 16rpx; } +.port-scroll { + width: 100%; + white-space: nowrap; +} + +.port-rows-wrapper { + display: inline-block; + min-width: 100%; +} + .port-row { margin-bottom: 20rpx; } @@ -277,11 +289,6 @@ onLoad((options) => { margin-bottom: 12rpx; } -.port-scroll { - width: 100%; - white-space: nowrap; -} - .port-list { display: flex; flex-direction: row; diff --git a/odf-uniapp/pages/rack/index.vue b/odf-uniapp/pages/rack/index.vue index c5a4f5b..b6761f7 100644 --- a/odf-uniapp/pages/rack/index.vue +++ b/odf-uniapp/pages/rack/index.vue @@ -19,6 +19,12 @@ + + + + 请输入要搜索的备注内容 + + @@ -33,8 +33,8 @@ - - + + 机房 import { ref } from 'vue' -import { onReachBottom } from '@dcloudio/uni-app' +import { onLoad, onReachBottom } from '@dcloudio/uni-app' import { searchPorts } from '@/services/search' const statusBarHeight = uni.getSystemInfoSync().statusBarHeight || 0 @@ -123,6 +123,7 @@ const pageNum = ref(1) const pageSize = 20 const totalPage = ref(0) const loading = ref(false) +const roomIdRef = ref('') async function doSearch() { const key = keyword.value.trim() @@ -130,7 +131,7 @@ async function doSearch() { pageNum.value = 1 loading.value = true try { - const res = await searchPorts(key, 1, pageSize) + const res = await searchPorts(key, 1, pageSize, roomIdRef.value || undefined) if (res.code === 200 && res.data) { rooms.value = res.data.rooms || [] const portsData = res.data.ports || {} @@ -149,7 +150,7 @@ async function loadMore() { loading.value = true pageNum.value++ try { - const res = await searchPorts(keyword.value.trim(), pageNum.value, pageSize) + const res = await searchPorts(keyword.value.trim(), pageNum.value, pageSize, roomIdRef.value || undefined) if (res.code === 200 && res.data) { const portsData = res.data.ports || {} ports.value = [...ports.value, ...(portsData.result || [])] @@ -179,6 +180,12 @@ function goPortDetail(item) { onReachBottom(() => { loadMore() }) + +onLoad((options) => { + if (options.roomId) { + roomIdRef.value = options.roomId + } +})