Parcourir la source

增加房间号

seimin il y a 3 ans
Parent
commit
ad40dcb589
9 fichiers modifiés avec 455 ajouts et 194 suppressions
  1. 0 0
      imgs/logo_default.png
  2. BIN
      imgs/logo_hk.png
  3. 0 0
      imgs/logo_zuel.png
  4. 148 69
      index.html
  5. 129 46
      js/index.js
  6. 71 45
      js/login.js
  7. 63 34
      login.html
  8. 1 0
      package.json
  9. 43 0
      upload/development110.js

imgs/logo.png → imgs/logo_default.png


BIN
imgs/logo_hk.png


imgs/logo--.png → imgs/logo_zuel.png


+ 148 - 69
index.html

@@ -1,11 +1,10 @@
1 1
 <!DOCTYPE html>
2 2
 <html lang="zh-cn">
3
-  <head>
3
+  <head id="head">
4 4
     <meta charset="UTF-8" />
5 5
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6 6
     <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
7 7
     <title>报修平台</title>
8
-    <link rel="icon" type="image/png" sizes="32x32" href="/imgs/logo.png" />
9 8
     <script src="./js/isLogin.js"></script>
10 9
     <link rel="stylesheet" href="./css/base.css" />
11 10
     <link rel="stylesheet" href="./css/index.css" />
@@ -19,12 +18,7 @@
19 18
 
20 19
   <body>
21 20
     <header class="clearfix">
22
-      <div class="fl logo">
23
-        <img src="./imgs/logo.png" alt="" />
24
-        <span>报修平台</span>
25
-        <span class="line">|</span>
26
-        <span>网络与信息运维服务平台</span>
27
-      </div>
21
+      <div class="fl logo" id="logo"></div>
28 22
       <div class="fr logOut">
29 23
         <span class="user"></span>
30 24
         <span class="down"></span>
@@ -110,26 +104,7 @@
110 104
                 />
111 105
               </div>
112 106
             </div>
113
-            <!-- 区域地点 -->
114
-            <div class="formItem">
115
-              <div class="label"><span class="required">*</span>区域地点:</div>
116
-              <div>
117
-                <div class="areaplace">
118
-                  <div class="areaBox clearfix">
119
-                    <select
120
-                      class="fl"
121
-                      id="area_list"
122
-                      style="font-size: 12px"
123
-                    ></select>
124
-                    <select
125
-                      class="fr"
126
-                      id="place_list"
127
-                      style="font-size: 12px"
128
-                    ></select>
129
-                  </div>
130
-                </div>
131
-              </div>
132
-            </div>
107
+            <div id="areaPlaceRoom"></div>
133 108
             <!-- 详细地址 -->
134 109
             <div class="formItem">
135 110
               <div class="label"><span class="required">*</span>详细地址:</div>
@@ -235,9 +210,86 @@
235 210
   <script src="./libs/es5-sham.min.js"></script>
236 211
   <script src="./libs/json3.min.js"></script>
237 212
   <script src="./libs/template-web.min.js"></script>
213
+  <!-- areaPlaceRoom -->
214
+  <script id="areaPlaceRoom_temp" type="text/html">
215
+    {{if ifRoom == 1}}
216
+    <!-- 区域地点房间号 -->
217
+    <div class="formItem">
218
+      <div class="label"><span class="required">*</span>区域地点房间号:</div>
219
+      <div>
220
+        <div class="areaplace">
221
+          <div class="areaBox clearfix">
222
+            <select
223
+              class="fl"
224
+              id="area_list"
225
+              style="font-size: 12px;width: 115px;margin-right: 8px;"
226
+            ></select>
227
+            <select
228
+              class="fl"
229
+              id="place_list"
230
+              style="font-size: 12px;width: 115px;margin-right: 8px;"
231
+            ></select>
232
+            <select
233
+              class="fr"
234
+              id="room_list"
235
+              style="font-size: 12px;width: 115px;"
236
+            ></select>
237
+          </div>
238
+        </div>
239
+      </div>
240
+    </div>
241
+    {{else}}
242
+    <!-- 区域地点 -->
243
+    <div class="formItem">
244
+      <div class="label"><span class="required">*</span>区域地点:</div>
245
+      <div>
246
+        <div class="areaplace">
247
+          <div class="areaBox clearfix">
248
+            <select class="fl" id="area_list" style="font-size: 12px"></select>
249
+            <select class="fr" id="place_list" style="font-size: 12px"></select>
250
+          </div>
251
+        </div>
252
+      </div>
253
+    </div>
254
+    {{/if}}
255
+  </script>
256
+  <!-- favicon -->
257
+  <script id="favicon_temp" type="text/html">
258
+    {{if isVersion === 'isZncd'}}
259
+    <link
260
+      rel="icon"
261
+      type="image/png"
262
+      sizes="32x32"
263
+      href="/imgs/logo_zuel.png"
264
+    />
265
+    {{else if isVersion === 'isHk'}}
266
+    <link rel="icon" type="image/png" sizes="32x32" href="/imgs/logo_hk.png" />
267
+    {{else}}
268
+    <link
269
+      rel="icon"
270
+      type="image/png"
271
+      sizes="32x32"
272
+      href="/imgs/logo_default.png"
273
+    />
274
+    {{/if}}
275
+  </script>
276
+  <!-- logo -->
277
+  <script id="logo_temp" type="text/html">
278
+    {{if isVersion === 'isZncd'}}
279
+    <img src="./imgs/logo_zuel.png" alt="" />
280
+    {{else if isVersion === 'isHk'}}
281
+    <img src="./imgs/logo_hk.png" alt="" />
282
+    {{else}}
283
+    <img src="./imgs/logo_default.png" alt="" />
284
+    {{/if}}
285
+    <span>报修平台</span>
286
+    <span class="line">|</span>
287
+    <span>网络与信息运维服务平台</span>
288
+  </script>
238 289
   <!-- demo -->
239 290
   <script id="demo_temp" type="text/html">
240
-    {{if account === 'ITIL_test2'||account === 'Z0003865'||account === 'wangyaxiang'||account === 'Z0004571'}}
291
+    {{if account === 'ITIL_test2'||account === 'Z0003865'||account ===
292
+    'wangyaxiang'||account === 'Z0004571'}}
241 293
     <div class="opcBg_item fl active">
242 294
       <i class="iconfont dsit-wodebaoxiu"></i> 最新报修
243 295
     </div>
@@ -245,7 +297,10 @@
245 297
       <i class="iconfont dsit-sousuo"></i> 电话查号
246 298
     </div>
247 299
     {{else}}
248
-    <div class="opcBg_item fl" style="width: 100%;padding-left: 16px;text-align: left;">
300
+    <div
301
+      class="opcBg_item fl"
302
+      style="width: 100%;padding-left: 16px;text-align: left;"
303
+    >
249 304
       <i class="iconfont dsit-wodebaoxiu"></i> 最新报修
250 305
     </div>
251 306
     {{/if}}
@@ -374,6 +429,12 @@
374 429
     <option value="{{$value.id}}">{{$value.place}}</option>
375 430
     {{/each}}
376 431
   </script>
432
+  <!-- 房间号 -->
433
+  <script id="room_list_temp" type="text/html">
434
+    {{each list}}
435
+    <option value="{{$value.id}}">{{$value.room}}</option>
436
+    {{/each}}
437
+  </script>
377 438
   <!-- 最新报修列表 -->
378 439
   <script id="bx_list_temp" type="text/html">
379 440
     {{if data.length == 0}}
@@ -572,20 +633,14 @@
572 633
       <img src="./imgs/img_wubaoxiu.png" alt="" />
573 634
       <p>暂无数据</p>
574 635
     </li>
575
-    {{else}}
576
-    {{each list}}
636
+    {{else}} {{each list}}
577 637
     <li class="r-item hauto">
578 638
       <div class="r-item-title twoline"><span>{{$value.dept}}</span></div>
579
-      <p class="r-item-content hauto">
580
-        单位名称:{{$value.unit.unit}}
581
-      </p>
639
+      <p class="r-item-content hauto">单位名称:{{$value.unit.unit}}</p>
582 640
       <p class="r-item-content hauto">单位电话:{{$value.phone}}</p>
583
-      <p class="r-item-content hauto">
584
-        办公地址:{{$value.address}}
585
-      </p>
641
+      <p class="r-item-content hauto">办公地址:{{$value.address}}</p>
586 642
     </li>
587
-    {{/each}}
588
-    {{/if}}
643
+    {{/each}} {{/if}}
589 644
   </script>
590 645
   <!-- 电话查号列表 -->
591 646
   <script id="ch_search_list_temp" type="text/html">
@@ -594,27 +649,19 @@
594 649
       <img src="./imgs/img_wubaoxiu.png" alt="" />
595 650
       <p>暂无数据</p>
596 651
     </li>
597
-    {{else}}
598
-    {{each list}}
652
+    {{else}} {{each list}}
599 653
     <li class="r-item hauto clearfix ch-search">
600 654
       <i class="iconfont dsit-sousuo r-icon"></i>
601 655
       <div class="r-icon-search">
602 656
         {{if $value.unit.id}}
603
-        <p class="r-item-content hauto">
604
-          单位:{{$value.unit.unit}}
605
-        </p>
606
-        <p class="r-item-content hauto">
607
-          部门:{{$value.dept}}
608
-        </p>
657
+        <p class="r-item-content hauto">单位:{{$value.unit.unit}}</p>
658
+        <p class="r-item-content hauto">部门:{{$value.dept}}</p>
609 659
         {{else}}
610
-        <p class="r-item-content hauto">
611
-          单位:{{$value.unit}}
612
-        </p>
660
+        <p class="r-item-content hauto">单位:{{$value.unit}}</p>
613 661
         {{/if}}
614 662
       </div>
615 663
     </li>
616
-    {{/each}}
617
-    {{/if}}
664
+    {{/each}} {{/if}}
618 665
   </script>
619 666
   <!-- 申请(1)详情 -->
620 667
   <script id="bx1_detail_temp" type="text/html">
@@ -636,7 +683,8 @@
636 683
           </li>
637 684
           {{if incident.category}}
638 685
           <li class="pop1-hd__itemList">
639
-            <strong>报修类别:</strong><span>{{incident.category.category}}</span>
686
+            <strong>报修类别:</strong
687
+            ><span>{{incident.category.category}}</span>
640 688
           </li>
641 689
           {{/if}}
642 690
           <li class="pop1-hd__itemList">
@@ -652,7 +700,10 @@
652 700
           </li>
653 701
           <li class="pop1-hd__itemList">
654 702
             <strong>报修地址:</strong>
655
-            <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
703
+            <span
704
+              >{{incident.place ? incident.place.area.area +
705
+              incident.place.place : ''}}{{address}}</span
706
+            >
656 707
           </li>
657 708
           {{if wxIncidentWithCmdb == 1}}
658 709
           <li class="pop1-hd__itemList">
@@ -744,7 +795,8 @@
744 795
           </li>
745 796
           {{if incident.category}}
746 797
           <li class="pop1-hd__itemList">
747
-            <strong>报修类别:</strong><span>{{incident.category.category}}</span>
798
+            <strong>报修类别:</strong
799
+            ><span>{{incident.category.category}}</span>
748 800
           </li>
749 801
           {{/if}}
750 802
           <li class="pop1-hd__itemList">
@@ -760,7 +812,10 @@
760 812
           </li>
761 813
           <li class="pop1-hd__itemList">
762 814
             <strong>报修地址:</strong>
763
-            <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
815
+            <span
816
+              >{{incident.place ? incident.place.area.area +
817
+              incident.place.place : ''}}{{address}}</span
818
+            >
764 819
           </li>
765 820
           {{if wxIncidentWithCmdb == 1}}
766 821
           <li class="pop1-hd__itemList">
@@ -858,7 +913,8 @@
858 913
           </li>
859 914
           {{if incident.category}}
860 915
           <li class="pop1-hd__itemList">
861
-            <strong>报修类别:</strong><span>{{incident.category.category}}</span>
916
+            <strong>报修类别:</strong
917
+            ><span>{{incident.category.category}}</span>
862 918
           </li>
863 919
           {{/if}}
864 920
           <li class="pop1-hd__itemList">
@@ -874,7 +930,10 @@
874 930
           </li>
875 931
           <li class="pop1-hd__itemList">
876 932
             <strong>报修地址:</strong>
877
-            <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
933
+            <span
934
+              >{{incident.place ? incident.place.area.area +
935
+              incident.place.place : ''}}{{address}}</span
936
+            >
878 937
           </li>
879 938
           {{if wxIncidentWithCmdb == 1}}
880 939
           <li class="pop1-hd__itemList">
@@ -978,7 +1037,8 @@
978 1037
           </li>
979 1038
           {{if incident.category}}
980 1039
           <li class="pop1-hd__itemList">
981
-            <strong>报修类别:</strong><span>{{incident.category.category}}</span>
1040
+            <strong>报修类别:</strong
1041
+            ><span>{{incident.category.category}}</span>
982 1042
           </li>
983 1043
           {{/if}}
984 1044
           <li class="pop1-hd__itemList">
@@ -994,7 +1054,10 @@
994 1054
           </li>
995 1055
           <li class="pop1-hd__itemList">
996 1056
             <strong>报修地址:</strong>
997
-            <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
1057
+            <span
1058
+              >{{incident.place ? incident.place.area.area +
1059
+              incident.place.place : ''}}{{address}}</span
1060
+            >
998 1061
           </li>
999 1062
           {{if wxIncidentWithCmdb == 1}}
1000 1063
           <li class="pop1-hd__itemList">
@@ -1104,7 +1167,8 @@
1104 1167
           </li>
1105 1168
           {{if incident.category}}
1106 1169
           <li class="pop1-hd__itemList">
1107
-            <strong>报修类别:</strong><span>{{incident.category.category}}</span>
1170
+            <strong>报修类别:</strong
1171
+            ><span>{{incident.category.category}}</span>
1108 1172
           </li>
1109 1173
           {{/if}}
1110 1174
           <li class="pop1-hd__itemList">
@@ -1120,7 +1184,10 @@
1120 1184
           </li>
1121 1185
           <li class="pop1-hd__itemList">
1122 1186
             <strong>报修地址:</strong>
1123
-            <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
1187
+            <span
1188
+              >{{incident.place ? incident.place.area.area +
1189
+              incident.place.place : ''}}{{address}}</span
1190
+            >
1124 1191
           </li>
1125 1192
           {{if wxIncidentWithCmdb == 1}}
1126 1193
           <li class="pop1-hd__itemList">
@@ -1228,7 +1295,8 @@
1228 1295
           </li>
1229 1296
           {{if incident.category}}
1230 1297
           <li class="pop1-hd__itemList">
1231
-            <strong>报修类别:</strong><span>{{incident.category.category}}</span>
1298
+            <strong>报修类别:</strong
1299
+            ><span>{{incident.category.category}}</span>
1232 1300
           </li>
1233 1301
           {{/if}}
1234 1302
           <li class="pop1-hd__itemList">
@@ -1244,7 +1312,10 @@
1244 1312
           </li>
1245 1313
           <li class="pop1-hd__itemList">
1246 1314
             <strong>报修地址:</strong>
1247
-            <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
1315
+            <span
1316
+              >{{incident.place ? incident.place.area.area +
1317
+              incident.place.place : ''}}{{address}}</span
1318
+            >
1248 1319
           </li>
1249 1320
           {{if wxIncidentWithCmdb == 1}}
1250 1321
           <li class="pop1-hd__itemList">
@@ -1352,7 +1423,8 @@
1352 1423
           </li>
1353 1424
           {{if incident.category}}
1354 1425
           <li class="pop1-hd__itemList">
1355
-            <strong>报修类别:</strong><span>{{incident.category.category}}</span>
1426
+            <strong>报修类别:</strong
1427
+            ><span>{{incident.category.category}}</span>
1356 1428
           </li>
1357 1429
           {{/if}}
1358 1430
           <li class="pop1-hd__itemList">
@@ -1368,7 +1440,10 @@
1368 1440
           </li>
1369 1441
           <li class="pop1-hd__itemList">
1370 1442
             <strong>报修地址:</strong>
1371
-            <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
1443
+            <span
1444
+              >{{incident.place ? incident.place.area.area +
1445
+              incident.place.place : ''}}{{address}}</span
1446
+            >
1372 1447
           </li>
1373 1448
           {{if wxIncidentWithCmdb == 1}}
1374 1449
           <li class="pop1-hd__itemList">
@@ -1550,7 +1625,8 @@
1550 1625
           </li>
1551 1626
           {{if incident.category}}
1552 1627
           <li class="pop1-hd__itemList">
1553
-            <strong>报修类别:</strong><span>{{incident.category.category}}</span>
1628
+            <strong>报修类别:</strong
1629
+            ><span>{{incident.category.category}}</span>
1554 1630
           </li>
1555 1631
           {{/if}}
1556 1632
           <li class="pop1-hd__itemList">
@@ -1566,7 +1642,10 @@
1566 1642
           </li>
1567 1643
           <li class="pop1-hd__itemList">
1568 1644
             <strong>报修地址:</strong>
1569
-            <span>{{incident.place ? incident.place.area.area + incident.place.place : ''}}{{address}}</span>
1645
+            <span
1646
+              >{{incident.place ? incident.place.area.area +
1647
+              incident.place.place : ''}}{{address}}</span
1648
+            >
1570 1649
           </li>
1571 1650
           {{if wxIncidentWithCmdb == 1}}
1572 1651
           <li class="pop1-hd__itemList">

+ 129 - 46
js/index.js

@@ -2,13 +2,25 @@ $(function () {
2 2
   var repairMain = JSON.parse(sessionStorage.getItem("repair_main")); //报修主体
3 3
   var reqHasCategory = JSON.parse(sessionStorage.getItem("reqHasCategory")); //自动建单
4 4
   var loginUser = JSON.parse(window.sessionStorage.getItem("loginUser")); //用户信息
5
-  var wxIncidentWithCmdb = JSON.parse(window.sessionStorage.getItem("wxIncidentWithCmdb")); //是否绑定资产
6
-  var incidentWithConsumable = JSON.parse(window.sessionStorage.getItem("incidentWithConsumable")); //是否绑定耗材
5
+  var ifRoom = JSON.parse(window.sessionStorage.getItem("ifRoom")); //是否增加房间号选择
6
+  var wxIncidentWithCmdb = JSON.parse(
7
+    window.sessionStorage.getItem("wxIncidentWithCmdb")
8
+  ); //是否绑定资产
7 9
   // demo start
8 10
   $("#demo").html(template("demo_temp", { account: loginUser.account }));
9 11
   // demo end
12
+  $("#head").append(
13
+    template("favicon_temp", {
14
+      isVersion: sessionStorage.getItem("version_qd"),
15
+    })
16
+  );
17
+  $("#logo").html(
18
+    template("logo_temp", { isVersion: sessionStorage.getItem("version_qd") })
19
+  );
20
+  $("#areaPlaceRoom").html(template("areaPlaceRoom_temp", { ifRoom: ifRoom }));
10 21
   // repairMain.valueconfig = '2';
11 22
   var placeList = []; //获取到的地点列表
23
+  var roomList = []; //获取到的房间号列表
12 24
   var wxId = ""; //微信报修ID
13 25
   var processMessageData = null; //详情页流程数据
14 26
   var dictionary = []; //详情页流程数据
@@ -78,6 +90,10 @@ $(function () {
78 90
   getAreaList({ idx: 0, sum: 1000, area: { wechatArea: true } });
79 91
   // 获取地点列表
80 92
   getPlaceList({ idx: 0, sum: 1000, area: { wechatAreaId: "" } });
93
+  // 获取地点列表
94
+  if (ifRoom == 1) {
95
+    getRoomList({ idx: 0, sum: 1000, room: {} });
96
+  }
81 97
   // 获取WxId
82 98
   getWxId();
83 99
   // 获取最新报修列表
@@ -474,7 +490,7 @@ $(function () {
474 490
     });
475 491
   }
476 492
 
477
-  //选择框联动
493
+  //选择框联动-选区域
478 494
   $("#area_list").on("change", function () {
479 495
     //获取id
480 496
     var id = $(this).val();
@@ -488,6 +504,42 @@ $(function () {
488 504
     //填充数据
489 505
     var html = template("place_list_temp", resFilter);
490 506
     $("#place_list").html(html);
507
+    // 过滤数据
508
+    var resFilter1 = { list: [] };
509
+    for (var i = 0; i < roomList.length; i++) {
510
+      if (roomList[i]["place"]["id"] == resFilter.list[0].id) {
511
+        resFilter1.list.push(roomList[i]);
512
+      }
513
+    }
514
+    //填充数据
515
+    var html = template("room_list_temp", resFilter1);
516
+    $("#room_list").html(html);
517
+    if (resFilter1.list.length) {
518
+      $("#bx_address").val(resFilter1.list[0].room);
519
+    }
520
+  });
521
+  //选择框联动-选地点
522
+  $("#place_list").on("change", function () {
523
+    //获取id
524
+    var id = $(this).val();
525
+    // 过滤数据
526
+    var resFilter = { list: [] };
527
+    for (var i = 0; i < roomList.length; i++) {
528
+      if (roomList[i]["place"]["id"] == id) {
529
+        resFilter.list.push(roomList[i]);
530
+      }
531
+    }
532
+    //填充数据
533
+    var html = template("room_list_temp", resFilter);
534
+    $("#room_list").html(html);
535
+  });
536
+  //选择框联动-选房间号
537
+  $("#room_list").on("change", function () {
538
+    //获取id
539
+    var id = $(this).val();
540
+    var val = roomList.find((v) => v.id == id);
541
+    //填充数据
542
+    $("#bx_address").val(val.room);
491 543
   });
492 544
   // 提交报修
493 545
   $("#f-submit").on("click", function () {
@@ -580,6 +632,7 @@ $(function () {
580 632
       description: $.trim($("#bx_description").val()),
581 633
       fileUrl: "url",
582 634
       placeId: $.trim($("#place_list").val()),
635
+      roomId: ifRoom == 1 ? $.trim($("#room_list").val()) : undefined,
583 636
       requester: loginUser,
584 637
       sourceType: "wechatUserIncident",
585 638
     };
@@ -626,10 +679,10 @@ $(function () {
626 679
     bx_arr.data = [];
627 680
     ch_arr.list = [];
628 681
     currentBxOrCh = $(this).index();
629
-    if(currentBxOrCh === 0){
630
-      $('.right .r-list').css('top','41px')
631
-    }else if(currentBxOrCh === 1){
632
-      $('.right .r-list').css('top','63px')
682
+    if (currentBxOrCh === 0) {
683
+      $(".right .r-list").css("top", "41px");
684
+    } else if (currentBxOrCh === 1) {
685
+      $(".right .r-list").css("top", "63px");
633 686
     }
634 687
     $(this).addClass("active").siblings().removeClass("active");
635 688
     getNewBxList(currentBxOrCh);
@@ -638,7 +691,7 @@ $(function () {
638 691
   $("#bx_list").on(
639 692
     "scroll",
640 693
     debounce(function () {
641
-      if($.trim($('.opcBg_item.active').text()) === '电话查号'){
694
+      if ($.trim($(".opcBg_item.active").text()) === "电话查号") {
642 695
         return;
643 696
       }
644 697
       var itemLen = $(this).find(".r-item").length;
@@ -988,6 +1041,7 @@ $(function () {
988 1041
         if (res.status == 200) {
989 1042
           var html = template("area_list_temp", res);
990 1043
           $("#area_list").html(html);
1044
+          $("#area_list").val(loginUser.place.area.id);
991 1045
         }
992 1046
       },
993 1047
       error: function (err) {
@@ -1004,9 +1058,38 @@ $(function () {
1004 1058
       data: JSON.stringify(data),
1005 1059
       success: function (res) {
1006 1060
         if (res.status == 200) {
1061
+          placeList = JSON.parse(JSON.stringify(res.list));
1062
+          res.list = res.list.filter((v) => {
1063
+            return v.area.id == loginUser.place.area.id;
1064
+          });
1007 1065
           var html = template("place_list_temp", res);
1008 1066
           $("#place_list").html(html);
1009
-          placeList = res.list;
1067
+          $("#place_list").val(loginUser.place.id);
1068
+        }
1069
+      },
1070
+      error: function (err) {
1071
+        console.log(err);
1072
+      },
1073
+    });
1074
+  }
1075
+  //获取房间号列表
1076
+  function getRoomList(data) {
1077
+    $.ajax({
1078
+      type: "POST",
1079
+      contentType: "application/json;charset=UTF-8",
1080
+      url: baseUrl + "user/data/fetchDataList/room",
1081
+      data: JSON.stringify(data),
1082
+      success: function (res) {
1083
+        if (res.status == 200) {
1084
+          roomList = JSON.parse(JSON.stringify(res.list));
1085
+          res.list = res.list.filter((v) => {
1086
+            return v.place.id == loginUser.place.id;
1087
+          });
1088
+          var html = template("room_list_temp", res);
1089
+          $("#room_list").html(html);
1090
+          if (res.list.length) {
1091
+            $("#bx_address").val(res.list[0].room);
1092
+          }
1010 1093
         }
1011 1094
       },
1012 1095
       error: function (err) {
@@ -1068,7 +1151,7 @@ $(function () {
1068 1151
     });
1069 1152
   }
1070 1153
   //处理查号
1071
-  function handlerCh(val,list){
1154
+  function handlerCh(val, list) {
1072 1155
     //触发
1073 1156
     $("#bx_list").getNiceScroll().resize();
1074 1157
     $("#bx_list").show().next(".loading").hide();
@@ -1087,27 +1170,27 @@ $(function () {
1087 1170
         }
1088 1171
       });
1089 1172
     //点击单位或部门
1090
-    $('.ch-search').click(function(e){
1173
+    $(".ch-search").click(function (e) {
1091 1174
       console.log(list.list);
1092 1175
       console.log($(this).index());
1093 1176
       var index = $(this).index();
1094 1177
       var obj = list.list[index];
1095 1178
       var data = {};
1096
-      if(obj.unit.id){
1179
+      if (obj.unit.id) {
1097 1180
         //部门
1098 1181
         data.list = [obj];
1099 1182
         var html = template("ch_list_temp", data);
1100 1183
         $("#bx_list").html(html);
1101 1184
         //处理
1102
-        handlerCh(val,data);
1103
-      }else{
1185
+        handlerCh(val, data);
1186
+      } else {
1104 1187
         //单位
1105 1188
         $.ajax({
1106 1189
           type: "POST",
1107 1190
           contentType: "application/json;charset=UTF-8",
1108 1191
           url: baseUrl + "user/queryPhone",
1109 1192
           data: JSON.stringify({
1110
-            unitId: obj.id
1193
+            unitId: obj.id,
1111 1194
           }),
1112 1195
           success: function (res) {
1113 1196
             if (res.state == 200) {
@@ -1115,7 +1198,7 @@ $(function () {
1115 1198
               var html = template("ch_list_temp", data);
1116 1199
               $("#bx_list").html(html);
1117 1200
               //处理
1118
-              handlerCh(val,data);
1201
+              handlerCh(val, data);
1119 1202
             }
1120 1203
           },
1121 1204
           error: function (err) {
@@ -1123,7 +1206,7 @@ $(function () {
1123 1206
           },
1124 1207
         });
1125 1208
       }
1126
-    })
1209
+    });
1127 1210
   }
1128 1211
   function search1() {
1129 1212
     bx_pageNum = 0;
@@ -1136,7 +1219,7 @@ $(function () {
1136 1219
     let postData = {};
1137 1220
     let url = "";
1138 1221
     if (type === 0) {
1139
-      $('.opcBg_searchBox').hide();
1222
+      $(".opcBg_searchBox").hide();
1140 1223
       postData = {
1141 1224
         assignee: loginUser.account,
1142 1225
         state: 0,
@@ -1145,22 +1228,22 @@ $(function () {
1145 1228
       };
1146 1229
       url = "apply/bpm/fetchServiceTasks";
1147 1230
     } else if (type === 1) {
1148
-      $('.opcBg_searchBox').show();
1231
+      $(".opcBg_searchBox").show();
1149 1232
       var val =
1150 1233
         $.trim($("#searchPro1").val()) == "可简拼、名称搜索"
1151 1234
           ? ""
1152 1235
           : $.trim($("#searchPro1").val());
1153 1236
       postData = {};
1154
-      if(val){
1237
+      if (val) {
1155 1238
         postData.keyword = val;
1156 1239
       }
1157 1240
       url = "user/queryPhone";
1158 1241
       //没有搜索内容的时候,返回空数组
1159
-      if($("#searchPro1").val() === '可简拼、名称搜索'){
1160
-        var html = template("ch_search_list_temp", {list:[]});
1242
+      if ($("#searchPro1").val() === "可简拼、名称搜索") {
1243
+        var html = template("ch_search_list_temp", { list: [] });
1161 1244
         $("#bx_list").html(html);
1162 1245
         //处理
1163
-        handlerCh(val,{list:[]});
1246
+        handlerCh(val, { list: [] });
1164 1247
         return;
1165 1248
       }
1166 1249
     }
@@ -1198,7 +1281,7 @@ $(function () {
1198 1281
               res.data[i].time = res.data[i].createTime;
1199 1282
               res.data[i].processInstanceId =
1200 1283
                 res.data[i].incident.processInstanceId;
1201
-                res.data[i].wxIncidentWithCmdb = wxIncidentWithCmdb;//是否展示资产带入模板
1284
+              res.data[i].wxIncidentWithCmdb = wxIncidentWithCmdb; //是否展示资产带入模板
1202 1285
             }
1203 1286
             //添加分页数据,汇总
1204 1287
             bx_arr.data = bx_arr.data.concat(res.data);
@@ -1242,9 +1325,9 @@ $(function () {
1242 1325
                 if (resFilter.state.id == 1592) {
1243 1326
                   //未受理
1244 1327
                   //添加详情页流程数据
1245
-                  processMessageData.forEach(function(v){
1246
-                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
1247
-                  })
1328
+                  processMessageData.forEach(function (v) {
1329
+                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
1330
+                  });
1248 1331
                   resFilter.processList = processMessageData;
1249 1332
                   //填充弹窗数据
1250 1333
                   var html = template("bx1_detail_temp", resFilter);
@@ -1305,9 +1388,9 @@ $(function () {
1305 1388
                   });
1306 1389
                 } else if (resFilter.state.id == 0) {
1307 1390
                   //添加详情页流程数据
1308
-                  processMessageData.forEach(function(v){
1309
-                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
1310
-                  })
1391
+                  processMessageData.forEach(function (v) {
1392
+                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
1393
+                  });
1311 1394
                   resFilter.processList = processMessageData;
1312 1395
                   //填充弹窗数据
1313 1396
                   var html = template("bx2_detail_temp", resFilter);
@@ -1367,9 +1450,9 @@ $(function () {
1367 1450
                   });
1368 1451
                 } else if (resFilter.state.id == 1594) {
1369 1452
                   //添加详情页流程数据
1370
-                  processMessageData.forEach(function(v){
1371
-                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
1372
-                  })
1453
+                  processMessageData.forEach(function (v) {
1454
+                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
1455
+                  });
1373 1456
                   resFilter.processList = processMessageData;
1374 1457
                   //填充弹窗数据
1375 1458
                   var html = template("bx3_detail_temp", resFilter);
@@ -1386,9 +1469,9 @@ $(function () {
1386 1469
                   });
1387 1470
                 } else if (resFilter.state.id == 1595) {
1388 1471
                   //添加详情页流程数据
1389
-                  processMessageData.forEach(function(v){
1390
-                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
1391
-                  })
1472
+                  processMessageData.forEach(function (v) {
1473
+                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
1474
+                  });
1392 1475
                   resFilter.processList = processMessageData;
1393 1476
                   //填充弹窗数据
1394 1477
                   var html = template("bx4_detail_temp", resFilter);
@@ -1485,9 +1568,9 @@ $(function () {
1485 1568
                   });
1486 1569
                 } else if (resFilter.state.id == 1593) {
1487 1570
                   //添加详情页流程数据
1488
-                  processMessageData.forEach(function(v){
1489
-                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
1490
-                  })
1571
+                  processMessageData.forEach(function (v) {
1572
+                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
1573
+                  });
1491 1574
                   resFilter.processList = processMessageData;
1492 1575
                   //填充弹窗数据
1493 1576
                   var html = template("bx5_detail_temp", resFilter);
@@ -1504,9 +1587,9 @@ $(function () {
1504 1587
                   });
1505 1588
                 } else if (resFilter.state.id == 1597) {
1506 1589
                   //添加详情页流程数据
1507
-                  processMessageData.forEach(function(v){
1508
-                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
1509
-                  })
1590
+                  processMessageData.forEach(function (v) {
1591
+                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
1592
+                  });
1510 1593
                   resFilter.processList = processMessageData;
1511 1594
                   //填充弹窗数据
1512 1595
                   var html = template("bx6_detail_temp", resFilter);
@@ -1523,9 +1606,9 @@ $(function () {
1523 1606
                   });
1524 1607
                 } else {
1525 1608
                   //添加详情页流程数据
1526
-                  processMessageData.forEach(function(v){
1527
-                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, '$1');
1528
-                  })
1609
+                  processMessageData.forEach(function (v) {
1610
+                    v.desc = v.desc.replace(/<.*?>(.*?)<\/.*?>/g, "$1");
1611
+                  });
1529 1612
                   resFilter.processList = processMessageData;
1530 1613
                   //填充弹窗数据
1531 1614
                   var html = template("bx7_detail_temp", resFilter);
@@ -1556,7 +1639,7 @@ $(function () {
1556 1639
             ch_arr.list = res.data;
1557 1640
             var html = template("ch_search_list_temp", ch_arr);
1558 1641
             $("#bx_list").html(html);
1559
-            handlerCh(val,ch_arr);
1642
+            handlerCh(val, ch_arr);
1560 1643
           }
1561 1644
         }
1562 1645
       },

+ 71 - 45
js/login.js

@@ -1,33 +1,57 @@
1 1
 $(function () {
2
-  var isSSo = location.search.length > 0;//是否单点登录
2
+  //因项目众多,前端为了加以区分,所以用域名加以判断,后期有更好的方式可以自行修改
3
+  // 中南财大
4
+  var isZncd = document.domain === "itsm.zuel.edu.cn";
5
+  // 华科
6
+  var isHk =
7
+    document.domain === "192.168.3.110" ||
8
+    document.domain === "192.168.3.69" ||
9
+    document.domain === "172.16.7.91" ||
10
+    document.domain === "192.168.3.105" ||
11
+    document.domain === "localhost";
12
+  if (isZncd) {
13
+    sessionStorage.setItem("version_qd", "isZncd");
14
+  }
15
+  if (isHk) {
16
+    sessionStorage.setItem("version_qd", "isHk");
17
+  }
18
+  $("#head").append(
19
+    template("favicon_temp", { isVersion: sessionStorage.getItem("version_qd") })
20
+  );
21
+  $("#logo").html(
22
+    template("logo_temp", { isVersion: sessionStorage.getItem("version_qd") })
23
+  );
24
+  var isSSo = location.search.length > 0; //是否单点登录
3 25
   if (isSSo) {
4
-    $('.container').hide();
26
+    $(".container").hide();
5 27
     login();
6 28
   }
7 29
   var hasClick = false; //是否已经点击过登录按钮
8 30
   // 兼容ie的placeholder
9
-  $('input, textarea').placeholder();
31
+  $("input, textarea").placeholder();
10 32
   // 登录点击
11
-  $('#login').on('click', login);
33
+  $("#login").on("click", login);
12 34
   // 登录方法
13 35
   function login() {
14 36
     if (hasClick) return;
15 37
     hasClick = true;
16
-    var name = $('#name').val()
17
-    var pwd = $('#pwd').val()
38
+    var name = $("#name").val();
39
+    var pwd = $("#pwd").val();
18 40
     var data = {
19 41
       username: name,
20
-      password: pwd
21
-    }
42
+      password: pwd,
43
+    };
22 44
     // 单点登录 start
23
-    var ssoStr = '';
45
+    var ssoStr = "";
24 46
     var ssoJson;
25 47
     if (isSSo) {
26
-      ssoStr = location.search.replace('?', '').split('&')[0].split('=')[1];
48
+      ssoStr = location.search.replace("?", "").split("&")[0].split("=")[1];
27 49
       ssoStr = Base64.decode(decodeURIComponent(ssoStr));
28 50
       ssoJson = JSON.parse(ssoStr);
29 51
     }
30
-    var postData = isSSo ? { username: ssoJson.a, password: ssoJson.r, t: false } : data;
52
+    var postData = isSSo
53
+      ? { username: ssoJson.a, password: ssoJson.r, t: false }
54
+      : data;
31 55
     // 单点登录 end
32 56
     $.ajax({
33 57
       type: "POST",
@@ -37,44 +61,46 @@ $(function () {
37 61
       success: function (res) {
38 62
         if (res.state == 200) {
39 63
           if (isSSo) {
40
-            sessionStorage.setItem('isSSo', '1');//单点登录
64
+            sessionStorage.setItem("isSSo", "1"); //单点登录
41 65
           } else {
42
-            sessionStorage.setItem('isSSo', '0');//正常登录
66
+            sessionStorage.setItem("isSSo", "0"); //正常登录
43 67
           }
44
-          sessionStorage.setItem('loginUser', JSON.stringify(res.data.requester));
68
+          sessionStorage.setItem(
69
+            "loginUser",
70
+            JSON.stringify(res.data.requester)
71
+          );
45 72
           //判断版本类别
46 73
           $.ajax({
47 74
             type: "POST",
48 75
             contentType: "application/json;charset=UTF-8",
49 76
             url: baseUrl + "sysinfo/data/fetchDataList/systemConfiguration",
50
-            data: JSON.stringify({ "idx": 0, "sum": 1000 }),
77
+            data: JSON.stringify({ idx: 0, sum: 1000 }),
51 78
             success: function (result) {
52 79
               if (result.status == 200) {
53 80
                 var list = result.list;
54
-                var repairMain = list.find((v) => v.keyconfig == "repairMain"); //报修主体
55
-                var incidentWithConsumable = list.find(
56
-                  (v) => v.keyconfig == "incidentWithConsumable"
57
-                ); //是否绑定耗材
58
-                var wxIncidentWithCmdb = list.find(
59
-                  (v) => v.keyconfig == "wxIncidentWithCmdb"
60
-                ); //是否绑定资产
61
-                var reqHasCategory = list.find(
62
-                  (v) => v.keyconfig == "reqHasCategory"
63
-                ); //获取是否自动建单
64
-                sessionStorage.setItem(
65
-                  "repair_main",
66
-                  JSON.stringify(repairMain)
67
-                );
68
-                sessionStorage.setItem(
69
-                  "incidentWithConsumable",
70
-                  incidentWithConsumable.valueconfig
71
-                );
72
-                sessionStorage.setItem(
73
-                  "wxIncidentWithCmdb",
74
-                  wxIncidentWithCmdb.valueconfig
75
-                );
76
-                sessionStorage.setItem("reqHasCategory", JSON.stringify(reqHasCategory));
77
-                window.location.href = 'index.html';
81
+                list.forEach((v) => {
82
+                  switch (v.keyconfig) {
83
+                    case "repairMain": //报修主体
84
+                      sessionStorage.setItem("repair_main", JSON.stringify(v));
85
+                      break;
86
+                    case "wxIncidentWithCmdb": //是否绑定资产
87
+                      sessionStorage.setItem(
88
+                        "wxIncidentWithCmdb",
89
+                        v.valueconfig
90
+                      );
91
+                      break;
92
+                    case "reqHasCategory": //获取是否自动建单
93
+                      sessionStorage.setItem(
94
+                        "reqHasCategory",
95
+                        JSON.stringify(v)
96
+                      );
97
+                      break;
98
+                    case "ifRoom": //是否增加房间号选择
99
+                      sessionStorage.setItem("ifRoom", v.valueconfig);
100
+                      break;
101
+                  }
102
+                });
103
+                window.location.href = "index.html";
78 104
               }
79 105
               hasClick = false;
80 106
             },
@@ -82,10 +108,10 @@ $(function () {
82 108
             error: function (e) {
83 109
               console.log(e.status);
84 110
               console.log(e.responseText);
85
-            }
111
+            },
86 112
           });
87 113
         } else {
88
-          alert('用户名或密码错误,请重试!');
114
+          alert("用户名或密码错误,请重试!");
89 115
           hasClick = false;
90 116
         }
91 117
       },
@@ -93,14 +119,14 @@ $(function () {
93 119
       error: function (e) {
94 120
         console.log(e.status);
95 121
         console.log(e.responseText);
96
-      }
122
+      },
97 123
     });
98 124
   }
99 125
   // enter登录
100
-  $(document).bind('keypress', function (e) {
126
+  $(document).bind("keypress", function (e) {
101 127
     var keyCode;
102 128
     if (window.event) {
103
-      keyCode = e.keyCode
129
+      keyCode = e.keyCode;
104 130
     } else if (e.which) {
105 131
       keycode = e.which;
106 132
     }
@@ -110,4 +136,4 @@ $(function () {
110 136
     $("#login").trigger("click");
111 137
     return false;
112 138
   });
113
-})
139
+});

+ 63 - 34
login.html

@@ -1,48 +1,77 @@
1 1
 <!DOCTYPE html>
2 2
 <html lang="zh-cn">
3
-
4
-<head>
5
-    <meta charset="UTF-8">
6
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
-    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
3
+  <head id="head">
4
+    <meta charset="UTF-8" />
5
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+    <meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
8 7
     <title>报修平台</title>
9
-    <link rel="icon" type="image/png" sizes="32x32" href="/imgs/logo.png">
10
-    <link rel="stylesheet" href="./css/base.css">
11
-    <link rel="stylesheet" href="./css/login.css">
8
+    <link rel="stylesheet" href="./css/base.css" />
9
+    <link rel="stylesheet" href="./css/login.css" />
12 10
     <script src="./libs/jquery-1.9.1.min.js"></script>
13 11
     <script src="./libs/jquery.placeholder.js"></script>
14 12
     <script src="./libs/base64.min.js"></script>
15 13
     <!--[if lt IE 10]>
16
-        <script src="./libs/html5shiv.js"></script>
14
+      <script src="./libs/html5shiv.js"></script>
17 15
     <![endif]-->
18
-</head>
16
+  </head>
19 17
 
20
-<body>
18
+  <body>
21 19
     <div class="container">
22
-        <div class="content">
23
-            <div class="logo">
24
-                <img src="./imgs/logo.png" alt="">
25
-                <span>网络与信息运维报修平台</span>
26
-            </div>
27
-            <div class="login">
28
-                <div class="title">用户登录</div>
29
-                <input id="name" type="text" placeholder="请输入用户名">
30
-                <input id="pwd" type="password" placeholder="请输入密码">
31
-                <button id="login">登录</button>
32
-                <p>推荐使用Google浏览器,其他浏览器可能出现兼容性问题</p>
33
-                <!-- <p class="login_reset" style="color: #005395;">账号为您的学工号,初始密码为您的学工号后4位</p> -->
34
-            </div>
35
-            <div class="shadow">
36
-                <img src="./imgs/shadow_login.png" alt="">
37
-            </div>
20
+      <div class="content">
21
+        <div class="logo" id="logo">
22
+          <!-- <img src="./imgs/logo.png" alt="" />
23
+          <span>网络与信息运维报修平台</span> -->
24
+        </div>
25
+        <div class="login">
26
+          <div class="title">用户登录</div>
27
+          <input id="name" type="text" placeholder="请输入用户名" />
28
+          <input id="pwd" type="password" placeholder="请输入密码" />
29
+          <button id="login">登录</button>
30
+          <p>推荐使用Google浏览器,其他浏览器可能出现兼容性问题</p>
31
+          <!-- <p class="login_reset" style="color: #005395;">账号为您的学工号,初始密码为您的学工号后4位</p> -->
38 32
         </div>
39
-        <div class="camp">
40
-            <img src="./imgs/logo-ds.png" alt="">
41
-            <span>武汉大势恒通科技有限责任公司</span>
33
+        <div class="shadow">
34
+          <img src="./imgs/shadow_login.png" alt="" />
42 35
         </div>
36
+      </div>
37
+      <div class="camp">
38
+        <img src="./imgs/logo-ds.png" alt="" />
39
+        <span>武汉大势恒通科技有限责任公司</span>
40
+      </div>
43 41
     </div>
44
-</body>
45
-<script src="./js/base.js"></script>
46
-<script src="./js/login.js"></script>
47
-
42
+  </body>
43
+  <script src="./libs/template-web.min.js"></script>
44
+  <!-- favicon -->
45
+  <script id="favicon_temp" type="text/html">
46
+    {{if isVersion === 'isZncd'}}
47
+    <link
48
+      rel="icon"
49
+      type="image/png"
50
+      sizes="32x32"
51
+      href="/imgs/logo_zuel.png"
52
+    />
53
+    {{else if isVersion === 'isHk'}}
54
+    <link rel="icon" type="image/png" sizes="32x32" href="/imgs/logo_hk.png" />
55
+    {{else}}
56
+    <link
57
+      rel="icon"
58
+      type="image/png"
59
+      sizes="32x32"
60
+      href="/imgs/logo_default.png"
61
+    />
62
+    {{/if}}
63
+  </script>
64
+  <!-- logo -->
65
+  <script id="logo_temp" type="text/html">
66
+    {{if isVersion === 'isZncd'}}
67
+    <img src="./imgs/logo_zuel.png" alt="" />
68
+    {{else if isVersion === 'isHk'}}
69
+    <img src="./imgs/logo_hk.png" alt="" />
70
+    {{else}}
71
+    <img src="./imgs/logo_default.png" alt="" />
72
+    {{/if}}
73
+    <span>网络与信息运维报修平台</span>
74
+  </script>
75
+  <script src="./js/base.js"></script>
76
+  <script src="./js/login.js"></script>
48 77
 </html>

+ 1 - 0
package.json

@@ -4,6 +4,7 @@
4 4
   "description": "",
5 5
   "main": "index.js",
6 6
   "scripts": {
7
+    "development110": "node ./upload/development110.js",
7 8
     "development": "node ./upload/development.js",
8 9
     "production": "node ./upload/production.js",
9 10
     "build": "npx gulp build"

+ 43 - 0
upload/development110.js

@@ -0,0 +1,43 @@
1
+const shell = require('shelljs')
2
+const path = require('path');
3
+const config = {
4
+  ip: "192.168.3.110", // ssh地址
5
+  username: "root", // ssh 用户名
6
+  port: 22,      //端口
7
+  password: "DStech@123", // ssh 密码
8
+  path: '/home/itsm/project/web/pcReq', // 上传地址,删除地址
9
+  buildPath: '../dist' // 本地打包后文件地址
10
+}
11
+let Client = require('ssh2-sftp-client');
12
+
13
+function connectSSh() {
14
+  let sftp = new Client();
15
+  sftp.connect({
16
+    host: config.ip,
17
+    port: config.port,
18
+    username: config.username,
19
+    password: config.password
20
+  }).then(() => {
21
+    console.log("-----先执行删除服务器文件-----")
22
+    return sftp.rmdir(config.path, true);
23
+  }).then(() => {
24
+    // 上传文件
25
+    console.log("-----开始上传-----")
26
+    return sftp.uploadDir(path.resolve(__dirname, config.buildPath), config.path);
27
+  }).then((data) => {
28
+    console.log("-----上传完成-----");
29
+    sftp.end();
30
+  }).catch((err) => {
31
+    console.log(err, '-----失败-----');
32
+    sftp.end();
33
+  });
34
+}
35
+function runTask() {
36
+  //打包完成
37
+  if (shell.exec(`npm run build`).code == 0) {
38
+    console.log("-----打包成功-----");
39
+    //提交上传
40
+    connectSSh();
41
+  }
42
+}
43
+runTask()