dever 5 years ago
parent
commit
82d57abf6f
10 changed files with 43 additions and 21 deletions
  1. 2 2
      database/cate.php
  2. 3 3
      database/file.php
  3. 1 1
      database/file_tag.php
  4. 2 2
      database/pic_crop.php
  5. 2 2
      database/pic_thumb.php
  6. 2 2
      database/pic_water.php
  7. 15 5
      database/upload.php
  8. 2 2
      index.php
  9. 9 2
      src/Manage.php
  10. 5 0
      src/View.php

+ 2 - 2
database/cate.php

@@ -5,8 +5,8 @@ return array
     # 表名
     'name' => 'cate',
     # 显示给用户看的名称
-    'lang' => '分类管理',
-    'order' => 1,
+    'lang' => '资源分类',
+    'order' => 99,
     # 数据结构
     'struct' => array
     (

+ 3 - 3
database/file.php

@@ -21,7 +21,7 @@ return array
 	# 表名
 	'name' => 'file',
 	# 显示给用户看的名称
-	'lang' => '文件管理',
+	'lang' => '资源列表',
 	'order' => 9,
 	'end' => array
 	(
@@ -65,7 +65,7 @@ return array
 			'desc' 		=> '请输入文件名',
 			'match' 	=> 'is_string',
 			'search'	=> 'fulltext',
-			'list'		=> true,
+			//'list'		=> true,
 		),
 
 		'source_name'		=> array
@@ -181,7 +181,7 @@ return array
 		'cdate'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '录入时间',
+			'name' 		=> '上传时间',
 			'match' 	=> array('is_numeric', time()),
 			'desc' 		=> '',
 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',

+ 1 - 1
database/file_tag.php

@@ -10,7 +10,7 @@ return array
     # 表名
     'name' => 'file_tag',
     # 显示给用户看的名称
-    'lang' => '文件标签关联表',
+    'lang' => '资源标签关联表',
     'menu' => false,
 
     # 数据结构

+ 2 - 2
database/pic_crop.php

@@ -21,8 +21,8 @@ return array
 	# 表名
 	'name' => 'pic_crop',
 	# 显示给用户看的名称
-	'lang' => '裁剪配置',
-	//'menu' => false,
+	'lang' => '图片裁剪配置',
+	'menu' => false,
 	# 数据结构
 	'struct' => array
 	(

+ 2 - 2
database/pic_thumb.php

@@ -15,8 +15,8 @@ return array
 	# 表名
 	'name' => 'pic_thumb',
 	# 显示给用户看的名称
-	'lang' => '缩略配置',
-	//'menu' => false,
+	'lang' => '图片缩略配置',
+	'menu' => false,
 	# 数据结构
 	'struct' => array
 	(

+ 2 - 2
database/pic_water.php

@@ -26,8 +26,8 @@ return array
 	# 表名
 	'name' => 'pic_water',
 	# 显示给用户看的名称
-	'lang' => '水印配置',
-	//'menu' => false,
+	'lang' => '图片水印配置',
+	'menu' => false,
 	# 数据结构
 	'struct' => array
 	(

+ 15 - 5
database/upload.php

@@ -22,8 +22,8 @@ return array
 	# 表名
 	'name' => 'upload',
 	# 显示给用户看的名称
-	'lang' => '上传基本配置',
-	'order'	=> 10,
+	'lang' => '资源文件类型',
+	'order'	=> 100,
 	# 数据结构
 	'struct' => array
 	(
@@ -53,7 +53,7 @@ return array
 		'width'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '限制宽度',
+			'name' 		=> '限制宽度-仅限图片类资源',
 			'default' 	=> '0',
 			'desc' 		=> '请输入宽度',
 			'match' 	=> 'option',
@@ -64,7 +64,7 @@ return array
 		'height'		=> array
 		(
 			'type' 		=> 'int-11',
-			'name' 		=> '限制高度',
+			'name' 		=> '限制高度-仅限图片类资源',
 			'default' 	=> '0',
 			'desc' 		=> '请输入高度',
 			'match' 	=> 'option',
@@ -97,7 +97,7 @@ return array
 		'alter'		=> array
 		(
 			'type' 		=> 'varchar-255',
-			'name' 		=> '默认的后续操作-t=1&c=1&w=1,其中t代表缩略图,1代表对应的id,c代表裁剪图,w代表水印图',
+			'name' 		=> '默认的后续操作-t=1&c=1&w=1,其中t代表缩略图,1代表对应的id,c代表裁剪图,w代表水印图,仅限图片类资源',
 			'default' 	=> '',
 			'desc' 		=> '默认的后续操作',
 			'match' 	=> 'option',
@@ -150,6 +150,16 @@ return array
 			'"默认文件配置",1,"jpg,png,gif,doc,pdf,rar,zip,xls,xlsx,docx,msi",1,' . time(),
 		),
 	),
+
+	'manage' => array
+	(
+		'button' => array
+		(
+			'图片水印配置' => array('location', 'manage/project/database/list&project=upload&table=pic_water'),
+			'图片缩略配置' => array('location', 'manage/project/database/list&project=upload&table=pic_thump'),
+			'图片裁剪配置' => array('location', 'manage/project/database/list&project=upload&table=pic_crop'),
+		),
+	),
 	
 	# request 请求接口定义
 	'request' => array

+ 2 - 2
index.php

@@ -1,7 +1,7 @@
 <?php
 define('DEVER_APP_NAME', 'upload');
-define('DEVER_APP_LANG', '文件上传系统');
+define('DEVER_APP_LANG', '资源库');
 define('DEVER_APP_PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
 define('DEVER_MANAGE_ORDER', -90);
-define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-upload');
+define('DEVER_MANAGE_ICON', 'glyphicon glyphicon-upload layui-icon-picture');
 include(DEVER_APP_PATH . '../boot.php');

+ 9 - 2
src/Manage.php

@@ -50,8 +50,15 @@ class Manage
 
         $table = array();
 
-        $table['文件'] = $info['file'];
+        $html = '';
+        $config = Dever::db('upload/upload')->one($info['key']);
+        $link = Dever::upload('{uploadRes}' . $info['file']);
+        if (strstr($info['file'], '.png') || strstr($info['file'], '.jpg')) {
+            $html = '<img src="'.$link.'" width="100" />';
+        }
 
-        return Dever::table($table);
+        $table['文件名'] = $info['name'];
+        $html .= Dever::table($table);
+        return $html;
     }
 }

+ 5 - 0
src/View.php

@@ -12,6 +12,11 @@ use Upload\Src\Lib\Img;
 
 class View
 {
+    public function kindeditorFile()
+    {
+        echo 11;die;
+    }
+
     # webp
     public function webp($file)
     {