diff --git a/lib/layui/lay/okmodules/okMock.js b/lib/layui/lay/okmodules/okMock.js index c4ec046..5b2ee68 100644 --- a/lib/layui/lay/okmodules/okMock.js +++ b/lib/layui/lay/okmodules/okMock.js @@ -9,6 +9,11 @@ layui.define([], function (exprots) { 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", + listProduct: "http://rap2api.taobao.org/app/mock/233041/product/listProduct", + listDownload: "http://rap2api.taobao.org/app/mock/233041/download/listDownload", + listLink: "http://rap2api.taobao.org/app/mock/233041/link/listLink", + listTask: "http://rap2api.taobao.org/app/mock/233041/task/listTask", + listImage: "http://rap2api.taobao.org/app/mock/233041/image/listImage", listBbs: "http://rap2api.taobao.org/app/mock/233041/bbs/listBbs", diff --git a/pages/often/download.html b/pages/often/download.html index b6f38b0..6d76975 100644 --- a/pages/often/download.html +++ b/pages/often/download.html @@ -1,222 +1,208 @@ - - - 下载列表 - - - - -
- -
- - 首页 - 常用页面 - 下载列表 - - - - -
- -
- -
- -
+ + + 下载列表 + + + + +
+ +
+
- - - + - - - - - - - - - - - - + } + }); + } + + function batchDisabled() { + okLayer.confirm("确定要批量下架吗?", function (index) { + layer.close(index); + let idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/download/update-download-status", "put", {idsStr: idsStr}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + } + }); + } + + function batchDelete() { + okLayer.confirm("确定要批量删除吗?", function (index) { + layer.close(index); + let idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/download/deleteDownload", "delete", {idsStr: idsStr}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + } + }); + } + + function add() { + okLayer.open("添加文章", "download-add.html", "90%", "90%", null, function () { + articleTable.reload(); + }); + } + + function updateById(id) { + okLayer.open("编辑文章", "download-edit.html?id=" + id, "90%", "90%", null, function () { + articleTable.reload(); + }); + } + + function deleteById(id) { + okLayer.confirm("确定要删除吗?", function () { + okUtils.ajax("/download/deleteDownload", "delete", {idsStr: id}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + }); + } + }) + + + + + + + + + + + + diff --git a/pages/often/image.html b/pages/often/image.html index ff051f0..634a3e3 100644 --- a/pages/often/image.html +++ b/pages/often/image.html @@ -1,222 +1,203 @@ - - - 图片列表 - - - - -
- - - -
- -
- -
+ + + 图片列表 + + + + +
+ +
+
- - - + - - - - - - + + + + + - - + - - - + {{# } }} + + + + diff --git a/pages/often/link.html b/pages/often/link.html index 3c72fda..ade2626 100644 --- a/pages/often/link.html +++ b/pages/often/link.html @@ -1,213 +1,161 @@ - - - 链接列表 - - - - -
- - - -
- -
- -
+ + + 链接列表 + + + + +
+ +
+
- - - + - - - - - - - - - - - + } + }); + } + + function add() { + okLayer.open("添加连接", "link-add.html", "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function updateById(id) { + okLayer.open("编辑连接", "link-edit.html?id=" + id, "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function deleteById(id) { + okLayer.confirm("确定要删除吗?", function () { + okUtils.ajax("/link/deleteLink", "delete", {idsStr: id}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + }) + } + }) + + + + + + + + + + diff --git a/pages/often/product.html b/pages/often/product.html index cd836b4..adc8c6c 100644 --- a/pages/often/product.html +++ b/pages/often/product.html @@ -1,205 +1,191 @@ - - - 产品列表 - - - - -
- - - -
- -
- -
+ + + 产品列表 + + + + +
+ +
+
- - - + - - - - + } + }); + } - + function batchDisabled() { + okLayer.confirm("确定要批量下架吗?", function (index) { + layer.close(index); + let idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/product/update-product-status", "put", {idsStr: idsStr}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + } + }); + } - - + function batchDelete() { + okLayer.confirm("确定要批量删除吗?", function (index) { + layer.close(index); + let idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/product/deleteProduct", "delete", {idsStr: idsStr}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + } + }); + } + + function add() { + okLayer.open("添加产品", "product-add.html", "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function updateById(id) { + okLayer.open("编辑产品", "product-edit.html?id=" + id, "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function deleteById(id) { + okLayer.confirm("确定要删除吗?", function () { + okUtils.ajax("/product/deleteProduct", "delete", {idsStr: id}).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + }) + } + }) + + + + + + + + + + diff --git a/pages/often/task.html b/pages/often/task.html index 500c43f..8c02c7c 100644 --- a/pages/often/task.html +++ b/pages/often/task.html @@ -1,217 +1,202 @@ - - - 任务列表 - - - - -
- - - -
- -
- -
+ + + 任务列表 + + + + +
+ +
+
- - - + - - - - - - - - - + } + }); + } + + function batchEnd() { + okLayer.confirm("确定要批量结束吗?", function (index) { + layer.close(index); + let idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/task/update-task-status", "put", {idsStr: idsStr}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + } + }); + } + + function batchDelete() { + okLayer.confirm("确定要批量删除吗?", function (index) { + layer.close(index); + let idsStr = okUtils.tableBatchCheck(table); + if (idsStr) { + okUtils.ajax("/task/deleteTask", "delete", {idsStr: idsStr}, true).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + } + }); + } + + function add() { + okLayer.open("添加任务", "task-add.html", "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function updateById(id) { + okLayer.open("编辑任务", "task-edit.html?id=" + id, "90%", "90%", null, function () { + articleTable.reload(); + }) + } + + function deleteById(id) { + okLayer.confirm("确定要删除吗?", function () { + okUtils.ajax("/task/deleteTask", "delete", {idsStr: id}).done(function (response) { + okUtils.tableSuccessMsg(response.msg); + }).fail(function (error) { + console.log(error); + }); + }) + } + }) + + + + + + + + + +