JS同结构对象对比做标识
///处理当前项目对应的项目措施标识
function CheckSubItemData(allSubItemData, mySubItemData) {
// 单独遍历,是考虑mySubItem为空的情况,下面不能循环
for (var item in allSubItemData) {
allSubItemData[item].IsMySubItem = false;
}
for (var item in allSubItemData) {
for (var myItem in mySubItemData) {
mySubItemData[myItem].CareSubItemBy.IsMySubItem = false;
allSubItemData[item].FrequencyId = mySubItemData[myItem].FrequencyId;
if (allSubItemData[item].Id == mySubItemData[myItem].CareSubItemBy.Id) {
allSubItemData[item].IsMySubItem = true;
break;
}
}
}
careWorlDoc = "";
var Nos = 0;
///获取每个项目措施描述,组合工作标准
for (var m in allSubItemData) {
if (allSubItemData[m].IsMySubItem) {
Nos++;
careWorlDoc += Nos + "、" + allSubItemData[m].Desc + "\r";
}
}
定,精,简,俭