<div class="main" id="main">
    <el-form label-position="left" label-width="100px">
        <el-form-item label="原名称">
            <el-input v-model="name" maxlength="50" readonly></el-input>
            <span class="help-block validate-tips-box"></span>
        </el-form-item>
        <el-form-item label="新文件名" v-if="type==1">
            <el-input v-model="newName" maxlength="50" v-validate="{data:newName,dataType:'file',nullMsg:'请填写新文件名!',errorMsg:'文件格式错误!'}"></el-input>
            <span class="help-block validate-tips-box">必须填写扩展名，如：newname.html</span>
        </el-form-item>
        <el-form-item label="新目录名" v-else>
            <el-input v-model="newName" maxlength="50" v-validate="{data:newName,dataType:'*',nullMsg:'请填写新目录名!',errorMsg:'目录名格式错误!'}"></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>
    var formData = { name: "@Request.QueryString["name"]", path: "@Request.QueryString["path"]", type:@(StringHelper.Format<int>(Request.QueryString["type"])), newName: '',siteId:"@ViewBag.CurrentSiteId"};
    var vue= new Vue({
        el: "#main",
        data: formData,
        methods: {
            postSubmit: function () {
                var validated = this.validateForm({ tipsStyle: 1 });//jquery表单验证
                if (validated)
                {
                    this.submit({ url: "@Url.ActionUrl()", data: formData, success: "PostBack()"});
                }
            },
        },
    });
    function PostBack() {
        parent.loadData();
        closeSelf();
    }
</script>
