Browse Source

add 个人业绩

XMTT 8 years ago
parent
commit
9e08fc080a

+ 14 - 0
css/model/sys/personal.css

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

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

@ -18,7 +18,7 @@
18 18
19 19
    </div>
20 20
    <div id="type" style="height:400px"></div>
21
    <div class="container dt-tpl-2">
21
    <div class="container dt-tpl">
22 22
        <div>用户流量</div>
23 23
        <table class="table table-bordered">
24 24
            <thead>

+ 35 - 0
html/model/sys/pictable/personal.html

@ -0,0 +1,35 @@
1
<div class="sys_personal_index">
2
    <div class="modal-ctrl">
3
        <i class="icon icon-times"></i>
4
    </div>
5
6
    <div id="type" style="height:400px"></div>
7
    <div class="container dt-tpl">
8
        <div>用户流量</div>
9
        <table class="table table-bordered">
10
            <thead>
11
            <tr>
12
                <th>时间</th>
13
                <th>新认领客户</th>
14
                <th>新认领成功客户</th>
15
                <th>累计认领成功客户</th>
16
                <th>累计认领客户</th>
17
            </tr>
18
            </thead>
19
            <tbody>
20
            <tr ch-dir="list">
21
                <td>{{createTime}}</td>
22
                <td>{{znum-count}}</td>
23
                <td>{{jnum-count}}</td>
24
                <td>{{ljnum}}</td>
25
                <td>{{lznum}}</td>
26
            </tr>
27
            </tbody>
28
            <tbody ch-dir="array.empty">
29
            <tr>
30
                <td colspan="7">表格暂无数据</td>
31
            </tr>
32
            </tbody>
33
        </table>
34
    </div>
35
</div>

+ 1 - 1
js/model/sys/pictable/index.js

@ -4,7 +4,7 @@ spa_define(function () {
4 4
        return {
5 5
            main: function () {
6 6
                var root = spa.findInMain(".sys_pictable_index");
7
                var cr = code.parseCode(root.find(".dt-tpl-2"));
7
                var cr = code.parseCode(root.find(".dt-tpl"));
8 8
                var myChart = echarts.init(document.getElementById('type'));
9 9
10 10
                var dynUser = {ready: true};

+ 99 - 0
js/model/sys/pictable/personal.js

@ -0,0 +1,99 @@
1
/**
2
 * Created by TT on 2017/4/21.
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_personal_index");
10
                var cr = code.parseCode(root.find(".dt-tpl"));
11
                var myChart = echarts.init(document.getElementById('type'));
12
13
                cr.shell("count", function (env) {
14
                    var v = env.cd[this.k];
15
                    if (v === 0) {
16
                        return 0;
17
                    }
18
                    return v;
19
                });
20
21
                var loadChart = function () {
22
                    util.get("../ajax/sys/user/pictable/"+util.data("loginUser").id,null,function (data) {
23
                        var colors = ['#c23531', '#82C8FA'];
24
                        var option = {
25
                            color: colors,
26
                            title: {
27
                                text: '个人业绩统计',
28
                                subtext: '最近7天'
29
                            },
30
                            tooltip: {
31
                                trigger: 'axis'
32
                            },
33
                            legend: {
34
                                data: ['新增用户', '新增激活用户']
35
                            },
36
                            xAxis: {
37
                                data: data.map(function (item) {
38
                                    return item.createTime;
39
                                }),
40
                                boundaryGap: false
41
                            },
42
                            yAxis: {
43
                                splitLine: {
44
                                    show: false
45
                                },
46
                                boundaryGap: false,
47
                                type: "value",
48
                                // interval: 1,
49
                                min: 0
50
                            },
51
                            toolbox: {
52
                                show: true,
53
                                feature: {
54
                                    dataZoom: {
55
                                        yAxisIndex: 'none'
56
                                    },
57
                                    dataView: {readOnly: false},
58
                                    magicType: {type: ['line', 'bar']},
59
                                    restore: {},
60
                                    saveAsImage: {}
61
                                }
62
                            },
63
                            dataZoom: [{
64
                                startValue: ""
65
                            }, {
66
                                type: 'inside'
67
                            }],
68
                            visualMap: {
69
                                top: 10,
70
                                right: 10,
71
                            },
72
                            series: [{
73
                                name: '新增用户',
74
                                type: 'line',
75
                                data: data.map(function (item) {
76
                                    return item.znum;
77
                                }),
78
                            }, {
79
                                name: '新增激活用户',
80
                                type: 'line',
81
                                data: data.map(function (item) {
82
                                    return item.jnum;
83
                                })
84
                            }
85
                            ]
86
                        };
87
                        cr.val(data);
88
                        myChart.setOption(option);
89
                    })
90
                };
91
92
                cr.listen(dict.doTransfer);
93
                loadChart();
94
95
96
            }
97
        }
98
    });
99
});