AAI-181 verification SDNC 39/8539/1
authorqin.liang(10184303) <qin.liang13@zte.com.cn>
Thu, 24 Aug 2017 02:25:52 +0000 (10:25 +0800)
committerqin.liang(10184303) <qin.liang13@zte.com.cn>
Thu, 24 Aug 2017 02:25:52 +0000 (10:25 +0800)
Change-Id: I6605ec89dd24919d4b61a314e0ab523cb8ebe279
Issue-ID: AAI-181
Signed-off-by: qin.liang(10184303) <qin.liang13@zte.com.cn>
esr/src/main/webapp/extsys/sdncontroller/js/sdncController.js

index 1c9b7bd..ef663b0 100644 (file)
@@ -127,7 +127,7 @@ var vm = avalon.define({
         updateSDNC: function (index) {
             vm.saveType = "update";
             vm.currentIndex = index;
-            vm.currentElement = vm.sdncList[index];
+            vm.fillElement(vm.sdncList[vm.currentIndex], vm.currentElement)
             vm.$showTable();
         },
         validate: function () {
@@ -204,6 +204,7 @@ var vm = avalon.define({
         },
         putSDNC: function () {
             console.log(vm.getSDNCSave());
+            vm.fillElement(vm.currentElement, vm.sdncList[vm.currentIndex]);
             return true;
            /* $.ajax({
                 type: "PUT",
@@ -243,6 +244,20 @@ var vm = avalon.define({
                 }
             });*/
         },
+        fillElement: function (sourceElement, targetElement) {
+            targetElement["sdnControllerId"] = sourceElement["sdnControllerId"];
+            targetElement["name"] = sourceElement["name"];
+            targetElement["status"] = sourceElement["status"];
+            targetElement["url"] = sourceElement["url"];
+            targetElement["userName"] = sourceElement["userName"];
+            targetElement["password"] = sourceElement["password"];
+            targetElement["version"] = sourceElement["version"];
+            targetElement["vendor"] = sourceElement["vendor"];
+            targetElement["description"] = sourceElement["description"];
+            targetElement["protocol"] = sourceElement["protocol"];
+            targetElement["productName"] = sourceElement["productName"];
+            targetElement["type"] = sourceElement["type"];
+        },
         getSDNCSave: function () {
             var emsSave = $.extend(true, {}, vm.currentElement.$model);
             return emsSave;