@model string
@{
    string Id = Request.QueryString["id"];
    int xuhao = StringHelper.Format<int>(Request.QueryString["xuhao"]);
    if (xuhao == 0)
    {
        xuhao = 1;
    }
    else
    {
        xuhao++;
    }
}
<div class="main" id="main" v-cloak>
    <el-tabs type="card" v-model="activeName">
        <el-tab-pane label="基础参数" name="first">
            <el-form label-width="130px" class="small" label-position="left" size="medium">
                <el-form-item label="字段名">
                    <el-input maxlength="30" v-model.trim="Name" :readonly="Id>0" v-validate="{data:Name,dataType:'field',nullMsg:'请填写字段名'}"></el-input>
                    <span class="help-block">字段只能用英文字符，数字组成，且必须字母开头</span>
                </el-form-item>

                <el-form-item label="字段备注">
                    <el-input maxlength="30" v-model.trim="Remark" v-validate="{data:Remark,dataType:'*',nullMsg:'请填写字段备注'}"></el-input>
                    <span class="help-block">如：标题，用于标识</span>
                </el-form-item>

                <el-form-item label="表单类型">
                    <el-select v-model="FieldType" v-validate="{data:FieldType,dataType:'*',nullMsg:'请选择表单类型'}">
                        <el-option value="text" label="文本输入框" v-show="(Id==0) || (Id>0 && ['colorpicker','datepicker','zdy','empty','text','password','number','slider','select','radio','checkbox','cascader'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="password" label="密码输入框" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','password','number'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="number" label="数字输入框" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','password','number','slider'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="slider" label="数字范围滑块" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','password','number','slider'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="colorpicker" label="颜色选择器" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','colorpicker','select','radio','checkbox'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="datepicker" label="日期选择器" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','password','datepicker','datetimepicker'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="radio" label="单选框" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','number','slider','select','radio','checkbox','cascader','datapicker'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="checkbox" label="复选框" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','select','radio','checkbox','cascader','datapicker'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="select" label="下拉框" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','number','slider','cascader','select','checkbox','radio','datapicker'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="cascader" label="级联选择框" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','select','radio','checkbox','cascader','datapicker'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="datapicker" label="数据选择器(弹窗选择)" v-show="(Id==0) || (Id>0 && ['zdy','empty','text','select','radio','checkbox','cascader','datapicker'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="textarea" label="多行文本(textarea)" v-show="(Id==0) || (Id>0 && ['zdy','empty','textarea','editor'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="editor" label="编辑器" v-show="(Id==0) || (Id>0 && ['zdy','empty','textarea','editor'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="image" label="图片" v-show="(Id==0) || (Id>0 && ['empty','image','file'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="images" label="图片组" v-show="(Id==0) || (Id>0 && ['empty','files','images'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="file" label="附件" v-show="(Id==0) || (Id>0 && ['empty','image','file'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="files" label="附件组" v-show="(Id==0) || (Id>0 && ['empty','files','images'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="subtable" label="附属表(子表)" v-show="(Id==0) || (Id>0 && ['empty','subtable'].indexOf(FieldType)>=0)"></el-option>
                        <el-option value="zdy" label="自定义内容"></el-option>
                        <el-option value="empty" label="空表单(不展现前端界面)"></el-option>
                    </el-select>
                    <span class="help-block">
                    <span v-if="FieldType=='subtable'">附属表类型会创建一个新的附属表</span>
                    <span v-else-if="['textarea'].indexOf(FieldType)>=0">可添加autosize属性使高度能够根据内容自动调整，如 :autosize="{ minRows: 2, maxRows: 4}"</span>
                    <span v-else-if="['number','slider'].indexOf(FieldType)>=0">可添加:min和:max属性控制取值范围格式，如:min="1" :max="100",更多属性参考相关表单组件使用教程</span>
                    <span v-else-if="['datepicker'].indexOf(FieldType)>=0">可添加自定义type属性控制格式，如type="date"只能设置日期，更多属性参考相关表单组件使用教程</span>
                    <span v-else>部分表单组件，可通过自定义属性>自定义标签属性进行扩展</span>
                    </span>
                </el-form-item>

                <el-form-item label="数据类型" v-show="['images','files','subtable'].indexOf(FieldType)<0" >
                    <el-select v-model="ValueType" :disabled="Id>0"  v-validate="{data:ValueType,dataType:'*',nullMsg:'请选择字段数据类型',ignore:(FieldType=='images' || FieldType=='files' || FieldType=='subtable')}">
                        <el-option value="nvarchar" label="文本类型/nvarchar" v-show="['zdy','text','datepicker','colorpicker','password','select','cascader','radio','checkbox','textarea','editor','image','file'].indexOf(FieldType)>=0"></el-option>
                        <el-option value="int" label="整型/int" title="从-2,147,483,648到2,147,483,647的整型数据，存储大小为4个字节" v-show="['zdy','text','number','slider','select','cascader','radio','datapicker'].indexOf(FieldType)>=0"></el-option>
                        <el-option value="smallint" label="小整型/smallint" title="从-32768到32767的整型数据，存储大小为2个字节" v-show="['zdy','text','number','slider','select','cascader','radio','datapicker'].indexOf(FieldType)>=0"></el-option>
                        <el-option value="tinyint" label="微整型/tinyint" title="从0到255的整型数据，存储大小位1个字节" v-show="['zdy','text','select','number','slider','cascader','radio','datapicker'].indexOf(FieldType)>=0"></el-option>
                        <el-option value="decimal" label="小数/decimal" title="system.decimal，无精度损失" v-show="['zdy','text','select','number','slider','cascader','radio','datapicker'].indexOf(FieldType)>=0"></el-option>
                        <el-option value="datetime" label="日期/DateTime" v-show="['zdy','text','datepicker','select','radio'].indexOf(FieldType)>=0"></el-option>
                    </el-select>
                    <span class="help-block">提交保存后不可修改</span>
                </el-form-item>

                <el-form-item label="自定义内容" v-show="FieldType=='zdy'">
                    <el-input v-model="ZdyContent" type="textarea" :autosize="{ minRows: 4, maxRows: 6}"></el-input>
                    <span class="help-block">可填写html和组件，其中动态组件建议通过ui-script组件引入</span>
                </el-form-item>

                <el-form-item label="小数精度" v-show="ValueType=='decimal'">
                    <el-input type="text" name="DecimalAccuracy" v-model="DecimalAccuracy" maxlength="5" value="12,2"></el-input>
                    <span class="help-block">小数精度，格式为：12,2表示总最大长度为12位，其中小数点后只保留2位数，精度改小可能会导致已有数据丢失。</span>
                </el-form-item>

                <el-form-item label="内容最大长度" v-show="['subtable','images','file'].indexOf(FieldType)<0">
                    <el-input-number controls-position="right" v-model="ValueLength" maxlength="9" :min="1" :max="999999999"></el-input-number>
                    <span class="help-block">中文占用两个字符，文本类型超过4000后将采用nvarchar(max)。</span>
                </el-form-item>
                <el-form-item label="默认值" v-show="['text','textarea','password','select','radio','checkbox','image','file'].indexOf(FieldType)>=0">
                    <el-input type="text" name="DefaultValue" v-model="DefaultValue" maxlength="50"></el-input>
                    <span class="help-block">字段的默认值，数值型默认值为0，日期型默认为当前日期</span>
                </el-form-item>
                <el-form-item label="自定义选项" v-show="['select','radio','checkbox'].indexOf(FieldType)>=0">
                    <el-input v-model="Items" type="textarea" :autosize="{ minRows: 4, maxRows: 6}"></el-input>
                    <span class="help-block">每行为一个列表选项,值和文本用“,”隔开，如：1,推荐</span>
                </el-form-item>
                <el-form-item label="选择类型" v-show="['select','cascader','datapicker'].indexOf(FieldType)>=0">
                    <el-radio-group v-model="IsMultipleSelect">
                        <el-radio :label="0">单选</el-radio>
                        <el-radio :label="1">多选</el-radio>
                    </el-radio-group>
                    <span class="help-block">多选下拉表单的数据类型建议设置为文本类</span>
                </el-form-item>
                <el-form-item label="可选择类型" v-show="['cascader','datapicker'].indexOf(FieldType)>=0">
                    <el-radio-group v-model="OnlySelectFinal">
                        <el-radio :label="1">只能选最终节点</el-radio>
                        <el-radio :label="0">可以选择任意节点</el-radio>
                    </el-radio-group>
                    <span class="help-block">此设置只对树形数据列表有效</span>
                </el-form-item>
                <el-form-item v-show="['editor'].indexOf(FieldType)>=0" label="编辑器类型">
                    <el-radio v-model="EditorStyle" label="small">精简版</el-radio>
                    <el-radio v-model="EditorStyle" label="simple">简洁版</el-radio>
                    <el-radio v-model="EditorStyle" label="normal">通用版</el-radio>
                    <el-radio v-model="EditorStyle" label="full">全功能版</el-radio>
                    <span class="help-block"></span>
                </el-form-item>
                <el-form-item label="编辑器宽度" v-show="['editor'].indexOf(FieldType)>=0">
                    <el-input v-model="EditorWidth" maxlength="10" style="width:300px"></el-input>
                    <span class="help-block">只能填写数值或百分比，不填写则默认100%宽度</span>
                </el-form-item>
                <el-form-item label="编辑器高度" v-show="['editor'].indexOf(FieldType)>=0">
                    <el-input v-model="EditorHeight" maxlength="10" style="width:300px"></el-input>
                    <span class="help-block">只能填写数值或百分比</span>
                </el-form-item>
                <el-form-item v-show="['image','images'].indexOf(FieldType)>=0" label="上传图片处理">
                    <el-checkbox v-model="Watermark" :true-label="1" :false-label="0">加水印</el-checkbox>
                    <el-checkbox v-model="Thumbnail" :true-label="1" :false-label="0">生成缩略图</el-checkbox>
                    <span class="help-block">水印图片在系统设置》文件上传中设置</span>
                </el-form-item>

                <el-form-item label="生成缩略图尺寸" v-show="FieldType=='image' || FieldType=='images'">
                    <el-button-group>
                        <el-input style="width:300px" v-model="ThumbnailWidth" maxlength="4">
                            <template slot="prepend">缩略图宽</template>
                            <template slot="append">px</template>
                        </el-input>

                        <el-input style="width:300px" v-model="ThumbnailHeight" maxlength="4">
                            <template slot="prepend">
                                缩略图高
                            </template>
                            <template slot="append">px</template>
                        </el-input>
                    </el-button-group>
                    <span class="help-block" id="thumbnailTips">0则表示不生成缩略图</span>

                </el-form-item>

                <el-form-item label="允许的上传格式" v-show="['image','file','images','files'].indexOf(FieldType)>=0">
                    <ui-tag v-model="UploadExt"></ui-tag>
                    <span class="help-block">多个后缀用半角逗号隔开，如.jpg,.gif,.png，如果出现禁止上传，到系统设置>安全>上传白名单中添加白名单即可。</span>
                </el-form-item>

                <el-form-item label="上传文件大小限制" v-show="['image','file','images','files'].indexOf(FieldType)>=0">
                    <el-input-number controls-position="right" maxlength="10"  v-model="UploadMaxsize" :min="0" :max="2147483647" class="form-control form-control-sm"></el-input-number>
                    <span class="help-block">0则不限制，单位为千字节(KB)</span>
                </el-form-item>

                <el-form-item label="上传图片最大宽度" v-show="['image','file','images','files','editor'].indexOf(FieldType)>=0">
                    <el-input-number controls-position="right" maxlength="6"  v-model="MaxImageWidth" :min="0" :max="10000"></el-input-number>
                    <span class="help-block validate-tips-box">0则不限制，单位为像素(PX)，原始图片超过最大宽度尺寸将会自动剪裁</span>
                </el-form-item>

                <el-form-item label="使用数据源" v-show="['select','checkbox','radio'].indexOf(FieldType)>=0">
                    <el-checkbox v-model="DatasourceOpen" :true-label="1" :false-label="0">关联数据源</el-checkbox>
                    <span class="help-block">数据源只对下拉表单、单选框和多选框有效，100条以上数据建议使用"数据选择器"表单。</span>
                </el-form-item>

                <el-form-item label="数据源类型" v-if="['datapicker'].indexOf(FieldType)>=0">
                    <el-radio v-model="SelectDataType" :label="0">普通列表数据</el-radio>
                    <el-radio v-model="SelectDataType" :label="1">树形列表数据</el-radio>
                    <span class="help-block">如栏目，分类等属于树形列表数据，请根据数据源实际情况设置，否则信息添加页面可能会报错</span>
                </el-form-item>

                <el-form-item label="数据源表" v-show="['datapicker'].indexOf(FieldType)>=0 || ['cascader'].indexOf(FieldType)>=0  || (['select','radio','checkbox'].indexOf(FieldType)>=0 && DatasourceOpen==1)">
                    <el-input v-model="DatasourceTable" maxlength="30"></el-input>
                    <span class="help-block">必须填写已经存在的表，如果是级联选择器必须是树型数据表</span>
                </el-form-item>

                <el-form-item label="数据筛选条件" v-show="['datapicker'].indexOf(FieldType)>=0 || ['cascader'].indexOf(FieldType)>=0  || (['select','radio','checkbox'].indexOf(FieldType)>=0 && DatasourceOpen==1)">
                    <el-input v-model="ZdyCondition" maxlength="150"></el-input>
                    <span class="help-block">如：id=5,采用sql语法，没有条件，请留空</span>
                </el-form-item>

                <el-form-item label="数据源值字段" v-show="false">
                    <el-input name="ValueField" v-model="ValueField" value="id" maxlength="30" readonly></el-input>
                    <span class="help-block">表单的value字段,只能为id字段</span>
                </el-form-item>

                <el-form-item label="数据源文本字段" v-show="['datapicker'].indexOf(FieldType)>=0 || ['cascader'].indexOf(FieldType)>=0 || (['select','radio','checkbox'].indexOf(FieldType)>=0 && DatasourceOpen==1)">
                    <el-button-group>
                        <el-input style="width:300px" v-model="TextField" maxlength="30">
                            <template slot="prepend">
                                字段名：
                            </template>
                        </el-input>
                        <el-input style="width:300px" v-model="TextFieldName" maxlength="30">
                            <template slot="prepend">
                                字段描述：
                            </template>
                        </el-input>
                    </el-button-group>
                    <span class="help-block">只能填写nvarchar、varchar类型的字段，字段名必须为数据库中的实际存在字段</span>
                </el-form-item>
                <el-form-item label=" 窗口尺寸" v-show="['subtable'].indexOf(FieldType)>=0 || ['datapicker'].indexOf(FieldType)>=0">
                    <el-button-group>
                        <el-input style="width:300px" v-model="WinWidth" value="90%" maxlength="20">
                            <template slot="prepend">
                                窗口宽：
                            </template>
                        </el-input>
                        <el-input style="width:300px" v-model="WinHeight" value="90%" maxlength="20">
                            <template slot="prepend">
                                窗口高：
                            </template>
                        </el-input>
                    </el-button-group>
                    <span class="help-block">支持数字和百分比</span>
                </el-form-item>

                <el-form-item label="按钮文本" v-show="['subtable','datapicker'].indexOf(FieldType)>=0">
                    <el-input v-model="BtText" maxlength="50"></el-input>
                    <span class="help-block"></span>
                </el-form-item>

                <el-form-item label="主附表关系" v-show="['subtable'].indexOf(FieldType)>=0">
                    <el-radio-group v-model="SubTableType">
                        <el-radio label="single" title="一条主表数据只对应一条附表数据">一对一</el-radio>
                        <el-radio label="multiple" title="一条主表数据是否可对应多条附表数据">一对多</el-radio>
                    </el-radio-group>
                    <span class="help-block"></span>

                </el-form-item>

                <el-form-item label="最大发布数" v-show="['images','files'].indexOf(FieldType)>=0">
                    <el-input-number  controls-position="right" v-model="MaxNum" :min="0" :max="99999999"></el-input-number>
                    <span class="help-block">0则表示不限制</span>
                </el-form-item>

                    <el-form-item label="数据排序方式" v-show="['cascader'].indexOf(FieldType)>=0 || ['subtable'].indexOf(FieldType)>=0 || ['datapicker'].indexOf(FieldType)>=0 || (['select','checkbox','radio'].indexOf(FieldType)>=0 && DatasourceOpen==1)">
                        <el-input v-model="Orderby" maxlength="50"></el-input>
                        <span class="help-block">排序方式，如id desc,可留空</span>
                    </el-form-item>

                    <el-form-item label="显示(每页)数" v-show="(['subtable'].indexOf(FieldType)>=0 && SubTableType=='multiple') || (['datapicker'].indexOf(FieldType)>=0 && SelectDataType==0)">
                        <el-input-number v-model="Pagesize" value="20" maxlength="4" :min="0" :max="9999"></el-input-number>
                        <span class="help-block">列表界面每页显示的记录数,如果分页则表示分页显示数</span>
                    </el-form-item>

                    <el-form-item label="基础属性">
                        <el-checkbox v-model="MustItem" :true-label="1" :false-label="0">必填项</el-checkbox> &nbsp;
                        <el-checkbox v-model="OnlyItem" :true-label="1" :false-label="0">值唯一项</el-checkbox>  &nbsp;
                        <el-checkbox v-model="OrderItem" :true-label="1" :false-label="0">排序项</el-checkbox>  &nbsp;
                        <el-checkbox v-model="Htmlencode" :true-label="1" :false-label="0">htmlEncode编码</el-checkbox> &nbsp;
                        <span class="help-block">排序项只对数值和日期字段有效，htmlEncode编码只对字符型数据有意义</span>
                    </el-form-item>


                    <el-form-item label="搜索匹配" v-show="['subtable','images','files'].indexOf(FieldType)<0">
                        <el-select v-model="SearchType" palceholder="请选择" :clearable="true">
                            <el-option value="fuzzy" label="模糊匹配"></el-option>
                            <el-option value="precise" label="精确匹配"></el-option>
                            <el-option value="in" label="多值匹配(in)"></el-option>
                            <el-option value="range" label="范围匹配"></el-option>
                        </el-select>
                        <span class="help-block">仅用于管理界面的自定义搜索</span>

                    </el-form-item>

                    <el-form-item label="序号">
                        <el-input-number controls-position="right" v-model="Xuhao" maxlength="4" :min="0" :max="9999"></el-input-number>
                        <span class="help-block"></span>
                    </el-form-item>
</el-form>
        </el-tab-pane>

        <el-tab-pane label="权限设置" name="two">
            <el-form label-width="150px" class="small" label-position="left" size="medium">
                <el-form-item label="模板页数据读取">
                    <el-checkbox :true-label="1" :false-label="0" v-model="ListItem">列表页读取</el-checkbox>
                    <el-checkbox :true-label="1" :false-label="0" v-model="DetailItem">内容页读取</el-checkbox>
                    <span class="help-block">用于限制前台模板标签默认读取字段，根据需要配置可提升数据读取速度</span>
                </el-form-item>

                <el-form-item label="管理员权限">
                    <el-checkbox :true-label="1" :false-label="0" v-model="AdminListItem">管理列表项</el-checkbox>
                    <el-checkbox :true-label="1" :false-label="0" v-model="AdminCanAdd">可添加</el-checkbox>
                    <el-checkbox :true-label="1" :false-label="0" v-model="AdminCanEdit">可编辑</el-checkbox>
                    <span class="help-block">多行文本和编辑器不建议设为列表项，否则影响加载速度</span>
                </el-form-item>

                <el-form-item label="会员权限">
                    <el-checkbox :true-label="1" :false-label="0" v-model="MemberListItem">管理列表项</el-checkbox>
                    <el-checkbox :true-label="1" :false-label="0" v-model="MemberCanAdd">可添加</el-checkbox>
                    <el-checkbox :true-label="1" :false-label="0" v-model="MemberCanEdit">可编辑</el-checkbox>
                    <span class="help-block">多行文本和编辑器不建议设为列表项，否则影响加载速度</span>
                </el-form-item>

                <el-form-item label="游客权限">
                    <el-checkbox :true-label="1" :false-label="0" v-model="AnonymousCanAdd">可发布</el-checkbox>
                    <el-checkbox :true-label="1" :false-label="0" v-model="AnonymousCanEdit" v-show="false">可编辑</el-checkbox>
                    <span class="help-block">不选则投稿表单中不生成对应字段的表单代码</span>
                </el-form-item>


                <el-form-item label="管理员角色权限">
                    <ui-select v-model="RoleIds" :multiple=true :clearable="true" style="width:100%" v-bind:options="@Html.GetOptionsJson("pa_role", "name", "", "id asc")" ></ui-select>
                    <span class="help-block">不选择则默认所有管理员角色有权限，只用于后台信息管理，超级管理员不受限制</span>
                </el-form-item>


                <el-form-item label="会员组权限">
                    <ui-select v-model="MemberGroupIds" :multiple="true" style="width:100%" v-bind:options="@Html.GetOptionsJson("pa_member_group", "name", "", "Rank asc")"></ui-select>
                    <span class="help-block">不选择则默认所有会员组有权限，只用于会员中心</span>
                </el-form-item>


                <el-form-item label="无权限替换代码">
                    <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6}" v-model="NoPermissionContent"></el-input>
                    <span class="help-block">无权限时这里内容将显示在表单代码中</span>
                </el-form-item>
            </el-form>
        </el-tab-pane>

        <el-tab-pane label="自定义属性" name="three">
            <el-form label-width="150px" class="small" label-position="left" size="medium">
                <el-form-item label="管理列表列宽">
                    <el-input-number  controls-position="right" v-model="ListWidth" :min="0" :max="1000"  style="width:300px" placeholder="列表的宽度">
                    </el-input-number>
                    <span class="help-block">填写数字即可，0为不限制</span>
                </el-form-item>
                <el-form-item label="管理列表显示字数">
                    <el-input-number  controls-position="right" v-model="ListWords" :min="0" :max="1000" style="width:300px">
                    </el-input-number>
                    <span class="help-block">填写数字即可，0为不限制</span>
                </el-form-item>
                <el-form-item label="数据验证类型">
                    <el-input v-model="DataType" maxlength="100"></el-input>
                    <span class="help-block">留空则由系统根据表单和值类型自动识别，如需个性化验证请在/FrameUi/1.0/validateForm.js文件中自行添加后再填写。</span>
                </el-form-item>

                <el-form-item label="字段提示">
                    <el-input v-model="Tips" maxlength="100"></el-input>
                    <span class="help-block">显示在字段对应的一下行</span>
                </el-form-item>

                <el-form-item label="自定义标签属性" v-show="['zdy'].indexOf(FieldType)<0">
                    <el-input v-model="InputParams" type="textarea" :autosize="{ minRows: 4, maxRows: 6}"></el-input>
                    <span class="help-block">每行一个属性，将添加到表单标签上,row:开头的属性将应用在表单外层容器上，如：row:v-show="true"</span>
                </el-form-item>

                <el-form-item label="提交前运行js">
                    <label class="control-label"></label>
                    <el-input v-model="BeforeSubmitJs" type="textarea" :autosize="{ minRows: 4, maxRows: 6}"></el-input>
                    <span class="help-block">在提交到服务器前执行的javascript脚本，必须返回true或flase,false则表单不提交</span>
                </el-form-item>
                <el-form-item label="表单附加内容" v-show="['zdy'].indexOf(FieldType)<0">
                    <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 6}" v-model="AdditionalContent"></el-input>
                    <span class="help-block">自动加载到默认表单代码的后面</span>
                </el-form-item>
            </el-form>
        </el-tab-pane>
    </el-tabs>
    <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 id = "@Id";
    var formData =@Html.RawModel(Model);
    formData.tabIndex = 0;
    formData.DefaultValueOld = formData.DefaultValue;
    formData.ValueLengthOld = formData.ValueLength;
    formData.DecimalAccuracyOld = formData.DecimalAccuracy;
    formData.activeName = "first";
    if (formData.Id == "")
    {
        formData.TableName = "@Request.QueryString["table"]";
        formData.Id = 0;
        formData.ValueType = "nvarchar";
        formData.FieldType = "text";
        formData.IsMultipleSelect = 0;
        formData.EditorStyle = 'normal';
        formData.EditorHeight = 200;
        formData.SelectDataType =0;
        formData.ValueField = "id";
        formData.ListWords = 50;
        formData.ListItem = 1;
        formData.DetailItem = 1;
        formData.AdminListItem = 0;
        formData.MemberListItem = 0;
        formData.AdminCanAdd = 1;
        formData.AdminCanEdit = 1;
        formData.MemberCanAdd = 0;
        formData.MemberCanEdit =0;
        formData.AnonymousCanAdd =0;
        formData.Xuhao = @xuhao;
        formData.ValueLength = 50;
        formData.WinWidth = "90%";
        formData.WinHeight = "90%";
        formData.Pagesize = 20;
        formData.Rename = 1;
        formData.Watermark = 1;
        formData.Thumbnail = 1;
        formData.ThumbnailWidth = 800;
        formData.ThumbnailHeight = 800;
        formData.UploadMaxsize = 1024;
        formData.MaxImageWidth =1920;
        formData.MaxNum = 0
        formData.SubTableType = "multiple";
        formData.BtText = "管理";
        formData.UploadExt = ".jpg,.png,.gif";
        formData.OnlySelectFinal = 1;
    }
    else
    {
        if (formData.DefaultValue == null)
        {
            formData.DefaultValue = "";
        }
        formData.ValueLengthOld = formData.ValueLength;
        formData.DecimalAccuracyOld = formData.DecimalAccuracy;
        formData.DefaultValueOld = formData.DefaultValue;
    }
    function beforeSubmit()
    {
        
    }
    var vue = new Vue({
        el: "#main",
        data: formData,
        methods: {
            postSubmit: function () {
                var validated = this.validateForm({});//jquery表单验证
                if (validated) {
                    this.submit({ url: "@Url.ActionUrl()", beforeExecute: beforeSubmit, data: formData, success: function () { postBack() } });
                }
            }
        },
    });

    function postBack() {
        parent.loadData();
        var url = location.href;
        if (id == "")
        {
            if (url.indexOf("xuhao=") < 0)
            {
                location.href = url + "&xuhao=" + formData.Xuhao;
            }
            else
            {
                location.href = url.replace(/(\?|&)xuhao=[0-9]*/, "$1xuhao=@xuhao");
            }
        }
    }
</script>
