seimin 1 год назад
Родитель
Сommit
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 85
       children: []
86 86
     },
87 87
     {
88
-      path: '/main/incidentNewList/:type/:status/:isToday?',
88
+      path: '/main/incidentNewList/:searchType/:searchState?/:belongtoMe?/:isToday?',
89 89
       name: 'IncidentNewList',
90 90
       component: IncidentNewList,
91 91
       meta: {

+ 29 - 19
src/views/IncidentNewList.vue

@@ -300,7 +300,6 @@ export default {
300 300
       searchsState:[],//状态列表
301 301
       searchType: "todo",
302 302
       searchState: 1544,
303
-      type: "todo",
304 303
       isToday: "",
305 304
       sum: 10,
306 305
       idx: 0,
@@ -826,20 +825,28 @@ export default {
826 825
       };
827 826
     },
828 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 851
     typeChange(tab) {
845 852
       this.tabTypeIdActive = tab.id;
@@ -898,13 +905,16 @@ export default {
898 905
         searchType: this.searchType,
899 906
         idx: 0,
900 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 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 918
         postData.incident.place = {
909 919
           area: this.evt.area
910 920
         }
@@ -957,16 +967,16 @@ export default {
957 967
         searchType: this.searchType,
958 968
         idx: this.idx,
959 969
         sum: this.sum,
960
-        belongtoMe: this.evt ? this.evt.belongtoMe : false,
961 970
         incident: {
971
+          belongtoMe: this.evt ? this.evt.belongtoMe : false,
962 972
           temporary: true,
963 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 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 980
         postData.incident.place = {
971 981
           area: this.evt.area
972 982
         }

+ 31 - 18
src/views/my.vue

@@ -39,44 +39,53 @@
39 39
       <div class="label">我的事件工单</div>
40 40
       <div class="tit">
41 41
         <div>全部</div>
42
-        <div @click="toIncidentList('all')">
43
-          {{ incidentCount.incidentAll || 0 }}条&nbsp;&nbsp;&nbsp;>
44
-        </div>
45 42
       </div>
46 43
       <div class="rapirMessage">
47
-        <div class="status" @click="toIncidentList('todo')">
44
+        <div class="status" @click="toIncidentList({searchState: 1543, searchType: 'todo', belongtoMe: false})">
48 45
           <div>
49 46
             <svg class="icon" aria-hidden="true">
50 47
               <use xlink:href="#icon-daishouli"></use>
51 48
             </svg>
52 49
           </div>
53 50
           <div>
54
-            <span>待处理</span>
55
-            <span>{{ incidentCount.incidentTodo || 0 }}</span>
51
+            <span>待接单</span>
52
+            <span>{{ incidentCount.todoCount || 0 }}</span>
56 53
           </div>
57 54
         </div>
58
-        <div class="status" @click="toIncidentList('done')">
55
+
56
+        <div class="status" @click="toIncidentList({searchState: 1544, searchType: 'todo', belongtoMe: false})">
59 57
           <div>
60 58
             <svg class="icon" aria-hidden="true">
61 59
               <use xlink:href="#icon-yijiejue"></use>
62 60
             </svg>
63 61
           </div>
64 62
           <div>
65
-            <span>处理</span>
66
-            <span>{{ incidentCount.incidentDone || 0 }}</span>
63
+            <span>处理</span>
64
+            <span>{{ incidentCount.doingCount || 0 }}</span>
67 65
           </div>
68 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 79
           <div>
71 80
             <svg class="icon" aria-hidden="true">
72 81
               <use xlink:href="#icon-daipingjia"></use>
73 82
             </svg>
74 83
           </div>
75 84
           <div>
76
-            <span>我创建</span>
77
-            <span>{{ incidentCount.incidentCreate || 0 }}</span>
85
+            <span>我处理的</span>
86
+            <span>{{ incidentCount.idoCount || 0 }}</span>
78 87
           </div>
79
-        </div> -->
88
+        </div>
80 89
       </div>
81 90
     </div>
82 91
     <div class="myRapir">
@@ -91,7 +100,6 @@
91 100
       </div>
92 101
       <div class="rapirMessage">
93 102
         <div class="status">
94
-          <!-- <div class="status" @click="toIncidentList(1594)"> -->
95 103
           <div>
96 104
             <svg class="icon" aria-hidden="true">
97 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 306
     toinspectionList(state) {