优化代码

This commit is contained in:
java110 2022-06-17 12:12:31 +08:00
parent b6aa206264
commit 51b481b72d

View File

@ -24,7 +24,6 @@
vc.component.refreshEditCommunityInfo();
$('#editCommunityModel').modal('show');
vc.copyObject(_params, vc.component.editCommunityInfo);
if (_params.hasOwnProperty('communityAttrDtos')) {
let _attrDtos = _params.communityAttrDtos;
_attrDtos.forEach(item => {
@ -42,8 +41,7 @@
editCommunityValidate: function() {
return vc.validate.validate({
editCommunityInfo: vc.component.editCommunityInfo
},
{
}, {
'editCommunityInfo.name': [{
limit: "required",
param: "",
@ -81,20 +79,17 @@
limit: "maxLength",
param: "12",
errInfo: "小区城市编码不能大于4个字符"
},
],
}, ],
'editCommunityInfo.mapX': [{
limit: "maxLength",
param: "20",
errInfo: "小区城市编码不能大于4个字符"
},
],
}, ],
'editCommunityInfo.mapY': [{
limit: "maxLength",
param: "20",
errInfo: "小区城市编码不能大于4个字符"
},
],
}, ],
'editCommunityInfo.communityId': [{
limit: "required",
param: "",
@ -108,9 +103,6 @@
vc.toast(vc.validate.errInfo);
return;
}
vc.http.post('editCommunity', 'update', JSON.stringify(vc.component.editCommunityInfo), {
emulateJSON: true
},