@{
    Layout = "_Layout.cshtml";
}
<div  id="main">
    <div class="set-box">
        <div class="pr-title"><h3>创建管理员账户</h3></div>
        <div class="set">
            <el-form ref="form" label-width="120px">
                <!--解决浏览器自动填充账户-->
                <input type="text" style="position:fixed;bottom:-9999px" />
                <input type="password" style="position:fixed;bottom:-9999px" />
                <el-form-item label="管理员账户" v-validate="{data:username,dataType:'username',focusTarget:'#username',nullMsg:'请填写管理员账户!'}">
                    <el-input id="username" v-model="username" maxlength="30" placeholder="创建后将默认为超级管理员"></el-input>
                    <span class="help-block">超级管理员账户，可自行更改</span>
                </el-form-item>
                <el-form-item label="升级同名账户">
                    <el-checkbox v-model="updateSameUser">如果有同名账户存在，则升级为超级管理员</el-checkbox>
                </el-form-item>
                <el-form-item label="管理员密码" v-validate="{data:password,dataType:'password',focusTarget:'#password',nullMsg:'请填写密码!'}">
                    <el-input type="password" id="password" v-model="password" maxlength="30" placeholder="用户密码建议6位以上"></el-input>
                </el-form-item>
                <el-form-item label="默认确认" v-validate="{data:password1,focusTarget:'#password1',nullMsg:'请填写确认密码!',errorMsg:'两次输入的密码不一致!',compare:password}">
                    <el-input type="password" id="password1" v-model="password1" maxlength="30"></el-input>
                </el-form-item>
            </el-form>
        </div>
    </div>
    <div class="btn-box">
        <button class="el-button el-button--primary" onclick="location.href='@Url.ActionUrl("Step3")'">上一步</button>
        <button class="el-button el-button--primary" v-on:click="next">下一步</button>
    </div>
</div>

<script type="text/javascript">
    document.getElementById("progressBar").style.width = "800px";
    var formData = { username: "admin", updateSameUser:true, password: "", password1: "" }
    function successBack()
    {
      location.href = "@Url.ActionUrl("over")";
    }
      var vue= new Vue({
          el: "#main",
          data: formData,
            methods: {
                next: function () {
                    var validated = this.validateForm();//jquery表单验证
                    if (validated)
                    {
                        this.submit({
                            url: "@Url.ActionUrl("SetAdminer")",data:formData,showSuccessMsg: false, success: successBack
                        });
                    }
              },
          },
    });

</script>


