Browse Source

资源导入

XMTT 7 years ago
parent
commit
2676a86705
3 changed files with 88 additions and 0 deletions
  1. 16 0
      css/model/sys/import.css
  2. 24 0
      html/model/sys/import/index.html
  3. 48 0
      js/model/sys/import/index.js

+ 16 - 0
css/model/sys/import.css

@ -0,0 +1,16 @@
1
@charset "utf-8";
2
.sys_import_index .queryForm {
3
    position: relative;
4
}
5
6
.sys_import_index .queryForm .icon-search {
7
    position: absolute;
8
    top: 7px;
9
    right: 15px;
10
    font-size: 25px;
11
}
12
13
.sys_import_index .table-opt .icon {
14
    margin: 10px;
15
    font-size: 20px;
16
}

+ 24 - 0
html/model/sys/import/index.html

@ -0,0 +1,24 @@
1
<div class="sys_import_index">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
6
7
    <div class="container dt-form">
8
        <div class="row">
9
            <div class="col-2 item-caption">路径</div>
10
            <div class="col-4">
11
                <div class="form-item text"  name="path"></div>
12
            </div>
13
            <!--<div class="col-2 item-caption">查看</div>-->
14
        </div>
15
        <div class="row">
16
            <div class="col-2 item-caption"></div>
17
            <div class="col-6">
18
                <div class="btn opt-count">查看文件数量</div>
19
                <div class="btn opt-import">导入</div>
20
            </div>
21
        </div>
22
23
    </div>
24
</div>

+ 48 - 0
js/model/sys/import/index.js

@ -0,0 +1,48 @@
1
/**
2
 * Created by TT on 2017/6/7.
3
 */
4
;
5
spa_define(function () {
6
    return $.use(["spa", "code", "form", "util", "dict"], function (spa, code, form, util, dict) {
7
        return {
8
            main: function () {
9
                var root = spa.findInMain(".sys_import_index");
10
                // var cr = code.parseCode(root.find(".dt-tpl"));
11
                var path = form.build(root.find(".dt-form"));
12
13
                root.find(".opt-count").on("click", function () {
14
                    if(path.val().path){
15
                        path.doPost("../ajax/resourceTmp/file",function (data) {
16
                            util.alert("文件夹下共有" + data + "个文件");
17
                        });
18
                    }else {
19
                        util.alert("请输入资源文件夹路径");
20
                    }
21
                });
22
23
                root.find(".opt-import").on("click", function () {
24
                    if(path.val().path){
25
                        util.boxMsg({
26
                            title: "确认",
27
                            content: "您是否要录入此文件夹中的信息,信息录入成功后文件将被删除,请确认路径是否正确或做好备份!!!!!!",
28
                            btns: [{
29
                                caption: "开始录入",
30
                                hand: function() {
31
                                    path.doPost("../ajax/resourceTmp/importRes",function (data) {
32
                                        util.alert("本次录入成功"+data+"条信息");
33
                                    });
34
                                }
35
                            },
36
                                { caption: "取消" }
37
                            ]
38
                        });
39
                    }else {
40
                        util.alert("请输入资源文件夹路径");
41
                    }
42
                });
43
            }
44
        }
45
    });
46
});
47
48