<div class="main" id="main" v-cloak>
    <el-form ref="form" label-width="100px" label-position="left">
        <el-form-item label="角色名称">
            <el-input v-model="Name" id="Name" name="Name" maxlength="50" v-validate="{data:Name,dataType:'*',nullMsg:'请填写角色名称!'}"></el-input>
            <span class="help-block validate-tips-box"></span>
        </el-form-item>

        <el-form-item label="备注">
            <el-input v-model="Remark" name="Remark" id="Remark" maxlength="50"></el-input>
            <span class="help-block validate-tips-box"></span>
        </el-form-item>
    </el-form>
   
    <div class="footer-submit-bar" style="padding-left:120px">
        <el-button type="primary" v-on:click="postSubmit">提交保存</el-button>
        <el-button onclick="closeSelf()">关闭</el-button>
    </div>
</div>

<script type="text/javascript">
    var id = request("id");
    var roleType = request("roleType");
    var formData =@Html.Raw(Model ?? "{}");
    var vue = new Vue({
        el: "#main",
        data: formData,
        methods: {
            postSubmit: function () {
                var validated = this.validateForm({});//jquery表单验证
                if (validated) {
                    this.submit({ url: "@Url.ActionUrl()", data: formData, success: "PostBack()" });
                }
            }
        }
    })
    function PostBack() {
        location.href = location.href;
        parent.vue.loadData();
    }
</script>