From 2b32306511ea05f2e2d4379a67dd8c9037705431 Mon Sep 17 00:00:00 2001 From: hant Date: Sat, 29 Mar 2025 19:05:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/alioss/config.php | 326 +++++++++--------- application/admin/controller/auth/Admin.php | 64 ++++ application/admin/controller/user/User.php | 3 + .../admin/controller/workers/Worker.php | 2 - application/admin/model/Area.php | 36 ++ application/admin/view/auth/admin/area.html | 21 ++ .../admin/view/workers/worker/index.html | 36 +- public/assets/js/backend/auth/admin.js | 229 +++++++++--- public/assets/js/backend/user/rule.js | 5 +- public/assets/js/backend/user/user.js | 5 +- public/assets/js/backend/workers/worker.js | 3 +- 11 files changed, 488 insertions(+), 242 deletions(-) create mode 100644 application/admin/view/auth/admin/area.html diff --git a/addons/alioss/config.php b/addons/alioss/config.php index 0d958c2..ac6982f 100644 --- a/addons/alioss/config.php +++ b/addons/alioss/config.php @@ -2,232 +2,232 @@ return [ [ - 'name' => 'accessKeyId', - 'title' => 'AccessKey ID', - 'type' => 'string', + 'name' => 'accessKeyId', + 'title' => 'AccessKey ID', + 'type' => 'string', 'content' => [], - 'value' => '', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => 'LTAI5t87F5mAkaXVKfLcmnrB', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'accessKeySecret', - 'title' => 'AccessKey Secret', - 'type' => 'string', + 'name' => 'accessKeySecret', + 'title' => 'AccessKey Secret', + 'type' => 'string', 'content' => [], - 'value' => '', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => 'fk7KgdqRdJUS6Jc99TlB6mNLKorrsD', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'bucket', - 'title' => 'Bucket名称', - 'type' => 'string', + 'name' => 'bucket', + 'title' => 'Bucket名称', + 'type' => 'string', 'content' => [], - 'value' => 'yourbucket', - 'rule' => 'required;bucket', - 'msg' => '', - 'tip' => '阿里云OSS的空间名', - 'ok' => '', - 'extend' => 'data-rule-bucket="[/^[0-9a-z_\-]{3,63}$/, \'请输入正确的Bucket名称\']"', + 'value' => 'allocatr', + 'rule' => 'required;bucket', + 'msg' => '', + 'tip' => '阿里云OSS的空间名', + 'ok' => '', + 'extend' => 'data-rule-bucket="[/^[0-9a-z_\\-]{3,63}$/, \'请输入正确的Bucket名称\']"', ], [ - 'name' => 'endpoint', - 'title' => 'Endpoint', - 'type' => 'string', + 'name' => 'endpoint', + 'title' => 'Endpoint', + 'type' => 'string', 'content' => [], - 'value' => 'oss-cn-shenzhen.aliyuncs.com', - 'rule' => 'required;endpoint', - 'msg' => '', - 'tip' => '请填写从阿里云存储获取的Endpoint', - 'ok' => '', - 'extend' => 'data-rule-endpoint="[/^(?!http(s)?:\/\/).*$/, \'不能以http(s)://开头\']"', + 'value' => 'allocatr.oss-cn-hangzhou.aliyuncs.com', + 'rule' => 'required;endpoint', + 'msg' => '', + 'tip' => '请填写从阿里云存储获取的Endpoint', + 'ok' => '', + 'extend' => 'data-rule-endpoint="[/^(?!http(s)?:\\/\\/).*$/, \'不能以http(s)://开头\']"', ], [ - 'name' => 'cdnurl', - 'title' => 'CDN地址', - 'type' => 'string', + 'name' => 'cdnurl', + 'title' => 'CDN地址', + 'type' => 'string', 'content' => [], - 'value' => 'https://yourbucket.oss-cn-shenzhen.aliyuncs.com', - 'rule' => 'required;cdnurl', - 'msg' => '', - 'tip' => '请填写CDN地址,必须以http(s)://开头', - 'ok' => '', - 'extend' => 'data-rule-cdnurl="[/^http(s)?:\/\/.*$/, \'必需以http(s)://开头\']"', + 'value' => 'https://allocatr.oss-cn-hangzhou.aliyuncs.com', + 'rule' => 'required;cdnurl', + 'msg' => '', + 'tip' => '请填写CDN地址,必须以http(s)://开头', + 'ok' => '', + 'extend' => 'data-rule-cdnurl="[/^http(s)?:\\/\\/.*$/, \'必需以http(s)://开头\']"', ], [ - 'name' => 'uploadmode', - 'title' => '上传模式', - 'type' => 'select', + 'name' => 'uploadmode', + 'title' => '上传模式', + 'type' => 'select', 'content' => [ 'client' => '客户端直传(速度快,无备份)', 'server' => '服务器中转(占用服务器带宽,可备份)', ], - 'value' => 'server', - 'rule' => '', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => 'client', + 'rule' => '', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'serverbackup', - 'title' => '服务器中转模式备份', - 'type' => 'radio', + 'name' => 'serverbackup', + 'title' => '服务器中转模式备份', + 'type' => 'radio', 'content' => [ 1 => '备份(附件管理将产生2条记录)', 0 => '不备份', ], - 'value' => '1', - 'rule' => '', - 'msg' => '', - 'tip' => '服务器中转模式下是否备份文件', - 'ok' => '', - 'extend' => '', + 'value' => '1', + 'rule' => '', + 'msg' => '', + 'tip' => '服务器中转模式下是否备份文件', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'savekey', - 'title' => '保存文件名', - 'type' => 'string', + 'name' => 'savekey', + 'title' => '保存文件名', + 'type' => 'string', 'content' => [], - 'value' => '/uploads/{year}{mon}{day}/{filemd5}{.suffix}', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '/uploads/{year}{mon}{day}/{filemd5}{.suffix}', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'expire', - 'title' => '上传有效时长', - 'type' => 'string', + 'name' => 'expire', + 'title' => '上传有效时长', + 'type' => 'string', 'content' => [], - 'value' => '600', - 'rule' => 'required', - 'msg' => '', - 'tip' => '用户停留页面上传有效时长,单位秒', - 'ok' => '', - 'extend' => '', + 'value' => '600', + 'rule' => 'required', + 'msg' => '', + 'tip' => '用户停留页面上传有效时长,单位秒', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'maxsize', - 'title' => '最大可上传', - 'type' => 'string', + 'name' => 'maxsize', + 'title' => '最大可上传', + 'type' => 'string', 'content' => [], - 'value' => '10M', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '10M', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'mimetype', - 'title' => '可上传后缀格式', - 'type' => 'string', + 'name' => 'mimetype', + 'title' => '可上传后缀格式', + 'type' => 'string', 'content' => [], - 'value' => 'jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => 'jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'multiple', - 'title' => '多文件上传', - 'type' => 'bool', + 'name' => 'multiple', + 'title' => '多文件上传', + 'type' => 'bool', 'content' => [], - 'value' => '0', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '0', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'thumbstyle', - 'title' => '缩略图样式', - 'type' => 'string', + 'name' => 'thumbstyle', + 'title' => '缩略图样式', + 'type' => 'string', 'content' => [], - 'value' => '', - 'rule' => '', - 'msg' => '', - 'tip' => '用于后台列表缩略图样式,可使用:?x-oss-process=image/resize,m_lfit,w_120,h_90', - 'ok' => '', - 'extend' => '', + 'value' => '', + 'rule' => '', + 'msg' => '', + 'tip' => '用于后台列表缩略图样式,可使用:?x-oss-process=image/resize,m_lfit,w_120,h_90', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'chunking', - 'title' => '分片上传', - 'type' => 'radio', + 'name' => 'chunking', + 'title' => '分片上传', + 'type' => 'radio', 'content' => [ 1 => '开启', 0 => '关闭', ], - 'value' => '0', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '0', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'chunksize', - 'title' => '分片大小', - 'type' => 'number', + 'name' => 'chunksize', + 'title' => '分片大小', + 'type' => 'number', 'content' => [], - 'value' => '4194304', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '4194304', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'syncdelete', - 'title' => '附件删除时是否同步删除云存储文件', - 'type' => 'bool', + 'name' => 'syncdelete', + 'title' => '附件删除时是否同步删除云存储文件', + 'type' => 'bool', 'content' => [], - 'value' => '0', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '1', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'apiupload', - 'title' => 'API接口使用云存储', - 'type' => 'bool', + 'name' => 'apiupload', + 'title' => 'API接口使用云存储', + 'type' => 'bool', 'content' => [], - 'value' => '0', - 'rule' => 'required', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '1', + 'rule' => 'required', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], [ - 'name' => 'noneedlogin', - 'title' => '免登录上传', - 'type' => 'checkbox', + 'name' => 'noneedlogin', + 'title' => '免登录上传', + 'type' => 'checkbox', 'content' => [ - 'api' => 'API', + 'api' => 'API', 'index' => '前台', 'admin' => '后台', ], - 'value' => '', - 'rule' => '', - 'msg' => '', - 'tip' => '', - 'ok' => '', - 'extend' => '', + 'value' => '', + 'rule' => '', + 'msg' => '', + 'tip' => '', + 'ok' => '', + 'extend' => '', ], ]; diff --git a/application/admin/controller/auth/Admin.php b/application/admin/controller/auth/Admin.php index 85f8fb4..16f46ca 100755 --- a/application/admin/controller/auth/Admin.php +++ b/application/admin/controller/auth/Admin.php @@ -8,6 +8,8 @@ use app\common\controller\Backend; use fast\Random; use fast\Tree; use think\Db; +use think\exception\PDOException; +use think\exception\ValidateException; use think\Validate; /** @@ -294,4 +296,66 @@ class Admin extends Backend $this->dataLimitField = 'id'; return parent::selectpage(); } + + public function areaget(){ + $user_id = request()->get('user_id'); + $data = model('area')->getTree(); + + if ($user_id){ + $user = model('admin')->get($user_id); + $in_areas = explode(',',$user->area_ids ?? ''); + foreach ($data as &$datum){ + if (in_array($datum['id'],$in_areas)){ + $datum['state'] = [ + 'selected' => true + ]; + } + } + + } + + return $data; + } + public function area($ids = null){ + if (false === $this->request->isPost()) { + +// dd($areas); + $this->view->assign('user_id',$ids); +// dd($areas); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { + $params[$this->dataLimitField] = $this->auth->id; + } + $result = false; + // 获取当前ID对应的订单信息 + $user = $this->model->get($ids); + if (!$user) { + $this->error('订单不存在'); + } + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException()->validate($validate); + } + $result = $user->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result === false) { + $this->error(__('No rows were inserted')); + } + $this->success(); + } } diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php index 6908ad6..37d1349 100755 --- a/application/admin/controller/user/User.php +++ b/application/admin/controller/user/User.php @@ -4,6 +4,9 @@ namespace app\admin\controller\user; use app\common\controller\Backend; use app\common\library\Auth; +use think\Db; +use think\exception\PDOException; +use think\exception\ValidateException; /** * 会员管理 diff --git a/application/admin/controller/workers/Worker.php b/application/admin/controller/workers/Worker.php index 5a14ade..160b03b 100644 --- a/application/admin/controller/workers/Worker.php +++ b/application/admin/controller/workers/Worker.php @@ -49,9 +49,7 @@ class Worker extends Backend unset($v['sort']); unset($v['status']); } - $this->tree = $res; - $this->view->assign("tree", $res); } diff --git a/application/admin/model/Area.php b/application/admin/model/Area.php index 89743f0..34c075f 100644 --- a/application/admin/model/Area.php +++ b/application/admin/model/Area.php @@ -2,6 +2,7 @@ namespace app\admin\model; +use fast\Tree; use think\Model; @@ -16,6 +17,41 @@ class Area extends Model return $this->where('area_code','=',$code) ->value('merge_name'); } + + public function getTree(){ + + $res = $this->field(['city_code','code','name','level','province_code']) + ->where('level','<',3) + ->select(); + + +// dd($ruleList); + + foreach ($res as &$v) { + $v = $v->toArray(); + $v['state'] = ['selected' => false]; + if ($v['level'] == 2){ + $v['pid'] = $v['province_code'] ?: 0; + $v['parent'] = $v['province_code'] ?: '#'; + }else{ + $v['pid'] = $v['city_code'] ?: 0; + $v['parent'] = $v['city_code'] ?: '#'; + } + $v['id'] = $v['code']; + $v['text'] = $v['name']; + unset($v['province_code']); + unset($v['city_code']); + unset($v['level']); + unset($v['code']); + } +// dd($res); + Tree::instance()->init($res)->icon = + ['    ', '    ', '    ']; + + $res = Tree::instance()->getTreeList(Tree::instance()->getTreeArray(0)); +// dd($res); + return $res; + } } diff --git a/application/admin/view/auth/admin/area.html b/application/admin/view/auth/admin/area.html new file mode 100644 index 0000000..6a78481 --- /dev/null +++ b/application/admin/view/auth/admin/area.html @@ -0,0 +1,21 @@ +
+ {:token()} +
+ +
+ + + +
+
+
+ + + +
\ No newline at end of file diff --git a/application/admin/view/workers/worker/index.html b/application/admin/view/workers/worker/index.html index a4caafc..f96cc4c 100644 --- a/application/admin/view/workers/worker/index.html +++ b/application/admin/view/workers/worker/index.html @@ -33,24 +33,24 @@ {:__('Recycle bin')}
-
- -
- - -
-
-
- -
- -
-
+ + + + + + + + + + + + + + + + + +
diff --git a/public/assets/js/backend/auth/admin.js b/public/assets/js/backend/auth/admin.js index 0901410..bd690c6 100755 --- a/public/assets/js/backend/auth/admin.js +++ b/public/assets/js/backend/auth/admin.js @@ -1,62 +1,179 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { - - var Controller = { - index: function () { - // 初始化表格参数配置 - Table.api.init({ - extend: { - index_url: 'auth/admin/index', - add_url: 'auth/admin/add', - edit_url: 'auth/admin/edit', - del_url: 'auth/admin/del', - multi_url: 'auth/admin/multi', - } +define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], + function ($, undefined, Backend, Table, Form) { + $.jstree.core.prototype.get_all_checked = function (full) { + var obj = this.get_selected(), i, j; + for (i = 0, j = obj.length; i < j; i++) { + obj = obj.concat(this.get_node(obj[i]).parents); + } + obj = $.grep(obj, function (v, i, a) { + return v != '#'; }); - - var table = $("#table"); - - //在表格内容渲染完成后回调的事件 - table.on('post-body.bs.table', function (e, json) { - $("tbody tr[data-index]", this).each(function () { - if (parseInt($("td:eq(1)", this).text()) == Config.admin.id) { - $("input[type=checkbox]", this).prop("disabled", true); + obj = obj.filter(function (itm, i, a) { + return i == a.indexOf(itm); + }); + return full ? $.map(obj, $.proxy(function (i) { + return this.get_node(i); + }, this)) : obj; + }; + var Controller = { + index: function () { + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'auth/admin/index', + add_url: 'auth/admin/add', + edit_url: 'auth/admin/edit', + del_url: 'auth/admin/del', + multi_url: 'auth/admin/multi', + area_url: 'auth/admin/setArea', } }); - }); - // 初始化表格 - table.bootstrapTable({ - url: $.fn.bootstrapTable.defaults.extend.index_url, - columns: [ - [ - {field: 'state', checkbox: true, }, - {field: 'id', title: 'ID'}, - {field: 'username', title: __('Username')}, - {field: 'nickname', title: __('Nickname')}, - {field: 'groups_text', title: __('Group'), operate:false, formatter: Table.api.formatter.label}, - {field: 'email', title: __('Email')}, - {field: 'mobile', title: __('Mobile')}, - {field: 'status', title: __("Status"), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.status}, - {field: 'logintime', title: __('Login time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) { - if(row.id == Config.admin.id){ - return ''; - } - return Table.api.formatter.operate.call(this, value, row, index); - }} + var table = $("#table"); + + //在表格内容渲染完成后回调的事件 + table.on('post-body.bs.table', function (e, json) { + $("tbody tr[data-index]", this).each(function () { + if (parseInt($("td:eq(1)", this).text()) == Config.admin.id) { + $("input[type=checkbox]", this).prop("disabled", true); + } + }); + }); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + columns: [ + [ + {field: 'state', checkbox: true,}, + {field: 'id', title: 'ID'}, + {field: 'username', title: __('Username')}, + {field: 'nickname', title: __('Nickname')}, + { + field: 'groups_text', + title: __('Group'), + operate: false, + formatter: Table.api.formatter.label + }, + {field: 'email', title: __('Email')}, + {field: 'mobile', title: __('Mobile')}, + { + field: 'status', + title: __("Status"), + searchList: {"normal": __('Normal'), "hidden": __('Hidden')}, + formatter: Table.api.formatter.status + }, + { + field: 'logintime', + title: __('Login time'), + formatter: Table.api.formatter.datetime, + operate: 'RANGE', + addclass: 'datetimerange', + sortable: true + }, + { + field: 'operate', title: __('Operate'), table: table, + events: Table.api.events.operate, formatter: function (value, row, index) { + if (row.id == Config.admin.id) { + return ''; + } + return Table.api.formatter.operate.call(this, value, row, index); + }, + buttons: [ + { + name: "setArea", + text: "配置管理区域", + title: "区域", + url: 'auth/admin/area', + extend: 'data-toggle="tooltip" data-container="body"', + classname: 'btn btn-xs btn-warning btn-dialog', + //classname:"btn-view btn-dialog", + icon: 'fa fa-add', + refresh: true, + }, + ], + } + ] ] - ] - }); + }); - // 为表格绑定事件 - Table.api.bindevent(table); - }, - add: function () { - Form.api.bindevent($("form[role=form]")); - }, - edit: function () { - Form.api.bindevent($("form[role=form]")); - } - }; - return Controller; -}); + // 为表格绑定事件 + Table.api.bindevent(table); + }, + add: function () { + Form.api.bindevent($("form[role=form]")); + }, + edit: function () { + Form.api.bindevent($("form[role=form]")); + }, + area: function () { + Form.api.bindevent($("form[role=form]"), null, null, function () { + if ($("#treeview").length > 0) { + var r = $("#treeview").jstree("get_all_checked"); + $("input[name='row[area_ids]']").val(r.join(',')); + } + return true; + }); + //渲染权限节点树 + //销毁已有的节点树 + $("#treeview").jstree("destroy"); + + $.ajax({ + url: "auth/admin/areaget", // 你的 API 地址 + type: "GET", + dataType: "json", + data: { + user_id:$('#user_id').val() + }, + success: function (data) { + // console.log(data); + Controller.api.rendertree(data); + }, + error: function () { + console.error("请求失败"); + } + }); + + + //全选和展开 + $(document).on("click", "#checkall", function () { + $("#treeview").jstree($(this).prop("checked") ? "check_all" : "uncheck_all"); + }); + $(document).on("click", "#expandall", function () { + $("#treeview").jstree($(this).prop("checked") ? "open_all" : "close_all"); + }); + $("select[name='row[pid]']").trigger("change"); + }, + api: { + rendertree: function (content) { + $("#treeview") + .on('redraw.jstree', function (e) { + $(".layer-footer").attr("domrefresh", Math.random()); + }) + .jstree({ + "themes": {"stripes": true}, + "checkbox": { + "keep_selected_style": false, + }, + "types": { + "root": { + "icon": "fa fa-folder-open", + }, + "menu": { + "icon": "fa fa-folder-open", + }, + "file": { + "icon": "fa fa-file-o", + } + }, + "plugins": ["checkbox", "types"], + "core": { + 'check_callback': true, + "data": content + } + }); + } + } + }; + return Controller; + }); diff --git a/public/assets/js/backend/user/rule.js b/public/assets/js/backend/user/rule.js index 0ba2e80..01dfce9 100755 --- a/public/assets/js/backend/user/rule.js +++ b/public/assets/js/backend/user/rule.js @@ -35,7 +35,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'updatetime', title: __('Updatetime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true, visible: false}, {field: 'weigh', title: __('Weigh')}, {field: 'status', title: __('Status'), formatter: Table.api.formatter.status}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'operate', title: __('Operate'), + table: table, events: Table.api.events.operate, + formatter: Table.api.formatter.operate, + } ] ], pagination: false, diff --git a/public/assets/js/backend/user/user.js b/public/assets/js/backend/user/user.js index 1ee1a74..ba871f1 100755 --- a/public/assets/js/backend/user/user.js +++ b/public/assets/js/backend/user/user.js @@ -43,7 +43,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin {field: 'jointime', title: __('Jointime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, {field: 'joinip', title: __('Joinip'), formatter: Table.api.formatter.search}, {field: 'status', title: __('Status'), formatter: Table.api.formatter.status, searchList: {normal: __('Normal'), hidden: __('Hidden')}}, - {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} + {field: 'operate', title: __('Operate'), table: table, + events: Table.api.events.operate, + formatter: Table.api.formatter.operate, + } ] ] }); diff --git a/public/assets/js/backend/workers/worker.js b/public/assets/js/backend/workers/worker.js index 177add3..8a8abfa 100644 --- a/public/assets/js/backend/workers/worker.js +++ b/public/assets/js/backend/workers/worker.js @@ -1,4 +1,5 @@ -define(['jquery', 'bootstrap', 'backend', 'table', 'form','jstree'], function ($, undefined, Backend, Table, Form) { +define(['jquery', 'bootstrap', 'backend', 'table', 'form','jstree'], + function ($, undefined, Backend, Table, Form) { $.jstree.core.prototype.get_all_checked = function (full) { var obj = this.get_selected(), i, j; for (i = 0, j = obj.length; i < j; i++) {