112 lines
5.8 KiB
HTML
Executable File
112 lines
5.8 KiB
HTML
Executable File
<!DOCTYPE HTML>
|
||
<html lang="en">
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||
<title>文件管理</title>
|
||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/adminlte/webuploader/dist/webuploader.css">
|
||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/adminlte/webuploader/style/style.css">
|
||
</head>
|
||
<body>
|
||
<div id="wrapper">
|
||
<div id="container">
|
||
<!--头部,文件选择和格式选择-->
|
||
<div id="uploader">
|
||
<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 class="saveBtn">确定使用</div>
|
||
</div>
|
||
</div>
|
||
<div class="queueList">
|
||
<div id="dndArea" class="placeholder">
|
||
<div id="filePicker"></div>
|
||
<p>或将文件拖到这里,单次最多可选<?php echo empty($num)?1:$num;?>个</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="fileWarp" style="display:none;">
|
||
<fieldset>
|
||
<legend>列表</legend>
|
||
<ul></ul>
|
||
</fieldset>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- jQuery 3 -->
|
||
<script src="__PUBLIC__/adminlte/bower_components/jquery/dist/jquery.min.js"></script>
|
||
<!-- Bootstrap 3.3.7 -->
|
||
<script src="__PUBLIC__/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
|
||
<script type="text/javascript" src="__PUBLIC__/adminlte/webuploader/dist/webuploader.min.js"></script>
|
||
<script type="text/javascript">
|
||
var BASE_URL = '__PUBLIC__';
|
||
var bgmoudle = 'admin';
|
||
var webuploader_config = {
|
||
"swf": BASE_URL + "/adminlte/webuploader/dist/Uploader.swf",
|
||
"server": "<?php echo $uploadurl;?>",
|
||
"deleteurl": "<?php echo $deleteurl;?>",
|
||
"chunked": false,
|
||
"chunkSize": 512 * 1024,
|
||
"fileNumLimit": "<?php echo empty($num)?1:$num;?>",
|
||
"fileSizeLimit": 512 * 1024 * 1024,
|
||
"fileSingleSizeLimit": 512 * 1024 * 1024,
|
||
"fileVal": "file",
|
||
"auto": true,
|
||
"type": "<?php echo ucfirst($type);?>",
|
||
"compress": false, //不启用压缩
|
||
"resize": false, //尺寸不改变
|
||
"formData": {},
|
||
"pick": {id: '#filePicker', label: '点击选择文件', "name": "file", "multiple": false},
|
||
"thumb": {"width": 110, "height": 110, "quality": 70, "allowMagnify": true, "crop": true, "preserveHeaders": false, "type": "image\/jpeg"}
|
||
};
|
||
$(function() {
|
||
/*点击保存按钮时
|
||
*判断允许上传数,检测是单一文件上传还是组文件上传
|
||
*如果是单一文件,上传结束后将地址存入$input元素
|
||
*如果是组文件上传,则创建input样式,添加到$input后面
|
||
*隐藏父框架,清空列队,移除已上传文件样式*/
|
||
$(".statusBar .saveBtn").click(function() {
|
||
var callback = "<?php echo $func;?>";
|
||
var num = "<?php echo $num;?>";
|
||
var target = "<?php echo $target;?>";
|
||
var thumb = "<?php echo $thumb;?>";
|
||
var fileurl_tmp = [];
|
||
if (callback != "undefined") {
|
||
if (num > 1) {
|
||
$("input[name^='fileurl_tmp']").each(function(index, dom) {
|
||
fileurl_tmp[index] = dom.value;
|
||
});
|
||
} else {
|
||
fileurl_tmp = $("input[name^='fileurl_tmp']").val();
|
||
}
|
||
eval('window.parent.' + callback + '(fileurl_tmp,target);');
|
||
window.parent.webuploader_modal_close();
|
||
return;
|
||
}
|
||
if (num > 1) {
|
||
var fileurl_tmp = "";
|
||
$("input[name^='fileurl_tmp']").each(function() {
|
||
fileurl_tmp += '<li rel="' + this.value + '"><input class="input-text" type="text" name="<?php echo $target;?>[]" value="' + this.value + '" /><a href="javascript:void(0);" onclick="ClearPicArr(\'' + this.value + '\',\'\')">删除</a></li>';
|
||
});
|
||
$("#" + target, window.parent.document).append(fileurl_tmp);
|
||
} else {
|
||
if (thumb) {
|
||
$('#' + thumb, window.parent.document).find('img').attr('src', $("input[name^='fileurl_tmp']").val());
|
||
}
|
||
if (target) {
|
||
$("#" + target, window.parent.document).val($("input[name^='fileurl_tmp']").val());
|
||
}
|
||
}
|
||
window.parent.webuploader_modal_close();
|
||
// $('#modal-image', window.parent.document).on('hidden.bs.modal', function(e) {
|
||
// window.parent.document.find("div.modal-backdrop").remove();
|
||
// }).modal('hide').remove();
|
||
});
|
||
});
|
||
</script>
|
||
<script type="text/javascript" src="__PUBLIC__/adminlte/webuploader/style/upload.js"></script>
|
||
</body>
|
||
</html>
|