From 5e4cd5fe28e946e767f82048d43fffe0b36b82e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Tue, 25 Nov 2025 09:41:10 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/files/edit/FO043.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/files/edit/FO043.js b/src/files/edit/FO043.js index 2109caa..04754b3 100644 --- a/src/files/edit/FO043.js +++ b/src/files/edit/FO043.js @@ -46,16 +46,16 @@ export default { } else if(stateData.FIRE_STATUS == 10) { - setFieldEditable('COMPLETED_CONDITION', true) - setFieldEditable('IS_FIRE', true) - setFieldEditable('ACT_DATE', true) - setFieldEditable('Nav_FireFiles', true) - setFieldEditable('Nav_DispatchUser.NAME', true) - setFieldEditable('COMPLETED_CONTENT', false) - setFieldEditable('IS_LEAVE', false) - setFieldEditable('ACT_END_DATE', false) - setFieldEditable('LEAVE_DATE', false) - setFieldEditable('Nav_MonitorFiles', false) + setFieldVisible('COMPLETED_CONDITION', true) + setFieldVisible('IS_FIRE', true) + setFieldVisible('ACT_DATE', true) + setFieldVisible('Nav_FireFiles', true) + setFieldVisible('Nav_DispatchUser.NAME', true) + setFieldVisible('COMPLETED_CONTENT', false) + setFieldVisible('IS_LEAVE', false) + setFieldVisible('ACT_END_DATE', false) + setFieldVisible('LEAVE_DATE', false) + setFieldVisible('Nav_MonitorFiles', false) } else if(stateData.FIRE_STATUS == 18) { From 988d776d95e4b86eb4955c05d2ba2ea9c7854876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Tue, 25 Nov 2025 12:00:59 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=A2=9E=E6=94=B9=E8=B4=A3=E4=BB=BB?= =?UTF-8?q?=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomPages/SK/SK022ShowPrint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/CustomPages/SK/SK022ShowPrint.js b/src/components/CustomPages/SK/SK022ShowPrint.js index 6444e57..5ad6582 100644 --- a/src/components/CustomPages/SK/SK022ShowPrint.js +++ b/src/components/CustomPages/SK/SK022ShowPrint.js @@ -1,7 +1,7 @@ import { message } from "antd/lib/index"; import { Button, Descriptions, Popconfirm, Row, Col, Form, Input, Select, Modal } from 'antd'; import React from 'react'; -import { initFilter, extendRule, extendInclude, extendIgnoreDataRule, setDataFieldValue, guid, showFiles, GetFileModel } from "../../../utils/common"; +import { initFilter, extendRule, extendInclude, extendIgnoreDataRule, setDataFieldValue, guid, showFiles,showUserSign, GetFileModel } from "../../../utils/common"; import ReactToPrint from "react-to-print"; import config from "../../../config"; import XLSX from 'xlsx'; From b96f742a52e820ee980350c2676ede649893c254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Tue, 25 Nov 2025 13:17:05 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=8A=A8=E7=81=AB=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomPages/FO/FO043ShowPrint.js | 12 ++++++------ src/components/CustomPages/FO/FO045ShowPrint.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/CustomPages/FO/FO043ShowPrint.js b/src/components/CustomPages/FO/FO043ShowPrint.js index 640440c..bebba18 100644 --- a/src/components/CustomPages/FO/FO043ShowPrint.js +++ b/src/components/CustomPages/FO/FO043ShowPrint.js @@ -202,8 +202,8 @@ class FO043ShowPrint extends React.Component { 序号 作业阶段 作业流程及安全措施 - 是否确认 - 附件 + 是否确认 + 附件 { data.Nav_Details && data.Nav_Details.map((item, i) => { @@ -217,11 +217,11 @@ class FO043ShowPrint extends React.Component { {item.CONTENT} - + {item.IS_CONFIRM_NEW ? "是" : "否"} {/* {enums.FOYesOrNoEnum.enums[item.IS_CONFIRM]} */} - + {showFiles(item.Nav_DetailFiles, config.picServerHost, this)} @@ -231,7 +231,7 @@ class FO043ShowPrint extends React.Component { : null } - + {data.COMPLETED_CONDITION} {enums.FOYesOrNoEnum.enums[data.IS_FIRE]} {data.ACT_DATE} @@ -259,7 +259,7 @@ class FO043ShowPrint extends React.Component { } - + { data.COMPLETED_CONTENT } diff --git a/src/components/CustomPages/FO/FO045ShowPrint.js b/src/components/CustomPages/FO/FO045ShowPrint.js index a668a9f..7b71807 100644 --- a/src/components/CustomPages/FO/FO045ShowPrint.js +++ b/src/components/CustomPages/FO/FO045ShowPrint.js @@ -204,8 +204,8 @@ class FO045ShowPrint extends React.Component { 序号 作业阶段 作业流程及安全措施 - 是否确认 - 附件 + 是否确认 + 附件 { data.Nav_Details && data.Nav_Details.map((item, i) => { @@ -219,11 +219,11 @@ class FO045ShowPrint extends React.Component { {item.CONTENT} - + {item.IS_CONFIRM_NEW ? "是" : "否"} {/* {enums.FOYesOrNoEnum.enums[item.IS_CONFIRM]} */} - + {showFiles(item.Nav_DetailFiles, config.picServerHost, this)} @@ -233,7 +233,7 @@ class FO045ShowPrint extends React.Component { : null } - + {data.COMPLETED_CONDITION} {enums.FOYesOrNoEnum.enums[data.IS_FIRE]} {data.ACT_DATE} @@ -259,7 +259,7 @@ class FO045ShowPrint extends React.Component { } - + { data.COMPLETED_CONTENT } From e184b009f9b974803dd177d63597231906786bb8 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Tue, 25 Nov 2025 13:52:08 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/Sider.js | 244 ++++++++++++++++++++++++-------------------- 1 file changed, 135 insertions(+), 109 deletions(-) diff --git a/src/layout/Sider.js b/src/layout/Sider.js index a2ce73d..b1a925e 100644 --- a/src/layout/Sider.js +++ b/src/layout/Sider.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useMemo, useRef } from "react"; +import React, { useState, useEffect, useMemo, useRef } from 'react'; import { AppstoreOutlined, CalendarOutlined, @@ -7,26 +7,20 @@ import { SettingOutlined, MenuUnfoldOutlined, MenuFoldOutlined, -} from "@ant-design/icons"; -import { Divider, Menu, Switch, Icon, Button, Modal } from "antd"; -import { connect } from "dva"; -import { withRouter, matchPath } from "dva/router"; -import { Scrollbars } from "react-custom-scrollbars"; -import EnergyIcon from "../utils/energyIcon"; -import { $consts } from "../plugins"; -import "./sider.less"; -import MenuItem from "antd/lib/menu/MenuItem"; -import SubMenu from "antd/lib/menu/SubMenu"; -import FullScreenPage from "./FullScreen"; -import { - requestFullScreenMethod, -} from "../utils/common"; - - - +} from '@ant-design/icons'; +import { Divider, Menu, Switch, Icon, Button, Modal } from 'antd'; +import { connect } from 'dva'; +import { withRouter, matchPath } from 'dva/router'; +import { Scrollbars } from 'react-custom-scrollbars'; +import EnergyIcon from '../utils/energyIcon'; +import { $consts } from '../plugins'; +import './sider.less'; +import MenuItem from 'antd/lib/menu/MenuItem'; +import SubMenu from 'antd/lib/menu/SubMenu'; +import FullScreenPage from './FullScreen'; +import { requestFullScreenMethod } from '../utils/common'; const Sider = (props) => { - /** 菜单页展开与收起 */ const timer = useRef(-1); const handleExpandMenuShow = () => { @@ -44,11 +38,11 @@ const Sider = (props) => { const [menuShrink, setMenuShrink] = useState({}); const handleMenuShrink = (menuId) => { const data = Object.assign({}, menuShrink); - data[menuId] ? (data[menuId] = "") : (data[menuId] = menuId); + data[menuId] ? (data[menuId] = '') : (data[menuId] = menuId); setMenuShrink(data); }; - const [showModal, setshowModal] = useState(false); - const escFunction = () => { + const [showModal, setshowModal] = useState(false); + const escFunction = () => { let isFull = !!( document.fullscreen || document.mozFullScreen || @@ -61,39 +55,30 @@ const Sider = (props) => { } else { // requestFullScreenMethod(document.body); setshowModal(false); - setActiveMenu(null); + setActiveMenu(null); } }; useEffect(() => { // 监听退出全屏事件 --- chrome 用 esc 退出全屏并不会触发 keyup 事件 - document.addEventListener( - "webkitfullscreenchange", - escFunction - ); /* Chrome, Safari and Opera */ - document.addEventListener("mozfullscreenchange", escFunction); /* Firefox */ - document.addEventListener( - "fullscreenchange", - escFunction - ); /* Standard syntax */ - document.addEventListener( - "msfullscreenchange", - escFunction - ); /* IE / Edge */ + document.addEventListener('webkitfullscreenchange', escFunction); /* Chrome, Safari and Opera */ + document.addEventListener('mozfullscreenchange', escFunction); /* Firefox */ + document.addEventListener('fullscreenchange', escFunction); /* Standard syntax */ + document.addEventListener('msfullscreenchange', escFunction); /* IE / Edge */ return () => { //销毁时清除监听 - document.removeEventListener("webkitfullscreenchange", escFunction); - document.removeEventListener("mozfullscreenchange", escFunction); - document.removeEventListener("fullscreenchange", escFunction); - document.removeEventListener("MSFullscreenChange", escFunction); + document.removeEventListener('webkitfullscreenchange', escFunction); + document.removeEventListener('mozfullscreenchange', escFunction); + document.removeEventListener('fullscreenchange', escFunction); + document.removeEventListener('MSFullscreenChange', escFunction); }; }, []); /** 回到首页 */ const navToHome = () => { setActiveMenu(null); - if (localStorage.getItem("webOrgId") == '00300000-0000-0000-0000-000000000000' ) { - props.history.replace('/grouphome') - }else{ - props.history.replace('/home') + if (localStorage.getItem('webOrgId') == '00300000-0000-0000-0000-000000000000') { + props.history.replace('/grouphome'); + } else { + props.history.replace('/home'); } // props.history.push({ pathname: "/home" }); }; @@ -101,12 +86,72 @@ const Sider = (props) => { setActiveMenu('largeScreen'); setshowModal(true); requestFullScreenMethod(document.body); - } + }; const clickMenu = () => { - collapsed === true ? setCollapsed(false) : setCollapsed(false) + collapsed === true ? setCollapsed(false) : setCollapsed(false); + }; + //ykx新增 + const [openKeys, setOpenKeys] = useState([]); + // 手风琴模式:只展开一个菜单 + const onOpenChange = (keys) => { + if (!keys || keys.length === 0) { + setOpenKeys([]); + return; + } - } + // 包含常用菜单 sub1 和所有一级菜单 key + const rootSubMenuKeys = ['sub1', ...topMenus.menus.map((menu, index) => `${menu.Node.ID}_${index}`)]; + + // 查找最新展开的 key(相对于当前 openKeys) + const latestOpenKey = keys.find((key) => !openKeys.includes(key)); + + const isRoot = (key) => rootSubMenuKeys.includes(key); + + // 根据二级 key 去找到它的一级父 key(通过匹配 topMenus 中的 Children.Node.ID) + const getParentKeyBySecondKey = (secondKey) => { + const secondId = String(secondKey).split('_')[0]; + for (let i = 0; i < topMenus.menus.length; i++) { + const top = topMenus.menus[i]; + if (top.Children && top.Children.some((c) => String(c.Node.ID) === secondId)) { + return `${top.Node.ID}_${i}`; + } + } + return null; + }; + + // 如果最新展开的是一级菜单,直接只保留该一级菜单(手风琴) + if (latestOpenKey && isRoot(latestOpenKey)) { + setOpenKeys([latestOpenKey]); + return; + } + + // 如果最新展开的是二级菜单,保留它的父级和它自己 + if (latestOpenKey) { + const parentKey = getParentKeyBySecondKey(latestOpenKey) || keys.find((k) => isRoot(k)); + if (parentKey) { + setOpenKeys([parentKey, latestOpenKey]); + return; + } + } + + // 兜底:保证每个父级只保留一个二级(取 keys 中最后一个属于该父级的二级) + const parentsInKeys = keys.filter((k) => isRoot(k)); + if (parentsInKeys.length) { + const parent = parentsInKeys[0]; + const secondsForParent = keys.filter((k) => !isRoot(k) && getParentKeyBySecondKey(k) === parent); + if (secondsForParent.length) { + setOpenKeys([parent, secondsForParent[secondsForParent.length - 1]]); + return; + } else { + setOpenKeys([parent]); + return; + } + } + + // 其他情况直接使用传入的 keys + setOpenKeys(keys); + }; /** 子菜单路由 */ const navToMenu = (menu) => { props.history.push({ pathname: `/main/${menu.ID}` }); @@ -135,7 +180,7 @@ const Sider = (props) => { useEffect(() => { const { pathname } = props.location; const mathHome = matchPath(pathname, { - path: $consts["ROUTE/HOME"], + path: $consts['ROUTE/HOME'], exact: true, strict: true, }); @@ -143,7 +188,7 @@ const Sider = (props) => { activeMenu && setActiveMenu(null); } const mathMain = matchPath(pathname, { - path: $consts["ROUTE/MAIN"], + path: $consts['ROUTE/MAIN'], exact: true, strict: true, }); @@ -153,7 +198,7 @@ const Sider = (props) => { const find = flatMenus.find((item) => item.ID === menuId); if (find) { props.dispatch({ - type: "app/updateActivatedMenu", + type: 'app/updateActivatedMenu', payload: { currActivatedTab: find.ID, currActivatedMenu: find, @@ -175,12 +220,9 @@ const Sider = (props) => { const topMenus = useMemo(() => { const menus = props.login.loginInfo?.Menus || []; // 菜单宽度 82 + margin 40 - const menuWidth = menus.length - ? menus.length * 82 + (menus.length - 1) * 40 - : 0; + const menuWidth = menus.length ? menus.length * 82 + (menus.length - 1) * 40 : 0; // 叶子菜单需要换行展示个数 - const leafMenuSections = - menus.length < 3 ? 1 : menus.length === 3 ? 2 : menus.length - 2; + const leafMenuSections = menus.length < 3 ? 1 : menus.length === 3 ? 2 : menus.length - 2; const result = { menus, width: menuWidth < 120 ? 120 : menuWidth, @@ -203,13 +245,7 @@ const Sider = (props) => { if (IS_MENU_SHRINK) { const { menus } = topMenus; const data = {}; - menus.forEach( - (menu) => - menu.Children && - menu.Children.forEach( - (child) => (data[child.Node.ID] = child.Node.ID) - ) - ); + menus.forEach((menu) => menu.Children && menu.Children.forEach((child) => (data[child.Node.ID] = child.Node.ID))); setMenuShrink(data); } }, [IS_MENU_SHRINK]); @@ -221,14 +257,14 @@ const Sider = (props) => { if (collapsed == false) { setCollapsed(true); } - }, [props.repost]) + }, [props.repost]); // console.log(props.repost,'21312313213213123') /** 登录页隐藏 */ if (props.matchLogin) return null; return ( -
+
{ > -
+
@@ -266,16 +304,17 @@ const Sider = (props) => { 首页 - {localStorage.getItem("webOrgId") == '00300000-0000-0000-0000-000000000000'? - - {/* + {/* */} - - 可视化大屏 - :null} + + 可视化大屏 + + ) : null} { 常用菜单 - } onTitleClick={clickMenu} > {favorMenus.map((menu2, index2) => { return ( - handleActiveMenu(menu2)} - title={menu2.NAME} - > - + handleActiveMenu(menu2)} title={menu2.NAME}> + {menu2.NAME} @@ -308,47 +342,38 @@ const Sider = (props) => { key={`${menu.Node.ID}_${index}`} title={ - + {menu.Node.NAME} - } onTitleClick={() => { setCurrMenu(menu.Node); - clickMenu() + clickMenu(); }} - > {/* 二级 */} {menu.Children.map((menu1, index1) => { - const isLevel4Menu = menu1.Children?.find( - (mc) => mc.Children?.length - ); - const childMenus = isLevel4Menu - ? [menu] - : menu.Children || []; + const isLevel4Menu = menu1.Children?.find((mc) => mc.Children?.length); + const childMenus = isLevel4Menu ? [menu] : menu.Children || []; return ( - + {menu1.Node.NAME} - } > {/* 三级 */} {menu1.Children.map((menu3, index3) => { return ( - - isLevel4Menu - ? navToBackend(menu3.Node) - : handleActiveMenu(menu3.Node) - } + (isLevel4Menu ? navToBackend(menu3.Node) : handleActiveMenu(menu3.Node))} title={menu3.Node.NAME} > - + {menu3.Node.NAME} @@ -361,9 +386,9 @@ const Sider = (props) => { ); })} -
-
{ backgroundColor: '#DEE0E8', borderRadius: '6px', margin: '0px 0px 0px 0px', - - }}> - + }} + > +
- -
); }; From 094390886bd0657e693890b33941a245a1c1e929 Mon Sep 17 00:00:00 2001 From: yunkexin <760754045@qq.com> Date: Tue, 25 Nov 2025 14:02:50 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CustomPages/SK/SK006ShowOperateLog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/CustomPages/SK/SK006ShowOperateLog.js b/src/components/CustomPages/SK/SK006ShowOperateLog.js index 40caa60..2a6aa1e 100644 --- a/src/components/CustomPages/SK/SK006ShowOperateLog.js +++ b/src/components/CustomPages/SK/SK006ShowOperateLog.js @@ -207,7 +207,10 @@ class SK006ShowOperateLog extends React.Component { 用户:{item1.USER_NAME} {' '} - 时间:{ShowDateTime(item1.DEAL_DATE, 'MM-dd HH:mm')} + 时间: + {item1.DEAL_DATE == '0001-01-01 00:00:00' || !item1.DEAL_DATE + ? '' + : ShowDateTime(item1.DEAL_DATE, 'MM-dd HH:mm')}
From 20ef35e68ee423495f45a63c7f4c07c30581b7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Wed, 26 Nov 2025 16:49:31 +0800 Subject: [PATCH 6/6] 2 --- src/components/CustomPages/FO/FO043ShowPrint.js | 2 +- src/components/CustomPages/FO/FO045ShowPrint.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/CustomPages/FO/FO043ShowPrint.js b/src/components/CustomPages/FO/FO043ShowPrint.js index bebba18..942f5ee 100644 --- a/src/components/CustomPages/FO/FO043ShowPrint.js +++ b/src/components/CustomPages/FO/FO043ShowPrint.js @@ -259,7 +259,7 @@ class FO043ShowPrint extends React.Component { }
- + = 10?'block':'none'}}> { data.COMPLETED_CONTENT } diff --git a/src/components/CustomPages/FO/FO045ShowPrint.js b/src/components/CustomPages/FO/FO045ShowPrint.js index 7b71807..5a99a84 100644 --- a/src/components/CustomPages/FO/FO045ShowPrint.js +++ b/src/components/CustomPages/FO/FO045ShowPrint.js @@ -259,7 +259,7 @@ class FO045ShowPrint extends React.Component { } - + = 10?'block':'none'}}> { data.COMPLETED_CONTENT }