function dodel(t){uploader.removeFile(t),$("#"+t).remove()}var host,multipart_params,NowDir=$("#NowDir").text();$.ajax({url:"ajax.php?act=Upfile",type:"POST",data:{dir:NowDir},dataType:"json",async:!1,success:function(t){var a=t.data;switch(a.type){case"local":host="ajax.php?act=Upfile",multipart_params={dir:NowDir};break;case"oss":host=a.host,multipart_params={key:a.dir+"${filename}",policy:a.policy,OSSAccessKeyId:a.accessid,success_action_status:"200",signature:a.signature};break;case"cos":host=a.host,multipart_params={key:a.dir+"${filename}",policy:a.policy,"q-sign-algorithm":"sha1",success_action_status:"200","q-ak":a.secretId,keytime:a.keytime,signature:a.signature}}}});var uploader=new plupload.Uploader({runtimes:"html5,flash,silverlight,html4",browse_button:"selectfiles",url:host,flash_swf_url:"page/file/upload/plupload/Moxie.swf",silverlight_xap_url:"page/file/upload/plupload/Moxie.xap",multipart_params:multipart_params,filters:{prevent_duplicates:!0},init:{PostInit:function(){$("#postfiles").click(function(){return uploader.start(),!1})},FilesAdded:function(t,a){plupload.each(a,function(t){$("#fileList").append('<tr id="'+t.id+'"><td>'+t.name+"</td><td>"+plupload.formatSize(t.size)+'</td><td><div class="layui-progress layui-progress-big " lay-showpercent="true""><div id="'+t.id+'_jdt" class="layui-progress-bar layui-bg-blue" style="width:0%"><span class="layui-progress-text">0%</span></div></div></td><td id="'+t.id+'_zt">等待上传</td><td><button class="layui-btn layui-btn-xs layui-btn-danger" onclick="dodel(\''+t.id+"')\">删除</button></td></tr>")})},BeforeUpload:function(t,a){$("#"+a.id+"_zt").html('<span style="color: #009688;">正在上传</span>')},UploadProgress:function(t,a){var s=$("#"+a.id+"_jdt");s.css("width",a.percent+"%"),s.children("span").text(a.percent+"%")},FileUploaded:function(t,a,s){var e=$("#"+a.id+"_zt");200==s.status||203==s.status?e.html('<span style="color: #1E9FFF;">上传成功</span>'):e.html('<span style="color: #FF5722;">上传失败</span>')}}});uploader.init();