From 63700a7e50b8db13d81c885233d0ea7a440bf364 Mon Sep 17 00:00:00 2001
From: mrzcc <121184950@qq.com>
Date: 星期一, 17 二月 2020 19:42:47 +0800
Subject: [PATCH] 更新巡检计划页面

---
 WebService/src/main/resources/components/unitPackage/unit-select2/unitSelect2.js |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/WebService/src/main/resources/components/unitPackage/unit-select2/unitSelect2.js b/WebService/src/main/resources/components/unitPackage/unit-select2/unitSelect2.js
index d81dd98..4e98ec9 100644
--- a/WebService/src/main/resources/components/unitPackage/unit-select2/unitSelect2.js
+++ b/WebService/src/main/resources/components/unitPackage/unit-select2/unitSelect2.js
@@ -12,7 +12,7 @@
                 unitId: '-1',
                 unitNum: '',
                 unitName: '',
-                unitSelector:{}
+                unitSelector: {}
             }
         },
         watch: {
@@ -20,7 +20,7 @@
                 deep: true,
                 handler: function () {
                     vc.emit($props.callBackListener, $props.callBackFunction, this.unitSelect2Info);
-                    console.log('鏄惁鎵ц watch',$props.callBackListener, $props.callBackFunction, this.unitSelect2Info);
+                    console.log('鏄惁鎵ц watch', $props.callBackListener, $props.callBackFunction, this.unitSelect2Info);
                     vc.emit($namespace, 'roomSelect2', "transferRoom", this.unitSelect2Info);
                 }
             }
@@ -38,9 +38,19 @@
             });
             vc.on('unitSelect2', 'setUnit', function (_param) {
                 vc.copyObject(_param, this.unitSelect2Info);
-               /* $(".unitSelector").val(_param.unitId).select2();*/
-                var option = new Option(_param.unitNum , _param.unitId, true, true);
+                /* $(".unitSelector").val(_param.unitId).select2();*/
+                var option = new Option(_param.unitNum, _param.unitId, true, true);
                 this.unitSelect2Info.unitSelector.append(option);
+            });
+            vc.on('unitSelect2', 'clearUnit', function (_param) {
+                this.unitSelect2Info = {
+                    units: [],
+                    floorId: '-1',
+                    unitId: '-1',
+                    unitNum: '',
+                    unitName: '',
+                    unitSelector: {}
+                };
             });
         },
         methods: {
@@ -93,7 +103,9 @@
                 $('#unitSelector').on("select2:unselect", function (evt) {
                     //杩欓噷鏄彇娑堥�変腑瑙﹀彂鐨勪簨浠�
                     //濡傞厤缃產llowClear: true鍚庯紝瑙﹀彂
-                    console.log('unselect', evt)
+                    console.log('unselect', evt);
+                    this.unitSelect2Info.unitId = '-1';
+                    this.unitSelect2Info.unitName = '';
 
                 });
             },

--
Gitblit v1.8.0