|
|
|
@ -14,6 +14,7 @@ import MicroApps from '@/microhost/system/apps'
|
|
|
|
|
import { SystemData } from '@/microhost/models/system'
|
|
|
|
|
import { string } from 'prop-types';
|
|
|
|
|
import { FrameMessage as message1 } from '@/library/union';
|
|
|
|
|
import { WebSocketOption as SocketOption, WebSocketLoader as Socket } from "./ws"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -34,7 +35,41 @@ const RightInfo = () => {
|
|
|
|
|
const [searchList, setSearchList] = useState<any[]>([])
|
|
|
|
|
const [msgnum, setmsgnum] = useState<any>("");
|
|
|
|
|
//const [isHidden, setIsHidden] = useState(true); // 初始化状态变量为 false
|
|
|
|
|
const ws = useRef<Socket>(new Socket(new SocketOption()))
|
|
|
|
|
const [socketData, setsocketData] = useState<any>({})
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
startSocket()
|
|
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
|
ws.current.dispose()
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
// const startSocket = () => {
|
|
|
|
|
// let option = new SocketOption()
|
|
|
|
|
|
|
|
|
|
// option.ws = `ws://127.0.0.1:1233`
|
|
|
|
|
|
|
|
|
|
// option.onOpen = () => {
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// option.onClose = () => {
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// option.onError = () => {
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// option.onMessage = (msgdata: any) => {
|
|
|
|
|
// setsocketData(JSON.parse(msgdata))
|
|
|
|
|
// // console.log("on message", msgdata)
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// ws.current = new Socket(option)
|
|
|
|
|
// ws.current.start()
|
|
|
|
|
// }
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
msglog();
|
|
|
|
|
}, [])
|
|
|
|
@ -69,7 +104,7 @@ const RightInfo = () => {
|
|
|
|
|
const loginName = utils.loadCookie("loginName")
|
|
|
|
|
//const loginName='chengzhigang';
|
|
|
|
|
requestaxios
|
|
|
|
|
.post("http://172.15.89.222:8081/WF/API/EmpWorksNums?UserNo=" + loginName)
|
|
|
|
|
.post("https://craft.dayesteel.com.cn:8081/WF/API/EmpWorksNums?UserNo=" + loginName)
|
|
|
|
|
.then(({ data }) => {
|
|
|
|
|
setmsgnum(data.replace("EmpWorksNums:", ""));
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|