seimin пре 2 година
родитељ
комит
1e598ef103
2 измењених фајлова са 271 додато и 228 уклоњено
  1. 31 31
      src/views/Login.vue
  2. 240 197
      src/views/newIncident.vue

+ 31 - 31
src/views/Login.vue

@@ -49,29 +49,29 @@ export default {
49 49
       this.$http
50 50
         .post("/service/sysinfo/data/fetchDataList/systemConfiguration", {
51 51
           idx: 0,
52
-          sum: 1000,
52
+          sum: 1000
53 53
         })
54
-        .then((res) => {
54
+        .then(res => {
55 55
           let list = res.data.list;
56
-          let repairMain = list.find((v) => v.keyconfig == "repairMain"); //报修主体
57
-          let incidentWithConsumable = list.find(
58
-            (v) => v.keyconfig == "incidentWithConsumable"
59
-          ); //是否绑定耗材
60
-          let wxIncidentWithCmdb = list.find(
61
-            (v) => v.keyconfig == "wxIncidentWithCmdb"
62
-          ); //是否绑定资产
63
-          localStorage.setItem(
64
-            "valConfig",
65
-            JSON.stringify(repairMain.valueconfig)
66
-          );
67
-          localStorage.setItem(
68
-            "incidentWithConsumable",
69
-            incidentWithConsumable.valueconfig
70
-          );
71
-          localStorage.setItem(
72
-            "wxIncidentWithCmdb",
73
-            wxIncidentWithCmdb.valueconfig
74
-          );
56
+          list.forEach(v => {
57
+            switch (v.keyconfig) {
58
+              case "repairMain": //报修主体
59
+                localStorage.setItem(
60
+                  "valConfig",
61
+                  JSON.stringify(v.valueconfig)
62
+                );
63
+                break;
64
+              case "incidentWithConsumable": //是否绑定耗材
65
+                localStorage.setItem("incidentWithConsumable", v.valueconfig);
66
+                break;
67
+              case "wxIncidentWithCmdb": //是否绑定资产
68
+                localStorage.setItem("wxIncidentWithCmdb", v.valueconfig);
69
+                break;
70
+              case "ifRoom": //是否增加房间号选择
71
+                localStorage.setItem("ifRoom", v.valueconfig);
72
+                break;
73
+            }
74
+          });
75 75
           this.$router.push({ path: "/main" });
76 76
         });
77 77
     },
@@ -134,7 +134,7 @@ export default {
134 134
     // 登陆
135 135
     login() {
136 136
       var that = this;
137
-      that.$http.post("service/auth/wechatAuth", {}).then((res) => {
137
+      that.$http.post("service/auth/wechatAuth", {}).then(res => {
138 138
         if (res.data.url) {
139 139
           window.location.href = res.data.url;
140 140
         } else {
@@ -160,9 +160,9 @@ export default {
160 160
         that.login();
161 161
       } else {
162 162
         var code = {
163
-          code: url[1],
163
+          code: url[1]
164 164
         };
165
-        that.$http.post("service/auth/wechatLoginEncrypt", code).then((res) => {
165
+        that.$http.post("service/auth/wechatLoginEncrypt", code).then(res => {
166 166
           if (res.data.state == 200) {
167 167
             if (res.data.user) {
168 168
               localStorage.setItem(
@@ -197,18 +197,18 @@ export default {
197 197
     },
198 198
     // 获取查询参数
199 199
     getQueryString(name) {
200
-    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
201
-    var r = window.location.search.substr(1).match(reg);
202
-    if (r != null){
200
+      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
201
+      var r = window.location.search.substr(1).match(reg);
202
+      if (r != null) {
203 203
         return unescape(r[2]);
204 204
       }
205 205
       return null;
206
-    },
206
+    }
207 207
   },
208 208
   created() {
209
-    if(location.search.length > 0){
210
-      this.isSSo = Boolean(this.getQueryString('t'));
211
-    }else{
209
+    if (location.search.length > 0) {
210
+      this.isSSo = Boolean(this.getQueryString("t"));
211
+    } else {
212 212
       this.isSSo = false;
213 213
     }
214 214
     if (this.isSSo) {

Разлика између датотеке није приказан због своје велике величине
+ 240 - 197
src/views/newIncident.vue