@{ 
    Layout = null;
}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>PageAdmin上传界面</title>
    <link rel="stylesheet" type="text/css" href="/Incs/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="/Incs/webuploader/style.css">
    <script type="text/javascript" src="/Js/jquery.min.js"></script>
    <script type="text/javascript" src="~/Js/basic.js"></script>
    <script type="text/javascript" src="/Incs/layer/layer.js"></script>
    <script type="text/javascript" src="/Incs/webuploader/webuploader.js"></script>
</head>
<body>
    <div id="uploader" class="wu-example">
        <div class="queueList">
            <div id="dndArea" class="placeholder">
                <div id="filePicker"></div>
                <p id="uploadRemark">已可以将文件拖到这里进行上传</p>
            </div>
        </div>
        <div class="statusBar" style="display: none;">
            <div class="progress">
                <span class="text">0%</span>
                <span class="percentage"></span>
            </div>
            <div class="info"></div>
            <div class="btns">
                <div id="filePicker2"></div>
                <div class="uploadBtn">开始上传</div>
            </div>
        </div>
        @Html.AntiForgeryToken()
    </div>
    <script type="text/javascript">
        var parentObjName = "@Server.HtmlEncode(Request.QueryString["objName"])";
        var path = Request("path");
        var $parentObj = parent.$(parentObjName);
        if($parentObj.length==0)
        {
            $("#uploader").html("缺少必须的父级对象！");
            hasError = true;
        }
        var hasError = false;
        var BASE_URL = "/Incs/webuploader/"; //插件目录
        var serverUploadUrl = "@Url.Action("Index","UploadPanel")"; //服务器后台处理路径
        var jsonData = new Array(); //服务器返回的jsonData

        //判断是否和父级页面域名一样
        if (parent.location == self.location) {
            $(".main").html("无效的请求！");
            hasError = true;
        }

        //判断域名是否匹配
        if (document.domain != parent.document.domain) {
            $("#uploader").html("非法请求！");
        }
        if (hasError) {
            $("#uploader").html();
        }

        var defaultoptions = { fileName:"", fileNumLimit: "1", fileSizeLimit: "0", fileSingleSizeLimit: "1024", extensions: ".gif,.jpg,.jpeg,.png", mimeTypes: "*/*", rename:0,uploadRootPath: "/Upload/",uploadPath:"Temp",callBack:""};
        var UploadOptions = eval("({" + $parentObj.attr("data-upload-params") + "})")
        defaultoptions = $.extend(defaultoptions, UploadOptions);

        var fileNumLimit = defaultoptions.fileNumLimit; //文件总数限制
        var fileSizeLimit = defaultoptions.fileSizeLimit; //单位kb，总大小
        var fileSingleSizeLimit = defaultoptions.fileSingleSizeLimit; //单位kb，单个文件大小
        var extensions = defaultoptions.extensions;  //允许的文件后缀，不带点，多个用逗号分割。
        var mimeTypes = defaultoptions.mimeTypes //mime类型"
        var rename = defaultoptions.rename;//是否重命名
        var uploadRootPath = defaultoptions.uploadRootPath;//上传文件的根目录
        var uploadPath = defaultoptions.uploadPath;//上传文件的当前目录
        var fileName = defaultoptions.fileName;
        if (uploadPath == "")
        {
            uploadPath = path;
        }
        var callBack = defaultoptions.callBack;

        function CallBack(successNum)
        {
            if (typeof (parent.UploadedComplete) == "function") 
            {
                parent.UploadedComplete();
            }
            else
            {
                if (jsonData.length > 0) {
                    parent.UploadPaneledCallBack(parentObjName, jsonData)
                }
            }
            CloseDialog();
        }

        function CloseDialog() //关闭弹出层
        {
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        }
        var __RequestVerificationToken = $("[name='__RequestVerificationToken']").eq(0).val();
    </script>
    <script type="text/javascript" src="/Incs/webuploader/uploadZdy.js"></script>
</body>
</html>
