rabin преди 7 години
родител
ревизия
99cd66aa4f

+ 11 - 4
assets/public/layui/upload.js

@@ -11,17 +11,23 @@ function loadUpload(i,e,key,upload,assets)
 	upload[value] = true;
 
 	var id = e.attr('id');
-	layui.use('upload', function() {
+	layui.use(['upload','layer'], function() {
+		var layer = layui.layer;
+		var layer_1 = false;
 		var layuiUpload = layui.upload;
 		var uploadInst = layuiUpload.render({
 			elem: '#' + id
-			,data: {'title' : key}
-			,field: 'Filedata'
+			,data: {'key' : key}
+			,field: 'file'
 			,url: upload
 			,multiple: true
+			,choose: function(obj){
+				layer_1 = layer.load(0, {shade: false});
+			}
 			,done: function(data) {
 				//var data = eval('('+res+')');
-				if (data.status) {
+				layer.closeAll('loading');
+				if (data.status == 1) {
 					var mul = e.attr('mul');
 					if (mul == 'yes') {
 						if (e.attr('t') == 'file') {
@@ -69,6 +75,7 @@ function loadUpload(i,e,key,upload,assets)
 						$('#'+value).val(data.url);
 					}
 				} else {
+					layer.msg(data.message, {icon: 4});
 					//$("#"+file.id).find('.data').html("<font color='red'>"+data.message+"</font>");
 					return false;
 				}

+ 0 - 92
assets/public/upload/css/uploadify.css

@@ -1,92 +0,0 @@
-/*
-Uploadify
-Copyright (c) 2012 Reactive Apps, Ronnie Garcia
-Released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
-*/
-
-.uploadify {
-	position: relative;
-	margin-bottom: 1em;
-}
-.uploadify-button {
-	background-color: #505050;
-	background-image: linear-gradient(bottom, #505050 0%, #707070 100%);
-	background-image: -o-linear-gradient(bottom, #505050 0%, #707070 100%);
-	background-image: -moz-linear-gradient(bottom, #505050 0%, #707070 100%);
-	background-image: -webkit-linear-gradient(bottom, #505050 0%, #707070 100%);
-	background-image: -ms-linear-gradient(bottom, #505050 0%, #707070 100%);
-	background-image: -webkit-gradient(
-		linear,
-		left bottom,
-		left top,
-		color-stop(0, #505050),
-		color-stop(1, #707070)
-	);
-	background-position: center top;
-	background-repeat: no-repeat;
-	-webkit-border-radius: 30px;
-	-moz-border-radius: 30px;
-	border-radius: 30px;
-	border: 2px solid #808080;
-	color: #FFF;
-	font: bold 12px Arial, Helvetica, sans-serif;
-	text-align: center;
-	text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
-	width: 100%;
-}
-.uploadify:hover .uploadify-button {
-	background-color: #606060;
-	background-image: linear-gradient(top, #606060 0%, #808080 100%);
-	background-image: -o-linear-gradient(top, #606060 0%, #808080 100%);
-	background-image: -moz-linear-gradient(top, #606060 0%, #808080 100%);
-	background-image: -webkit-linear-gradient(top, #606060 0%, #808080 100%);
-	background-image: -ms-linear-gradient(top, #606060 0%, #808080 100%);
-	background-image: -webkit-gradient(
-		linear,
-		left bottom,
-		left top,
-		color-stop(0, #606060),
-		color-stop(1, #808080)
-	);
-	background-position: center bottom;
-}
-.uploadify-button.disabled {
-	background-color: #D0D0D0;
-	color: #808080;
-}
-.uploadify-queue {
-	margin-bottom: 1em;
-}
-.uploadify-queue-item {
-	background-color: #F5F5F5;
-	-webkit-border-radius: 3px;
-	-moz-border-radius: 3px;
-	border-radius: 3px;
-	font: 11px Verdana, Geneva, sans-serif;
-	margin-top: 5px;
-	max-width: 350px;
-	padding: 10px;
-}
-.uploadify-error {
-	background-color: #FDE5DD !important;
-}
-.uploadify-queue-item .cancel a {
-	background: url('../images/uploadify-cancel.png') 0 0 no-repeat;
-	float: right;
-	height:	16px;
-	text-indent: -9999px;
-	width: 16px;
-}
-.uploadify-queue-item.completed {
-	background-color: #E5E5E5;
-}
-.uploadify-progress {
-	background-color: #E5E5E5;
-	margin-top: 10px;
-	width: 100%;
-}
-.uploadify-progress-bar {
-	background-color: #0099FF;
-	height: 3px;
-	width: 1px;
-}

BIN
assets/public/upload/image/uploadify-cancel.png


Файловите разлики са ограничени, защото са твърде много
+ 0 - 15
assets/public/upload/js/jquery.uploadify.min.js


+ 0 - 147
assets/public/upload/js/upload.js

@@ -1,147 +0,0 @@
-var upload_pic = [];
-var upload_file = [];
-var upload = [];
-
-function loadUpload(i,e,key,upload,assets)
-{
-	var value = e.attr('v');
-	if(typeof(upload[value]) != "undefined")
-	{
-		return;
-	}
-	upload[value] = true;
-	e.uploadify({
-				'formData' : {'key' : key},
-				'swf' : assets + 'uploadify.swf',
-				'buttonText' : '选择文件',
-				'fileObjName' : 'file',
-				'uploader'  : upload,
-				'cancelImg' : assets + 'upload/img/fyuploadify-cancel.png',
-				'onUploadSuccess':function(file,data,response)
-				{
-					//console.info(data);
-					var data = eval('('+data+')');
-					if(data.status)
-					{
-						var mul = e.attr('mul');
-						if(mul == 'yes')
-						{
-							if(e.attr('t') == 'file')
-							{
-								if(upload_file.length <= 0 && $("#" + value).val())
-								{
-									upload_file = $("#" + value).val().split(',');
-								}
-
-								var m = $('.' +value+'_mul');
-								var i = m.find('li').eq(upload_file.length);
-								if(i.length)
-								{
-									i.find('a').eq(0).html(data.data.name);
-								}
-								else
-								{
-									m.append('<li><a href="'+data.data.url+'" target="_blank" title="点此下载" >'+data.data.name+'</a>&nbsp;&nbsp;<a href="javascript:;" title="点此删除" style="color:red;" onclick="fileDel($(this), \''+value+'\')">[删除]</a></li>');
-								}
-
-								upload_file.push(data.data.url);
-
-								$("#" + value).val(upload_file.join(','));
-							}
-							else
-							{
-								if(upload_pic.length <= 0 && $("#" + value).val())
-								{
-									upload_pic = $("#" + value).val().split(',');
-								}
-								var m = $('.' +value+'_mul');
-								var i = m.find('img').eq(upload_pic.length);
-								if(i.length)
-								{
-									i.attr('src', data.data.url);
-								}
-								else
-								{
-									m.append('<a href="javascript:;" title="点此删除" onclick="picDel($(this), \''+value+'\')"><img src="'+data.data.url+'" width="150" style="margin-left:5px;" alt="点此删除"/></a>');
-								}
-
-								upload_pic.push(data.data.url);
-
-								$("#" + value).val(upload_pic.join(','));
-							}
-							
-						}
-						else
-						{
-							if(e.attr('t') == 'file')
-							{
-								
-							}
-							else
-							{
-								$('#show_'+value).attr('src',data.data.url).show();
-							}
-							$("#"+file.id).find('.data').html('上传完毕');
-							$('#'+value).val(data.data.url);
-							
-						}
-					}
-					else
-					{
-						$("#"+file.id).find('.data').html("<font color='red'>"+data.data.message+"</font>");
-						return false;
-					}
-				}
-	});
-}
-
-/*
-if(jQuery.browser.msie){
-SWFUpload.prototype.getFlashHTML = function () {
-	return ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
-				'<param name="wmode" value="', this.settings.button_window_mode , '" />',
-				'<param name="movie" value="', this.settings.flash_url, '" />',
-				'<param name="quality" value="high" />',
-				'<param name="menu" value="false" />',
-				'<param name="allowScriptAccess" value="always" />',
-				'<param name="flashvars" value="' + this.getFlashVars() + '" />',
-				'</object>'].join("");
-    }
-}
-*/
-function picDel(e,v)
-{
-	if(confirm('确定要删除图片吗?'))
-	{
-		if(upload_pic.length <= 0 && $("#" + v).val())
-		{
-			upload_pic = $("#" + v).val().split(',');
-		}
-		var p = e.find('img').attr('src');
-		e.remove();
-		upload_pic.remove(p);
-		//console.info(pic);
-		$("#" + v).val(upload_pic.join(','));
-	}
-}
-
-
-function fileDel(e,v)
-{
-	if(confirm('确定要删除文件吗?'))
-	{
-		if(upload_file.length <= 0 && $("#" + v).val())
-		{
-			upload_file = $("#" + v).val().split(',');
-		}
-
-		var parent = e.parent();
-		var p = parent.find('a').eq(0).attr('href');
-		
-		parent.remove();
-		upload_file.remove(p);
-		//console.info(pic);
-		$("#" + v).val(upload_file.join(','));
-	}
-}
-

+ 0 - 64
assets/public/upload/js/upload_avatar.js

@@ -1,64 +0,0 @@
-var reorder = 0;
-
-function loadUpload(i,e,key,upload,assets)
-{
-	e.uploadify({
-				'formData' : {'key' : key},
-				'swf' : assets + 'uploadify.swf',
-				'buttonText' : '选择文件',
-				'uploader'  : upload,
-				'cancelImg' : assets + 'image/uploadify-cancel.png',
-				'width':'65',//选择文件按钮的宽度
-        		'height':'65',//选择文件按钮的高度
-        		'buttonText'    :   '',
-        		//'buttonClass'   :  'update',
-
-				'onUploadSuccess':function(file,data,response)
-				{
-					console.info(data);
-					var data = eval('('+data+')');
-					if(data.status)
-					{
-						var value = e.attr('v');
-						if(value.indexOf('mul') != -1 && $(value).length)
-						{
-							var img = '<img src="'+data.url+'" width="">';
-							$(value).eq(reorder).html(img);
-
-							$("#content").val($("#content").val() + "<br />" + img);
-							reorder++;
-
-							if(reorder > 5)
-							{
-								reorder = 0;
-							}
-						}
-						else
-						{
-							jQuery("#"+file.id).find('.data').html('上传完毕');
-							jQuery("#"+file.id).hide();
-							jQuery('#'+value).val(data.url);
-							jQuery('#show_'+value).attr('src',data.url).show();
-						}
-					}
-					else
-					{
-						jQuery("#"+file.id).find('.data').html("<font color='red'>"+data.message+"</font>");
-						return false;
-					}
-				}
-	});
-}
-
-if(jQuery.browser.msie){
-SWFUpload.prototype.getFlashHTML = function () {
-	return ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
-				'<param name="wmode" value="', this.settings.button_window_mode , '" />',
-				'<param name="movie" value="', this.settings.flash_url, '" />',
-				'<param name="quality" value="high" />',
-				'<param name="menu" value="false" />',
-				'<param name="allowScriptAccess" value="always" />',
-				'<param name="flashvars" value="' + this.getFlashVars() + '" />',
-				'</object>'].join("");
-    }
-}

+ 0 - 79
assets/public/upload/js/upload_niuyou.js

@@ -1,79 +0,0 @@
-var reorder = 0;
-
-function loadUpload(i,e,key,upload,assets)
-{
-	e.uploadify({
-				'formData' : {'key' : key},
-				'swf' : assets + 'uploadify.swf',
-				'buttonText' : '选择文件',
-				'uploader'  : upload,
-				'cancelImg' : assets + 'image/uploadify-cancel.png',
-				'width':'160',//选择文件按钮的宽度
-        		'height':'160',//选择文件按钮的高度
-        		'buttonText'    :   '',
-        		//'buttonClass'   :  'update',
-
-				'onUploadSuccess':function(file,data,response)
-				{
-					console.info(data);
-					var data = eval('('+data+')');
-					if(data.status)
-					{
-						var value = e.attr('v');
-						if(value.indexOf('mul') != -1 && $(value).length)
-						{
-							var img = '<img src="'+data.url+'" width="">';
-							$(value).eq(reorder).html(img);
-
-							$("#content").val($("#content").val() + "<br />" + img);
-							reorder++;
-
-							if(reorder > 5)
-							{
-								reorder = 0;
-							}
-						}
-						else
-						{
-							jQuery("#"+file.id).find('.data').html('上传完毕');
-							jQuery("#"+file.id).hide();
-							jQuery('#'+value).val(data.url);
-							jQuery('#show_'+value).attr('style','background:url("'+data.url+'") no-repeat;background-size:contain;');
-							var img = '<img src="'+data.url+'" width="">';
-
-							var vv = '';
-							$(".img_value").each(function()
-							{
-								if($(this).val())
-								{
-									vv += '<img src="'+data.url+'" width=""><br />';
-								}
-							});
-
-							//alert(vv);
-
-							$("#content").val(vv);
-							
-						}
-					}
-					else
-					{
-						jQuery("#"+file.id).find('.data').html("<font color='red'>"+data.message+"</font>");
-						return false;
-					}
-				}
-	});
-}
-
-if(jQuery.browser.msie){
-SWFUpload.prototype.getFlashHTML = function () {
-	return ['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
-				'<param name="wmode" value="', this.settings.button_window_mode , '" />',
-				'<param name="movie" value="', this.settings.flash_url, '" />',
-				'<param name="quality" value="high" />',
-				'<param name="menu" value="false" />',
-				'<param name="allowScriptAccess" value="always" />',
-				'<param name="flashvars" value="' + this.getFlashVars() + '" />',
-				'</object>'].join("");
-    }
-}

BIN
assets/public/upload/uploadify.swf


+ 21 - 13
src/Database.php

@@ -97,7 +97,7 @@ class Database
             'delete'      => 'database.delete_action?{param}&where_id=' . $id,
             'recovery'    => 'database.recovery_action?{param}&where_id=' . $id,
             'stat'              => 'project/database/stat?{param}',
-            'list_excel'        => 'database.list_excel?{param}',
+            'excel'             => 'database.list_excel?{param}',
             'stat_excel'        => 'database.stat_excel?{param}',
             'diy'               => 'list?{param}',
         );
@@ -796,7 +796,7 @@ class Database
 
         # 增加下载报表按钮
         if (isset($config['manage']['excel'])) {
-            $config['manage']['button']['导出数据'] = 'onclick="$(\'#form1\').attr(\'action\', \'' . $this->url('list_excel') . '\');list_search($(this))"';
+            $config['manage']['button']['导出数据'] = 'onclick="$(\'#form1\').attr(\'action\', \'' . $this->url('excel') . '\');list_search($(this))"';
         }
         # 增加回收站
         if (isset($config['struct']['state']) && (!isset($config['manage']['delete']) || (isset($config['manage']['delete']) && $config['manage']['delete'] && isset($config['manage']['_list']['value']['delete'])))) {
@@ -1151,7 +1151,7 @@ class Database
      *
      * @return array
      */
-    public function list_excel()
+    public function list_excel_api()
     {
         Dever::$global['base']['excel'] = 1;
         $data = $this->list_tbody(true);
@@ -1173,13 +1173,13 @@ class Database
             }
              */
 
-            $xls->getProperties()->setCreator("Maze Excel")
-                ->setLastModifiedBy("Maze Excel")
+            $xls->getProperties()->setCreator("Dever Excel")
+                ->setLastModifiedBy("Dever Excel")
                 ->setTitle("Office 2007 XLSX Analysis Document")
                 ->setSubject("Office 2007 XLSX Analysis Document")
-                ->setDescription("Mazephp Excel")
-                ->setKeywords("Mazephp Excel")
-                ->setCategory("Mazephp Excel");
+                ->setDescription("Dever Excel")
+                ->setKeywords("Dever Excel")
+                ->setCategory("Dever Excel");
 
             $info = $this->info();
 
@@ -1389,7 +1389,11 @@ class Database
 
         $result = array();
 
-        $method = $this->project . '/' . $this->table . '-list';
+        if ($excel == true) {
+            $method = $this->project . '/' . $this->table . '-all';
+        } else {
+            $method = $this->project . '/' . $this->table . '-list';
+        }
 
         //print_r($param);die;
         $data = Dever::load($method, $param);
@@ -1470,7 +1474,7 @@ class Database
                             $show = $this->value($vi['list'], $data[$k], $config['struct']);
                         }
                         if (isset($vi['key']) && $vi['update'] != 'editor') {
-                            $show = Dever::pic($show);
+                            $show = Dever::upload($show);
                         }
                         if (isset($vi['modal'])) {
                             $show = Html::modal($this->value($vi['modal'], $data[$k], $config['struct']), $show);
@@ -1899,7 +1903,7 @@ class Database
             }
 
             # 得到下级的值
-            if (isset($param['child_value'])) {
+            if (isset($param['child_value']) && isset($data['id'])) {
                 $param['child_value'] = $this->value($param['child_value'], $data);
             }
 
@@ -1909,7 +1913,7 @@ class Database
             }
 
             if (isset($data[$index]) && isset($param['key']) && $param['update'] != 'editor') {
-                $param['value'] = Dever::pic($data[$index]);
+                $param['value'] = Dever::upload($data[$index]);
             }
 
             # 处理下级字段
@@ -2236,7 +2240,11 @@ class Database
             if (isset($log[$j['name']])) {
                 $tlog[$j['name']] = $log[$j['name']];
                 if (is_array($tlog[$j['name']])) {
-                    $tlog[$j['name']] = implode(',', $tlog[$j['name']]);
+                    if (isset($tlog[$j['name']][0]) && is_array($tlog[$j['name']][0])) {
+                        $tlog[$j['name']] = json_encode($tlog[$j['name']]);
+                    } else {
+                        $tlog[$j['name']] = implode(',', $tlog[$j['name']]);
+                    }
                 } elseif (strpos($log[$j['name']], 'http://wx.qlogo.cn/') !== false || strpos($log[$j['name']], '.jpg') !== false || strpos($log[$j['name']], '.gif') !== false || strpos($log[$j['name']], '.png') !== false) {
                     $log[$j['name']] = '<a href="' . $log[$j['name']] . '" target="_blank"><img src="' . $log[$j['name']] . '" width="150"></a>';
                 } elseif (is_numeric($log[$j['name']]) && (strpos($i, 'time') !== false || strpos($i, 'date') !== false)) {

Някои файлове не бяха показани, защото твърде много файлове са промени