|
|
@ -186,28 +186,27 @@ |
|
|
// } |
|
|
// } |
|
|
// |
|
|
// |
|
|
// function getEntityInfo() { |
|
|
// function getEntityInfo() { |
|
|
// entityService.getEntity(entityId.entityType, entityId.id).subscribe(function (entity) { |
|
|
// widgetContext.rxjs.forkJoin([ |
|
|
// vm.entity = entity; |
|
|
// entityRelationService.findInfoByFrom(entityId), |
|
|
// widgetContext.rxjs.forkJoin([ |
|
|
// entityRelationService.findInfoByTo(entityId), |
|
|
// entityRelationService.findInfoByFrom(entityId), |
|
|
// attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE'), |
|
|
// entityRelationService.findInfoByTo(entityId), |
|
|
// entityService.getEntity(entityId.entityType, entityId.id) |
|
|
// attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE') |
|
|
// ]).subscribe( |
|
|
// ]).subscribe( |
|
|
// function (data) { |
|
|
// function (data) { |
|
|
// getEntityRelations(data.slice(0,2)); |
|
|
// getEntityRelations(data.slice(0,2)); |
|
|
// getEntityAttributes(data[2]); |
|
|
// getEntityAttributes(data[2]); |
|
|
// vm.entity = data[3]; |
|
|
// vm.editEntityFormGroup.patchValue({ |
|
|
// vm.editEntityFormGroup.patchValue({ |
|
|
// entityName: vm.entity.name, |
|
|
// entityName: vm.entity.name, |
|
|
// entityType: vm.entityType, |
|
|
// entityType: vm.entityType, |
|
|
// entityLabel: vm.entity.label, |
|
|
// entityLabel: vm.entity.label, |
|
|
// type: vm.entity.type, |
|
|
// type: vm.entity.type, |
|
|
// attributes: vm.attributes, |
|
|
// attributes: vm.attributes, |
|
|
// oldRelations: vm.oldRelationsData |
|
|
// oldRelations: vm.oldRelationsData |
|
|
// }, {emitEvent: false}); |
|
|
// }, {emitEvent: false}); |
|
|
// } |
|
|
// } |
|
|
// ); |
|
|
// ); |
|
|
// }); |
|
|
// } |
|
|
// } |
|
|
|
|
|
// |
|
|
// |
|
|
// function saveEntity() { |
|
|
// function saveEntity() { |
|
|
// const formValues = vm.editEntityFormGroup.value; |
|
|
// const formValues = vm.editEntityFormGroup.value; |
|
|
@ -218,9 +217,8 @@ |
|
|
// } else if (formValues.entityType == 'DEVICE') { |
|
|
// } else if (formValues.entityType == 'DEVICE') { |
|
|
// return deviceService.saveDevice(vm.entity); |
|
|
// return deviceService.saveDevice(vm.entity); |
|
|
// } |
|
|
// } |
|
|
// } else { |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
|
|
|
// } |
|
|
// } |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
// } |
|
|
// } |
|
|
// |
|
|
// |
|
|
// function saveAttributes(entityId) { |
|
|
// function saveAttributes(entityId) { |
|
|
@ -233,9 +231,8 @@ |
|
|
// } |
|
|
// } |
|
|
// if (attributesArray.length > 0) { |
|
|
// if (attributesArray.length > 0) { |
|
|
// return attributeService.saveEntityAttributes(entityId, "SERVER_SCOPE", attributesArray); |
|
|
// return attributeService.saveEntityAttributes(entityId, "SERVER_SCOPE", attributesArray); |
|
|
// } else { |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
|
|
|
// } |
|
|
// } |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
// } |
|
|
// } |
|
|
// |
|
|
// |
|
|
// function saveRelations(entityId) { |
|
|
// function saveRelations(entityId) { |
|
|
@ -270,9 +267,8 @@ |
|
|
// } |
|
|
// } |
|
|
// if (tasks.length > 0) { |
|
|
// if (tasks.length > 0) { |
|
|
// return widgetContext.rxjs.forkJoin(tasks); |
|
|
// return widgetContext.rxjs.forkJoin(tasks); |
|
|
// } else { |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
|
|
|
// } |
|
|
// } |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
// } |
|
|
// } |
|
|
//} |
|
|
//} |
|
|
// |
|
|
// |
|
|
@ -380,9 +376,8 @@ |
|
|
// } |
|
|
// } |
|
|
// if (attributesArray.length > 0) { |
|
|
// if (attributesArray.length > 0) { |
|
|
// return attributeService.saveEntityAttributes(entityId, "SERVER_SCOPE", attributesArray); |
|
|
// return attributeService.saveEntityAttributes(entityId, "SERVER_SCOPE", attributesArray); |
|
|
// } else { |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
|
|
|
// } |
|
|
// } |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
// } |
|
|
// } |
|
|
// |
|
|
// |
|
|
// function saveRelations(entityId) { |
|
|
// function saveRelations(entityId) { |
|
|
@ -404,8 +399,7 @@ |
|
|
// } |
|
|
// } |
|
|
// if (tasks.length > 0) { |
|
|
// if (tasks.length > 0) { |
|
|
// return widgetContext.rxjs.forkJoin(tasks); |
|
|
// return widgetContext.rxjs.forkJoin(tasks); |
|
|
// } else { |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
|
|
|
// } |
|
|
// } |
|
|
|
|
|
// return widgetContext.rxjs.of([]); |
|
|
// } |
|
|
// } |
|
|
//} |
|
|
//} |
|
|
|