owl-cli 6.123.0 → 6.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -215,7 +215,7 @@ var @projectCodeService = (function (pigeon) {
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
//对于unique的字段,检查有没有重复
|
|
218
|
-
if (field.unique === 'true') {
|
|
218
|
+
if (field.unique === 'true' && value) {
|
|
219
219
|
if (f.isDuplicated(data.id, field.key, value)) {
|
|
220
220
|
$.log("duplicated,key=" + field.key + ",value=" + value + ",call removeUniqueValue(data.id, field.key, value)");
|
|
221
221
|
return {'state': 'err', msg: field.fieldLabel + '不能重复。' + value, code: 'duplicated'}
|
|
@@ -274,7 +274,7 @@ var @projectCodeService = (function (pigeon) {
|
|
|
274
274
|
|
|
275
275
|
if(value && typeof(value)=='string'){
|
|
276
276
|
if (f.isDuplicated(data.id, field.key, value)) {
|
|
277
|
-
throw {'state': 'err', msg: field.fieldLabel + '不能重复。', code: 'duplicated'}
|
|
277
|
+
throw {'state': 'err', msg: field.fieldLabel + '不能重复。value=' + value, code: 'duplicated'}
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
//对于没有重复的数据,保存起来
|
|
@@ -543,9 +543,11 @@ var @projectCodeService = (function (pigeon) {
|
|
|
543
543
|
throw JSON.stringify(ret);
|
|
544
544
|
}
|
|
545
545
|
|
|
546
|
+
if(data.__force !== 'T'){
|
|
547
|
+
data['owl_createTime'] = new Date().getTime();
|
|
548
|
+
data['owl_modifyTime'] = new Date().getTime();
|
|
549
|
+
}
|
|
546
550
|
|
|
547
|
-
data['owl_createTime'] = new Date().getTime();
|
|
548
|
-
data['owl_modifyTime'] = new Date().getTime();
|
|
549
551
|
data['_v'] = 0
|
|
550
552
|
data['_t'] = spec['_t']
|
|
551
553
|
try {
|
|
@@ -668,7 +670,11 @@ var @projectCodeService = (function (pigeon) {
|
|
|
668
670
|
obj['_v'] = obj['_v'] + 1
|
|
669
671
|
f.validate(obj, env)
|
|
670
672
|
data._v = obj._v
|
|
671
|
-
obj.
|
|
673
|
+
if(obj.__force!=='T'){
|
|
674
|
+
//如果__force为T,则不更新时间,这代表了强制更新,可以用于数据迁移的场景,希望更新时间保留为旧系统时间
|
|
675
|
+
obj.owl_modifyTime=new Date().getTime();
|
|
676
|
+
}
|
|
677
|
+
|
|
672
678
|
EventBusService.fire(spec['_t'] + '_update_before', {old: oldObj, data: obj, env: env})
|
|
673
679
|
f.addToList(obj)
|
|
674
680
|
f.removeUniqueFields(oldObj, env)
|