diff --git a/app/controller/admin/Client.php b/app/controller/admin/Client.php index 041c85b5..fbe2ecaf 100644 --- a/app/controller/admin/Client.php +++ b/app/controller/admin/Client.php @@ -19,14 +19,14 @@ class Client extends Admin{ * @title 系统首页 */ public function index(ClientModel $client){ - $res = $client->paginate(25, false, array( - 'query' => $this->request->param() - )); - - $data['list'] = $res; - $data['page'] = $res->render(); - $this->data['data'] = $data; - return $this->data; + if ($this->request->isAjax()) { + $res = $client->paginate(25, false, array( + 'query' => $this->request->param() + )); + $data = $res->toArray(); + $this->data['data'] = $data; + return $this->data; + } } /** diff --git a/app/controller/admin/Menu.php b/app/controller/admin/Menu.php index 9ab4b58a..f02f6b99 100644 --- a/app/controller/admin/Menu.php +++ b/app/controller/admin/Menu.php @@ -26,4 +26,46 @@ class Menu extends Admin{ return $this->data; } } + + /** + * @title 编辑菜单 + */ + public function edit(){ + if($this->request->isAjax()){ + $menu = new MenuModel(); + + $res = $menu->select(); + + $this->data['data'] = $res; + return $this->data; + } + } + + /** + * @title 添加菜单 + */ + public function add(){ + if($this->request->isAjax()){ + $menu = new MenuModel(); + + $res = $menu->select(); + + $this->data['data'] = $res; + return $this->data; + } + } + + /** + * @title 移除菜单 + */ + public function remove(){ + if($this->request->isAjax()){ + $menu = new MenuModel(); + + $res = $menu->select(); + + $this->data['data'] = $res; + return $this->data; + } + } } \ No newline at end of file diff --git a/public/static/admin/js/app.js b/public/static/admin/js/app.js index 79acfbd4..e69de29b 100644 --- a/public/static/admin/js/app.js +++ b/public/static/admin/js/app.js @@ -1,172 +0,0 @@ -$(function () { - 'use strict' - - /** - * List of all the available skins - * - * @type Array - */ - var mySkins = [ - 'skin-blue', - 'skin-black', - 'skin-red', - 'skin-yellow', - 'skin-purple', - 'skin-green', - 'skin-blue-light', - 'skin-black-light', - 'skin-red-light', - 'skin-yellow-light', - 'skin-purple-light', - 'skin-green-light' - ] - - var $skinsList = $('
蓝黑
') - $skinsList.append($skinBlue) - var $skinBlack = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '白黑
') - $skinsList.append($skinBlack) - var $skinPurple = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '紫黑
') - $skinsList.append($skinPurple) - var $skinGreen = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '绿黑
') - $skinsList.append($skinGreen) - var $skinRed = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '红黑
') - $skinsList.append($skinRed) - var $skinYellow = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '黄黑
') - $skinsList.append($skinYellow) - - // Light sidebar skins - var $skinBlueLight = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '亮蓝
') - $skinsList.append($skinBlueLight) - var $skinBlackLight = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '亮
') - $skinsList.append($skinBlackLight) - var $skinPurpleLight = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '亮紫
') - $skinsList.append($skinPurpleLight) - var $skinGreenLight = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '亮绿
') - $skinsList.append($skinGreenLight) - var $skinRedLight = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '亮红
') - $skinsList.append($skinRedLight) - var $skinYellowLight = - $('', {style: 'float:left; width: 33.33333%; padding: 5px;'}) - .append('' - + '亮黄
') - $skinsList.append($skinYellowLight) - - $('[data-skin-box] > .content').append($skinsList); - - setup(); - - /** - * Replaces the old skin with the new skin - * @param String cls the new skin class - * @returns Boolean false to prevent link's default action - */ - function changeSkin(cls) { - $.each(mySkins, function (i) { - $('body').removeClass(mySkins[i]) - }) - - $('body').addClass(cls) - store('skin', cls) - return false - } - - /** - * Retrieve default settings and apply them to the template - * - * @returns void - */ - function setup() { - var tmp = get('skin') || 'skin-blue'; - if (tmp && $.inArray(tmp, mySkins) >= 0){ - changeSkin(tmp) - } - - // Add the change skin listener - $('[data-skin]').on('click', function (e) { - if ($(this).hasClass('knob')) - return - e.preventDefault() - changeSkin($(this).data('skin')) - }) - - $('[data-toggle="control-sidebar"]').click(function(){ - $("[data-skin-box]").animate({right:"0"}, 500); - }) - - $('.tool-bar').click(function(){ - $("[data-skin-box]").animate({right:"-320px"}, 500); - }) - } -}) \ No newline at end of file diff --git a/view/admin/base.html b/view/admin/base.html index da520a65..7e5ca659 100644 --- a/view/admin/base.html +++ b/view/admin/base.html @@ -12,11 +12,18 @@ - + - + + + + + + + + @@ -48,13 +55,6 @@ folder instead of downloading all of them to reduce the load. --> - - - - - - - diff --git a/view/admin/client/index.html b/view/admin/client/index.html index 447c35da..fd5dc5a2 100644 --- a/view/admin/client/index.html +++ b/view/admin/client/index.html @@ -4,50 +4,84 @@
-