wuxw7 лет назад: 7
Родитель
Сommit
188cddf894

+ 5 - 11
WebService/src/main/java/com/java110/web/controller/HomeController.java

@@ -1,13 +1,7 @@
 package com.java110.web.controller;
 
-import com.alibaba.fastjson.JSONObject;
-import com.java110.common.exception.NoAuthorityException;
-import com.java110.common.exception.SMOException;
-import com.java110.common.util.Assert;
-import com.java110.common.util.StringUtil;
-import com.java110.web.smo.IConsoleServiceSMO;
+import com.java110.web.smo.IFlowServiceSMO;
 import com.java110.core.base.controller.BaseController;
-import com.java110.core.context.PageData;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -28,22 +22,22 @@ public class HomeController extends BaseController {
 
 
     @Autowired
-    private IConsoleServiceSMO consoleServiceSMOImpl;
+    private IFlowServiceSMO consoleServiceSMOImpl;
 
     @RequestMapping(path = "/")
     public String index(Model model, HttpServletRequest request) {
         String template = "index";
 
-            return template;
+        return template;
     }
 
 
 
-    public IConsoleServiceSMO getConsoleServiceSMOImpl() {
+    public IFlowServiceSMO getConsoleServiceSMOImpl() {
         return consoleServiceSMOImpl;
     }
 
-    public void setConsoleServiceSMOImpl(IConsoleServiceSMO consoleServiceSMOImpl) {
+    public void setConsoleServiceSMOImpl(IFlowServiceSMO consoleServiceSMOImpl) {
         this.consoleServiceSMOImpl = consoleServiceSMOImpl;
     }
 }

+ 1 - 1
WebService/src/main/java/com/java110/web/smo/IConsoleServiceSMO.java

@@ -11,7 +11,7 @@ import java.util.Map;
  * 控制类业务接口
  * Created by wuxw on 2018/4/28.
  */
-public interface IConsoleServiceSMO {
+public interface IFlowServiceSMO {
 
 
 

+ 4 - 11
WebService/src/main/java/com/java110/web/smo/impl/ConsoleServiceSMOImpl.java

@@ -10,14 +10,9 @@ import com.java110.common.constant.ServiceCodeConstant;
 import com.java110.common.exception.SMOException;
 import com.java110.common.util.DateUtil;
 import com.java110.core.context.IPageData;
-import com.java110.core.factory.AuthenticationFactory;
-import com.java110.core.factory.DataTransactionFactory;
-import com.java110.common.log.LoggerEngine;
 import com.java110.common.util.Assert;
-import com.java110.common.util.StringUtil;
-import com.java110.web.smo.IConsoleServiceSMO;
+import com.java110.web.smo.IFlowServiceSMO;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.core.context.PageData;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -29,18 +24,16 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.client.HttpClientErrorException;
 import org.springframework.web.client.RestTemplate;
 
-import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
  * 业务服务类
  * Created by wuxw on 2018/4/28.
  */
-@Service("consoleServiceSMOImpl")
-public class ConsoleServiceSMOImpl  implements IConsoleServiceSMO {
+@Service("flowServiceSMOImpl")
+public class FlowServiceSMOImpl implements IFlowServiceSMO {
 
-    private final static Logger logger = LoggerFactory.getLogger(ConsoleServiceSMOImpl.class);
+    private final static Logger logger = LoggerFactory.getLogger(FlowServiceSMOImpl.class);
 
     @Autowired
     private RestTemplate restTemplate;

+ 107 - 0
WebService/src/main/resources/components/company/company.html

@@ -0,0 +1,107 @@
+<div class="wrapper wrapper-content animated fadeInRight">
+    <div class="row">
+        <div class="col-lg-12">
+            <div class="ibox">
+                <div class="ibox-title">
+                    <h5>Wizard with Validation</h5>
+                    <div class="ibox-tools">
+                        <a class="collapse-link">
+                            <i class="fa fa-chevron-up"></i>
+                        </a>
+                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
+                            <i class="fa fa-wrench"></i>
+                        </a>
+                        <ul class="dropdown-menu dropdown-user">
+                            <li><a href="#" class="dropdown-item">Config option 1</a>
+                            </li>
+                            <li><a href="#" class="dropdown-item">Config option 2</a>
+                            </li>
+                        </ul>
+                        <a class="close-link">
+                            <i class="fa fa-times"></i>
+                        </a>
+                    </div>
+                </div>
+                <div class="ibox-content">
+                    <h2>
+                        Validation Wizard Form
+                    </h2>
+                    <p>
+                        This example show how to use Steps with jQuery Validation plugin.
+                    </p>
+
+                    <form id="form" action="#" class="wizard-big">
+                        <h1>Account</h1>
+                        <fieldset>
+                            <h2>Account Information</h2>
+                            <div class="row">
+                                <div class="col-lg-8">
+                                    <div class="form-group">
+                                        <label>Username *</label>
+                                        <input id="userName" name="userName" type="text" class="form-control required">
+                                    </div>
+                                    <div class="form-group">
+                                        <label>Password *</label>
+                                        <input id="password" name="password" type="text" class="form-control required">
+                                    </div>
+                                    <div class="form-group">
+                                        <label>Confirm Password *</label>
+                                        <input id="confirm" name="confirm" type="text" class="form-control required">
+                                    </div>
+                                </div>
+                                <div class="col-lg-4">
+                                    <div class="text-center">
+                                        <div style="margin-top: 20px">
+                                            <i class="fa fa-sign-in" style="font-size: 180px;color: #e5e5e5 "></i>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+
+                        </fieldset>
+                        <h1>Profile</h1>
+                        <fieldset>
+                            <h2>Profile Information</h2>
+                            <div class="row">
+                                <div class="col-lg-6">
+                                    <div class="form-group">
+                                        <label>First name *</label>
+                                        <input id="name" name="name" type="text" class="form-control required">
+                                    </div>
+                                    <div class="form-group">
+                                        <label>Last name *</label>
+                                        <input id="surname" name="surname" type="text" class="form-control required">
+                                    </div>
+                                </div>
+                                <div class="col-lg-6">
+                                    <div class="form-group">
+                                        <label>Email *</label>
+                                        <input id="email" name="email" type="text" class="form-control required email">
+                                    </div>
+                                    <div class="form-group">
+                                        <label>Address *</label>
+                                        <input id="address" name="address" type="text" class="form-control">
+                                    </div>
+                                </div>
+                            </div>
+                        </fieldset>
+
+                        <h1>Warning</h1>
+                        <fieldset>
+                            <div class="text-center" style="margin-top: 120px">
+                                <h2>You did it Man :-)</h2>
+                            </div>
+                        </fieldset>
+
+                        <h1>Finish</h1>
+                        <fieldset>
+                            <h2>Terms and Conditions</h2>
+                            <input id="acceptTerms" name="acceptTerms" type="checkbox" class="required"> <label for="acceptTerms">I agree with the Terms and Conditions.</label>
+                        </fieldset>
+                    </form>
+                </div>
+            </div>
+        </div>
+
+    </div>
+</div>

+ 9 - 0
WebService/src/main/resources/components/company/company.js

@@ -0,0 +1,9 @@
+/**
+    初始化 公司信息
+
+**/
+
+(function(vc){
+
+
+})(window.vc);

+ 3 - 0
WebService/src/main/resources/components/login/login.js

@@ -47,6 +47,9 @@
                              });
 
             }
+        },
+        _destroyedMethod:function(){
+            console.log("登录页面销毁调用");
         }
     });
 

+ 4 - 1
WebService/src/main/resources/components/validate-code/validate-code.js

@@ -43,7 +43,10 @@
                                  });
 
                 }
-            }
+            },
+             _destroyedMethod:function(){
+                 console.log("登录验证码页面销毁调用");
+             }
 
     });
 

+ 3 - 3
WebService/src/main/resources/components/validate-tel/validate-tel.html

@@ -3,11 +3,11 @@
         <input  name="tel" v-model="validateParam.tel" type="text" class="form-control" placeholder="请输入手机号码" required="">
     </div>
     <div class="form-group row" >
-        <div class="col-sm-8 ">
+        <div class="col-sm-7 ">
             <input type="text" class="form-control" v-model="validateParam.messageCode" placeholder="请输入验证码" required=""/>
         </div>
-        <div class="col-sm-4 ">
-            <button type="button" class="btn btn-primary form-control" v-on:click="sendTelMessageCode()">{{buttonInfo}}</button>
+        <div class="col-sm-5 ">
+            <button type="button" v-bind:disabled="buttonInfo !='验证码'"  class="btn btn-primary form-control" v-on:click="sendTelMessageCode()">{{buttonInfo}}</button>
         </div>
     </div>
 </div>

+ 24 - 1
WebService/src/main/resources/components/validate-tel/validate-tel.js

@@ -29,6 +29,13 @@
             },
             methods:{
                 sendTelMessageCode(){
+                    if(!vc.validate.phone(vc.component.validateParam.tel)){
+                          vc.component.$emit('errorInfoEvent',"手机号码为空或不正确,不能发送验证码");
+                        return;
+                    }
+                    // 开启定时
+                    vc.component.messageCodeTimer();
+
                     var param = {
                             tel:vc.component.validateParam.tel,
                     };
@@ -50,8 +57,24 @@
                                     vc.component.$emit('errorInfoEvent',errInfo);
                                  });
 
+                },
+                //验证码定时
+                messageCodeTimer(){
+                      var num = 0;
+
+                    var _timer = vc.createTimer(function(){
+                        num ++;
+                        vc.component.buttonInfo = num +" 秒后重试";
+                        if(num === 60){
+                            vc.clearTimer(_timer);
+                            vc.component.buttonInfo = "验证码";
+                        }
+                    },1000);
                 }
-            }
+            },
+             _destroyedMethod:function(){
+                 console.log("登录页面销毁调用");
+             }
 
     });
 

+ 48 - 2
WebService/src/main/resources/static/js/core.js

@@ -8,6 +8,8 @@
    var _initMethod = [];
    var _initEvent = [];
    var _component = {};
+   var _destroyedMethod = [];
+   var _timers = [];//定时器
 
    _vmOptions = {
         el:'#component',
@@ -20,6 +22,18 @@
         methods:{
 
         },
+        destroyed:function(){
+            window.vc.destroyedMethod.forEach(function(eventMethod){
+                 eventMethod();
+            });
+            //清理所有定时器
+
+            window.vc.timers.forEach(function(timer){
+                clearInterval(timer);
+            });
+
+            _timers = [];
+        }
 
    };
     vc = {
@@ -29,7 +43,9 @@
         vmOptions:_vmOptions,
         initMethod:_initMethod,
         initEvent:_initEvent,
-        component:_component
+        component:_component,
+        destroyedMethod:_destroyedMethod,
+        timers:_timers
     };
    //通知window对象
    window.vc = vc;
@@ -93,10 +109,40 @@
             vc.initEvent.push(_vmOptions._initEvent);
         }
 
+         //处理_initEvent_destroyedMethod
+        if(_vmOptions.hasOwnProperty('_destroyedMethod')){
+            vc.destroyedMethod.push(_vmOptions._destroyedMethod);
+        }
+
+
     };
 
+
+
     //绑定跳转函数
     vc.jumpToPage = function(url){
                                     window.location.href = url;
                                 };
-})(window.vc);
+})(window.vc);
+
+/**
+    vc 定时器处理
+**/
+(function(w,vc){
+
+    /**
+        创建定时器
+    **/
+    vc.createTimer = function(func,sec){
+        var _timer = w.setInterval(func,sec);
+        vc.timers.push(_timer); //这里将所有的定时器保存起来,页面退出时清理
+
+        return _timer;
+    };
+    //清理定时器
+    vc.clearTimer = function(timer){
+        clearInterval(timer);
+    }
+
+
+})(window,window.vc);

+ 1 - 1
WebService/src/main/resources/static/js/vc-validate.js

@@ -187,7 +187,7 @@ vc 校验 工具类 -method
 
                     if(configObj.limit == 'minLength'){
                         validate.setState(validate.minLength(tmpDataObj,configObj.param),configObj.errInfo);
-
+7
                     }
 
                     if(configObj.limit == 'num'){

+ 28 - 0
WebService/src/main/resources/views/init_company.html

@@ -0,0 +1,28 @@
+
+<html lang="en"
+      xmlns="http://www.w3.org/1999/xhtml"
+      xmlns:th="http://www.thymeleaf.org"
+      xmlns:vc="http://www.thymeleaf.org">
+
+<head>
+
+    <meta charset="utf-8"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+
+    <title>完善公司信息 | java110</title>
+
+    <vc:create name="commonTop"></vc:create>
+
+</head>
+
+<body class="gray-bg">
+<div id="component" class="middle-box text-center loginscreen animated fadeInDown">
+    <vc:create name="company"></vc:create>
+
+</div>
+
+
+<vc:create name="commonBottom"></vc:create>
+</body>
+
+</html>