|
@@ -1,6 +1,6 @@
|
|
import PageContent from '@/components/PageContent';
|
|
import PageContent from '@/components/PageContent';
|
|
import TabsContent from '@/components/TabsContent';
|
|
import TabsContent from '@/components/TabsContent';
|
|
-import { getNotificationList } from '@/services/message';
|
|
|
|
|
|
+import { getNotificationList, readNotification } from '@/services/message';
|
|
import { UnityAction } from '@/utils/utils';
|
|
import { UnityAction } from '@/utils/utils';
|
|
import { useParams, useRequest, useSearchParams } from '@umijs/max';
|
|
import { useParams, useRequest, useSearchParams } from '@umijs/max';
|
|
import { Button, Spin } from 'antd';
|
|
import { Button, Spin } from 'antd';
|
|
@@ -14,7 +14,7 @@ const icon3 = require('@/assets/message/warning.png');
|
|
const MessageCenter = () => {
|
|
const MessageCenter = () => {
|
|
const { projectId } = useParams();
|
|
const { projectId } = useParams();
|
|
const [searchParams] = useSearchParams();
|
|
const [searchParams] = useSearchParams();
|
|
- const [tab, setTab] = useState(searchParams.get('type') || '2');
|
|
|
|
|
|
+ const [tab, setTab] = useState(searchParams.get('type') || '1');
|
|
//, msgType: 工况:11, 自检:12, 预警:13
|
|
//, msgType: 工况:11, 自检:12, 预警:13
|
|
const { data, run, loading } = useRequest(() =>
|
|
const { data, run, loading } = useRequest(() =>
|
|
getNotificationList({ projectId, msgType: 11 }, { manual: true }),
|
|
getNotificationList({ projectId, msgType: 11 }, { manual: true }),
|
|
@@ -54,12 +54,17 @@ const MessageCenter = () => {
|
|
};
|
|
};
|
|
|
|
|
|
const handlerSeeClick = (item) => {
|
|
const handlerSeeClick = (item) => {
|
|
|
|
+ readNotification(item.ID);
|
|
if (tab === '3') {
|
|
if (tab === '3') {
|
|
// if (item?.MandateId) {
|
|
// if (item?.MandateId) {
|
|
UnityAction.sendMsg('OpenTaskModal', `mandate_id=${item.MandateId}`);
|
|
UnityAction.sendMsg('OpenTaskModal', `mandate_id=${item.MandateId}`);
|
|
|
|
+ run();
|
|
// }
|
|
// }
|
|
} else if (tab == '1') {
|
|
} else if (tab == '1') {
|
|
UnityAction.sendMsg('notiZiJian', item.PatrolId);
|
|
UnityAction.sendMsg('notiZiJian', item.PatrolId);
|
|
|
|
+ runSelf();
|
|
|
|
+ } else {
|
|
|
|
+ runWarning();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -84,7 +89,7 @@ const MessageCenter = () => {
|
|
<div className={styles.right}>
|
|
<div className={styles.right}>
|
|
<div
|
|
<div
|
|
className={
|
|
className={
|
|
- item?.ReadStatus ? styles.redPoint : styles.nonePoint
|
|
|
|
|
|
+ item.ReadStatus === 0 ? styles.redPoint : styles.nonePoint
|
|
}
|
|
}
|
|
/>
|
|
/>
|
|
<Button
|
|
<Button
|