huwhois 1 год назад
Родитель
Сommit
6755d33f6e
50 измененных файлов с 441 добавлено и 3711 удалено
  1. 93 0
      app/common.php
  2. 6 19
      app/controller/sys/Article.php
  3. 2 2
      app/controller/sys/Base.php
  4. 11 11
      app/controller/sys/Category.php
  5. 67 133
      app/controller/sys/FileManager.php
  6. 6 4
      app/controller/sys/GuestBook.php
  7. 3 3
      app/controller/sys/Login.php
  8. 3 2
      app/controller/sys/SysLog.php
  9. 5 4
      app/controller/sys/SysUser.php
  10. 4 4
      app/controller/sys/System.php
  11. 0 96
      app/controller/sys/common.php
  12. 0 8
      app/controller/sys/event.php
  13. 0 5
      app/controller/sys/middleware.php
  14. 1 0
      app/event.php
  15. 16 1
      app/model/Category.php
  16. 0 66
      app/model/FileManager.php
  17. 0 6
      app/model/Module.php
  18. 0 6
      app/model/News.php
  19. 17 1
      app/model/SysUser.php
  20. 0 22
      app/model/Template.php
  21. 0 17
      app/model/TemplateType.php
  22. 0 173
      app/service/FileService.php
  23. 10 10
      app/utils/FileUtils.php
  24. 1 1
      app/utils/ReUtils.php
  25. 4 4
      config/app.php
  26. 10 55
      public/static/sys/js/admin.js
  27. 32 22
      route/app.php
  28. 0 84
      view/sys/advertise/index.html
  29. 0 157
      view/sys/advertise/save.html
  30. 0 72
      view/sys/advertise_type/index.html
  31. 0 73
      view/sys/advertise_type/save.html
  32. 2 2
      view/sys/article/index.html
  33. 7 17
      view/sys/category/index.html
  34. 8 30
      view/sys/category/save.html
  35. 0 136
      view/sys/file_manager/database_picture.html
  36. 0 81
      view/sys/file_manager/directory_picture.html
  37. 0 462
      view/sys/file_manager/explorer.html
  38. 0 415
      view/sys/file_manager/index.html
  39. 0 345
      view/sys/file_manager/uploadimg.html
  40. 0 706
      view/sys/file_manager/uploadimgbak.html
  41. 3 4
      view/sys/guest_book/index.html
  42. 1 5
      view/sys/index/index.html
  43. 0 138
      view/sys/module/index.html
  44. 0 154
      view/sys/module/save.html
  45. 1 24
      view/sys/sys_log/index.html
  46. 8 3
      view/sys/sys_login/index.html
  47. 9 13
      view/sys/sys_menu/index.html
  48. 15 72
      view/sys/sys_role/index.html
  49. 7 8
      view/sys/sys_user/index.html
  50. 89 35
      view/sys/system/index.html

+ 93 - 0
app/common.php

@@ -74,3 +74,96 @@ function generate_stochastic_string($length = 16)
     return substr(str_shuffle($permitted_chars), 0, $length);
 }
 
+/**
+ * PHP格式化字节大小
+ * @param number $size      字节数
+ * @param string $delimiter 数字和单位分隔符
+ * @return string            格式化后的带单位的大小
+ */
+function format_bytes(int $size, string $delimiter = ''): string
+{
+    $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
+    for ($i = 0; $size >= 1024 && $i < 5; $i++) {
+        $size = (int) $size / 1024;
+    }
+    return round($size, 2) . $delimiter . $units[$i];
+}
+
+/**
+ * 使用递归遍历获取文件夹的大小
+ */
+function get_dir_size($dirname)
+{
+    static $tot; //这里把$tot定义为静态的,表示$tot全局只有这一个变量
+    $ds = opendir($dirname); //创建一个目录资源, 传入的目录就是资源
+    while ($file = readdir($ds)) { //从目录中读取到条目
+        //这里的$path 表示这个路径下的文件夹,如果不这么去定义,里边执行递归语句的时候,找不到是那个文件夹
+        $path = $dirname . "/" . $file;
+
+        //判断,如果是 . 或者 ..的目录就过滤掉
+        if ($file != "." && $file != "..") {
+            if (is_dir($path)) { //判断如果找到的是目录
+                get_dir_size($path); //如果得到是文件夹,然后递归调用一次方法传入的$path文件夹路径就是判断得到的文件夹赋值给$dirname
+            } else {
+                $tot += filesize($path);
+            }
+        }
+    }
+    return $tot;
+}
+
+/**
+ * 递归删除文件夹
+ */
+function deldir($path)
+{
+    //如果是目录则继续
+    if (is_dir($path)) {
+        //扫描一个文件夹内的所有文件夹和文件并返回数组
+        $p = scandir($path);
+        foreach ($p as $val) {
+            //排除目录中的.和..
+            if ($val != "." && $val != "..") {
+                //如果是目录则递归子目录,继续操作
+                if (is_dir($path . $val)) {
+                    //子目录中操作删除文件夹和文件
+                    deldir($path . $val . DIRECTORY_SEPARATOR);
+                    //目录清空后删除空文件夹
+                    @rmdir($path . $val . DIRECTORY_SEPARATOR);
+                } else {
+                    //如果是文件直接删除
+                    unlink($path . $val);
+                }
+            }
+        }
+    }
+}
+
+/**
+ * 遍历获取目录下的指定类型的文件
+ * @param $path
+ * @param array $files
+ * @return array
+ */
+function getfiles($path, $allowFiles, &$files = array())
+{
+    if (!is_dir($path)) return null;
+    if (substr($path, strlen($path) - 1) != '/') $path .= '/';
+    $handle = opendir($path);
+    while (false !== ($file = readdir($handle))) {
+        if ($file != '.' && $file != '..') {
+            $path2 = $path . $file;
+            if (is_dir($path2)) {
+                getfiles($path2, $allowFiles, $files);
+            } else {
+                if (preg_match("/\.(" . $allowFiles . ")$/i", $file)) {
+                    $files[] = array(
+                        'url' => substr($path2, strlen($_SERVER['DOCUMENT_ROOT'])),
+                        'mtime' => filemtime($path2)
+                    );
+                }
+            }
+        }
+    }
+    return $files;
+}

+ 6 - 19
app/controller/sys/Article.php

@@ -22,9 +22,8 @@ use think\facade\View;
 
 use app\model\Category as CategoryModel;
 use app\model\Article as ArticleModel;
-use app\facade\FileUtils;
+use app\utils\FileUtils;
 use app\utils\ReUtils;
-use app\model\FileManager as FileManagerModel;
 
 class Article extends Base
 {
@@ -64,10 +63,8 @@ class Article extends Base
             }
 
             $params['content'] =  isset($params['content']) ? $params['content'] : '';
-            if ($content_type == 0) {
-                $username = $this->getSysUser()->username;
-                $params['content'] = $this->saveRomteImage($params['content'], (int)$params['id'], (int) $params['cjid'], $username);
-            }
+            
+            $params['content'] = $this->saveRomteImage($params['content']);
 
             $params['keywords'] = trim($params['keywords']);
 
@@ -76,7 +73,7 @@ class Article extends Base
                     ArticleModel::update($params);
                 } else {
                     $params['userid'] = $this->getSysUser()->userid;
-                    $params['username'] = $this->getSysUser()->nickname;
+                    $params['username'] = $this->getSysUser()->nickname ?? $this->getSysUser()->username;
                     unset($params['id']);
                     ArticleModel::create($params);
                 }
@@ -107,7 +104,7 @@ class Article extends Base
         }
     }
 
-    protected function saveRomteImage($content, $infoid = 0, $cjid = 0, $username = 'system')
+    protected function saveRomteImage($content)
     {
         $content = stripslashes($content);
         $img_array = [];
@@ -119,18 +116,8 @@ class Article extends Base
         $img_arrays = array_unique($img_array[1]);
 
         foreach ($img_arrays as $value) {
-            $file = FileFacade::downloadUrlImg($value);
-
-            $savename = \think\facade\Filesystem::disk('public')->putFile('/', $file);
-
-            FileManagerModel::saveFileInfo($file, $savename, $file->getOriginalName, $infoid, $cjid, $username);
-
-            // 删除临时文件
-            @unlink($file->getRealPath());
-
-            $filename = Config::get('filesystem.disks.public.url') . '/' . str_replace('\\', '/', $savename);
+            $filename = FileUtils::downloadUrlImg($value);
 
-            // dump($filename);
             $content = str_replace($value, $filename, $content);
         }
 

+ 2 - 2
app/controller/sys/Base.php

@@ -100,12 +100,12 @@ abstract class Base
 
         $menus = $rid !=null ? SysMenu::getUserMenuList($rid) : [];
 
-        $controller =  strtolower(preg_replace('/(?<=[a-z])([A-Z])/', '_$1', Request::controller()));
+        $controller =  str_replace("sys.", "", strtolower(preg_replace('/(?<=[a-z])([A-Z])/', '_$1', Request::controller())));
 
         $action = strtolower(preg_replace('/(?<=[a-z])([A-Z])/', '_$1', Request::action()));
 
         $route =  $controller . '/' . $action;
-        
+
         $breadCrumb = SysMenu::getBreadCrumb($route);
 
         // layer open

+ 11 - 11
app/controller/sys/Category.php

@@ -1,4 +1,5 @@
 <?php
+
 declare(strict_types=1);
 /**
  * +----------------------------------------------------------------------
@@ -12,20 +13,22 @@ namespace app\controller\sys;
 use think\facade\View;
 
 use app\model\Category as CategoryModel;
+use app\utils\ReUtils;
 
 class Category extends Base
 {
     protected  $modelName = "Category";
+    protected $types = ['一般', '目录', '链接'];
 
     public function index()
     {
-        $list = CategoryModel::getList(['order'=>'id DESC']);
+        $list = CategoryModel::getList(['order' => 'id DESC']);
 
         $list = list_tree($list, 'id', 'parent_id');
 
         View::assign('list', $list);
 
-        View::assign('types', ['','一般','目录','单页','锚点','链接']);
+        View::assign('types', $this->types);
 
         return View::fetch();
     }
@@ -41,12 +44,11 @@ class Category extends Base
             $data = CategoryModel::find($id);
         } else {
             $data = new CategoryModel();
-            $data->is_nav = 1;
         }
 
         View::assign('data', $data);
 
-        $list = list_tree(CategoryModel::select());
+        $list = CategoryModel::selectOne();
 
         View::assign('list', $list);
 
@@ -71,12 +73,10 @@ class Category extends Base
                 } else {
                     CategoryModel::create($params);
                 }
+                return ReUtils::success();
             } catch (\Exception $e) {
-                $msg = $e->getMessage();
-
-                $this->error("错误提示:" . $msg);
+                return ReUtils::error($e->getMessage());
             }
-            $this->success('操作成功', (string)url('index'));
         }
     }
 
@@ -85,13 +85,13 @@ class Category extends Base
     {
         if ($this->app->request->isPost()) {
             if (CategoryModel::where('parent_id', $id)->value('id')) {
-                return ['code' => 0, 'msg' => '子栏目不为空, 若要删除请先清空子栏目'];
+                return ReUtils::error('子栏目不为空, 若要删除请先清空子栏目');
             }
 
             if (CategoryModel::destroy($id)) {
-                return ['code' => 0,'msg'=>'删除成功'];
+                return ReUtils::success();
             } else {
-                return ['code' => 1,'msg'=>'删除失败'];
+                return ReUtils::error();
             }
         }
     }

+ 67 - 133
app/controller/sys/FileManager.php

@@ -25,14 +25,11 @@ use think\file\UploadedFile;
 use app\common\service\FileService;
 use app\model\FileManager as FileManagerModel;
 use app\facade\FileFacade;
+use app\utils\ReUtils;
 
 class FileManager extends Base
 {
     protected $modelName = 'FileManager';
-    protected $t_suffix = '_thumb';
-    protected $width = 400;  // 缩略图高度
-    protected $height = 300;
-    protected $storage_path = 'public/storage';
     
     public function index()
     {
@@ -66,13 +63,6 @@ class FileManager extends Base
 
                     $savename = \think\facade\Filesystem::disk('public')->putFile('/', $file);
 
-                    $savename = str_replace('\\', '/', $savename);
-                    $infoid   = (int) $this->request->param('infoid');
-                    $cjid     = (int) $this->request->param('cjid');
-                    $username = $this->getSysUser()->username;
-                    
-                    FileManagerModel::saveFileInfo($file, $savename, $file->getOriginalName(), $infoid, $cjid, $username);
-
                     return json([
                         'uploaded' => 1,
                         'fileName' => basename($savename),
@@ -81,19 +71,65 @@ class FileManager extends Base
                 } catch (\think\exception\ValidateException $e) {
                     $this->error($e->getMessage());
                     return json([
-                        'uploaded' => 1,
+                        'uploaded' => 0,
                         'error' =>  ['message' => $e->getMessage()]
                     ]);
                 }
             } else {
                 return json([
-                    'uploaded' => 1,
+                    'uploaded' => 0,
                     'error' =>  ['message' => '图片不能为空']
                 ]);
             }
         }
     }
 
+    /**
+     * 本地图片上传
+     * @param file upload_file   上传的文件
+     */
+    public function uploadImage()
+    {
+        if ($this->request->isPost()) {
+            $file = $this->request->file('upload_file');
+
+            if ($file) {
+                try {
+                    validate(
+                        [
+                            'file' => [
+                                // 限制文件大小(单位b),这里限制为4M
+                                'fileSize' => 4 * 1024 * 1024,
+                                // 限制文件后缀,多个后缀以英文逗号分割
+                                'fileExt'  => 'jpg,png,gif,jpeg,webp,jfif'
+                            ]
+                        ],
+                        [
+                            'file.fileSize' => '文件太大',
+                            'file.fileExt' => '不支持的文件后缀',
+                        ]
+                    )->check(['file' => $file]);
+
+                    $savename = \think\facade\Filesystem::disk('public')->putFile('/', $file);
+
+                    $urlpath = Config::get('filesystem.disks.public.url');
+
+                    $pictureurl = str_replace("\\", "/", $urlpath . '/' . $savename);
+
+                    return ReUtils::result([
+                        'filename' => $pictureurl
+                    ]);
+                } catch (ValidateException $e) {
+                    return ReUtils::error($e->getMessage());
+                } catch (Exception $e) {
+                    return ReUtils::error($e->getMessage());
+                }
+            } else {
+                return ReUtils::error('图片不能为空');
+            }
+        }
+    }
+
     /**
      * 文件上传
      */
@@ -131,22 +167,9 @@ class FileManager extends Base
                 $url = Config::get('filesystem.disks.public.url');
 
                 foreach ($uploadFiles as $file) {
-                    $fileinfo = new FileManagerModel();
-                    
-                    $fileinfo->title         = $file->getOriginalName();
-                    $fileinfo->filesize      = $file->getSize();
-                    $fileinfo->filetime      = $file->getCTime();
-                    $fileinfo->fileextension = $file->extension();
-                    $fileinfo->username      = $this->getSysUser()->username;
-                    $fileinfo->hash_md5      = $file->md5();
-                    
                     $savename = \think\facade\Filesystem::disk('public')->putFile('/', $file);
-                    
-                    $fileinfo->filepath = $url . '/' . $savename;
 
-                    $fileinfo->save();
-
-                    $savenames[] = $fileinfo->filepath;
+                    $savenames[] = $url . '/' . $savename;
                 }
 
                 return json(['code' => 0, 'msg'=>'上传成功', 'filename'=>$savenames]);
@@ -158,59 +181,6 @@ class FileManager extends Base
         }
     }
 
-    /**
-     * 本地图片上传
-     * @file upload_file   上传的文件
-     * @param string  $img_id   图片ipnut text id 默认值 picture
-     * @param boolean $thumb    是否制作缩略图
-     * @param int $width        缩略图最大宽
-     * @param int $height       缩略图最大高
-     * @param int $id           信息ID
-     * @param int $cjid         信息临时ID
-     * @param bool $saveoriginal   生成缩略图后是否保存原图 默认保存 saveoriginal
-     */
-    public function uploadLocalImg(string $img_id = 'picture', $thumb = false, $width = 400, $height = 300,
-        $original = false, $id = 0, $cjid = 0)
-    {
-        if ($this->request->isPost()) {
-            $file = $this->request->file('upload_file');
-
-            if ($file) {
-                try {
-                    validate(
-                        [
-                            'file' => [
-                                // 限制文件大小(单位b),这里限制为4M
-                                'fileSize' => 4 * 1024 * 1024,
-                                // 限制文件后缀,多个后缀以英文逗号分割
-                                'fileExt'  => 'jpg,png,gif,jpeg,webp,jfif'
-                            ]
-                        ],
-                        [
-                            'file.fileSize' => '文件太大',
-                            'file.fileExt' => '不支持的文件后缀',
-                        ]
-                    )->check(['file' => $file]);
-
-                    $result = $this->dealUploadImg($file, $thumb, $width, $height, $original, $id, $cjid);
-
-                    return json([
-                        'code'    => 0,
-                        'img_id'  => $img_id,
-                        'picname' => $result['picname'],
-                        'thumb'   => $result['thumbname']
-                    ]);
-                } catch (ValidateException $e) {
-                    $this->error($e->getMessage());
-                } catch (Exception $e) {
-                    $this->error($e->getMessage());
-                }
-            } else {
-                $this->error('图片不能为空');
-            }
-        }
-    }
-
     /**
      * 网络图片上传
      * @paran string url_file   网络图片地址
@@ -230,8 +200,23 @@ class FileManager extends Base
             if ($urlImg) {
                 try {
                     $file = FileFacade::downloadUrlImg($urlImg);
-                    
-                    $result = $this->dealUploadImg($file, $thumb, $width, $height, $original, $id, $cjid);
+                                        
+                    $urlpath = Config::get('filesystem.disks.public.url');
+
+                    $username = $this->getSysUser()->username;
+            
+                    $savename =  str_replace('\\', '/', $file->hashName());
+            
+                    $originalName = $file->getOriginalName();
+            
+                    $thumbname = "";
+            
+                    \think\facade\Filesystem::disk('public')->putFileAs('/', $file, $savename);
+
+                    $result = [
+                        'picname'   => $savename,
+                        'thumbname' => $thumbname,
+                    ];
 
                     // 删除临时文件
                     @unlink($file->getRealPath());
@@ -250,55 +235,4 @@ class FileManager extends Base
             }
         }
     }
-
-
-
-    /**
-     * 处理上传的图片
-     */
-    protected function dealUploadImg(UploadedFile $file, $thumb, $width, $height, $original, $id, $cjid): array
-    {
-        $urlpath = Config::get('filesystem.disks.public.url');
-
-        $username = $this->getSysUser()->username;
-
-        $savename =  str_replace('\\', '/', $file->hashName());
-
-        $originalName = $file->getOriginalName();
-
-        $thumbname = "";
-
-        if ($thumb == true) {
-            $image = Image::open($file);
-            
-            $image->thumb($width, $height, 1);
-
-            $ext = $file->extension();
-            
-            if ($original == true) {
-                \think\facade\Filesystem::disk('public')->putFileAs('/', $file, $savename);
-                
-                $thumbname = str_replace('.' . $ext, '',  $savename) . $this->t_suffix . '.' . $ext;
-
-                $savepath = str_replace('\\', '/', Config::get('filesystem.disks.public.root') . '/' . $thumbname);
-
-                $image->save($savepath);
-                
-                FileManagerModel::saveFileInfo($savepath, $thumbname, $originalName, $id, $cjid, $username);
-
-                $thumbname = $urlpath . '/' . $thumbname;
-            } else {
-                $image->save(Config::get('filesystem.disks.public.root') . '/' . $savename);
-            }
-        } else {
-            \think\facade\Filesystem::disk('public')->putFileAs('/', $file, $savename);
-        }
-
-        $fileinfo = FileManagerModel::saveFileInfo($file, $savename, $originalName, $id, $cjid, $username);
-        
-        return [
-            'picname'   => $fileinfo->filepath,
-            'thumbname' => $thumbname,
-        ];
-    }
 }

+ 6 - 4
app/controller/sys/GuestBook.php

@@ -4,6 +4,7 @@ namespace app\controller\sys;
 
 use think\facade\View;
 use app\model\GuestBook as GuestBookModel;
+use app\utils\ReUtils;
 
 class GuestBook extends Base
 {
@@ -24,17 +25,18 @@ class GuestBook extends Base
     }
 
     /**
-     * 状态修改 1,正常; 0,非正常
+     * 标记状态修改 1,正常; 0,非正常
      */
-    public static function mark($id)
+    public function status(int $id)
     {
         try {
             $info       = GuestBookModel::find($id);
             $info->mark = 1 - $info['mark'];
             $info->save();
-            return json(['code' => 0, 'msg' => '修改成功!', 'mark'=>$info->mark]);
+
+            return ReUtils::success();
         } catch (\Exception $e) {
-            return json(['code' => 1, 'msg' => $e->getMessage()]);
+            return ReUtils::error($e->getMessage());
         }
     }
 

+ 3 - 3
app/controller/sys/Login.php

@@ -25,9 +25,9 @@ class Login
     {
         // 已登录自动跳转
         if (Session::has('adminuser')) {
-            return redirect((string)url('index/index'));
+            return redirect((string)url('/sys/index/index'));
         }
-        $restore_url = Session::has('restore') ? Session::get('restore'): (string)url('index/index');
+        $restore_url = Session::has('restore') ? Session::get('restore'): (string)url('/sys/index/index');
 
         View::assign('restore_url', $restore_url);
 
@@ -42,6 +42,6 @@ class Login
     // 退出登录
     public function logout(){
         Session::delete('adminuser');
-        return redirect((string) url('login/index'));
+        return redirect((string) url('/sys/login/index'));
     }
 }

+ 3 - 2
app/controller/sys/SysLog.php

@@ -10,6 +10,7 @@ namespace app\controller\sys;
 // 引入框架内置类
 use think\facade\View;
 
+use app\utils\ReUtils;
 use app\model\SysLog as SysLogModel;
 
 class SysLog extends Base
@@ -27,9 +28,9 @@ class SysLog extends Base
     {
         if ($this->app->request->isPost()) {
             if (SysLogModel::destroy($id)) {
-                return ['code' => 1,'msg'=>'删除成功'];
+                return ReUtils::success();
             } else {
-                return ['code' => 0,'msg'=>'删除失败'];
+                return ReUtils::error();
             }
         }
     }

+ 5 - 4
app/controller/sys/SysUser.php

@@ -11,6 +11,7 @@ namespace app\controller\sys;
 use think\facade\View;
 use think\facade\Config;
 
+use app\utils\ReUtils;
 use app\model\SysUser as SysUserModel;
 use app\model\SysRole as SysRoleModel;
 
@@ -109,17 +110,17 @@ class SysUser extends Base
         if ($this->app->request->isAjax()) {
             if (is_array($id)) {
                 if (in_array(session('uid'), $id)) {
-                    return ['code'=>0,'msg'=>'当前登录用户无法删除'];
+                    return ReUtils::error('当前登录用户无法删除');
                 }
             } else {
                 if ($id == session('uid')) {
-                    return ['code'=>0,'msg'=>'当前登录用户无法删除'];
+                    return ReUtils::error('当前登录用户无法删除');
                 }
             }
             if (SysUserModel::destroy($id)) {
-                return ['code' => 1,'msg'=>'删除成功'];
+                return ReUtils::success();
             } else {
-                return ['code' => 0,'msg'=>'删除失败'];
+                return ReUtils::error();
             }
         }
     }

+ 4 - 4
app/controller/sys/System.php

@@ -11,6 +11,7 @@ namespace app\controller\sys;
 use think\facade\View;
 
 use app\model\System as SystemModel;
+use app\utils\ReUtils;
 
 class System extends Base
 {
@@ -31,12 +32,11 @@ class System extends Base
 
             try {
                 SystemModel::update($params, ['id' => 1]);
-            } catch (\Exception $e) {
-                $msg = $e->getMessage();
 
-                $this->error("错误提示:" . $msg);
+                return ReUtils::success();
+            } catch (\Exception $e) {
+                return ReUtils::error($e->getMessage());
             }
-            $this->success('操作成功', 'sys/system/index');
         }
     }
 }

+ 0 - 96
app/controller/sys/common.php

@@ -1,96 +0,0 @@
-<?php
-// 这是系统自动生成的公共文件
-
-/**
- * PHP格式化字节大小
- * @param number $size      字节数
- * @param string $delimiter 数字和单位分隔符
- * @return string            格式化后的带单位的大小
- */
-function format_bytes(int $size, string $delimiter = ''): string
-{
-    $units = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
-    for ($i = 0; $size >= 1024 && $i < 5; $i++) {
-        $size = (int) $size / 1024;
-    }
-    return round($size, 2) . $delimiter . $units[$i];
-}
-
-/**
- * 使用递归遍历获取文件夹的大小
- */
-function get_dir_size($dirname)
-{
-    static $tot; //这里把$tot定义为静态的,表示$tot全局只有这一个变量
-    $ds = opendir($dirname); //创建一个目录资源, 传入的目录就是资源
-    while ($file = readdir($ds)) { //从目录中读取到条目
-        //这里的$path 表示这个路径下的文件夹,如果不这么去定义,里边执行递归语句的时候,找不到是那个文件夹
-        $path = $dirname . "/" . $file;
-
-        //判断,如果是 . 或者 ..的目录就过滤掉
-        if ($file != "." && $file != "..") {
-            if (is_dir($path)) { //判断如果找到的是目录
-                get_dir_size($path); //如果得到是文件夹,然后递归调用一次方法传入的$path文件夹路径就是判断得到的文件夹赋值给$dirname
-            } else {
-                $tot += filesize($path);
-            }
-        }
-    }
-    return $tot;
-}
-
-/**
- * 递归删除文件夹
- */
-function deldir($path)
-{
-    //如果是目录则继续
-    if (is_dir($path)) {
-        //扫描一个文件夹内的所有文件夹和文件并返回数组
-        $p = scandir($path);
-        foreach ($p as $val) {
-            //排除目录中的.和..
-            if ($val != "." && $val != "..") {
-                //如果是目录则递归子目录,继续操作
-                if (is_dir($path . $val)) {
-                    //子目录中操作删除文件夹和文件
-                    deldir($path . $val . DIRECTORY_SEPARATOR);
-                    //目录清空后删除空文件夹
-                    @rmdir($path . $val . DIRECTORY_SEPARATOR);
-                } else {
-                    //如果是文件直接删除
-                    unlink($path . $val);
-                }
-            }
-        }
-    }
-}
-
-/**
- * 遍历获取目录下的指定类型的文件
- * @param $path
- * @param array $files
- * @return array
- */
-function getfiles($path, $allowFiles, &$files = array())
-{
-    if (!is_dir($path)) return null;
-    if (substr($path, strlen($path) - 1) != '/') $path .= '/';
-    $handle = opendir($path);
-    while (false !== ($file = readdir($handle))) {
-        if ($file != '.' && $file != '..') {
-            $path2 = $path . $file;
-            if (is_dir($path2)) {
-                getfiles($path2, $allowFiles, $files);
-            } else {
-                if (preg_match("/\.(" . $allowFiles . ")$/i", $file)) {
-                    $files[] = array(
-                        'url' => substr($path2, strlen($_SERVER['DOCUMENT_ROOT'])),
-                        'mtime' => filemtime($path2)
-                    );
-                }
-            }
-        }
-    }
-    return $files;
-}

+ 0 - 8
app/controller/sys/event.php

@@ -1,8 +0,0 @@
-<?php
-// 这是系统自动生成的event定义文件
-return [
-    'listen'  =>    [
-        'SysLog'    =>    ['app\admin\listener\SysUserLog'],
-        // 更多事件监听
-    ],
-];

+ 0 - 5
app/controller/sys/middleware.php

@@ -1,5 +0,0 @@
-<?php
-// 这是系统自动生成的middleware定义文件
-return [
-
-];

+ 1 - 0
app/event.php

@@ -10,6 +10,7 @@ return [
         'HttpEnd'  => [],
         'LogLevel' => [],
         'LogWrite' => [],
+        'SysLog'   => ['app\admin\listener\SysUserLog'],
     ],
 
     'subscribe' => [

+ 16 - 1
app/model/Category.php

@@ -53,11 +53,26 @@ class Category extends Base
     {
         try {
             $info         = self::find($id);
-            $info->is_nav = 1 - $info['is_nav'];
+            $info->is_nav = -1 - $info['is_nav'];
             $info->save();
             return json(['code' => 0, 'msg' => '修改成功!', 'is_nav'=>$info->is_nav]);
         } catch (\Exception $e) {
             return json(['code' => 1, 'msg' => $e->getMessage()]);
         }
     }
+
+    public static function selectOne()
+    {
+        $list = self::where('type', 1)->field("id, parent_id,name")->select();
+
+        $top = new static([
+            "id"=> 0,
+            "parent_id" => -1,
+            "name" => "顶级栏目"
+        ]);
+
+        $list->push($top);
+
+        return list_tree($list, 'id', 'parent_id', 'child', -1);
+    }
 }

+ 0 - 66
app/model/FileManager.php

@@ -1,66 +0,0 @@
-<?php
-declare(strict_types=1);
-
-namespace app\model;
-
-use think\facade\Config;
-
-class FileManager extends \think\Model
-{
-    protected $pk = "fileid";
-
-    protected $schema = [
-        'fileid'        => "int",      // '文件id'
-        'filename'      => "varchar",  // '文件名称'
-        'filesize'      => "int",      // '文件大小字节'
-        'filetime'      => "int",      // '文件上传时间'
-        'filepath'      => "varchar",  // '文件路径'
-        'fileextension' => "varchar",  // '文件扩展名'
-        'title'         => "varchar",  // '文件title'
-        'type'          => "int",      // '0为附件,1为图片,2为Flash文件,3为多媒体文件'
-        'onclick'       => "int",      // '下载量'
-        'username'      => "varchar",  // '上传者'
-        'cid'           => "int",      // '栏目ID'
-        'infoid'        => "int",      // '信息ID', 
-        'cjid'          => "int",       // '信息临时ID'
-        'hash_md5'       => "varcahr"       // hash值(MD5)
-    ];
-
-    protected $autoWriteTimestamp = false;
-
-    public static function queryPage(array $param = [])
-    {
-        $limit = (int)$param['limit'];
-
-        $where = [];
-
-        return self::where($where)->field('fileid,filename,filesize,filetime,filepath,fileextension,title,username')->paginate(['list_rows'=>$limit, 'query' => $param]);
-    }
-
-    public static function saveFileInfo(\think\File $file)
-    {
-        $fileinfo = self::where('hash_md5', $file->md5())->find();
-
-        $publicRootPath = str_replace('\\', '/', Config::get('filesystem.disks.public.root'));
-
-        $publicUrlPath =  Config::get('filesystem.disks.public.url');
-
-        if ($fileinfo == null) {
-            $fileinfo = new static();
-        } elseif ($publicRootPath . $fileinfo->filepath == $file->getPathname())  { // 路径不同的文件
-            $fileinfo = new static();
-        }
-
-        $fileinfo->filename       = $file->getFilename();
-        $fileinfo->filesize       = $file->getSize();
-        $fileinfo->filetime       = $file->getCTime();
-        $fileinfo->filepath       = $publicUrlPath . str_replace($publicRootPath, '', $file->getPathname());
-        $fileinfo->fileextension  = $file->getExtension();
-        $fileinfo->username       = 'system';
-        $fileinfo->hash_md5       = $file->md5();
-
-        $fileinfo->save();
-        
-        return $fileinfo;
-    }
-}

+ 0 - 6
app/model/Module.php

@@ -1,6 +0,0 @@
-<?php
-namespace app\model;
-
-class Module extends Base
-{
-}

+ 0 - 6
app/model/News.php

@@ -1,6 +0,0 @@
-<?php
-namespace app\model;
-
-class News extends \think\Model
-{
-}

+ 17 - 1
app/model/SysUser.php

@@ -14,6 +14,9 @@ class SysUser extends Base
 {
     protected $pk = 'userid';
 
+
+
+
     public function sysRole()
     {
         return $this->belongsTo('SysRole', 'roleid')->bind(['rolename' => 'name']);
@@ -38,6 +41,19 @@ class SysUser extends Base
             }
         }
     }
+    
+    // 状态修改 1,正常; 2,非正常
+    public static function state(int $id)
+    {
+        try {
+            $info         = self::find($id);
+            $info->status = -1 - $info['status'];
+            $info->save();
+            return json(['code' => 0, 'msg' => '修改成功!', 'status'=>$info->status]);
+        } catch (\Exception $e) {
+            return json(['code' => 1, 'msg' => $e->getMessage()]);
+        }
+    }
 
     public static function checkLogin()
     {
@@ -76,7 +92,7 @@ class SysUser extends Base
             return json(['code' => 2, 'msg' => '用户名/密码不正确']);
         }
 
-        if ($info->status == 1) {
+        if ($info->status === 0) {
             // 更新登录IP,登录时间和更新次数
             $perTime = $info->per_time;
             $perIp = $info->per_ip;

+ 0 - 22
app/model/Template.php

@@ -1,22 +0,0 @@
-<?php
-declare (strict_types = 1);
-
-namespace app\model;
-
-class Template extends Base
-{
-    protected $schema = [
-        
-    ];
-
-    public function templateType()
-    {
-        $this->belongsTo('TemplateType', 'typeid', 'typeid')->bind(['typename'=>'typename']);
-    }
-
-    // 获取列表
-    public static function getList()
-    {
-        return self::with('templateType')->order(['id' => 'desc'])->select();
-    }
-}

+ 0 - 17
app/model/TemplateType.php

@@ -1,17 +0,0 @@
-<?php
-declare (strict_types = 1);
-
-namespace app\model;
-
-class TemplateType extends Base
-{
-    protected $schema = [
-        
-    ];
-
-    // 获取列表
-    public static function getList()
-    {
-        return self::order(['id' => 'desc'])->select();
-    }
-}

+ 0 - 173
app/service/FileService.php

@@ -1,173 +0,0 @@
-<?php
-declare(strict_types=1);
-
-/**
- * 文件 service
- *
- * @version      0.0.1
- * @author      by huwhois
- * @time        2021/12/28
- */
-
-namespace app\common\service;
-
-use think\Image;
-use think\Exception;
-use think\File;
-use think\image\Exception as ImageException;
-use think\facade\Config;
-
-class FileService
-{
-    /**
-     * 图片添加水印
-     * @param File $file  要处理的文件
-     * @param int $type  水印类型 0 图片水印, 1 文字水印 
-     * @param string $waterimg  图片水印内容
-     * @param string $watertext  文字水印内容
-     * @param string $fonttype  水印文字类型
-     * @param int $fontsize  水印文字大小
-     * @param string $fontcolor  水印文字颜色
-     * @return Image  返回图片对象
-     */
-    public function waterMark(Image $image, int $type = 0, string $watermark = '', string $watertext = '', 
-        string $fonttype = '', int $fontsize = 0, string $fontcolor = '#ffffff30'): Image
-    {
-        if ($type == 0) {
-            $watermark = $watermark ?: Config::get('filesystem.water.watermark');
-            $image->water($watermark);
-        } else {
-            $watetext = $watertext ?: Config::get('filesystem.water.watertext');
-            $fonttype = $fonttype ?: Config::get('filesystem.water.fonttype');
-            $fontsize = $fontsize ?: (int) Config::get('filesystem.water.fontsize');
-            $fontcolor = $fontcolor ?: (int) Config::get('filesystem.water.fontcolor');
-
-            $image->text($watetext, $fonttype, $fontsize, $fontcolor);
-        }
-
-        return $image;
-    }
-
-    /**
-     * 生成缩略图
-     * @param Image $image  要处理的文件
-     * @param int $width 缩略图宽值, 默认 384px;
-     * @param int $height 缩略图高值, 默认 224px;
-     * @param int $type 缩略图裁剪方式, 默认值 1,固定尺寸缩放; 其他: 1,等比例缩放;2,缩放后填充;3,居中裁剪;4,左上角裁剪;5,右下角裁剪
-     * @param string $t_suffix  缩略图后缀
-     * @return Image  返回图片对象
-     */
-    public function thumbnail(Image $image, string $thumbname, int $width = 384, int $height = 224, int $type = 1)
-    {
-        $image->thumb($width, $height, $type)->save('./storage/' . $thumbname);
-
-        return $image;
-    }
-
-    /**
-     * 保存远程图片到本地
-     */
-    public function downloadUrlImg(string $url)
-    {
-        $ch = curl_init($url);
-        curl_setopt($ch, CURLOPT_HEADER, 0);
-        curl_setopt($ch, CURLOPT_NOBODY, 0); // 只取body头
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
-        curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
-        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- 
-        $package = curl_exec($ch);
-        $httpinfo = curl_getinfo($ch);
-        
-        curl_close($ch);
-
-        $imageAll = array_merge(array(
-            'imgBody' => $package
-        ), $httpinfo);
-        if ($httpinfo['download_content_length'] > 4 * 1024 * 1024) {
-            throw new Exception("文件太大", 1);
-        }
-
-        $type = null;
-
-        switch ($imageAll['content_type']) {
-            case 'image/gif':
-                $type = "gif";
-                break;
-            case 'image/webp':
-                $type = "webp";
-                break;
-            case 'image/jpeg':
-                $type = "jpg";
-                break;
-            case 'image/png':
-                $type = "png";
-                break;
-            default:
-                $type = null;
-                break;
-        }
-
-        // 腾讯公众号图片
-        if(strpos($url,'qpic.cn') !== false){
-            $urls = parse_url($url);
-        
-            if (isset($urls['query'])) {
-                $query_arr = [];
-                
-                parse_str($urls['query'], $query_arr);
-        
-                $type = isset($query_arr['wx_fmt']) ? $query_arr['wx_fmt'] : null;
-        
-                $type = $type == 'jpeg' ? 'jpg' : $type;
-            }
-        }
-
-        if (!$type) {
-            throw new Exception("不支持的文件后缀", 1);
-        }
-
-        $temp = app()->getRuntimePath() . 'temp';
-
-        if (!file_exists($temp)) {
-            mkdir($temp, 0755);
-        }
-
-        $tempname = $temp . '/php.' . $type;
-
-        file_put_contents($tempname, $imageAll["imgBody"]);
-
-        return new File($tempname);
-    }
-
-    /**
-     * 遍历获取目录下的指定类型的文件
-     * @param $path
-     * @param $allowFiles  png|jpg|jpeg|gif|bmp|webp
-     * @param array $files
-     * @return array
-     */
-    public function getFiles($path, $allowFiles = 'png|jpg|jpeg|gif|bmp|webp', &$files = array())
-    {
-        if (!is_dir($path)) return null;
-        if (substr($path, strlen($path) - 1) != '/') $path .= '/';
-        $handle = opendir($path);
-        while (false !== ($file = readdir($handle))) {
-            if ($file != '.' && $file != '..') {
-                $path2 = $path . $file;
-                if (is_dir($path2)) {
-                    self::getFiles($path2, $allowFiles, $files);
-                } else {
-                    if (preg_match("/\.(" . $allowFiles . ")$/i", $file)) {
-                        $files[] = array(
-                            'url' => substr($path2, strlen(app()->getRootPath().'/public') - 1),
-                            'mtime' => filemtime($path2)
-                        );
-                    }
-                }
-            }
-        }
-        return $files;
-    }
-}

+ 10 - 10
app/utils/FileUtils.php

@@ -100,8 +100,6 @@ class FileUtils
 
         $type = null;
 
-        $originalName = "";
-
         switch ($imageAll['content_type']) {
             case 'image/gif':
                 $type = "gif";
@@ -139,19 +137,21 @@ class FileUtils
             throw new Exception("不支持的文件后缀", 1);
         }
 
-        $originalName = pathinfo($url, PATHINFO_EXTENSION) ? basename($url) : basename($url) . '.' . $type;
+        $rootpath = Config::get('filesystem.disks.public.root');
 
-        $temp =  app()->getRuntimePath() . 'temp';
+        $filepath = date("YMd");
 
-        if (!file_exists($temp)) {
-            mkdir($temp, 0755);
+        if (!file_exists($rootpath . "/" . $filepath)) {
+            mkdir($rootpath . "/" . $filepath, 0755);
         }
-        
-        $tempname = $temp . DIRECTORY_SEPARATOR . 'php' . substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'), 0, 6) . '.tmp';
 
-        file_put_contents($tempname, $imageAll["imgBody"]);
+        $savename = $filepath . md5(microtime(true). substr(str_shuffle('0123456789abcdefghijklmnopqrstuvwxyz'), 0, 6));
+
+        $filename = Config::get('filesystem.disks.public.url') . '/' . $savename;
+
+        file_put_contents($rootpath . $savename, $imageAll["imgBody"]);
 
-        return new UploadedFile($tempname, $originalName, $imageAll["content_type"]);
+        return $filename;
     }
 
     /**

+ 1 - 1
app/utils/ReUtils.php

@@ -62,7 +62,7 @@ class ReUtils
      * @param array   $header 发送的Header信息
      * @return Response
      */
-    public static function result($data, int $code = 0, $msg = '', string $type = '', array $header = []): Response
+    public static function result($data, int $code = 0, $msg = 'success', string $type = '', array $header = []): Response
     {
         $result = [
             'code' => $code,

+ 4 - 4
config/app.php

@@ -40,11 +40,11 @@ return [
     // 显示错误信息
     'show_error_msg'   => false,
     // 默认分页显示数量
-    'page_size'             => 20,
+    'page_size'        => 20,
     // 版本信息
-    'sys_version'          => '0.1',
+    'sys_version'      => '0.1',
     // 默认密码
-    'default_password' => 'qwe123',
+    'default_password' => env('app.default_password', ""),
     // 是否开启权限认证
-    'auth_on'               => true,
+    'auth_on'          => true,
 ];

+ 10 - 55
public/static/sys/js/admin.js

@@ -69,61 +69,6 @@ function pwdFormat6MixNew(pwd) {
     return pwd.match(/^[a-zA-Z]\w{5,17}$/) ? true : false;
 }
 
-// 改变状态
-function status(obj, id) {
-    $.post('status', {
-        'id': parseInt(id)
-    }, function (res) {
-        if (res.code == 0) {
-            topalert({
-                type: 0,
-                content: res.msg,
-                speed: 1000
-            });
-            if (res.status == 1) {
-                var img_str = '<a href="javascript:;" onclick="status(this,' + id + ')" title="正常"><span class="f-20 c-primary"><i class="Hui-iconfont">&#xe601;</i></span></a>';
-            } else {
-                var img_str = '<a href="javascript:;" onclick="status(this,' + id + ')" title="停用"><span class="f-20 c-primary"><i class="Hui-iconfont">&#xe677;</i></span></a>';
-            }
-            $(obj).parents('td.td-status').append(img_str);
-            $(obj).remove();
-        } else {
-            topalert({
-                type: 1,
-                content: res.msg,
-                speed: 1000
-            });
-            return false;
-        }
-    }, 'json');
-}
-
-// 排序
-$(".input-sort").change(function () {
-    var sort = $(this).val();
-    var id = $(this).data('id');
-
-    $.post('sort', {
-        'id': id,
-        'sort': sort
-    }, function (data) {
-        if (data.code == 0) {
-            topalert({
-                type: 0,
-                content: data.msg,
-                speed: 2000
-            });
-        } else {
-            topalert({
-                type: 1,
-                content: data.msg,
-                speed: 2000
-            });
-            return false;
-        }
-    }, 'json');
-});
-
 // 删除条目
 function del(obj, id) {
     layer.confirm('确认要删除吗?', function (index) {
@@ -224,6 +169,16 @@ function topalert(options, callback) {
 }
 
 $(function () {
+    // 全选
+    $("input[name='allcheck']").change(function (e, x) {
+        // console.log(this.checked);
+        if (this.checked) {
+            $('.text-c input[name="checkbox[]"]').prop("checked", true);
+        } else {
+            $('.text-c input[name="checkbox[]"]').prop("checked", false);
+        }
+    })
+
     // 图片预览
     $('.pictureview').hover(function () {
         console.log($(this).children('img').attr('src'));

+ 32 - 22
route/app.php

@@ -38,29 +38,18 @@ Route::get('/detail/<id>-<name>', 'index/article/read');
 Route::get('/:year/<month>-<day>/:id', 'index/article/read');
 Route::get('/:year/<month>-<page?>', 'index/article/archive');
 
-$list = Category::getList();
 
-foreach ($list as $key => $value) {
-    Route::get($value->url . '-<page?>', $value->route)->append(['cid' => $value->id]);
-}
-
-Route::get('sys/index', 'sys.index/index');
-Route::post('sys/index/usedspace', 'sys.index/usedspace');
-Route::post('sys/index/clearcache', 'sys.index/clearcache');
-Route::post('sys/index/countArticle', 'sys.index/countArticle');
-Route::post('sys/index/countIndustry', 'sys.index/countIndustry');
-Route::post('sys/index/countGuestBook', 'sys.index/countGuestBook');
-Route::post('sys/index/saveIndexButton', 'sys.index/saveIndexButton');
-Route::get('sys/login/index', 'sys.login/index');
-Route::post('sys/login/dologin', 'sys.login/dologin');
-Route::get('sys/login/logout', 'sys.login/logout');
-Route::get('sys/verify', 'sys.login/verify');
-Route::post('sys/file_manager/uploadImage', 'sys.file_manager/uploadImage');
-Route::post('sys/file_manager/uploadMoive', 'sys.file_manager/uploadMoive');
-Route::post('sys/file_manager/ckeditorUploadImage', 'sys.file_manager/ckeditorUploadImage');
-Route::post('sys/file_manager/uploadUrlImg', 'sys.file_manager/uploadUrlImg');
-
-Route::group('sys', function () {
+Route::group('sys', function() {
+    Route::get('index', 'sys.index/index');
+    Route::post('index/usedspace', 'sys.index/usedspace');
+    Route::post('index/clearcache', 'sys.index/clearcache');
+    Route::get('login/index', 'sys.login/index');
+    Route::post('login/dologin', 'sys.login/dologin');
+    Route::get('login/logout', 'sys.login/logout');
+    Route::get('verify', 'sys.login/verify');
+    Route::post('file_manager/uploadImage', 'sys.file_manager/uploadImage');
+    Route::post('file_manager/ckeditorUploadImage', 'sys.file_manager/ckeditorUploadImage');
+    Route::post('file_manager/uploadUrlImg', 'sys.file_manager/uploadUrlImg');
     $menuList = SysMenu::where('type', '<>', '0')->field('id, pid, name, url, icon')->select();
     foreach ($menuList as $menu) {
         $menuUrl = $menu->url;
@@ -69,5 +58,26 @@ Route::group('sys', function () {
     }
 });
 
+
+// Route::post('sys/index/usedspace', 'sys.index/usedspace');
+// ;
+// Route::post('sys/index/countArticle', 'sys.index/countArticle');
+// Route::post('sys/index/countIndustry', 'sys.index/countIndustry');
+// Route::post('sys/index/countGuestBook', 'sys.index/countGuestBook');
+// Route::post('sys/index/saveIndexButton', 'sys.index/saveIndexButton');
+// Route::get('sys/login/index', 'sys.login/index');
+// Route::post('sys/login/dologin', 'sys.login/dologin');
+// Route::get('sys/login/logout', 'sys.login/logout');
+// Route::get('sys/verify', 'sys.login/verify');
+// Route::post('sys/file_manager/uploadImage', 'sys.file_manager/uploadImage');
+// Route::post('sys/file_manager/uploadMoive', 'sys.file_manager/uploadMoive');
+// Route::post('sys/file_manager/ckeditorUploadImage', 'sys.file_manager/ckeditorUploadImage');
+// Route::post('sys/file_manager/uploadUrlImg', 'sys.file_manager/uploadUrlImg');
+// Route::post('sys/category/index', 'sys.category/index');
+
+// Route::group('sys', function () {
+
+// });
+
 Route::get('sys', 'sys.index/index');
 

+ 0 - 84
view/sys/advertise/index.html

@@ -1,84 +0,0 @@
-<article class="cl pd-20">
-    <div class="cl pd-5 bg-1 bk-gray">
-        <span class="l">
-            <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
-                <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
-            <a href="javascript:layer_show('添加广告', '{:url('save?_layer=true&id=0')}');" class="btn btn-primary radius">
-                <i class="Hui-iconfont">&#xe600;</i> 添加广告</a>
-        </span>
-    </div>
-    <div class="mt-10" style="min-width:800px;">
-        <table class="table table-border table-bordered table-bg">
-            <thead>
-                <tr class="text-c">
-                    <th width="25">
-                        <input type="checkbox" name="allcheck">
-                    </th>
-                    <th width="50px">ID</th>
-                    <th>名称</th>
-                    <th>类别</th>
-                    <th>图片</th>
-                    <th>链接地址</th>
-                    <th>栏目ID</th>
-                    <th>文章ID</th>
-                    <th>状态</th>
-                    <th>排序</th>
-                    <th>添加时间</th>
-                    <th>更新时间</th>
-                    <th>操作</th>
-                </tr>
-            </thead>
-            <tbody>
-                {foreach $list as $val}
-                <tr class="text-c">
-                    <td>
-                        <input type="checkbox" value="{$val.id}" name="checkbox[]">
-                    </td>
-                    <td>{$val.id}</td>
-                    <td>{$val.name}</td>
-                    <td>{$val.advertiseType.name}</td>
-                    <td><a href="{$val.picture}" target="_blank" class="pictureview" style="text-decoration: none;">
-                            <img src="{$val.thumb}" title="{$val.name}" style="max-width: 100px; max-height: 38px;">
-                        </a></td>
-                    <td>{$val.url}</td>
-                    <td>{$val.cid}</td>
-                    <td>{$val.artid}</td>
-                    <td class="td-status">
-                        <a href="javascript:;" onclick="state(this,'{$val.id}')" style="text-decoration: none;" title="已{$val.status==1? '启用' : '停用'}">
-                            <span class="f-20 c-primary"><i class="Hui-iconfont">{$val.status==1?'&#xe601;' : '&#xe677;'}</i></span></a>
-                    </td>
-                    <td>{$val.sort}</td>
-                    <td>{$val.create_time|date='Y-m-d H:i:s'}</td>
-                    <td>{$val.update_time|date='Y-m-d H:i:s'}</td>
-                    <td class="td-manage">
-                        <a class="btn btn-primary radius" title="编辑" href="javascript:layer_show('修改广告', '{:url('save?_layer=true&id='.$val.id)}');">
-                            <i class="Hui-iconfont">&#xe6df;</i>修改
-                        </a>
-                        <a class="btn btn-danger radius" title="删除" href="javascript:;" onclick="del(this,'{$val.id}')" class="ml-5">
-                            <i class="Hui-iconfont">&#xe6e2;</i>删除
-                        </a>
-                    </td>
-                </tr>
-                {/foreach}
-            </tbody>
-        </table>
-    </div>
-    <div class="cl pd-5 bg-1 bk-gray mt-20 ">
-        <span class="r">{notempty name="data"}{$data->render()|raw}{/notempty}</span>
-    </div>
-</article>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    // 图片预览
-    $('.pictureview').hover(function(){
-        console.log($(this).children('img').attr('src'));
-        var url = $(this).children('img').attr('src');
-        var img = '<img class="thumbnail" id="thumbview" src="'+url+'">';
-        $(this).append(img);
-    },function(){
-        $('#thumbview').remove();
-    });
-
-</script>
-<!--/请在上方写此页面业务相关的脚本-->

+ 0 - 157
view/sys/advertise/save.html

@@ -1,157 +0,0 @@
-<article class="cl pd-20">
-    <form action="" method="post" class="form form-horizontal" id="form-save">
-        <input type="hidden" name="id" id="id" value="{$data.id}">
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red">*</span>名称:</label>
-            <div class="formControls col-xs-8 col-sm-6">
-                <input type="text" class="input-text" id="name" name="name" value="{$data.name}"
-                    autocomplete="new-password">
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red">*</span>标题图:</label>
-                <div class="formControls col-xs-6 col-sm-4">
-                    <div style="width: 200px;height: 200px;">
-                     <a href="javascript:void(0);" onclick="uploadPicture()" >
-                        <img id="view-img" src="{$data.thumb ? $data.thumb : '/static/images/upload_picture.png'}" alt="标题图" title="{$data.title_pic ? '更换' : '添加'}标题图" style="max-width: 200px;max-height: 200px;">
-                     </a>
-                    </div>
-                    <input type="text" class="input-text" value="{$data.picture}" name="picture" id="picture" style="display: none;">
-                    <input type="text" class="input-text" value="{$data.thumb}" name="thumb" id="thumb" style="display: none;">
-                </div>
-                <label class="form-label col-xs-2 col-sm-2">
-                    <a class="btn btn-success radius" href="javascript:uploadPicture();">{$data.picture ? '更换' : '添加'}标题图</a></label>
-            <div class="col-3"> </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red"></span>url:</label>
-            <div class="formControls col-xs-8 col-sm-6">
-                <input type="text" class="input-text" id="url" name="url" value="{$data.url}"
-                    placeholder="文章or网站访问连接">
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                文章栏目id:</label>
-            <div class="formControls col-xs-4 col-sm-4">
-                <input type="text" class="input-text" id="cid" name="cid" value="{$data.cid}">
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">文章id:</label>
-            <div class="formControls col-xs-4 col-sm-4">
-                <input type="text" class="input-text" id="artid" name="artid" value="{$data.artid}">
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red">*</span>类别:</label>
-            <div class="formControls col-xs-8 col-sm-6">
-                <span class="select-box">
-                    <select class="select" id="type_id" name="type_id">
-                        <option value="" >请选择类别</option>
-                        {foreach $listTypes as $k=>$op}
-                        <option value="{$k}" {eq name="data.type_id" value="$k" }selected{/eq}>{$op}</option>
-                        {/foreach}
-                    </select>
-                </span>
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red"></span>状态:</label>
-            <div class="formControls col-xs-8 col-sm-6">
-                <div class="radio-box">
-                    <input type="radio" name="status" id="status-1" value="1" {$data==null || $data.status==1 ? 'checked' : ""}>
-                    <label for="typeId-1">启用</label>
-                </div>
-                <div class="radio-box">
-                    <input type="radio" name="status" id="status-2" value="2" {$data.status==2 ? 'checked' : ""}>
-                    <label for="status-2">禁用</label>
-                </div>
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red"></span>排序:</label>
-                <div class="formControls col-xs-4 col-sm-4">
-                    <input type="text" class="input-text" id="sort" name="sort"
-                        placeholder="数字越大, 越靠前">
-                </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">备注:</label>
-            <div class="formControls col-xs-8 col-sm-6">
-                <textarea id="remark" name="remark" cols="" rows="" class="textarea" placeholder="备注...200个字符以内"
-                    dragonfly="true" onKeyUp="textarealength(this,200)">{$data.remark}</textarea>
-                <p class="textarea-numberbar">
-                    <em class="textarea-length">0</em>/200
-                </p>
-            </div>
-        </div>
-        <div class="row cl">
-            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
-                <input class="btn btn-success radius" type="button" id="form-save-button"
-                    value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
-                <input class="btn btn-default radius" type="button" value="&nbsp;&nbsp;取消&nbsp;&nbsp;"
-                    onClick="layer_close();">
-            </div>
-        </div>
-    </form>
-</article>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    // 图片上传
-    function uploadPicture() {
-        layer.open({
-            type: 2,
-            area: ['700px', '500px'],
-            fix: false, //不固定
-            maxmin: true,
-            shade: 0.4,
-            title: '添加缩略图',
-            content: '{:url("file_manager/uploadimg", ["_layer"=>true, "thumb"=>true, "width"=>400])}'
-        });
-    }
-
-    $(function () {
-        $("#form-save-button").click(function () {
-            if (getblen($("#remark").val()) > 200) {
-                layer.msg('备注过长', {
-                    icon: 5,
-                    time: 1000
-                });
-                return false;
-            }
-
-            var data = $("#form-save").serializeArray();
-            $.ajax({
-                type: 'POST',
-                url: '{:url("save")}',
-                data: data,
-                dataType: 'json',
-                success: function (res) {
-                    // console.log(res);
-                    if (res.code == 0) {
-                        layer.msg(data.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    } else {
-                        layer.msg(res.msg, { icon: 1 }, function () {
-                            parent.location.reload(); // 父页面刷新
-                            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
-                            parent.layer.close(index);
-                        });
-                    }
-                }
-            })
-        })
-    })
-</script>
-<!--请在上方写此页面业务相关的脚本-->

+ 0 - 72
view/sys/advertise_type/index.html

@@ -1,72 +0,0 @@
-<article class="cl pd-20">
-    <div class="cl pd-5 bg-1 bk-gray">
-        <span class="l">
-            <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
-                <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
-            <a href="javascript:layer_show('添加广告', '{:url('save?_layer=true&id=0')}');" class="btn btn-primary radius">
-                <i class="Hui-iconfont">&#xe600;</i> 添加广告</a>
-        </span>
-        <span class="r">
-            共有:<span class="f-18 c-red">{$list->count()}</span>条
-        </span>
-    </div>
-    <div class="mt-10" style="min-width:800px;">
-        <table class="table table-border table-bordered table-bg">
-            <thead>
-                <tr class="text-c">
-                    <th width="25">
-                        <input type="checkbox" name="allcheck">
-                    </th>
-                    <th width="50px">ID</th>
-                    <th>名称</th>
-                    <th>备注</th>
-                    <th>状态</th>
-                    <th>添加时间</th>
-                    <th>更新时间</th>
-                    <th>操作</th>
-                </tr>
-            </thead>
-            <tbody>
-                {foreach $list as $val}
-                <tr class="text-c">
-                    <td>
-                        <input type="checkbox" value="{$val.id}" name="checkbox[]">
-                    </td>
-                    <td>{$val.id}</td>
-                    <td>{$val.name}</td>
-                    <td>{$val.remark}</td>
-                    <td class="td-status">
-                        <a href="javascript:;" onclick="state(this,'{$val.id}')" style="text-decoration: none;" title="已{$val.status==1? '启用' : '停用'}">
-                            <span class="f-20 c-primary"><i class="Hui-iconfont">{$val.status==1?'&#xe601;' : '&#xe677;'}</i></span></a>
-                    </td>
-                    <td>{$val.create_time|date='Y-m-d H:i:s'}</td>
-                    <td>{$val.update_time|date='Y-m-d H:i:s'}</td>
-                    <td class="td-manage">
-                        <a class="btn btn-primary radius" title="编辑" href="javascript:layer_show('修改', '{:url('save?_layer=true&id='.$val.id)}');">
-                            <i class="Hui-iconfont">&#xe6df;</i>修改
-                        </a>
-                        <a class="btn btn-danger radius" title="删除" href="javascript:;" onclick="del(this,'{$val.id}')" class="ml-5">
-                            <i class="Hui-iconfont">&#xe6e2;</i>删除
-                        </a>
-                    </td>
-                </tr>
-                {/foreach}
-            </tbody>
-        </table>
-    </div>
-</article>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    // 图片预览
-    $('.pictureview').hover(function(){
-        console.log($(this).children('img').attr('src'));
-        var url = $(this).children('img').attr('src');
-        var img = '<img class="thumbnail" id="thumbview" src="'+url+'">';
-        $(this).append(img);
-    },function(){
-        $('#thumbview').remove();
-    });
-
-</script>
-<!--/请在上方写此页面业务相关的脚本-->

+ 0 - 73
view/sys/advertise_type/save.html

@@ -1,73 +0,0 @@
-<article class="cl pd-20">
-    <form action="" method="post" class="form form-horizontal" id="form-save">
-        <input type="hidden" name="id" id="id" value="{$data.id}">
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red">*</span>名称:</label>
-            <div class="formControls col-xs-8 col-sm-6">
-                <input type="text" class="input-text" id="name" name="name" value="{$data.name}"
-                    autocomplete="new-password">
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red"></span>状态:</label>
-            <div class="formControls col-xs-8 col-sm-6">
-                <div class="radio-box">
-                    <input type="radio" name="status" id="status-1" value="1" {$data==null || $data.status==1 ? 'checked' : ""}>
-                    <label for="typeId-1">启用</label>
-                </div>
-                <div class="radio-box">
-                    <input type="radio" name="status" id="status-2" value="2" {$data.status==2 ? 'checked' : ""}>
-                    <label for="status-2">禁用</label>
-                </div>
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">备注:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" id="remark" name="remark" value="{$data.remark}">
-            </div>
-        </div>
-        <div class="row cl">
-            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
-                <input class="btn btn-success radius" type="button" id="form-save-button"
-                    value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
-                <input class="btn btn-default radius" type="button" value="&nbsp;&nbsp;取消&nbsp;&nbsp;"
-                    onClick="layer_close();">
-            </div>
-        </div>
-    </form>
-</article>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    $(function () {
-        $("#form-save-button").click(function () {
-            var data = $("#form-save").serializeArray();
-            $.ajax({
-                type: 'POST',
-                url: '{:url("save")}',
-                data: data,
-                dataType: 'json',
-                success: function (res) {
-                    // console.log(res);
-                    if (res.code = 0) {
-                        layer.msg(data.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    } else {
-                        layer.msg(res.msg, { icon: 1 }, function () {
-                            parent.location.reload(); // 父页面刷新
-                            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
-                            parent.layer.close(index);
-                        });
-                    }
-                }
-            })
-        })
-    })
-</script>
-<!--请在上方写此页面业务相关的脚本-->

+ 2 - 2
view/sys/article/index.html

@@ -3,8 +3,8 @@
         <span class="l">
             <a href="javascript:void(0);" onclick="del_all()" class="btn btn-danger radius">
                 <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
-            <a class="btn btn-success radius" href="{:url('/sys/article/save')}">
-                <i class="Hui-iconfont">&#xe600;</i> 添加文章</a>
+            <!-- <a class="btn btn-success radius" href="{:url('/sys/article/save')}">
+                <i class="Hui-iconfont">&#xe600;</i> 添加文章</a> -->
             <a class="btn btn-success radius" href="{:url('/sys/article/save', ['content_type'=>1])}">
                 <i class="Hui-iconfont">&#xe600;</i> 添加MarkDown文章</a>
             <a class="btn btn-primary radius" href="javascript:void(0);" onclick="moveArticle()">

+ 7 - 17
view/sys/category/index.html

@@ -1,9 +1,7 @@
 <article class="cl pd-20">
     <div class="cl pd-5 bg-1 bk-gray">
         <span class="l">
-            <!-- <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
-                <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> -->
-            <a class="btn btn-primary radius" href="javascript:save(0);">
+            <a class="btn btn-primary radius" href="javascript:void(0);" onclick="save(0)">
                 <i class="Hui-iconfont">&#xe600;</i> 添加栏目</a>
         </span>
     </div>
@@ -14,8 +12,6 @@
                     <th width="60px">ID</th>
                     <th>栏目名称</th>
                     <th>url</th>
-                    <!-- <th>模型名</th>
-                    <th>列表模板</th> -->
                     <th>导航状态</th>
                     <th style="width: 100px;">排序</th>
                     <th>类型</th>
@@ -28,13 +24,11 @@
                 {foreach $list as $value}
                 <tr class="text-c">
                     <td>{$value.id}</td>
-                    <td>{$value.name}</td>
+                    <td class="text-l">{$value.name}</td>
                     <td>{$value.url}</td>
-                    <!-- <td>{$value.tablename}</td>
-                    <td>{$value.template}</td> -->
                     <td class="td-status-nav">
                         <div class="switch size-S" data-on-label="是" data-off-label="否" data-id="{$value.id}">
-                            <input type="checkbox" {if $value.is_nav==1}checked{/if}>
+                            <input type="checkbox" {if $value.is_nav==0}checked{/if}>
                         </div>
                     </td>
                     <td><input type="text" class="input-text input-sort" value="{$value.sort}" data-id="{$value.id}"
@@ -54,11 +48,9 @@
                     <td>{$val.id}</td>
                     <td>{$val.name}</td>
                     <td>{$val.url}</td>
-                    <!-- <td>{$val.tablename}</td>
-                    <td>{$val.template}</td> -->
                     <td class="td-status-nav">
                         <div class="switch size-S" data-on-label="是" data-off-label="否" data-id="{$val.id}">
-                            <input type="checkbox" {if $val.is_nav==1}checked{/if}>
+                            <input type="checkbox" {if $val.is_nav==0}checked{/if}>
                         </div>
                     </td>
                     <td><input type="text" class="input-text input-sort" value="{$val.sort}" data-id="{$val.id}"
@@ -78,14 +70,12 @@
                     <td>{$vo.id}</td>
                     <td>{$vo.name}</td>
                     <td>{$vo.url}</td>
-                    <!-- <td>{$vo.tablename}</td>
-                    <td>{$vo.template}</td> -->
                     <td class="td-status-nav">
                         <div class="switch size-S" data-on-label="是" data-off-label="否" data-id="{$vo.id}">
-                            <input type="checkbox" {if $vo.is_nav==1}checked{/if}>
+                            <input type="checkbox" {if $vo.is_nav==0}checked{/if}>
                         </div>
                     </td>
-                    <td><input type="text" class="input-text input-sort" value="{$vo.sort}" data-id="{$val.id}"
+                    <td><input type="text" class="input-text input-sort" value="{$vo.sort}" data-id="{$vo.id}"
                         style="text-align: center;"></td>
                     <td>{$types[$vo['type']]}</td>
                     <td>{$vo.create_time}</td>
@@ -107,7 +97,7 @@
 <script type="text/javascript">
     function save(id) {
         var title = id == 0 ? '添加栏目' : '修改栏目'
-        var url = "{:url('save')}" + "?_layer=true&id=" + id
+        var url = "/sys/category/save" + "?_layer=true&id=" + id
         layer_show(title, url, 800, 600);
     }
 

+ 8 - 30
view/sys/category/save.html

@@ -7,7 +7,6 @@
             <div class="formControls col-xs-4 col-sm-6">
                 <span class="select-box">
                     <select class="select" name="parent_id">
-                        <option value="0" {eq name='data.parent_id' value="0" }selected{/eq}>--顶级栏目--</option>
                         {foreach $list as $value}
                         <option value="{$value.id}" {eq name='value.id' value="$data.parent_id" }selected{/eq}>
                             {$value.name}</option>
@@ -42,35 +41,14 @@
             <div class="formControls col-xs-4 col-sm-6">
                 <span class="select-box">
                     <select class="select" name="type">
-                        <option value="0" {eq name='data.type' value="0" }selected{/eq}> 请选择类型 </option>
-                        <option value="1" {eq name='data.type' value="1" }selected{/eq}> 一般栏目 </option>
-                        <option value="2" {eq name='data.type' value="2" }selected{/eq}> 目录 </option>
-                        <option value="3" {eq name='data.type' value="3" }selected{/eq}> 单页 </option>
-                        <option value="4" {eq name='data.type' value="4" }selected{/eq}> 锚点 </option>
-                        <option value="4" {eq name='data.type' value="5" }selected{/eq}> 链接 </option>
+                        <option value="0" {eq name='data.type' value="0" }selected{/eq}> 一般栏目 </option>
+                        <option value="1" {eq name='data.type' value="1" }selected{/eq}> 目录 </option>
+                        <option value="3" {eq name='data.type' value="2" }selected{/eq}> 链接 </option>
                     </select>
                 </span>
             </div>
             <div class="col-3"> </div>
         </div>
-        <!-- <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                模型名:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" value="{$data.tablename}" placeholder="请填写模型名(表名, 小写驼峰, 无前缀)"
-                    id="tablename" name="tablename">
-            </div>
-            <div class="col-3"> </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                列表模板:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" value="{$data.template}" placeholder="请填写列表模板" id="template"
-                    name="template">
-            </div>
-            <div class="col-3"> </div>
-        </div> -->
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-2">
                 栏目标题:</label>
@@ -123,11 +101,11 @@
                 <span class="c-red"></span>导航:</label>
             <div class="formControls col-xs-8 col-sm-6">
                 <div class="radio-box">
-                    <input type="radio" name="is_nav" id="is_menu-1" value="1" {$data.is_nav==1 ? 'checked' : "" }>
+                    <input type="radio" name="is_nav" id="is_menu-1" value="0" {$data.is_nav==0 ? 'checked' : "" }>
                     <label for="is_menu-1">是</label>
                 </div>
                 <div class="radio-box">
-                    <input type="radio" name="is_nav" id="is_menu-2" value="0" {$data.is_nav==0 ? 'checked' : "" }>
+                    <input type="radio" name="is_nav" id="is_menu-2" value="-1" {$data.is_nav==-1 ? 'checked' : "" }>
                     <label for="is_menu-2">否</label>
                 </div>
             </div>
@@ -137,11 +115,11 @@
                 <span class="c-red"></span>新标签打开:</label>
             <div class="formControls col-xs-8 col-sm-6">
                 <div class="radio-box">
-                    <input type="radio" name="is_blank" id="is_blank-1" value="1" {$data.is_blank==1 ? 'checked' : "" }>
+                    <input type="radio" name="is_blank" id="is_blank-1" value="0" {$data.is_blank==0 ? 'checked' : "" }>
                     <label for="is_blank-1">是</label>
                 </div>
                 <div class="radio-box">
-                    <input type="radio" name="is_blank" id="is_blank-2" value="0" {$data.is_blank==0 ? 'checked' : "" }>
+                    <input type="radio" name="is_blank" id="is_blank-2" value="-1" {$data.is_blank==-1 ? 'checked' : "" }>
                     <label for="is_blank-2">否</label>
                 </div>
             </div>
@@ -163,7 +141,7 @@
             var data = $("#form-save").serializeArray();
             $.ajax({
                 type: 'POST',
-                url: '{:url("doSave")}',
+                url: '/sys/category/doSave',
                 data: data,
                 dataType: 'json',
                 success: function (res) {

+ 0 - 136
view/sys/file_manager/database_picture.html

@@ -1,136 +0,0 @@
-<style>
-    #online {
-        width: 100%;
-        height: 224px;
-        padding: 10px 0 0 0;
-    }
-
-    #online #imageList {
-        width: 100%;
-        height: 100%;
-        overflow-x: hidden;
-        overflow-y: auto;
-        position: relative;
-        margin-left: 20px;
-    }
-
-    #online ul {
-        display: block;
-        list-style: none;
-        margin: 0;
-        padding: 0;
-    }
-
-    #online li {
-        float: left;
-        display: block;
-        list-style: none;
-        padding: 0;
-        width: 113px;
-        height: 113px;
-        margin: 0 0 9px 9px;
-        background-color: #eee;
-        overflow: hidden;
-        cursor: pointer;
-        position: relative;
-    }
-
-    #online li img {
-        cursor: pointer;
-    }
-
-    #online li .icon {
-        cursor: pointer;
-        width: 113px;
-        height: 113px;
-        position: absolute;
-        top: 0;
-        left: 0;
-        z-index: 2;
-        border: 0;
-        background-repeat: no-repeat;
-    }
-
-    #online li .icon:hover {
-        width: 107px;
-        height: 107px;
-        border: 3px solid #1094fa;
-    }
-
-    #online li.selected .icon {
-        background-image: url(/static/images/success.png);
-        background-image: url(images/success.gif)\9;
-        background-position: 75px 75px;
-    }
-
-    #online li.clearFloat {
-        float: left;
-        clear: both;
-        display: block;
-        width: 113px;
-        height: 113px;
-        margin: 0 0 9px 9px;
-        padding: 0;
-    }
-</style>
-
-<div class="cl mt-20" id="online">
-    <div id="imageList">
-        <ul class="list">
-            <!-- <li>
-                <img width="170" height="113" src="/storage/20220223/d5cc488e71c58bb072debe45ed06c6ad.jpg?noCache=1634567323"
-                 _src="/storage/20220223/d5cc488e71c58bb072debe45ed06c6ad.jpg">
-                <span class="icon"></span>
-            </li>
-             -->
-            <li class="clearFloat"></li>
-        </ul>
-    </div>
-</div>
-
-<script type="text/javascript">
-    $(function () {
-        $.Huitab("#tab-img .tabBar span", "#tab-img .tabCon", "current", "click", "0");
-        $(document).on("click", "#online li", function () {
-            $("#online li").removeClass('selected');
-            
-            $(this).addClass('selected');
-            
-            img = $(this).children('img').attr('_src');
-            
-            $("#online_file").val(img);
-        });
-    });
-    
-    function onlinepicture() {
-        let infoid = $("input[name='infoid']").val();
-        let cjid = $("input[name='cjid']").val();
-
-        $.ajax({
-            url: '{:url("file_manager/queryList")}',
-            type: 'POST',
-            async: true,
-            cache: false,
-            data: JSON.stringify({
-                infoid: infoid,
-                cjid: cjid
-            }),
-            processData: false,
-            contentType: 'application/json',
-            dataType: "json",
-            success: function (res) {
-                if (res.code == 0) {
-                    html_str = "";
-                    res.list.forEach(element => {
-                        html_str += '<li><img width="170" height="113" src="' + element.filepath + '?noCache=' + element.filetime + '"';
-                        html_str += '_src="' + element.filepath + '" title="'+element.title+'">';
-                        html_str += '<span class="icon"></span></li>';
-                    });
-                    $('ul.list').prepend(html_str);
-                }
-            }
-        });
-    }
-
-    onlinepicture();
-</script>

+ 0 - 81
view/sys/file_manager/directory_picture.html

@@ -1,81 +0,0 @@
-<div class="row cl">
-    <table class="table table-border table-bordered table-bg">
-        <thead>
-            <tr class="text-c">
-                <th>
-                    <strong>文件名</strong>
-                </th>
-                <th>
-                    <strong>文件大小</strong>
-                </th>
-                <th>
-                    <strong>最后修改时间</strong>
-                </th>
-            </tr>
-        </thead>
-        <tbody>
-        </tbody>
-    </table>
-</div>
-
-<script type="text/javascript">
-    var data = {
-        dirs: [],
-        files: [],
-        activeurl: '',
-        activepath: ''
-    }
-
-    function maketbody() {
-        let tbhtml = '';
-        tbhtml += '<tr class="text-c" bgcolor="#FFFFFF" height="26" onMouseMove="javascript:this.bgColor=\'#FCFDEE\';" onMouseOut="javascript:this.bgColor=\'#FFFFFF\';">'
-        tbhtml += '<td>'+(data.activeurl ? '<i class="Hui-iconfont Hui-iconfont-arrow1-top"></i>' : '') +'<a onclick="onlinepicture(\''+data.activeurl+'\')">上级目录</a></td>'
-        tbhtml += '<td>当前目录:<span style="color:#f00;"> ./storage'+data.activepath+'</span></td><td></td></tr>'
-
-        data.dirs.forEach((dir) => {
-            tbhtml += '<tr class="text-c" style="height:26px; " onMouseMove="javascript:this.bgColor=\'#FCFDEE\';" onMouseOut="javascript:this.bgColor=\'#FFFFFF\';">'
-            tbhtml += '<td style="text-align:left;"><img src="/static/images/icon/dir.png">'
-            tbhtml += '<a onclick="onlinepicture(\''+data.activepath+'/'+dir+'\')">'+dir+'</a></td><td></td><td></td></tr>'
-        });
-
-        data.files.forEach((file) => {
-            tbhtml += '<tr class="text-c" style="height:26px; " onMouseMove="javascript:this.bgColor=\'#FCFDEE\';" onMouseOut="javascript:this.bgColor=\'#FFFFFF\';">'
-            tbhtml += '<td style="text-align:left;"><img src="/static/images/icon/'+file.extension+'.png">'
-            tbhtml += '<a onclick="selcetimg(\'/storage'+data.activepath+'/'+file.filename+'\')">'+file.filename+'</a></td>'
-            tbhtml += '<td>'+file.size+'</td><td></td></tr>'
-        });
-
-        document.querySelector('table tbody').innerHTML = tbhtml;
-    }
-
-    function onlinepicture(activepath) {        
-        $.ajax({
-            url: '{:url("file_manager/explorer")}',
-            type: 'GET',
-            async: true,
-            cache: false,
-            data: 'activepath='+activepath,
-            processData: false,
-            contentType: 'application/x-www-form-urlencoded',
-            dataType: "json",
-            success: function (res) {
-                if (res.code == 0) {
-                    // console.log(res);
-                    data.dirs       = res.dirs
-                    data.files      = res.files
-                    data.activeurl  = res.activeurl
-                    data.activepath = res.activepath
-
-                    maketbody();
-                }
-            }
-        });
-    }
-
-    function selcetimg(img) {
-        $("#online_file").val(img);
-    }
-
-    onlinepicture(data.activepath);
-</script>
-

+ 0 - 462
view/sys/file_manager/explorer.html

@@ -1,462 +0,0 @@
-<<<<<<< HEAD
-<style>
-    .progress {
-        width: 600px;
-        height: 10px;
-        border: 1px solid #ccc;
-        border-radius: 10px;
-        margin: 10px 0px;
-        overflow: hidden;
-        display: -webkit-inline-box;
-    }
-
-    /* 初始状态设置进度条宽度为0px */
-    .progress>div {
-        width: 0px;
-        height: 100%;
-        background-color: yellowgreen;
-        transition: all .3s ease;
-    }
-</style>
-
-<article class="cl pd-20">
-    <div class="cl pd-5 bg-1 bk-gray">
-        <span class="l">
-            <a class="btn radius btn-default" href="{:url('index')}"><i
-                    class="Hui-iconfont Hui-iconfont-pages"></i>数据库模式</a>
-            <a class="btn radius btn-secondary"><i class="Hui-iconfont Hui-iconfont-jifen"></i> 目录模式 </a>
-            <a class="btn btn-primary radius" onclick="uploadFile();"><i
-                    class="Hui-iconfont Hui-iconfont-add"></i>上传附件</a>
-            <input type="file" id="upload_file" hidden multiple onchange="fileChange()">
-            <input type="hidden" id="activepath" name="activepath" value="{$activepath}">
-            <div class="progress">
-                <div></div>
-            </div>
-        </span>
-        <span class="r">共有:
-            <strong>{$counts}</strong> 个对象</span>
-    </div>
-    <div class="cl mt-20">
-        <table class="table table-border table-bordered table-bg">
-            <thead>
-                <tr class="text-c">
-                    <th width="25%">
-                        <strong>文件名</strong>
-                    </th>
-                    <th width="16%">
-                        <strong>文件大小</strong>
-                    </th>
-                    <th width="22%">
-                        <strong>最后修改时间</strong>
-                    </th>
-                    <th width="34%">
-                        <strong>操作</strong>
-                    </th>
-                </tr>
-            </thead>
-            <tbody>
-                <tr class="text-c" bgcolor='#FFFFFF' height='26' onMouseMove="javascript:this.bgColor='#FCFDEE';"
-                    onMouseOut="javascript:this.bgColor='#FFFFFF';">
-                    <td>
-                        {notempty name="activepath"}<i class="Hui-iconfont Hui-iconfont-arrow1-top"></i>{/notempty}
-                        <a href="/sys/file_manager/explorer?activepath={$activeurl}">上级目录</a>
-                    </td>
-                    <td>当前目录:
-                        <span style="color:#f00;"> ./storage{$activepath} </span>  
-                    </td>
-                    <td></td>
-                    <td></td>
-                </tr>
-                {foreach $dirs as $dir}
-                <tr class="text-c" style="height:26px; " onMouseMove="javascript:this.bgColor='#FCFDEE';"
-                    onMouseOut="javascript:this.bgColor='#FFFFFF';">
-                    <td style="text-align:left;">
-                        <img src=/static/images/icon/dir.png>
-                        <a href="/sys/file_manager/explorer?activepath={$activepath.'/'.$dir}">
-                            {$dir}
-                        </a>
-                    </td>
-                    <td></td>
-                    <td></td>
-                    <td>
-                        <a class="btn" onclick="del_dir(this, '{$activepath}/{$dir}')">删除</a>
-                    </td>
-                </tr>
-                {/foreach}
-                {foreach $files as $file}
-                <tr class="text-c" bgcolor='#FFFFFF' height='26' onMouseMove="javascript:this.bgColor='#FCFDEE';"
-                    onMouseOut="javascript:this.bgColor='#FFFFFF';">
-                    <td style="text-align:left;">
-                        <img src="/static/images/icon/{$file['extension']}.png">
-                        <a href="/storage{$activepath}/{$file['filename']}" target="_blank">
-                            {$file['filename']}
-                        </a>
-                    </td>
-                    <td align='center'> {$file['size']} </td>
-                    <td align='center'> {$file['time']|date="Y-m-d H:i:s"} </td>
-                    <td>
-                        <a href="/storage{$activepath.'/'.$file['filename']}" class="btn radius btn-primary"
-                            target="_blank">查看/下载</a>&nbsp;
-                        <a class="btn radius btn-danger"
-                            onclick="del_file(this,'{$activepath}/{$file.filename}')">删除</a>&nbsp;
-                        <!-- <a href='' class="btn" >移动</a> -->
-                    </td>
-                </tr>
-                {/foreach}
-            </tbody>
-        </table>
-    </div>
-</article>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    /*删除图片*/
-    function del_dir(obj, dir) {
-        layer.confirm('确认要删除吗?', function (index) {
-            $.post('deldir', {
-                'dir': dir
-            }, function (res) {
-                if (res.code == 0) {
-                    $(obj).parents('tr').remove();
-                    topalert({
-                        type: 0,
-                        content: res.msg,
-                        speed: 1000
-                    });
-                } else {
-                    topalert({
-                        type: 2,
-                        content: res.msg,
-                        speed: 2000
-                    });
-                }
-                layer.close(layer.index);
-            }, 'json');
-        });
-    }
-
-    /*删除图片*/
-    function del_file(obj, filename) {
-        layer.confirm('确认要删除吗?', function (index) {
-            $.post('delfile', {
-                'filename': filename
-            }, function (res) {
-                if (res.code == 0) {
-                    $(obj).parents('tr').remove();
-                    topalert({
-                        type: 0,
-                        content: res.msg,
-                        speed: 1000
-                    });
-                } else {
-                    topalert({
-                        type: 2,
-                        content: res.msg,
-                        speed: 2000
-                    });
-                }
-                layer.close(layer.index);
-            }, 'json');
-        });
-    }
-
-    //通过点击图片来触发文件上传按钮
-    function uploadFile(params) {
-        $("#upload_file").click();
-    }
-
-    // 自动上传处理
-    function fileChange() {
-        let uploadFile = $("#upload_file").get(0).files;
-        // console.log(uploadFile);
-        if (uploadFile == undefined || uploadFile == null) {
-            layer.msg("请选择文件", { icon: 5, time: 1000 });
-            return false;
-        }
-
-        if (uploadFile.length > 20) {
-            layer.msg("最多20个文件", { icon: 5, time: 1000 });
-            return false;
-        }
-
-        let formData = new FormData();
-
-        formData.append('activepath', $('#activepath').val());
-
-        for (let i = 0; i < uploadFile.length; i++) {
-            formData.append('upload_file[]', uploadFile[i]);
-        }
-
-        $.ajax({
-            url: '{:url("file_manager/uploadFile")}',
-            type: 'post',
-            dataType: 'json',
-            data: formData,
-            processData: false,
-            contentType: false,
-            xhr: function () {
-                var xhr = new XMLHttpRequest();
-                //使用XMLHttpRequest.upload监听上传过程,注册progress事件,打印回调函数中的event事件
-                xhr.upload.addEventListener('progress', function (e) {
-                    // console.log(e);
-                    //loaded代表上传了多少
-                    //total代表总数为多少
-                    var progressRate = (e.loaded / e.total) * 100 + '%';
-
-                    //通过设置进度条的宽度达到效果
-                    $('.progress > div').css('width', progressRate);
-                })
-
-                return xhr;
-            },
-            success: function (res) {
-                console.log(res);
-                if (res.code == 0) {
-                    layer.msg(res.msg, {
-                        icon: 1,
-                        time: 1000
-                    });
-                    window.location.reload();
-                } else {
-                    layer.msg(res.msg, {
-                        icon: 5,
-                        time: 1000
-                    });
-                    return false;
-                }
-            }
-        });
-    }
-</script>
-=======
-<style>
-    .progress {
-        width: 600px;
-        height: 10px;
-        border: 1px solid #ccc;
-        border-radius: 10px;
-        margin: 10px 0px;
-        overflow: hidden;
-        display: -webkit-inline-box;
-    }
-
-    /* 初始状态设置进度条宽度为0px */
-    .progress>div {
-        width: 0px;
-        height: 100%;
-        background-color: yellowgreen;
-        transition: all .3s ease;
-    }
-</style>
-
-<article class="cl pd-20">
-    <div class="cl pd-5 bg-1 bk-gray">
-        <span class="l">
-            <a class="btn radius btn-default" href="{:url('index')}"><i
-                    class="Hui-iconfont Hui-iconfont-pages"></i>数据库模式</a>
-            <a class="btn radius btn-secondary"><i class="Hui-iconfont Hui-iconfont-jifen"></i> 目录模式 </a>
-            <a class="btn btn-primary radius" onclick="uploadFile();"><i
-                    class="Hui-iconfont Hui-iconfont-add"></i>上传附件</a>
-            <input type="file" id="upload_file" hidden multiple onchange="fileChange()">
-            <input type="hidden" id="activepath" name="activepath" value="{$activepath}">
-            <div class="progress">
-                <div></div>
-            </div>
-        </span>
-        <span class="r">共有:
-            <strong>{$counts}</strong> 个对象</span>
-    </div>
-    <div class="cl mt-20">
-        <table class="table table-border table-bordered table-bg">
-            <thead>
-                <tr class="text-c">
-                    <th width="25%">
-                        <strong>文件名</strong>
-                    </th>
-                    <th width="16%">
-                        <strong>文件大小</strong>
-                    </th>
-                    <th width="22%">
-                        <strong>最后修改时间</strong>
-                    </th>
-                    <th width="34%">
-                        <strong>操作</strong>
-                    </th>
-                </tr>
-            </thead>
-            <tbody>
-                <tr class="text-c" bgcolor='#FFFFFF' height='26' onMouseMove="javascript:this.bgColor='#FCFDEE';"
-                    onMouseOut="javascript:this.bgColor='#FFFFFF';">
-                    <td>
-                        {notempty name="activepath"}<i class="Hui-iconfont Hui-iconfont-arrow1-top"></i>{/notempty}
-                        <a href="/sys/file_manager/explorer?activepath={$activeurl}">上级目录</a>
-                    </td>
-                    <td>当前目录:
-                        <span style="color:#f00;"> ./storage{$activepath} </span>  
-                    </td>
-                    <td></td>
-                    <td></td>
-                </tr>
-                {foreach $dirs as $dir}
-                <tr class="text-c" style="height:26px; " onMouseMove="javascript:this.bgColor='#FCFDEE';"
-                    onMouseOut="javascript:this.bgColor='#FFFFFF';">
-                    <td style="text-align:left;">
-                        <img src="/static/images/icon/dir.png">
-                        <a href="/sys/file_manager/explorer?activepath={$activepath.'/'.$dir}">
-                            {$dir}
-                        </a>
-                    </td>
-                    <td></td>
-                    <td></td>
-                    <td>
-                        <a class="btn" onclick="del_dir(this, '{$activepath}/{$dir}')">删除</a>
-                    </td>
-                </tr>
-                {/foreach}
-                {foreach $files as $file}
-                <tr class="text-c" bgcolor='#FFFFFF' height='26' onMouseMove="javascript:this.bgColor='#FCFDEE';"
-                    onMouseOut="javascript:this.bgColor='#FFFFFF';">
-                    <td style="text-align:left;">
-                        <img src="/static/images/icon/{$file['extension']}.png">
-                        <a href="/storage{$activepath}/{$file['filename']}" target="_blank">
-                            {$file['filename']}
-                        </a>
-                    </td>
-                    <td align='center'> {$file['size']} </td>
-                    <td align='center'> {$file['time']|date="Y-m-d H:i:s"} </td>
-                    <td>
-                        <a href="/storage{$activepath.'/'.$file['filename']}" class="btn radius btn-primary"
-                            target="_blank">查看/下载</a>&nbsp;
-                        <a class="btn radius btn-danger"
-                            onclick="del_file(this,'{$activepath}/{$file.filename}')">删除</a>&nbsp;
-                        <!-- <a href='' class="btn" >移动</a> -->
-                    </td>
-                </tr>
-                {/foreach}
-            </tbody>
-        </table>
-    </div>
-</article>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    /*删除图片*/
-    function del_dir(obj, dir) {
-        layer.confirm('确认要删除吗?', function (index) {
-            $.post('deldir', {
-                'dir': dir
-            }, function (res) {
-                if (res.code == 0) {
-                    $(obj).parents('tr').remove();
-                    topalert({
-                        type: 0,
-                        content: res.msg,
-                        speed: 1000
-                    });
-                } else {
-                    topalert({
-                        type: 2,
-                        content: res.msg,
-                        speed: 2000
-                    });
-                }
-                layer.close(layer.index);
-            }, 'json');
-        });
-    }
-
-    /*删除图片*/
-    function del_file(obj, filename) {
-        layer.confirm('确认要删除吗?', function (index) {
-            $.post('delfile', {
-                'filename': filename
-            }, function (res) {
-                if (res.code == 0) {
-                    $(obj).parents('tr').remove();
-                    topalert({
-                        type: 0,
-                        content: res.msg,
-                        speed: 1000
-                    });
-                } else {
-                    topalert({
-                        type: 2,
-                        content: res.msg,
-                        speed: 2000
-                    });
-                }
-                layer.close(layer.index);
-            }, 'json');
-        });
-    }
-
-    //通过点击图片来触发文件上传按钮
-    function uploadFile(params) {
-        $("#upload_file").click();
-    }
-
-    // 自动上传处理
-    function fileChange() {
-        let uploadFile = $("#upload_file").get(0).files;
-        // console.log(uploadFile);
-        if (uploadFile == undefined || uploadFile == null) {
-            layer.msg("请选择文件", { icon: 5, time: 1000 });
-            return false;
-        }
-
-        if (uploadFile.length > 20) {
-            layer.msg("最多20个文件", { icon: 5, time: 1000 });
-            return false;
-        }
-
-        let formData = new FormData();
-
-        formData.append('activepath', $('#activepath').val());
-
-        for (let i = 0; i < uploadFile.length; i++) {
-            formData.append('upload_file[]', uploadFile[i]);
-        }
-
-        $.ajax({
-            url: '{:url("file_manager/uploadFile")}',
-            type: 'post',
-            dataType: 'json',
-            data: formData,
-            processData: false,
-            contentType: false,
-            xhr: function () {
-                var xhr = new XMLHttpRequest();
-                //使用XMLHttpRequest.upload监听上传过程,注册progress事件,打印回调函数中的event事件
-                xhr.upload.addEventListener('progress', function (e) {
-                    // console.log(e);
-                    //loaded代表上传了多少
-                    //total代表总数为多少
-                    var progressRate = (e.loaded / e.total) * 100 + '%';
-
-                    //通过设置进度条的宽度达到效果
-                    $('.progress > div').css('width', progressRate);
-                })
-
-                return xhr;
-            },
-            success: function (res) {
-                console.log(res);
-                if (res.code == 0) {
-                    layer.msg(res.msg, {
-                        icon: 1,
-                        time: 1000
-                    });
-                    window.location.reload();
-                } else {
-                    layer.msg(res.msg, {
-                        icon: 5,
-                        time: 1000
-                    });
-                    return false;
-                }
-            }
-        });
-    }
-</script>
->>>>>>> 78b76253c8ce5873016cf837373af5e30ac80c86
-<!--请在上方写此页面业务相关的脚本-->

+ 0 - 415
view/sys/file_manager/index.html

@@ -1,415 +0,0 @@
-<<<<<<< HEAD
-<style>
-    .progress {
-        width: 600px;
-        height: 10px;
-        border: 1px solid #ccc;
-        border-radius: 10px;
-        margin: 10px 0px;
-        overflow: hidden;
-        display: -webkit-inline-box;
-    }
-
-    /* 初始状态设置进度条宽度为0px */
-    .progress>div {
-        width: 0px;
-        height: 100%;
-        background-color: yellowgreen;
-        transition: all .3s ease;
-    }
-</style>
-
-<article class="cl pd-10">
-    <div class="cl pd-5 bg-1 bk-gray mt-20">
-        <span class="l">
-            <a class="btn radius btn-secondary"><i class="Hui-iconfont Hui-iconfont-jifen"></i>数据库模式</a>
-            <a class="btn radius btn-default" href="{:url('explorer')}"><i class="Hui-iconfont Hui-iconfont-pages"></i> 目录模式 </a>
-            <a class="btn btn-danger radius" onclick="del_all();"><i class="Hui-iconfont Hui-iconfont-del2"></i>批量删除</a>
-            <a class="btn btn-primary radius" onclick="uploadFile();"><i class="Hui-iconfont Hui-iconfont-add"></i>上传附件</a>
-            <input type="file" id="upload_file" hidden multiple onchange="fileChange()">
-            <div class="progress">
-                <div></div>
-            </div>
-        </span>
-        <span class="r">共有数据:<strong id="total">{$list->total()}</strong>条</span>
-    </div>
-
-    <div class="cl mt-20">
-        <table class="table table-border table-bordered table-bg">
-            <thead>
-                <tr class="text-c">
-                    <th width="25px;">
-                        <input type="checkbox" name="allcheck" value="">
-                    </th>
-                    <th width="60px;">ID</th>
-                    <th>文件title</th>
-                    <th style="min-width: 260px;">文件路径</th>
-                    <th>文件类型</th>
-                    <th>文件大小</th>
-                    <th>增加者</th>
-                    <th>增加时间</th>
-                    <th width="100px;">操作</th>
-                </tr>
-            </thead>
-            <tbody>
-                {foreach $list as $val}
-                <tr class="text-c">
-                    <td>
-                        <input type="checkbox" value="{$val.fileid}" name="checkbox[]">
-                    </td>
-                    <td>{$val.fileid}</td>
-                    <td class="text-l">{$val.title}</td>
-                    <td class="text-l">
-                        <a href="{$val.filepath}" title="{$val.filepath}" target="_blank">{$val.filepath}</a>
-                    </td>
-                    <td>{$val.fileextension}</td>
-                    <td>{$val.filesize|format_bytes}</td>
-                    <td>{$val.username}</td>
-                    <td>{$val.filetime|date="Y-m-d H:i:s"}</td>
-                    <td class="td-manager">
-                        <a class="btn btn-secondary radius" title="编辑title" onClick="editTitle('{$val.fileid}','{$val.title}')"><i
-                            class="Hui-iconfont Hui-iconfont-edit"></i></a>
-                        <a class="btn btn-danger radius" title="删除" onClick="del(this,'{$val.fileid}')"><i
-                            class="Hui-iconfont Hui-iconfont-del2"></i></a></td>
-                </tr>
-                {/foreach}
-            </tbody>
-        </table>
-    </div>
-</article>
-
-<script>
-    //通过点击图片来触发文件上传按钮
-    function uploadFile(params) {
-        $("#upload_file").click();
-    }
-
-    // 上传处理
-    function fileChange() {
-        let uploadFile = $("#upload_file").get(0).files;
-        // console.log(uploadFile);
-        if (uploadFile == undefined || uploadFile == null) {
-            layer.msg("请选择文件", { icon: 5, time: 1000 });
-            return false;
-        }
-
-        if (uploadFile.length > 20) {
-            layer.msg("最多20个文件", { icon: 5, time: 1000 });
-            return false;
-        }
-
-        let formData = new FormData();
-
-        for (let i = 0; i < uploadFile.length; i++) {
-            formData.append('upload_file[]', uploadFile[i]);
-        }
-
-        $.ajax({
-            url: '{:url("file_manager/uploadFile")}',
-            type: 'post',
-            dataType: 'json',
-            data: formData,
-            processData: false,
-            contentType: false,
-            xhr: function () {
-                var xhr = new XMLHttpRequest();
-                //使用XMLHttpRequest.upload监听上传过程,注册progress事件,打印回调函数中的event事件
-                xhr.upload.addEventListener('progress', function (e) {
-                    // console.log(e);
-                    //loaded代表上传了多少
-                    //total代表总数为多少
-                    var progressRate = (e.loaded / e.total) * 100 + '%';
-
-                    //通过设置进度条的宽度达到效果
-                    $('.progress > div').css('width', progressRate);
-                })
-
-                return xhr;
-            },
-            success: function (res) {
-                console.log(res);
-                if (res.code == 0) {
-                    layer.msg(res.msg, {
-                        icon: 1,
-                        time: 1000
-                    });
-                    window.location.reload();
-                } else {
-                    layer.msg(res.msg, {
-                        icon: 5,
-                        time: 1000
-                    });
-                    return false;
-                }
-            }
-        });
-    }
-
-    function editTitle(id, title) {
-        if (id==0) {
-            layer.msg('id不可为空', {icon: 5,time: 1000});
-        }
-
-        var content  = '<div  class="cl" style="padding:20px;">';
-            content += '<label class="form-label col-sm-4">';
-            content += '<span class="c-red">*</span>文件title:</label>';
-            content += '<div class="formControls col-sm-6">';
-            content += '<input type="text" class="input-text" name="filetile" id="filetile">';
-            content += '</div><div class="col-3"></div></div></div>';
-
-        layer.open({
-            type: 1,
-            area: ['500px', '200px'],
-            title: '修改文件title',
-            content: '\<\div style="padding:20px;">\<\span class="c-red">*\<\/span>文件title:\<\input type="text" class="input-text" name="filetitle" value="'+title+'" id="filetitle">\<\/div>',
-            btn: ['确定', '取消'],
-            yes: function(index, layero){
-                let filetitle = document.querySelector('input[name="filetitle"]').value;
-                $.ajax({
-                    url: '{:url("file_manager/updateFileTitle")}',
-                    type: 'post',
-                    dataType: 'json',
-                    contentType: 'application/json',
-                    data: JSON.stringify({
-                        id: id,
-                        filetitle: filetitle
-                    }),
-                    success: function (res) {
-                        if (res.code == 0) {
-                            layer.msg(res.msg, {
-                                icon: 1,
-                                time: 1000
-                            });
-                            window.location.reload();
-                        } else {
-                            layer.msg(res.msg, {
-                                icon: 5,
-                                time: 1000
-                            });
-                        }
-                        layer.close(index);
-                    }
-                });
-            }
-        });
-        
-        // layer.open({
-        //     type: 2,
-        //     area: ['700px', '500px'],
-        //     fix: false, //不固定
-        //     maxmin: true,
-        //     shade: 0.4,
-        //     title: '添加标题图',
-        //     content: 'test'
-        // });
-    }
-=======
-<style>
-    .progress {
-        width: 600px;
-        height: 10px;
-        border: 1px solid #ccc;
-        border-radius: 10px;
-        margin: 10px 0px;
-        overflow: hidden;
-        display: -webkit-inline-box;
-    }
-
-    /* 初始状态设置进度条宽度为0px */
-    .progress>div {
-        width: 0px;
-        height: 100%;
-        background-color: yellowgreen;
-        transition: all .3s ease;
-    }
-</style>
-
-<article class="cl pd-10">
-    <div class="cl pd-5 bg-1 bk-gray mt-20">
-        <span class="l">
-            <a class="btn radius btn-secondary"><i class="Hui-iconfont Hui-iconfont-jifen"></i>数据库模式</a>
-            <a class="btn radius btn-default" href="{:url('explorer')}"><i class="Hui-iconfont Hui-iconfont-pages"></i> 目录模式 </a>
-            <a class="btn btn-danger radius" onclick="del_all();"><i class="Hui-iconfont Hui-iconfont-del2"></i>批量删除</a>
-            <a class="btn btn-primary radius" onclick="uploadFile();"><i class="Hui-iconfont Hui-iconfont-add"></i>上传附件</a>
-            <input type="file" id="upload_file" hidden multiple onchange="fileChange()">
-            <div class="progress">
-                <div></div>
-            </div>
-        </span>
-        <span class="r">共有数据:<strong id="total">{$list->total()}</strong>条</span>
-    </div>
-
-    <div class="cl mt-20">
-        <table class="table table-border table-bordered table-bg">
-            <thead>
-                <tr class="text-c">
-                    <th width="25px;">
-                        <input type="checkbox" name="allcheck" value="">
-                    </th>
-                    <th width="60px;">ID</th>
-                    <th>文件title</th>
-                    <th style="min-width: 260px;">文件路径</th>
-                    <th>文件类型</th>
-                    <th>文件大小</th>
-                    <th>增加者</th>
-                    <th>增加时间</th>
-                    <th width="100px;">操作</th>
-                </tr>
-            </thead>
-            <tbody>
-                {foreach $list as $val}
-                <tr class="text-c">
-                    <td>
-                        <input type="checkbox" value="{$val.fileid}" name="checkbox[]">
-                    </td>
-                    <td>{$val.fileid}</td>
-                    <td class="text-l">{$val.title}</td>
-                    <td class="text-l">
-                        <a href="{$val.filepath}" title="{$val.filepath}" target="_blank">{$val.filepath}</a>
-                    </td>
-                    <td>{$val.fileextension}</td>
-                    <td>{$val.filesize|format_bytes}</td>
-                    <td>{$val.username}</td>
-                    <td>{$val.filetime|date="Y-m-d H:i:s"}</td>
-                    <td class="td-manager">
-                        <a class="btn btn-secondary radius" title="编辑title" onClick="editTitle('{$val.fileid}','{$val.title}')"><i
-                            class="Hui-iconfont Hui-iconfont-edit"></i></a>
-                        <a class="btn btn-danger radius" title="删除" onClick="del(this,'{$val.fileid}')"><i
-                            class="Hui-iconfont Hui-iconfont-del2"></i></a></td>
-                </tr>
-                {/foreach}
-            </tbody>
-        </table>
-    </div>
-    <div class="cl pd-5 bg-1 bk-gray mt-20 ">
-        <span class="r">{$list->render()|raw}</span>
-    </div>
-</article>
-
-<script>
-    //通过点击图片来触发文件上传按钮
-    function uploadFile(params) {
-        $("#upload_file").click();
-    }
-
-    // 上传处理
-    function fileChange() {
-        let uploadFile = $("#upload_file").get(0).files;
-        // console.log(uploadFile);
-        if (uploadFile == undefined || uploadFile == null) {
-            layer.msg("请选择文件", { icon: 5, time: 1000 });
-            return false;
-        }
-
-        if (uploadFile.length > 20) {
-            layer.msg("最多20个文件", { icon: 5, time: 1000 });
-            return false;
-        }
-
-        let formData = new FormData();
-
-        for (let i = 0; i < uploadFile.length; i++) {
-            formData.append('upload_file[]', uploadFile[i]);
-        }
-
-        $.ajax({
-            url: '{:url("file_manager/uploadFile")}',
-            type: 'post',
-            dataType: 'json',
-            data: formData,
-            processData: false,
-            contentType: false,
-            xhr: function () {
-                var xhr = new XMLHttpRequest();
-                //使用XMLHttpRequest.upload监听上传过程,注册progress事件,打印回调函数中的event事件
-                xhr.upload.addEventListener('progress', function (e) {
-                    // console.log(e);
-                    //loaded代表上传了多少
-                    //total代表总数为多少
-                    var progressRate = (e.loaded / e.total) * 100 + '%';
-
-                    //通过设置进度条的宽度达到效果
-                    $('.progress > div').css('width', progressRate);
-                })
-
-                return xhr;
-            },
-            success: function (res) {
-                console.log(res);
-                if (res.code == 0) {
-                    layer.msg(res.msg, {
-                        icon: 1,
-                        time: 1000
-                    });
-                    window.location.reload();
-                } else {
-                    layer.msg(res.msg, {
-                        icon: 5,
-                        time: 1000
-                    });
-                    return false;
-                }
-            }
-        });
-    }
-
-    function editTitle(id, title) {
-        if (id==0) {
-            layer.msg('id不可为空', {icon: 5,time: 1000});
-        }
-
-        var content  = '<div  class="cl" style="padding:20px;">';
-            content += '<label class="form-label col-sm-4">';
-            content += '<span class="c-red">*</span>文件title:</label>';
-            content += '<div class="formControls col-sm-6">';
-            content += '<input type="text" class="input-text" name="filetile" id="filetile">';
-            content += '</div><div class="col-3"></div></div></div>';
-
-        layer.open({
-            type: 1,
-            area: ['500px', '200px'],
-            title: '修改文件title',
-            content: '\<\div style="padding:20px;">\<\span class="c-red">*\<\/span>文件title:\<\input type="text" class="input-text" name="filetitle" value="'+title+'" id="filetitle">\<\/div>',
-            btn: ['确定', '取消'],
-            yes: function(index, layero){
-                let filetitle = document.querySelector('input[name="filetitle"]').value;
-                $.ajax({
-                    url: '{:url("file_manager/updateFileTitle")}',
-                    type: 'post',
-                    dataType: 'json',
-                    contentType: 'application/json',
-                    data: JSON.stringify({
-                        id: id,
-                        filetitle: filetitle
-                    }),
-                    success: function (res) {
-                        if (res.code == 0) {
-                            layer.msg(res.msg, {
-                                icon: 1,
-                                time: 1000
-                            });
-                            window.location.reload();
-                        } else {
-                            layer.msg(res.msg, {
-                                icon: 5,
-                                time: 1000
-                            });
-                        }
-                        layer.close(index);
-                    }
-                });
-            }
-        });
-        
-        // layer.open({
-        //     type: 2,
-        //     area: ['700px', '500px'],
-        //     fix: false, //不固定
-        //     maxmin: true,
-        //     shade: 0.4,
-        //     title: '添加标题图',
-        //     content: 'test'
-        // });
-    }
->>>>>>> 78b76253c8ce5873016cf837373af5e30ac80c86
-</script>

+ 0 - 345
view/sys/file_manager/uploadimg.html

@@ -1,345 +0,0 @@
-<div id="tab-img" class="HuiTab">
-    <div class="tabBar clearfix">
-        <span>本地上传</span>
-        <span>网络文件上传</span>
-        <span>服务器图片选择</span>
-        <input type="hidden" name="layer" id="layer" value="{$layer}">
-        <input type="hidden" name="infoid" value={$infoid}>
-        <input type="hidden" name="cjid" value={$cjid}>
-    </div>
-    <!-- 本地上传 -->
-    <div class="tabCon">
-        <div class="step1 active" style="margin-left:30px;">
-            <form id="form-uploadimg" method="post" action="" enctype="multipart/form-data">
-                <div class="row cl" style="margin-top:20px;">
-                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>图片要求: </label>
-                    <div class="formControls col-xs-8 col-sm-8">
-                        格式 jpg,png,gif,jpeg,webp; 大小不超过4M.
-                    </div>
-                    <div class="col-3"> </div>
-                </div>
-                <div class="row cl" style="margin-top:20px;">
-                    <label class="form-label col-xs-2 col-sm-2">
-                        <span class="c-red">*</span>本地上传:</label>
-                    <div class="formControls  col-xs-8 col-sm-8">
-                        <input type="file" class="input-text" name="upload_file" id="upload_file">
-                    </div>
-                    <div class="col-3"> </div>
-                </div>
-                <div class="row cl" style="margin-top:20px;">
-                    <input type="hidden" name="img_id" value={$img_id}>
-                    <input type="hidden" name="infoid" value={$infoid}>
-                    <input type="hidden" name="cjid" value={$cjid}>
-                    <div class="formControls col-sm-12">
-                        <div class="skin-minimal">
-                            <div class="check-box">
-                                <input type="checkbox" name="thumb" value="true" {$thumb ? 'checked' : "" }>
-                                <label for="thumb-1">缩略图</label>
-                                <input type="text" class="input-text" name="width" value={$width}
-                                    style="width: 80px;">缩略图宽度
-                                <input type="text" class="input-text" name="height" value={$height}
-                                    style="width: 80px;">缩略图高度
-                                <input type="checkbox" name="original" value="true" {$original ? 'checked' : "" } style="margin-left: 20px;">
-                                <label for="overwrite">保留原图</label>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="row cl" style="margin-top:30px;margin-left:30px;">
-                    <div class="col-xs-6 col-sm-5 col-xs-offset-2 col-sm-offset-2">
-                        <input class="btn btn-primary radius" type="button" value="&nbsp;确&nbsp;定&nbsp;"
-                            onCLick="uploadLocalImg();">
-                        <input class="btn btn-default radius" type="button" value="&nbsp;取&nbsp;消&nbsp;"
-                            onClick="layer_close();">
-                    </div>
-                </div>
-            </form>
-        </div>
-        <!-- 本地上传end -->
-    </div>
-    <!-- 网络图片 -->
-    <div class="tabCon">
-        <form id="form-uploadurlimg" method="post" action="" enctype="multipart/form-data">
-            <div class="row cl" style="margin-top:20px;">
-                <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>图片要求: </label>
-                <div class="formControls col-xs-8 col-sm-8">
-                    格式 jpg,png,gif,jpeg,webp; 大小不超过4M.
-                </div>
-                <div class="col-3"> </div>
-            </div>
-            <div class="row cl" style="margin-top:20px;">
-                <label class="form-label col-xs-2 col-sm-2">
-                    <span class="c-red">*</span>图片地址:</label>
-                <div class="formControls col-xs-8 col-sm-8">
-                    <input type="text" class="input-text" name="url_file" id="url_file">
-                </div>
-                <div class="col-3"> </div>
-            </div>
-            <div class="row cl" style="margin-top:20px;">
-                <input type="hidden" name="img_id" value={$img_id}>
-                <div class="formControls col-xs-12 col-sm-12">
-                    <div class="skin-minimal">
-                        <div class="check-box">
-                            <input type="checkbox" name="thumb" value="{$thumb}" {$thumb ? 'checked' : "" }>
-                            <label for="thumb-1">缩略图</label>
-                            <input type="text" class="input-text" name="width" value={$width} style="width: 80px;">缩略图宽度
-                            <input type="text" class="input-text" name="height" value={$height}
-                                style="width: 80px;">缩略图高度
-                            <input type="checkbox" name="original" value="{$original}" {$original ? 'checked' : "" } style="margin-left: 20px;">
-                            <label for="overwrite">保留原图</label>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="row cl" style="margin-top:30px;margin-left:30px;">
-                <div class="col-xs-6 col-sm-5 col-xs-offset-2 col-sm-offset-2">
-                    <input class="btn btn-primary radius" type="button" value="&nbsp;确&nbsp;定&nbsp;"
-                        onCLick="uploadUrlImg()">
-                    <input class="btn btn-default radius" type="button" value="&nbsp;取&nbsp;消&nbsp;"
-                        onClick="layer_close();">
-                </div>
-            </div>
-        </form>
-    </div>
-    <!-- 在线图片 -->
-    <style>
-        a.active-btn {
-            color: #fff;
-            background-color: #3bb4f2;
-            border-color: #3bb4f2;
-        }
-    </style>
-    <div class="tabCon">
-        <a class="btn radius active-btn" id="database_picture"><i class="Hui-iconfont Hui-iconfont-jifen"></i>数据库模式</a>
-        <a class="btn radius" id="directory_picture"><i class="Hui-iconfont Hui-iconfont-pages"></i> 目录模式</a>
-        <div class="database online-picture">
-            {include file="file_manager/database_picture" /}
-        </div>
-        <div class="directory online-picture" style="display: none;">
-            {include file="file_manager/directory_picture" /}
-        </div>
-        <form id="form-uploadonlineimg" method="post" action="" enctype="multipart/form-data">
-            <div class="row cl" style="margin-top:20px;">
-                <label class="form-label col-xs-2 col-sm-2">
-                    <span class="c-red">*</span>图片地址:</label>
-                <div class="formControls col-xs-8 col-sm-8">
-                    <input type="hidden" name="img_id" value={$img_id}>
-                    <input type="text" class="input-text" name="online_file" id="online_file">
-                </div>
-                <div class="col-3"> </div>
-            </div>
-            <div class="row cl" style="margin-top:30px;margin-left:30px;">
-                <div class="col-xs-6 col-sm-5 col-xs-offset-2 col-sm-offset-2">
-                    <input class="btn btn-primary radius" type="button" value="&nbsp;确&nbsp;定&nbsp;"
-                        onCLick="uploadOnlineImg()">
-                    <input class="btn btn-default radius" type="button" value="&nbsp;取&nbsp;消&nbsp;"
-                        onClick="layer_close();">
-                </div>
-            </div>
-        </form>
-    </div>
-</div>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    jQuery.Huitab = function (tabBar, tabCon, class_name, tabEvent, i) {
-        var $tab_menu = $(tabBar);
-        // 初始化操作
-        $tab_menu.removeClass(class_name);
-        $(tabBar).eq(i).addClass(class_name);
-        $(tabCon).hide();
-        $(tabCon).eq(i).show();
-
-        $tab_menu.bind(tabEvent, function () {
-            $tab_menu.removeClass(class_name);
-            $(this).addClass(class_name);
-            var index = $tab_menu.index(this);
-            $(tabCon).hide();
-            $(tabCon).eq(index).show()
-        })
-    }
-
-    $(function () {
-        $.Huitab("#tab-img .tabBar span", "#tab-img .tabCon", "current", "click", "0");
-
-        $("#database_picture").click(function () {
-            $(".online-picture").css('display', 'none');
-            $(".database").css('display', 'block');
-
-            $(this).addClass('active-btn');
-            $('#directory_picture').removeClass('active-btn');
-        });
-
-        $("#directory_picture").click(function () {
-            $(".online-picture").css('display', 'none');
-            $(".directory").css('display', 'block');
-
-            $(this).addClass('active-btn');
-            $('#database_picture').removeClass('active-btn');
-        });
-    });
-
-    // 本地上传图片
-    function uploadLocalImg() {
-        var layer = $("#layer").val();
-        if ($("#upload_file").val() == '') {
-            layer.msg("请选择要上传的文件", {
-                icon: 6,
-                time: 1000
-            });
-            return false;
-        } else {
-            var formData = new FormData($("#form-uploadimg")[0]);
-            $.ajax({
-                url: '{:url("file_manager/uploadLocalImg")}',
-                type: 'POST',
-                async: true,
-                cache: false,
-                data: formData,
-                processData: false,
-                contentType: false,
-                dataType: "json",
-                beforeSend: function () {
-                    // loadIndex = layer.load();
-                },
-                success: function (res) {
-                    if (res.code == 0) {
-                        // layer.close(loadIndex);
-                        if (layer == true) {
-                            var img = res.thumb ? res.thumb : res.picname;
-
-                            window.parent.$("#" + res.img_id).val(img);
-
-                            window.parent.$("#view-" + res.img_id).attr('src', img);
-
-                            layer_close();
-                        } else {
-                            layer.msg('上传成功', {
-                                icon: 1,
-                                time: 1000
-                            }, () => {
-                                window.location.reload();
-                            });
-                        }
-                    } else {
-                        // layer.close(loadIndex);
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    }
-                }
-            });
-        }
-    }
-
-    // 网络图片
-    function uploadUrlImg() {
-        var layer = $("#layer").val();
-        if ($("#url_file").val() == '') {
-            layer.msg("文件地址不可以为空", {
-                icon: 6,
-                time: 1000
-            });
-            return false;
-        } else {
-            var formData = new FormData($("#form-uploadurlimg")[0]);
-            $.ajax({
-                url: '{:url("file_manager/uploadUrlImg")}',
-                type: 'POST',
-                async: true,
-                cache: false,
-                data: formData,
-                processData: false,
-                contentType: false,
-                dataType: "json",
-                beforeSend: function () {
-                    // loadIndex = layer.load();
-                },
-                success: function (res) {
-                    if (res.code == 0) {
-                        console.log(layer);
-                        // layer.close(loadIndex);
-                        if (layer == true) {
-                            var img = res.picname;
-                            window.parent.$("#" + res.img_id).val(img);
-
-                            if (res.thumbname) {
-                                img = res.thumbname;
-                                window.parent.$("#thumb").val(img);
-                            }
-
-                            window.parent.$("#view-" + res.img_id).attr('src', img);
-                            layer_close();
-                        } else {
-                            window.location.reload();
-                        }
-                    } else {
-                        // layer.close(loadIndex);
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    }
-                }
-            });
-        }
-    }
-
-    function uploadOnlineImg() {
-        var layer = $("#layer").val();
-        if ($("#online_file").val() == '') {
-            layer.msg("文件地址不可以为空", {
-                icon: 6,
-                time: 1000
-            });
-            return false;
-        } else {
-            var formData = new FormData($("#form-uploadonlineimg")[0]);
-            $.ajax({
-                url: '{:url("file_manager/uploadOnlineImg")}',
-                type: 'POST',
-                async: true,
-                cache: false,
-                data: formData,
-                processData: false,
-                contentType: false,
-                dataType: "json",
-                beforeSend: function () {
-                    // loadIndex = layer.load();
-                },
-                success: function (res) {
-                    // layer.close(loadIndex);
-                    if (res.code == 0) {
-                        if (layer == true) {
-                            var img = res.picname;
-                            window.parent.$("#" + res.img_id).val(img);
-                            if (res.thumbname) {
-                                img = res.thumbname;
-                                window.parent.$("#thumb").val(img);
-                            }
-                            window.parent.$("#view-" + res.img_id).attr('src', img);
-                            layer_close();
-                        } else {
-                            layer.msg('上传成功', {
-                                icon: 1,
-                                time: 1000
-                            }, () => {
-                                window.location.reload();
-                            });
-                        }
-                    } else {
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    }
-                }
-            });
-        }
-    }
-</script>
-<!--请在上方写此页面业务相关的脚本-->

+ 0 - 706
view/sys/file_manager/uploadimgbak.html

@@ -1,706 +0,0 @@
-<<<<<<< HEAD
-<!-- <div class="cl pd-5 bg-1 bk-gray">
-        <a href="{:url('/file_manager/selectpicture')}" class="btn btn-default radius sethumb">
-            <i class="Hui-iconfont">&#xe600;</i> 站内选择 </a>&nbsp;&nbsp;
-        <a href="javascript:void(0);" class="btn btn-primary radius sethumb">
-            <i class="Hui-iconfont">&#xe600;</i> 本地上传 </a>&nbsp;&nbsp;
-        <a href="{:url('/file_manager/onlinepicture')}" class="btn btn-default radius sethumb">
-            <i class="Hui-iconfont">&#xe600;</i> 网络图片 </a>&nbsp;&nbsp;
-    </div> -->
-<!-- 本地上传 -->
-<style>
-    #online {
-        width: 100%;
-        height: 224px;
-        padding: 10px 0 0 0;
-    }
-
-    #online #imageList {
-        width: 100%;
-        height: 100%;
-        overflow-x: hidden;
-        overflow-y: auto;
-        position: relative;
-        margin-left: 20px;
-    }
-
-    #online ul {
-        display: block;
-        list-style: none;
-        margin: 0;
-        padding: 0;
-    }
-
-    #online li {
-        float: left;
-        display: block;
-        list-style: none;
-        padding: 0;
-        width: 113px;
-        height: 113px;
-        margin: 0 0 9px 9px;
-        background-color: #eee;
-        overflow: hidden;
-        cursor: pointer;
-        position: relative;
-    }
-
-    #online li img {
-        cursor: pointer;
-    }
-
-    #online li .icon {
-        cursor: pointer;
-        width: 113px;
-        height: 113px;
-        position: absolute;
-        top: 0;
-        left: 0;
-        z-index: 2;
-        border: 0;
-        background-repeat: no-repeat;
-    }
-
-    #online li .icon:hover {
-        width: 107px;
-        height: 107px;
-        border: 3px solid #1094fa;
-    }
-
-    #online li.selected .icon {
-        background-image: url(/static/images/success.png);
-        background-image: url(images/success.gif)\9;
-        background-position: 75px 75px;
-    }
-
-    #online li.clearFloat {
-        float: none;
-        clear: both;
-        display: block;
-        width: 0;
-        height: 0;
-        margin: 0;
-        padding: 0;
-    }
-</style>
-
-<div id="tab-img" class="HuiTab">
-    <div class="tabBar clearfix">
-        <span>本地上传</span>
-        <span>网络文件上传</span>
-        <a onclick="onlinepicture(1)"><span>服务器图片选择</span></a>
-    </div>
-    <div class="tabCon">
-        <div class="step1 active" style="margin-left:30px;">
-            <form id="form-uploadimg" method="post" action="" enctype="multipart/form-data">
-                <div class="row cl" style="margin-top:20px;">
-                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>图片要求: </label>
-                    <div class="formControls col-xs-8 col-sm-8">
-                        格式 jpg,png,gif,jpeg,webp; 大小不超过4M.
-                    </div>
-                    <div class="col-3"> </div>
-                </div>
-                <div class="row cl" style="margin-top:20px;">
-                    <label class="form-label col-xs-2 col-sm-2">
-                        <span class="c-red">*</span>本地上传:</label>
-                    <div class="formControls col-xs-4 col-sm-4">
-                        <input type="file" class="input-text" name="upload_file" id="upload_file">
-                    </div>
-                    <div class="col-3"> </div>
-                </div>
-                <div class="row cl" style="margin-top:20px;">
-                    <input type="hidden" name="img_id" value={$img_id}>
-                    <div class="formControls col-xs-12 col-sm-8">
-                        <div class="skin-minimal">
-                            <div class="check-box">
-                                <input type="checkbox" name="overwrite" value="{$overwrite}" {$overwrite ? 'checked'
-                                    : "" }>
-                                <label for="overwrite">覆盖原图</label>
-                            </div>
-                            <div class="check-box">
-                                <input type="checkbox" name="water" value="{$water}" {$water ? 'checked' : "" }>
-                                <label for="water">水印</label>
-                            </div>
-                            <div class="check-box">
-                                <input type="checkbox" name="thumb" value="{$thumb}" {$thumb ? 'checked' : "" }>
-                                <label for="thumb-1">缩略图</label>
-                                <input type="text" class="input-text" name="width" value={$width}
-                                    style="width: 80px;">缩略图宽度
-                                <input type="text" class="input-text" name="height" value={$height}
-                                    style="width: 80px;">缩略图高度
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="row cl" style="margin-top:30px;margin-left:30px;">
-                    <div class="col-xs-6 col-sm-5 col-xs-offset-2 col-sm-offset-2">
-                        <input class="btn btn-primary radius" type="button" value="&nbsp;确&nbsp;定&nbsp;"
-                            onCLick="uploadImg()">
-                        <input class="btn btn-default radius" type="button" value="&nbsp;取&nbsp;消&nbsp;"
-                            onClick="layer_close();">
-                    </div>
-                </div>
-            </form>
-        </div>
-        <!-- 本地上传end -->
-    </div>
-    <div class="tabCon">
-
-    </div>
-    <!-- 在线图片 -->
-    <div class="tabCon">
-
-    </div>
-</div>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    jQuery.Huitab = function (tabBar, tabCon, class_name, tabEvent, i) {
-        var $tab_menu = $(tabBar);
-        // 初始化操作
-        $tab_menu.removeClass(class_name);
-        $(tabBar).eq(i).addClass(class_name);
-        $(tabCon).hide();
-        $(tabCon).eq(i).show();
-
-        $tab_menu.bind(tabEvent, function () {
-            $tab_menu.removeClass(class_name);
-            $(this).addClass(class_name);
-            var index = $tab_menu.index(this);
-            $(tabCon).hide();
-            $(tabCon).eq(index).show()
-        })
-    }
-
-    $(function () {
-        $.Huitab("#tab-img .tabBar span", "#tab-img .tabCon", "current", "click", "0");
-        $(document).on("click", "#online li", function(){
-            $("#online li").removeClass('selected');
-
-            $(this).addClass('selected');
-
-            img = $(this).children('img').attr('_src');
-
-            $("#online_file").val(img);
-        })
-    });
-
-    function onlinepicture(page) {
-        var data = { "page": page };
-        $.ajax({
-            url: '{:url("file_manager/onlineimg")}',
-            type: 'GET',
-            async: true,
-            cache: false,
-            data: 'page=' + page,
-            processData: false,
-            contentType: false,
-            dataType: "json",
-            success: function (res) {
-                if (res.code == 0) {
-                    html_str = "";
-                    res.list.forEach(element => {
-                        html_str += '<li><img width="170" height="113" src="' + element.url + '?noCache=' + element.mtime + '"';
-                        html_str += '_src="' + element.url + '">';
-                        html_str += '<span class="icon"></span></li>';
-                    });
-                    $('ul.list').prepend(html_str);
-                }
-            }
-        });
-    }
-
-    //step1本地上传图片
-    function uploadImg() {
-        if ($("#upload_file").val() == '') {
-            layer.msg("请选择要上传的文件", {
-                icon: 6,
-                time: 1000
-            });
-            return false;
-        } else {
-            var formData = new FormData($("#form-uploadimg")[0]);
-            $.ajax({
-                url: '{:url("file_manager/uploadimg")}',
-                type: 'POST',
-                async: true,
-                cache: false,
-                data: formData,
-                processData: false,
-                contentType: false,
-                dataType: "json",
-                beforeSend: function () {
-                    // loadIndex = layer.load();
-                },
-                success: function (res) {
-                    if (res.code == 0) {
-                        // layer.close(loadIndex);
-                        console.log(res);
-                        var img = res.picture_url + res.picname;
-                        window.parent.$("#" + res.img_id).val(img);
-
-                        if (res.thumbname) {
-                            img = res.picture_url + res.thumbname;
-                            window.parent.$("#thumb").val(img);
-                        }
-
-                        window.parent.$("#view-" + res.img_id).attr('src', img);
-                        layer_close();
-                    } else {
-                        // layer.close(loadIndex);
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    }
-                }
-            });
-        }
-    }
-
-    // 网络图片
-    function uploadUrlImg() {
-        if ($("#url_file").val() == '') {
-            layer.msg("文件地址不可以为空", {
-                icon: 6,
-                time: 1000
-            });
-            return false;
-        } else {
-            var formData = new FormData($("#form-uploadurlimg")[0]);
-            $.ajax({
-                url: '{:url("file_manager/uploadurlimg")}',
-                type: 'POST',
-                async: true,
-                cache: false,
-                data: formData,
-                processData: false,
-                contentType: false,
-                dataType: "json",
-                beforeSend: function () {
-                    // loadIndex = layer.load();
-                },
-                success: function (res) {
-                    if (res.code == 0) {
-                        console.log(res);
-                        // layer.close(loadIndex);
-                        var img = res.picture_url + res.picname;
-                        window.parent.$("#" + res.img_id).val(img);
-
-                        if (res.thumbname) {
-                            img = res.picture_url + res.thumbname;
-                            window.parent.$("#thumb").val(img);
-                        }
-
-                        window.parent.$("#view-" + res.img_id).attr('src', img);
-                        layer_close();
-                    } else {
-                        // layer.close(loadIndex);
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    }
-                }
-            });
-        }
-    }
-
-    function uploadOnlineImg() {
-        if ($("#online_file").val() == '') {
-            layer.msg("文件地址不可以为空", {
-                icon: 6,
-                time: 1000
-            });
-            return false;
-        } else {
-            var formData = new FormData($("#form-uploadonlineimg")[0]);
-            $.ajax({
-                url: '{:url("file_manager/uploadonlineimg")}',
-                type: 'POST',
-                async: true,
-                cache: false,
-                data: formData,
-                processData: false,
-                contentType: false,
-                dataType: "json",
-                beforeSend: function () {
-                    // loadIndex = layer.load();
-                },
-                success: function (res) {
-                    if (res.code == 0) {
-                        // console.log(res);
-                        // layer.close(loadIndex);
-                        var img = res.picname;
-                        window.parent.$("#" + res.img_id).val(img);
-
-                        if (res.thumbname) {
-                            img = res.thumbname;
-                            window.parent.$("#thumb").val(img);
-                        }
-
-                        window.parent.$("#view-" + res.img_id).attr('src', img);
-                        layer_close();
-                    } else {
-                        // layer.close(loadIndex);
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    }
-                }
-            });
-        }
-    }
-</script>
-<!--请在上方写此页面业务相关的脚本-->
-=======
-<div id="tab-img" class="HuiTab">
-    <div class="tabBar clearfix">
-        <span>本地上传</span>
-        <span>网络文件上传</span>
-        <span>服务器图片选择</span>
-        <input type="hidden" name="layer" id="layer" value="{$layer}">
-        <input type="hidden" name="infoid" value={$infoid}>
-        <input type="hidden" name="cjid" value={$cjid}>
-    </div>
-    <!-- 本地上传 -->
-    <div class="tabCon">
-        <div class="step1 active" style="margin-left:30px;">
-            <form id="form-uploadimg" method="post" action="" enctype="multipart/form-data">
-                <div class="row cl" style="margin-top:20px;">
-                    <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>图片要求: </label>
-                    <div class="formControls col-xs-8 col-sm-8">
-                        格式 jpg,png,gif,jpeg,webp; 大小不超过4M.
-                    </div>
-                    <div class="col-3"> </div>
-                </div>
-                <div class="row cl" style="margin-top:20px;">
-                    <label class="form-label col-xs-2 col-sm-2">
-                        <span class="c-red">*</span>本地上传:</label>
-                    <div class="formControls  col-xs-8 col-sm-8">
-                        <input type="file" class="input-text" name="upload_file" id="upload_file">
-                    </div>
-                    <div class="col-3"> </div>
-                </div>
-                <div class="row cl" style="margin-top:20px;">
-                    <input type="hidden" name="img_id" value={$img_id}>
-                    <input type="hidden" name="infoid" value={$infoid}>
-                    <input type="hidden" name="cjid" value={$cjid}>
-                    <div class="formControls col-sm-12">
-                        <div class="skin-minimal">
-                            <div class="check-box">
-                                <input type="checkbox" name="thumb" value="true" {$thumb ? 'checked' : "" }>
-                                <label for="thumb-1">缩略图</label>
-                                <input type="text" class="input-text" name="width" value={$width}
-                                    style="width: 80px;">缩略图宽度
-                                <input type="text" class="input-text" name="height" value={$height}
-                                    style="width: 80px;">缩略图高度
-                                <input type="checkbox" name="original" value="true" {$original ? 'checked' : "" } style="margin-left: 20px;">
-                                <label for="overwrite">保留原图</label>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="row cl" style="margin-top:30px;margin-left:30px;">
-                    <div class="col-xs-6 col-sm-5 col-xs-offset-2 col-sm-offset-2">
-                        <input class="btn btn-primary radius" type="button" value="&nbsp;确&nbsp;定&nbsp;"
-                            onCLick="uploadLocalImg();">
-                        <input class="btn btn-default radius" type="button" value="&nbsp;取&nbsp;消&nbsp;"
-                            onClick="layer_close();">
-                    </div>
-                </div>
-            </form>
-        </div>
-        <!-- 本地上传end -->
-    </div>
-    <!-- 网络图片 -->
-    <div class="tabCon">
-        <form id="form-uploadurlimg" method="post" action="" enctype="multipart/form-data">
-            <div class="row cl" style="margin-top:20px;">
-                <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>图片要求: </label>
-                <div class="formControls col-xs-8 col-sm-8">
-                    格式 jpg,png,gif,jpeg,webp; 大小不超过4M.
-                </div>
-                <div class="col-3"> </div>
-            </div>
-            <div class="row cl" style="margin-top:20px;">
-                <label class="form-label col-xs-2 col-sm-2">
-                    <span class="c-red">*</span>图片地址:</label>
-                <div class="formControls col-xs-8 col-sm-8">
-                    <input type="text" class="input-text" name="url_file" id="url_file">
-                </div>
-                <div class="col-3"> </div>
-            </div>
-            <div class="row cl" style="margin-top:20px;">
-                <input type="hidden" name="img_id" value={$img_id}>
-                <div class="formControls col-xs-12 col-sm-12">
-                    <div class="skin-minimal">
-                        <div class="check-box">
-                            <input type="checkbox" name="thumb" value="{$thumb}" {$thumb ? 'checked' : "" }>
-                            <label for="thumb-1">缩略图</label>
-                            <input type="text" class="input-text" name="width" value={$width} style="width: 80px;">缩略图宽度
-                            <input type="text" class="input-text" name="height" value={$height}
-                                style="width: 80px;">缩略图高度
-                            <input type="checkbox" name="original" value="{$original}" {$original ? 'checked' : "" } style="margin-left: 20px;">
-                            <label for="overwrite">保留原图</label>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="row cl" style="margin-top:30px;margin-left:30px;">
-                <div class="col-xs-6 col-sm-5 col-xs-offset-2 col-sm-offset-2">
-                    <input class="btn btn-primary radius" type="button" value="&nbsp;确&nbsp;定&nbsp;"
-                        onCLick="uploadUrlImg()">
-                    <input class="btn btn-default radius" type="button" value="&nbsp;取&nbsp;消&nbsp;"
-                        onClick="layer_close();">
-                </div>
-            </div>
-        </form>
-    </div>
-    <!-- 在线图片 -->
-    <style>
-        a.active-btn {
-            color: #fff;
-            background-color: #3bb4f2;
-            border-color: #3bb4f2;
-        }
-    </style>
-    <div class="tabCon">
-        <a class="btn radius active-btn" id="database_picture"><i class="Hui-iconfont Hui-iconfont-jifen"></i>数据库模式</a>
-        <a class="btn radius" id="directory_picture"><i class="Hui-iconfont Hui-iconfont-pages"></i> 目录模式</a>
-        <div class="database online-picture">
-            {include file="file_manager/database_picture" /}
-        </div>
-        <div class="directory online-picture" style="display: none;">
-            {include file="file_manager/directory_picture" /}
-        </div>
-        <form id="form-uploadonlineimg" method="post" action="" enctype="multipart/form-data">
-            <div class="row cl" style="margin-top:20px;">
-                <label class="form-label col-xs-2 col-sm-2">
-                    <span class="c-red">*</span>图片地址:</label>
-                <div class="formControls col-xs-8 col-sm-8">
-                    <input type="hidden" name="img_id" value={$img_id}>
-                    <input type="text" class="input-text" name="online_file" id="online_file">
-                </div>
-                <div class="col-3"> </div>
-            </div>
-            <div class="row cl" style="margin-top:30px;margin-left:30px;">
-                <div class="col-xs-6 col-sm-5 col-xs-offset-2 col-sm-offset-2">
-                    <input class="btn btn-primary radius" type="button" value="&nbsp;确&nbsp;定&nbsp;"
-                        onCLick="uploadOnlineImg()">
-                    <input class="btn btn-default radius" type="button" value="&nbsp;取&nbsp;消&nbsp;"
-                        onClick="layer_close();">
-                </div>
-            </div>
-        </form>
-    </div>
-</div>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    jQuery.Huitab = function (tabBar, tabCon, class_name, tabEvent, i) {
-        var $tab_menu = $(tabBar);
-        // 初始化操作
-        $tab_menu.removeClass(class_name);
-        $(tabBar).eq(i).addClass(class_name);
-        $(tabCon).hide();
-        $(tabCon).eq(i).show();
-
-        $tab_menu.bind(tabEvent, function () {
-            $tab_menu.removeClass(class_name);
-            $(this).addClass(class_name);
-            var index = $tab_menu.index(this);
-            $(tabCon).hide();
-            $(tabCon).eq(index).show()
-        })
-    }
-
-    $(function () {
-        $.Huitab("#tab-img .tabBar span", "#tab-img .tabCon", "current", "click", "0");
-
-        $("#database_picture").click(function () {
-            $(".online-picture").css('display', 'none');
-            $(".database").css('display', 'block');
-
-            $(this).addClass('active-btn');
-            $('#directory_picture').removeClass('active-btn');
-        });
-
-        $("#directory_picture").click(function () {
-            $(".online-picture").css('display', 'none');
-            $(".directory").css('display', 'block');
-
-            $(this).addClass('active-btn');
-            $('#database_picture').removeClass('active-btn');
-        });
-    });
-
-    // 本地上传图片
-    function uploadLocalImg() {
-        var layer = $("#layer").val();
-        if ($("#upload_file").val() == '') {
-            layer.msg("请选择要上传的文件", {
-                icon: 6,
-                time: 1000
-            });
-            return false;
-        } else {
-            var formData = new FormData($("#form-uploadimg")[0]);
-            $.ajax({
-                url: '{:url("file_manager/uploadLocalImg")}',
-                type: 'POST',
-                async: true,
-                cache: false,
-                data: formData,
-                processData: false,
-                contentType: false,
-                dataType: "json",
-                beforeSend: function () {
-                    // loadIndex = layer.load();
-                },
-                success: function (res) {
-                    if (res.code == 0) {
-                        // layer.close(loadIndex);
-                        if (layer == true) {
-                            var img = res.thumb ? res.thumb : res.picname;
-
-                            window.parent.$("#" + res.img_id).val(img);
-
-                            window.parent.$("#view-" + res.img_id).attr('src', img);
-
-                            layer_close();
-                        } else {
-                            layer.msg('上传成功', {
-                                icon: 1,
-                                time: 1000
-                            }, () => {
-                                window.location.reload();
-                            });
-                        }
-                    } else {
-                        // layer.close(loadIndex);
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    }
-                }
-            });
-        }
-    }
-
-    // 网络图片
-    function uploadUrlImg() {
-        var layer = $("#layer").val();
-        if ($("#url_file").val() == '') {
-            layer.msg("文件地址不可以为空", {
-                icon: 6,
-                time: 1000
-            });
-            return false;
-        } else {
-            var formData = new FormData($("#form-uploadurlimg")[0]);
-            $.ajax({
-                url: '{:url("file_manager/uploadUrlImg")}',
-                type: 'POST',
-                async: true,
-                cache: false,
-                data: formData,
-                processData: false,
-                contentType: false,
-                dataType: "json",
-                beforeSend: function () {
-                    // loadIndex = layer.load();
-                },
-                success: function (res) {
-                    if (res.code == 0) {
-                        console.log(layer);
-                        // layer.close(loadIndex);
-                        if (layer == true) {
-                            var img = res.picname;
-                            window.parent.$("#" + res.img_id).val(img);
-
-                            if (res.thumbname) {
-                                img = res.thumbname;
-                                window.parent.$("#thumb").val(img);
-                            }
-
-                            window.parent.$("#view-" + res.img_id).attr('src', img);
-                            layer_close();
-                        } else {
-                            window.location.reload();
-                        }
-                    } else {
-                        // layer.close(loadIndex);
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    }
-                }
-            });
-        }
-    }
-
-    function uploadOnlineImg() {
-        var layer = $("#layer").val();
-        if ($("#online_file").val() == '') {
-            layer.msg("文件地址不可以为空", {
-                icon: 6,
-                time: 1000
-            });
-            return false;
-        } else {
-            var formData = new FormData($("#form-uploadonlineimg")[0]);
-            $.ajax({
-                url: '{:url("file_manager/uploadOnlineImg")}',
-                type: 'POST',
-                async: true,
-                cache: false,
-                data: formData,
-                processData: false,
-                contentType: false,
-                dataType: "json",
-                beforeSend: function () {
-                    // loadIndex = layer.load();
-                },
-                success: function (res) {
-                    // layer.close(loadIndex);
-                    if (res.code == 0) {
-                        if (layer == true) {
-                            var img = res.picname;
-                            window.parent.$("#" + res.img_id).val(img);
-                            if (res.thumbname) {
-                                img = res.thumbname;
-                                window.parent.$("#thumb").val(img);
-                            }
-                            window.parent.$("#view-" + res.img_id).attr('src', img);
-                            layer_close();
-                        } else {
-                            layer.msg('上传成功', {
-                                icon: 1,
-                                time: 1000
-                            }, () => {
-                                window.location.reload();
-                            });
-                        }
-                    } else {
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    }
-                }
-            });
-        }
-    }
-</script>
-<!--请在上方写此页面业务相关的脚本-->
->>>>>>> 78b76253c8ce5873016cf837373af5e30ac80c86

+ 3 - 4
view/sys/guest_book/index.html

@@ -38,10 +38,9 @@
                     <td class="text-l">{$val.url}</td>
                     <td>{$val.time|date="Y-m-d H:i:s"}</td>
                     <td class="td-status">
-                        <a href="javascript:;" onclick="mark(this,'{$val.id}')" style="text-decoration: none;"
-                            title="{$val.mark==1? '重点' : ''}">
-                            <span class="f-20 c-primary"><i class="Hui-iconfont">{$val.mark==1?'&#xe601;' :
-                                    '&#xe677;'}</i></span></a>
+                        <div class="switch size-S" data-on-label="是" data-off-label="否" data-id="{$val.id}">
+                            <input type="checkbox" {if $val.mark==1}checked{/if}>
+                        </div>                
                     </td>
                     <td><input type="text" class="input-text input-remark text-l" value="{$val.remark}"
                             data-id="{$val.id}"></td>

+ 1 - 5
view/sys/index/index.html

@@ -15,10 +15,6 @@
                         </div>
                         <!-- /.card-header -->
                         <div class="card-body">
-                            <!-- <a class="btn btn-app" href="{:url('system/edit',['id'=>1])}">
-                                <div><i class="Hui-iconfont">&#xe62e;</i></div>
-                                <span>系统设置</span>
-                            </a> -->
                             {foreach $indexButton as $button}
                             <a class="btn btn-app" href="/sys/{$button.url}">
                                 <div><i class="Hui-iconfont">{$button.icon|raw}</i></div>
@@ -162,7 +158,7 @@
                                             class="btn btn-flat btn-success ">ThinkPHP6 开发手册</a>
                                     </td>
                                     <td>
-                                        <a href="http://h-ui.net/Hui-overview.shtml" target="_blank"
+                                        <a href="http://h-ui.net/" target="_blank"
                                             class="btn btn-flat btn-secondary "> Hui.Admin 文档</a>
                                     </td>
                                 </tr>

+ 0 - 138
view/sys/module/index.html

@@ -1,138 +0,0 @@
-<article class="cl pd-10" style="min-width: 900px;">
-    <div class="cl pd-5 bg-1 bk-gray mt-20">
-        <span class="l">
-            <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
-                <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
-            <a class="btn btn-primary radius" href="javascript:save(0);">
-                <i class="Hui-iconfont">&#xe600;</i> 添加模型</a>
-        </span>
-        <span class="r">共有数据:<strong id="total">{notempty name="list"}{$list->total()}{else/}0{/notempty}</strong>
-            条</span>
-    </div>
-    <div id="edatalist">
-        <table class="table table-border table-bordered table-bg">
-            <thead>
-                <tr class="text-c">
-                    <th width="25px;">
-                        <input type="checkbox" name="" value="">
-                    </th>
-                    <th width="80px;">ID</th>
-                    <th width="160px;">模块名称</th>
-                    <th width="160px;">表名称</th>
-                    <th width="160px;">模型名称</th>
-                    <th width="180px;">表描述</th>
-                    <th width="100px;">表类型</th>
-                    <th width="80px;">主键</th>
-                    <th width="80px;">排序</th>
-                    <th width="140px;">创建时间</th>
-                    <th>操作</th>
-                </tr>
-            </thead>
-            <tbody>
-                {foreach $list as $val}
-                <tr class="text-c va-m">
-                    <td>
-                        <input type="checkbox" value="{$val.id}" name="checkbox[]">
-                    </td>
-                    <td>{$val.id}</td>
-                    <td>{$val.module_name}</td>
-                    <td>{$val.table_name}</td>
-                    <td>{$val.model_name}</td>
-                    <td>{$val.remark}</td>
-                    <td>{$val.table_type}</td>
-                    <td>{$val.pk}</td>
-                    <td><input type="text" class="input-text input-sort" value="{$val.sort}" data-id="{$val.id}"
-                            style="text-align: center;"></td>
-                    <td>{$val.create_time|date="Y-m-d H:i:s"}</td>
-                    <td class="td-manage">
-                        <a class="btn btn-primary radius" href="javascript:save({$val.id});"
-                            title="编辑" style="text-decoration:none" class="ml-10">
-                            <i class="Hui-iconfont">&#xe6df;</i>编辑
-                        </a>
-                        <a class="btn btn-danger radius" href="javascript:;" title="删除" style="text-decoration:none"
-                            class="ml-10" onClick="del(this,'{$val.id}')">
-                            <i class="Hui-iconfont">&#xe6e2;</i>删除
-                        </a>
-                    </td>
-                </tr>
-                {/foreach}
-            </tbody>
-        </table>
-    </div>
-    <div class="cl pd-5 bg-1 bk-gray mt-20 ">
-        <span class="r">{notempty name="list"}{$list->render()|raw}{/notempty}</span>
-    </div>
-</article>
-<script>
-    function save(id) {
-        var title = id == 0 ? '添加模型' : '修改模型'
-        var url = "{:url('save')}" + "?_layer=true&id=" + id
-        layer_show(title, url, 800, 700);
-    }
-
-    // 排序
-    $(".input-sort").change(function () {
-        var sort = $(this).val();
-        var id = $(this).data('id');
-        // console.log(sort);
-        // console.log(id);
-        $.post('sort', {
-            'id': id,
-            'sort': sort
-        }, function (res) {
-            console.log(res);
-            if (res) {
-                layer.msg('排序成功', {
-                    icon: 1,
-                    time: 2000
-                });
-            } else {
-                layer.msg('排序失败', {
-                    icon: 5,
-                    time: 2000
-                });
-            }
-        }, 'json');
-    })
-    
-    // 产品上加/下架 or 文章上线.下线
-    function duty(action, obj, id) {
-        var duty = 2,
-            title = '上线',
-            button = 'default',
-            status = '下线';
-
-        if (action == 'up') {
-            duty = 1;
-            title = '下线';
-            status = '正常';
-            button = 'success';
-            action = 'down';
-        } else {
-            action = 'up';
-        }
-
-
-        var text = "<a href=\"javascript:void(0);\" title=" + title + " onClick=\"duty('" + action + "', this," + id + ")\" >";
-        text += '<span class="label label-' + button + ' radius">' + status + '</span></a>';
-
-        $.post("duty", {
-            'id': id,
-            'status': duty
-        }, function (data) {
-            if (data.code == 2) {
-                $(obj).after(text);
-                $(obj).remove();
-                layer.msg(data.msg, {
-                    icon: 6,
-                    time: 1000
-                });
-            } else {
-                layer.msg(data.msg, {
-                    icon: 5,
-                    time: 1000
-                });
-            }
-        }, 'json');
-    }
-</script>

+ 0 - 154
view/sys/module/save.html

@@ -1,154 +0,0 @@
-<article class="cl pd-20">
-    <form action="" method="post" class="form form-horizontal" id="form-save">
-        <input type="hidden" name="id" id="id" value="{$data.id}">
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red">*</span>模块名称:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" value="{$data.module_name}" placeholder="请填写模块名称"
-                    id="module_name" name="module_name">
-            </div>
-            <span class="c-666"><i class="Hui-iconfont">&#xe6cd;</i> 填写中文名称,如:友情链接</span>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red">*</span>表名称:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" value="{$data.table_name}" placeholder="请填写表名称"
-                    id="table_name" name="table_name">
-            </div>
-            <span class="c-666"><i class="Hui-iconfont">&#xe6cd;</i> 除去表前缀的数据表名称,全部小写并以`_`分割,如:user_group</span>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                模型名称:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" value="{$data.model_name}" placeholder="请填写请填写模型名称" id="model_name" name="model_name">
-            </div>
-            <span class="c-666"><i class="Hui-iconfont">&#xe6cd;</i> 除去表前缀的数据表名称,驼峰法命名,且首字母大写,如:UserGroup</span>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                表描述:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" value="{$data.table_comment}" placeholder="请填写表描述" id="table_comment"
-                    name="table_comment">
-            </div>
-            <div class="col-3"> </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                表类型:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <span class="select-box">
-                    <select class="select" id="table_type" name="table_type">
-                        <option value="0" {eq name="data.table_type" value="0" }selected{/eq}>请选择</option>
-                        <option value="1" {eq name="data.table_type" value="1" }selected{/eq}>CMS</option>
-                        <option value="2" {eq name="data.table_type" value="2" }selected{/eq}>后台</option>
-                    </select>
-                </span>
-            </div>
-            <div class="col-3"> </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                主键:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" value="{$data.pk}" placeholder="请填写主键"
-                    id="pk" name="pk">
-            </div>
-            <div class="col-3"> </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                字段列表:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="text" class="input-text" value="{$data.list_fields}" placeholder="请填写详情模板"
-                    id="list_fields" name="list_fields">
-            </div>
-            <span class="c-666"><i class="Hui-iconfont">&#xe6cd;</i> 前台列表页可调用字段,默认为*,仅用作前台CMS调用时使用</span>
-            <div class="col-3"> </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">排序:</label>
-            <div class="formControls col-xs-4 col-sm-6">
-                <input type="number" min=0 max=100 class="input-text" value="{$data.sort}" name="sort"
-                    style="width:120px;">
-                </div>
-            <span class="c-666"><i class="Hui-iconfont">&#xe6cd;</i> 降序(数字越大, 越靠前)</span>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">
-                <span class="c-red"></span>单页模式:</label>
-            <div class="formControls col-xs-8 col-sm-6">
-                <div class="radio-box">
-                    <input type="radio" name="is_single" id="is_single-1" value="1" {$data==null || $data.is_single==1
-                        ? 'checked' : "" }>
-                    <label for="is_single-1">是</label>
-                </div>
-                <div class="radio-box">
-                    <input type="radio" name="is_single" id="is_single-2" value="0" {$data.is_single==0 ? 'checked' : "" }>
-                    <label for="is_single-2">否</label>
-                </div>
-            </div>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2">备注:</label>
-            <div class="formControls col-xs-8 col-sm-6">
-                <textarea name="remark" id="remark" cols="" rows="" class="textarea"
-                    placeholder="SEO描述...最多输入500个字符" dragonfly="true" nullmsg="备注不能为空!"
-                    onKeyUp="textarealength(this,500)">{$data.remark}</textarea>
-                <p class="textarea-numberbar">
-                    <em class="textarea-length">0</em>/500
-                </p>
-            </div>
-            <div class="col-3"> </div>
-        </div>
-    </form>
-    <div class="row cl">
-        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
-            <button type="button" class="btn btn-success radius" id="form-save-button" name="">确&nbsp;定</button>
-            <button type="button" class="btn btn-default radius" onclick="layer_close();"
-                style="margin-left:20px;">取&nbsp;消</button>
-        </div>
-    </div>
-</article>
-
-<!--请在下方写此页面业务相关的脚本-->
-<script type="text/javascript">
-    $(function () {
-        $("#form-save-button").click(function () {
-            if (getblen($("#remark").val()) > 500) {
-                layer.msg('备注过长', {
-                    icon: 5,
-                    time: 1000
-                });
-                return false;
-            }
-
-            var data = $("#form-save").serializeArray();
-            $.ajax({
-                type: 'POST',
-                url: '{:url("save")}',
-                data: data,
-                dataType: 'json',
-                success: function (res) {
-                    if (res.code == 0) {
-                        layer.msg(res.msg, {
-                            icon: 5,
-                            time: 1000
-                        });
-                        return false;
-                    } else {
-                        layer.msg(res.msg, { icon: 1 }, function () {
-                            parent.location.reload(); // 父页面刷新
-                            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
-                            parent.layer.close(index);
-                        });
-                    }
-                }
-            })
-        })
-    })
-
-</script>

+ 1 - 24
view/sys/sys_log/index.html

@@ -38,8 +38,7 @@
                     <td>{$val.create_time}</td>
                     <td>{$val.ip}</td>
                     <td class="td-manage">
-                        <a title="删除" href="javascript:;" onclick="del(this,'{$val.loginid}')" class="ml-5"
-                            style="text-decoration:none">
+                        <a title="删除" href="javascript:;" onclick="del(this,'{$val.loginid}')" class="ml-5 btn btn-danger radius">
                             <i class="Hui-iconfont">&#xe6e2;</i>
                         </a>
                     </td>
@@ -56,27 +55,5 @@
 
 <!--请在下方写此页面业务相关的脚本-->
 <script type="text/javascript">
-    // 删除条目
-    function del(obj, id) {
-        layer.confirm('确认要删除吗?', function (index) {
-            $.post('delete', {
-                'id': id
-            }, function (data) {
-                if (data.code == 1) {
-                    $(obj).parents("tr").remove();
-                    layer.msg(data.msg, {
-                        icon: 1,
-                        time: 1000
-                    });
-                } else {
-                    layer.msg(data.msg, {
-                        icon: 5,
-                        time: 2000
-                    });
-                    return false;
-                }
-            }, 'json');
-        });
-    }
 </script>
 <!--请在上方写此页面业务相关的脚本-->

+ 8 - 3
view/sys/sys_login/index.html

@@ -42,7 +42,7 @@
                     {/switch}
                     </td>
                     <td class="td-manage">
-                        <a title="删除" href="javascript:;" onclick="del(this,'{$val.id}')" class="ml-5"
+                        <a title="删除" href="javascript:;" onclick="del(this,'{$val.id}')" class="ml-5 btn btn-danger radius"
                             style="text-decoration:none">
                             <i class="Hui-iconfont">&#xe6e2;</i>
                         </a>
@@ -54,6 +54,11 @@
         </table>
     </div>
     <div class="cl pd-5 bg-1 bk-gray mt-20 ">
-        <span class="r">{notempty name="data"}{$data->render()|raw}{/notempty}</span>
+        <span class="r">{$list->render()|raw}</span>
     </div>
-</article>
+</article>
+
+<!--请在下方写此页面业务相关的脚本-->
+<script type="text/javascript">
+</script>
+<!--请在上方写此页面业务相关的脚本-->

+ 9 - 13
view/sys/sys_menu/index.html

@@ -21,7 +21,6 @@
                     <th width="60px">图标</th>
                     <th width="60px">类型</th>
                     <th width="160px">url</th>
-                    <th width="120px">状态</th>
                     <th>操作</th>
                 </tr>
             </thead>
@@ -42,12 +41,11 @@
                     <td><i class="Hui-iconfont">{$value.icon|raw}</i></td>
                     <td><span class="label label-default">{$type[$value.type]}</span></td>
                     <td>{$value.url}</td>
-                    <td>{$value.perms}</td>
-                    <td class="f-14">
-                        <a title="编辑" href="javascript:save({$value.id});" style="text-decoration:none">
+                    <td class="td-manage">
+                        <a title="编辑" href="javascript:;" onclick="save('{$value.id}')" class="btn btn-primary radius">
                             <i class="Hui-iconfont">&#xe6df;</i>
                         </a>
-                        <a title="删除" href="javascript:;" onclick="del(this,'{$value.id}')" class="ml-5"
+                        <a title="删除" href="javascript:;" onclick="del(this,'{$value.id}')" class="ml-5 btn btn-danger radius"
                             style="text-decoration:none">
                             <i class="Hui-iconfont">&#xe6e2;</i>
                         </a>
@@ -72,12 +70,11 @@
                     <td><i class="Hui-iconfont">{$val.icon|raw}</i></td>
                     <td><span class="label label-success">{$type[$val.type]}</span></td>
                     <td>{$val.url}</td>
-                    <td>{$value.perms}</td>
-                    <td class="f-14">
-                        <a title="编辑" href="javascript:save({$val.id});" style="text-decoration:none">
+                    <td class="td-manage">
+                        <a title="编辑" href="javascript:;" onclick="save('{$val.id}')" class="btn btn-primary radius">
                             <i class="Hui-iconfont">&#xe6df;</i>
                         </a>
-                        <a title="删除" href="javascript:;" onclick="del(this,'{$val.id}')" class="ml-5"
+                        <a title="删除" href="javascript:;" onclick="del(this,'{$val.id}')" class="ml-5 btn btn-danger radius"
                             style="text-decoration:none">
                             <i class="Hui-iconfont">&#xe6e2;</i>
                         </a>
@@ -94,12 +91,11 @@
                     <td></td>
                     <td><span class="label label-default">{$type[$vo.type]}</span></td>
                     <td>{$vo.url}</td>
-                    <td>{$vo.perms}</td>
-                    <td class="f-14">
-                        <a title="编辑" href="javascript:save({$vo.id});" style="text-decoration:none">
+                    <td class="td-manage">
+                        <a title="编辑" href="javascript:;" onclick="save('{$vo.id}')" class="btn btn-primary radius">
                             <i class="Hui-iconfont">&#xe6df;</i>
                         </a>
-                        <a title="删除" href="javascript:;" onclick="del(this,'{$vo.id}')" class="ml-5"
+                        <a title="删除" href="javascript:;" onclick="del(this,'{$vo.id}')" class="ml-5 btn btn-danger radius"
                             style="text-decoration:none">
                             <i class="Hui-iconfont">&#xe6e2;</i>
                         </a>

+ 15 - 72
view/sys/sys_role/index.html

@@ -1,9 +1,7 @@
 <article class="cl pd-20">
     <div class="cl pd-5 bg-1 bk-gray">
         <span class="l">
-            <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
-                <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
-            <a class="btn btn-primary radius" href="javascript:save(0);">
+            <a class="btn btn-primary radius" href="javascript:;" onclick="save(0);">
                 <i class="Hui-iconfont">&#xe600;</i> 添加角色</a>
         </span>
         <span class="r">共有数据:<strong>{$list|count}</strong> 条</span> 
@@ -11,9 +9,6 @@
     <div class="mt-10">
         <table class="table table-border table-bordered table-hover table-bg">
             <thead>
-                <tr>
-                    <th scope="col" colspan="6">角色管理</th>
-                </tr>
                 <tr class="text-c">
                     <th width="25">
                         <input type="checkbox" value="" name="allcheck">
@@ -22,27 +17,30 @@
                     <th width="120px">角色名称</th>
                     <th>权限(menu_ids)</th>
                     <th width="160px">备注</th>
-                    <th width="80px">操作</th>
+                    <th width="80px">状态</th>
+                    <th width="120px">操作</th>
                 </tr>
             </thead>
             <tbody>
                 {foreach $list as $val}
                 <tr class="text-c">
-                    <td>
+                    <!-- <td>
                         <input type="checkbox" value="{$val.roleid}" name="checkbox[]">
-                    </td>
+                    </td> -->
                     <td>{$val.roleid}</td>
                     <td>{$val.name}</td>
                     <td>{$val.permissions}</td>
                     <td>{$val.remark}</td>
-                    <td class="f-14">
-                        <a title="编辑" href="javascript:save({$val.roleid});" style="text-decoration:none">
-                            <i class="Hui-iconfont">&#xe6df;</i>
-                        </a>
-                        <a title="删除" href="javascript:;" onclick="del(this,'{$val.roleid}')" class="ml-5"
-                            style="text-decoration:none">
-                            <i class="Hui-iconfont">&#xe6e2;</i>
-                        </a>
+                    <td class="td-status">
+                        <div class="switch size-S" data-on-label="是" data-off-label="否" data-id="{$val.roleid}">
+                            <input type="checkbox" {if $val.status==0}checked{/if}>
+                        </div>
+                    </td>
+                    <td class="td-manage">
+                        <a title="编辑" href="javascript:;" onclick="save('{$val.roleid}');" class="btn btn-primary radius">
+                            <i class="Hui-iconfont">&#xe6df;</i></a>
+                        <a title="删除" href="javascript:;" onclick="del(this,'{$val.roleid}')" class="ml-5 btn btn-danger radius">
+                            <i class="Hui-iconfont">&#xe6e2;</i></a>
                     </td>
                 </tr>
                 {/foreach}
@@ -58,60 +56,5 @@
         var url = "{:url('save')}" + "?_layer=true&id=" + id
         layer_show(title, url, 800, 700);
     }
-    // 删除条目
-    function del(obj, id) {
-        layer.confirm('确认要删除吗?', function (index) {
-            $.post('delete', {
-                'id': id
-            }, function (data) {
-                if (data.code == 1) {
-                    $(obj).parents("tr").remove();
-                    layer.msg(data.msg, {
-                        icon: 1,
-                        time: 1000
-                    });
-                } else {
-                    layer.msg(data.msg, {
-                        icon: 5,
-                        time: 2000
-                    });
-                    return false;
-                }
-            }, 'json');
-        });
-    }
-
-    // 批量删除
-    function del_all() {
-        var checkbox = $('.text-c input[name="checkbox[]"]');
-        var ids = new Array();
-        checkbox.each(function (x) {
-            if (this.checked)
-                ids.push(this.value);
-        })
-        console.log(ids);
-
-        layer.confirm('确认要删除吗?', function (index) {
-            $.post('delete', {
-                'id': ids
-            }, function (data) {
-                if (data.code == 1) {
-                    layer.msg(data.msg, {
-                        icon: 1,
-                        time: 1000
-                    });
-                    checkbox.each(function (x) {
-                        if (this.checked)
-                            $(this).parents("tr").remove();
-                    })
-                } else {
-                    layer.msg(data.msg, {
-                        icon: 5,
-                        time: 1000
-                    });
-                }
-            }, 'json')
-        });
-    }
 </script>
 <!--请在上方写此页面业务相关的脚本-->

+ 7 - 8
view/sys/sys_user/index.html

@@ -1,8 +1,8 @@
 <article class="cl pd-20">
     <div class="cl pd-5 bg-1 bk-gray">
         <span class="l">
-            <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
-                <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
+            <!-- <a href="javascript:;" onclick="del_all()" class="btn btn-danger radius">
+                <i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a> -->
             <a href="javascript:save(0);" class="btn btn-primary radius">
                 <i class="Hui-iconfont">&#xe600;</i> 添加管理员</a>
         </span>
@@ -11,9 +11,9 @@
         <table class="table table-border table-bordered table-bg">
             <thead>
                 <tr class="text-c">
-                    <th width="25">
+                    <!-- <th width="25">
                         <input type="checkbox" name="allcheck" value="">
-                    </th>
+                    </th> -->
                     <th width="40px">ID</th>
                     <th width="120px">登录名</th>
                     <th width="120px">用户组</th>
@@ -45,10 +45,9 @@
                     <td>{$val.per_ip}</td>
                     <td>{$val.create_time}</td>
                     <td class="td-status">
-                        <a href="javascript:;" onclick="status(this,'{$val.userid}')" style="text-decoration: none;"
-                            title="{$val.status==1? '禁用' : '正常'}">
-                            <span class="f-20 c-primary"><i class="Hui-iconfont">{$val.status==1?'&#xe601;' :
-                                    '&#xe677;'}</i></span></a>
+                        <div class="switch size-S" data-on-label="是" data-off-label="否" data-id="{$val.userid}">
+                            <input type="checkbox" {if $val.status==0}checked{/if}>
+                        </div>
                     </td>
                     <td class="td-manage">
                         <a title="编辑" href="javascript:save({$val.userid});" class="btn btn-primary radius">

+ 89 - 35
view/sys/system/index.html

@@ -1,5 +1,5 @@
 <article class="cl pd-20">
-    <form action="{:url('save')}" method="post" class="form form-horizontal" id="form-article-add">
+    <form action="" method="post" class="form form-horizontal" id="form-save">
         <div id="tab-system" class="HuiTab">
             <div class="tabBar cl"><span>基本设置</span><span>SEO设置</span><span>留言邮箱设置</span></div>
             <div class="tabCon">
@@ -13,21 +13,21 @@
                 <div class="row cl">
                     <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>logo:</label>
                     <div class="formControls col-xs-8 col-sm-9">
-                        <input type="text" id="picture" placeholder="logo 路径" value="{$data.logo}" name="logo"
+                        <input type="text" id="logo" placeholder="logo 路径" value="{$data.logo}" name="logo"
                             class="input-text">
                     </div>
                     <div class="formControls col-xs-8 col-sm-4 col-xs-offset-4 col-sm-offset-2">
                         <div style="max-width: 200px;">
-                            <a href="javascript:void(0);" onclick="uploadLogo()">
-                                <img id="view-picture"
-                                    src="{$data.logo ? $data.logo : '/static/images/upload_picture.png'}"
-                                    alt="logo" title="{$data.title_pic ? '更换' : '添加'}logo"
-                                    style="max-width: 200px;max-height: 200px;">
+                            <a href="javascript:void(0);" onclick="uploadPicture('logo')">
+                                <img id="view-logo"
+                                    src="{$data.logo ? $data.logo : '/static/images/upload_picture.png'}" alt="logo"
+                                    title="{$data.logo ? '更换' : '添加'}logo" style="max-width: 200px;max-height: 200px;">
                             </a>
                         </div>
                     </div>
                     <label class="form-label col-xs-2 col-sm-2">
-                        <a class="btn btn-success radius" href="javascript:uploadLogo();">{$data.logo ? '更换' :
+                        <a class="btn btn-success radius" href="javascript:void(0);"
+                            onclick="uploadPicture('logo')">{$data.logo ? '更换' :
                             '添加'}logo</a></label>
                 </div>
                 <div class="row cl">
@@ -107,16 +107,16 @@
                     </div>
                     <div class="formControls col-xs-8 col-sm-4 col-xs-offset-4 col-sm-offset-2">
                         <div style="max-width: 200px;">
-                            <a href="javascript:void(0);" onclick="addTitlePic()">
+                            <a href="javascript:void(0);" onclick="uploadPicture('qrcode')">
                                 <img id="view-qrcode"
-                                    src="{$data.qrcode ? $data.qrcode : '/static/images/upload_picture.png'}"
-                                    alt="logo" title="{$data.qrcode ? '更换' : '添加'}二维码"
-                                    style="max-width: 200px;max-height: 200px;">
+                                    src="{$data.qrcode ? $data.qrcode : '/static/images/upload_picture.png'}" alt="qrcode"
+                                    title="{$data.qrcode ? '更换' : '添加'}二维码" style="max-width: 200px;max-height: 200px;">
                             </a>
                         </div>
                     </div>
                     <label class="form-label col-xs-2 col-sm-2">
-                        <a class="btn btn-success radius" href="javascript:uploadQrcode();">{$data.qrcode ? '更换' :
+                        <a class="btn btn-success radius" href="javascript:void(0);"
+                            onclick="uploadPicture('qrcode')">{$data.qrcode ? '更换' :
                             '添加'}二维码</a></label>
                 </div>
             </div>
@@ -206,7 +206,8 @@
         </div>
         <div class="row cl">
             <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
-                <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
+                <button class="btn btn-primary radius" type="button" id="admin-form-save"><i
+                        class="Hui-iconfont">&#xe632;</i> 保存</button>
                 <button onClick="layer_close();" class="btn btn-default radius"
                     type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
             </div>
@@ -214,6 +215,13 @@
     </form>
 </article>
 
+<!-- 图片上传 -->
+<div>
+    <form id="form-upload_picture">
+        <input type="file" hidden name="image" id="upload_picture">
+    </form>
+</div>
+
 <script type="text/javascript">
     jQuery.Huitab = function (tabBar, tabCon, class_name, tabEvent, i) {
         var $tab_menu = $(tabBar);
@@ -241,30 +249,76 @@
         $.Huitab("#tab-system .tabBar span", "#tab-system .tabCon", "current", "click", "0");
     });
 
-    //添加标题图
-    function uploadLogo() {
-        layer.open({
-            type: 2,
-            area: ['700px', '500px'],
-            fix: false, //不固定
-            maxmin: true,
-            shade: 0.4,
-            title: 'Logo上传',
-            content: '{:url("uploadlogo")}'
+    //添加图片
+    const file = document.querySelector('input[type="file"]');
+    function uploadPicture(name) {
+        // file模拟input点击事件
+        var evt = new MouseEvent("click", {
+            bubbles: false,
+            cancelable: true,
+            view: window,
         });
+        file.dispatchEvent(evt, uploadfn(name));
     }
 
-    //添加标题图
-    function uploadQrcode() {
-        layer.open({
-            type: 2,
-            area: ['700px', '500px'],
-            fix: false, //不固定
-            maxmin: true,
-            shade: 0.4,
-            title: 'Logo上传',
-            content: '{:url("uploadqrcode")}'
-        });
+    function uploadfn(name) {
+        file.oninput = function () {
+            if (file.files && file.files[0]) {
+                var formData = new FormData();
+                formData.append("upload_file", file.files[0]);
+                $.ajax({
+                    url: '/sys/file_manager/uploadImage',
+                    type: "post",
+                    data: formData,
+                    processData: false, // 告诉jQuery不要去处理发送的数据
+                    contentType: false, // 告诉jQuery不要去设置Content-Type请求头
+                    dataType: 'json',
+                    success: function (res) {
+                        // console.log(res);
+                        var img = res.data.filename;
+                        $("#view-" + name).attr('src', img);
+                        $("#" + name).val(img);
+                        layer.msg(res.msg, {
+                            icon: 1,
+                            time: 1000
+                        });
+                    },
+                    error: function (res) {
+                        layer.msg(res.msg, {
+                            icon: 5,
+                            time: 1000
+                        });
+                        return false;
+                    },
+                    complete: function () {
+                        document.getElementById('form-upload_picture').reset();
+                    }
+                });
+            }
+        }
     }
 
+    $("#admin-form-save").click(function () {
+        var data = $("#form-save").serializeArray();
+        $.ajax({
+            type: 'POST',
+            url: '/sys/system/save',
+            data: data,
+            dataType: 'json',
+            success: function (res) {
+                if (res.code == 0) {
+                    layer.msg(res.msg, {
+                        icon: 1,
+                        time: 1000
+                    });
+                } else {
+                    layer.msg(res.msg, {
+                        icon: 5,
+                        time: 1000
+                    });
+                    return false;
+                }
+            }
+        });
+    });
 </script>