diff --git a/src/pages/ElecEvaluation/Monitor/Exception/index.tsx b/src/pages/ElecEvaluation/Monitor/Exception/index.tsx index ff7908c..a43fe06 100644 --- a/src/pages/ElecEvaluation/Monitor/Exception/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/Exception/index.tsx @@ -16,7 +16,7 @@ const MonitorException: React.FC<{}> = () => { //超过1小时未开标数量-列表 const [noOpenListData, setNoOpenListData] = useState([]); //开标后超过6小时未开启评审室-列表 - const [noOpenAssessListData, setNoOpenAssessListData] = useState(); + const [noOpenAssessListData, setNoOpenAssessListData] = useState([]); //开标后超过6小时未开启评审室-数量 const [noOpenAssessNumber, setNoOpenAssessNumber] = useState(0); //异常监控-解密异常、mac地址相同及相关项目列表 @@ -31,6 +31,8 @@ const MonitorException: React.FC<{}> = () => { const [modalListData, setModalListData] = useState([]); //ModalList Type const [exceptionType, setExceptionType] = useState(); + //selectKey + const [selectKey, setSelectKey] = useState(-1); //权限校验 const auth = useRef(authCheck()); //超过1小时未开标数量 @@ -148,6 +150,36 @@ const MonitorException: React.FC<{}> = () => { getThreeDayNoEndCount(); } }, []) + useEffect(() => { + let interval: any = null; + let count = 0; + let lengthMap = [noOpenListData.length, noOpenAssessListData.length, isNotEmpty(decryptData?.decryptExceptionList) ? decryptData?.decryptExceptionList.length : 0, threeDayNoEndData.length, isNotEmpty(decryptData?.macSameList) ? decryptData?.macSameList.length : 0, threeDaysUnSendAnnoList.length].sort((a, b) => b - a); + if (lengthMap[0] > 1) {//至少2条才能滚动 + interval = setInterval(() => { + if (count < lengthMap[0]) { + setSelectKey(count); + const v0 = document.getElementsByClassName("scroll-select-bg")[0]; + const v1 = document.getElementsByClassName("scroll-select-bg")[1]; + const v2 = document.getElementsByClassName("scroll-select-bg")[2]; + const v3 = document.getElementsByClassName("scroll-select-bg")[3]; + const v4 = document.getElementsByClassName("scroll-select-bg")[4]; + const v5 = document.getElementsByClassName("scroll-select-bg")[5]; + v0.scrollIntoView(false); + v1.scrollIntoView(false); + v2.scrollIntoView(false); + v3.scrollIntoView(false); + v4.scrollIntoView(false); + v5.scrollIntoView(false); + count++; + } else { + count = 0; + } + }, 5000) + } + return () => { + clearInterval(interval); + } + }, [noOpenListData, noOpenAssessListData, decryptData?.decryptExceptionList, threeDayNoEndData, decryptData?.macSameList, threeDaysUnSendAnnoList]) const columns: any[] = [ { @@ -481,11 +513,11 @@ const MonitorException: React.FC<{}> = () => {
{ setExceptionType(null); setModalListData(noOpenListData); setModalListVisible(true); }}>more} />
- +
{ setExceptionType(null); setModalListData(noOpenAssessListData); setModalListVisible(true); }}>more} />
- +
@@ -493,11 +525,11 @@ const MonitorException: React.FC<{}> = () => {
{ setExceptionType("解密异常"); setModalListData(decryptData?.decryptExceptionList ? decryptData?.decryptExceptionList : []); setModalListVisible(true); }}>more} />
- +
{ setExceptionType("开启评审后3日未结束评标"); setModalListData(threeDayNoEndData); setModalListVisible(true); }}>more} />
- +
@@ -505,11 +537,11 @@ const MonitorException: React.FC<{}> = () => {
{ setExceptionType("MAC地址重复"); setModalListData(decryptData?.macSameList ? decryptData?.macSameList : []); setModalListVisible(true); }}>more} />
- +
{ setExceptionType("评标结束后3日内未发布公示"); setModalListData(threeDaysUnSendAnnoList); setModalListVisible(true); }}>more} />
- +
diff --git a/src/pages/ElecEvaluation/Monitor/Home/index.tsx b/src/pages/ElecEvaluation/Monitor/Home/index.tsx index babd485..33e341c 100644 --- a/src/pages/ElecEvaluation/Monitor/Home/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/Home/index.tsx @@ -458,8 +458,8 @@ export const StageCard = (props: { percentage: string | number, total: string | ) } //滚动列表 -export const ScrollTable = (props: { dataSource: any[], columns: any[], rollTime?: number, rollNum?: number, ynum?: number, rowKey?: string }) => { - const { dataSource, columns, rollTime = 50, rollNum = 5, ynum = 300, rowKey = "id" } = props; +export const ScrollTable = (props: { dataSource: any[], columns: any[], rollTime?: number, rollNum?: number, ynum?: number, rowKey?: string, selectKey?: number }) => { + const { dataSource, columns, rollTime = 10, rollNum = 5, ynum = 300, rowKey = "id", selectKey = -1 } = props; return (
{ + if ((selectKey >= (dataSource?.length - 1)) && (index == (dataSource?.length - 1))) {//超过列表长度后锁定最后一条 + return "scroll-select-bg"; + } + if (index == selectKey) { + return "scroll-select-bg"; //highlight样式需要自己定义 + } + return "scroll-select-default"; + }} dataSource={dataSource} columns={columns} onRow={record => { diff --git a/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx b/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx index 5c489ad..67380e0 100644 --- a/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx @@ -33,6 +33,8 @@ const OpenToday: React.FC<{}> = () => { const [modalListData, setModalListData] = useState([]); //ModalList Type const [exceptionType, setExceptionType] = useState(); + //selectKey + const [selectKey, setSelectKey] = useState(-1); //权限校验 const auth = useRef(authCheck()); //定时器描述 @@ -61,7 +63,7 @@ const OpenToday: React.FC<{}> = () => { width: '20%', onCell, onHeaderCell, - render: (_: any, record: any) => {record.projectName}
{record.sectionName}
, + render: (_: any, record: any) => {record.projectName}
{record.sectionName}
, }, { title: '采购预算', @@ -113,7 +115,7 @@ const OpenToday: React.FC<{}> = () => { width: '20%', onCell, onHeaderCell, - render: (_: any, record: any) => {record.projectName}
{record.sectionName}
, + render: (_: any, record: any) => {record.projectName}
{record.sectionName}
, }, { title: '采购预算', @@ -233,6 +235,28 @@ const OpenToday: React.FC<{}> = () => { clearInterval(interval); } }, []) + useEffect(() => { + let interval: any = null; + let count = 0; + let lengthMap = [isNotEmpty(todayOpeningData?.todayList) ? todayOpeningData?.todayList.length : 0, isNotEmpty(todayOpeningData?.importantList) ? todayOpeningData?.importantList.length : 0].sort((a, b) => b - a); + if (lengthMap[0] > 1) {//至少2条才能滚动 + interval = setInterval(() => { + if (count < lengthMap[0]) { + setSelectKey(count); + const v0 = document.getElementsByClassName("scroll-select-bg")[0]; + const v1 = document.getElementsByClassName("scroll-select-bg")[1]; + v0.scrollIntoView(false); + v1.scrollIntoView(false); + count++; + } else { + count = 0; + } + }, 5000) + } + return () => { + clearInterval(interval); + } + }, [todayOpeningData?.todayList, todayOpeningData?.importantList]) return (
@@ -276,13 +300,13 @@ const OpenToday: React.FC<{}> = () => {
- +
- +
diff --git a/src/pages/ElecEvaluation/Monitor/Supplier/index.tsx b/src/pages/ElecEvaluation/Monitor/Supplier/index.tsx index 68d4ecf..9ce581a 100644 --- a/src/pages/ElecEvaluation/Monitor/Supplier/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/Supplier/index.tsx @@ -71,7 +71,7 @@ const Supplier: React.FC<{}> = () => { const monthOrYear = useRef("yearData"); //指标项 tenderCount-投标次数 selectCount-中选次数 bidCost-中选金额 const metric = useRef("tenderCount"); - const metricMap = { tenderCount: "投标次数", selectCount: "中选次数", bidCost: "中选金额" }; + const metricMap = { tenderCount: "投标次数", selectCount: "中选次数", bidCost: "中选金额(万元)" }; //省份 const province = useRef(""); //图表数据 diff --git a/src/pages/ElecEvaluation/Monitor/TenderAgent/index.tsx b/src/pages/ElecEvaluation/Monitor/TenderAgent/index.tsx index c95ffc3..6c74abb 100644 --- a/src/pages/ElecEvaluation/Monitor/TenderAgent/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/TenderAgent/index.tsx @@ -177,7 +177,7 @@ const TenderAgent: React.FC<{}> = () => { - + diff --git a/src/pages/ElecEvaluation/Monitor/style.less b/src/pages/ElecEvaluation/Monitor/style.less index 2d27364..8f2aaea 100644 --- a/src/pages/ElecEvaluation/Monitor/style.less +++ b/src/pages/ElecEvaluation/Monitor/style.less @@ -724,6 +724,10 @@ .ant-table-body { height: var(--monitor-table-height); } + + .scroll-select-bg { + background: #1b7ef266; + } } .monitor-statistic-table {