Browse Source

新增Bootstrap-table分页跳转
新增后台修改会员积分日志
优化控制台切换时图表展示
修复安卓下图片无法上传的BUG
修复附件类型筛选时多条件的BUG
修复Backend基类无法捕获Exception异常的BUG
修复Form::checkboxs名称生成错误的BUG

Karson 6 years ago
parent
commit
2b60921cf3

+ 1 - 1
application/admin/controller/Ajax.php

@@ -158,7 +158,7 @@ class Ajax extends Backend
         //主键
         $pk = $this->request->post("pk");
         //排序的方式
-        $orderway = $this->request->post("orderway", "", 'strtolower');
+        $orderway = strtolower($this->request->post("orderway", ""));
         $orderway = $orderway == 'asc' ? 'ASC' : 'DESC';
         $sour = $weighdata = [];
         $ids = explode(',', $ids);

+ 2 - 2
application/admin/controller/Category.php

@@ -9,7 +9,7 @@ use fast\Tree;
 /**
  * 分类管理
  *
- * @icon fa fa-list
+ * @icon   fa fa-list
  * @remark 用于统一管理网站的所有分类,分类可进行无限级分类,分类类型请在常规管理->系统配置->字典配置中添加
  */
 class Category extends Backend
@@ -102,7 +102,7 @@ class Category extends Backend
                 $params = $this->preExcludeFields($params);
 
                 if ($params['pid'] != $row['pid']) {
-                    $childrenIds = Tree::instance()->init(collection(\app\common\model\Category::select())->toArray())->getChildrenIds($row['id'] true);
+                    $childrenIds = Tree::instance()->init(collection(\app\common\model\Category::select())->toArray())->getChildrenIds($row['id'], true);
                     if (in_array($params['pid'], $childrenIds)) {
                         $this->error(__('Can not change the parent to child or itself'));
                     }

+ 1 - 1
application/admin/controller/general/Attachment.php

@@ -36,7 +36,7 @@ class Attachment extends Backend
             $filter = $this->request->request('filter');
             $filterArr = (array)json_decode($filter, TRUE);
             if (isset($filterArr['mimetype']) && stripos($filterArr['mimetype'], ',') !== false) {
-                $this->request->get(['filter' => json_encode(array_merge($filterArr, ['mimetype' => '']))]);
+                $this->request->get(['filter' => json_encode(array_diff_key($filterArr, ['mimetype' => '']))]);
                 $mimetypeQuery = function ($query) use ($filterArr) {
                     $mimetypeArr = explode(',', $filterArr['mimetype']);
                     foreach ($mimetypeArr as $index => $item) {

+ 1 - 0
application/admin/lang/zh-cn.php

@@ -56,6 +56,7 @@ return [
     'Execute'                                               => '执行',
     'Close'                                                 => '关闭',
     'Choose'                                                => '选择',
+    'Go'                                                    => '跳转',
     'Search'                                                => '搜索',
     'Refresh'                                               => '刷新',
     'Install'                                               => '安装',

+ 2 - 2
application/admin/library/traits/Backend.php

@@ -3,12 +3,12 @@
 namespace app\admin\library\traits;
 
 use app\admin\library\Auth;
+use Exception;
 use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
 use PhpOffice\PhpSpreadsheet\Reader\Xlsx;
 use PhpOffice\PhpSpreadsheet\Reader\Xls;
 use PhpOffice\PhpSpreadsheet\Reader\Csv;
 use think\Db;
-use think\Exception;
 use think\exception\PDOException;
 use think\exception\ValidateException;
 
@@ -470,7 +470,7 @@ trait Backend
                 $msg = "导入失败,包含【{$matches[1]}】的记录已存在";
             };
             $this->error($msg);
-        } catch (\Exception $e) {
+        } catch (Exception $e) {
             $this->error($e->getMessage());
         }
 

+ 5 - 0
application/admin/model/User.php

@@ -3,6 +3,7 @@
 namespace app\admin\model;
 
 use app\common\model\MoneyLog;
+use app\common\model\ScoreLog;
 use think\Model;
 
 class User extends Model
@@ -50,6 +51,10 @@ class User extends Model
                 $origin = $row->getOriginData();
                 MoneyLog::create(['user_id' => $row['id'], 'money' => $changedata['money'] - $origin['money'], 'before' => $origin['money'], 'after' => $changedata['money'], 'memo' => '管理员变更金额']);
             }
+            if (isset($changedata['score'])) {
+                $origin = $row->getOriginData();
+                ScoreLog::create(['user_id' => $row['id'], 'score' => $changedata['score'] - $origin['score'], 'before' => $origin['score'], 'after' => $changedata['score'], 'memo' => '管理员变更积分']);
+            }
         });
     }
 

+ 1 - 1
application/admin/view/dashboard/index.html

@@ -208,7 +208,7 @@
 
                 <div class="row">
                     <div class="col-lg-8">
-                        <div id="echart" style="height:200px;width:100%;"></div>
+                        <div id="echart" class="btn-refresh" style="height:200px;width:100%;"></div>
                     </div>
                     <div class="col-lg-4">
                         <div class="card sameheight-item stats">

+ 2 - 2
application/index/controller/User.php

@@ -76,7 +76,7 @@ class User extends Frontend
      */
     public function register()
     {
-        $url = $this->request->request('url', '', 'trim');
+        $url = $this->request->request('url', '');
         if ($this->auth->id) {
             $this->success(__('You\'ve logged in, do not login again'), $url ? $url : url('user/index'));
         }
@@ -144,7 +144,7 @@ class User extends Frontend
      */
     public function login()
     {
-        $url = $this->request->request('url', '', 'trim');
+        $url = $this->request->request('url', '');
         if ($this->auth->id) {
             $this->success(__('You\'ve logged in, do not login again'), $url ? $url : url('user/index'));
         }

+ 92 - 92
extend/fast/Form.php

@@ -157,9 +157,9 @@ class FormBuilder
     /**
      * 生成Label标签
      *
-     * @param  string $name
-     * @param  string $value
-     * @param  array  $options
+     * @param string $name
+     * @param string $value
+     * @param array  $options
      * @return string
      */
     public function label($name, $value = null, $options = [])
@@ -175,8 +175,8 @@ class FormBuilder
     /**
      * Format the label value.
      *
-     * @param  string      $name
-     * @param  string|null $value
+     * @param string      $name
+     * @param string|null $value
      * @return string
      */
     protected function formatLabel($name, $value)
@@ -187,10 +187,10 @@ class FormBuilder
     /**
      * 生成文本框(按类型)
      *
-     * @param  string $type
-     * @param  string $name
-     * @param  string $value
-     * @param  array  $options
+     * @param string $type
+     * @param string $name
+     * @param string $value
+     * @param array  $options
      * @return string
      */
     public function input($type, $name, $value = null, $options = [])
@@ -215,9 +215,9 @@ class FormBuilder
     /**
      * 生成普通文本框
      *
-     * @param  string $name
-     * @param  string $value
-     * @param  array  $options
+     * @param string $name
+     * @param string $value
+     * @param array  $options
      * @return string
      */
     public function text($name, $value = null, $options = [])
@@ -228,8 +228,8 @@ class FormBuilder
     /**
      * 生成密码文本框
      *
-     * @param  string $name
-     * @param  array  $options
+     * @param string $name
+     * @param array  $options
      * @return string
      */
     public function password($name, $options = [])
@@ -240,9 +240,9 @@ class FormBuilder
     /**
      * 生成隐藏文本框
      *
-     * @param  string $name
-     * @param  string $value
-     * @param  array  $options
+     * @param string $name
+     * @param string $value
+     * @param array  $options
      * @return string
      */
     public function hidden($name, $value = null, $options = [])
@@ -253,9 +253,9 @@ class FormBuilder
     /**
      * 生成Email文本框
      *
-     * @param  string $name
-     * @param  string $value
-     * @param  array  $options
+     * @param string $name
+     * @param string $value
+     * @param array  $options
      * @return string
      */
     public function email($name, $value = null, $options = [])
@@ -266,9 +266,9 @@ class FormBuilder
     /**
      * 生成URL文本框
      *
-     * @param  string $name
-     * @param  string $value
-     * @param  array  $options
+     * @param string $name
+     * @param string $value
+     * @param array  $options
      * @return string
      */
     public function url($name, $value = null, $options = [])
@@ -279,8 +279,8 @@ class FormBuilder
     /**
      * 生成上传文件组件
      *
-     * @param  string $name
-     * @param  array  $options
+     * @param string $name
+     * @param array  $options
      * @return string
      */
     public function file($name, $options = [])
@@ -291,9 +291,9 @@ class FormBuilder
     /**
      * 生成多行文本框
      *
-     * @param  string $name
-     * @param  string $value
-     * @param  array  $options
+     * @param string $name
+     * @param string $value
+     * @param array  $options
      * @return string
      */
     public function textarea($name, $value = null, $options = [])
@@ -331,7 +331,7 @@ class FormBuilder
     /**
      * 设置默认的文本框行列数
      *
-     * @param  array $options
+     * @param array $options
      * @return array
      */
     protected function setTextAreaSize($options)
@@ -349,7 +349,7 @@ class FormBuilder
     /**
      * 根据size设置行数和列数
      *
-     * @param  array $options
+     * @param array $options
      * @return array
      */
     protected function setQuickTextAreaSize($options)
@@ -379,10 +379,10 @@ class FormBuilder
     /**
      * 生成下拉列表框
      *
-     * @param  string $name
-     * @param  array  $list
-     * @param  mixed  $selected
-     * @param  array  $options
+     * @param string $name
+     * @param array  $list
+     * @param mixed  $selected
+     * @param array  $options
      * @return string
      */
     public function select($name, $list = [], $selected = null, $options = [])
@@ -719,11 +719,11 @@ EOD;
     /**
      * 创建一个下拉列表选择区间组件
      *
-     * @param  string $name
-     * @param  string $begin
-     * @param  string $end
-     * @param  string $selected
-     * @param  array  $options
+     * @param string $name
+     * @param string $begin
+     * @param string $end
+     * @param string $selected
+     * @param array  $options
      * @return string
      */
     public function selectRange($name, $begin, $end, $selected = null, $options = [])
@@ -735,11 +735,11 @@ EOD;
     /**
      * 生成选择年组件
      *
-     * @param  string $name
-     * @param  string $begin
-     * @param  string $end
-     * @param  string $selected
-     * @param  array  $options
+     * @param string $name
+     * @param string $begin
+     * @param string $end
+     * @param string $selected
+     * @param array  $options
      * @return string
      */
     public function selectYear($name, $begin, $end, $selected, $options)
@@ -750,10 +750,10 @@ EOD;
     /**
      * 生成选择月组件
      *
-     * @param  string $name
-     * @param  string $selected
-     * @param  array  $options
-     * @param  string $format
+     * @param string $name
+     * @param string $selected
+     * @param array  $options
+     * @param string $format
      * @return string
      */
     public function selectMonth($name, $selected = null, $options = [], $format = '%m')
@@ -770,9 +770,9 @@ EOD;
     /**
      * 根据传递的值生成option
      *
-     * @param  string $display
-     * @param  string $value
-     * @param  string $selected
+     * @param string $display
+     * @param string $value
+     * @param string $selected
      * @return string
      */
     public function getSelectOption($display, $value, $selected)
@@ -787,9 +787,9 @@ EOD;
     /**
      * 生成optionGroup
      *
-     * @param  array  $list
-     * @param  string $label
-     * @param  string $selected
+     * @param array  $list
+     * @param string $label
+     * @param string $selected
      * @return string
      */
     protected function optionGroup($list, $label, $selected)
@@ -806,9 +806,9 @@ EOD;
     /**
      * 生成option选项
      *
-     * @param  string $display
-     * @param  string $value
-     * @param  string $selected
+     * @param string $display
+     * @param string $value
+     * @param string $selected
      * @return string
      */
     protected function option($display, $value, $selected)
@@ -823,8 +823,8 @@ EOD;
     /**
      * 检测value是否选中
      *
-     * @param  string $value
-     * @param  string $selected
+     * @param string $value
+     * @param string $selected
      * @return string
      */
     protected function getSelectedValue($value, $selected)
@@ -839,10 +839,10 @@ EOD;
     /**
      * 生成复选按钮
      *
-     * @param  string $name
-     * @param  mixed  $value
-     * @param  bool   $checked
-     * @param  array  $options
+     * @param string $name
+     * @param mixed  $value
+     * @param bool   $checked
+     * @param array  $options
      * @return string
      */
     public function checkbox($name, $value = 1, $checked = null, $options = [])
@@ -870,7 +870,7 @@ EOD;
         $checked = is_array($checked) ? $checked : explode(',', $checked);
         foreach ($list as $k => $v) {
             $options['id'] = "{$name}-{$k}";
-            $html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::checkbox($name, $k, in_array($k, $checked), $options));
+            $html[] = sprintf(Form::label("{$name}-{$k}", "%s {$v}"), Form::checkbox("{$name}[{$k}}]", $k, in_array($k, $checked), $options));
         }
         return '<div class="checkbox">' . implode(' ', $html) . '</div>';
     }
@@ -878,10 +878,10 @@ EOD;
     /**
      * 生成单选按钮
      *
-     * @param  string $name
-     * @param  mixed  $value
-     * @param  bool   $checked
-     * @param  array  $options
+     * @param string $name
+     * @param mixed  $value
+     * @param bool   $checked
+     * @param array  $options
      * @return string
      */
     public function radio($name, $value = null, $checked = null, $options = [])
@@ -1042,8 +1042,8 @@ EOD;
     /**
      * 生成一个按钮
      *
-     * @param  string $value
-     * @param  array  $options
+     * @param string $value
+     * @param array  $options
      * @return string
      */
     public function button($value = null, $options = [])
@@ -1058,8 +1058,8 @@ EOD;
     /**
      * 获取ID属性值
      *
-     * @param  string $name
-     * @param  array  $attributes
+     * @param string $name
+     * @param array  $attributes
      * @return string
      */
     public function getIdAttribute($name, $attributes)
@@ -1076,8 +1076,8 @@ EOD;
     /**
      * 获取Value属性值
      *
-     * @param  string $name
-     * @param  string $value
+     * @param string $name
+     * @param string $value
      * @return string
      */
     public function getValueAttribute($name, $value = null)
@@ -1094,7 +1094,7 @@ EOD;
     /**
      * 数组转换成一个HTML属性字符串。
      *
-     * @param  array $attributes
+     * @param array $attributes
      * @return string
      */
     public function attributes($attributes)
@@ -1115,8 +1115,8 @@ EOD;
     /**
      * 拼接成一个属性。
      *
-     * @param  string $key
-     * @param  string $value
+     * @param string $key
+     * @param string $value
      * @return string
      */
     protected function attributeElement($key, $value)
@@ -1141,7 +1141,7 @@ class Arr
     /**
      * Determine whether the given value is array accessible.
      *
-     * @param  mixed $value
+     * @param mixed $value
      * @return bool
      */
     public static function accessible($value)
@@ -1152,8 +1152,8 @@ class Arr
     /**
      * Determine if the given key exists in the provided array.
      *
-     * @param  \ArrayAccess|array $array
-     * @param  string|int         $key
+     * @param \ArrayAccess|array $array
+     * @param string|int         $key
      * @return bool
      */
     public static function exists($array, $key)
@@ -1167,9 +1167,9 @@ class Arr
     /**
      * Get an item from an array using "dot" notation.
      *
-     * @param  \ArrayAccess|array $array
-     * @param  string             $key
-     * @param  mixed              $default
+     * @param \ArrayAccess|array $array
+     * @param string             $key
+     * @param mixed              $default
      * @return mixed
      */
     public static function get($array, $key, $default = null)
@@ -1196,8 +1196,8 @@ class Arr
     /**
      * Get all of the given array except for a specified array of items.
      *
-     * @param  array        $array
-     * @param  array|string $keys
+     * @param array        $array
+     * @param array|string $keys
      * @return array
      */
     public static function except($array, $keys)
@@ -1209,8 +1209,8 @@ class Arr
     /**
      * Remove one or many array items from a given array using "dot" notation.
      *
-     * @param  array        $array
-     * @param  array|string $keys
+     * @param array        $array
+     * @param array|string $keys
      * @return void
      */
     public static function forget(&$array, $keys)
@@ -1247,9 +1247,9 @@ if (!function_exists('array_get')) {
     /**
      * Get an item from an array using "dot" notation.
      *
-     * @param  \ArrayAccess|array $array
-     * @param  string             $key
-     * @param  mixed              $default
+     * @param \ArrayAccess|array $array
+     * @param string             $key
+     * @param mixed              $default
      * @return mixed
      */
     function array_get($array, $key, $default = null)
@@ -1278,8 +1278,8 @@ if (!function_exists('array_except')) {
     /**
      * Get all of the given array except for a specified array of items.
      *
-     * @param  array        $array
-     * @param  array|string $keys
+     * @param array        $array
+     * @param array|string $keys
      * @return array
      */
     function array_except($array, $keys)

+ 8 - 0
public/assets/css/backend.css

@@ -997,4 +997,12 @@ table.table-nowrap thead > tr > th {
 .btn-switcher .text-gray {
   color: #d2d6de !important;
 }
+.jumpto input {
+  height: 31px;
+  width: 50px;
+  margin-left: 5px;
+  margin-right: 5px;
+  text-align: center;
+  display: inline-block;
+}
 /*# sourceMappingURL=backend.css.map */

File diff suppressed because it is too large
+ 1 - 1
public/assets/css/backend.min.css


+ 9 - 1
public/assets/css/frontend.css

@@ -510,4 +510,12 @@ main.content {
   padding: .5em .93em;
   font-size: 14px;
 }
-/*# sourceMappingURL=../css/frontend.css.map */
+.jumpto input {
+  height: 31px;
+  width: 50px;
+  margin-left: 5px;
+  margin-right: 5px;
+  text-align: center;
+  display: inline-block;
+}
+/*# sourceMappingURL=frontend.css.map */

File diff suppressed because it is too large
+ 1 - 1
public/assets/css/frontend.min.css


+ 3 - 2
public/assets/js/backend.js

@@ -162,13 +162,14 @@ define(['fast', 'template', 'moment'], function (Fast, Template, Moment) {
                 var options = $.extend({}, $(that).data() || {});
                 var url = Backend.api.replaceids(that, $(that).attr('href'));
                 var title = $(that).attr("title") || $(that).data("title") || $(that).data('original-title');
+                var icon = $(that).attr("icon") || $(that).data("icon");
                 if (typeof options.confirm !== 'undefined') {
                     Layer.confirm(options.confirm, function (index) {
-                        Backend.api.addtabs(url, title);
+                        Backend.api.addtabs(url, title, icon);
                         Layer.close(index);
                     });
                 } else {
-                    Backend.api.addtabs(url, title);
+                    Backend.api.addtabs(url, title, icon);
                 }
                 return false;
             });

+ 1 - 1
public/assets/js/backend/addon.js

@@ -153,7 +153,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
                 commonSearch: true,
                 searchFormVisible: true,
                 searchFormTemplate: 'searchformtpl',
-                pageSize: 30,
+                pageSize: 50,
             });
 
             // 为表格绑定事件

+ 6 - 3
public/assets/js/backend/dashboard.js

@@ -96,9 +96,6 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart
                             data: Orderdata.createdata
                         }]
                 });
-                if ($("#echart").width() != $("#echart canvas").width() && $("#echart canvas").width() < $("#echart").width()) {
-                    myChart.resize();
-                }
             }, 2000);
             $(window).resize(function () {
                 myChart.resize();
@@ -108,6 +105,12 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart
                 top.window.$("[data-toggle=checkupdate]").trigger("click");
             });
 
+            $(document).on("click", ".btn-refresh", function () {
+                setTimeout(function () {
+                    myChart.resize();
+                }, 0);
+            });
+
         }
     };
 

+ 6 - 1
public/assets/js/require-backend.js

@@ -29,10 +29,11 @@ require.config({
         'bootstrap-daterangepicker': '../libs/bootstrap-daterangepicker/daterangepicker',
         'bootstrap-select': '../libs/bootstrap-select/dist/js/bootstrap-select.min',
         'bootstrap-select-lang': '../libs/bootstrap-select/dist/js/i18n/defaults-zh_CN',
-        'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min',
+        'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table',
         'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
         'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
         'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
+        'bootstrap-table-jumpto': '../libs/bootstrap-table/dist/extensions/page-jumpto/bootstrap-table-jumpto',
         'bootstrap-slider': '../libs/bootstrap-slider/bootstrap-slider',
         'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
         'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort',
@@ -87,6 +88,10 @@ require.config({
             deps: ['bootstrap-table', 'template'],
             exports: '$.fn.bootstrapTable.defaults'
         },
+        'bootstrap-table-jumpto': {
+            deps: ['bootstrap-table'],
+            exports: '$.fn.bootstrapTable.defaults'
+        },
         'tableexport': {
             deps: ['jquery'],
             exports: '$.fn.extend'

File diff suppressed because it is too large
+ 3240 - 77
public/assets/js/require-backend.min.js


+ 5 - 0
public/assets/js/require-frontend.js

@@ -33,6 +33,7 @@ require.config({
         'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
         'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
         'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
+        'bootstrap-table-jumpto': '../libs/bootstrap-table/dist/extensions/page-jumpto/bootstrap-table-jumpto',
         'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
         'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort',
         'sortable': '../libs/Sortable/Sortable.min',
@@ -86,6 +87,10 @@ require.config({
             deps: ['bootstrap-table', 'template'],
             exports: '$.fn.bootstrapTable.defaults'
         },
+        'bootstrap-table-jumpto': {
+            deps: ['bootstrap-table'],
+            exports: '$.fn.bootstrapTable.defaults'
+        },
         'tableexport': {
             deps: ['jquery'],
             exports: '$.fn.extend'

+ 5 - 0
public/assets/js/require-frontend.min.js

@@ -46,6 +46,7 @@ require.config({
         'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min',
         'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile',
         'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN',
+        'bootstrap-table-jumpto': '../libs/bootstrap-table/dist/extensions/page-jumpto/bootstrap-table-jumpto',
         'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min',
         'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort',
         'sortable': '../libs/Sortable/Sortable.min',
@@ -99,6 +100,10 @@ require.config({
             deps: ['bootstrap-table', 'template'],
             exports: '$.fn.bootstrapTable.defaults'
         },
+        'bootstrap-table-jumpto': {
+            deps: ['bootstrap-table'],
+            exports: '$.fn.bootstrapTable.defaults'
+        },
         'tableexport': {
             deps: ['jquery'],
             exports: '$.fn.extend'

+ 6 - 2
public/assets/js/require-table.js

@@ -1,4 +1,4 @@
-define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table', 'bootstrap-table-lang', 'bootstrap-table-export', 'bootstrap-table-commonsearch', 'bootstrap-table-template'], function ($, undefined, Moment) {
+define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table', 'bootstrap-table-lang', 'bootstrap-table-export', 'bootstrap-table-commonsearch', 'bootstrap-table-template', 'bootstrap-table-jumpto'], function ($, undefined, Moment) {
     var Table = {
         list: {},
         // Bootstrap-table 基础配置
@@ -27,6 +27,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
             dblClickToEdit: true, //是否启用双击编辑
             singleSelect: false, //是否启用单选
             showRefresh: false,
+            showJumpto: true,
             locale: 'zh-CN',
             showToggle: true,
             showColumns: true,
@@ -124,6 +125,9 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                     },
                     formatCommonChoose: function () {
                         return __('Choose');
+                    },
+                    formatJumpto: function () {
+                        return __('Go');
                     }
                 }, locales);
                 if (typeof defaults.exportTypes != 'undefined') {
@@ -434,7 +438,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                 image: {
                     'click .img-center': function (e, value, row, index) {
                         var data = [];
-                        value = value.split(",");
+                        value = value.toString().split(",");
                         $.each(value, function (index, value) {
                             data.push({
                                 src: Fast.api.cdnurl(value),

+ 3 - 2
public/assets/js/require-upload.js

@@ -9,8 +9,8 @@ define(['jquery', 'bootstrap', 'plupload', 'template'], function ($, undefined,
             events: {
                 onInit: function (up) {
                     //修复少数安卓浏览器无法上传图片的Bug
-                    var input = $("input[type=file]", $(up.settings.button).next());
-                    if (input && input.prop("accept") && input.prop("accept").match(/image\/jpeg/)) {
+                    var input = $("input[type=file]", up.settings.container);
+                    if (input && input.prop("accept") && input.prop("accept").match(/image\//)) {
                         input.prop("accept", "image/jpg," + input.prop("accept"));
                     }
                 },
@@ -214,6 +214,7 @@ define(['jquery', 'bootstrap', 'plupload', 'template'], function ($, undefined,
                             url: url,
                             multipart_params: $.isArray(multipart) ? {} : multipart,
                             init: {
+                                Init: Upload.events.onInit,
                                 PostInit: Upload.events.onPostInit,
                                 FilesAdded: Upload.events.onFileAdded,
                                 BeforeUpload: Upload.events.onBeforeUpload,

+ 119 - 3
public/assets/less/backend.less

@@ -46,6 +46,7 @@ body.is-dialog {
   .logo, .navbar {
     .transition(none);
   }
+
   .navbar {
     position: relative;
   }
@@ -62,9 +63,11 @@ html.ios-fix, html.ios-fix body {
   overflow: auto;
   -webkit-overflow-scrolling: touch;
 }
+
 .wrapper {
   height: 100%;
 }
+
 #header {
   background: #fff;
   //box-shadow: 0 2px 2px rgba(0,0,0,.05),0 1px 0 rgba(0,0,0,.05);
@@ -72,7 +75,7 @@ html.ios-fix, html.ios-fix body {
 
 .content-wrapper {
   position: relative;
-  height:100%;
+  height: 100%;
 }
 
 .control-relative {
@@ -119,6 +122,7 @@ html.ios-fix, html.ios-fix body {
       color: #fff;
       background-color: @brand-danger;
     }
+
     &.btn-primary {
       color: #fff;
       background-color: @brand-primary;
@@ -187,6 +191,7 @@ table.table-template {
     color: #777 !important;
     text-decoration: none !important;
   }
+
   .breadcrumb {
     display: inline-block;
     margin: 0;
@@ -199,6 +204,7 @@ table.table-template {
   .breadcrumb li {
     color: #aaa;
   }
+
   .shortcut {
     a {
       margin-left: 10px;
@@ -211,6 +217,7 @@ table.table-template {
   #main {
     background: #fff;
   }
+
   .layer-footer {
     display: none;
   }
@@ -229,14 +236,17 @@ form.form-horizontal .control-label {
 .panel-intro {
   margin-bottom: 0;
   border: none;
+
   > .panel-heading {
     padding: 15px;
     padding-bottom: 0;
     background: @panel-intro-bg;
     border-color: @panel-intro-bg;
     position: relative;
+
     .panel-lead {
       margin-bottom: 15px;
+
       em {
         display: block;
         font-weight: bold;
@@ -257,10 +267,12 @@ form.form-horizontal .control-label {
       position: absolute;
       top: 8px;
       right: 8px;
+
       .fa {
         font-size: 14px;
       }
     }
+
     .nav-tabs {
       border-bottom: 0;
       margin-bottom: 0;
@@ -273,11 +285,13 @@ form.form-horizontal .control-label {
       border: 1px solid @panel-intro-bg;
       border-bottom-color: transparent;
     }
+
     .nav-tabs > li > a:hover, .nav-tabs > li > a:focus {
       border: 1px solid @panel-intro-bg;
       color: #7b8a8b;
       background-color: darken(@panel-intro-bg, 10%);
     }
+
     .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
       color: #7b8a8b;
       background-color: #ffffff;
@@ -291,9 +305,11 @@ form.form-horizontal .control-label {
 .panel-tabs {
   .panel-heading {
     padding: 12px 15px 12px 15px;
+
     .panel-lead {
       margin-bottom: 0px;
     }
+
     .panel-title {
 
     }
@@ -309,15 +325,18 @@ form.form-horizontal .control-label {
     background: @main-bg;
     border-color: @main-bg;
   }
+
   .nav-tabs > li > a {
     padding: 12px 15px;
     background-color: @panel-intro-bg;
     border: 1px solid @main-bg;
   }
+
   .nav-tabs > li > a:hover, .nav-tabs > li > a:focus {
     border: 1px solid @panel-intro-bg;
     background-color: @panel-intro-bg;
   }
+
   .nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
     border-color: @main-bg;
     border-bottom-color: transparent;
@@ -327,14 +346,18 @@ form.form-horizontal .control-label {
 /*顶栏addtabs*/
 .nav-addtabs {
   height: 100%;
+
   &.disable-top-badge {
     > li > a > .pull-right-container {
       display: none;
     }
   }
+
   border: none;
+
   > li {
     margin: 0;
+
     > a {
       height: 50px;
       line-height: 50px;
@@ -344,12 +367,14 @@ form.form-horizontal .control-label {
       border-right: 1px solid rgba(0, 0, 0, 0.05);
       margin: 0;
       color: #95a5a6;
+
       &:hover, &:focus {
         border: none;
         color: #2c3e50;
         border-right: 1px solid rgba(0, 0, 0, 0.05);
       }
     }
+
     &.active > a {
       height: 50px;
       line-height: 50px;
@@ -360,6 +385,7 @@ form.form-horizontal .control-label {
       background: #f1f4f6;
       color: #2c3e50;
       overflow: hidden;
+
       &:hover, &:focus {
         border: none;
         color: #2c3e50;
@@ -367,6 +393,7 @@ form.form-horizontal .control-label {
         border-right: 1px solid rgba(0, 0, 0, 0.05);
       }
     }
+
     .close-tab {
       font-size: 10px;
       position: absolute;
@@ -385,17 +412,21 @@ form.form-horizontal .control-label {
         text-decoration: inherit;
         font-size: 18px;
       }
+
       display: none;
     }
   }
+
   .open > a {
     &:hover, &:focus {
       border-right: 1px solid rgba(0, 0, 0, 0.05);
     }
   }
+
   ul li {
     position: relative;
   }
+
   li:hover > .close-tab {
     display: block;
   }
@@ -416,6 +447,7 @@ form.form-horizontal .control-label {
   border-bottom: 1px solid transparent;
   box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
   position: relative;
+
   .sidebar-toggle {
     position: absolute;
     width: 45px;
@@ -424,11 +456,13 @@ form.form-horizontal .control-label {
     line-height: 50px;
     padding: 0;
   }
+
   .nav-addtabs {
     position: absolute;
     left: 45px;
     z-index: 98;
   }
+
   .navbar-custom-menu {
     position: absolute;
     top: 0;
@@ -451,14 +485,18 @@ form.form-horizontal .control-label {
   -webkit-user-select: none;
   -moz-user-select: none;
   user-select: none;
+
   .nav-addtabs {
     height: 100%;
+
     &.disable-top-badge {
       > li > a > .pull-right-container {
         display: none;
       }
     }
+
     border: none;
+
     > li {
       border: 1px solid #eee;
       border-radius: 3px;
@@ -467,6 +505,7 @@ form.form-horizontal .control-label {
       line-height: 30px;
       margin: 2px 5px 2px 0;
       background: #fff;
+
       > a {
         display: block;
         color: #495060 !important;
@@ -480,10 +519,12 @@ form.form-horizontal .control-label {
         background: none;
         border: none;
       }
+
       &.active {
         border-color: #bdbebd;
         background-color: #f7f7f7;
       }
+
       .close-tab {
         font-size: 10px;
         position: absolute;
@@ -503,13 +544,16 @@ form.form-horizontal .control-label {
           font-size: 18px;
         }
       }
+
       &:hover, &:focus {
         border-color: #bdbebd;
       }
     }
+
     ul li {
       position: relative;
     }
+
     li:hover > .close-tab {
       display: block;
       border-color: #222e32;
@@ -521,6 +565,7 @@ form.form-horizontal .control-label {
 
 .main-sidebar .sidebar-form {
   overflow: visible;
+
   .menuresult {
     z-index: 999;
     position: absolute;
@@ -533,6 +578,7 @@ form.form-horizontal .control-label {
     border-top: none;
     border-top-left-radius: 0;
     border-top-right-radius: 0;
+
     a {
       border-top: 1px solid #eee;
       display: block;
@@ -542,6 +588,7 @@ form.form-horizontal .control-label {
       display: block;
       padding: 10px 15px;
       color: #222d32;
+
       &:hover {
         background: #eee;
       }
@@ -559,9 +606,11 @@ form.form-horizontal .control-label {
       display: block;
     }
   }
+
   > li .badge {
     margin-top: 0;
   }
+
   .treeview-menu > li > a {
     font-size: inherit;
   }
@@ -588,13 +637,16 @@ form.form-horizontal .control-label {
 .fieldlist dd {
   display: block;
   margin: 5px 0;
+
   input {
     display: inline-block;
     width: 300px;
   }
+
   input:first-child {
     width: 110px;
   }
+
   ins {
     width: 110px;
     display: inline-block;
@@ -608,6 +660,7 @@ form.form-horizontal .control-label {
   height: 100%;
   min-height: 150px;
   min-width: 300px;
+
   .form-body {
     width: 100%;
     overflow: auto;
@@ -617,6 +670,7 @@ form.form-horizontal .control-label {
     bottom: 50px;
     padding: 15px;
   }
+
   .form-footer {
     height: 50px;
     line-height: 50px;
@@ -627,6 +681,7 @@ form.form-horizontal .control-label {
     bottom: 0;
     margin: 0;
   }
+
   .form-footer .form-group {
     margin-left: 0;
     margin-right: 0;
@@ -638,6 +693,7 @@ form.form-horizontal .control-label {
     display: block;
     clear: both;
   }
+
   .jstree-leaf:not(:first-child) {
     float: left;
     background: none;
@@ -645,6 +701,7 @@ form.form-horizontal .control-label {
     min-width: 80px;
     clear: none;
   }
+
   .jstree-leaf {
     float: left;
     margin-left: 0;
@@ -653,17 +710,21 @@ form.form-horizontal .control-label {
     clear: none;
     color: #777;
   }
+
   .jstree-leaf > .jstree-icon, .jstree-leaf .jstree-themeicon {
     display: none;
   }
+
   .jstree-last {
     background-image: url("../img/32px.png");
     background-position: -292px -4px;
     background-repeat: repeat-y;
   }
+
   .jstree-children {
     .clearfix();
   }
+
   .jstree-themeicon {
     display: none;
   }
@@ -692,17 +753,22 @@ form.form-horizontal .control-label {
 .plupload-preview {
   padding: 0 10px;
   margin-bottom: 0;
+
   li {
     margin-top: 15px;
   }
+
   .thumbnail {
     margin-bottom: 10px;
   }
+
   a {
     display: block;
+
     &:first-child {
       height: 90px;
     }
+
     img {
       height: 80px;
       object-fit: cover;
@@ -775,6 +841,7 @@ table.table-nowrap {
 
 .dropdown-submenu {
   position: relative;
+
   > .dropdown-menu {
     overflow: auto;
     top: 0;
@@ -783,14 +850,17 @@ table.table-nowrap {
     margin-left: -1px;
     .border-radius(0 6px 6px 6px);
   }
+
   &:hover {
     > .dropdown-menu {
       display: block;
     }
+
     > a:after {
       border-left-color: #fff;
     }
   }
+
   > a:after {
     display: block;
     content: " ";
@@ -804,8 +874,10 @@ table.table-nowrap {
     margin-top: 5px;
     margin-right: -10px;
   }
+
   &.pull-left {
     float: none;
+
     > .dropdown-menu {
       left: -100%;
       margin-left: 10px;
@@ -859,6 +931,7 @@ table.table-nowrap {
     ~ .layui-layer-setwin {
       top: 0px;
       height: 42px;
+
       > a {
         height: 42px;
         line-height: 42px;
@@ -871,19 +944,24 @@ table.table-nowrap {
     border: none !important;
     box-shadow: 1px 1px 50px rgba(0, 0, 0, .3) !important;
   }
+
   &.layui-layer-iframe {
     //overflow:hidden!important;
     overflow: visible;
   }
+
   .layui-layer-moves {
     .box-sizing(content-box);
   }
+
   /*自定义底部灰色操作区*/
+
   .layui-layer-btn {
     text-align: center !important;
     padding: 10px !important;
     background: #ecf0f1;
     overflow: hidden;
+
     a {
       background-color: #95a5a6;
       border-color: #95a5a6;
@@ -892,11 +970,13 @@ table.table-nowrap {
       margin-top: 0;
       border: 1px solid transparent;
     }
+
     .layui-layer-btn0 {
       background-color: #18bc9c;
       border-color: #18bc9c;
     }
   }
+
   .layui-layer-footer {
     padding: 8px 20px;
     background-color: #ecf0f1;
@@ -907,9 +987,11 @@ table.table-nowrap {
   .layui-layer-setwin {
     > a {
       background: none !important;
+
       cite {
         display: none;
       }
+
       &:after {
         content: "\e625";
         font-family: iconfont;
@@ -922,42 +1004,53 @@ table.table-nowrap {
         margin: 0;
         z-index: 1;
       }
+
       &:hover {
         text-decoration: none !important;
         background: none !important;
       }
+
       &:focus {
         text-decoration: none !important;
       }
     }
+
     .layui-layer-min {
       display: none;
+
       &:after {
         content: "\e625";
       }
     }
+
     .layui-layer-max {
       display: none;
+
       &:after {
         content: "\e623";
       }
     }
+
     .layui-layer-maxmin {
       display: none;
+
       &:after {
         content: "\e624";
       }
     }
+
     .layui-layer-close1 {
       &:after {
         content: "\e626";
       }
     }
+
     //样式二关闭按钮
     .layui-layer-close2, .layui-layer-close2:hover {
       background: url('../libs/fastadmin-layer/dist/theme/default/icon.png') no-repeat -149px -31px !important;
       top: -30px;
       right: -30px;
+
       &:after {
         display: none;
       }
@@ -976,12 +1069,14 @@ table.table-nowrap {
 .layui-layer-fast-tab {
   .layui-layer-title {
     .layui-this {
-      color:#333;
+      color: #333;
     }
   }
+
   .layui-layer-content {
     .layui-layer-tabmain {
-      margin:0;padding:0;
+      margin: 0;
+      padding: 0;
     }
   }
 }
@@ -1008,12 +1103,14 @@ table.table-nowrap {
     .nav-addtabs {
       //display: none;
     }
+
     .navbar-custom-menu {
       ul li a {
         padding-left: 10px;
         padding-right: 10px;
       }
     }
+
     .navbar-nav > .user-menu .user-image {
       margin-top: -3px;
     }
@@ -1065,13 +1162,16 @@ table.table-nowrap {
     width: 100px;
     height: 70px;
     font-size: 13px;
+
     i.fa {
       font-size: 24px;
     }
+
     span {
       margin-top: 5px;
       display: block;
     }
+
     &.active {
       color: #222d32;
     }
@@ -1080,12 +1180,15 @@ table.table-nowrap {
   body .wrapper .main-header .navbar .dropdown-menu li {
     > a {
       color: #333;
+
       &:hover {
         background: #eee;
       }
     }
+
     &.active > a {
       color: #fff;
+
       &:hover {
         background: #222d32
       }
@@ -1104,10 +1207,12 @@ table.table-nowrap {
       left: 0;
       text-align: right;
       width: 100%;
+
       .msg-wrap {
         position: relative;
       }
     }
+
     .col-xs-12 > .n-right {
       .msg-wrap {
         margin-right: 15px;
@@ -1120,6 +1225,7 @@ table.table-nowrap {
 .radio, .checkbox {
   > label {
     margin-right: 10px;
+
     > input {
       margin: 2px 0 0;
     }
@@ -1136,7 +1242,17 @@ table.table-nowrap {
     opacity: .6;
     cursor: not-allowed;
   }
+
   .text-gray {
     color: #d2d6de !important;
   }
 }
+
+.jumpto input {
+  height: 31px;
+  width: 50px;
+  margin-left: 5px;
+  margin-right: 5px;
+  text-align: center;
+  display: inline-block;
+}

+ 9 - 0
public/assets/less/frontend.less

@@ -476,4 +476,13 @@ main.content {
     border-radius: 0.25em;
     padding: .5em .93em;
     font-size: 14px;
+}
+
+.jumpto input {
+    height: 31px;
+    width: 50px;
+    margin-left: 5px;
+    margin-right: 5px;
+    text-align: center;
+    display: inline-block;
 }