validate cloudOwner&cloudRegionId 99/16599/1
author覃亮10184303 <qin.liang13@zte.com.cn>
Fri, 29 Sep 2017 08:25:18 +0000 (16:25 +0800)
committer覃亮10184303 <qin.liang13@zte.com.cn>
Fri, 29 Sep 2017 08:25:18 +0000 (16:25 +0800)
Issue-ID: AAI-186

Change-Id: I8c0a8a4f87ce998206d2c2d5b4162043c78580d0
Signed-off-by: 覃亮10184303 <qin.liang13@zte.com.cn>
portal/src/main/webapp/extsys/vim/js/vimController.js
portal/src/main/webapp/extsys/vim/vimView.html

index e9fd644..6bd6961 100644 (file)
@@ -106,6 +106,32 @@ var vm = avalon
             if (form.valid() == false) {
                 vm.isSave = false;
                 return false;
+            } else {
+                vm.isSave = true;
+            }
+            var cloudOwner = vm.currentElement["cloudOwner"];
+            var $cloudOwner = $("#vim_form input[name='cloudOwner']");
+            var cloudRegionId  = vm.currentElement["cloudRegionId"];
+            var $cloudRegionId = $("#vim_form input[name='cloudRegionId']");
+            if(cloudOwner.indexOf("_") != -1){
+                $cloudOwner.parent().parent().addClass("has-error");
+                $cloudOwner.next().html("It not allowed '_' contained here").show();
+                vm.isSave = false;
+                return false;
+            } else {
+                vm.isSave = true;
+                $cloudOwner.parent().parent().removeClass("has-error");
+                $cloudOwner.next().hide();
+            }
+            if(cloudRegionId.indexOf("_") != -1){
+                $cloudRegionId.parent().parent().addClass("has-error");
+                $cloudRegionId.next().html("It not allowed '_' contained here").show();
+                vm.isSave = false;
+                return false;
+            } else {
+                vm.isSave = true;
+                $cloudRegionId.parent().parent().removeClass("has-error");
+                $cloudRegionId.next().hide();
             }
             var res = false;
             if (vm.saveType == "add") {
index 923ddf7..33715ed 100644 (file)
     <div class="row-fluid col-sm-12" data-name="cond_zone">
         <div class="col-sm-4">
             <button class="btn white radius_l" id="app-new-btn" ms-click="$showVimTable(-1, 'add')">
-                <i class="ict-new"></i> <span id_i18n="com_zte_ums_eco_roc_vim_register"
-                                              name_i18n="com_zte_conductor_ui_i18n"></span>
+                <i class="ict-new"></i> <span id_i18n="com_zte_ums_eco_roc_vim_register" name_i18n="com_zte_conductor_ui_i18n"></span>
             </button>
         </div>
         <!-- <div class="fa fa-refresh text-muted refresh-status-text"><small><span id_i18n="com_zte_ums_eco_roc_vim_status_update_time" name_i18n="com_zte_conductor_ui_i18n"></span></small><small ms-text="vimStatusTime"></small></div>-->