From 4fa64835a5d14e3a80e7f4960b800fa50934e2cf Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 14 三月 2024 15:30:26 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/header/search.jsx | 44 +++++++++++++++++++++++++++++++++-----------
1 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/header/search.jsx b/zy-asrs-flow/src/pages/map/header/search.jsx
index 587f3da..fc23f45 100644
--- a/zy-asrs-flow/src/pages/map/header/search.jsx
+++ b/zy-asrs-flow/src/pages/map/header/search.jsx
@@ -7,14 +7,25 @@
import * as Utils from '../utils'
import { values } from 'lodash';
-const renderTitle = (title) => (
- <span
- style={{
- fontWeight: 'bold'
- }}
- >
- {title}
- </span>
+const renderTitle = (title, uuid) => (
+ <>
+ <span
+ style={{
+ fontWeight: 'bold'
+ }}
+ >
+ {title}
+ </span>
+ <span
+ style={{
+ float: 'right',
+ opacity: .3
+ }}
+ >
+ {uuid}
+ </span>
+ </>
+
);
const MapSearch = (props) => {
@@ -49,7 +60,7 @@
if (child?.data?.type === Utils.SENSOR_TYPE.SHELF) {
setSensorList(prevArr => [...prevArr, {
value: child.data.uuid,
- label: renderTitle(child.data.shelfNo)
+ label: renderTitle(child.data.shelfNo, child.data.uuid)
}]);
}
})
@@ -99,12 +110,23 @@
value={curSensorLabel}
onSelect={(value, option) => {
setCurSensorUuid(value);
- if (option.label?.props?.children) {
- setCurSensorLabel(option.label?.props?.children)
+ let showLable = option.label?.props?.children?.[0].props.children;
+ if (showLable) {
+ setCurSensorLabel(showLable)
} else {
return setCurSensorLabel(value);
}
}}
+ onChange={(value) => {
+ setCurSensorLabel(value);
+ if (!value) {
+ setCurSensorUuid(null);
+ setCurSensorLabel(null);
+ setCurSensor(null);
+ } else {
+
+ }
+ }}
/>
</>
)
--
Gitblit v1.9.1