|
|
|
@ -99,7 +99,7 @@
|
|
|
|
|
<if condition="$data['server_name'] neq ''"><option value="{$data['server_name']}">{$data['server_name']}</option></if>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<?php if (!empty($data['attachment_url'])):?>
|
|
|
|
|
<?php if (!empty($data['attachment_url']) || $data['type'] == 2):?>
|
|
|
|
|
<div class="input-list">
|
|
|
|
|
<div id="uploader" class="wu-example">
|
|
|
|
|
<div class="btns">
|
|
|
|
@ -107,9 +107,11 @@
|
|
|
|
|
</div>
|
|
|
|
|
<!--用来存放文件信息-->
|
|
|
|
|
<div id="thelist" class="uploader-list">
|
|
|
|
|
<?php if (!empty($data['attachment_url'])):?>
|
|
|
|
|
<div id="beforeupload" class="item">
|
|
|
|
|
<h4 class="info">已有附件<a href="javascript:;" class="jsdelzip table_click" style="float:none;display:inline-block;margin-left:10px;" onclick="$('#file_url').val('');$(this).parents('#beforeupload').remove()">删除</a><a href="{$data.attachment_url}" target="_blank" style="float:none;display:inline-block;margin-left:10px;">下载</a></h4>
|
|
|
|
|
</div>
|
|
|
|
|
<?php endif;?>
|
|
|
|
|
</div>
|
|
|
|
|
<input type="hidden" id="file_url" name="attachment_url" value="{$data['attachment_url']}"/>
|
|
|
|
|
</div>
|
|
|
|
@ -319,7 +321,7 @@
|
|
|
|
|
}, {
|
|
|
|
|
beforeSendFile: function(file){
|
|
|
|
|
//秒传验证
|
|
|
|
|
if (file['source']['ext'] === 'zip' || file['source']['ext'] === 'rar') {
|
|
|
|
|
if (true) {
|
|
|
|
|
var task = new $.Deferred();
|
|
|
|
|
var start = new Date().getTime();
|
|
|
|
|
(new WebUploader.Uploader()).md5File(file, 0, 10*1024*1024).progress(function(percentage){
|
|
|
|
@ -357,7 +359,7 @@
|
|
|
|
|
}
|
|
|
|
|
, beforeSend: function(block){
|
|
|
|
|
//分片验证是否已传过,用于断点续传
|
|
|
|
|
if (block['file']['source']['ext'] === 'zip' || block['file']['source']['ext'] === 'rar') {
|
|
|
|
|
if (true) {
|
|
|
|
|
var task = new $.Deferred();
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST"
|
|
|
|
@ -384,7 +386,7 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
, afterSendFile: function(file){
|
|
|
|
|
if (file['source']['ext'] === 'zip' || file['source']['ext'] === 'rar') {
|
|
|
|
|
if (true) {
|
|
|
|
|
var chunksTotal = 0;
|
|
|
|
|
if((chunksTotal = Math.ceil(file.size/chunkSize)) > 1){
|
|
|
|
|
//合并请求
|
|
|
|
@ -431,11 +433,6 @@
|
|
|
|
|
pick: {id:'#picker'},
|
|
|
|
|
//dnd: "#theList",
|
|
|
|
|
paste: document.body,
|
|
|
|
|
accept: {
|
|
|
|
|
title: '压缩包',
|
|
|
|
|
extensions: 'rar,zip',
|
|
|
|
|
mimeTypes: '.rar,.zip',
|
|
|
|
|
},
|
|
|
|
|
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
|
|
|
|
resize: false,
|
|
|
|
|
disableGlobalDnd: true,
|
|
|
|
@ -450,14 +447,14 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
uploaderFile.on('beforeFileQueued',function(file){
|
|
|
|
|
var mycars=new Array("zip","rar","tar","jar");
|
|
|
|
|
if($.inArray(file.ext,mycars) == -1){
|
|
|
|
|
updateAlert('上传文件非法','tip_error');
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
$('#tip').find('.tipclose').click();
|
|
|
|
|
},1500);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// var mycars=new Array("zip","rar","tar","jar");
|
|
|
|
|
// if($.inArray(file.ext,mycars) == -1){
|
|
|
|
|
// updateAlert('上传文件非法','tip_error');
|
|
|
|
|
// setTimeout(function(){
|
|
|
|
|
// $('#tip').find('.tipclose').click();
|
|
|
|
|
// },1500);
|
|
|
|
|
// return false;
|
|
|
|
|
// }
|
|
|
|
|
if ($('#file_url').val()) {
|
|
|
|
|
layer.msg('请先删除原文件后,再上传');
|
|
|
|
|
return false;
|
|
|
|
|