jiazx0107@163.com
2023-11-04 43ce77a85d8297a53dc25430fff10ead57296167
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// @Bind @dtTiming.onDataChange
!function(self, arg) {
    var porp = arg.property;
    if(porp == "timType"){
        if(arg.newValue == "day"){
            arg.entity.set("week",null);
            arg.entity.set("appointTime",null);
            view.get("^week").set("readOnly",true);
            view.get("^day").set("readOnly",false);
            view.get("^hour").set("readOnly",true);
        }
        if(arg.newValue == "week"){
            arg.entity.set("appointTime",null);
            view.get("^week").set("readOnly",false);
            view.get("^day").set("readOnly",false);
            view.get("^hour").set("readOnly",true);
        }
        if(arg.newValue == "hour"){
            arg.entity.set("week",null);
            arg.entity.set("hour",null);
            arg.entity.set("minute",null);
            view.get("^week").set("readOnly",true);
            view.get("^day").set("readOnly",true);
            view.get("^hour").set("readOnly",false);
        }
    }
};
 
//@Bind #tabControlMain.onTabChange
!function(self,arg,dataSetTiming){
    var name = self.get("currentTab.name");
    if(name == "tabGrain"){
        dataSetTiming.set("parameter",{
            type:"grain"
        }).flushAsync();
    }
    
    if(name == "tabPest"){
        dataSetTiming.set("parameter",{
            type:"pest"
        }).flushAsync();
    }
    
    if(name == "tabGas"){
        dataSetTiming.set("parameter",{
            type:"gas"
        }).flushAsync();
    }
    if(name == "tabStorage"){
        dataSetTiming.set("parameter",{
            type:"storage"
        }).flushAsync();
    }
};
 
/**
 * 单元格说明渲染
 * @param arg
 * @param self
 */
weekRenderCell = function(arg, self) {
    var data = arg.data;
    var week = data.get("week");
    var result = "";
    if (data.get("timType") == "day") {
        result = "每天:" + data.get("hour") + "点" + data.get("minute") + "分 执行";
    }
    if (data.get("timType") == "week") {
        if (week == "MON")
            result = "每周一:" + data.get("hour") + "点" + data.get("minute")
                    + "分 执行";
        if (week == "TUE")
            result = "每周二:" + data.get("hour") + "点" + data.get("minute")
                    + "分 执行";
        if (week == "WED")
            result = "每周三:" + data.get("hour") + "点" + data.get("minute")
                    + "分 执行";
        if (week == "THU")
            result = "每周四:" + data.get("hour") + "点" + data.get("minute")
                    + "分 执行";
        if (week == "FRI")
            result = "每周五:" + data.get("hour") + "点" + data.get("minute")
                    + "分 执行";
        if (week == "SAT")
            result = "每周六:" + data.get("hour") + "点" + data.get("minute")
                    + "分 执行";
        if (week == "SUN")
            result = "每周日:" + data.get("hour") + "点" + data.get("minute")
                    + "分 执行";
    }
    if (data.get("timType") == "hour") {
        if (data.get("appointTime")) {
            result = "指定时间:"
                    + data.get("appointTime").formatDate("Y年m月d日 H点i分s秒")
                    + " 执行。";
        } else {
            result = "指定时间:执行。";
        }
    }
    arg.dom.innerHTML = result;
};