#
luxiaotao1123
2024-03-14 4fa64835a5d14e3a80e7f4960b800fa50934e2cf
#
1个文件已修改
30 ■■■■ 已修改文件
zy-asrs-flow/src/pages/map/header/search.jsx 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/header/search.jsx
@@ -7,7 +7,8 @@
import * as Utils from '../utils'
import { values } from 'lodash';
const renderTitle = (title) => (
const renderTitle = (title, uuid) => (
    <>
    <span
        style={{
            fontWeight: 'bold'
@@ -15,6 +16,16 @@
    >
        {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 {
                    }
                }}
            />
        </>
    )