From 5f99d6a7de9d5ceef940e5f9abb912c3dde31e66 Mon Sep 17 00:00:00 2001 From: jl-zhoujl2 Date: Thu, 5 Jan 2023 17:26:37 +0800 Subject: [PATCH 1/5] =?UTF-8?q?1.5=20=E7=AC=AC=E5=8D=81=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Monitor/Exception/index.tsx | 68 +++- .../ElecEvaluation/Monitor/Home/index.tsx | 332 ++++++++++++------ .../Monitor/OpenToday/index.tsx | 248 +++++++------ .../ElecEvaluation/Monitor/Supplier/index.tsx | 43 ++- .../Monitor/TenderAgent/index.tsx | 43 ++- src/pages/ElecEvaluation/Monitor/service.ts | 45 ++- src/pages/ElecEvaluation/Monitor/style.less | 85 +++-- 7 files changed, 554 insertions(+), 310 deletions(-) diff --git a/src/pages/ElecEvaluation/Monitor/Exception/index.tsx b/src/pages/ElecEvaluation/Monitor/Exception/index.tsx index ae91a83..ff7908c 100644 --- a/src/pages/ElecEvaluation/Monitor/Exception/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/Exception/index.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useRef, useState } from 'react'; import '../style.less' import { authCheck, ModalList, onCell, onHeaderCell, OverviewItem, ScreenLabel, ScreenTitle, ScrollTable } from '../Home'; import Circle3199 from '@/assets/monitor/circle-3199.png'; -import { getDecryptDataAPI, getNoOpenAssessListAPI, getNoOpenListAPI, getNoOpenNumberAPI, getThreeDayNoEndAPI, getThreeDayNoEndCountAPI, getThreeDaysUnSendAnnoCountAPI, getThreeDaysUnSendAnnoListAPI } from '../service'; +import { getDecryptDataAPI, getNoOpenAssessListAPI, getNoOpenAssessNumberAPI, getNoOpenListAPI, getNoOpenNumberAPI, getThreeDayNoEndAPI, getThreeDayNoEndCountAPI, getThreeDaysUnSendAnnoCountAPI, getThreeDaysUnSendAnnoListAPI } from '../service'; import { isNotEmpty } from '@/utils/CommonUtils'; const MonitorException: React.FC<{}> = () => { @@ -17,6 +17,8 @@ const MonitorException: React.FC<{}> = () => { const [noOpenListData, setNoOpenListData] = useState([]); //开标后超过6小时未开启评审室-列表 const [noOpenAssessListData, setNoOpenAssessListData] = useState(); + //开标后超过6小时未开启评审室-数量 + const [noOpenAssessNumber, setNoOpenAssessNumber] = useState(0); //异常监控-解密异常、mac地址相同及相关项目列表 const [decryptData, setDecryptData] = useState(); //评审室关闭3日内未发布公示数 @@ -57,17 +59,52 @@ const MonitorException: React.FC<{}> = () => { } //开标后超过6小时未开启评审室-列表 const getNoOpenAssessList = () => { - getNoOpenAssessListAPI({ pageNo: 1, pageSize: 100 }).then(res => { + getNoOpenAssessListAPI({ "timeLimit": "6", "dayNumber": "30" }).then(res => { if (res?.code == 200) { setNoOpenAssessListData(res?.data); } }) } - //异常监控-解密异常、mac地址相同及相关项目列表 + + //开标后超过6小时未开启评审室-数量 + const getNoOpenAssessNumber = () => { + getNoOpenAssessNumberAPI({ "timeLimit": "6", "dayNumber": "30" }).then(res => { + if (res?.code == 200) { + setNoOpenAssessNumber(res?.data); + } + }) + } + //异常监控-解密异常、mac地址相同及相关项目列表jectRecord? const getDecryptData = () => { getDecryptDataAPI().then(res => { if (res?.code == 200) { - setDecryptData(res?.data); + const data = res?.data; + if (data?.decryptExceptionList?.length > 0) { + for (let i = 0, length = data.decryptExceptionList.length; i < length; i++) { + data.decryptExceptionList[i]["regionDictName"] = data.decryptExceptionList[i].projectRecord?.regionDictName; + data.decryptExceptionList[i]["projectName"] = data.decryptExceptionList[i].projectRecord?.projectName; + data.decryptExceptionList[i]["ownerContactName"] = data.decryptExceptionList[i].projectRecord?.ownerContactName; + data.decryptExceptionList[i]["ownerContactTel"] = data.decryptExceptionList[i].projectRecord?.ownerContactTel; + data.decryptExceptionList[i]["tenderAgencyName"] = data.decryptExceptionList[i].projectRecord?.tenderAgencyName; + data.decryptExceptionList[i]["appManagerTel"] = data.decryptExceptionList[i].projectRecord?.appManagerTel; + data.decryptExceptionList[i]["recruitStartTime"] = data.decryptExceptionList[i].projectRecord?.recruitStartTime; + data.decryptExceptionList[i]["bidMethodDict"] = data.decryptExceptionList[i].projectRecord?.bidMethodDict; + } + + } + if (data?.macSameList?.length > 0) { + for (let i = 0, length = data.macSameList.length; i < length; i++) { + data.macSameList[i]["regionDictName"] = data.macSameList[i].projectRecord?.regionDictName; + data.macSameList[i]["projectName"] = data.macSameList[i].projectRecord?.projectName; + data.macSameList[i]["ownerContactName"] = data.macSameList[i].projectRecord?.ownerContactName; + data.macSameList[i]["ownerContactTel"] = data.macSameList[i].projectRecord?.ownerContactTel; + data.macSameList[i]["tenderAgencyName"] = data.macSameList[i].projectRecord?.tenderAgencyName; + data.macSameList[i]["appManagerTel"] = data.macSameList[i].projectRecord?.appManagerTel; + data.macSameList[i]["recruitStartTime"] = data.macSameList[i].projectRecord?.recruitStartTime; + data.macSameList[i]["bidMethodDict"] = data.macSameList[i].projectRecord?.bidMethodDict; + } + } + setDecryptData(data); } }) } @@ -104,6 +141,7 @@ const MonitorException: React.FC<{}> = () => { getThreeDayNoEnd(); getNoOpenList(); getNoOpenAssessList(); + getNoOpenAssessNumber(); getDecryptData(); getThreeDaysUnSendAnnoCount(); getThreeDaysUnSendAnnoList(); @@ -206,8 +244,8 @@ const MonitorException: React.FC<{}> = () => { }, { title: '预算金额(元)', - dataIndex: 'budgetAmount', - key: 'budgetAmount', + dataIndex: 'bidSectContractPrice', + key: 'bidSectContractPrice', align: 'center', width: '25%', onCell, @@ -248,8 +286,8 @@ const MonitorException: React.FC<{}> = () => { }, { title: '省分', - dataIndex: 'provinceName', - key: 'provinceName', + dataIndex: 'province', + key: 'province', align: 'center', width: '15%', ellipsis: true, @@ -332,13 +370,13 @@ const MonitorException: React.FC<{}> = () => { }, { title: '预算金额(元)', - dataIndex: 'budgetAmount', - key: 'budgetAmount', + dataIndex: 'bidSectContractPrice', + key: 'bidSectContractPrice', align: 'center', width: '25%', onCell, onHeaderCell, - render: (_: any, record: any) => isNotEmpty(record.budgetAmount) ? Number(record.budgetAmount).toFixed(2) : 0, + render: (_: any, record: any) => isNotEmpty(record.bidSectContractPrice) ? Number(record.bidSectContractPrice).toFixed(2) : 0, }, { title: '采购经理', @@ -395,8 +433,8 @@ const MonitorException: React.FC<{}> = () => { }, { title: '预算金额(元)', - dataIndex: 'budgetAmount', - key: 'budgetAmount', + dataIndex: 'bidSectContractPrice', + key: 'bidSectContractPrice', align: 'center', width: '25%', onCell, @@ -432,7 +470,7 @@ const MonitorException: React.FC<{}> = () => { - + {/* */} @@ -443,7 +481,7 @@ const MonitorException: React.FC<{}> = () => {
{ setExceptionType(null); setModalListData(noOpenListData); setModalListVisible(true); }}>more} />
- +
{ setExceptionType(null); setModalListData(noOpenAssessListData); setModalListVisible(true); }}>more} />
diff --git a/src/pages/ElecEvaluation/Monitor/Home/index.tsx b/src/pages/ElecEvaluation/Monitor/Home/index.tsx index 5fcba4f..e564d44 100644 --- a/src/pages/ElecEvaluation/Monitor/Home/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/Home/index.tsx @@ -1,4 +1,4 @@ -import { Button, Col, Descriptions, Divider, Dropdown, Empty, Menu, message, Modal, Progress, Row, Space, Table } from 'antd'; +import { Button, Col, Descriptions, Divider, Dropdown, Empty, Input, Menu, MenuProps, message, Modal, Progress, Row, Space, Table } from 'antd'; import { debounce } from 'lodash'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import '../style.less' @@ -14,10 +14,10 @@ import right from '@/assets/monitor/right.png'; import { CaretRightOutlined, DownOutlined } from '@ant-design/icons'; import './china'; import * as echarts from 'echarts'; -import { getActiveSupplierAPI, getAnnoCountAPI, getAnnualAndTenderAgentAPI, getExpertNumberAPI, getMonitorListAPI, getOpeningListAPI, getReviewDistributionAPI, getSupplierCountAPI, getTodayOpeningAPI } from '../service'; +import { getActiveSupplierAPI, getAnnoCountAPI, getAnnualAndTenderAgentAPI, getExpertNumberAPI, getMonitorListAPI, getOpeningListAPI, getReviewDistributionAPI, getSupplierCountAPI, getTodayInfoAPI, getTodayOpeningAPI } from '../service'; import moment from 'moment'; import { isEmpty, isNotEmpty } from '@/utils/CommonUtils'; -import { getSessionUserData } from '@/utils/session'; +import { getDicData, getSessionUserData } from '@/utils/session'; import { history } from 'umi'; export const onCell = () => ({ className: "monitor-table-content" }); @@ -56,6 +56,15 @@ export const proviceEnum = { "0065": "新疆", "001000": "集团" } +function getYearMap() { + const year: number = moment().year();//当前年份 + const data: { label: string, value: string }[] = []; + for (let i = 0, length = year - 2021 + 1; i < length; i++) { + data.push({ label: (year - i) + "年", value: String(year - i) }) + } + return data; +} +export const yearMap: { label: string, value: string }[] = getYearMap(); function dealWithData(mapd: any[]) { let geoCoordMap = { 吉林: [125.35, 43.88], @@ -92,20 +101,38 @@ function dealWithData(mapd: any[]) { 江西: [115.864528, 28.687675] }; let data = []; - for (let key in geoCoordMap) { - for (let i = 0, length = mapd.length; i < length; i++) { - const ele = mapd[i]; - if (ele.provincesName == key) { - geoCoordMap[key].push(Number(ele.allNumber)); - geoCoordMap[key].push(Number(ele.opeingNumber)); - geoCoordMap[key].push(Number(ele.assessNumber)); - break; - } - } - data.push({ name: key, value: geoCoordMap[key] }); + // for (let key in geoCoordMap) { + // for (let i = 0, length = mapd.length; i < length; i++) { + // const ele = mapd[i]; + // if (ele.provincesName == key) { + // geoCoordMap[key].push(Number(ele.allNumber)); + // geoCoordMap[key].push(Number(ele.opeingNumber)); + // geoCoordMap[key].push(Number(ele.assessNumber)); + // break; + // } + // } + // data.push({ name: key, value: geoCoordMap[key] }); + // } + for (let i = 0, length = mapd.length; i < length; i++) { + const ele = mapd[i]; + data.push({ name: ele.provincesName, value: [...geoCoordMap[ele.provincesName], Number(ele.allNumber), Number(ele.opeingNumber), Number(ele.assessNumber)] }); } return data; } +/** + * 字典code回显dicName + * @param dictList[] + * @param code + */ +export const changeDict = (dictList: any[], code: any) => { + let name = ''; + dictList.forEach((ele: any) => { + if (ele.code == code) { + name = ele.dicName; + } + }); + return name; +}; const columns: any[] = [ { @@ -332,6 +359,50 @@ export const SelectItem = (props: { onSelectChange: (value: string) => void, opt ) } + +//下拉框-招标代理选择 +export const SelectRadio = (props: { onSelectChange: (value: string) => void, options: ({ label: string, value: string })[], defaultText?: string, hidden?: boolean }) => { + const { onSelectChange, options, defaultText = "全部", hidden = false } = props; + const [selectedItem, setSelectItem] = useState(defaultText); + const [open, setOpen] = useState(false); + const [optionsList, setOptionsList] = useState<{ label: string, value: string }[]>([]); + + const handleOpenChange = (flag: boolean) => { + setOpen(flag); + }; + const handleMenuClick = () => { + setOpen(false); + }; + const onChange = (e: any) => { + const data = e.target.value; + const list = options.filter(item => item.label.includes(data)); + setOptionsList(list); + } + useEffect(() => { + options.length > 0 && setOptionsList(options); + }, [options]) + const menu = ( + +
搜索:
+ {optionsList.slice(0, 56).map(item => ( +
{ setSelectItem(item.label); onSelectChange(item.value); handleMenuClick(); }}>{item.label}
+ ))} + {optionsList.length > 56 && "..."} +
+ ); + return ( + + + + ) +} //阶段卡片 export const StageCard = (props: { percentage: string | number, total: string | number, firstTitle: string, secondTitle: string, thirdTitle: string, firstNumber: string | number, secondNumber: string | number, thirdNumber: string | number }) => { const { percentage, total, firstTitle, secondTitle, thirdTitle, firstNumber, secondNumber, thirdNumber } = props; @@ -387,14 +458,14 @@ export const StageCard = (props: { percentage: string | number, total: string | ) } //滚动列表 -export const ScrollTable = (props: { dataSource: any[], columns: any[], rollTime?: number, rollNum?: number, ynum?: number }) => { - const { dataSource, columns, rollTime = 50, rollNum = 5, ynum = 300 } = props; +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; return (
{ - const { dataSource, columns, rollTime = 50, rollNum = 5, ynum = 300 } = props; +export const StatisticTable = (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; return (
void, const contentStyle = { color: "#fff" }; const titleStyle = { color: "#1b7ef2", fontWeight: "bold", marginBottom: '24px' }; const dividerStyle = { borderColor: "#999", margin: "12px 0 24px" }; + //初始化字典 + let dic: any = getDicData(); + let dicData: any = JSON.parse(dic); return ( void, {isNotEmpty(exceptionType) ? exceptionType : item?.exType} {item?.projectName} + {item?.bidSectName || item?.sectionName} {item?.provinceName || item?.regionDictName || item?.province} {item?.ownerContactName} {item?.ownerContactTel} + {(item?.state || item?.sectionState || item?.sectionStatus) == 9 ? "异常处理" : changeDict(item?.bidMethodDict ? dicData[`business_module=${item?.bidMethodDict}`] : [], item?.businessModule)} {item?.tenderAgencyName} {item?.appManagerTel} {item?.openTime || item?.recruitStartTime || item?.openingTime} @@ -564,8 +640,7 @@ export const GraphChart = (props: { type: string, chartData: any[], chartColor?: let mapData: any[] = []; if (type == "map") {//地图处理数据 dataValue = dealWithData(chartData); - // mapData = dataValue.splice(0, 3); - mapData = dataValue; + mapData = dataValue.splice(0, 3); } const autoTooltip = (index: number) => { myChart.dispatchAction({ @@ -577,6 +652,13 @@ export const GraphChart = (props: { type: string, chartData: any[], chartColor?: }, }); } + const autoSelect = (index: number) => { + myChart.dispatchAction({ + type: 'select', + seriesIndex: 0, + dataIndex: index, + }); + } const colors = ['#1B7EF2', '#29F1FA', '#1B7EF2']; const categoryOption: EChartsOption = { color: colors, @@ -740,7 +822,13 @@ export const GraphChart = (props: { type: string, chartData: any[], chartColor?: coordinateSystem: "geo", data: dataValue, symbolSize: function (val) { - return val[2] == 0 ? 8 : Math.floor(val[2] / 1.2); + if (val[2] < 9) { + return 8; + } else if (val[2] > 30) { + return 30; + } else { + return val[2]; + } }, symbol: "circle", // symbolSize: 8, @@ -774,48 +862,54 @@ export const GraphChart = (props: { type: string, chartData: any[], chartColor?: disabled: true }, }, - // { - // name: "", - // type: "effectScatter", - // coordinateSystem: "geo", - // data: mapData, - // symbolSize: 16, - // // symbolSize: function (val) { - // // return Math.floor(val[1] / 4); - // // }, - // tooltip: { - // formatter(value) { - // return value.data.name + "
" + "今日评标总数:" + value.data.value[2] + "
" + "电子招标:" + value.data.value[3] + "
" + "电子评标:" + value.data.value[4]; - // }, - // backgroundColor: "#0a0c11cc", - // textStyle: { - // color: '#fff' - // }, - // show: true - // }, - // encode: { - // value: 2 - // }, - // showEffectOn: "render", - // rippleEffect: { - // brushType: "stroke", - // color: "rgb(36,203,255)", - // period: 9, - // scale: 5 - // }, - // label: { - // formatter: "{b}", - // position: "right", - // color: "#fff", - // show: true - // }, - // itemStyle: { - // color: "rgb(36,203,255)", - // shadowBlur: 2, - // shadowColor: "#333" - // }, - // zlevel: 1 - // } + { + name: "", + type: "effectScatter", + coordinateSystem: "geo", + data: mapData, + // symbolSize: 16, + symbolSize: function (val) { + if (val[2] < 9) { + return 8; + } else if (val[2] > 30) { + return 30; + } else { + return val[2]; + } + }, + tooltip: { + formatter(value) { + return value.data.name + "
" + "今日评标总数:" + value.data.value[2] + "
" + "电子招标:" + value.data.value[3] + "
" + "电子评标:" + value.data.value[4]; + }, + backgroundColor: "#0a0c11cc", + textStyle: { + color: '#fff' + }, + show: true + }, + encode: { + value: 2 + }, + showEffectOn: "render", + rippleEffect: { + brushType: "stroke", + color: "rgb(36,203,255)", + period: 9, + scale: 5 + }, + label: { + formatter: "{b}", + position: "right", + color: "#fff", + show: true + }, + itemStyle: { + color: "rgb(36,203,255)", + shadowBlur: 2, + shadowColor: "#333" + }, + zlevel: 1 + } ] }; const gaugeOption: EChartsOption = { @@ -1238,16 +1332,29 @@ export const GraphChart = (props: { type: string, chartData: any[], chartColor?: myChart && myChart.resize(); }; let interval: any = null; - // if (type == "map") {//地图自动轮播tooltip - // let index = 0; - // interval = setInterval(() => { - // autoTooltip(index) - // index++; - // if (index >= mapData.length) { - // index = 0; - // } - // }, 10000) - // } + if (type == "map") {//地图自动轮播tooltip + let index = 0; + interval = setInterval(() => { + autoTooltip(index); + index++; + if (index >= mapData.length) { + index = 0; + } + }, 10000) + } + if (type == "mapTwice") {//地图自动轮播tooltip + let index = 1; + autoSelect(0); + if (chartData.length > 1) { + interval = setInterval(() => { + autoSelect(index); + index++; + if (index >= chartData.length) { + index = 0; + } + }, 10000) + } + } window.addEventListener("resize", debounce(() => resize(), 100)); return () => { window.removeEventListener("resize", debounce(() => resize(), 100)); @@ -1289,14 +1396,17 @@ const MonitorHome: React.FC<{}> = () => { const [annoCount, setAnnoCount] = useState(""); //评审专家数量 const [expertNumber, setExpertNumber] = useState(""); - //年度&月度 year-年度 month-月度 - const [ymChange, setYmChange] = useState("year"); //评标室监控 - const [monitorList, setMonitorList] = useState([{ status: "3" }, { status: "3" }, { status: "3" }]); + const [monitorList, setMonitorList] = useState([]); + //今日开标-评标阶段,评标及时率 + const [todayInfoData, setTodayInfoData] = useState(); //权限校验 const auth = useRef(authCheck()); const bidStatusMap = ["准备评标", "正在评标", "评标结束", "暂无数据"]; const statusColorMap = ["card-text-orange", "card-text-green", "card-text-purple", "card-text-white"]; + //year select + const localYear: string = moment().month() < 2 ? String(moment().year() - 1) : String(moment().year()); + const [yearSelect, setYearSelect] = useState(localYear); const mapChart = useMemo(() => { return reviewDistributionData.length > 0 && }, [reviewDistributionData]) @@ -1325,8 +1435,8 @@ const MonitorHome: React.FC<{}> = () => { }) } //上面前三个指标和招标代理实施项目统计 - const getAnnualAndTenderAgent = () => { - getAnnualAndTenderAgentAPI().then(res => { + const getAnnualAndTenderAgent = (ym: any) => { + getAnnualAndTenderAgentAPI(ym).then(res => { if (res?.code == 200) { const data = res?.data; if (data.agencyProjectYear.length > 0) { @@ -1335,20 +1445,13 @@ const MonitorHome: React.FC<{}> = () => { data.agencyProjectYear[i]["maxNum"] = max1; } } - if (data.agencyProjectMonth.length > 0) { - const max2 = data.agencyProjectMonth[0].num; - - for (let i = 0, length = data.agencyProjectMonth.length; i < length; i++) { - data.agencyProjectMonth[i]["maxNum"] = max2; - } - } setAnnualAndTenderAgentData(data); } }) } //活跃供应商 - const getActiveSupplier = () => { - getActiveSupplierAPI().then(res => { + const getActiveSupplier = (ym: string) => { + getActiveSupplierAPI(ym).then(res => { if (res?.code == 200) { const data = res?.data; if (data.length > 0) { @@ -1363,7 +1466,7 @@ const MonitorHome: React.FC<{}> = () => { } //参与供应商数 const getSupplierCount = (ym: string) => { - getSupplierCountAPI({ type: ym }).then(res => { + getSupplierCountAPI(ym).then(res => { if (res?.code == 200) { setSupplierCount(res?.data); } @@ -1371,7 +1474,7 @@ const MonitorHome: React.FC<{}> = () => { } //公告公示数量 const getAnnoCount = (ym: string) => { - getAnnoCountAPI({ type: ym }).then(res => { + getAnnoCountAPI(ym).then(res => { if (res?.code == 200) { setAnnoCount(res?.data); } @@ -1395,11 +1498,16 @@ const MonitorHome: React.FC<{}> = () => { } }) } + //今日开标-评标阶段,评标及时率 + const getTodayInfo = () => { + getTodayInfoAPI().then(res => { + if (res?.code == 200) { + setTodayInfoData(res?.data); + } + }) + } //监控室点击事件 const onCardClick = (item: any) => { - if (item.status == "3") { - return; - } if (item.status == "0") { message.info("当前评标室未开启,请等待开启后查看"); return; @@ -1409,36 +1517,41 @@ const MonitorHome: React.FC<{}> = () => { state: { monitorId: item.id }, }) } + //onYearSelect + const onYearSelect = (value: string) => { + setYearSelect(value); + } useEffect(() => { if (auth.current) { getTodayOpening(); getReviewDistribution(); getOpeningList(); - getAnnualAndTenderAgent(); - getActiveSupplier(); getMonitorList(); + getTodayInfo(); } }, []) useEffect(() => { if (auth.current) { - getSupplierCount(ymChange); - getAnnoCount(ymChange); - getExpertNumber(ymChange); + getSupplierCount(yearSelect); + getAnnoCount(yearSelect); + getAnnualAndTenderAgent(yearSelect); + getExpertNumber(yearSelect); + getActiveSupplier(yearSelect); } - }, [ymChange]) + }, [yearSelect]) return (
- { setYmChange("year") }}>年度 | { setYmChange("month") }}>月度 +
-
- - + + + @@ -1448,7 +1561,7 @@ const MonitorHome: React.FC<{}> = () => {
{ window.open("/ElecMonitor/OpenToday") }}> - 标段总数  {isNotEmpty(todayOpeningData?.sectionNumber) ? todayOpeningData?.sectionNumber : 0}  已完成  {isNotEmpty(todayOpeningData?.complete) ? Number(todayOpeningData?.complete).toFixed(0) : 0}  完成率  {isNotEmpty(todayOpeningData?.rate) ? todayOpeningData?.rate : 0}} /> + 标段总数  {isNotEmpty(todayOpeningData?.sectionNumber) ? todayOpeningData?.sectionNumber : 0}  开标完成率  {isNotEmpty(todayOpeningData?.sectionNumber) && todayOpeningData?.sectionNumber != "0" ? Number(((Number(todayOpeningData?.banner) / todayOpeningData?.sectionNumber) * 100).toFixed(0)) : 0}%  评标完成率  {(isNotEmpty(todayInfoData?.sectionNumber) && todayInfoData?.sectionNumber != "0") ? Number(((Number(todayInfoData?.resultNumber) / todayInfoData?.sectionNumber) * 100).toFixed(0)) : 0}%} />
@@ -1473,11 +1586,9 @@ const MonitorHome: React.FC<{}> = () => {
- {/*
*/} - + {monitorList.length > 0 ?
{monitorList.map((item, index) => (
- {/*
*/}
onCardClick(item)}>
{bidStatusMap[item.status]}
@@ -1485,12 +1596,9 @@ const MonitorHome: React.FC<{}> = () => {
{item?.projectName}
- {/*
*/} - ))} - - {/*
*/} + : } diff --git a/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx b/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx index 114fe4c..066a8a0 100644 --- a/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx @@ -1,104 +1,13 @@ import { Col, Row } from 'antd'; import React, { useEffect, useRef, useState } from 'react'; import '../style.less' -import { authCheck, ModalList, onCell, onHeaderCell, OverviewItem, ProgressItem, proviceEnum, ScreenLabel, ScreenTitle, ScrollTable, StageCard } from '../Home'; +import { authCheck, changeDict, ModalList, onCell, onHeaderCell, OverviewItem, ProgressItem, proviceEnum, ScreenLabel, ScreenTitle, ScrollTable, StageCard } from '../Home'; import Circle3199 from '@/assets/monitor/circle-3199.png'; import { getDecryptSuccessRateTodayAPI, getNoOpenListAPI, getNoOpenNumberAPI, getTodayInfoAPI, getTodayOpeningAPI, getUnopenSixAPI, getUnopenTenAPI } from '../service'; import { isNotEmpty } from '@/utils/CommonUtils'; -const statusMap = ["未开标", "开标", "唱标", "唱标结束", "取消开标", "", "", "", "", "异常处理"]; +import { getDicData } from '@/utils/session'; +// const statusMap = ["未开标", "开标", "唱标", "唱标结束", "取消开标", "", "", "", "", "异常处理"]; -const columns: any[] = [ - { - title: '省分', - dataIndex: 'provinceName', - key: 'provinceName', - width: '20%', - align: "center", - ellipsis: true, - onCell, - onHeaderCell, - // render: (_: any, record: any) => proviceEnum[record.provinceDictId], - }, - { - title: '项目名称', - dataIndex: 'projectName', - key: 'projectName', - align: "center", - ellipsis: true, - width: '30%', - onCell, - onHeaderCell, - }, - { - title: '采购预算', - dataIndex: 'bidSectContractPrice', - key: 'bidSectContractPrice', - align: "center", - width: '30%', - onCell, - onHeaderCell, - }, - { - title: '开标时间', - dataIndex: 'openTime', - key: 'openTime', - align: "center", - width: '20%', - onCell, - onHeaderCell, - }, -]; -const reiColumns: any[] = [ - { - title: '省分', - dataIndex: 'provinceName', - key: 'provinceName', - align: "center", - width: '20%', - ellipsis: true, - onCell, - onHeaderCell, - // render: (_: any, record: any) => proviceEnum[record.provinceDictId], - }, - { - title: '项目名称', - dataIndex: 'projectName', - key: 'projectName', - align: "center", - ellipsis: true, - width: '20%', - onCell, - onHeaderCell, - }, - { - title: '采购预算', - dataIndex: 'bidSectContractPrice', - key: 'bidSectContractPrice', - align: "center", - width: '20%', - onCell, - onHeaderCell, - }, - { - title: '开标时间', - dataIndex: 'openTime', - key: 'openTime', - align: "center", - width: '20%', - onCell, - onHeaderCell, - }, - { - title: '状态', - dataIndex: 'state', - key: 'state', - align: "center", - width: '20%', - onCell, - onHeaderCell, - render: (_: any, record: any) => statusMap[record.state], - }, -]; const OpenToday: React.FC<{}> = () => { //今日开标-评标阶段,评标及时率 const [todayInfoData, setTodayInfoData] = useState(); @@ -126,6 +35,114 @@ const OpenToday: React.FC<{}> = () => { const [exceptionType, setExceptionType] = useState(); //权限校验 const auth = useRef(authCheck()); + //定时器描述 + const _time = 20000; + //初始化字典 + let dic: any = getDicData(); + let dicData: any = JSON.parse(dic); + const columns: any[] = [ + { + title: '省分', + dataIndex: 'provinceName', + key: 'provinceName', + width: '20%', + align: "center", + ellipsis: true, + onCell, + onHeaderCell, + // render: (_: any, record: any) => proviceEnum[record.provinceDictId], + }, + { + title: '标段名称', + dataIndex: 'projectName', + key: 'projectName', + align: "center", + ellipsis: true, + width: '20%', + onCell, + onHeaderCell, + render: (_: any, record: any) => {record.projectName}
{record.sectionName}
, + }, + { + title: '采购预算', + dataIndex: 'bidSectContractPrice', + key: 'bidSectContractPrice', + align: "center", + width: '20%', + onCell, + onHeaderCell, + }, + { + title: '开标时间', + dataIndex: 'openTime', + key: 'openTime', + align: "center", + width: '20%', + onCell, + onHeaderCell, + }, + { + title: '标段状态', + dataIndex: 'sectionState', + key: 'sectionState', + align: "center", + width: '20%', + onCell, + onHeaderCell, + render: (_: any, record: any) => record?.sectionState == 9 ? "异常处理" : changeDict(record?.bidMethodDict ? dicData[`business_module=${record?.bidMethodDict}`] : [], record?.businessModule), + }, + ]; + const reiColumns: any[] = [ + { + title: '省分', + dataIndex: 'provinceName', + key: 'provinceName', + align: "center", + width: '20%', + ellipsis: true, + onCell, + onHeaderCell, + // render: (_: any, record: any) => proviceEnum[record.provinceDictId], + }, + { + title: '项目名称', + dataIndex: 'projectName', + key: 'projectName', + align: "center", + ellipsis: true, + width: '20%', + onCell, + onHeaderCell, + }, + { + title: '采购预算', + dataIndex: 'bidSectContractPrice', + key: 'bidSectContractPrice', + align: "center", + width: '20%', + onCell, + onHeaderCell, + }, + { + title: '开标时间', + dataIndex: 'openTime', + key: 'openTime', + align: "center", + width: '20%', + onCell, + onHeaderCell, + }, + { + title: '标段状态', + dataIndex: 'sectionState', + key: 'sectionState', + align: "center", + width: '20%', + onCell, + onHeaderCell, + render: (_: any, record: any) => record?.sectionState == 9 ? "异常处理" : changeDict(record?.bidMethodDict ? dicData[`business_module=${record?.bidMethodDict}`] : [], record?.businessModule), + }, + ]; //今日开标-评标阶段,评标及时率 const getTodayInfo = () => { getTodayInfoAPI().then(res => { @@ -192,27 +209,40 @@ const OpenToday: React.FC<{}> = () => { } }) } + //页面数据获取 + const getPageData = () => { + getTodayInfo(); + getDecryptSuccessRateToday(); + getTodayOpening(); + getUnopenSix(); + getUnopenTen(); + getNoOpenNumber(); + getNoOpenList(); + } useEffect(() => { + let interval: any; if (auth.current) { - getTodayInfo(); - getDecryptSuccessRateToday(); - getTodayOpening(); - getUnopenSix(); - getUnopenTen(); - getNoOpenNumber(); - getNoOpenList(); + getPageData(); + interval = setInterval(() => { + getPageData(); + }, _time); + } + return () => { + clearInterval(interval); } }, []) return (
- { window.open("/ElecMonitor/Exception") }}>异常监控 +
+ { window.open("/ElecMonitor/Exception") }}>异常监控 +
-
+
@@ -220,19 +250,19 @@ const OpenToday: React.FC<{}> = () => {
-
+
- - + +
{ }} rightClick={() => { setExceptionType("解密异常"); setModalListData(isNotEmpty(decryptSuccessRateTodayData?.decryptFailProjectList) ? decryptSuccessRateTodayData?.decryptFailProjectList : []); setModalListVisible(true); }} /> - { setExceptionType(null); setModalListData(noOpenListTwo); setModalListVisible(true); }} rightClick={() => { setExceptionType(null); setModalListData(noOpenListFive); setModalListVisible(true); }} /> - { setExceptionType(null); setModalListData(unopenSixData); setModalListVisible(true); }} rightClick={() => { setExceptionType(null); setModalListData(unopenTenData); setModalListVisible(true); }} /> + { setExceptionType("2小时未开标"); setModalListData(noOpenListTwo); setModalListVisible(true); }} rightClick={() => { setExceptionType("5小时未开标"); setModalListData(noOpenListFive); setModalListVisible(true); }} /> + { setExceptionType("6小时未评标"); setModalListData(unopenSixData); setModalListVisible(true); }} rightClick={() => { setExceptionType("10小时未评标"); setModalListData(unopenTenData); setModalListVisible(true); }} />
-
+
diff --git a/src/pages/ElecEvaluation/Monitor/Supplier/index.tsx b/src/pages/ElecEvaluation/Monitor/Supplier/index.tsx index ce28fec..100a644 100644 --- a/src/pages/ElecEvaluation/Monitor/Supplier/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/Supplier/index.tsx @@ -1,11 +1,12 @@ import { Col, Progress, Row } from 'antd'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import '../style.less' -import { authCheck, GraphChart, MetricItems, onCell, onHeaderCell, ScreenLabel, ScreenTitle, SelectItem, StatisticTable } from '../Home'; +import { authCheck, GraphChart, MetricItems, onCell, onHeaderCell, ScreenLabel, ScreenTitle, SelectItem, StatisticTable, yearMap } from '../Home'; import Frame10116 from '@/assets/monitor/Frame-10116.png'; import Frame10121 from '@/assets/monitor/Frame-10121.png'; import { getActiveSupplierRankAPI, getProvinceActiveSupplierInfoAPI, getSupplierInfoAPI } from '../service'; import { isNotEmpty } from '@/utils/CommonUtils'; +import moment from 'moment'; const columns: any[] = [ { @@ -77,6 +78,9 @@ const Supplier: React.FC<{}> = () => { const [chartData, setChartData] = useState([]); //权限校验 const auth = useRef(authCheck()); + //year select + const localYear: string = moment().month() < 2 ? String(moment().year() - 1) : String(moment().year()); + const [yearSelect, setYearSelect] = useState(localYear); const transverseBarChart = useMemo(() => { return chartData.length > 0 && }, [chartData]) @@ -90,16 +94,16 @@ const Supplier: React.FC<{}> = () => { }, [provinceData]) //上面六个指标 - const getSupplierInfo = () => { - getSupplierInfoAPI().then(res => { + const getSupplierInfo = (ym: string) => { + getSupplierInfoAPI(ym).then(res => { if (res?.code == 200) { setSupplierInfoData(res?.data); } }) } //全国活跃供应商排名 - const getActiveSupplierRank = () => { - getActiveSupplierRankAPI().then(res => { + const getActiveSupplierRank = (ym: string) => { + getActiveSupplierRankAPI(ym).then(res => { if (res?.code == 200) { const data = JSON.parse(res?.data) rankDataRef.current = data; @@ -108,8 +112,8 @@ const Supplier: React.FC<{}> = () => { }) } //供应商概况-省份活跃供应商 - const getProvinceActiveSupplierInfo = () => { - getProvinceActiveSupplierInfoAPI().then(res => { + const getProvinceActiveSupplierInfo = (ym: string) => { + getProvinceActiveSupplierInfoAPI(ym).then(res => { if (res?.code == 200) { provinceActiveSupplierInfoData.current = res?.data; setProvinceData(res?.data.map((item: any) => ({ name: item.provinceName, value: 0 }))) @@ -119,13 +123,15 @@ const Supplier: React.FC<{}> = () => { //onSelectChange select变更事件 const onSelectChange = (value: string | number) => { if (rankDataRef.current) { - const data = rankDataRef.current[value]; + const data = rankDataRef.current[value] ? rankDataRef.current[value] : []; if (data.length > 0) { const max = data[0].tenderCount; for (let i = 0, length = data.length; i < length; i++) { data[i]["maxTenderCount"] = max; } - setActiveSupplierRankData(data) + setActiveSupplierRankData(data); + } else { + setActiveSupplierRankData([]); } } @@ -157,18 +163,25 @@ const Supplier: React.FC<{}> = () => { } } } + //onYearSelect + const onYearSelect = (value: string) => { + setYearSelect(value); + } useEffect(() => { if (auth.current) { - getSupplierInfo(); - getActiveSupplierRank(); - getProvinceActiveSupplierInfo(); + getSupplierInfo(yearSelect); + getActiveSupplierRank(yearSelect); + getProvinceActiveSupplierInfo(yearSelect); } - }, []) + }, [yearSelect]) return (
-
+
+ +
+
@@ -191,7 +204,7 @@ const Supplier: React.FC<{}> = () => {
- { monthOrYear.current = "yearData"; chartDataChange(); }}>本年 | { monthOrYear.current = "monthData"; chartDataChange(); }}>本月     { metric.current = "tenderCount"; chartDataChange(); }}>投标次数 | { metric.current = "selectCount"; chartDataChange(); }}>中选次数 | { metric.current = "bidCost"; chartDataChange(); }}>中选金额    {province.current}} /> + { metric.current = "tenderCount"; chartDataChange(); }}>投标次数 | { metric.current = "selectCount"; chartDataChange(); }}>中选次数 | { metric.current = "bidCost"; chartDataChange(); }}>中选金额    {province.current}} />
diff --git a/src/pages/ElecEvaluation/Monitor/TenderAgent/index.tsx b/src/pages/ElecEvaluation/Monitor/TenderAgent/index.tsx index b817e07..c95ffc3 100644 --- a/src/pages/ElecEvaluation/Monitor/TenderAgent/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/TenderAgent/index.tsx @@ -1,13 +1,14 @@ import { Col, Radio, Row } from 'antd'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import '../style.less' -import { authCheck, GraphChart, onCell, onHeaderCell, OverviewItem, ScreenLabel, ScreenTitle, SelectItem, StatisticTable } from '../Home'; +import { authCheck, GraphChart, onCell, onHeaderCell, OverviewItem, ScreenLabel, ScreenTitle, SelectItem, SelectRadio, StatisticTable, yearMap } from '../Home'; import Circle3197 from '@/assets/monitor/circle-3197.png'; import Circle3198 from '@/assets/monitor/circle-3198.png'; import Circle3199 from '@/assets/monitor/circle-3199.png'; import Circle3200 from '@/assets/monitor/circle-3200.png'; import { getTenderAgentDataAPI, getProvinceByAgencyAPI } from '../service'; import { isNotEmpty } from '@/utils/CommonUtils'; +import moment from 'moment'; const columns: any[] = [ { @@ -71,6 +72,11 @@ const TenderAgent: React.FC<{}> = () => { const [provinceData, setProvinceData] = useState([]); //btn select const [btnSelect, setBtnSelect] = useState("0"); + //year select + const localYear: string = moment().month() < 2 ? String(moment().year() - 1) : String(moment().year()); + const [yearSelect, setYearSelect] = useState(localYear); + //存一份 + const selectAgency = useRef(""); //权限校验 const auth = useRef(authCheck()); // const gaugeChartData = [{ value: 20 }] @@ -94,8 +100,8 @@ const TenderAgent: React.FC<{}> = () => { }, [provinceByAgencyData]) //相关统计数据 - const getTenderAgentData = () => { - getTenderAgentDataAPI().then(res => { + const getTenderAgentData = (year: string) => { + getTenderAgentDataAPI(year).then(res => { if (res?.code == 200) { setTenderAgentData(res?.data); const data = res?.data.agencyProjectMonth;//左侧条形图数据处理 @@ -113,7 +119,7 @@ const TenderAgent: React.FC<{}> = () => { setMonthData(monthDataMap) const selectData: any[] = res?.data.agencyList.map((item: any) => ({ label: item.agencyName, value: item.agencyId }));//右侧代理机构下拉 - selectData.unshift({ label: "请选择", value: "all" }); + // selectData.unshift({ label: "请选择", value: "all" }); setSelectData(selectData); const province = res?.data.agencyListByProvince;//招标代理省份分布数据 @@ -129,8 +135,8 @@ const TenderAgent: React.FC<{}> = () => { }) } //代理分布省分 - const getProvinceByAgency = (agencyId: string) => { - getProvinceByAgencyAPI(agencyId).then(res => { + const getProvinceByAgency = (agencyId: string, year: string) => { + getProvinceByAgencyAPI(agencyId, year).then(res => { if (res?.code == 200) { const data = res?.data; const agencyData = data.map((item: any) => ({ name: item.province, value: Number(item.dlxms), data: item })); @@ -143,20 +149,27 @@ const TenderAgent: React.FC<{}> = () => { } //onSelectChange select变更事件 const onSelectChange = (value: string) => { - if (value != "all") { - getProvinceByAgency(value); - } else { - setProvinceByAgencyData([]); - } + getProvinceByAgency(value, yearSelect); + selectAgency.current = value; + } + //onYearSelect + const onYearSelect = (value: string) => { + setYearSelect(value); } useEffect(() => { if (auth.current) { - getTenderAgentData(); + getTenderAgentData(yearSelect); + if (selectAgency.current != "") { + getProvinceByAgency(selectAgency.current, yearSelect); + } } - }, []) + }, [yearSelect]) return (
+
+ +
@@ -194,7 +207,7 @@ const TenderAgent: React.FC<{}> = () => { {categoryChart}
- +
@@ -204,7 +217,7 @@ const TenderAgent: React.FC<{}> = () => { 代理分布省分省分代理分布 -
{ + 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 { From 2af3714c6d65bf479632c3ec149f90652ba0499a Mon Sep 17 00:00:00 2001 From: jl-zhoujl2 Date: Fri, 6 Jan 2023 21:49:06 +0800 Subject: [PATCH 5/5] =?UTF-8?q?1.6=20=E7=AC=AC=E5=8D=81=E4=B8=89=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ElecEvaluation/Monitor/Exception/index.tsx | 14 +++++++------- src/pages/ElecEvaluation/Monitor/Home/index.tsx | 3 --- .../ElecEvaluation/Monitor/OpenToday/index.tsx | 8 ++++---- src/pages/ElecEvaluation/Monitor/style.less | 2 +- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/pages/ElecEvaluation/Monitor/Exception/index.tsx b/src/pages/ElecEvaluation/Monitor/Exception/index.tsx index a43fe06..3820875 100644 --- a/src/pages/ElecEvaluation/Monitor/Exception/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/Exception/index.tsx @@ -164,17 +164,17 @@ const MonitorException: React.FC<{}> = () => { 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); + v0?.scrollIntoView(false); + v1?.scrollIntoView(false); + v2?.scrollIntoView(false); + v3?.scrollIntoView(false); + v4?.scrollIntoView(false); + v5?.scrollIntoView(false); count++; } else { count = 0; } - }, 5000) + }, 3000) } return () => { clearInterval(interval); diff --git a/src/pages/ElecEvaluation/Monitor/Home/index.tsx b/src/pages/ElecEvaluation/Monitor/Home/index.tsx index 33e341c..ea67c7a 100644 --- a/src/pages/ElecEvaluation/Monitor/Home/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/Home/index.tsx @@ -473,9 +473,6 @@ export const ScrollTable = (props: { dataSource: any[], columns: any[], rollTime }} // dataSource={tableData} rowClassName={(record, index) => { - if ((selectKey >= (dataSource?.length - 1)) && (index == (dataSource?.length - 1))) {//超过列表长度后锁定最后一条 - return "scroll-select-bg"; - } if (index == selectKey) { return "scroll-select-bg"; //highlight样式需要自己定义 } diff --git a/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx b/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx index 67380e0..1ad88b7 100644 --- a/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx +++ b/src/pages/ElecEvaluation/Monitor/OpenToday/index.tsx @@ -38,7 +38,7 @@ const OpenToday: React.FC<{}> = () => { //权限校验 const auth = useRef(authCheck()); //定时器描述 - const _time = 20000; + const _time = 60000; //初始化字典 let dic: any = getDicData(); let dicData: any = JSON.parse(dic); @@ -245,13 +245,13 @@ const OpenToday: React.FC<{}> = () => { setSelectKey(count); const v0 = document.getElementsByClassName("scroll-select-bg")[0]; const v1 = document.getElementsByClassName("scroll-select-bg")[1]; - v0.scrollIntoView(false); - v1.scrollIntoView(false); + v0?.scrollIntoView(false); + v1?.scrollIntoView(false); count++; } else { count = 0; } - }, 5000) + }, 3000) } return () => { clearInterval(interval); diff --git a/src/pages/ElecEvaluation/Monitor/style.less b/src/pages/ElecEvaluation/Monitor/style.less index 8f2aaea..220ecb2 100644 --- a/src/pages/ElecEvaluation/Monitor/style.less +++ b/src/pages/ElecEvaluation/Monitor/style.less @@ -726,7 +726,7 @@ } .scroll-select-bg { - background: #1b7ef266; + background: #66666666; } }