瀏覽代碼

我的页面统计

seimin 1 年之前
父節點
當前提交
1de40edb5a
共有 3 個文件被更改,包括 61 次插入38 次删除
  1. 1 1
      src/router/index.js
  2. 29 19
      src/views/IncidentNewList.vue
  3. 31 18
      src/views/my.vue

+ 1 - 1
src/router/index.js

@@ -85,7 +85,7 @@ export default new Router({
85
       children: []
85
       children: []
86
     },
86
     },
87
     {
87
     {
88
-      path: '/main/incidentNewList/:type/:status/:isToday?',
88
+      path: '/main/incidentNewList/:searchType/:searchState?/:belongtoMe?/:isToday?',
89
       name: 'IncidentNewList',
89
       name: 'IncidentNewList',
90
       component: IncidentNewList,
90
       component: IncidentNewList,
91
       meta: {
91
       meta: {

+ 29 - 19
src/views/IncidentNewList.vue

@@ -300,7 +300,6 @@ export default {
300
       searchsState:[],//状态列表
300
       searchsState:[],//状态列表
301
       searchType: "todo",
301
       searchType: "todo",
302
       searchState: 1544,
302
       searchState: 1544,
303
-      type: "todo",
304
       isToday: "",
303
       isToday: "",
305
       sum: 10,
304
       sum: 10,
306
       idx: 0,
305
       idx: 0,
@@ -826,20 +825,28 @@ export default {
826
       };
825
       };
827
     },
826
     },
828
     getParamsState() {
827
     getParamsState() {
829
-      if (this.$route.params.type) {
830
-        this.type = this.$route.params.type;
831
-        this.isToday = this.$route.params.isToday;
832
-        if (this.type === "todo") {
833
-          this.searchType = "todo";
834
-        } else if (this.type === "done") {
835
-          this.searchType = "done";
836
-        } else {
837
-          this.searchType = "all";
828
+      console.log(this.$route.params);
829
+
830
+      if(this.evt){
831
+        this.evt.selected = this.$route.params.searchType;
832
+        this.evt.belongtoMe = this.$route.params.belongtoMe;
833
+      }else{
834
+        this.evt = {
835
+          selected: this.$route.params.searchType,
836
+          belongtoMe: this.$route.params.belongtoMe,
838
         }
837
         }
839
       }
838
       }
840
-      if(this.$route.params.status){
841
-        this.searchState = this.$route.params.status ? Number(this.$route.params.status) : undefined;
839
+      this.searchType = this.$route.params.searchType;
840
+
841
+      this.searchState = this.$route.params.searchState;
842
+      if(this.$route.params.searchState === undefined){
843
+        this.tabTypeIdActive = 1;
844
+      }else if(this.$route.params.searchState === 1543){
845
+        this.tabTypeIdActive = 2;
846
+      }else if(this.$route.params.searchState === 1544){
847
+        this.tabTypeIdActive = 3;
842
       }
848
       }
849
+
843
     },
850
     },
844
     typeChange(tab) {
851
     typeChange(tab) {
845
       this.tabTypeIdActive = tab.id;
852
       this.tabTypeIdActive = tab.id;
@@ -898,13 +905,16 @@ export default {
898
         searchType: this.searchType,
905
         searchType: this.searchType,
899
         idx: 0,
906
         idx: 0,
900
         sum: 1,
907
         sum: 1,
901
-        belongtoMe: this.evt ? this.evt.belongtoMe : false,
902
-        incident: { temporary: true,statusId }
908
+        incident: {
909
+          belongtoMe: this.evt ? this.evt.belongtoMe : false,
910
+          temporary: true,
911
+          statusId
912
+        }
903
       };
913
       };
904
-      if(this.evt && this.evt.category.id){
914
+      if(this.evt && this.evt.category && this.evt.category.id){
905
         postData.incident.levelCategory = this.evt.category;
915
         postData.incident.levelCategory = this.evt.category;
906
       }
916
       }
907
-      if(this.evt && this.evt.area.id){
917
+      if(this.evt && this.evt.area && this.evt.area.id){
908
         postData.incident.place = {
918
         postData.incident.place = {
909
           area: this.evt.area
919
           area: this.evt.area
910
         }
920
         }
@@ -957,16 +967,16 @@ export default {
957
         searchType: this.searchType,
967
         searchType: this.searchType,
958
         idx: this.idx,
968
         idx: this.idx,
959
         sum: this.sum,
969
         sum: this.sum,
960
-        belongtoMe: this.evt ? this.evt.belongtoMe : false,
961
         incident: {
970
         incident: {
971
+          belongtoMe: this.evt ? this.evt.belongtoMe : false,
962
           temporary: true,
972
           temporary: true,
963
           statusId:this.searchState || undefined,
973
           statusId:this.searchState || undefined,
964
         }
974
         }
965
       };
975
       };
966
-      if(this.evt && this.evt.category.id){
976
+      if(this.evt && this.evt.category && this.evt.category.id){
967
         postData.incident.levelCategory = this.evt.category;
977
         postData.incident.levelCategory = this.evt.category;
968
       }
978
       }
969
-      if(this.evt && this.evt.area.id){
979
+      if(this.evt && this.evt.area && this.evt.area.id){
970
         postData.incident.place = {
980
         postData.incident.place = {
971
           area: this.evt.area
981
           area: this.evt.area
972
         }
982
         }

+ 31 - 18
src/views/my.vue

@@ -39,44 +39,53 @@
39
       <div class="label">我的事件工单</div>
39
       <div class="label">我的事件工单</div>
40
       <div class="tit">
40
       <div class="tit">
41
         <div>全部</div>
41
         <div>全部</div>
42
-        <div @click="toIncidentList('all')">
43
-          {{ incidentCount.incidentAll || 0 }}条&nbsp;&nbsp;&nbsp;>
44
-        </div>
45
       </div>
42
       </div>
46
       <div class="rapirMessage">
43
       <div class="rapirMessage">
47
-        <div class="status" @click="toIncidentList('todo')">
44
+        <div class="status" @click="toIncidentList({searchState: 1543, searchType: 'todo', belongtoMe: false})">
48
           <div>
45
           <div>
49
             <svg class="icon" aria-hidden="true">
46
             <svg class="icon" aria-hidden="true">
50
               <use xlink:href="#icon-daishouli"></use>
47
               <use xlink:href="#icon-daishouli"></use>
51
             </svg>
48
             </svg>
52
           </div>
49
           </div>
53
           <div>
50
           <div>
54
-            <span>待处理</span>
55
-            <span>{{ incidentCount.incidentTodo || 0 }}</span>
51
+            <span>待接单</span>
52
+            <span>{{ incidentCount.todoCount || 0 }}</span>
56
           </div>
53
           </div>
57
         </div>
54
         </div>
58
-        <div class="status" @click="toIncidentList('done')">
55
+
56
+        <div class="status" @click="toIncidentList({searchState: 1544, searchType: 'todo', belongtoMe: false})">
59
           <div>
57
           <div>
60
             <svg class="icon" aria-hidden="true">
58
             <svg class="icon" aria-hidden="true">
61
               <use xlink:href="#icon-yijiejue"></use>
59
               <use xlink:href="#icon-yijiejue"></use>
62
             </svg>
60
             </svg>
63
           </div>
61
           </div>
64
           <div>
62
           <div>
65
-            <span>处理</span>
66
-            <span>{{ incidentCount.incidentDone || 0 }}</span>
63
+            <span>处理</span>
64
+            <span>{{ incidentCount.doingCount || 0 }}</span>
67
           </div>
65
           </div>
68
         </div>
66
         </div>
69
-        <!-- <div class="status" @click="toIncidentList('create')">
67
+        <div class="status" @click="toIncidentList({searchState: undefined, searchType: 'done', belongtoMe: false})">
68
+          <div>
69
+            <svg class="icon" aria-hidden="true">
70
+              <use xlink:href="#icon-chulizhong"></use>
71
+            </svg>
72
+          </div>
73
+          <div>
74
+            <span>与我关联</span>
75
+            <span>{{ incidentCount.irelateCount || 0 }}</span>
76
+          </div>
77
+        </div>
78
+        <div class="status" @click="toIncidentList({searchState: undefined, searchType: 'done', belongtoMe: true})">
70
           <div>
79
           <div>
71
             <svg class="icon" aria-hidden="true">
80
             <svg class="icon" aria-hidden="true">
72
               <use xlink:href="#icon-daipingjia"></use>
81
               <use xlink:href="#icon-daipingjia"></use>
73
             </svg>
82
             </svg>
74
           </div>
83
           </div>
75
           <div>
84
           <div>
76
-            <span>我创建</span>
77
-            <span>{{ incidentCount.incidentCreate || 0 }}</span>
85
+            <span>我处理的</span>
86
+            <span>{{ incidentCount.idoCount || 0 }}</span>
78
           </div>
87
           </div>
79
-        </div> -->
88
+        </div>
80
       </div>
89
       </div>
81
     </div>
90
     </div>
82
     <div class="myRapir">
91
     <div class="myRapir">
@@ -91,7 +100,6 @@
91
       </div>
100
       </div>
92
       <div class="rapirMessage">
101
       <div class="rapirMessage">
93
         <div class="status">
102
         <div class="status">
94
-          <!-- <div class="status" @click="toIncidentList(1594)"> -->
95
           <div>
103
           <div>
96
             <svg class="icon" aria-hidden="true">
104
             <svg class="icon" aria-hidden="true">
97
               <use xlink:href="#icon-chulizhong"></use>
105
               <use xlink:href="#icon-chulizhong"></use>
@@ -284,10 +292,15 @@ export default {
284
       );
292
       );
285
     },
293
     },
286
     // 跳转到事件列表
294
     // 跳转到事件列表
287
-    toIncidentList(searchType) {
288
-      if(!(searchType === 'all' && !this.isAll)){
289
-        this.$router.push({ path: "/main/incidentList/" + searchType + '/0' });
290
-      }
295
+    toIncidentList(data) {
296
+      this.$router.push({
297
+        name: "IncidentNewList",
298
+        params: {
299
+          searchType: data.searchType,
300
+          searchState: data.searchState,
301
+          belongtoMe: data.belongtoMe,
302
+        },
303
+      });
291
     },
304
     },
292
     // 巡检列表
305
     // 巡检列表
293
     toinspectionList(state) {
306
     toinspectionList(state) {