@using PageAdmin.Utils;
@{
    string table = ViewBag.Table;
    string guid = Html.Guid();
    CurrentUser currentUser = ViewBag.CurrentUser;
    string action = ViewContext.RouteData.Values["action"].ToString();
    IEnumerable<dynamic> fieldDataList = Html.GetFieldList(table, action, currentUser, PageAdmin.Common.FromEnum.Admin,true);
}
<script src="~/Incs/UEditor/ueditor.forAdmin.config.js" type="text/javascript"></script>
<script src="~/Incs/UEditor/ueditor.all.min.js" type="text/javascript"></script>
<div class="main" id="main" v-cloak>
    <el-form label-width="150px" label-position="left">
        @{
            string beforeSubmitJs = "";
            var data = new ViewDataDictionary();
            data.Add("currentUser", currentUser);
            data.Add("guid", guid);
            data.Add("from", PageAdmin.Common.FromEnum.Admin);
            data.Add("i", 0);
            int i = 0;
            foreach (var row in fieldDataList)
            {
                data["i"] = i;
                beforeSubmitJs += row.BeforeSubmitJs;
                Html.RenderPartial("~/Areas/E/Views/CustomForm/FormPartial.cshtml", (object)row, data);
                i++;
            }
        }
    </el-form>
    <div class="footer-submit-bar" style="padding-left:150px">
        <el-button type="primary" v-on:click="postSubmit">提交保存</el-button>
        <el-button onclick="closeSelf()">关闭</el-button>
    </div>
</div>

<script type="text/javascript">
    var formData=@Html.RawModel((string)Model ?? "{}");
    formData.Guid = "@guid";

    //提交前执行
    function beforeSubmitExecute() {
        @Html.Raw(beforeSubmitJs)
        return true;
    }
      var vue= new Vue({
          el: "#main",
          data: formData,
          methods: {
              postSubmit: function () {
                    var validated = this.validateForm({ beforeSubmit:function (){ return beforeSubmitExecute() }});//jquery表单验证
                    if (validated)
                    {
                        this.submit({ url: "@Url.ActionUrl("Edit")?table=@ViewBag.Table", data: formData,success: function () { callBack() }});
                    }
              },
          },
    });

      function callBack() {
            parent.loadData();
        }
</script>