From 16b0065bc32234d940b7204b8130cb140355f5c0 Mon Sep 17 00:00:00 2001 From: bobi1234 Date: Fri, 3 Aug 2018 12:18:42 +0800 Subject: [PATCH] =?UTF-8?q?article=E7=9B=B8=E5=85=B3=E6=B7=BB=E5=8A=A0js?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- article-add.html | 169 +++++++++++----------- article-edit.html | 127 ++++++++-------- article.html | 360 ++++++++++++++++++++++++++-------------------- data/article.json | 2 +- 4 files changed, 355 insertions(+), 303 deletions(-) diff --git a/article-add.html b/article-add.html index 8a196f2..6a90c65 100644 --- a/article-add.html +++ b/article-add.html @@ -10,96 +10,97 @@ -
- -
+
+ + - -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- - -
-
-
+ + +
- - - + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+
+
+
+ + + \ No newline at end of file diff --git a/article-edit.html b/article-edit.html index 8c1bef4..0df1bae 100644 --- a/article-edit.html +++ b/article-edit.html @@ -1,78 +1,78 @@ - - 编辑文章 - - - - - + + 编辑文章 + + + + +
- -
+ + - -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- - -
-
-
+ + + +
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + +
+
+
@@ -94,6 +94,7 @@ }); form.on('submit(edit)', function (data) { + console.log(data.field); layer.msg("编辑成功!", {icon: 6, time: 1000, anim: 4}, function () { parent.layer.close(parent.layer.getFrameIndex(window.name)); }); diff --git a/article.html b/article.html index ff2c91f..50535b8 100644 --- a/article.html +++ b/article.html @@ -8,177 +8,227 @@ - + -
- -
+
+ + - -
- -
- - - - - - - 共有数据: - - -
+ + +
- - - - + + - - - - - + + $("#batchDisabled").click(function () { + layer.confirm("确定要批量下架吗?", {skin: 'layui-layer-lan', icon: 3, title: '提示', anim: 2}, function () { + var checkStatus = table.checkStatus('tableId'); + var rows = checkStatus.data.length; + if (rows > 0) { + var idsStr = ""; + for (var i = 0; i < checkStatus.data.length; i++) { + idsStr += checkStatus.data[i].id + ','; + } + console.log("选择的id-->" + idsStr); + layer.msg("操作成功!", {icon: 1, time: 1000}, function () { + $(".layui-laypage-btn")[0].click(); + }); + } else { + layer.msg('未选择有效数据', { + offset: 't', + anim: 6 + }); + } + }); + }) + + $("#batchDel").click(function () { + layer.confirm("确定要批量删除吗?", {skin: 'layui-layer-lan', icon: 2, title: '提示', anim: 6}, function () { + var checkStatus = table.checkStatus('tableId'); + var rows = checkStatus.data.length; + if (rows > 0) { + var idsStr = ""; + for (var i = 0; i < checkStatus.data.length; i++) { + idsStr += checkStatus.data[i].id + ','; + } + console.log("选择的id-->" + idsStr); + layer.msg("操作成功!", {icon: 1, time: 1000}, function () { + $(".layui-laypage-btn")[0].click(); + }); + } else { + layer.msg('未选择有效数据', { + offset: 't', + anim: 6 + }); + } + }); + }) + + $("#addUser").click(function () { + layer.open({ + title: '添加文章', + type: 2, + shade: false, + maxmin: true, + shade: 0.5, + anim: 4, + area: ['90%', '90%'], + content: 'article-add.html', + zIndex: layer.zIndex, + // skin: 'layui-layer-molv', + end: function () { + $(".layui-laypage-btn")[0].click(); + } + }); + }) + }) + + + + + + \ No newline at end of file diff --git a/data/article.json b/data/article.json index 57be335..eac2864 100644 --- a/data/article.json +++ b/data/article.json @@ -1,7 +1,7 @@ { "code": 0, "msg": "", - "count": 11, + "count": 2, "data": [ { "id": "001",