wenhongquan 3 years ago
parent
commit
4f72121c88
4 changed files with 41 additions and 31 deletions
  1. 1 1
      index.html
  2. 29 29
      public/login.js
  3. 1 0
      src/api/incident.ts
  4. 10 1
      src/views/IncidentDetail/WzCard/index.tsx

+ 1 - 1
index.html

@@ -13,7 +13,7 @@
     <script src="./lib/md5.js"></script>
     <script src="./lib/jsencrypt.min.js"></script>
     <!-- <script src="./flexible.js"></script> -->
-    <script src="./login.js?time=1"></script>
+    <script src="./login.js?time=2"></script>
     <script src="./webClient/defaultConfig.js?time=111"></script>
     <script src="./webClient/initWebSocket.js?time=111"></script>
     <script src="./webClient/webClient_initWnd.js?time=114"></script>

+ 29 - 29
public/login.js

@@ -42,35 +42,35 @@ Package.prototype = {
 
         let _t = this;
         if (localStorage.getItem("token")) {
-            $.ajax({
-                type: 'PUT',
-                url: this.settings.URL + '/videoService/accounts/token/keepalive',
-                contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
-                dateType: 'json',
-                data: JSON.stringify({
-                    token: localStorage.getItem('token'),
-                    duration: 86400,
-                }),
-                beforeSend: function(xhr) {
-                    xhr.setRequestHeader(
-                        'X-Subject-Token',
-                        localStorage.getItem('token'),
-                    );
-                    xhr.setRequestHeader(
-                        'Content-Type',
-                        'application/json;charset=UTF-8',
-                    );
-                },
-                success: function(jsonResult) {
-                    // setTimeout(function() {
-                    //     _t.keepalive();
-                    // }, 20000);
-                },
-                error: function(data) {
-                    localStorage.removeItem('token');
-                    _t.login();
-                },
-            });
+            // $.ajax({
+            //     type: 'PUT',
+            //     url: this.settings.URL + '/videoService/accounts/token/keepalive',
+            //     contentType: 'application/json', //如果提交的是json数据类型,则必须有此参数,表示提交的数据类型
+            //     dateType: 'json',
+            //     data: JSON.stringify({
+            //         token: localStorage.getItem('token'),
+            //         duration: 86400,
+            //     }),
+            //     beforeSend: function(xhr) {
+            //         xhr.setRequestHeader(
+            //             'X-Subject-Token',
+            //             localStorage.getItem('token'),
+            //         );
+            //         xhr.setRequestHeader(
+            //             'Content-Type',
+            //             'application/json;charset=UTF-8',
+            //         );
+            //     },
+            //     success: function(jsonResult) {
+            //         // setTimeout(function() {
+            //         //     _t.keepalive();
+            //         // }, 20000);
+            //     },
+            //     error: function(data) {
+            //         localStorage.removeItem('token');
+            //         _t.login();
+            //     },
+            // });
         } else {
             setTimeout(() => {
                 _t.login();

+ 1 - 0
src/api/incident.ts

@@ -106,6 +106,7 @@ export interface IncidentItemDetail {
   task?: IncidentItemDetailTaskItem[]; // 处置任务
   baseTask?: Map<string, IncidentItemEmergencyPlan[]>;
   resource?: wz[];
+  resourceSendTime?:string;
 }
 export interface IncidentItemDetailResponse extends BaseResponse {
   data: IncidentItemDetail;

+ 10 - 1
src/views/IncidentDetail/WzCard/index.tsx

@@ -6,6 +6,7 @@ import emitter from '@/utils/mitt';
 
 // @ts-ignore
 import IconLevel from '@/assets/icons/detail/level@2x.png';
+import moment from 'moment';
 
 
 
@@ -49,7 +50,15 @@ export default defineComponent({
                   {i.name}
                 </div>
                 <div style="flex-basis: 17%;">{i.num}</div>
-                <div style="flex-basis: 17%;">{i.availablenum}</div>
+                <div style="flex-basis: 17%;">
+                  {store.incidentDetail.resourceSendTime == null
+                    ? '无'
+                    : moment(store.incidentDetail.resourceSendTime).valueOf() -
+                        moment(i.time).valueOf() >
+                      0
+                    ? '未更新'
+                    : i.availablenum}
+                </div>
                 <div style="flex-basis: 8%;">{i.unit}</div>
                 <div style="flex-basis: 30%;text-align: left;">{i.time}</div>
               </div>