合并master

qzc-dev
秦子超 2025-09-10 16:40:45 +08:00
commit c2a38ded0f
51 changed files with 2304 additions and 455 deletions

1
.gitignore vendored
View File

@ -10,6 +10,7 @@
# production
/build
build.zip
# misc
.DS_Store

View File

@ -10,7 +10,7 @@ const { RangePicker } = DatePicker
const { Dragger } = Upload;
const url = "http://223.75.53.141:9100/gs-tsg"
const FileUpload = ({mode, fileNum=1, value, onChange}) => {
const FileUpload = ({mode, fileNum=1, value, onChange,uploadUrl,onLoadingChange}) => {
const [fileList, setFileList] = useState([]) //上传文件列表
const [loading, setLoading] = useState(false)
console.log(1111111,fileList);
@ -19,13 +19,17 @@ const FileUpload = ({mode, fileNum=1, value, onChange}) => {
const fileChange = (info) => {
if (info.file.status === "done") {
setLoading(false);
if(onLoadingChange) onLoadingChange(false);
}
if (info.file.status === "uploading") {
setLoading(true);
if(onLoadingChange) onLoadingChange(true);
}
if (info.file.status === "error") {
message.error("文件上传失败")
setLoading(false);
if(onLoadingChange) onLoadingChange(false);
}
setFileList(info.fileList)
}
@ -47,8 +51,8 @@ const FileUpload = ({mode, fileNum=1, value, onChange}) => {
useEffect(()=>{
if(onChange && fileList){
let oldFiles = fileList.map(item => (item.response?.data??item))
onChange(oldFiles)
let oldFiles = fileList.map(item => (item.response?.data.fileId))
onChange(oldFiles.join(','))
}
},[fileList])
@ -59,7 +63,7 @@ const FileUpload = ({mode, fileNum=1, value, onChange}) => {
mode!=='view' &&
<Dragger
name='file'
action={apiurl.file.upload}
action={uploadUrl}
onChange={fileChange}
onDrop={(info) => { console.log(info.dataTransfer.files); }}
fileList={fileList}
@ -73,7 +77,7 @@ const FileUpload = ({mode, fileNum=1, value, onChange}) => {
</p>
</Dragger>
}
<FileView fileList={fileList} setFileList={setFileList}/>
<FileView fileList={fileList} setFileList={setFileList} mode={mode} />
</>
)
}

View File

@ -300,6 +300,12 @@ export async function loadMenu(): Promise<MenuItem[]> {
{
id: id(), title: '调度方案库', path: '/mgr/sz/zsk/ddfa',
},
{
id: id(), title: '业务规则库', path: '/mgr/sz/zsk/ywgz',
},
{
id: id(), title: '工程安全知识库', path: '/mgr/sz/zsk/gcaq',
},
]
},

View File

@ -126,6 +126,28 @@ export const map = createModel<RootModel>()({
state: initState() as MapCtrlState,
reducers: {
// 新增只关闭业务图层的方法(保留基础底图)
closeBusinessLayers(state): MapCtrlState{
const s = { ...state };
const businessLayersClosed: Record<string, boolean> = {};
// 关闭特定的业务图层
const businessLayers = [
"HdswLayer", "RealDrpLayer", "SYLayer", "TuRangLayer", "PicStLayer", 'AZDLayer', "QSYDWLayer", 'YHJMHLayer',
"ShuiKuLayer"
];
businessLayers.forEach(layer => {
businessLayersClosed[layer] = false;
});
s.layerVisible = {
...s.layerVisible,
...businessLayersClosed,
};
return s;
},
setMap(state, map) {
return {
...state,
@ -248,6 +270,10 @@ export const map = createModel<RootModel>()({
}).filter(Boolean);
dispatch.runtime.setLayerSetting({ highlight: records })
},
// 新增只关闭业务图层的effect方法
closeBusinessLayersEffect() {
dispatch.map.closeBusinessLayers();
},
resetMap() {
dispatch.map.reset();

View File

@ -25,7 +25,7 @@ export const runtime = createModel<RootModel>()({
layerSetting: {},
layerSettingLoop: {},
hasRightPanel: true,
showGlobalSearch: false,
showGlobalSearch: true,
leftActiveTab: '',
rainLayerTm: '2022070108',
hasAlertBox: false,

View File

@ -9,7 +9,40 @@ const baseFileView = "http://223.75.53.141:9100/gs-tsg"//文件回显地址
const service_fxdd = '/gunshiApp/tsg'
const service_xyt = '/gunshiApp/tsg'//登陆先用小玉潭
const service_shzh = '/shzh'
const baseTest = "http://223.75.53.141:81/"
const apiurl = {
zsk: {
ddfa: {
page: service_fxdd + "/dispatchScheme/pageByTm",
save:service_fxdd + "/dispatchScheme/add",
edit: service_fxdd + "/dispatchScheme/update",
del: service_fxdd + "/dispatchScheme/delete",
upload: service_fxdd + "/dispatchScheme/file/upload/singleSimple",
getOne:service_fxdd + "/dispatchScheme/getById/"
},
ywgz: {
page: service_fxdd + "/businessRule/pageByTm",
save:service_fxdd + "/businessRule/add",
edit: service_fxdd + "/businessRule/update",
del: service_fxdd + "/businessRule/delete",
upload: service_fxdd + "/businessRule/file/upload/singleSimple",
getOne:service_fxdd + "/businessRule/getById/"
},
gcaq: {
page: service_fxdd + "/projectSafety/pageByTm",
save:service_fxdd + "/projectSafety/add",
edit: service_fxdd + "/projectSafety/update",
del: service_fxdd + "/projectSafety/delete",
upload: service_fxdd + "/projectSafety/file/upload/singleSimple",
tree: service_fxdd + "/projectSafety/listCategory",
saveTree: service_fxdd + "/projectSafety/addCategory",
editTree: service_fxdd + "/projectSafety/updateCategory",
deleteTree: service_fxdd + "/projectSafety/delCategory",
getOne:service_fxdd + "/projectSafety/getById/"
}
},
file:{
upload:baseFileUpLoad,
download:baseFileDownLoad,
@ -84,6 +117,7 @@ const apiurl = {
// 基本情况
home: {
globalSearch:service_fxdd +"/globalSearch/findByName",
yq: service_fxdd + '/real/rain/list',//'/stStbprpB/rainfallStationDetails/rainfallList',//雨情
sk: service_fxdd + '/stStbprpB/reservoirStationDetails/realTimeWaterLevelList',//水库
skjbxx: service_fxdd+ '/attResBase/list',//水库基本信息
@ -532,7 +566,8 @@ const apiurl = {
srcData: service_fxdd + '/attCctvBase/preview/',
videoBystcd: service_fxdd + '/stbprp/cctv/listByStcd/',
videoList:service_fxdd + '/attCctvBase/list',
ysyToken:service_fxdd + '/ysy/getAccessToken'
ysyToken: service_fxdd + '/ysy/getAccessToken',
preview:baseTest + 'isc/liveAddressLimited'
},
//基本情况
jbqk: {

View File

@ -44,6 +44,15 @@ export async function getjdTreeData(params = {}) {
}
return data;
}
export async function getGcaqTreeData(params = {}) {
const { data, code, msg } = await httpget(apiurl.zsk.gcaq.tree) || {};
if (code !== 200) {
message.error(msg || '请求失败');
return [];
}
return data;
}
//获取行政区划树下拉 中电科接口
export async function getAdcdTreeData() {
const { data, code, msg } = await httpget(apiurl.getTreeData);

View File

@ -116,7 +116,8 @@ import Ddfa from './sz/ddfa'
import Krgl from './KrLine'
import Gsnlfx from './gxsl/gsnlfx'
import Ddjl from './szydd/ddjl'
import Ywgz from './sz/ywgz'
import Gcaq from './sz/khzbgl'
const HomePage = lazy(() => import('./Home'))
@ -284,10 +285,9 @@ const AppRouters: React.FC = () => {
{ path: 'sz/szzf/clyj', element: <Clyj /> },
{ path: 'sz/zsk/ddfa', element: <Ddfa /> },
{ path: 'sz/zsk/ywgz', element: <Ywgz /> },
{ path: 'sz/zsk/gcaq', element: <Gcaq /> },
],
},
{ path: '/login', element: <LoginPage /> },

View File

@ -1,6 +1,7 @@
import React, { useEffect } from 'react';
import { Table, Tabs,Modal,message,Tooltip } from 'antd';
import { zindexmarker } from '../zindex';
import {useDispatch, useSelector} from "react-redux";
const {
css,
@ -35,7 +36,7 @@ const dist2 = 8000 * 8000;
function PicStMarker({ data, dispatch, setting, zoom, distSq }) {
const getLayerVisible = useSelector((s) => s.map.layerVisible)
const highlight = setting;
let zindexOffset = 1;
@ -171,6 +172,30 @@ function PicStMarker({ data, dispatch, setting, zoom, distSq }) {
// </div>
// )
}
{
(zoom > 12 || distSq < dist2 || highlight) && (
<div
className="markerLabel"
style={{
// backgroundColor: '#0008',
padding: 4,
borderRadius: 4,
fontSize: 10,
lineHeight: 1,
bottom: -14 * markerZoom,
left: 0,
transform: 'translateX(-50%)',
zIndex: zindexmarker.tuxiangLabel + zindexOffset + (highlight ? zindexmarker.hilightPlus : 0),
color: !getLayerVisible.SatelliteImage?'#0008':'#fff',
// textShadow: '2px 2px 4px #000000',
minWidth: "20px",
textAlign: "center"
}}>
{data?.name}
</div>
)
}
</>
)
}

View File

@ -94,7 +94,10 @@ export default class ShuiKuLayer extends BaseLayer {
// }
// });
// }
const list = data.map((i)=>{
const list = data.filter(o=>o.stnm==='檀树岗' || o.stnm==='檀树岗(新)')
.map((i) => {
return {
id : i.stcd,
name: i.stnm,

View File

@ -25,7 +25,7 @@ export default function drpOption(data) {
// 显示图例
show: true,
// 图例的位置
data: ["测管水位", "库水位"],
data: ["管水位", "库水位"],
},
xAxis: [
{
@ -57,7 +57,7 @@ export default function drpOption(data) {
// gridIndex: 1,
type: 'value',
position: 'left',
name: "测管水位(m)",
name: "管水位(m)",
nameTextStyle: {
padding: [0, 0, 10, 10],
color:'#333333',
@ -128,7 +128,7 @@ export default function drpOption(data) {
{
// xAxisIndex: 1,
yAxisIndex: 0,
name: '测管水位',
name: '管水位',
type: 'line',
color: "#d6eaec",
lineStyle: {

View File

@ -41,7 +41,7 @@ export default function drpOption(data,yjData) {
// 显示图例
show: true,
// 图例的位置
data: ["测管水位", "库水位"],
data: ["管水位", "库水位"],
},
xAxis: [
{
@ -73,7 +73,7 @@ export default function drpOption(data,yjData) {
// gridIndex: 1,
type: 'value',
position: 'left',
name: "测管水位(m)",
name: "管水位(m)",
nameTextStyle: {
padding: [0, 0, 10, 10],
color:'#333333',
@ -144,7 +144,7 @@ export default function drpOption(data,yjData) {
{
// xAxisIndex: 1,
yAxisIndex: 0,
name: '测管水位',
name: '管水位',
type: 'line',
color: "#d6eaec",
lineStyle: {

View File

@ -0,0 +1,46 @@
import React from 'react';
import './index.less';
import appconsts from '../../../../service/appconsts';
/**
* 搜索结果列表组件
* @param {Array} data - 搜索结果数据数组每个项目应包含 name type 属性
* @param {Function} onItemClick - 点击列表项的回调函数
* @param {String} title - 可选的标题默认为"搜索结果"
*/
const SearchResultList = ({ data = [], onItemClick, title = "搜索结果" }) => {
return (
<div className="search-result-list">
{/* <div className="search-result-header">
<div className="search-result-title">{title}</div>
<div className="search-result-count"> {data.length} </div>
</div> */}
<div className="search-result-table">
<div className="search-result-table-header">
<div className="search-result-table-cell name-cell">名称</div>
<div className="search-result-table-cell type-cell">类型</div>
</div>
<div className="search-result-table-body">
{data.length > 0 ? (
data.map((item, index) => (
<div
key={item.id || index}
className="search-result-table-row"
onClick={() => onItemClick && onItemClick(item)}
>
<div className="search-result-table-cell name-cell">{item.name}</div>
<div className="search-result-table-cell type-cell">
{item.type}
</div>
</div>
))
) : (
<div className="search-result-empty">暂无搜索结果</div>
)}
</div>
</div>
</div>
);
};
export default SearchResultList;

View File

@ -0,0 +1,104 @@
.search-result-list {
width: 100%;
background-color: #fff;
border-radius: 4px;
overflow: hidden;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
height: 100%;
}
.search-result-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
border-bottom: 1px solid #f0f0f0;
flex-shrink: 0; /* 防止头部被压缩 */
}
.search-result-title {
font-size: 16px;
font-weight: 500;
color: #333;
}
.search-result-count {
font-size: 14px;
color: #999;
}
.search-result-table {
width: 100%;
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden; /* 确保内容不溢出 */
}
.search-result-table-header {
display: flex;
background-color: #f0f5ff;
font-weight: 500;
flex-shrink: 0; /* 防止表头被压缩 */
}
.search-result-table-body {
flex: 1;
overflow-y: auto; /* 添加垂直滚动 */
scrollbar-width: thin; /* Firefox 滚动条样式 */
}
/* 自定义滚动条样式 */
.search-result-table-body::-webkit-scrollbar {
width: 6px;
}
.search-result-table-body::-webkit-scrollbar-thumb {
background-color: #d9d9d9;
border-radius: 3px;
}
.search-result-table-body::-webkit-scrollbar-track {
background-color: #f5f5f5;
}
.search-result-table-row {
display: flex;
border-bottom: 1px solid #f0f0f0;
cursor: pointer;
transition: background-color 0.3s;
&:hover {
background-color: #f5f5f5;
}
&:last-child {
border-bottom: none;
}
}
.search-result-table-cell {
padding: 12px 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.name-cell {
flex: 1;
text-align: left;
}
.type-cell {
width: 120px;
text-align: right;
}
.search-result-empty {
padding: 40px 0;
text-align: center;
color: #999;
font-size: 14px;
}

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react'
import React, { useEffect, useState, useRef } from 'react'
import { useLocation } from 'react-router'
import { useDispatch, useSelector } from 'react-redux'
import { Collapse, DatePicker } from 'antd';
import { Collapse, DatePicker, Input, Modal, message } from 'antd';
import './index.less'
import Yujing from './item_yujing/index.js'
import Yuqing from './item_yuqing'
@ -23,229 +23,773 @@ import AnZhiDian from './item_anzhidian'
import QSYDW from './item_qishiyedanwei'
import YHJMH from './item_yanhejuminhu'
import SetWxqStation from '../setMapStation/wxq'
import SetDrpStation from '../setMapStation/drp'
import Bzt from '../../gcaqjc/bzt2'
import ShenLiu from '../MapCtrl/Pops/ShenLiu';
import ShenYa from '../MapCtrl/Pops/ShenYa';
import WeiYi from '../MapCtrl/Pops/WeiYi';
import Tuli from '../TuLi/Tuli.js'
import Tuli2 from '../TuLi/Tuli2.js';
import Tuli3 from '../TuLi/Tuli3.js'
import Tuli4 from '../TuLi/Tuli4.js'
import Tuli5 from '../TuLi/Tuli5.js'
import SearchResultList from './SearchResultList';
import { httpget } from '../../../utils/request';
import apiurl from '../../../service/apiurl';
import FillStyle from "ol/style/Fill";
import GeoJSONFormat from 'ol/format/GeoJSON';
import { Vector as VectorSource } from "ol/source";
import StrokeStyle from "ol/style/Stroke";
import { geometryCenter } from '../../../utils/tools'
import Text from "ol/style/Text";
import Feature from "ol/Feature";
import VectorLayer from "ol/layer/Vector";
import Style from "ol/style/Style";
import moment from 'moment';
import { httppost2 } from "../../../utils/request";
import Circle from 'ol/style/Circle';
import Stroke from "ol/style/Stroke";
import Point from 'ol/geom/Point.js';
import { transform } from 'ol/proj';
const { Panel } = Collapse;
const { RangePicker } = DatePicker;
const { Search } = Input;
const items = [
{ key:'1', label:'综合监视', children:[
{ key:'11', label:'预警', labelRight:'预警', icon:'yujing' },
{ key:'12', label:'雨情', labelRight:'统计', icon:'yuqing' },
{ key:'13', label:'水库水情', labelRight:'实时水情', icon:'shuikushuiqing' },
{ key:'19', label:'土壤墒情', labelRight:'土壤墒情', icon:'turangshangqing' },
{ key:'15', label:'工程安全', labelRight:'工程安全监测', icon:'gongchenganquan' },
{ key:'16', label:'监测设备状态', labelRight:'监测设备运行', icon:'jianceshebeizhuangtai' },
// { key:'17', label:'水质', labelRight:'水质', icon:'shuizhi' },
{ key:'18', label:'视频点', labelRight:'视频点', icon:'shipindian' },
] },
{ key:'2', label:'巡查巡检', children:[
{ key:'21', label:'巡查巡检', labelRight:'工程巡检', icon:'jianceshebeizhuangtai' },
// { key:'22', label:'大坝', labelRight:'基本信息', icon:'daba' },
// { key:'23', label:'溢洪道', labelRight:'基本信息', icon:'yihongdao' },
] },
{ key:'3', label:'洪水防御', children:[
{ key:'31', label:'危险区', labelRight:'危险区列表', icon:'weixianqu' },
{ key:'32', label:'安置点', labelRight:'安置点列表', icon:'anzhidian' },
{ key:'33', label:'企事业单位', labelRight:'企事业单位列表', icon:'qishiyedanwei' },
{ key:'34', label:'沿河居民户', labelRight:'沿河居民户列表', icon:'yanhejuminhu' },
] },
{ key:'4', label:'水资源调度', children:[
{ key:'41', label:'供水', labelRight:'今日供水实况', icon:'gongshui' },
] },
{ key:'5', label:'水库工程', children:[
{ key:'51', label:'水库', labelRight:'基本信息', icon:'shuiku' },
{ key:'52', label:'大坝', labelRight:'基本信息', icon:'daba' },
{ key:'53', label:'溢洪道', labelRight:'基本信息', icon:'yihongdao' },
] },
{
key: '1', label: '综合监视', children: [
{ key: '11', label: '预警', labelRight: '预警', icon: 'yujing' },
{ key: '12', label: '雨情', labelRight: '统计', icon: 'yuqing' },
{ key: '13', label: '水库水情', labelRight: '实时水情', icon: 'shuikushuiqing' },
{ key: '19', label: '土壤墒情', labelRight: '土壤墒情', icon: 'turangshangqing' },
{ key: '15', label: '工程安全', labelRight: '工程安全监测', icon: 'gongchenganquan' },
{ key: '16', label: '监测设备状态', labelRight: '监测设备运行', icon: 'jianceshebeizhuangtai' },
// { key:'17', label:'水质', labelRight:'水质', icon:'shuizhi' },
{ key: '18', label: '视频点', labelRight: '视频点', icon: 'shipindian' },
]
},
{
key: '2', label: '巡查巡检', children: [
{ key: '21', label: '巡查巡检', labelRight: '工程巡检', icon: 'jianceshebeizhuangtai' },
// { key:'22', label:'大坝', labelRight:'基本信息', icon:'daba' },
// { key:'23', label:'溢洪道', labelRight:'基本信息', icon:'yihongdao' },
]
},
{
key: '3', label: '洪水防御', children: [
{ key: '31', label: '危险区', labelRight: '危险区列表', icon: 'weixianqu' },
{ key: '32', label: '安置点', labelRight: '安置点列表', icon: 'anzhidian' },
{ key: '33', label: '企事业单位', labelRight: '企事业单位列表', icon: 'qishiyedanwei' },
{ key: '34', label: '沿河居民户', labelRight: '沿河居民户列表', icon: 'yanhejuminhu' },
]
},
{
key: '4', label: '水资源调度', children: [
{ key: '41', label: '供水', labelRight: '今日供水实况', icon: 'gongshui' },
]
},
{
key: '5', label: '水库工程', children: [
{ key: '51', label: '水库', labelRight: '基本信息', icon: 'shuiku' },
{ key: '52', label: '大坝', labelRight: '基本信息', icon: 'daba' },
{ key: '53', label: '溢洪道', labelRight: '基本信息', icon: 'yihongdao' },
]
},
]
const HomePage = ({showPanels}) => {
const HomePage = ({ showPanels }) => {
// 添加搜索输入框的引用
const searchInputRef = useRef(null);
const dispatch = useDispatch();
const [checkedObj, setCheckedObj] = useState({})
const [searchVal, setSearchVal] = useState()
const [showTable, setShowTable] = useState(false)
const [wxqData, setWxqData] = useState({})
const [tms, setTms] = useState([
moment(moment().add(-1, 'days').format('YYYY-MM-DD 08:00:00')),
moment(moment().format('YYYY-MM-DD 08:00:00')),
])
let mapObj = useSelector(s => s.map.map)
const dispatch = useDispatch();
const [ checkedObj, setCheckedObj ] = useState({})
const [ showTable, setShowTable ] = useState(false)
const [ tms , setTms ] = useState([
moment(moment().add(-1,'days').format('YYYY-MM-DD 08:00:00')),
moment(moment().format('YYYY-MM-DD 08:00:00')),
])
// 在 globalSearch 函数中添加搜索结果状态
const [searchResults, setSearchResults] = useState([]);
const globalSearch = async (e) => {
if (e && e.trim() !== '') {
// 设置为空白状态
setShowTable(true);
setSearchVal(e)
// 创建一个新的空对象,只保留必要的属性用于显示
setCheckedObj({
key: 'search',
label: '搜索结果',
labelRight: `搜索:${e}`,
icon: 'search'
});
const res = await httpget(apiurl.home.globalSearch, { name: e })
if (res.code == 200) {
setSearchResults(res.data);
}
}
}
const importMap = {
'业务规则库': () => import('../../sz/ywgz/form'),
'调度方案库': () => import('../../sz/ddfa/form'),
'工程安全知识库': () => import('../../sz/khzbgl/form')
};
// 业务规则库弹框
const regularOpen = async (record) => {
const id = record?.unionCode
const com = record.type == '业务规则库' ?
{ url: apiurl.zsk.ywgz.getOne } :
record.type == '调度方案库' ?
{ url: apiurl.zsk.ddfa.getOne } :
{ url: apiurl.zsk.gcaq.getOne };
const res = await httpget(com.url + id)
// 导入业务规则库的Modal组件
// 使用映射函数进行导入
try {
const ModalForm = await importMap[record.type]();
Modal.destroyAll(); // 先销毁可能存在的其他Modal
const modal = Modal.confirm({
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,
content: (
<>
<div style={{ marginTop: 45 }}></div>
<ModalForm.default
mode="view"
record={res}
/>
</>
useEffect(()=>{
dispatch.runtime.closeFeaturePopAll()
if(checkedObj.label==='水库'||checkedObj.label==='大坝'||checkedObj.label==='溢洪道'||checkedObj.label==='视频点'){
dispatch.map.setLayerVisible({ PicStLayer: true })
}else{
dispatch.map.setLayerVisible({ PicStLayer: false })
),
icon: null,
okButtonProps: { style: { display: 'none' } },
cancelButtonProps: { style: { display: 'none' } },
closable: true
});
} catch (error) {
console.error('模块导入失败:', error);
message.error(`无法加载${record.type}详情,请稍后再试`);
}
return;
}
// 工程安全监测点
const renderGCaqModal = (record) => {
const row = { ...record, stationCode: record.name }
let popType = '';
if (record.type == '渗压站') {
popType = 'shenya';
} else if (record.type == '渗流站') {
popType = 'shenliu';
} else if (record.type == '位移站') {
popType = 'weiyi';
}
dispatch.runtime.setFeaturePop({
type: popType,
data: row,
lgtd: record.lgtd,
lttd: record.lttd,
id: record.id
});
return;
}
// 加载危险区图层数据
const getGeoJsonData = async () => {
const radarRangeData = await fetch(`${process.env.PUBLIC_URL}/data/geojson/macheng/wxq2.geojson`)
.then(resp => resp.json())
.then(data => data.features)
.catch(() => []);
const wxq = {}
radarRangeData.map((item) => {
wxq[item.properties.ADCD] = item
})
sessionStorage.setItem('wxq', JSON.stringify(wxq))
return [...radarRangeData];
};
// 危险区图层
const addLayer = () => {
getGeoJsonData().then((data) => {
var layer = new VectorLayer({
// @ts-ignore
name: "ZHZS_WXQ",
source: new VectorSource(),
style: new Style({
stroke: new StrokeStyle({
color: 'rgba(255,0,0,0.9)',
width: 2,
}),
fill: new FillStyle({
color: 'rgba(255,0,0,0.3)',
}),
})
});
const features = data.map((item) => {
// debugger
const geojsonFormat = new GeoJSONFormat();
let geometry = geojsonFormat.readGeometry(item.geometry, {
featureProjection: 'EPSG:3857',
});
const feature = new Feature({
geometry,
data: { ...item.properties, geometry: item.geometry, myLayerType: 'wxq' },
});
return feature
})
features.forEach(feature => layer.getSource().addFeature(feature));
mapObj && mapObj.addLayer(layer);
mapObj && mapObj.on('click', function (evt) {
//console.log("271++++",postmessageData);
var feature = mapObj && mapObj.forEachFeatureAtPixel(evt.pixel, function (feature) {
return feature;
});
if (feature) {
const data = feature.values_.data
const center = geometryCenter(data.geometry);
if (data && data.myLayerType === 'wxq') {
dispatch.runtime.setCameraTarget({
center: [center[0], center[1]],
zoom: 18,
pitch: 60
})
dispatch.runtime.setFeaturePop({
id: data.PID,
data: { ...data },
type: 'wxq',
lgtd: center[0],
lttd: center[1],
})
}
}
});
if(checkedObj.label==='危险区'||checkedObj.label==='安置点'||checkedObj.label==='企事业单位'||checkedObj.label==='沿河居民户'){
dispatch.map.setLayerVisible({ AZDLayer: true })
dispatch.map.setLayerVisible({ QSYDWLayer: true })
dispatch.map.setLayerVisible({ YHJMHLayer: true })
}else{
dispatch.map.setLayerVisible({ AZDLayer: false })
dispatch.map.setLayerVisible({ QSYDWLayer: false })
dispatch.map.setLayerVisible({ YHJMHLayer: false })
});
}
const getColor = (val) => {
if (val === null) {
return '#8c8c8c';
} else if (val < 0.1) {
return '#ffffff';
} else if (val >= 0.1 && val < 10) {
return 'rgb(167, 240, 143)';
} else if (val >= 10 && val < 25) {
return 'rgb(64, 215, 255)';
} else if (val >= 25 && val < 50) {
return 'rgb(32, 143, 238)';
} else if (val >= 50 && val < 100) {
return 'rgb(85, 86, 255)';
} else if (val >= 100 && val < 250) {
return 'rgb(191, 90, 252)';
} else {
return 'rgb(246, 66, 66)';
}
};
// 雨量站图层
const addRainLayer = (arr, tms) => {
var layer = new VectorLayer({
// @ts-ignore
name: "ZHZS_YQ",
source: new VectorSource(),
style: (feature, zIndex) => {
const drp = feature.values_.data.drp
const stnm = feature.values_.data.stnm
return [new Style({
image: new Circle({
radius: 5,
fill: new FillStyle({ color: getColor(drp) }),
stroke: new Stroke({ color: getColor(drp), width: 2 })
}),
text: new Text({
text: zIndex < 50 ? `${stnm}` : '',
offsetY: 24,
font: '12px 微软雅黑',
//backgroundFill: new FillStyle({ color: "rgba(255,255,255,0.5)" }),
fill: new FillStyle({ color: "rgba(0,0,0,0.5)" }),
stroke: new Stroke({ color: '#fff', width: 1 }),
overflow: true,
}),
zIndex: drp === 0 ? 0.01 : drp * 10
})]
},
zIndex: 200,
})
var layerDrp = new VectorLayer({
// @ts-ignore
name: "ZHZS_YQ_DRP",
visible: true,
source: new VectorSource(),
style: (feature, zIndex) => {
const drp = feature.values_.data.drp
return [new Style({
text: new Text({
text: drp === null ? '-' : String(drp),
offsetY: 12,
font: '12px 微软雅黑',
//backgroundFill: new FillStyle({ color: "rgba(255,255,255,0.5)" }),
fill: new FillStyle({ color: "rgba(0,0,0,0.5)" }),
stroke: new Stroke({ color: '#fff', width: 1 }),
overflow: true,
})
})]
},
zIndex: 200,
})
const features = arr.map((item) => {
const point2 = transform([item.lgtd, item.lttd], 'EPSG:4326', 'EPSG:3857');
const feature = new Feature({
geometry: new Point(point2),
data: { ...item, myParams: tms, myLayerType: 'drp' }
});
return feature
})
features.forEach(feature => layer.getSource().addFeature(feature));
features.forEach(feature => layerDrp.getSource().addFeature(feature));
mapObj && mapObj.addLayer(layer);
mapObj && mapObj.addLayer(layerDrp);
mapObj && mapObj.on('click', function (evt) {
//console.log("271++++",postmessageData);
var feature = mapObj && mapObj.forEachFeatureAtPixel(evt.pixel, function (feature) {
return feature;
});
if (feature) {
const data = feature.values_.data
if (data && data.myLayerType === 'drp') {
dispatch.runtime.setFeaturePop({
id: data.stcd,
data: { ...data, myParams: tms },
type: 'drp',
lgtd: data.lgtd,
lttd: data.lttd,
})
}
}
});
}
const clickItem = (item) => {
// 业务规则库
if (item.type == '业务规则库' || item.type == '调度方案库' || item.type == '工程安全知识库') {
regularOpen(item)
return; // 添加return避免继续执行
}
return ()=>{
dispatch.runtime.closeFeaturePopAll()
dispatch.map.setLayerVisible({ PicStLayer: false })
dispatch.map.setLayerVisible({ AZDLayer: false })
dispatch.map.setLayerVisible({ QSYDWLayer: false })
dispatch.map.setLayerVisible({ YHJMHLayer: false })
// 工程安全监测点
if (item.type == '渗压站' || item.type == '渗流站' || item.type == '位移站') {
renderGCaqModal(item)
return; // 添加return避免继续执行
}
// 关闭所有已打开的弹窗
dispatch.runtime.closeFeaturePopAll();
// 先关闭所有图层
dispatch.map.setLayerVisible({
HdswLayer: false,
RealDrpLayer: false,
PicStLayer: false,
ShuiKuLayer: false,
TuRangLayer: false,
GongShuiLayer: false,
AZDLayer: false,
QSYDWLayer: false,
YHJMHLayer: false
});
// 先清除已存在的同名图层
mapObj && mapObj.getLayers().getArray().forEach(layer => {
if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 ||
layer.values_.name.indexOf('ZHZS_YQ') > -1 ||
layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
layer.getSource().clear()
}
});
// 根据类型确定弹窗类型和图层
let popType = item.type;
let layerToShow = {};
// 对特定类型进行映射和图层设置
switch (item.type) {
// case '水文站':
// popType = 'hdsw';
// layerToShow = { HdswLayer: true };
// break;
// case '雨量站':
// popType = 'drp';
// layerToShow = { RealDrpLayer: true };
// break;
case '视频站':
popType = 'tuxiang';
layerToShow = { PicStLayer: true };
break;
case '水位站':
popType = 'shuiku';
layerToShow = { ShuiKuLayer: true };
break;
case '土壤墒情站':
popType = 'turangshangqing';
layerToShow = { TuRangLayer: true };
break;
case '流量站':
popType = 'gongshui';
layerToShow = { GongShuiLayer: true };
break;
case '安置点':
popType = 'anzhidian';
layerToShow = { AZDLayer: true };
break;
case '企事业单位':
popType = 'qishiyedanwei';
layerToShow = { QSYDWLayer: true };
break;
case '沿河居民点':
popType = 'yanhejuminhu';
layerToShow = { YHJMHLayer: true };
break;
default:
// 默认不设置特定图层
break;
}
// 设置图层可见性
if (Object.keys(layerToShow).length > 0) {
dispatch.map.setLayerVisible(layerToShow);
}
const record = JSON.parse(item.jsonStr);
if (item.type == '危险区') {
addLayer()
const wxq = JSON.parse(sessionStorage.getItem('wxq'))?.[record?.adcd] || ''
if (!wxq) {
message.error('暂无经纬度数据')
return
}
const data = wxq.properties
const center = item.type == '危险区' ? geometryCenter(wxq.geometry) :
[record?.lgtd, record?.lttd];
dispatch.runtime.setCameraTarget({
center: [center[0], center[1]],
zoom: 18,
pitch: 60
})
dispatch.runtime.setFeaturePop({
id: data.PID,
data: { ...data },
type: 'wxq',
lgtd: center[0],
lttd: center[1],
})
return;
}
if (item.type == '安置点' || item.type == '企事业单位' || item.type == '沿河居民点') {
// 显示弹窗
dispatch.runtime.setFeaturePop({
type: popType,
data: record,
lgtd: item.lgtd,
lttd: item.lttd,
id: record.id
});
}
// 雨量站
if (item.type == '雨量站') {
// 创建近一小时的时间范围
const tms = [
moment().add(-1, 'hours').format('YYYY-MM-DD HH:mm:ss'),
moment().format('YYYY-MM-DD HH:mm:ss')
];
// 直接调用httppost2获取数据并添加图层
const fetchAndAddLayer = async () => {
try {
const { data, code, msg } = await httppost2(apiurl.home.yq, {
"stm": tms[0],
"etm": tms[1]
});
if (code !== 200) {
message.error(msg || '请求失败');
return;
}
const list = data.map((i) => ({
id: i.stcd,
...i,
drp: i.drp
}));
// 清除已存在的同名图层
// mapObj && mapObj.getLayers().getArray().forEach(layer => {
// if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_YQ') > -1)) {
// mapObj.removeLayer(layer);
// }
// });
// 创建雨量站图层
addRainLayer(list, tms)
} catch (error) {
console.error('获取雨量站数据失败', error);
}
},[checkedObj])
};
useEffect(()=>{
setCheckedObj({ key:'12', label:'雨情', labelRight:'统计', icon:'yuqing' })
},[])
fetchAndAddLayer();
}
return (
<div className='homePage' style={{display:!showPanels?'none':'block'}}>
<div className='homePage_leftBox'>
<div className='homePage_head'>综合展示</div>
<Collapse ghost onChange={(a)=>{
dispatch.runtime.closeFeaturePopAll()
if(a===undefined){
setCheckedObj({ key:'12', label:'雨情', labelRight:'统计', icon:'yuqing' })
setShowTable(false)
}else if(a==='1'){
setShowTable(true)
dispatch.runtime.setHome()
setCheckedObj({ key:'11', label:'预警', labelRight:'预警', icon:'yujing' })
}else if(a==='2'){
setShowTable(true)
// dispatch.runtime.setHome()
setCheckedObj({ key:'21', label:'巡查巡检', labelRight:'工程巡检', icon:'shuiku' })
}else if(a==='3'){
dispatch.runtime.setCameraTarget({
center: [114.75, 31.493],
zoom: 13.5,
pitch: 60
})
setShowTable(true)
setCheckedObj({ key:'31', label:'危险区', labelRight:'危险区列表', icon:'weixianqu' })
}else if(a==='4'){
setCheckedObj({ key:'41', label:'供水', labelRight:'今日供水实况', icon:'gongshui' })
}else if(a==='5'){
setCheckedObj({ key:'51', label:'水库', labelRight:'基本信息', icon:'shuiku' })
setShowTable(true)
}else{
}
}} expandIconPosition="end" accordion={true} bordered={false}>
{
items.map((item,index)=>
<Panel
key={item.key}
header={
<>
<div className='homePage_Panel'>
<div className='homePage_Panel_icon'></div>
{item.label}
</div>
</>
}
>
{
item.children.map((item)=>
<dit className='homePage_Panel_item' style={(checkedObj.key===item.key&&showTable)?{color:'#409eff'}:{}} onClick={()=>{
setCheckedObj(item)
setShowTable(true)
}}>
<img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/${item.icon}.png`} width="20" height="20" alt="" style={{marginRight:'10px'}} />
{item.label}
{
(checkedObj.key===item.key&&showTable)?
<div style={{flex:1,display:'flex',flexDirection:'row-reverse'}}>
<div style={{width:"3px",height:'40px',background:'rgba(64, 158, 255, 1)'}}></div>
</div>
:null
}
</dit>
)
}
</Panel>
)
}
</Collapse>
</div>
{
(checkedObj.label === '预警'||checkedObj.label === '雨情')?
<div className='homePage_centerBox'><RangePicker showTime value={tms} disabled/></div>
:null
// 设置地图视角
dispatch.runtime.setCameraTarget({
center: [item.lgtd, item.lttd],
zoom: 18,
pitch: 60
});
}
useEffect(() => {
dispatch.runtime.closeFeaturePopAll()
// 如果是搜索结果,不要关闭图层
if (checkedObj.label === '搜索结果') {
// 主动设置相关图层可见
return;
}
if (checkedObj.label === '水库' || checkedObj.label === '大坝' || checkedObj.label === '溢洪道' || checkedObj.label === '视频点') {
dispatch.map.setLayerVisible({ PicStLayer: true })
} else {
dispatch.map.setLayerVisible({ PicStLayer: false })
}
if (checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户') {
dispatch.map.setLayerVisible({ AZDLayer: true })
dispatch.map.setLayerVisible({ QSYDWLayer: true })
dispatch.map.setLayerVisible({ YHJMHLayer: true })
} else {
dispatch.map.setLayerVisible({ AZDLayer: false })
dispatch.map.setLayerVisible({ QSYDWLayer: false })
dispatch.map.setLayerVisible({ YHJMHLayer: false })
}
return () => {
dispatch.runtime.closeFeaturePopAll()
dispatch.map.setLayerVisible({ PicStLayer: false })
dispatch.map.setLayerVisible({ AZDLayer: false })
dispatch.map.setLayerVisible({ QSYDWLayer: false })
dispatch.map.setLayerVisible({ YHJMHLayer: false })
}
}, [checkedObj])
useEffect(() => {
setCheckedObj({ key: '12', label: '雨情', labelRight: '统计', icon: 'yuqing' })
getGeoJsonData()
}, [])
return (
<div className='homePage' style={{ display: !showPanels ? 'none' : 'block' }}>
<div className='homePage_leftBox'>
<Search
placeholder="请输入"
onSearch={globalSearch}
enterButton
ref={searchInputRef}
value={searchVal}
onChange={(e) => setSearchVal(e.target.value)}
/>
<div className='homePage_head' style={{ marginTop: 10 }}>综合展示</div>
<Collapse ghost onChange={(a) => {
// 清空搜索输入框
setSearchVal('')
dispatch.runtime.closeFeaturePopAll()
dispatch.map.setLayerVisible({ ShuiKuLayer: false })
mapObj && mapObj.getLayers().getArray().forEach(layer => {
if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
layer.getSource().clear()
}
});
dispatch.runtime.setHome()
if (a === undefined) {
setCheckedObj({ key: '12', label: '雨情', labelRight: '统计', icon: 'yuqing' })
setShowTable(false)
} else if (a === '1') {
setShowTable(true)
// dispatch.runtime.setHome()
setCheckedObj({ key: '11', label: '预警', labelRight: '预警', icon: 'yujing' })
} else if (a === '2') {
setShowTable(true)
// dispatch.runtime.setHome()
setCheckedObj({ key: '21', label: '巡查巡检', labelRight: '工程巡检', icon: 'shuiku' })
} else if (a === '3') {
dispatch.runtime.setCameraTarget({
center: [114.75, 31.493],
zoom: 13.5,
pitch: 60
})
setShowTable(true)
setCheckedObj({ key: '31', label: '危险区', labelRight: '危险区列表', icon: 'weixianqu' })
} else if (a === '4') {
setCheckedObj({ key: '41', label: '供水', labelRight: '今日供水实况', icon: 'gongshui' })
} else if (a === '5') {
setCheckedObj({ key: '51', label: '水库', labelRight: '基本信息', icon: 'shuiku' })
setShowTable(true)
} else {
}
}} expandIconPosition="end" accordion={true} bordered={false}>
{
items.map((item, index) =>
<Panel
key={item.key}
header={
<>
<div className='homePage_Panel'>
<div className='homePage_Panel_icon'></div>
{item.label}
</div>
</>
}
>
{
item.children.map((item) =>
<dit className='homePage_Panel_item' style={(checkedObj.key === item.key && showTable) ? { color: '#409eff' } : {}} onClick={() => {
// 清空搜索输入框
setSearchVal('')
setCheckedObj(item)
setShowTable(true)
dispatch.map.setLayerVisible({ ShuiKuLayer: false })
mapObj && mapObj.getLayers().getArray().forEach(layer => {
if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ') > -1 || layer.values_.name.indexOf('ZHZS_YQ_DRP') > -1)) {
layer.getSource().clear()
}
});
dispatch.runtime.setHome()
}}>
<img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/${item.icon}.png`} width="20" height="20" alt="" style={{ marginRight: '10px' }} />
{item.label}
{
(checkedObj.key === item.key && showTable) ?
<div style={{ flex: 1, display: 'flex', flexDirection: 'row-reverse' }}>
<div style={{ width: "3px", height: '40px', background: 'rgba(64, 158, 255, 1)' }}></div>
</div>
: null
}
</dit>
)
}
</Panel>
)
}
</Collapse>
</div>
{
(checkedObj.label === '预警' || checkedObj.label === '雨情') ?
<div className='homePage_centerBox'><RangePicker showTime value={tms} disabled /></div>
: null
}
{
checkedObj.labelRight ?
<div className='homePage_rightBox' style={{ display: !showPanels ? 'none' : 'block', padding: showTable ? '10px' : '0px' }}>
{
checkedObj.labelRight?
<div className='homePage_rightBox' style={{display:!showPanels?'none':'block',padding:showTable?'10px':'0px',}}>
{
showTable?
<div className='homePage_head2'>
<div className='homePage_head2_Bg'>
<img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/titleBg2.png`} width="14" height="14" alt="" style={{margin:'0 10px'}} />
{checkedObj.labelRight}
</div>
<div style={{display:'flex',alignItems:'center'}}>
{/* <img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/x.svg`} width="12" height="12" alt="" style={{margin:'0 10px'}} /> */}
</div>
</div>:null
}
{ checkedObj.label === '预警' ? <><Yujing mySetTms={setTms}/><Yuqing mySetTms={setTms} show={false}/></>:null }
{ checkedObj.label === '雨情' ? <Yuqing mySetTms={setTms} show={showTable}/>:null }
{ checkedObj.label === '水库水情' ? <ShuiKu/>:null }
{ checkedObj.label === '土壤墒情' ? <TuRangShangQing/>:null }
{ checkedObj.label === '供水' ? <GongShui/>:null }
{ checkedObj.label === '工程安全' ? <GongCheng/>:null }
{ checkedObj.label === '监测设备状态' ? <JianCe/>:null }
{/* { checkedObj.label === '水质' ? <ShuiZhi/>:null } */}
{ checkedObj.label === '视频点' ? <ShiPinDian/>:null }
showTable ?
<div className='homePage_head2'>
{
checkedObj.key != 'search' ?
<div className='homePage_head2_Bg'>
<img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/titleBg2.png`} width="14" height="14" alt="" style={{ margin: '0 10px' }} />
{checkedObj.labelRight}
</div> :
<div style={{ width: '100%', display: 'flex', alignItems: 'center', padding: "10px 0", borderBottom: '1px solid #02a7f0' }}>
<div style={{ width: 6, height: 20, background: '#02a7f0', marginRight: 10 }}></div>
<div>{checkedObj.labelRight}</div>
</div>
}
{ checkedObj.label === '巡查巡检' ? <XunChaXunJian/>:null }
{ checkedObj.label === '水库' ? <GCShuiKu/>:null }
{ checkedObj.label === '大坝' ? <DaBa/>:null }
{ checkedObj.label === '溢洪道' ? <YiHongDao/>:null }
{ checkedObj.label === '危险区' ? <WeiXianQx/>:null }
{ checkedObj.label === '安置点' ? <AnZhiDian/>:null }
{ checkedObj.label === '企事业单位' ? <QSYDW/>:null }
{ checkedObj.label === '沿河居民户' ? <YHJMH/>:null }
{ checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户'?<SetWxqStation/>:null }
</div>
:null
<div style={{ display: 'flex', alignItems: 'center' }}>
{/* <img src={`${process.env.PUBLIC_URL}/assets/xyt/homeImg/x.svg`} width="12" height="12" alt="" style={{margin:'0 10px'}} /> */}
</div>
</div> : null
}
{checkedObj.label === '搜索结果' ? <div className="search-result-container" style={{
marginTop: '10px', maxHeight: 'calc(100vh - 150px)', /* 设置一个合适的高度,可以根据实际情况调整 */
display: 'flex',
flexDirection: 'column'
}}>
<SearchResultList
data={searchResults}
title={checkedObj.labelRight}
onItemClick={(item) => clickItem(item)}
/>
</div> : null}
{checkedObj.label === '预警' ? <><Yujing mySetTms={setTms} /><Yuqing mySetTms={setTms} show={false} /></> : null}
{checkedObj.label === '雨情' ? <Yuqing mySetTms={setTms} show={showTable} /> : null}
{checkedObj.label === '水库水情' ? <ShuiKu /> : null}
{checkedObj.label === '土壤墒情' ? <TuRangShangQing /> : null}
{checkedObj.label === '供水' ? <GongShui /> : null}
{checkedObj.label === '工程安全' ? <GongCheng /> : null}
{checkedObj.label === '监测设备状态' ? <JianCe /> : null}
{/* { checkedObj.label === '水质' ? <ShuiZhi/>:null } */}
{checkedObj.label === '视频点' ? <ShiPinDian /> : null}
{
checkedObj.label === '工程安全' ?<div className='homePage_bztBox'>
<Bzt isHome={true}/>
</div>:null
}
{checkedObj.label === '巡查巡检' ? <XunChaXunJian /> : null}
<div className='homePage_leftBottomBox'>
{ checkedObj.label==='雨情'?<Tuli/>:null }
{ checkedObj.label==='水库水情'?<Tuli2/>:null }
{ checkedObj.label==='供水'?<Tuli3/>:null }
{ (checkedObj.label==='水库'||checkedObj.label==='大坝'||checkedObj.label==='溢洪道'||checkedObj.label==='视频点')?<Tuli4/>:null }
{ (checkedObj.label==='危险区'||checkedObj.label==='安置点'||checkedObj.label==='企事业单位'||checkedObj.label==='沿河居民户')?<Tuli5/>:null }
</div>
</div>
)
{checkedObj.label === '水库' ? <GCShuiKu /> : null}
{checkedObj.label === '大坝' ? <DaBa /> : null}
{checkedObj.label === '溢洪道' ? <YiHongDao /> : null}
{checkedObj.label === '危险区' ? <WeiXianQx /> : null}
{checkedObj.label === '安置点' ? <AnZhiDian /> : null}
{checkedObj.label === '企事业单位' ? <QSYDW /> : null}
{checkedObj.label === '沿河居民户' ? <YHJMH /> : null}
{checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户' ? <SetWxqStation /> : null}
{checkedObj.label === '搜索结果' ? <SetDrpStation tms={tms} setTableData={() => { }} /> : null}
</div>
: null
}
{
checkedObj.label === '工程安全' ? <div className='homePage_bztBox'>
<Bzt isHome={true} />
</div> : null
}
<div className='homePage_leftBottomBox'>
{checkedObj.label === '雨情' ? <Tuli /> : null}
{checkedObj.label === '水库水情' ? <Tuli2 /> : null}
{checkedObj.label === '供水' ? <Tuli3 /> : null}
{(checkedObj.label === '水库' || checkedObj.label === '大坝' || checkedObj.label === '溢洪道' || checkedObj.label === '视频点') ? <Tuli4 /> : null}
{(checkedObj.label === '危险区' || checkedObj.label === '安置点' || checkedObj.label === '企事业单位' || checkedObj.label === '沿河居民户') ? <Tuli5 /> : null}
</div>
</div>
)
}
export default HomePage

View File

@ -29,11 +29,11 @@ const Page = () => {
]
}else{
return [
{ title: '监测点', key: 'stationCode', dataIndex: 'stationCode',align: "center",width: 80, ellipsis: true },
{ title: '监测点', key: 'cd', dataIndex: 'cd',align: "center",width: 80, ellipsis: true },
{ title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 80, ellipsis: true, render:(v,row)=><div style={{color:row.flag===1?'red':'#3B4859'}}><div>{v?.slice(5,10)}</div><div>{v?.slice(11,16)}</div></div> },
{ title: <div><div>X方向</div><div>(mm)</div></div>, key: 'x', dataIndex: 'x',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.xstatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>Y方向</div><div>(mm)</div></div>, key: 'y', dataIndex: 'y',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.ystatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>H方向</div><div>(mm)</div></div>, key: 'h', dataIndex: 'h',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.hstatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>e方向</div><div>(mm)</div></div>, key: 'de', dataIndex: 'de',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.xstatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>n方向</div><div>(mm)</div></div>, key: 'dn', dataIndex: 'dn',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.ystatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>u方向</div><div>(mm)</div></div>, key: 'du', dataIndex: 'du',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.hstatus===1?'red':'#3B4859'}}>{v}</div> },
]
}
}, [checked]);
@ -89,7 +89,10 @@ const Page = () => {
<Table rowKey="stationCode"
sticky
columns={columns}
pagination={false}
pagination={checked == '位移监测' ?{
pageSize: 100,
showSizeChanger: true,
pageSizeOptions: [ '100', '200']}:false}
dataSource={tableData}
scroll={{ y: "300px"}}
onRow={

View File

@ -25,13 +25,13 @@ const Page = () => {
},[])
const getData = async (params) => {
const data = await reservoirlist(params) || []
const list = [...data.filter(o=>o.stnm==='檀树岗(新)'),...data.filter(o=>o.stnm!=='檀树岗(新)')]
const data = await reservoirlist(params) || []
// const list = [...data.filter(o=>o.stnm==='檀树岗(新)'),...data.filter(o=>o.stnm!=='檀树岗(新)')]
const list = [...data.filter(o=>o.stnm==='檀树岗'),...data.filter(o=>o.stnm==='檀树岗(新)')]
setData(list)
}
const getShuiKu = () => {
SkRealPromiseWX.get().then((res) => {
const list = [...res].map((i)=>{
return {
@ -40,7 +40,8 @@ const Page = () => {
...i
}
})
const list2 = [...list.filter(o=>o.stnm==='檀树岗(新)'),...list.filter(o=>o.stnm!=='檀树岗(新)')]
// const list2 = [...list.filter(o=>o.stnm==='檀树岗(新)'),...list.filter(o=>o.stnm!=='檀树岗(新)')]
const list2 = [...list.filter(o=>o.stnm==='檀树岗'),...list.filter(o=>o.stnm==='檀树岗(新)')]
console.log('res',list2);
const data = list2[checked]
dispatch.runtime.setFeaturePop({

View File

@ -68,7 +68,6 @@ const HomePage = () => {
{/* 地图 */}
<MapCtrl mode={mode}/>
{/*首页面板*/}
{pathname === '/mgr/home' ? (
<HomePanelsLayoutPage showPanels={showPanels} />

View File

@ -76,7 +76,7 @@ export default function SetDrpStation({tms, setTableData}) {
}
const addLayer = (arr,tms)=>{
const addLayer = (arr, tms) => {
var layer = new VectorLayer({
// @ts-ignore
name:"ZHZS_YQ",

View File

@ -59,7 +59,14 @@ export default function SetDrpStation({tms}) {
const addLayer = ()=>{
const addLayer = () => {
// 先清除已存在的同名图层
mapObj && mapObj.getLayers().getArray().forEach(layer => {
if (layer.values_.name && (layer.values_.name.indexOf('ZHZS_WXQ') > -1)) {
mapObj.removeLayer(layer);
}
});
getGeoJsonData().then((data) => {
var layer = new VectorLayer({
// @ts-ignore

View File

@ -44,11 +44,11 @@ export default function Page({isHome}) {
]
const columnsWy = [
{ title: '监测点', key: 'stationCode', dataIndex: 'stationCode',align: "center",width: 80, ellipsis: true },
{ title: '监测点', key: 'cd', dataIndex: 'cd',align: "center",width: 80, ellipsis: true },
{ title: '监测时间', key: 'tm', dataIndex: 'tm',align: "center",width: 80, ellipsis: true, render:(v,row)=><div style={{color:row.flag===1?'red':'#3B4859'}}><div>{v?.slice(5,10)}</div><div>{v?.slice(11,16)}</div></div> },
{ title: <div><div>X方向</div><div>(mm)</div></div>, key: 'x', dataIndex: 'x',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.xstatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>Y方向</div><div>(mm)</div></div>, key: 'y', dataIndex: 'y',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.ystatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>H方向</div><div>(mm)</div></div>, key: 'h', dataIndex: 'h',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.hstatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>e方向</div><div>(mm)</div></div>, key: 'de', dataIndex: 'de',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.xstatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>n方向</div><div>(mm)</div></div>, key: 'dn', dataIndex: 'dn',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.ystatus===1?'red':'#3B4859'}}>{v}</div> },
{ title: <div><div>u方向</div><div>(mm)</div></div>, key: 'du', dataIndex: 'du',align: "center", ellipsis: true, render:(v,row)=><div style={{color:row.hstatus===1?'red':'#3B4859'}}>{v}</div> },
]
@ -194,8 +194,13 @@ export default function Page({isHome}) {
<Table rowKey="stationCode"
sticky
columns={columnsWy}
pagination={false}
// pagination={false}
dataSource={wyList}
pagination={{
pageSize: 100,
showSizeChanger: true,
pageSizeOptions: [ '100', '200'],
}}
scroll={{ y: "650px"}}
onRow={
(data)=>({

View File

@ -49,9 +49,9 @@ const Page = () => {
width: 100,
align: "center",
children: trData?.map(item => ({
title: item.stationCode,
key: item.stationCode,
dataIndex: item.stationCode,
title: item.mpcd,
key: item.mpcd,
dataIndex: item.mpcd,
width: 100,
align: "center",
render: (rec, record) => <span>{rec?? "-"}</span>
@ -70,7 +70,7 @@ const Page = () => {
let newArr = [];
let newData = res.data?.map((s, i) => {
newArr.push(s.list?.map(c => ({
[c.stationCode]: c.value || '-',
[c.stationCode]: (c.value || c.value == 0) ? c.value : '-',
tm:c.tm
})))
return {
@ -106,7 +106,7 @@ const Page = () => {
const exportExcel = () => {
let params = {
...searchVal,
stationCodes: trData.map(s => s.stationCode),
stationCodes: trData.map(s => s.mpcd),
type:2,
id:1
}
@ -126,7 +126,7 @@ const Page = () => {
if (trData && trData.length > 0) {
const params = {
...searchVal,
stationCodes: trData.map(s => s.stationCode),
stationCodes: trData.map(s => s.mpcd),
type:2
};
getTableData(params)
@ -138,7 +138,7 @@ const Page = () => {
if (trData && trData?.length > 0) {
let params = {
...searchVal,
stationCodes:trData.map(s => s.stationCode),
stationCodes:trData.map(s => s.mpcd),
type:2
}
getTable2Data(params)

View File

@ -16,7 +16,7 @@ const Page = () => {
const [table2Data, setTable2Data] = useState([])
const [loading, setLoading] = useState(false)
const [wyObj, setWyObj] = useState(false)
const wyList = ["X","Y","H"]
const wyList = ["e","n","u"]
const columns1 = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 150, align:"center"},
];
@ -55,13 +55,13 @@ const Page = () => {
if (trData.length > 0 && wyObj) {
let dm = trData?.map(item => (
{
title: item.stationCode,
title: item.cd,
width: 100,
align: "center",
children: wyList?.map(s => ({
title: s,
key: `${s}_${item.stationCode}`,
dataIndex: `${s}_${item.stationCode}`,
key: `${s}_${item.cd}`,
dataIndex: `${s}_${item.cd}`,
width: 100,
align: "center",
render: (rec, record) => <span>{rec?? "-"}</span>
@ -83,10 +83,10 @@ const Page = () => {
let newArr = [];
let newData = res.data?.map((s, i) => {
newArr.push(s.list?.map((c, i) => ({
[c.stationCode]: c.value || '-',
[`X_${c.stationCode}`]:c.x ,
[`Y_${c.stationCode}`]:c.y ,
[`H_${c.stationCode}`]:c.h ,
[c.cd]: (c.value || c.value == 0) ? c.value : '-',
[`e_${c.cd}`]:c.de ,
[`n_${c.cd}`]:c.dn ,
[`u_${c.cd}`]:c.du ,
tm: c.tm,
})))
return {
@ -125,7 +125,7 @@ const Page = () => {
const exportExcel = () => {
let params = {
...searchVal,
stationCodes: [trData.find(s => s.stationCode == wyObj.wy)?.stationCode],
stationCodes: [trData.find(s => s.cd == wyObj.wy)?.cd],
type:2,
id:1
}
@ -156,7 +156,7 @@ const Page = () => {
if (trData && trData.length > 0) {
const params = {
...searchVal,
stationCodes: trData.map(s => s.stationCode),
stationCodes: trData.map(s => s.cd),
};
getTableData(params)
@ -167,11 +167,11 @@ const Page = () => {
if (trData && trData?.length > 0) {
let params = {
...searchVal,
stationCodes:[trData.find(s => s.stationCode == wyObj.wy)?.stationCode],
stationCodes:[trData.find(s => s.cd == wyObj.wy)?.cd],
}
getTable2Data(params)
}
}, [trData,wyObj])
}, [trData,wyObj,searchVal])
useEffect(() => {
getDmTree()

View File

@ -31,15 +31,15 @@ const ToolBar = ({ setSearchVal, setDmName, exportFile, role,list,setWyObj }) =>
useEffect(() => {
let time = moment()
form.setFieldValue("tm", time)
form.setFieldValue("wy","WY-01")
form.setFieldValue("wy","07")
setSearchVal({ year: moment().format("YYYY")})
setWyObj({ wy: "WY-01"})
setWyObj({ wy: "07"})
}, [])
useEffect(() => {
if (list.length > 0) {
const newList = list.map(item => ({
label: item.stationCode,
value:item.stationCode
label: item.cd,
value:item.cd
}))
setSource(newList)
}

View File

@ -37,7 +37,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode,profileCode:s.profileCode})));
setCodeList(res.data);
} catch (error) {
console.log(error);
}
@ -58,94 +58,60 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
initialValues={record}
>
<Row>
<Col span={12}>
<Col span={12}>
<Form.Item
label="监测时间"
name="tm"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[{required: true}]}
>
<DatePicker disabled={mode==='view'||mode==='edit'} format={'YYYY-MM-DD HH:mm:ss'} style={{width:'100%'}} allowClear showTime />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="监测断面"
name="profileCode"
label="水库代码"
name="rscd"
rules={[{ required: true }]}
>
<NormalSelect
disabled={mode==='view'||mode==='edit'}
allowClear
style={{ width: "100%" }}
options={dmList}
onChange={(v)=>{
form.setFieldValue('stationCode',null)
setDmCode(v)
}}
/>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
</Col>
<Col span={12}>
<Form.Item
label="水工建筑物编号"
name="hycncd"
rules={[{ required: true }]}
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="测点编号"
rules={[{ required: true }]}
name="stationCode"
name="mpcd"
>
<NormalSelect
disabled={mode==='view'||mode==='edit'}
disabled={true}
allowClear
style={{ width: "100%" }}
options={codeList.filter(o=>dmCode?o.profileCode===dmCode:true)}
options={codeList.map(o => ({ label: o.mpcd, value: o.mpcd }))}
/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="通道号"
rules={[{ required: true }]}
name="chan"
label="测量时间"
name="mstm"
getValueFromEvent={(e,dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
<DatePicker disabled={true} format={'YYYY-MM-DD HH:mm:ss'} style={{width:'100%'}} allowClear showTime />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="测压管水位(m)"
name="value"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="渗压(KPa)"
name="press"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={12}>
<Form.Item
label="振弦(Hz)"
name="vib"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
</Col>
<Col span={12}>
<Form.Item
label="温度(℃)"
name="temp"
name="tm"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="渗流压力水位(m)"
name="spprwl"
>
<InputNumber disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>

View File

@ -18,14 +18,16 @@ const Page = () => {
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '监测时间', key: 'tm', dataIndex: 'tm', align:"center", },
{ title: '监测断面', key: 'profileName', dataIndex: 'profileName', align:"center", },
{ title: '测点编号', key: 'stationCode', dataIndex: 'stationCode', align:"center", },
{ title: '测压管水位(m)', key: 'value', dataIndex: 'value', align:"center", },
{ title: '渗压(KPa)', key: 'press', dataIndex: 'press', align:"center", },
{ title: '振弦(Hz)', key: 'vib', dataIndex: 'vib', align:"center", },
{ title: '温度(℃)', key: 'temp', dataIndex: 'temp', align:"center", },
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '水库代码', key: 'rscd', dataIndex: 'rscd', width: 200, ellipsis: true, align:"center" },
{ title: '水工建筑物编号', key: 'hycncd', dataIndex: 'hycncd', width: 200, align:"center"},
{ title: '测点编号', key: 'mpcd', dataIndex: 'mpcd', width: 200, align:"center"},
{ title: '测量时间', key: 'mstm', dataIndex: 'mstm', width: 200, align:"center"},
{ title: '温度(°C)', key: 'tm', dataIndex: 'tm', width: 250, ellipsis: true,align:"center", },
{
title: '渗流压力水位(m)', key: 'spprwl', dataIndex: 'spprwl', width: 200, align:"center",
},
{ title: '更新时间', key: 'updateTm', dataIndex: 'updateTm', width: 200, ellipsis: true,align:"center", },
{
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (
@ -48,7 +50,7 @@ const Page = () => {
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
const url = apiurl.gcaqjc.sjtjcx.sjlr.syjc.del + params.stationCode+'/'+params.tm
const url = apiurl.gcaqjc.sjtjcx.sjlr.syjc.del + params.mpcd+'/'+params.mstm
refModal.current.onDeleteGet(url);
}
}

View File

@ -51,7 +51,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode,profileCode:s.profileCode})));
setCodeList(res.data.map(s=>({label:s.mpcd,value:s.mpcd,profileCode:s.mpcd})));
} catch (error) {
console.log(error);
}

View File

@ -14,7 +14,6 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
const [dmCode,setDmCode] = useState('')
const onFinish = (values) => {
debugger
if (mode === 'edit') {
onEdit(apiurl.gcaqjc.sjtjcx.sjlr.wyjc.edit,{...record,...values})
}
@ -38,7 +37,7 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.wycx.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode,profileCode:s.profileCode})));
setCodeList(res.data);
} catch (error) {
console.log(error);
}
@ -58,6 +57,55 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
onFinish={onFinish}
initialValues={record}
>
<Form.Item
label="水库编码设备编码"
rules={[{ required: true }]}
name="resCd"
>
<NormalSelect
disabled={mode==='view'}
allowClear
style={{ width: "100%" }}
options={codeList.map(s=>({label:s.resCd,value:s.resCd}))}
/>
</Form.Item>
<Form.Item
label="测点编号"
rules={[{ required: true }]}
name="cd"
>
<NormalSelect
disabled={mode==='view'}
allowClear
style={{ width: "100%" }}
options={codeList.map(s=>({label:s.cd,value:s.cd}))}
/>
</Form.Item>
<Form.Item
label="e方向变形值(mm)"
name="de"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="n方向变形值(mm)"
name="dn"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="u方向变形值(mm)"
name="du"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="站点高程(m)"
name="alt"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="监测时间"
name="tm"
@ -65,39 +113,10 @@ const ModalForm = ({ mode, record,onEdit,onSave,onSimilarSave }) => {
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
rules={[{required: true}]}
>
<DatePicker disabled={mode==='view'||mode==='edit'} format={'YYYY-MM-DD HH:mm:ss'} style={{width:'100%'}} allowClear showTime />
</Form.Item>
<Form.Item
label="测点编号"
rules={[{ required: true }]}
name="stationCode"
>
<NormalSelect
disabled={mode==='view'||mode==='edit'}
allowClear
style={{ width: "100%" }}
options={codeList}
/>
</Form.Item>
<Form.Item
label="X方向表面位移(mm)"
name="x"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="Y方向表面位移(mm)"
name="y"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
</Form.Item>
<Form.Item
label="H方向表面位移(mm)"
name="h"
>
<Input disabled={mode==='view'} style={{width:'100%'}} allowClear />
<DatePicker disabled={mode==='view'} format={'YYYY-MM-DD HH:mm:ss'} style={{width:'100%'}} allowClear showTime />
</Form.Item>
{
mode==='view'?null:(
<>

View File

@ -18,12 +18,18 @@ const Page = () => {
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '监测时间', key: 'tm', dataIndex: 'tm', align:"center", },
{ title: '测点编号', key: 'stationCode', dataIndex: 'stationCode', align:"center", },
{ title: 'X方向表面位移(mm)', key: 'x', dataIndex: 'x', align:"center", },
{ title: 'Y方向表面位移(mm)', key: 'y', dataIndex: 'y', align:"center", },
{ title: 'H方向表面位移(mm)', key: 'h', dataIndex: 'h', align:"center", },
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '水库编码设备编码', key: 'resCd', dataIndex: 'resCd', width: 200, ellipsis: true, align:"center" },
{ title: '测点编号', key: 'cd', dataIndex: 'cd', width: 200, align:"center"},
{
title: 'e方向变形值(mm)', key: 'de', dataIndex: 'de', width: 200, align:"center",
},
{ title: 'n方向变形值(mm)', key: 'dn', dataIndex: 'dn', width: 200, ellipsis: true,align:"center", },
{ title: 'u方向变形值(mm)', key: 'du', dataIndex: 'du', width: 200, ellipsis: true, align: "center", },
{ title: '站点高程', key: 'alt', dataIndex: 'alt', width: 200, align:"center"},
{ title: '监测时间', key: 'tm', dataIndex: 'tm', width: 200, align:"center"},
{ title: '更新时间', key: 'updateTm', dataIndex: 'updateTm', width: 200, align:"center"},
{
title: '操作', key: 'operation', width: 240, fixed: 'right',align: 'center',
render: (value, row, index) => (
@ -46,7 +52,7 @@ const Page = () => {
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
const url = apiurl.gcaqjc.sjtjcx.sjlr.wyjc.del + params.stationCode+'/'+params.tm
const url = apiurl.gcaqjc.sjtjcx.sjlr.wyjc.del + params.cd+'/'+params.tm
refModal.current.onDeleteGet(url);
}
}

View File

@ -51,7 +51,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.wycx.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode})));
setCodeList(res.data.map(s=>({label:s.cd,value:s.cd})));
} catch (error) {
console.log(error);
}

View File

@ -14,14 +14,17 @@ const Page = () => {
const [searchVal, setSearchVal] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '上报时间', key: 'tm', dataIndex: 'tm', width: 200, ellipsis: true, align:"center" },
{ title: '测点编号', key: 'stationCode', dataIndex: 'stationCode', width: 200, align:"center"},
{ title: '水库代码', key: 'rscd', dataIndex: 'rscd', width: 200, ellipsis: true, align:"center" },
{ title: '水工建筑物编号', key: 'hycncd', dataIndex: 'hycncd', width: 200, align:"center"},
{ title: '测点编号', key: 'mpcd', dataIndex: 'mpcd', width: 200, align:"center"},
{ title: '测量时间', key: 'mstm', dataIndex: 'mstm', width: 200, align:"center"},
{ title: '温度(°C)', key: 'tm', dataIndex: 'tm', width: 250, ellipsis: true,align:"center", },
{ title: '渗流量(l/s)', key: 'spqn', dataIndex: 'spqn', width: 250, ellipsis: true,align:"center", },
{
title: '通道号', key: 'chan', dataIndex: 'chan', width: 200, align:"center",
title: '标准水温渗流量(l/s)', key: 'stspqn', dataIndex: 'stspqn', width: 200, align:"center",
},
{ title: '水深(mm)', key: 'l', dataIndex: 'l', width: 200, ellipsis: true,align:"center", },
{ title: '流量(L/s)', key: 'q', dataIndex: 'q', width: 250, ellipsis: true,align:"center", },
{ title: '创建时间', key: 'createTime', dataIndex: 'createTime', width: 200, ellipsis: true,align:"center" },
{ title: '更新时间', key: 'updateTm', dataIndex: 'updateTm', width: 200, ellipsis: true,align:"center" },
];

View File

@ -15,17 +15,15 @@ const Page = () => {
const [searchVal, setSearchVal] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '上报时间', key: 'tm', dataIndex: 'tm', width: 200, ellipsis: true, align:"center" },
{ title: '监测断面', key: 'profileName', dataIndex: 'profileName', width: 200, ellipsis: true, align:"center" },
{ title: '测点编号', key: 'stationCode', dataIndex: 'stationCode', width: 200, align:"center"},
{ title: '水库代码', key: 'rscd', dataIndex: 'rscd', width: 200, ellipsis: true, align:"center" },
{ title: '水工建筑物编号', key: 'hycncd', dataIndex: 'hycncd', width: 200, align:"center"},
{ title: '测点编号', key: 'mpcd', dataIndex: 'mpcd', width: 200, align:"center"},
{ title: '测量时间', key: 'mstm', dataIndex: 'mstm', width: 200, align:"center"},
{ title: '温度(°C)', key: 'tm', dataIndex: 'tm', width: 250, ellipsis: true,align:"center", },
{
title: '通道号', key: 'chan', dataIndex: 'chan', width: 200, align:"center",
title: '渗流压力水位(m)', key: 'spprwl', dataIndex: 'spprwl', width: 200, align:"center",
},
{ title: '测压管水位(m)', key: 'value', dataIndex: 'value', width: 200, ellipsis: true,align:"center", },
{ title: '渗压(KPa)', key: 'press', dataIndex: 'press', width: 200, ellipsis: true,align:"center", },
{ title: '振弦(Hz)', key: 'vib', dataIndex: 'vib', width: 250, ellipsis: true,align:"center", },
{ title: '温度(°C)', key: 'temp', dataIndex: 'temp', width: 250, ellipsis: true,align:"center", },
{ title: '更新时间', key: 'updateTm', dataIndex: 'updateTm', width: 200, ellipsis: true,align:"center", },
];
@ -64,7 +62,7 @@ const Page = () => {
role={role}
/>
</Card>
<div className="ant-card-body" style={{padding:"20px 0 0 0"}}>
<div className="ant-card-body" style={{padding:"20px 0 0 0",marginRight:20}}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width , y: "calc( 100vh - 400px )"}}/>
</div>
</div>

View File

@ -50,7 +50,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.gcaqyj.yjgzpz.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode,profileCode:s.profileCode})));
setCodeList(res.data.map(s=>({label:s.mpcd,value:s.mpcd,profileCode:s.mpcd})));
} catch (error) {
console.log(error);
}
@ -126,18 +126,18 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
options={optionsType}
/>
</Form.Item>
<Form.Item label="监测断面" name="profileCode">
<Form.Item label="监测断面" name="dm">
<NormalSelect
allowClear
style={{ width: "150px" }}
options={dmList}
onChange={(v)=>{
form.setFieldValue('stationCode',null)
form.setFieldValue('mpcd',null)
setDmCode(v)
}}
/>
</Form.Item>
<Form.Item label="测点编号" name="stationCode">
<Form.Item label="测点编号" name="mpcd">
<NormalSelect
allowClear
style={{ width: "150px" }}

View File

@ -14,14 +14,17 @@ const Page = () => {
const [searchVal, setSearchVal] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align:"center" },
{ title: '监测时间', key: 'tm', dataIndex: 'tm', width: 200, ellipsis: true, align:"center" },
{ title: '测点编号', key: 'stationCode', dataIndex: 'stationCode', width: 200, align:"center"},
{ title: '水库编码设备编码', key: 'resCd', dataIndex: 'resCd', width: 200, ellipsis: true, align:"center" },
{ title: '测点编号', key: 'cd', dataIndex: 'cd', width: 200, align:"center"},
{
title: 'X方向表面位移(mm)', key: 'x', dataIndex: 'x', width: 200, align:"center",
title: 'e方向变形值(mm)', key: 'de', dataIndex: 'de', width: 200, align:"center",
},
{ title: 'Y方向表面位移(mm)', key: 'y', dataIndex: 'y', width: 200, ellipsis: true,align:"center", },
{ title: 'n方向变形值(mm)', key: 'dn', dataIndex: 'dn', width: 200, ellipsis: true,align:"center", },
{ title: 'H方向表面位移(mm)', key: 'h', dataIndex: 'h', width: 200, ellipsis: true,align:"center", },
{ title: 'u方向变形值(mm)', key: 'du', dataIndex: 'du', width: 200, ellipsis: true, align: "center", },
{ title: '站点高程', key: 'alt', dataIndex: 'alt', width: 200, align:"center"},
{ title: '监测时间', key: 'tm', dataIndex: 'tm', width: 200, align:"center"},
{ title: '更新时间', key: 'updateTm', dataIndex: 'updateTm', width: 200, align:"center"},
];

View File

@ -40,7 +40,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
const getStationCode = async () => {
try {
const res = await httppost2(apiurl.gcaqjc.sjtjcx.wycx.list)
setCodeList(res.data.map(s=>({label:s.stationCode,value:s.stationCode})));
setCodeList(res.data.map(s=>({label:s.cdNm,value:s.cd})));
} catch (error) {
console.log(error);
}
@ -113,7 +113,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData,role }) => {
options={optionsType}
/>
</Form.Item>
<Form.Item label="测点编号" name="stationCode">
<Form.Item label="测点编号" name="cd">
<NormalSelect
allowClear
style={{ width: "150px" }}

View File

@ -76,23 +76,23 @@ const Page = () => {
const columns = [
{
title: '监测时间',
dataIndex: 'reportDate',
key: 'reportDate',
dataIndex: 'obDate',
key: 'obDate',
width: 180,
align:'center'
},
{
title: '测点编号',
dataIndex: 'pileNumber',
key: 'pileNumber',
dataIndex: 'order',
key: 'order',
width: 120,
align:'center'
},
{
title: '有无白蚁',
dataIndex: 'isHarm',
dataIndex: 'status',
align:'center',
key: 'isHarm',
key: 'status',
width: 100,
render:(text, record) => {
// 如果 isHarm 为 null 或 undefined显示无
@ -105,10 +105,10 @@ const Page = () => {
return (
<Tag
color={text ? (isHandle ? '#04d919' : '#d9001b') : '#04d919'}
color={!text ?'#04d919' : '#d9001b'}
style={{borderRadius: '50%', padding: '4px 8px'}}
>
{text ? (isHandle ? '无' : '有') : '无'}
{!text ? '无' : '有'}
</Tag>
);
}
@ -220,7 +220,7 @@ const Page = () => {
// role={role}
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" ,marginRight:20}}>
<Table columns={columns} rowKey="inx" {...tableProps} scroll={{ x: width , y: "calc( 100vh - 400px )"}}/>
</div>
</div>

View File

@ -15,7 +15,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
dateSo = moment(values.year).format('YYYY-MM-DD')
}
delete values.year
setSearchVal({...values, searchDate:dateSo});
setSearchVal({...values, obDate:dateSo});
}
// useEffect(() => {
@ -37,7 +37,7 @@ const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
style={{ width: "240px" }}
/>
</Form.Item>
<Form.Item label="测点编号" name="pileNumber">
<Form.Item label="测点编号" name="order">
<Input
allowClear
style={{ width: "240px" }}

View File

@ -74,6 +74,9 @@ const AdcdTreeSelector: React.FC<IProps> = ({ onSelectFun, setAdcd, showCheckbox
setTreeData(adcdTreedata);
setLoading(false);
setOrderMax(Math.max(...adcdTreedata.map((item:any) => item?.orderIndex)))
}else {
setLoading(false);
setTreeData([])
}
};
// @ts-ignore

View File

@ -17,7 +17,7 @@ export default function Sksq() {
const getData = async (params) => {
const data = await reservoirlist(params)
setTableData(data);
setTableData(data.filter(o=>o.stnm==='檀树岗' || o.stnm==='檀树岗(新)'));
}
useEffect(() => {
let option = {

View File

@ -8,30 +8,46 @@ import FileUpload from '../../../components/Form/FileUpload'
// import "./index.less"
import moment from 'moment';
import TextArea from 'antd/lib/input/TextArea';
const opntios=[
{value:0,label:'党支部工作制度'},
{value:1,label:'行政工作制度'},
{value:2,label:'部门工作制度'},
{value:3,label:'安全管理制度'},
{value:4,label:'工程管理制度'},
{value:5,label:'技术规程'},
{value:6,label:'岗位责任制'}
const opntios = [
{value:1,label:'防洪调度'},
{value:2,label:'兴利调度'},
{value:3,label:'生态调度'},
{value:4,label:'应急调度'},
{value:5,label:'其他'},
]
const opntios1 = [
{value:0,label:'已废弃'},
{value:1,label:'生效中'},
]
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false)
const [filesParams, setFilesParams] = useState([])
const [fileUploading, setFileUploading] = useState(false) // 新增文件上传状态
const onfinish = (values) => {
debugger
const userId = localStorage.getItem("userId");
const userName = localStorage.getItem("userName");
values.tm = moment(values.bzsj).format("YYYY-MM-DD")
if (mode === 'edit') {
// onEdit(apiurl.zdgl.edit, {...record,...values})
onEdit(apiurl.zsk.ddfa.edit, {...record,...values,createUser:userName,fileIds: filesParams, files:undefined})
}
if (mode === 'save') {
// onSave(apiurl.zdgl.add, values)
onSave(apiurl.zsk.ddfa.save, {...values,createUser:userName,fileIds: filesParams, files:undefined})
}
}
useEffect(() => {
if (mode != 'save') {
const tm = record?.tm ? moment(record?.tm) : '';
form.setFieldValue('bzsj', tm)
if (record?.files.length > 0) {
setFilesParams(record?.files)
}
}
}, [mode])
@ -43,30 +59,30 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
onFinish={onfinish}
initialValues={record}
>
<Form.Item name="id"><Input type="hidden" /></Form.Item>
<Row>
<Col span={12}>
<Form.Item
label="方案名称"
name="famc"
name="name"
rules={[{ required: true }]}
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear />
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear placeholder='请输入'/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="调度类型"
name="ddlx"
name="type"
rules={[{ required: true }]}
>
<Select allowClear style={{ width: '100%' }} options={opntios} />
<Select allowClear disabled={mode === 'view'} style={{ width: '100%' }} options={opntios} placeholder='请选择' />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="编制时间"
name="bzsj"
rules={[{ required: true }]}
getValueFromEvent={(e, dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
>
@ -76,9 +92,20 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
<Col span={12}>
<Form.Item
label="状态"
name="zt"
name="status"
rules={[{ required: true }]}
>
<Select allowClear style={{ width: '100%' }} options={opntios} />
<Select allowClear disabled={mode === 'view'} style={{ width: '100%' }} options={opntios1} placeholder='请选择' />
</Form.Item>
</Col>
<Col span={24}>
<Form.Item
label="简介"
name="content"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<Input.TextArea allowClear disabled={mode === 'view'} style={{ width: '100%',height:'15vh' }} placeholder='请输入'/>
</Form.Item>
</Col>
</Row>
@ -90,9 +117,12 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<FileUpload
<FileUpload
uploadUrl={apiurl.zsk.ddfa.upload}
mode={mode}
fileNum={3}
fileNum={999}
onChange={(v) => { setFilesParams(v); }}
onLoadingChange={(isLoading) => setFileUploading(isLoading)}
/>
</Form.Item>
</Col>
@ -101,8 +131,13 @@ const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
mode === 'view' ? null : (
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit" loading={loading}>
{mode === 'save' ? '提交' : '修改'}
<Button
type="primary"
htmlType="submit"
loading={loading}
disabled={fileUploading} // 文件上传中时禁用按钮
>
{fileUploading ? '文件上传中...' : (mode === 'save' ? '提交' : '修改')}
</Button>
</Form.Item>
</>

View File

@ -13,7 +13,8 @@ import { httpgetExport } from '../../../utils/request';
import { exportFile } from '../../../utils/tools';
import dayjs from 'dayjs';
const obj={0:"党支部工作制度",1:"行政工作制度",2:"部门工作制度",3:"安全管理制度",4:"工程管理制度",5:"技术规程",6:"岗位责任制"}
const obj = { 1: "防洪调度", 2: "兴利调度", 3: "生态调度", 4: "应急调度", 5: "其他" }
const sobj = {0:'已废弃',1:'生效中'}
const Page = () => {
const refModal = useRef();
@ -22,12 +23,12 @@ const Page = () => {
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '方案名称', key: 'name', dataIndex: 'name', ellipsis: true },
{ title: '调度类型', key: 'type', dataIndex: 'type',render:(v)=><>{obj[v]}</>},
{ title: '简介', key: 'releaseDate', dataIndex: 'releaseDate', render: (value) => <span>{value ? dayjs(value).format('YYYY-MM-DD') : ''}</span>},
{ title: '编制时间', key: 'fillUnit', dataIndex: 'fillUnit'},
{ title: '附件数', key: 'minUpTime', dataIndex: 'minUpTime'},
{ title: '状态', key: 'minUpTime', dataIndex: 'minUpTime'},
{ title: '创建人', key: 'minUpTime', dataIndex: 'minUpTime'},
{ title: '最后更新时间', key: 'minUpTime', dataIndex: 'minUpTime'},
{ title: '简介', key: 'content', dataIndex: 'content'},
{ title: '编制时间', key: 'tm', dataIndex: 'tm'},
{ title: '附件数', key: 'fileCount', dataIndex: 'fileCount'},
{ title: '状态', key: 'status', dataIndex: 'status',render:(v)=><>{sobj[v]}</>},
{ title: '创建人', key: 'createUser', dataIndex: 'createUser'},
{ title: '最后更新时间', key: 'updateTm', dataIndex: 'updateTm'},
{
title: '操作', key: 'operation', fixed: 'right', align: 'center',
render: (value, row, index) => (
@ -49,12 +50,12 @@ const Page = () => {
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onDeleteGet(apiurl.zdgl.del + `/${params.id}`);
refModal.current.onDeleteGet(apiurl.zsk.ddfa.del + `/${params.id}`);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.zdgl.list).find_noCode);
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.zsk.ddfa.page).find_noCode);
useEffect(() => {

View File

@ -9,20 +9,23 @@ const ToolBar = ({ setSearchVal, onSave }) => {
const onFinish = (values) => {
const {releaseDate,...ret} = values
if(releaseDate){
ret.stm = moment(values.releaseDate[0]).format('YYYY-MM-DD HH:mm:ss')
ret.etm = moment(values.releaseDate[1]).format('YYYY-MM-DD HH:mm:ss')
ret.stm = moment(values.releaseDate[0]).format('YYYY-MM-DD')
ret.etm = moment(values.releaseDate[1]).format('YYYY-MM-DD')
}
setSearchVal(ret);
}
const opntios = [
{value:0,label:'党支部工作制度'},
{value:1,label:'行政工作制度'},
{value:2,label:'部门工作制度'},
{value:3,label:'安全管理制度'},
{value:4,label:'工程管理制度'},
{value:5,label:'技术规程'},
{value:6,label:'岗位责任制'}
{value:1,label:'防洪调度'},
{value:2,label:'兴利调度'},
{value:3,label:'生态调度'},
{value:4,label:'应急调度'},
{value:5,label:'其他'},
]
const opntios1 = [
{value:0,label:'已废弃'},
{value:1,label:'生效中'},
]
return (
@ -38,8 +41,8 @@ const ToolBar = ({ setSearchVal, onSave }) => {
<Form.Item label="编制时间" name="releaseDate">
<RangePicker allowClear />
</Form.Item>
<Form.Item label="状态" name="fillUnit">
<Input allowClear style={{ width: '150px' }} />
<Form.Item label="状态" name="status">
<Select allowClear style={{ width: '150px' }} options={opntios1} />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>

View File

@ -0,0 +1,47 @@
li.ant-tree-treenode-disabled > span:not(.ant-tree-switcher),
li.ant-tree-treenode-disabled > .ant-tree-node-content-wrapper,
li.ant-tree-treenode-disabled > .ant-tree-node-content-wrapper span{
color: #000 !important;
font-weight: bold;
}
.treeBox1{
.ant-tree-node-content-wrapper{
position: static !important;
}
.hover-ele{
&:hover{
color:#259dff
}
}
}
.AdcdTreeSelectorStyle{
.ant-input-wrapper{
.ant-input-affix-wrapper{
width: 98%;
}
.ant-input-group-addon{
.ant-btn{
width: 34px;
height: 34px;
}
}
}
.treeTitle {
display: flex;
justify-content: space-between;
.treeBtn {
display: none;
}
}
.treeTitle:hover {
.treeBtn {
display: flex;
}
}
}
.no-matter{
opacity: 0.5;
}

View File

@ -0,0 +1,314 @@
import React, { useState, useEffect } from 'react';
import { Tree, Input, Checkbox, Spin,Modal,Form,Col,Row,message,Space } from 'antd';
import { EditOutlined,PlusCircleOutlined, DeleteOutlined,ExclamationCircleOutlined} from '@ant-design/icons';
import './index.less';
import { formItemLayout, btnItemLayout } from '../../../../components/crud/FormLayoutProps';
import { getGcaqTreeData } from '../../../../service/warn';
import apiurl from '../../../../service/apiurl';
import { httppost3,httpget6, httpget } from '../../../../utils/request';
const { Search } = Input;
type IProps = {
onSelectFun?: any;
setAdcd?: any;
showCheckbox: any;
tableName?: any;
onChangeOpen?: any;
hasAlertBox?: boolean;//顶部是否有预警条
isFetch?: boolean;
}
const { confirm } = Modal;
const AdcdTreeSelector: React.FC<IProps> = ({ onSelectFun, setAdcd, showCheckbox, tableName, hasAlertBox }) => {
const [loading, setLoading] = useState(true);
const [treeData, setTreeData] = useState([]);
const [newTreeData, setNewTreeData] = useState([]);
const [isFiter, setIsFiter] = useState(false);
const [expandedKeys, setExpandedKeys] = useState([]);
const [checkedKeys, setCheckedKeys] = useState([]);
const [selectedKeys, setSelectedKeys] = useState<any>([]);
const [selectedItem, setSelectedItem] = useState({});
const [autoExpandParent, setAutoExpandParent] = useState(true);
const [treeBoxHeight, setTreeBoxHeight] = useState({});
const [jdOpen, setJdOpen] = useState(false)
const [form] = Form.useForm();
const [mode, setMode] = useState('')
const [itemDetail, setItemDetail] = useState<any>({})
const [orderMax, setOrderMax] = useState<any>(0)
useEffect(() => {
getCustomerTreeData();
}, []);
useEffect(() => {
if(tableName){
setSelectedKeys([]);
}
}, [tableName]);
useEffect(()=>{
//根据预警条计/多选框计算高度
if(hasAlertBox){
if(showCheckbox){
setTreeBoxHeight({height:"calc( 100vh - 240px )"})
}else{
setTreeBoxHeight({height:"calc( 100vh - 210px )"})
}
}else{
if(showCheckbox){
setTreeBoxHeight({height:"calc( 100vh - 224px )"})
}else{
setTreeBoxHeight({height:"calc( 100vh - 194px )"})
}
}
},[hasAlertBox])
const getCustomerTreeData = async () => {
const adcdTreedata: any = await getGcaqTreeData();
const item:any = adcdTreedata
if (item) {
setSelectedKeys([item[0]?.id])
setAdcd(item[0]?.name)
}
if (adcdTreedata.length > 0) {
handelTreeData(adcdTreedata);
setTreeData(adcdTreedata);
setLoading(false);
setOrderMax(Math.max(...adcdTreedata.map((item:any) => item?.orderIndex)))
} else {
setLoading(false);
setTreeData([])
}
};
// @ts-ignore
const handelTreeData = (data) => {
if (data.length > 0) {
// @ts-ignore
data.forEach(item => {
item.title = item.name;
item.key = item.id;
if (item.children && item.children.length > 0) {
handelTreeData(item.children);
}
});
}
}
const onExpand = (expandedKeysValue:any) => {
setExpandedKeys(expandedKeysValue);
setAutoExpandParent(false);
};
const onSelect = (selectedKeysValue:any, info:any) => {
setSelectedKeys(selectedKeysValue);
setSelectedItem(info);
if (info.selectedNodes.length > 0) {
let selectData = info.selectedNodes[0];
let adcdVal = "";
adcdVal = selectData.title;
let params = { id: adcdVal };
if(onSelectFun){
onSelectFun(params);
}
if(setAdcd){
setAdcd(adcdVal)
}
} else {
let params = { id: "" };
if(onSelectFun){
onSelectFun(params);
}
if(setAdcd){
setAdcd("")
}
}
};
// 删除
const deleteJd = (v: any) => {
confirm({
title: '删除',
icon: <ExclamationCircleOutlined />,
content: '确认删除此数据',
okText: '确定',
okType: 'primary',
cancelText: '取消',
onOk: async() => {
try {
const res = await httpget6(apiurl.zsk.gcaq.deleteTree + `/${v.id}`)
if (res.code === 200) {
message.success('删除成功');
getCustomerTreeData();
}
if (res.code === 400) {
message.error(res.description);
}
} catch (error) {
console.log(error);
}
},
onCancel() {
console.log('Cancel');
},
});
}
// 新增节点
const saveJd = (v: any) => {
if (v) {
// form.setFieldValue('name', v.title);
setItemDetail(v);
}
setJdOpen(true);
setMode("save");
}
// 编辑节点
const editJd = (v: any) => {
setJdOpen(true);
form.setFieldsValue(v);
setMode("edit");
setItemDetail(v);
}
const onOk = async () => {
const name = form.getFieldValue('name').replace(/\s/g,"");
if(!name) return
const url = mode == "save" ? apiurl.zsk.gcaq.saveTree : apiurl.zsk.gcaq.editTree;
let saveParams = {
name,
// parentId: itemDetail?.id || undefined,
// orderIndex:itemDetail?.orderIndex || orderMax
}
let editParams = {
...itemDetail,
name
}
try {
const res = mode != 'save' ? await httppost3(url,editParams):await httpget(url, saveParams)
if (res.code == 200) {
message.success(mode == "save" ? '新增成功' : '编辑成功');
setJdOpen(false);
getCustomerTreeData();
form.resetFields();
} else if (res.code == 400) {
message.error(res.description);
}
} catch (error) {
console.log(error);
}
}
return (
<div className='AdcdTreeSelectorStyle'>
<div
style={{
padding: '10px',
color: "#409eff",
borderBottom: "1px solid #dfdfdf",
marginBottom: 20,
cursor: "pointer"
}}
onClick={saveJd}
></div>
{
loading?
<div style={{position:"absolute",top:"200px",left:"35%",background:"#fff",padding:"20px 30px",borderRadius:"10px"}}>
<Spin tip="正在加载..." size="large" spinning={loading} />
</div>:null
}
<div className="treeBox1" style={{...treeBoxHeight,marginTop:"10px"}}>
<div style={{ width: "300px"}}>
{
treeData.length > 0 &&
<Tree
defaultExpandAll={true}
blockNode={false}
onExpand={onExpand}
checkedKeys={checkedKeys}
onSelect={onSelect}
selectedKeys={selectedKeys}
treeData={isFiter ? newTreeData : treeData}
showLine={true}
titleRender={(v: any) => {
return (
<div
style={{width:200}}
className='treeTitle'
>
<span>{v.title}</span>
<Space
size={4}
className='treeBtn'
>
{/* <PlusCircleOutlined
style={{ fontSize: 15 }}
title='新增'
onClick={(e) => {
e.stopPropagation();
saveJd(v);
}}
className='hover-ele'
/> */}
<EditOutlined
title='编辑'
style={{ fontSize: 15 }}
onClick={(e) => {
e.stopPropagation();
editJd(v);
}}
className='hover-ele'
/>
<DeleteOutlined
title='删除'
style={{ fontSize: 15 }}
onClick={(e) => {
e.stopPropagation();
deleteJd(v);
}}
className='hover-ele'
/>
</Space>
</div>
)
}}
/>
}
</div>
</div>
<Modal
open={jdOpen}
title={mode == "save" ? "新增" : '编辑'}
destroyOnClose
onCancel={() => { setJdOpen(false); form.resetFields()}}
onOk={onOk}
>
<Form form={form} {...formItemLayout}>
<Row>
<Col span={24}>
<Form.Item
label="知识库类型"
name="name"
rules={[{required: true}]}
>
<Input allowClear/>
</Form.Item>
</Col>
</Row>
</Form>
</Modal>
</div>
);
};
export default AdcdTreeSelector;

133
src/views/sz/khzbgl/form.js Normal file
View File

@ -0,0 +1,133 @@
import React, { useEffect, useState, useMemo, useRef } from 'react';
import { Form, Button, Input, Row, Upload, Col, Table, DatePicker, InputNumber, message, Image, Modal, Typography, Select } from 'antd';
import { DeleteOutlined, FileWordOutlined, FilePdfOutlined, FileZipOutlined, FileExcelOutlined } from '@ant-design/icons';
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
import apiurl from '../../../service/apiurl';
import NormalSelect from '../../../components/Form/NormalSelect';
import FileUpload from '../../../components/Form/FileUpload'
// import "./index.less"
import moment from 'moment';
import TextArea from 'antd/lib/input/TextArea';
const opntios = [
{value:1,label:'水资源调度'},
{value:2,label:'防洪调度'},
{value:3,label:'工程安全'},
{value:4,label:'应急抢险'},
{value:5,label:'其他'},
]
const opntios1 = [
{value:0,label:'已废弃'},
{value:1,label:'生效中'},
]
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false)
const [filesParams, setFilesParams] = useState([])
const [fileUploading, setFileUploading] = useState(false) // 新增文件上传状态
const onfinish = (values) => {
const userId = localStorage.getItem("userId");
const userName = localStorage.getItem("userName");
values.tm = moment(values.bzsj).format("YYYY-MM-DD")
if (mode === 'edit') {
onEdit(apiurl.zsk.gcaq.edit, { ...record, ...values, createUser: userName, fileIds: filesParams, files:undefined})
}
if (mode === 'save') {
onSave(apiurl.zsk.gcaq.save, {...values,createUser:userName,fileIds:filesParams,files:undefined,type:record?.code})
}
}
useEffect(() => {
if (mode != 'save') {
const tm = record?.tm ? moment(record?.tm) : '';
form.setFieldValue('bzsj', tm)
if (record?.files.length > 0) {
setFilesParams(record?.files)
}
}
}, [mode,record])
return (
<>
<Form
form={form}
{...formItemLayout}
onFinish={onfinish}
initialValues={record}
>
<Row>
<Col span={12}>
<Form.Item
label="标题"
name="name"
rules={[{ required: true }]}
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear placeholder='请输入'/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="编制时间"
name="bzsj"
rules={[{ required: true }]}
getValueFromEvent={(e, dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
>
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
<Col span={24}>
<Form.Item
label="简介"
name="content"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<Input.TextArea allowClear disabled={mode === 'view'} style={{ width: '100%',height:'15vh' }} placeholder='请输入'/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="附件"
name="files"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<FileUpload
mode={mode}
fileNum={999}
uploadUrl={apiurl.zsk.gcaq.upload}
onChange={(v) => { setFilesParams(v)}}
value={filesParams}
onLoadingChange={(isLoading) => setFileUploading(isLoading)}
/>
</Form.Item>
</Col>
</Row>
{
mode === 'view' ? null : (
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit" loading={loading} disabled={fileUploading}>
{fileUploading ? '文件上传中...' : (mode === 'save' ? '提交' : '修改')}
</Button>
</Form.Item>
</>
)
}
</Form>
</>
);
}
export default ModalForm;

View File

@ -0,0 +1,120 @@
import React, { Fragment, useRef, useMemo, useEffect, useState } from 'react';
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
import { Table, Card, Modal, Form, Input, Button, Row, Col, Timeline, message, Tabs, Image, Switch } from 'antd';
import { FileWordOutlined, FilePdfOutlined, FileZipOutlined, FileExcelOutlined } from '@ant-design/icons';
import { useSelector } from 'react-redux';
import AdcdTreeSelector from "./AdcdTreeSelector";
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable2';
import { createCrudService } from '../../../components/crud/_';
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
const url = "http://223.75.53.141:9100/gs-tsg"
const Page = () => {
const role = useSelector(state => state.auth.role);
const editBtn = role?.rule?.find(item => item.menuName == "编辑") || true;
const delBtn = role?.rule?.find(item => item.menuName == "删除") || true;
const refModal = useRef();
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '标题', key: 'name', dataIndex: 'name', width: 200 },
{ title: '简介', key: 'content', dataIndex: 'content' },
{ title: '编制时间', key: 'tm', dataIndex: 'tm' },
{ title: '附件数', key: 'fileCount', dataIndex: 'fileCount' },
{ title: '创建人', key: 'createUser', dataIndex: 'createUser' },
{ title: '最后更新时间', key: 'updateTm', dataIndex: 'updateTm' },
{
title: '操作', key: 'operation', width: 200, fixed: 'right', align: 'center',
render: (value, row, index) => (
<CrudOpRender_text
edit={(editBtn && !row?.isUsed) ? true : false}
del={(delBtn && !row?.isUsed) ? true : false}
view={true}
command={(cmd) => () => command(cmd)(row)} />)
},
];
const [code, setCode] = useState()
const [searchVal, setSearchVal] = useState(false)
const width = useMemo(() => columns.reduce((total, cur) => total + (cur.width), 0), [columns]);
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave({ code });
} else if (type === 'edit') {
refModal.current.showEdit({ ...params, code });
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onDeleteGet(apiurl.zsk.gcaq.del + `/${params.id}`);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.zsk.gcaq.page).find_noCode);
const onEdit = (path, values) => {
createCrudService(path).edit(values).then((result) => {
if (result?.code === 200) {
refresh()
}
})
}
useEffect(() => {
if (code) {
let params = {
search: {
type: code,
...searchVal,
}
};
search(params)
}
}, [code, searchVal]);
return (
<>
<div className='content-box' style={{ backgroundColor: '#fff', height: '100%', display: 'flex', padding: '10px' }}>
<div className='lf adcdTreeSelectorBox' style={{ height: 'calc(100vh - 168px)', width: '340px' }}>
<AdcdTreeSelector hasAlertBox={false} setAdcd={setCode} />
</div>
<div className='AdcdTreeTableBox' style={{ flex: 1, overflowX: "auto" }}>
<Card className='nonebox'>
<ToolBar
onSave={command('save')}
setSearchVal={setSearchVal}
role={role}
/>
</Card>
<Table
columns={columns}
rowKey="id"
{...tableProps}
scroll={{ x: width, y: "calc( 100vh - 400px )" }}
/>
</div>
<BasicCrudModal
width={1000}
ref={refModal}
title=""
component={ModalForm}
onCrudSuccess={refresh}
/>
</div>
</>
);
}
export default Page;

View File

@ -0,0 +1,54 @@
import React, { useEffect, useState } from 'react';
import { Form, Input, Button, DatePicker } from 'antd';
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave, storeData, role }) => {
console.log("role", role);
const addBtn = role?.rule?.find(item => item.menuName == "新增");
const [form] = Form.useForm();
const onFinish = (values) => {
debugger
const { releaseDate, ...ret } = values
if (releaseDate) {
ret.stm = moment(values.releaseDate[0]).format('YYYY-MM-DD')
ret.etm = moment(values.releaseDate[1]).format('YYYY-MM-DD')
}
setSearchVal(ret);
}
return (
<>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="标题" name="name">
<Input allowClear style={{ width: '150px' }} />
</Form.Item>
<Form.Item label="编制时间" name="releaseDate">
<RangePicker allowClear />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>
{
(onSave) ?
<Form.Item>
<Button onClick={onSave} >新增</Button>
</Form.Item>
: null
}
</Form>
</div>
</>
);
}
export default ToolBar;

149
src/views/sz/ywgz/form.js Normal file
View File

@ -0,0 +1,149 @@
import React, { useEffect, useState, useMemo, useRef } from 'react';
import { Form, Button, Input, Row, Upload, Col, Table, DatePicker, InputNumber, message, Image, Modal, Typography, Select } from 'antd';
import { DeleteOutlined, FileWordOutlined, FilePdfOutlined, FileZipOutlined, FileExcelOutlined } from '@ant-design/icons';
import { formItemLayout, btnItemLayout } from '../../../components/crud/FormLayoutProps';
import apiurl from '../../../service/apiurl';
import NormalSelect from '../../../components/Form/NormalSelect';
import FileUpload from '../../../components/Form/FileUpload'
// import "./index.less"
import moment from 'moment';
import TextArea from 'antd/lib/input/TextArea';
const opntios = [
{value:1,label:'水资源调度'},
{value:2,label:'防洪调度'},
{value:3,label:'工程安全'},
{value:4,label:'应急抢险'},
{value:5,label:'其他'},
]
const opntios1 = [
{value:0,label:'已废弃'},
{value:1,label:'生效中'},
]
const ModalForm = ({ mode, record, onEdit, onSave, onSimilarSave }) => {
const [form] = Form.useForm();
const [loading, setLoading] = useState(false)
const [filesParams, setFilesParams] = useState([])
const [fileUploading, setFileUploading] = useState(false) // 新增文件上传状态
const onfinish = (values) => {
const userId = localStorage.getItem("userId");
const userName = localStorage.getItem("userName");
values.tm = moment(values.bzsj).format("YYYY-MM-DD")
if (mode === 'edit') {
onEdit(apiurl.zsk.ywgz.edit, { ...record, ...values, createUser: userName, fileIds: filesParams, files:undefined})
}
if (mode === 'save') {
onSave(apiurl.zsk.ywgz.save, {...values,createUser:userName,fileIds:filesParams,files:undefined})
}
}
useEffect(() => {
if (mode != 'save') {
const tm = record?.tm ? moment(record?.tm) : '';
form.setFieldValue('bzsj', tm)
if (record?.files.length > 0) {
setFilesParams(record?.files)
}
}
}, [mode,record])
return (
<>
<Form
form={form}
{...formItemLayout}
onFinish={onfinish}
initialValues={record}
>
<Row>
<Col span={12}>
<Form.Item
label="规则名称"
name="name"
rules={[{ required: true }]}
>
<Input disabled={mode === 'view'} style={{ width: '100%' }} allowClear placeholder='请输入'/>
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="规则类型"
name="type"
rules={[{ required: true }]}
>
<Select allowClear disabled={mode === 'view'} style={{ width: '100%' }} options={opntios} placeholder='请选择' />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="编制时间"
name="bzsj"
rules={[{ required: true }]}
getValueFromEvent={(e, dateString) => dateString}
getValueProps={(value) => ({ value: value ? moment(value) : undefined })}
>
<DatePicker disabled={mode === 'view'} format={'YYYY-MM-DD'} style={{ width: '100%' }} allowClear />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
label="状态"
name="status"
rules={[{ required: true }]}
>
<Select allowClear disabled={mode === 'view'} style={{ width: '100%' }} options={opntios1} placeholder='请选择' />
</Form.Item>
</Col>
<Col span={24}>
<Form.Item
label="简介"
name="content"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<Input.TextArea allowClear disabled={mode === 'view'} style={{ width: '100%',height:'15vh' }} placeholder='请输入'/>
</Form.Item>
</Col>
</Row>
<Row>
<Col span={24}>
<Form.Item
label="附件"
name="files"
labelCol={{ span: 3 }}
wrapperCol={{ span: 19 }}
>
<FileUpload
mode={mode}
fileNum={999}
uploadUrl={apiurl.zsk.ywgz.upload}
onChange={(v) => { setFilesParams(v);console.log("vvvv",v);
}}
value={filesParams}
onLoadingChange={(isLoading) => setFileUploading(isLoading)}
/>
</Form.Item>
</Col>
</Row>
{
mode === 'view' ? null : (
<>
<Form.Item {...btnItemLayout}>
<Button type="primary" htmlType="submit" loading={loading} disabled={fileUploading}>
{fileUploading ? '文件上传中...' : (mode === 'save' ? '提交' : '修改')}
</Button>
</Form.Item>
</>
)
}
</Form>
</>
);
}
export default ModalForm;

View File

@ -0,0 +1,98 @@
import React, { Fragment, useRef, useMemo, useEffect, useState } from 'react';
import BasicCrudModal from '../../../components/crud/BasicCrudModal';
import { Table, Card, Modal, Form, Input, Button, Row, Col, Timeline, message, Tabs, Image } from 'antd';
import { FileWordOutlined, FilePdfOutlined, FileZipOutlined, PaperClipOutlined } from '@ant-design/icons';
import { useSelector } from 'react-redux';
import ToolBar from './toolbar';
import ModalForm from './form';
import apiurl from '../../../service/apiurl';
import usePageTable from '../../../components/crud/usePageTable2';
import { createCrudService } from '../../../components/crud/_';
import { CrudOpRender_text } from '../../../components/crud/CrudOpRender';
import { httpgetExport } from '../../../utils/request';
import { exportFile } from '../../../utils/tools';
import dayjs from 'dayjs';
const obj = { 1: "水资源调度", 2: "防洪调度", 3: "工程安全", 4: "应急抢险", 5: "其他" }
const sobj = {0:'已废弃',1:'生效中'}
const Page = () => {
const refModal = useRef();
const [searchVal, setSearchVal] = useState(false)
const columns = [
{ title: '序号', key: 'inx', dataIndex: 'inx', width: 60, align: "center" },
{ title: '规则名称', key: 'name', dataIndex: 'name', ellipsis: true },
{ title: '规则类型', key: 'type', dataIndex: 'type',render:(v)=><>{obj[v]}</>},
{ title: '简介', key: 'content', dataIndex: 'content'},
{ title: '编制时间', key: 'tm', dataIndex: 'tm'},
{ title: '附件数', key: 'fileCount', dataIndex: 'fileCount'},
{ title: '状态', key: 'status', dataIndex: 'status',render:(v)=><>{sobj[v]}</>},
{ title: '创建人', key: 'createUser', dataIndex: 'createUser'},
{ title: '最后更新时间', key: 'updateTm', dataIndex: 'updateTm'},
{
title: '操作', key: 'operation', fixed: 'right', align: 'center',
render: (value, row, index) => (
<CrudOpRender_text
edit={true}
del={true}
view={true}
command={(cmd) => () => command(cmd)(row)}
/>
)
},
];
const command = (type) => (params) => {
if (type === 'save') {
refModal.current.showSave();
} else if (type === 'edit') {
refModal.current.showEdit({ ...params });
} else if (type === 'view') {
refModal.current.showView(params);
} else if (type === 'del') {
refModal.current.onDeleteGet(apiurl.zsk.ywgz.del + `/${params.id}`);
}
}
const { tableProps, search, refresh } = usePageTable(createCrudService(apiurl.zsk.ywgz.page).find_noCode);
useEffect(() => {
const params = {
search: {
...searchVal,
}
};
search(params)
}, [searchVal])
return (
<>
<div className='content-root clearFloat xybm' style={{ paddingRight: "0", paddingBottom: "0" }}>
<div className='lf CrudAdcdTreeTableBox' style={{ width: "100%", overflowY: "auto" }}>
<Card className='nonebox'>
<ToolBar
setSearchVal={setSearchVal}
onSave={command('save')}
/>
</Card>
<div className="ant-card-body" style={{ padding: "20px 0 0 0" }}>
<Table columns={columns} rowKey="inx" {...tableProps} />
</div>
</div>
<BasicCrudModal
width={1000}
ref={refModal}
title=""
component={ModalForm}
onCrudSuccess={refresh}
/>
</div>
</>
);
}
export default Page;

View File

@ -0,0 +1,69 @@
import React, { useEffect, useState } from 'react';
import { Form, Input, Button, DatePicker, Select } from 'antd';
import { DownOutlined, UpOutlined } from '@ant-design/icons'
import moment from 'moment';
const { RangePicker } = DatePicker;
const ToolBar = ({ setSearchVal, onSave }) => {
const [form] = Form.useForm();
const onFinish = (values) => {
const {releaseDate,...ret} = values
if(releaseDate){
ret.stm = moment(values.releaseDate[0]).format('YYYY-MM-DD')
ret.etm = moment(values.releaseDate[1]).format('YYYY-MM-DD')
}
setSearchVal(ret);
}
const opntios = [
{value:1,label:'水资源调度'},
{value:2,label:'防洪调度'},
{value:3,label:'工程安全'},
{value:4,label:'应急抢险'},
{value:5,label:'其他'},
]
const opntios1 = [
{value:0,label:'已废弃'},
{value:1,label:'生效中'},
]
return (
<>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<Form form={form} className='toolbarBox' layout="inline" onFinish={onFinish}>
<Form.Item label="规则名称" name="name">
<Input allowClear style={{ width: '150px' }} />
</Form.Item>
<Form.Item label="规则类型" name="type">
<Select allowClear style={{ width: '150px' }} options={opntios} />
</Form.Item>
<Form.Item label="编制时间" name="releaseDate">
<RangePicker allowClear />
</Form.Item>
<Form.Item label="状态" name="status">
<Select allowClear style={{ width: '150px' }} options={opntios1} />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">查询</Button>
</Form.Item>
<Form.Item>
<Button onClick={() => form.resetFields()}>重置</Button>
</Form.Item>
{
(onSave) ?
<Form.Item>
<Button onClick={onSave}>新增</Button>
</Form.Item>
: null
}
</Form>
</div>
</>
);
}
export default ToolBar;

View File

@ -33,7 +33,15 @@ const TreeData = (props: any) => {
console.log(props.treeListData);
const [checkNode, setCheckNode] = useState([]);
const [spType, setSpType] = useState(2)
const onSelect = async (selectedKeys: (any | never[]), info: any) => {
if (info.selected) {
if (info.node.type) {
setSpType(info.node.type)
}
} else {
setSpType(2)
}
if(!info.node.isLeaf && !info.node.selected)return
if(selectedKeys.length < props.size){
setCheckNode(selectedKeys)
@ -85,7 +93,7 @@ const TreeData = (props: any) => {
// setCheckNode(selectedKeys)
},[props.videoArr])
// useEffect(()=>{})
return <div style={{height:'100%',overflowY:'scroll'}}>
return <div style={spType ==1 ?{maxHeight:'61vh',overflowY:'auto'}:{height:"100%",overflowY:'auto'}}>
{props.treeListData.length !== 0 &&
<Tree
treeData={props.treeListData}