diff --git a/lib/layui/lay/okmodules/okMock.js b/lib/layui/lay/okmodules/okMock.js index c647428..c4ec046 100644 --- a/lib/layui/lay/okmodules/okMock.js +++ b/lib/layui/lay/okmodules/okMock.js @@ -7,6 +7,9 @@ layui.define([], function (exprots) { datatables: "http://rap2api.taobao.org/app/mock/233041/datatables", listUser: "http://rap2api.taobao.org/app/mock/233041/user/listUser", listRole: "http://rap2api.taobao.org/app/mock/233041/role/listRole", + listArticle: "http://rap2api.taobao.org/app/mock/233041/article/listArticle", + listMessage: "http://rap2api.taobao.org/app/mock/233041/message/listMessage", + listBbs: "http://rap2api.taobao.org/app/mock/233041/bbs/listBbs", menu: { diff --git a/lib/layui/lay/okmodules/okUtils.js b/lib/layui/lay/okmodules/okUtils.js index 1eb46fe..7d02079 100644 --- a/lib/layui/lay/okmodules/okUtils.js +++ b/lib/layui/lay/okmodules/okUtils.js @@ -48,7 +48,7 @@ layui.define(["layer"], function (exprots) { dataType: "json", beforeSend: function () { if (load) { - loadIndex = layer.load(0, {shade: false}); + loadIndex = layer.load(0, {shade: 0.3}); } }, success: function (data) { diff --git a/pages/member/user.html b/pages/member/user.html index 8073de2..4444ca6 100644 --- a/pages/member/user.html +++ b/pages/member/user.html @@ -57,8 +57,9 @@ {field: "province", title: "省份", width: 120}, {field: "city", title: "城市", width: 100}, {field: "county", title: "区县", width: 120}, - {field: "createTime", title: "创建时间", width: 150}, {field: "logins", title: "登陆次数", width: 100}, + {field: "createTime", title: "创建时间", width: 150}, + {field: "updateTime", title: "更新时间", width: 150}, {title: "操作", width: 100, align: "center", fixed: "right", templet: "#operationTpl"} ]], done: function (res, curr, count) { diff --git a/pages/often/article-add.html b/pages/often/article-add.html index 1c59051..3f33625 100644 --- a/pages/often/article-add.html +++ b/pages/often/article-add.html @@ -1,104 +1,83 @@ - - - 添加文章 - - - - -
- -
- - 首页 - 常用页面 - 用户列表 - 添加文章 - - - - + + + 添加文章 + + + + +
+ +
+
+ +
+ +
- - -
- -
- -
+
+ +
+
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+
+ +
-
-
- - -
-
- -
- - - + - + return false; + }); + }); + + diff --git a/pages/often/article-edit.html b/pages/often/article-edit.html index 6a5bf4c..03d939c 100644 --- a/pages/often/article-edit.html +++ b/pages/often/article-edit.html @@ -1,103 +1,83 @@ - - - 编辑文章 - - - - -
- -
- - 首页 - 常用页面 - 用户列表 - 编辑文章 - - - - + + + 编辑文章 + + + + +
+ +
+
+ +
+ +
- - -
- -
- -
+
+ +
+
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+ +
+
-
- -
- -
+
+
+
+ +
-
-
- - -
-
- -
- - - + - + return false; + }); + }); + + diff --git a/pages/often/article.html b/pages/often/article.html index ca4b943..f2c7f72 100644 --- a/pages/often/article.html +++ b/pages/often/article.html @@ -1,222 +1,213 @@ - - - 文章列表 - - - - -
- - - -
- -
- -
+ + + 文章列表 + + + + +
+ +
+
- - - + - - - - - - - - - - - + } + }); + } + + function batchDisabled() { + okLayer.confirm("确定要批量下架吗?", function (index) { + layer.close(index); + var idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/article/batchStop", "put", {idsStr: idsStr}, true).done(function (response) { + console.log(response); + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error) + }); + } + }); + } + + function batchDel() { + okLayer.confirm("确定要批量删除吗?", function (index) { + layer.close(index); + var idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/article/batchDel", "put", {idsStr: idsStr}, true).done(function (response) { + console.log(response); + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error) + }); + } + }); + } + + function add() { + okLayer.open("添加文章", "article-add.html", "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function edit(id) { + okLayer.open("编辑文章", "article-edit.html?id=" + id, "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function del(id) { + okLayer.confirm("确定要删除吗?", function () { + okUtils.ajax("/article/batchDel", "delete", {idsStr: id}, true).done(function (response) { + console.log(response); + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error) + }); + }) + } + }) + + + + + + + + + + + + diff --git a/pages/often/bbs.html b/pages/often/bbs.html index b622a43..e6041be 100644 --- a/pages/often/bbs.html +++ b/pages/often/bbs.html @@ -1,210 +1,196 @@ - - - 帖子列表 - - - - -
- - - -
- -
- -
+ + + 帖子列表 + + + + +
+ +
+
- - - + - - - - - - - + } + }); + } + + function batchDisabled() { + okLayer.confirm("确定要批量下架吗?", function (index) { + layer.close(index); + let idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/bbs/update-bbs-status", "put", {idsStr: idsStr}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error) + }); + } + }); + } + + function batchDel() { + okLayer.confirm("确定要批量删除吗?", function (index) { + layer.close(index); + let idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/bbs/deleteBbs", "delete", {idsStr: idsStr}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + } + }); + } + + function add() { + okLayer.open("添加帖子", "bbs-add.html", "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function edit(id) { + okLayer.open("编辑帖子", "bbs-edit.html?id=" + id, "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function del(id) { + okLayer.confirm("确定要删除吗?", function () { + okUtils.ajax("/bbs/deleteBbs", "delete", {idsStr: id}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + }) + } + }) + + + + + + + + diff --git a/pages/often/message.html b/pages/often/message.html index 88537d7..4758be4 100644 --- a/pages/often/message.html +++ b/pages/often/message.html @@ -1,210 +1,148 @@ - - - 留言列表 - - - - -
- - - -
- -
- -
+ + + 留言列表 + + + + +
+ +
+
- - - + - - - - - - - - - - + } + }); + } + + function updateById(id) { + okLayer.open("编辑留言", "message-edit.html?id=" + id, "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function deleteById(id) { + okLayer.confirm("确定要删除吗?", function () { + okUtils.ajax("/message/deleteMessage", "delete", {idsStr: id}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + }) + } + }); + + + + + + + + + +