cuiqian2004
2024-11-20 8fa4ce09620159d1233510b279270a16f61c6f08
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
var SESSION_SUFFIX = "mes_pda_"
var classUtils = {
 
 
    attrTypeIsString: function(type) {
        if (type == '字符串' || type == '可变长字符串' || type == 'char' || type == 'varchar') {
            return true
        }
        return false
    },
    attrTypeIsNumber: function(type) {
        if (attrTypeIsInt(type) || attrTypeIsFloat(type)) {
            return true
        }
        return false
    },
    attrTypeIsFloat: function(type) {
        if (type == '浮点数' ||  type == 'float') {
            return true
        }
        return false
    },
    attrTypeIsInt: function(type) {
        if (type == '整数' || type == 'int') {
            return true
        }
        return false
    },
    attrTypeIsDict: function(type) {
        if (type == '字典' || type == '字典-字符串' || type == '字典-整数' || type == 'dict' || type == 'dict-char' ||
            type == 'dict-int') {
            return true
        }
        return false
    },
    attrTypeIsDateTime: function(type) {
        if (type == '日期' || type == '时间' || type == 'date' || type == 'datetime') {
            return true
        }
        return false
    },
    attrTypeIsDate: function(type) {
        if (type == '日期' ||  type == 'date' ) {
            return true
        }
        return false
    },
    attrTypeIsTime: function(type) {
        if (type == '时间'  || type == 'datetime') {
            return true
        }
        return false
    },
    attrTypeIsObjRefMulti: function(type) {
        if (type == '引用对象(多个)' || type == 'obj-ref-multi') {
            return true
        }
        return false
    },
    attrTypeIsObjRef: function(type) {
        if (type == '引用对象(单个)' || type == 'obj-ref') {
            return true
        }
        return false
    },
    attrTypeIsRegion: function(type) {
        if (type == '省市区' || type == 'region') {
            return true
        }
        return false
    },
    attrTypeIsBool: function(type) {
        if (type == '布尔值' || type == 'bool') {
            return true
        }
        return false
    },
 
    attrTypeIsUser: function(type) {
        if (type == '引用人员' || type == 'user') {
            return true
        }
        return false
    },
    attrTypeIsProject: function(type) {
        if (type == '引用项目' || type == 'project') {
            return true
        }
        return false
    },
    attrTypeIsCode: function(type) {
        if (type == '编码' || type == 'code') {
            return true
        }
        return false
    },
    attrTypeIsGuid: function(type) {
        if (type == 'GUID' || type == 'guid') {
            return true
        }
        return false
    },
 
}
var session = {
    setValue(key, value) {
        let suffixStr = SESSION_SUFFIX
        if (value == null) {
            uni.removeStorageSync(suffixStr + key)
        } else {
            uni.setStorageSync(suffixStr + key, value);
        }
    },
 
    getValue(key) {
        let suffixStr = SESSION_SUFFIX
        return uni.getStorageSync(suffixStr + key) || null;
    },
 
    clearValue(key) {
        let suffixStr = SESSION_SUFFIX
        return uni.removeStorageSync(suffixStr +  key);
    },
}
export default {
    classUtils,
    session
}