From dd9fbd85fd0326c0966405b21722987c513bac67 Mon Sep 17 00:00:00 2001 From: molong Date: Sun, 1 Sep 2019 15:45:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0UI=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/admin/Client.php | 16 +-- app/controller/admin/Menu.php | 42 +++++++ public/static/admin/js/app.js | 172 ---------------------------- view/admin/base.html | 18 +-- view/admin/client/index.html | 106 ++++++++++++------ view/admin/index/clear.html | 22 ++-- view/admin/index/index.html | 36 +++++- view/admin/index/login.html | 4 +- view/admin/menu/index.html | 191 ++++++++++++++------------------ 9 files changed, 251 insertions(+), 356 deletions(-) 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 = $('