From d115e68420594435d767b8c9c26098a75ed2b87e Mon Sep 17 00:00:00 2001 From: sunliang <593170460@qq.com> Date: Thu, 22 Feb 2024 13:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=99=BB=E5=BD=95=E6=97=81?= =?UTF-8?q?=E5=BE=85=E5=8A=9E=E6=9D=A1=E6=95=B0=E6=8F=90=E9=86=92=EF=BC=8C?= =?UTF-8?q?=E5=8F=8A1=E5=88=86=E9=92=9F=E8=87=AA=E5=8A=A8=E9=9A=90?= =?UTF-8?q?=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../microhost/components/rightInfo/index.tsx | 49 +++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/platform-code/src/microhost/components/rightInfo/index.tsx b/platform-code/src/microhost/components/rightInfo/index.tsx index b7d4a2a..4848b08 100644 --- a/platform-code/src/microhost/components/rightInfo/index.tsx +++ b/platform-code/src/microhost/components/rightInfo/index.tsx @@ -1,6 +1,8 @@ import { AutoComplete, Divider, Form, Input, message, Popover, Tabs, Tag } from 'antd' import { Route } from 'dva/router' import lodash from "lodash" +import requestaxios from 'axios'; +import utils from "@/microhost/common" import React, { useContext, useEffect, useLayoutEffect, useRef, useState } from 'react' import { history, useModel, } from 'umi' import {Dropdown, Menu, Modal} from "antd" @@ -10,6 +12,7 @@ import {Runtime} from "../../system" import UserEditor from "../userEdit" import MicroApps from '@/microhost/system/apps' import { SystemData } from '@/microhost/models/system' +import { string } from 'prop-types'; /** * 头部右侧内容区 @@ -27,9 +30,14 @@ const RightInfo = () => { const [isLoading, setIsLoading] = useState(false) const [activeThemeName, setActiveThemeName] = useState("") const [searchList, setSearchList] = useState([]) - + const [msgnum,setmsgnum]=useState(""); + //const [isHidden, setIsHidden] = useState(true); // 初始化状态变量为 false + + useEffect(() => { + msglog(); + }, []) useLayoutEffect(() => { - + window.addEventListener("click", () => { //setShowFuncs(false) }) @@ -39,6 +47,40 @@ const RightInfo = () => { } }, []) + const msglog=()=> + { + setmsgnum("0"); + // console.log("开始请求"); + + // const date={ + // mid: "41f852c5-dfa3-3057-c62d-197d82f71b58" ,//指定模块id,可在导航管理获得,用户需有权限 + // app: "", //预留 + // title: "待办提醒", //推送标题 + // msg: "您有代办信息请及时处理", //推送内容 + // showtype: 0 ,//0-仅通知 1-通知且提供跳转 2-通知且直接跳转 + // filter: { //可选参数,推送过滤 + // // loginId: string //可选参数,指定接收人 + // }, + // param: { //可选参数,给模块传递get参数 + // //参数名:参数值 + // } + // } + const loginName = utils.loadCookie("loginName") + //const loginName='chengzhigang'; + requestaxios + .post("http://172.15.89.222:8081/WF/API/EmpWorksNums?UserNo="+loginName) + .then(({ data }) => { + setmsgnum(data.replace("EmpWorksNums:","")); + setTimeout(() => { + document.getElementById('MSGNUM').style.display = 'none'; + // setIsVisible(false); // 2000ms后将isVisible设置为不可见状态 + }, 60000); + }) + .catch((reason) => { + message.error('推送代办信息报错' + reason); + + }); + } const changePassword = async () => { await thisForm.validateFields() let vals: any = thisForm.getFieldsValue() @@ -231,8 +273,9 @@ const RightInfo = () => { */}
+ -
{!nickname ? "-" : `${nickname},您好!`}
+
{!nickname ? "-" : `${nickname},您好!`}{`您有${msgnum}条待办`}
{/* */}