Browse Source

资源管理、论文管理、专利管理

XMTT 7 years ago
parent
commit
b0c3009a06

+ 29 - 0
css/model/sys/paper.css

@ -0,0 +1,29 @@
1
@charset "utf-8";
2
.sys_paper_index .tpl-btns .row {
3
    padding-left: 10px;
4
}
5
.sys_paper_index th.opt-check {
6
    width: 35px;
7
}
8
9
.sys_paper_index .table {
10
    table-layout: fixed;
11
}
12
13
.sys_paper_index .orderBy .icon-close{
14
    display: none;
15
}
16
17
.sys_paper_index .number {
18
    width: 4%;
19
}
20
21
.sys_paper_sort {
22
    width: 600px;
23
    height: 200px;
24
}
25
26
.sys_paper_sort .content{
27
    font-size: 25px;
28
    font-weight: bold;
29
}

+ 29 - 0
css/model/sys/patent.css

@ -0,0 +1,29 @@
1
@charset "utf-8";
2
.sys_patent_index .tpl-btns .row {
3
    padding-left: 10px;
4
}
5
.sys_patent_index th.opt-check {
6
    width: 35px;
7
}
8
9
.sys_patent_index .table {
10
    table-layout: fixed;
11
}
12
13
.sys_patent_index .orderBy .icon-close{
14
    display: none;
15
}
16
17
.sys_patent_index .number {
18
    width: 4%;
19
}
20
21
.sys_patent_sort {
22
    width: 600px;
23
    height: 200px;
24
}
25
26
.sys_patent_sort .content{
27
    font-size: 25px;
28
    font-weight: bold;
29
}

+ 29 - 0
css/model/sys/resourceinfo.css

@ -0,0 +1,29 @@
1
@charset "utf-8";
2
.sys_resourceinfo_index .tpl-btns .row {
3
    padding-left: 10px;
4
}
5
.sys_resourceinfo_index th.opt-check {
6
    width: 35px;
7
}
8
9
.sys_resourceinfo_index .table {
10
    table-layout: fixed;
11
}
12
13
.sys_resourceinfo_index .orderBy .icon-close{
14
    display: none;
15
}
16
17
.sys_resourceinfo_index .number {
18
    width: 4%;
19
}
20
21
.sys_resourceinfo_sort {
22
    width: 600px;
23
    height: 200px;
24
}
25
26
.sys_resourceinfo_sort .content{
27
    font-size: 25px;
28
    font-weight: bold;
29
}

+ 95 - 0
html/model/sys/paper/index.html

@ -0,0 +1,95 @@
1
<div class="sys_paper_index" loadUri="../ajax/paper/pq" pageSize="10" pageNo="1" pageIndex="pi">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container dt-form">
6
        <div class="row">
7
            <div class="col-1"></div>
8
            <div class="col-1 item-caption ">名称</div>
9
            <div class="col-5">
10
                <div class="form-item text" defVal="" name="title"></div>
11
            </div>
12
            <div class="col-1 item-caption">发布者</div>
13
            <div class="col-2">
14
                <div class="form-item text" defVal="" name="name"></div>
15
            </div>
16
        </div>
17
        <div class="row">
18
            <div class="col-1"></div>
19
            <div class="col-1 item-caption ">发布时间</div>
20
            <div class="col-2">
21
                <div class="form-item date" defVal="" name="bt"></div>
22
            </div>
23
            <div class="col-1 item-caption center">至</div>
24
            <div class="col-2">
25
                <div class="form-item date" defVal="" name="et"></div>
26
            </div>
27
            <div class="col-1 item-caption ">排序方式</div>
28
            <div class="col-2">
29
                <div class="form-item select orderBy" dictCode="sort_rule" defVal="1" name="orderBy"></div>
30
            </div>
31
        </div>
32
        <div class="row">
33
            <div class="col-8">
34
            </div>
35
            <div class="col-2">
36
                <div class="btn opt-query pull-right">
37
                    <i class="icon-search"></i> 查询
38
                </div>
39
            </div>
40
            <div class="col-2"></div>
41
42
        </div>
43
    </div>
44
45
    <div class="container page-split"></div>
46
    <div class="container tpl-btns">
47
        <div class="row">
48
            <div class="btn opt-view">
49
                查看
50
            </div>
51
            <div class="btn opt-sort-num">
52
                设置权重
53
            </div>
54
            <!--<div class="btn opt-del">-->
55
                <!--删除-->
56
            <!--</div>-->
57
        </div>
58
    </div>
59
    <div class="container dt-tpl">
60
        <table class="table table-bordered">
61
            <thead>
62
            <tr>
63
                <th class="opt-check" ><i class="icon icon-st-check"></i> </th>
64
                <th class="number">序号</th>
65
                <th>专利名称</th>
66
                <th>发明人</th>
67
                <th>关键词</th>
68
                <th>发布时间</th>
69
                <th class="number">权重</th>
70
                <th class="number">浏览量</th>
71
                <th class="number">收藏量</th>
72
            </tr>
73
            </thead>
74
            <tbody>
75
            <tr ch-dir="list">
76
                <td class="opt-check" ><i class="icon icon-st-check" paperId="{{id}}"></i></td>
77
                <td>{{pi}}</td>
78
                <td>{{name}}</td>
79
                <td>{{authors}}</td>
80
                <td>{{keywords}}</td>
81
                <td>{{createTime-showDay}}</td>
82
                <td>{{sortNum}}</td>
83
                <td>{{pageViews}}</td>
84
                <td class="hand-collectionid" collectionid="{{id}}"></td>
85
            </tr>
86
            </tbody>
87
            <tbody ch-dir="array.empty">
88
            <tr>
89
                <td class="empty-desc" colspan="9">表格暂无数据</td>
90
            </tr>
91
            </tbody>
92
        </table>
93
    </div>
94
    <ul class="dt-pager"></ul>
95
</div>

+ 28 - 0
html/model/sys/paper/sort.html

@ -0,0 +1,28 @@
1
<div class="sys_paper_sort centerModal">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container newForm">
6
        <div class="row">
7
            <div class="col-2"></div>
8
            <div class="col-4 item-caption content ">设置权重</div>
9
10
        </div>
11
        <div class="row">
12
            <div class="col-2 item-caption">权重值</div>
13
            <div class="col-6">
14
                <div class="form-item text" defVal="" name="sortNum"></div>
15
            </div>
16
        </div>
17
18
        <div class="row">
19
            <div class="col-10"></div>
20
            <div class="col-2">
21
                <div class="btn pull-right opt-save">
22
                    <i class="icon-check"></i> SAVE
23
                </div>
24
            </div>
25
        </div>
26
27
    </div>
28
</div>

+ 95 - 0
html/model/sys/patent/index.html

@ -0,0 +1,95 @@
1
<div class="sys_patent_index" loadUri="../ajax/patent/pq" pageSize="10" pageNo="1" pageIndex="pi">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container dt-form">
6
        <div class="row">
7
            <div class="col-1"></div>
8
            <div class="col-1 item-caption ">名称</div>
9
            <div class="col-5">
10
                <div class="form-item text" defVal="" name="title"></div>
11
            </div>
12
            <div class="col-1 item-caption">发布者</div>
13
            <div class="col-2">
14
                <div class="form-item text" defVal="" name="name"></div>
15
            </div>
16
        </div>
17
        <div class="row">
18
            <div class="col-1"></div>
19
            <div class="col-1 item-caption ">发布时间</div>
20
            <div class="col-2">
21
                <div class="form-item date" defVal="" name="bt"></div>
22
            </div>
23
            <div class="col-1 item-caption center">至</div>
24
            <div class="col-2">
25
                <div class="form-item date" defVal="" name="et"></div>
26
            </div>
27
            <div class="col-1 item-caption ">排序方式</div>
28
            <div class="col-2">
29
                <div class="form-item select orderBy" dictCode="sort_rule" defVal="1" name="orderBy"></div>
30
            </div>
31
        </div>
32
        <div class="row">
33
            <div class="col-8">
34
            </div>
35
            <div class="col-2">
36
                <div class="btn opt-query pull-right">
37
                    <i class="icon-search"></i> 查询
38
                </div>
39
            </div>
40
            <div class="col-2"></div>
41
42
        </div>
43
    </div>
44
45
    <div class="container page-split"></div>
46
    <div class="container tpl-btns">
47
        <div class="row">
48
            <div class="btn opt-view">
49
                查看
50
            </div>
51
            <div class="btn opt-sort-num">
52
                设置权重
53
            </div>
54
            <!--<div class="btn opt-del">-->
55
                <!--删除-->
56
            <!--</div>-->
57
        </div>
58
    </div>
59
    <div class="container dt-tpl">
60
        <table class="table table-bordered">
61
            <thead>
62
            <tr>
63
                <th class="opt-check" ><i class="icon icon-st-check"></i> </th>
64
                <th class="number">序号</th>
65
                <th>专利名称</th>
66
                <th>发明人</th>
67
                <th>关键词</th>
68
                <th>发布时间</th>
69
                <th class="number">权重</th>
70
                <th class="number">浏览量</th>
71
                <th class="number">收藏量</th>
72
            </tr>
73
            </thead>
74
            <tbody>
75
            <tr ch-dir="list">
76
                <td class="opt-check" ><i class="icon icon-st-check" patentId="{{id}}"></i></td>
77
                <td>{{pi}}</td>
78
                <td>{{name}}</td>
79
                <td>{{authors}}</td>
80
                <td>{{keywords}}</td>
81
                <td>{{createTime-showDay}}</td>
82
                <td>{{sortNum}}</td>
83
                <td>{{pageViews}}</td>
84
                <td class="hand-collectionid" collectionid="{{id}}"></td>
85
            </tr>
86
            </tbody>
87
            <tbody ch-dir="array.empty">
88
            <tr>
89
                <td class="empty-desc" colspan="9">表格暂无数据</td>
90
            </tr>
91
            </tbody>
92
        </table>
93
    </div>
94
    <ul class="dt-pager"></ul>
95
</div>

+ 28 - 0
html/model/sys/patent/sort.html

@ -0,0 +1,28 @@
1
<div class="sys_patent_sort centerModal">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container newForm">
6
        <div class="row">
7
            <div class="col-2"></div>
8
            <div class="col-4 item-caption content ">设置权重</div>
9
10
        </div>
11
        <div class="row">
12
            <div class="col-2 item-caption">权重值</div>
13
            <div class="col-6">
14
                <div class="form-item text" defVal="" name="sortNum"></div>
15
            </div>
16
        </div>
17
18
        <div class="row">
19
            <div class="col-10"></div>
20
            <div class="col-2">
21
                <div class="btn pull-right opt-save">
22
                    <i class="icon-check"></i> SAVE
23
                </div>
24
            </div>
25
        </div>
26
27
    </div>
28
</div>

+ 95 - 0
html/model/sys/resourceinfo/index.html

@ -0,0 +1,95 @@
1
<div class="sys_resourceinfo_index" loadUri="../ajax/resource/pq" pageSize="10" pageNo="1" pageIndex="pi">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container dt-form">
6
        <div class="row">
7
            <div class="col-1"></div>
8
            <div class="col-1 item-caption ">名称</div>
9
            <div class="col-5">
10
                <div class="form-item text" defVal="" name="resourceName"></div>
11
            </div>
12
            <div class="col-1 item-caption">发布者</div>
13
            <div class="col-2">
14
                <div class="form-item text" defVal="" name="name"></div>
15
            </div>
16
        </div>
17
        <div class="row">
18
            <div class="col-1"></div>
19
            <div class="col-1 item-caption ">发布时间</div>
20
            <div class="col-2">
21
                <div class="form-item date" defVal="" name="bt"></div>
22
            </div>
23
            <div class="col-1 item-caption center">至</div>
24
            <div class="col-2">
25
                <div class="form-item date" defVal="" name="et"></div>
26
            </div>
27
            <div class="col-1 item-caption ">排序方式</div>
28
            <div class="col-2">
29
                <div class="form-item select orderBy" dictCode="sort_rule" defVal="1" name="orderBy"></div>
30
            </div>
31
        </div>
32
        <div class="row">
33
            <div class="col-8">
34
            </div>
35
            <div class="col-2">
36
                <div class="btn opt-query pull-right">
37
                    <i class="icon-search"></i> 查询
38
                </div>
39
            </div>
40
            <div class="col-2"></div>
41
42
        </div>
43
    </div>
44
45
    <div class="container page-split"></div>
46
    <div class="container tpl-btns">
47
        <div class="row">
48
            <div class="btn opt-view">
49
                查看
50
            </div>
51
            <div class="btn opt-sort-num">
52
                设置权重
53
            </div>
54
            <div class="btn opt-del">
55
                删除
56
            </div>
57
        </div>
58
    </div>
59
    <div class="container dt-tpl">
60
        <table class="table table-bordered">
61
            <thead>
62
            <tr>
63
                <th class="opt-check" ><i class="icon icon-st-check"></i> </th>
64
                <th class="number">序号</th>
65
                <th>资源名称</th>
66
                <th>发布者</th>
67
                <th>关键词</th>
68
                <th>发布时间</th>
69
                <th class="number">权重</th>
70
                <th class="number">浏览量</th>
71
                <th class="number">收藏量</th>
72
            </tr>
73
            </thead>
74
            <tbody>
75
            <tr ch-dir="list">
76
                <td class="opt-check" ><i class="icon icon-st-check" resourceId="{{resourceId}}"></i></td>
77
                <td>{{pi}}</td>
78
                <td>{{resourceName}}</td>
79
                <td>{{professorName}}{{organizationName}}</td>
80
                <td>{{subject}}</td>
81
                <td>{{publishTime-showDay}}</td>
82
                <td>{{sortNum}}</td>
83
                <td>{{pageViews}}</td>
84
                <td class="hand-collectionid" collectionid="{{resourceId}}"></td>
85
            </tr>
86
            </tbody>
87
            <tbody ch-dir="array.empty">
88
            <tr>
89
                <td class="empty-desc" colspan="9">表格暂无数据</td>
90
            </tr>
91
            </tbody>
92
        </table>
93
    </div>
94
    <ul class="dt-pager"></ul>
95
</div>

+ 28 - 0
html/model/sys/resourceinfo/sort.html

@ -0,0 +1,28 @@
1
<div class="sys_resourceinfo_sort centerModal">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
    <div class="container newForm">
6
        <div class="row">
7
            <div class="col-2"></div>
8
            <div class="col-4 item-caption content ">设置权重</div>
9
10
        </div>
11
        <div class="row">
12
            <div class="col-2 item-caption">权重值</div>
13
            <div class="col-6">
14
                <div class="form-item text" defVal="" name="sortNum"></div>
15
            </div>
16
        </div>
17
18
        <div class="row">
19
            <div class="col-10"></div>
20
            <div class="col-2">
21
                <div class="btn pull-right opt-save">
22
                    <i class="icon-check"></i> SAVE
23
                </div>
24
            </div>
25
        </div>
26
27
    </div>
28
</div>

+ 4 - 4
js/model/sys/article/index.js

@ -87,9 +87,9 @@ spa_define(function () {
87 87
                        } else {
88 88
                            $.util.get("../ajax/article/id/"+$article.attr("articleId"),null,function(rd){
89 89
                                if(rd){
90
                                    spa.showModal("sys_article_sort", { data:rd, hand: function() { pdg.load() } })
90
                                    spa.showModal("sys_article_sort", { data:rd, hand: function() { pdg.reload() } })
91 91
                                }else{
92
                                    util.alertMsg("文章", function(){pdg.load();});
92
                                    util.alertMsg("文章不存在", function(){pdg.load();});
93 93
                                }
94 94
                            },{});
95 95
                        }
@ -101,12 +101,12 @@ spa_define(function () {
101 101
                    var $org = root.find("td.opt-check>i.checked");
102 102
                    if ($org.length) {
103 103
                        if ($org.length > 1) {
104
                            util.alert("只能选择一个用户");
104
                            util.alert("只能选择一篇文章");
105 105
                        } else {
106 106
                            window.open('http://www.ekexiu.com/articalShow.html?articleId=' + $org.attr("articleId"));
107 107
                        }
108 108
                    } else {
109
                        util.alert("请选择一个用户");
109
                        util.alert("请选择一篇文章");
110 110
                    }
111 111
                });
112 112

+ 2 - 2
js/model/sys/feedback/index.js

@ -44,12 +44,12 @@ spa_define(function () {
44 44
                                    spa.showModal("sys_feedback_operate", {
45 45
                                        data: data,
46 46
                                        hand: function () {
47
                                            pdg.load()
47
                                            pdg.reload()
48 48
                                        }
49 49
                                    })
50 50
                                } else {
51 51
                                    util.alert("用户不存在了", function () {
52
                                        pdg.load();
52
                                        pdg.reload();
53 53
                                    });
54 54
                                }
55 55
                            }, {});

+ 110 - 0
js/model/sys/paper/index.js

@ -0,0 +1,110 @@
1
/**
2
 * Created by TT on 2017/8/9.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "pagedatagrid", "util"], function (spa, pdgf, util) {
7
        return {
8
            main: function () {
9
                var root = spa.findInMain(".sys_paper_index");
10
                var pdg = pdgf.build(root);
11
                pdg.code.shell("showDay", function (env) {
12
                    if (env.cd && env.cd[this.k]) {
13
                        var day = env.cd[this.k];
14
                        return day.substring(0, 4) + "年" + day.substring(4, 6) + "月" + day.substring(6, 8) + "日  " + day.substring(8, 10) + ":" + day.substring(10, 12);
15
                    }
16
                    return "";
17
                });
18
                pdg.code.listen($.dict.doTransfer);
19
                pdg.code.listen(function(){
20
                    root.find(".hand-collectionid").each(function() {
21
                        var $e = $(this);
22
                        var collectionid = $e.attr("collectionid");
23
                        util.get("/ajax/content/countProfessor",{id:collectionid,type:4},function(data){
24
                            $e.text(data);
25
                        },{});
26
                        $e.removeClass("hand-collectionid");
27
                    });
28
                });
29
30
                root.find(".opt-query").on("click", function () {
31
                    pdg.load();
32
                });
33
                pdg.load();
34
                root.find(".dt-tpl").on("click", "th.opt-check>i.icon-st-check", function () {
35
                    var $this = $(this);
36
                    $this.toggleClass("checked");
37
                    if ($this.hasClass("checked")) {
38
                        root.find(".dt-tpl td.opt-check>i.icon-st-check").addClass("checked");
39
                    } else {
40
                        root.find(".dt-tpl td.opt-check>i.icon-st-check").removeClass("checked");
41
                    }
42
                });
43
                root.find(".dt-tpl").on("click", "td.opt-check>i.icon-st-check", function () {
44
                    var $this = $(this);
45
                    $this.toggleClass("checked");
46
                });
47
                // root.find(".opt-del").on("click", function() {
48
                //     var $org = root.find("td.opt-check>i.checked");
49
                //     if($org.length) {
50
                //         var ret = [];
51
                //         $org.each(function() {
52
                //             ret.push($(this).attr("articleId"));
53
                //         });
54
                //         util.boxMsg({
55
                //             title: "确认删除",
56
                //             content: "您是否要删除选中的文章?",
57
                //             btns: [{
58
                //                 caption: "删除",
59
                //                 hand: function () {
60
                //                     util.post("../ajax/paper/deleteArticle", {articleIds: ret}, function () {
61
                //                         pdg.reload()
62
                //                     }, {});
63
                //                 }
64
                //             },
65
                //                 {caption: "取消"}
66
                //             ]
67
                //         });
68
                //     } else {
69
                //         util.alert("请选择一个用户");
70
                //     }
71
                // });
72
                root.find(".opt-sort-num").on("click", function() {
73
                    var $paper = root.find("td.opt-check>i.checked");
74
                    if($paper.length) {
75
                        if($paper.length > 1) {
76
                            util.alert("只能选择一篇资源");
77
                        } else {
78
                            $.util.get("../ajax/paper/id/"+$paper.attr("paperId"),null,function(rd){
79
                                if(rd){
80
                                    spa.showModal("sys_paper_sort", { data:rd, hand: function() { pdg.reload() } })
81
                                }else{
82
                                    util.alertMsg("资源不存在", function(){pdg.reload();});
83
                                }
84
                            },{});
85
                        }
86
                    } else {
87
                        util.alert("请选择一篇资源");
88
                    }
89
                });
90
                root.find(".opt-view").on("click", function () {
91
                    var $org = root.find("td.opt-check>i.checked");
92
                    if ($org.length) {
93
                        if ($org.length > 1) {
94
                            util.alert("只能选择一篇资源");
95
                        } else {
96
                            window.open('http://www.ekexiu.com/paperShow.html?paperId=' + $org.attr("paperId"));
97
                        }
98
                    } else {
99
                        util.alert("请选择一篇资源");
100
                    }
101
                });
102
103
104
            }, mainDestory: function () {
105
106
            }
107
        };
108
    });
109
});
110

+ 44 - 0
js/model/sys/paper/sort.js

@ -0,0 +1,44 @@
1
/**
2
 * Created by TT on 2017/8/9.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_paper_sort");
10
                var form = fb.build(root.find(".newForm"));
11
                form.val({sortNum: data.data.sortNum, id: data.data.id});
12
13
                var saveBtn = root.find(".opt-save"),
14
                    save = function () {
15
                        if (form.val().sortNum) {
16
                            var sortNum = form.val().sortNum;
17
                            var reg = new RegExp("^(\\d|[1-9]\\d|100)$");
18
                            if (!reg.test(sortNum)) {
19
                                util.alert("权重值必须是0-100的正整数");
20
                                return;
21
                            }
22
                        } else {
23
                            form.val({sortNum: 0});
24
                        }
25
                        util.post("../ajax/paper/sortNum", {
26
                            id: data.data.id,
27
                            sortNum: form.val().sortNum
28
                        }, function () {
29
                            spa.closeModal();
30
                            if (data.hand) {
31
                                data.hand();
32
                            }
33
                        }, {});
34
                    };
35
36
                root.find(".modal-ctrl .icon-times").on("click", function () {
37
                    spa.closeModal();
38
                });
39
40
                saveBtn.on("click", save);
41
            }
42
        }
43
    });
44
});

+ 110 - 0
js/model/sys/patent/index.js

@ -0,0 +1,110 @@
1
/**
2
 * Created by TT on 2017/8/9.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "pagedatagrid", "util"], function (spa, pdgf, util) {
7
        return {
8
            main: function () {
9
                var root = spa.findInMain(".sys_patent_index");
10
                var pdg = pdgf.build(root);
11
                pdg.code.shell("showDay", function (env) {
12
                    if (env.cd && env.cd[this.k]) {
13
                        var day = env.cd[this.k];
14
                        return day.substring(0, 4) + "年" + day.substring(4, 6) + "月" + day.substring(6, 8) + "日  " + day.substring(8, 10) + ":" + day.substring(10, 12);
15
                    }
16
                    return "";
17
                });
18
                pdg.code.listen($.dict.doTransfer);
19
                pdg.code.listen(function(){
20
                    root.find(".hand-collectionid").each(function() {
21
                        var $e = $(this);
22
                        var collectionid = $e.attr("collectionid");
23
                        util.get("/ajax/content/countProfessor",{id:collectionid,type:4},function(data){
24
                            $e.text(data);
25
                        },{});
26
                        $e.removeClass("hand-collectionid");
27
                    });
28
                });
29
30
                root.find(".opt-query").on("click", function () {
31
                    pdg.load();
32
                });
33
                pdg.load();
34
                root.find(".dt-tpl").on("click", "th.opt-check>i.icon-st-check", function () {
35
                    var $this = $(this);
36
                    $this.toggleClass("checked");
37
                    if ($this.hasClass("checked")) {
38
                        root.find(".dt-tpl td.opt-check>i.icon-st-check").addClass("checked");
39
                    } else {
40
                        root.find(".dt-tpl td.opt-check>i.icon-st-check").removeClass("checked");
41
                    }
42
                });
43
                root.find(".dt-tpl").on("click", "td.opt-check>i.icon-st-check", function () {
44
                    var $this = $(this);
45
                    $this.toggleClass("checked");
46
                });
47
                // root.find(".opt-del").on("click", function() {
48
                //     var $org = root.find("td.opt-check>i.checked");
49
                //     if($org.length) {
50
                //         var ret = [];
51
                //         $org.each(function() {
52
                //             ret.push($(this).attr("articleId"));
53
                //         });
54
                //         util.boxMsg({
55
                //             title: "确认删除",
56
                //             content: "您是否要删除选中的文章?",
57
                //             btns: [{
58
                //                 caption: "删除",
59
                //                 hand: function () {
60
                //                     util.post("../ajax/patent/deleteArticle", {articleIds: ret}, function () {
61
                //                         pdg.reload()
62
                //                     }, {});
63
                //                 }
64
                //             },
65
                //                 {caption: "取消"}
66
                //             ]
67
                //         });
68
                //     } else {
69
                //         util.alert("请选择一个用户");
70
                //     }
71
                // });
72
                root.find(".opt-sort-num").on("click", function() {
73
                    var $patent = root.find("td.opt-check>i.checked");
74
                    if($patent.length) {
75
                        if($patent.length > 1) {
76
                            util.alert("只能选择一篇资源");
77
                        } else {
78
                            $.util.get("../ajax/patent/id/"+$patent.attr("patentId"),null,function(rd){
79
                                if(rd){
80
                                    spa.showModal("sys_patent_sort", { data:rd, hand: function() { pdg.reload() } })
81
                                }else{
82
                                    util.alertMsg("资源不存在", function(){pdg.reload();});
83
                                }
84
                            },{});
85
                        }
86
                    } else {
87
                        util.alert("请选择一篇资源");
88
                    }
89
                });
90
                root.find(".opt-view").on("click", function () {
91
                    var $org = root.find("td.opt-check>i.checked");
92
                    if ($org.length) {
93
                        if ($org.length > 1) {
94
                            util.alert("只能选择一篇资源");
95
                        } else {
96
                            window.open('http://www.ekexiu.com/patentShow.html?patentId=' + $org.attr("patentId"));
97
                        }
98
                    } else {
99
                        util.alert("请选择一篇资源");
100
                    }
101
                });
102
103
104
            }, mainDestory: function () {
105
106
            }
107
        };
108
    });
109
});
110

+ 44 - 0
js/model/sys/patent/sort.js

@ -0,0 +1,44 @@
1
/**
2
 * Created by TT on 2017/8/9.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_patent_sort");
10
                var form = fb.build(root.find(".newForm"));
11
                form.val({sortNum: data.data.sortNum, id: data.data.id});
12
13
                var saveBtn = root.find(".opt-save"),
14
                    save = function () {
15
                        if (form.val().sortNum) {
16
                            var sortNum = form.val().sortNum;
17
                            var reg = new RegExp("^(\\d|[1-9]\\d|100)$");
18
                            if (!reg.test(sortNum)) {
19
                                util.alert("权重值必须是0-100的正整数");
20
                                return;
21
                            }
22
                        } else {
23
                            form.val({sortNum: 0});
24
                        }
25
                        util.post("../ajax/patent/sortNum", {
26
                            id: data.data.id,
27
                            sortNum: form.val().sortNum
28
                        }, function () {
29
                            spa.closeModal();
30
                            if (data.hand) {
31
                                data.hand();
32
                            }
33
                        }, {});
34
                    };
35
36
                root.find(".modal-ctrl .icon-times").on("click", function () {
37
                    spa.closeModal();
38
                });
39
40
                saveBtn.on("click", save);
41
            }
42
        }
43
    });
44
});

+ 110 - 0
js/model/sys/resourceinfo/index.js

@ -0,0 +1,110 @@
1
/**
2
 * Created by TT on 2017/8/9.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "pagedatagrid", "util"], function (spa, pdgf, util) {
7
        return {
8
            main: function () {
9
                var root = spa.findInMain(".sys_resourceinfo_index");
10
                var pdg = pdgf.build(root);
11
                pdg.code.shell("showDay", function (env) {
12
                    if (env.cd && env.cd[this.k]) {
13
                        var day = env.cd[this.k];
14
                        return day.substring(0, 4) + "年" + day.substring(4, 6) + "月" + day.substring(6, 8) + "日  " + day.substring(8, 10) + ":" + day.substring(10, 12);
15
                    }
16
                    return "";
17
                });
18
                pdg.code.listen($.dict.doTransfer);
19
                pdg.code.listen(function(){
20
                    root.find(".hand-collectionid").each(function() {
21
                        var $e = $(this);
22
                        var collectionid = $e.attr("collectionid");
23
                        util.get("/ajax/content/countProfessor",{id:collectionid,type:2},function(data){
24
                            $e.text(data);
25
                        },{});
26
                        $e.removeClass("hand-collectionid");
27
                    });
28
                });
29
30
                root.find(".opt-query").on("click", function () {
31
                    pdg.load();
32
                });
33
                pdg.load();
34
                root.find(".dt-tpl").on("click", "th.opt-check>i.icon-st-check", function () {
35
                    var $this = $(this);
36
                    $this.toggleClass("checked");
37
                    if ($this.hasClass("checked")) {
38
                        root.find(".dt-tpl td.opt-check>i.icon-st-check").addClass("checked");
39
                    } else {
40
                        root.find(".dt-tpl td.opt-check>i.icon-st-check").removeClass("checked");
41
                    }
42
                });
43
                root.find(".dt-tpl").on("click", "td.opt-check>i.icon-st-check", function () {
44
                    var $this = $(this);
45
                    $this.toggleClass("checked");
46
                });
47
                root.find(".opt-del").on("click", function() {
48
                    var $resource = root.find("td.opt-check>i.checked");
49
                    if($resource.length) {
50
                        if($resource.length > 1) {
51
                            util.alert("只能选择一个资源");
52
                        } else {
53
                            util.boxMsg({
54
                                title: "确认删除",
55
                                content: "您是否要删除选中的资源?",
56
                                btns: [{
57
                                    caption: "删除",
58
                                    hand: function () {
59
                                        util.post("../ajax/resource/deleteResource", {resourceId: $resource.attr("resourceId")}, function () {
60
                                            pdg.reload()
61
                                        }, {});
62
                                    }
63
                                },
64
                                    {caption: "取消"}
65
                                ]
66
                            });
67
                        }
68
                    } else {
69
                        util.alert("请选择一个用户");
70
                    }
71
                });
72
                root.find(".opt-sort-num").on("click", function() {
73
                    var $resource = root.find("td.opt-check>i.checked");
74
                    if($resource.length) {
75
                        if($resource.length > 1) {
76
                            util.alert("只能选择一个资源");
77
                        } else {
78
                            $.util.get("../ajax/resource/id/"+$resource.attr("resourceId"),null,function(rd){
79
                                if(rd){
80
                                    spa.showModal("sys_resourceinfo_sort", { data:rd, hand: function() { pdg.reload() } })
81
                                }else{
82
                                    util.alertMsg("资源不存在", function(){pdg.reload();});
83
                                }
84
                            },{});
85
                        }
86
                    } else {
87
                        util.alert("请选择一个资源");
88
                    }
89
                });
90
                root.find(".opt-view").on("click", function () {
91
                    var $resource = root.find("td.opt-check>i.checked");
92
                    if ($resource.length) {
93
                        if ($resource.length > 1) {
94
                            util.alert("只能选择一个资源");
95
                        } else {
96
                            window.open('http://www.ekexiu.com/resourceShow.html?resourceId=' + $resource.attr("resourceId"));
97
                        }
98
                    } else {
99
                        util.alert("请选择一个资源");
100
                    }
101
                });
102
103
104
            }, mainDestory: function () {
105
106
            }
107
        };
108
    });
109
});
110

+ 44 - 0
js/model/sys/resourceinfo/sort.js

@ -0,0 +1,44 @@
1
/**
2
 * Created by TT on 2017/8/9.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "util", "form"], function (spa, util, fb) {
7
        return {
8
            modal: function (data) {
9
                var root = spa.findInModal(".sys_resourceinfo_sort");
10
                var form = fb.build(root.find(".newForm"));
11
                form.val({sortNum: data.data.sortNum, id: data.data.id});
12
13
                var saveBtn = root.find(".opt-save"),
14
                    save = function () {
15
                        if (form.val().sortNum) {
16
                            var sortNum = form.val().sortNum;
17
                            var reg = new RegExp("^(\\d|[1-9]\\d|100)$");
18
                            if (!reg.test(sortNum)) {
19
                                util.alert("权重值必须是0-100的正整数");
20
                                return;
21
                            }
22
                        } else {
23
                            form.val({sortNum: 0});
24
                        }
25
                        util.post("../ajax/resource/sortNum", {
26
                            resourceId: data.data.resourceId,
27
                            sortNum: form.val().sortNum
28
                        }, function () {
29
                            spa.closeModal();
30
                            if (data.hand) {
31
                                data.hand();
32
                            }
33
                        }, {});
34
                    };
35
36
                root.find(".modal-ctrl .icon-times").on("click", function () {
37
                    spa.closeModal();
38
                });
39
40
                saveBtn.on("click", save);
41
            }
42
        }
43
    });
44
});