Browse Source

文章设置批量设置栏目

XMTT 7 years ago
parent
commit
35bce0c6f4

+ 1 - 1
css/model/sys/article.css

11
    table-layout: fixed;
11
    table-layout: fixed;
12
}
12
}
13
13
14
.sys_article_index .orderBy .icon-close, .sys_article_colnum .banner .icon-close {
14
.sys_article_index .orderBy .icon-close {
15
    display: none;
15
    display: none;
16
}
16
}
17
17

+ 1 - 1
html/model/sys/article/index.html

1
<div class="sys_article_index" loadUri="../ajax/article/pq" pageSize="10" pageNo="1" pageIndex="pi">
1
<div class="sys_article_index" loadUri="../ajax/article/pq" pageSize="20" pageNo="1" pageIndex="pi">
2
    <div class="modal-ctrl">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
3
        <i class="icon icon-times"></i>
4
    </div>
4
    </div>

+ 1 - 2
js/model/sys/article/colnum.js

8
            modal: function (data) {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_article_colnum");
9
                var root = spa.findInModal(".sys_article_colnum");
10
                var form = fb.build(root.find(".newForm"));
10
                var form = fb.build(root.find(".newForm"));
11
                form.val({colNum: data.data.colNum, id: data.data.id});
12
                var saveBtn = root.find(".opt-save"),
11
                var saveBtn = root.find(".opt-save"),
13
                    save = function () {
12
                    save = function () {
14
                        util.post("../ajax/article/colNum", {
13
                        util.post("../ajax/article/colNum", {
15
                            articleId: data.data.articleId,
14
                            articleIds: data.data,
16
                            colNum: form.val().colNum
15
                            colNum: form.val().colNum
17
                        }, function () {
16
                        }, function () {
18
                            spa.closeModal();
17
                            spa.closeModal();

+ 15 - 11
js/model/sys/article/index.js

97
                        util.alert("请选择一篇文章");
97
                        util.alert("请选择一篇文章");
98
                    }
98
                    }
99
                });
99
                });
100
                root.find(".opt-col-num").on("click", function() {
100
                root.find(".opt-col-num").on("click", function () {
101
                    var $article = root.find("td.opt-check>i.checked");
101
                    var $article = root.find("td.opt-check>i.checked");
102
                    if($article.length) {
103
                        if($article.length > 1) {
104
                            util.alert("只能选择一篇文章");
105
                        } else {
106
                            $.util.get("../ajax/article/id/"+$article.attr("articleId"),null,function(rd){
107
                                if(rd){
108
                                    spa.showModal("sys_article_colnum", { data:rd, hand: function() { pdg.reload() } })
109
                                }else{
110
                                    util.alertMsg("文章不存在", function(){pdg.load();});
102
                    if ($article.length) {
103
                        var articles = [];
104
                        $article.each(function () {
105
                            articles.push($(this).attr("articleId"));
106
                        });
107
                        if (articles) {
108
                            spa.showModal("sys_article_colnum", {
109
                                data: articles, hand: function () {
110
                                    pdg.reload();
111
                                }
111
                                }
112
                            },{});
112
                            });
113
                        } else {
114
                            util.alertMsg("文章不存在", function () {
115
                                pdg.load();
116
                            });
113
                        }
117
                        }
114
                    } else {
118
                    } else {
115
                        util.alert("请选择一篇文章");
119
                        util.alert("请选择一篇文章");