var SESSION_SUFFIX = "mes_pda_"
|
var classUtils = {
|
|
|
attrTypeIsString: function(type) {
|
if (type == '字符串' || type == '可变长字符串' || type == 'char' || type == 'varchar') {
|
return true
|
}
|
return false
|
},
|
attrTypeIsInt: function(type) {
|
if (type == '整数' || type == 'int') {
|
return true
|
}
|
return false
|
},
|
|
attrTypeIsFloat: function(type) {
|
if (type == '浮点数' || type == 'float') {
|
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
|
}
|