feat(): 完成知识检索全部功能

qzc-dev
李神峰 2025-08-06 17:13:27 +08:00
parent 8098b39329
commit bf68ca571e
3 changed files with 29 additions and 11 deletions

View File

@ -1,4 +1,4 @@
import React, { useEffect, useState,useRef } from 'react' import React, { useEffect, useState, useRef } from 'react'
import { useLocation } from 'react-router' import { useLocation } from 'react-router'
import { useDispatch, useSelector } from 'react-redux' import { useDispatch, useSelector } from 'react-redux'
import { Collapse, DatePicker, Input, Modal, message } from 'antd'; import { Collapse, DatePicker, Input, Modal, message } from 'antd';
@ -152,13 +152,19 @@ const HomePage = ({ showPanels }) => {
Modal.destroyAll(); // 先销毁可能存在的其他Modal Modal.destroyAll(); // 先销毁可能存在的其他Modal
const modal = Modal.confirm({ const modal = Modal.confirm({
title: `${record.name}详情`, title: <div style={{ width: '100%', padding: '16px 24px', color: '#3B4859', borderBottom: '1px solid #f0f0f0', position: "absolute", top: 0, left: 0 }}>
<div style={{ fontSize: 16, fontWeight: 'bold' }}>{record.name}详情</div>
</div>,
width: 1000, width: 1000,
content: ( content: (
<>
<div style={{ marginTop: 45 }}></div>
<ModalForm.default <ModalForm.default
mode="view" mode="view"
record={res} record={res}
/> />
</>
), ),
icon: null, icon: null,
okButtonProps: { style: { display: 'none' } }, okButtonProps: { style: { display: 'none' } },
@ -616,12 +622,18 @@ const HomePage = ({ showPanels }) => {
// 清空搜索输入框 // 清空搜索输入框
setSearchVal('') setSearchVal('')
dispatch.runtime.closeFeaturePopAll() dispatch.runtime.closeFeaturePopAll()
mapObj && mapObj.getLayers().getArray().forEach(layer => {
if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1||layer.values_.name.indexOf('ZHZS_YQ') > -1)) {
mapObj.removeLayer(layer);
}
});
dispatch.runtime.setHome()
if (a === undefined) { if (a === undefined) {
setCheckedObj({ key: '12', label: '雨情', labelRight: '统计', icon: 'yuqing' }) setCheckedObj({ key: '12', label: '雨情', labelRight: '统计', icon: 'yuqing' })
setShowTable(false) setShowTable(false)
} else if (a === '1') { } else if (a === '1') {
setShowTable(true) setShowTable(true)
dispatch.runtime.setHome() // dispatch.runtime.setHome()
setCheckedObj({ key: '11', label: '预警', labelRight: '预警', icon: 'yujing' }) setCheckedObj({ key: '11', label: '预警', labelRight: '预警', icon: 'yujing' })
} else if (a === '2') { } else if (a === '2') {
setShowTable(true) setShowTable(true)
@ -663,6 +675,12 @@ const HomePage = ({ showPanels }) => {
setSearchVal('') setSearchVal('')
setCheckedObj(item) setCheckedObj(item)
setShowTable(true) setShowTable(true)
mapObj && mapObj.getLayers().getArray().forEach(layer => {
if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 ||layer.values_.name.indexOf('ZHZS_YQ') > -1)) {
mapObj.removeLayer(layer);
}
});
dispatch.runtime.setHome()
}}> }}>
<img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/${item.icon}.png`} width="20" height="20" alt="" style={{ marginRight: '10px' }} /> <img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/${item.icon}.png`} width="20" height="20" alt="" style={{ marginRight: '10px' }} />
{item.label} {item.label}

View File

@ -75,7 +75,7 @@ useEffect(() => {
name="type" name="type"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Select allowClear style={{ width: '100%' }} options={opntios} placeholder='请选择' /> <Select allowClear disabled={mode === 'view'} style={{ width: '100%' }} options={opntios} placeholder='请选择' />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
@ -95,7 +95,7 @@ useEffect(() => {
name="status" name="status"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Select allowClear style={{ width: '100%' }} options={opntios1} placeholder='请选择' /> <Select allowClear disabled={mode === 'view'} style={{ width: '100%' }} options={opntios1} placeholder='请选择' />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={24}> <Col span={24}>

View File

@ -75,7 +75,7 @@ useEffect(() => {
name="type" name="type"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Select allowClear style={{ width: '100%' }} options={opntios} placeholder='请选择' /> <Select allowClear disabled={mode === 'view'} style={{ width: '100%' }} options={opntios} placeholder='请选择' />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
@ -95,7 +95,7 @@ useEffect(() => {
name="status" name="status"
rules={[{ required: true }]} rules={[{ required: true }]}
> >
<Select allowClear style={{ width: '100%' }} options={opntios1} placeholder='请选择' /> <Select allowClear disabled={mode === 'view'} style={{ width: '100%' }} options={opntios1} placeholder='请选择' />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={24}> <Col span={24}>