소스 검색

修改样式

Renxy 1 년 전
부모
커밋
ddf7fe416e
5개의 변경된 파일34개의 추가작업 그리고 14개의 파일을 삭제
  1. 1 0
      src/global.less
  2. 14 2
      src/pages/EqSelfInspection/index.js
  3. 5 2
      src/pages/Menu/index.less
  4. 2 2
      src/pages/MessageCenter/index.js
  5. 12 8
      src/utils/utils.js

+ 1 - 0
src/global.less

@@ -198,6 +198,7 @@ input[type='reset'] {
   }
   .tabs-item {
     flex: 1;
+    text-align: center;
     padding: 0.16rem 0.24rem;
     font-size: 0.24rem;
     font-weight: 400;

+ 14 - 2
src/pages/EqSelfInspection/index.js

@@ -91,6 +91,12 @@ const EqSelfInspection = (props) => {
       message.info('未查询到相关任务');
     }
   };
+  //消息跳转过来近具体自检报告详情页面
+  const handleJumpDetail = (id) => {
+    history.push(
+      `/self-inspection/detail/${projectId}/${id}?JWT-TOKEN=${GetTokenFromUrl()}`,
+    );
+  };
 
   useEffect(() => {
     if (routeId) {
@@ -110,6 +116,12 @@ const EqSelfInspection = (props) => {
         ProjectId: projectId * 1,
       },
     });
+
+    UnityAction.on('notiZiJian', (id) => {
+      handleJumpDetail(id);
+    });
+
+    return UnityAction.off('notiZiJian');
   }, []);
 
   useEffect(() => {
@@ -128,7 +140,7 @@ const EqSelfInspection = (props) => {
             className={`${styles.itemMain} card-box`}
             style={{ padding: '0.2rem 0.24rem', position: 'relative' }}
           >
-            <div style={{ fontSize: "0.28rem", color: 'rgb(110, 110, 110)' }}>
+            <div style={{ fontSize: '0.28rem', color: 'rgb(110, 110, 110)' }}>
               自检间隔:{autoReport?.RouteInfo?.PlanDur}分钟
             </div>
 
@@ -284,7 +296,7 @@ const Item = (props) => {
   };
   return (
     <div className={`${styles.itemMain} card-box`}>
-      <div className={styles.item} style={{ height: children ? "0.8rem" : '' }}>
+      <div className={styles.item} style={{ height: children ? '0.8rem' : '' }}>
         <span className={styles.itemName}>{name}</span>
         {/* <span className={styles.warningText}>{warningText}</span> */}
         {renderRight(status)}

+ 5 - 2
src/pages/Menu/index.less

@@ -1,12 +1,15 @@
 .main {
+  margin: 1rem 0;
   float: right;
-  width: 1.98rem;
-  height: 100vh;
+  width: 1.89rem;
+  height: calc(100vh - 2rem);
   display: flex;
   flex-direction: column;
   align-items: flex-end;
   background: url('@/assets/menu/right_bg.png') no-repeat center;
   background-size: 100% 100%;
+  border-radius: 0.74rem 0 0 0.74rem;
+  box-shadow: 0.03rem 0.49rem 1rem 0rem rgba(60, 93, 133, 0.72);
 }
 .menu {
   width: 100%;

+ 2 - 2
src/pages/MessageCenter/index.js

@@ -12,7 +12,7 @@ const icon2 = require('@/assets/message/check.png');
 
 const MessageCenter = () => {
   const { projectId } = useParams();
-  const [tab, setTab] = useState('1');
+  const [tab, setTab] = useState('2');
   //, msgType: 工况:11, 自检:12
   const { data, run, loading } = useRequest(() =>
     getNotificationList({ projectId, msgType: 11 }),
@@ -75,7 +75,7 @@ const MessageCenter = () => {
     <PageContent tabs>
       <TabsContent
         center={false}
-        defaultActiveKey="1"
+        defaultActiveKey="2"
         onChange={handleTabsChange}
         items={[
           {

+ 12 - 8
src/utils/utils.js

@@ -1,9 +1,8 @@
-
 export const clearToken = () => {
   localStorage.setItem('JWT-TOKEN', '');
 };
 
-export const storeToken = token => {
+export const storeToken = (token) => {
   localStorage.setItem('JWT-TOKEN', token);
 };
 
@@ -19,7 +18,6 @@ export const getToken = () => {
  * <a href="url" download/>
  */
 export const downloadFile = (url, fileName, encode = true) => {
-  
   const downloadLink = document.createElement('a');
   const body = document.documentElement || document.body;
   body.appendChild(downloadLink);
@@ -48,7 +46,9 @@ export function IsImageFile(fileName) {
 }
 
 export function IsVedio(fileName) {
-  return fileName.lastIndexOf('.mp4') !== -1 || fileName.lastIndexOf('.avi') !== -1;
+  return (
+    fileName.lastIndexOf('.mp4') !== -1 || fileName.lastIndexOf('.avi') !== -1
+  );
 }
 
 export function GetTokenFromUrl() {
@@ -95,7 +95,7 @@ export function getUser(params) {
     return;
   } else {
     return (arr = params
-      .map(item => {
+      .map((item) => {
         return item.Operator?.CName;
       })
       .join(','));
@@ -123,7 +123,7 @@ export const UnityAction = {
   emit(type, e) {
     if (!UnityAction.event[type]) return;
     console.log('emit====== type:', type, '====== event:', e);
-    UnityAction.event[type].forEach(item => {
+    UnityAction.event[type].forEach((item) => {
       item && item(e);
     });
   },
@@ -144,9 +144,13 @@ export const UnityAction = {
     }
   },
 };
+// alert(window.vuplex);
 if (window.vuplex) {
-  window.vuplex.addEventListener('message', e => {
-    console.log('============================getMessageForUnity============================');
+  window.vuplex.addEventListener('message', (e) => {
+    // alert('99999999');
+    console.log(
+      '============================getMessageForUnity============================',
+    );
     const data = JSON.parse(e.data);
     console.log(data);
     UnityAction.emit(data.type, data.message);