Просмотр исходного кода

加入服务下一步限制功能

wuxw лет назад: 6
Родитель
Сommit
a54a28a5a2

+ 2 - 0
WebService/src/main/resources/components/service-binding/serviceBinding.html

@@ -7,6 +7,8 @@
     <!-- 选择 应用信息 -->
     <div v-if="serviceBindingInfo.index == 0">
         <vc:create name="viewAppInfo"
+                   callBackListener="serviceBinding"
+                   callBackFunction="notify"
         ></vc:create>
     </div>
 

+ 10 - 1
WebService/src/main/resources/components/service-binding/serviceBinding.js

@@ -7,14 +7,18 @@
     vc.extends({
         data:{
             serviceBindingInfo:{
-                $step:'',
+                $step:{},
                 index:0,
+                infos:[]
             }
         },
         _initMethod:function(){
             vc.component._initStep();
         },
         _initEvent:function(){
+            vc.on("serviceBinding", "notify", function(_info){
+                vc.component.serviceBindingInfo.infos[vc.component.serviceBindingInfo.index] = _info;
+            });
 
         },
         methods:{
@@ -32,6 +36,11 @@
                 vc.component.serviceBindingInfo.index = vc.component.serviceBindingInfo.$step.getIndex();
             },
             _nextStep:function(){
+                var _currentData = vc.component.serviceBindingInfo.infos[vc.component.serviceBindingInfo.index];
+                if( _currentData == null || _currentData == undefined){
+                    vc.message("请选择相关信息");
+                    return ;
+                }
                 vc.component.serviceBindingInfo.$step.nextStep();
                 vc.component.serviceBindingInfo.index = vc.component.serviceBindingInfo.$step.getIndex();
             }

+ 5 - 2
WebService/src/main/resources/components/view-app-info/viewAppInfo.js

@@ -4,7 +4,10 @@
 (function(vc){
 
     vc.extends({
-
+        propTypes: {
+           callBackListener:vc.propTypes.string, //父组件名称
+           callBackFunction:vc.propTypes.string //父组件监听方法
+        },
         data:{
             viewAppInfo:{
                 appId:"",
@@ -22,7 +25,7 @@
         _initEvent:function(){
             vc.on('viewAppInfo','chooseApp',function(_app){
                 vc.component.viewAppInfo = _app;
-                //vc.emit($props.callBackComponent,'notify',_owner);
+                vc.emit($props.callBackListener,$props.callBackFunction,_app);
             });
 
         },