baotian
2024-06-04 b959135a1139fb66646523d92e5bd20c5910f283
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const originLine = [
    { 'month': '2023年4月', 'electricity': 120, 'torsion': 220, 'load': 150, 'other': 320 },
    { 'month': '2023年5月', 'electricity': 132, 'torsion': 182, 'load': 232, 'other': 332 },
    { 'month': '2023年6月', 'electricity': 101, 'torsion': 191, 'load': 201, 'other': 301 },
    { 'month': '2023年7月', 'electricity': 134, 'torsion': 234, 'load': 154, 'other': 334 },
    { 'month': '2023年8月', 'electricity': 90, 'torsion': 290, 'load': 190, 'other': 390 },
    { 'month': '2023年9月', 'electricity': 230, 'torsion': 330, 'load': 330, 'other': 330 },
    { 'month': '2023年10月', 'electricity': 210, 'torsion': 310, 'load': 410, 'other': 320 },
    { 'month': '2023年11月', 'electricity': 190, 'torsion': 132, 'load': 234, 'other': 330 },
    { 'month': '2023年12月', 'electricity': 180, 'torsion': 101, 'load': 290, 'other': 410 },
    { 'month': '2024年1月', 'electricity': 220, 'torsion': 134, 'load': 330, 'other': 234 },
    { 'month': '2024年2月', 'electricity': 340, 'torsion': 90, 'load': 310, 'other': 290 },
    { 'month': '2024年3月', 'electricity': 21, 'torsion': 230, 'load': 132, 'other': 330 }
]
 
const originGant = [
    { 'type': '任务1', 'beforeTime': '2021-10-01', 'endTime': '2021-10-14' },
    { 'type': '任务2', 'beforeTime': '2021-10-04', 'endTime': '2021-10-15' },
    { 'type': '任务3', 'beforeTime': '2021-10-05', 'endTime': '2021-10-09' },
    { 'type': '任务4', 'beforeTime': '2021-10-08', 'endTime': '2021-10-17' },
    { 'type': '任务5', 'beforeTime': '2021-10-10', 'endTime': '2021-10-21' },
    { 'type': '任务6', 'beforeTime': '2021-10-18', 'endTime': '2021-10-27' }
]
 
const dateLine = [
    { 'month': '2023年3月', 'electricity': 101, 'torsion': 191, 'load': 201, 'other': 301 },
    { 'month': '2023年4月', 'electricity': 134, 'torsion': 234, 'load': 154, 'other': 334 },
    { 'month': '2023年5月', 'electricity': 90, 'torsion': 290, 'load': 190, 'other': 390 },
    { 'month': '2023年6月', 'electricity': 230, 'torsion': 330, 'load': 330, 'other': 330 },
    { 'month': '2023年7月', 'electricity': 210, 'torsion': 310, 'load': 410, 'other': 320 },
    { 'month': '2023年8月', 'electricity': 190, 'torsion': 132, 'load': 234, 'other': 330 },
    { 'month': '2023年9月', 'electricity': 180, 'torsion': 101, 'load': 290, 'other': 410 },
    { 'month': '2023年10月', 'electricity': 220, 'torsion': 134, 'load': 330, 'other': 234 }
]
 
const dateGant = [
    { 'type': '任务1', 'beforeTime': '2021-10-01', 'endTime': '2021-10-14' },
    { 'type': '任务2', 'beforeTime': '2021-10-04', 'endTime': '2021-10-15' },
    { 'type': '任务3', 'beforeTime': '2021-10-05', 'endTime': '2021-10-09' },
    { 'type': '任务4', 'beforeTime': '2021-10-08', 'endTime': '2021-10-17' },
    { 'type': '任务5', 'beforeTime': '2021-10-10', 'endTime': '2021-10-22' },
    { 'type': '任务6', 'beforeTime': '2021-10-18', 'endTime': '2021-10-27' },
    { 'type': '任务7', 'beforeTime': '2021-10-25', 'endTime': '2021-10-31' }
]
 
// 初始状态如何显示数据
// 甘特图是显示一个月内的?
export const getKnifeToolUsageLine = (option) => {
    const obj = {
        code: 200
    }
    if (!option.searchBeforeTime && !option.searchEndTime && !option.knifeToolId) {
        obj.data = originLine
    } else {
        obj.data = dateLine
    }
    return obj
}
 
export const getKnifeToolUsageGant = (option) => {
    const obj = {
        code: 200
    }
    if (!option.searchBeforeTime && !option.searchEndTime && !option.knifeToolId) {
        obj.data = originGant
    } else {
        obj.data = dateGant
    }
    return obj
}