ato-water-lib 0.0.131 → 0.0.132

Sign up to get free protection for your applications and to get access to all the features.
@@ -3451,11 +3451,9 @@ var ENUM_ASSET_PARAMETERS;
3451
3451
  ENUM_ASSET_PARAMETERS["DATA_ANALYSIS_WET_BULB_TEMPERATURE"] = "DA Wet Bulb Temperature";
3452
3452
  ENUM_ASSET_PARAMETERS["DATA_ANALYSIS_RANGE"] = "DARange";
3453
3453
  ENUM_ASSET_PARAMETERS["DATA_ANALYSIS_APPROACH"] = "DAApproach";
3454
- // Cooling Tower -- Performance -- Efficiency and Performance
3455
- ENUM_ASSET_PARAMETERS["EFFICIENCY_DAILY_AVERAGE"] = "Efficiency Daily Average";
3456
- ENUM_ASSET_PARAMETERS["EFFICIENCY_ADJUSTED_DAILY_AVERAGE"] = "Efficiency Adjusted Daily Average";
3457
- ENUM_ASSET_PARAMETERS["LG_RATIO"] = "L/G Ratio";
3458
- ENUM_ASSET_PARAMETERS["NTU"] = "NTU";
3454
+ // Cooling Tower -- Performance -- Efficiency
3455
+ ENUM_ASSET_PARAMETERS["DAILY_EFFICIENCY_AVG"] = "Daily Efficiency Avg";
3456
+ ENUM_ASSET_PARAMETERS["ADJUSTED_EFFICIENCY_DAILY_AVG"] = "Adjusted Efficiency Daily Avg";
3459
3457
  // Cooling Tower -- Performance -- Water & Energy Consumption
3460
3458
  ENUM_ASSET_PARAMETERS["WATER_ENERGY_CONSUMPTION_MAKEUP_FLOW_RATE"] = "Make Up Water Flow Rate";
3461
3459
  ENUM_ASSET_PARAMETERS["WATER_ENERGY_CONSUMPTION_BLOWDOWN_FLOW_RATE"] = "Blowdown Water Flow Rate";
@@ -3475,8 +3473,8 @@ var ENUM_ASSET_PARAMETERS;
3475
3473
  ENUM_ASSET_PARAMETERS["KPIS_SUPPLY_TEMPERATURE"] = "KPIs Supply Temperature";
3476
3474
  ENUM_ASSET_PARAMETERS["KPIS_RANGE"] = "KPIs Range";
3477
3475
  ENUM_ASSET_PARAMETERS["KPIS_APPROACH"] = "KPIs Approach";
3478
- ENUM_ASSET_PARAMETERS["KPIS_EFFICIENCY_ADJUSTED_DAILY_AVERAGE"] = "KPIs Efficiency Adjusted Daily Average";
3479
- ENUM_ASSET_PARAMETERS["KPIS_LG_RATIO"] = "KPIs L/G Ratio";
3476
+ ENUM_ASSET_PARAMETERS["DAILY_EFFICIENCY"] = "Daily Efficiency";
3477
+ ENUM_ASSET_PARAMETERS["ADJUSTED_EFFICIENCY"] = "Adjusted Efficiency";
3480
3478
  })(ENUM_ASSET_PARAMETERS || (ENUM_ASSET_PARAMETERS = {}));
3481
3479
  var WATER_SYSTEMS_NAME;
3482
3480
  (function (WATER_SYSTEMS_NAME) {
@@ -3544,7 +3542,7 @@ var WATER_SYSTEMS_NAME;
3544
3542
  // For Cooling Tower - Performance
3545
3543
  WATER_SYSTEMS_NAME["VISUAL_MANAGEMENT"] = "Visual Management";
3546
3544
  WATER_SYSTEMS_NAME["DATA_ANALYSIS"] = "Data Analysis";
3547
- WATER_SYSTEMS_NAME["EFFICIENCY_AND_PERFORMANCE"] = "Efficiency and Performance";
3545
+ WATER_SYSTEMS_NAME["EFFICIENCY"] = "Efficiency";
3548
3546
  WATER_SYSTEMS_NAME["WATER_AND_ENERGY_CONSUMPTION"] = "Water & Energy Consumption";
3549
3547
  WATER_SYSTEMS_NAME["CHEMICALS_CONSUMPTION"] = "Chemicals Consumption";
3550
3548
  WATER_SYSTEMS_NAME["DESIGN_PARAMETERS"] = "Design Parameters";
@@ -3975,21 +3973,13 @@ const DATA_ASSET_PARAMETER_FIELDS = {
3975
3973
  isFrom: ATO_MAPPER_FROM.INDICATOR,
3976
3974
  },
3977
3975
  // Cooling Tower -- Performance -- Efficiency and Performance
3978
- [ENUM_ASSET_PARAMETERS.EFFICIENCY_DAILY_AVERAGE]: {
3979
- name: ENUM_ASSET_PARAMETERS.EFFICIENCY_DAILY_AVERAGE,
3980
- key: ENUM_ASSET_PARAMETERS.EFFICIENCY_DAILY_AVERAGE,
3981
- },
3982
- [ENUM_ASSET_PARAMETERS.EFFICIENCY_ADJUSTED_DAILY_AVERAGE]: {
3983
- name: ENUM_ASSET_PARAMETERS.EFFICIENCY_ADJUSTED_DAILY_AVERAGE,
3984
- key: ENUM_ASSET_PARAMETERS.EFFICIENCY_ADJUSTED_DAILY_AVERAGE,
3985
- },
3986
- [ENUM_ASSET_PARAMETERS.LG_RATIO]: {
3987
- name: ENUM_ASSET_PARAMETERS.COMMON_LG_RATIO,
3988
- key: ENUM_ASSET_PARAMETERS.LG_RATIO,
3976
+ [ENUM_ASSET_PARAMETERS.DAILY_EFFICIENCY_AVG]: {
3977
+ name: ENUM_ASSET_PARAMETERS.DAILY_EFFICIENCY_AVG,
3978
+ key: ENUM_ASSET_PARAMETERS.DAILY_EFFICIENCY_AVG,
3989
3979
  },
3990
- [ENUM_ASSET_PARAMETERS.NTU]: {
3991
- name: ENUM_ASSET_PARAMETERS.NTU,
3992
- key: ENUM_ASSET_PARAMETERS.NTU,
3980
+ [ENUM_ASSET_PARAMETERS.ADJUSTED_EFFICIENCY_DAILY_AVG]: {
3981
+ name: ENUM_ASSET_PARAMETERS.ADJUSTED_EFFICIENCY_DAILY_AVG,
3982
+ key: ENUM_ASSET_PARAMETERS.ADJUSTED_EFFICIENCY_DAILY_AVG,
3993
3983
  },
3994
3984
  // Cooling Tower -- Performance -- Water & Energy Consumption
3995
3985
  [ENUM_ASSET_PARAMETERS.WATER_ENERGY_CONSUMPTION_MAKEUP_FLOW_RATE]: {
@@ -4075,18 +4065,18 @@ const DATA_ASSET_PARAMETER_FIELDS = {
4075
4065
  visible: false,
4076
4066
  isFrom: ATO_MAPPER_FROM.INDICATOR,
4077
4067
  },
4078
- [ENUM_ASSET_PARAMETERS.KPIS_EFFICIENCY_ADJUSTED_DAILY_AVERAGE]: {
4079
- name: 'Efficiency Adjusted Daily Average',
4080
- key: ENUM_ASSET_PARAMETERS.KPIS_EFFICIENCY_ADJUSTED_DAILY_AVERAGE,
4068
+ [ENUM_ASSET_PARAMETERS.DAILY_EFFICIENCY]: {
4069
+ name: ENUM_ASSET_PARAMETERS.DAILY_EFFICIENCY,
4070
+ key: ENUM_ASSET_PARAMETERS.DAILY_EFFICIENCY,
4081
4071
  value: 'Mapping in Efficiency & Performance section',
4082
4072
  isEditable: false,
4083
4073
  isReadOnly: true,
4084
4074
  visible: false,
4085
4075
  isFrom: ATO_MAPPER_FROM.INDICATOR,
4086
4076
  },
4087
- [ENUM_ASSET_PARAMETERS.KPIS_LG_RATIO]: {
4088
- name: ENUM_ASSET_PARAMETERS.COMMON_LG_RATIO,
4089
- key: ENUM_ASSET_PARAMETERS.KPIS_LG_RATIO,
4077
+ [ENUM_ASSET_PARAMETERS.ADJUSTED_EFFICIENCY]: {
4078
+ name: ENUM_ASSET_PARAMETERS.ADJUSTED_EFFICIENCY,
4079
+ key: ENUM_ASSET_PARAMETERS.ADJUSTED_EFFICIENCY,
4090
4080
  value: 'Mapping in Efficiency & Performance section',
4091
4081
  isEditable: false,
4092
4082
  isReadOnly: true,
@@ -4361,8 +4351,8 @@ const DATA_WATER_SYSTEMS = {
4361
4351
  title: WATER_SYSTEMS_NAME.DATA_ANALYSIS,
4362
4352
  ...STYLE_TABLE_PARAM.LONDON_HUE,
4363
4353
  },
4364
- [WATER_SYSTEMS_NAME.EFFICIENCY_AND_PERFORMANCE]: {
4365
- title: WATER_SYSTEMS_NAME.EFFICIENCY_AND_PERFORMANCE,
4354
+ [WATER_SYSTEMS_NAME.EFFICIENCY]: {
4355
+ title: WATER_SYSTEMS_NAME.EFFICIENCY,
4366
4356
  ...STYLE_TABLE_PARAM.LONDON_HUE,
4367
4357
  },
4368
4358
  [WATER_SYSTEMS_NAME.WATER_AND_ENERGY_CONSUMPTION]: {
@@ -4484,11 +4474,9 @@ const ASSET_CATEGORY_PARAMS = {
4484
4474
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.DATA_ANALYSIS_RANGE],
4485
4475
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.DATA_ANALYSIS_APPROACH],
4486
4476
  ],
4487
- [WATER_SYSTEMS_NAME.EFFICIENCY_AND_PERFORMANCE]: [
4488
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.EFFICIENCY_DAILY_AVERAGE],
4489
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.EFFICIENCY_ADJUSTED_DAILY_AVERAGE],
4490
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.LG_RATIO],
4491
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.NTU],
4477
+ [WATER_SYSTEMS_NAME.EFFICIENCY]: [
4478
+ DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.DAILY_EFFICIENCY_AVG],
4479
+ DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.ADJUSTED_EFFICIENCY_DAILY_AVG],
4492
4480
  ],
4493
4481
  [WATER_SYSTEMS_NAME.WATER_AND_ENERGY_CONSUMPTION]: [
4494
4482
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.WATER_ENERGY_CONSUMPTION_MAKEUP_FLOW_RATE],
@@ -4512,8 +4500,8 @@ const ASSET_CATEGORY_PARAMS = {
4512
4500
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.KPIS_SUPPLY_TEMPERATURE],
4513
4501
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.KPIS_RANGE],
4514
4502
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.KPIS_APPROACH],
4515
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.KPIS_EFFICIENCY_ADJUSTED_DAILY_AVERAGE],
4516
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.KPIS_LG_RATIO],
4503
+ DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.DAILY_EFFICIENCY],
4504
+ DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.ADJUSTED_EFFICIENCY],
4517
4505
  ],
4518
4506
  };
4519
4507
  // For Boiler
@@ -4658,21 +4646,15 @@ const ASSET_CATEGORY_PARAMS__RO_WATER_TREATMENT = {
4658
4646
  [WATER_SYSTEMS_NAME.RO_PRE_FILTER__FLOW]: [
4659
4647
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.DIFFERENTIAL_PRESSURE],
4660
4648
  ],
4661
- [WATER_SYSTEMS_NAME.RO_HP_PUMP__FLOW]: [
4662
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.PRESSURE],
4663
- ],
4649
+ [WATER_SYSTEMS_NAME.RO_HP_PUMP__FLOW]: [DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.PRESSURE]],
4664
4650
  [WATER_SYSTEMS_NAME.RO_FEED__CHEMISTRY]: [
4665
4651
  // DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.TDS],
4666
4652
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.CONDUCTIVITY],
4667
4653
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.TEMPERATURE],
4668
4654
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.PH],
4669
4655
  ],
4670
- [WATER_SYSTEMS_NAME.RO_CONCENTRATE__CHEMISTRY]: [
4671
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.CONDUCTIVITY],
4672
- ],
4673
- [WATER_SYSTEMS_NAME.RO_RO__CHEMISTRY]: [
4674
- DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.REJECTION_RATE],
4675
- ],
4656
+ [WATER_SYSTEMS_NAME.RO_CONCENTRATE__CHEMISTRY]: [DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.CONDUCTIVITY]],
4657
+ [WATER_SYSTEMS_NAME.RO_RO__CHEMISTRY]: [DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.REJECTION_RATE]],
4676
4658
  [WATER_SYSTEMS_NAME.RO_PERMEATE__CHEMISTRY]: [
4677
4659
  // DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.TDS],
4678
4660
  DATA_ASSET_PARAMETER_FIELDS[ENUM_ASSET_PARAMETERS.PH],
@@ -4699,7 +4681,7 @@ var ATO_ASSET_LAYERS;
4699
4681
  ATO_ASSET_LAYERS["FLOW"] = "Flow";
4700
4682
  ATO_ASSET_LAYERS["CHEMISTRY"] = "Chemistry";
4701
4683
  ATO_ASSET_LAYERS["ANALYTICS"] = "Analytics";
4702
- ATO_ASSET_LAYERS["PERFORMANCE"] = "Performance";
4684
+ ATO_ASSET_LAYERS["EFFICIENCY"] = "Efficiency";
4703
4685
  })(ATO_ASSET_LAYERS || (ATO_ASSET_LAYERS = {}));
4704
4686
  var ATO_SPOT_LOCATION_TYPE;
4705
4687
  (function (ATO_SPOT_LOCATION_TYPE) {
@@ -6053,7 +6035,7 @@ const ATO_COMPONENTS_GROUP_DATA = {
6053
6035
  extendedData: {
6054
6036
  margin: new go.Margin(195, 20, 0, 0),
6055
6037
  },
6056
- extendedDataPerformance: {
6038
+ extendedDataEfficiency: {
6057
6039
  margin: new go.Margin(260, 20, 0, 0),
6058
6040
  },
6059
6041
  extendedDataResponsive: {
@@ -6121,7 +6103,7 @@ const ATO_COMPONENTS_GROUP_DATA = {
6121
6103
  waterSystem: WATER_SYSTEMS_NAME.VISUAL_MANAGEMENT,
6122
6104
  })),
6123
6105
  visible: true,
6124
- assetLayers: ATO_ASSET_LAYERS.PERFORMANCE,
6106
+ assetLayers: ATO_ASSET_LAYERS.EFFICIENCY,
6125
6107
  extendedData: {
6126
6108
  visible: true,
6127
6109
  },
@@ -6147,7 +6129,7 @@ const ATO_COMPONENTS_GROUP_DATA = {
6147
6129
  desiredSizeNameParam: new go.Size(136, 14),
6148
6130
  waterSystem: WATER_SYSTEMS_NAME.DATA_ANALYSIS,
6149
6131
  })),
6150
- assetLayers: ATO_ASSET_LAYERS.PERFORMANCE,
6132
+ assetLayers: ATO_ASSET_LAYERS.EFFICIENCY,
6151
6133
  extendedData: {
6152
6134
  visible: true,
6153
6135
  },
@@ -6160,69 +6142,19 @@ const ATO_COMPONENTS_GROUP_DATA = {
6160
6142
  type: AtoGojsEditorModel.ENUM_TEMPLATES.PARAM_TABLE,
6161
6143
  group: 100,
6162
6144
  padding: new go.Margin(0, 0, 0, 0),
6163
- loc: '667 620',
6164
- ...DATA_WATER_SYSTEMS[WATER_SYSTEMS_NAME.EFFICIENCY_AND_PERFORMANCE],
6145
+ loc: '667 630',
6146
+ ...DATA_WATER_SYSTEMS[WATER_SYSTEMS_NAME.EFFICIENCY],
6165
6147
  minSizeValue: new go.Size(100, NaN),
6166
6148
  selectable: false,
6167
- dataTable: ASSET_CATEGORY_PARAMS[WATER_SYSTEMS_NAME.EFFICIENCY_AND_PERFORMANCE].map((e) => ({
6149
+ dataTable: ASSET_CATEGORY_PARAMS[WATER_SYSTEMS_NAME.EFFICIENCY].map((e) => ({
6168
6150
  ...e,
6169
6151
  value: '',
6170
6152
  isEditable: true,
6171
6153
  desiredSizeValue: new go.Size(100, 14),
6172
6154
  desiredNameParam: new go.Size(160, 14),
6173
- waterSystem: WATER_SYSTEMS_NAME.EFFICIENCY_AND_PERFORMANCE,
6155
+ waterSystem: WATER_SYSTEMS_NAME.EFFICIENCY,
6174
6156
  })),
6175
- assetLayers: ATO_ASSET_LAYERS.PERFORMANCE,
6176
- extendedData: {
6177
- visible: true,
6178
- },
6179
- extendedDataResponsive: {
6180
- visible: false,
6181
- },
6182
- },
6183
- {
6184
- key: 104,
6185
- type: AtoGojsEditorModel.ENUM_TEMPLATES.PARAM_TABLE,
6186
- group: 100,
6187
- padding: new go.Margin(0, 0, 0, 0),
6188
- loc: '10 420',
6189
- ...DATA_WATER_SYSTEMS[WATER_SYSTEMS_NAME.WATER_AND_ENERGY_CONSUMPTION],
6190
- minSizeValue: new go.Size(100, NaN),
6191
- selectable: false,
6192
- dataTable: ASSET_CATEGORY_PARAMS[WATER_SYSTEMS_NAME.WATER_AND_ENERGY_CONSUMPTION].map((e) => ({
6193
- ...e,
6194
- value: '',
6195
- isEditable: true,
6196
- maxSizeValue: new go.Size(128, 14),
6197
- maxSizeNameParam: new go.Size(140, 14),
6198
- waterSystem: WATER_SYSTEMS_NAME.WATER_AND_ENERGY_CONSUMPTION,
6199
- })),
6200
- assetLayers: ATO_ASSET_LAYERS.PERFORMANCE,
6201
- extendedData: {
6202
- visible: true,
6203
- },
6204
- extendedDataResponsive: {
6205
- visible: false,
6206
- },
6207
- },
6208
- {
6209
- key: 107,
6210
- type: AtoGojsEditorModel.ENUM_TEMPLATES.PARAM_TABLE,
6211
- group: 100,
6212
- padding: new go.Margin(0, 0, 0, 0),
6213
- loc: '10 640',
6214
- ...DATA_WATER_SYSTEMS[WATER_SYSTEMS_NAME.CHEMICALS_CONSUMPTION],
6215
- minSizeValue: new go.Size(100, NaN),
6216
- selectable: false,
6217
- dataTable: ASSET_CATEGORY_PARAMS[WATER_SYSTEMS_NAME.CHEMICALS_CONSUMPTION].map((e) => ({
6218
- ...e,
6219
- value: '',
6220
- isEditable: true,
6221
- desiredSizeValue: new go.Size(120, 14),
6222
- desiredSizeNameParam: new go.Size(145, 14),
6223
- waterSystem: WATER_SYSTEMS_NAME.CHEMICALS_CONSUMPTION,
6224
- })),
6225
- assetLayers: ATO_ASSET_LAYERS.PERFORMANCE,
6157
+ assetLayers: ATO_ASSET_LAYERS.EFFICIENCY,
6226
6158
  extendedData: {
6227
6159
  visible: true,
6228
6160
  },
@@ -6243,10 +6175,13 @@ const ATO_COMPONENTS_GROUP_DATA = {
6243
6175
  ...e,
6244
6176
  isEditable: true,
6245
6177
  maxSizeValue: new go.Size(120, 14),
6178
+ // minSizeValue: new go.Size(120, 14),
6246
6179
  maxSizeNameParam: new go.Size(180, 14),
6180
+ // desiredSize: new go.Size(180, 14),
6247
6181
  waterSystem: WATER_SYSTEMS_NAME.DESIGN_PARAMETERS,
6182
+ isCreateDirectly: true,
6248
6183
  })),
6249
- assetLayers: ATO_ASSET_LAYERS.PERFORMANCE,
6184
+ assetLayers: ATO_ASSET_LAYERS.EFFICIENCY,
6250
6185
  extendedData: {
6251
6186
  visible: true,
6252
6187
  },
@@ -6269,7 +6204,7 @@ const ATO_COMPONENTS_GROUP_DATA = {
6269
6204
  desiredSizeNameParam: new go.Size(135, 14),
6270
6205
  waterSystem: WATER_SYSTEMS_NAME.SYSTEM_KPIS__COOLING_TOWER__PERFORMANCE,
6271
6206
  })),
6272
- assetLayers: ATO_ASSET_LAYERS.PERFORMANCE,
6207
+ assetLayers: ATO_ASSET_LAYERS.EFFICIENCY,
6273
6208
  isFrom: ATO_MAPPER_FROM.INDICATOR,
6274
6209
  extendedData: {
6275
6210
  visible: false,
@@ -7562,14 +7497,12 @@ class AtoDefaultGojsEditor {
7562
7497
  });
7563
7498
  // Remove Node and Node Group
7564
7499
  _.forEach(this.myDiagram.nodeTemplateMap?.Hb, (temp) => {
7565
- if (temp?.key &&
7566
- !this.editor.data?.nodeDataArray?.some((node) => node?.type === temp?.key)) {
7500
+ if (temp?.key && !this.editor.data?.nodeDataArray?.some((node) => node?.type === temp?.key)) {
7567
7501
  this.myDiagram.nodeTemplateMap.remove(temp?.key);
7568
7502
  }
7569
7503
  });
7570
7504
  _.forEach(this.myDiagram.groupTemplateMap?.Hb, (temp) => {
7571
- if (temp?.key &&
7572
- !this.editor.data?.nodeDataArray?.some((node) => node?.type === temp?.key)) {
7505
+ if (temp?.key && !this.editor.data?.nodeDataArray?.some((node) => node?.type === temp?.key)) {
7573
7506
  this.myDiagram.groupTemplateMap.remove(temp?.key);
7574
7507
  }
7575
7508
  });
@@ -7595,13 +7528,11 @@ class AtoDefaultGojsEditor {
7595
7528
  this.makeGroupCoolingTowerTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name);
7596
7529
  return;
7597
7530
  }
7598
- if (node?.type ===
7599
- AtoGojsEditorModel.ENUM_TEMPLATES.IMMERSED_UF_WATER_TREATMENTS) {
7531
+ if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.IMMERSED_UF_WATER_TREATMENTS) {
7600
7532
  this.makeGroupImmersedUFTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name);
7601
7533
  return;
7602
7534
  }
7603
- if (node?.type ===
7604
- AtoGojsEditorModel.ENUM_TEMPLATES.PRESSURIZED_UF_WATER_TREATMENTS) {
7535
+ if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PRESSURIZED_UF_WATER_TREATMENTS) {
7605
7536
  this.makeGroupCoolingTowerTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name);
7606
7537
  return;
7607
7538
  }
@@ -7609,8 +7540,7 @@ class AtoDefaultGojsEditor {
7609
7540
  this.makeGroupZoneTemplate();
7610
7541
  return;
7611
7542
  }
7612
- if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL &&
7613
- node?.isGroup) {
7543
+ if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL && node?.isGroup) {
7614
7544
  this.groupPlantCellTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name);
7615
7545
  return;
7616
7546
  }
@@ -7634,13 +7564,11 @@ class AtoDefaultGojsEditor {
7634
7564
  }
7635
7565
  // Not Group
7636
7566
  // Component Water Normal
7637
- if (AtoGojsEditorModel.TYPE_TEMPLATE_WATER_NORMAL?.includes(node?.type) &&
7638
- !node?.isGroup) {
7567
+ if (AtoGojsEditorModel.TYPE_TEMPLATE_WATER_NORMAL?.includes(node?.type) && !node?.isGroup) {
7639
7568
  this.makeEntityTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon ?? '', AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name ?? '');
7640
7569
  }
7641
7570
  // Component Water Withdraw Or Discharge
7642
- if (AtoGojsEditorModel.TYPE_TEMPLATE_WATER_WITHDRAW_OR_DISCHARGE?.includes(node?.type) &&
7643
- !node?.isGroup) {
7571
+ if (AtoGojsEditorModel.TYPE_TEMPLATE_WATER_WITHDRAW_OR_DISCHARGE?.includes(node?.type) && !node?.isGroup) {
7644
7572
  this.makeEntityWithdrawOrDischarge(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon ?? '', AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name ?? '');
7645
7573
  }
7646
7574
  // Component Energy Normal
@@ -7693,8 +7621,7 @@ class AtoDefaultGojsEditor {
7693
7621
  this.makeSpecialTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name);
7694
7622
  }
7695
7623
  // Plant Cell
7696
- if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL &&
7697
- !node?.isGroup) {
7624
+ if (node?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL && !node?.isGroup) {
7698
7625
  this.plantCellTemplate(AtoGojsEditorModel.NODE_TEMPLATES[node?.type].icon, AtoGojsEditorModel.NODE_TEMPLATES[node?.type].name);
7699
7626
  }
7700
7627
  }
@@ -7722,8 +7649,7 @@ class AtoDefaultGojsEditor {
7722
7649
  this.myDiagram.dragSelectingTool = this.initialOptions?.dragSelectingTool;
7723
7650
  this.myDiagram.toolManager.draggingTool.isGridSnapEnabled =
7724
7651
  this.initialOptions?.['draggingTool.isGridSnapEnabled'] ?? false;
7725
- if (this.myDiagram.toolManager &&
7726
- this.myDiagram.toolManager.draggingTool) {
7652
+ if (this.myDiagram.toolManager && this.myDiagram.toolManager.draggingTool) {
7727
7653
  if (this.initialOptions?.['draggingTool.gridSnapCellSize']) {
7728
7654
  this.myDiagram.toolManager.draggingTool.gridSnapCellSize =
7729
7655
  this.initialOptions?.['draggingTool.gridSnapCellSize'];
@@ -7741,8 +7667,7 @@ class AtoDefaultGojsEditor {
7741
7667
  this.initialOptions?.['linkingTool.linkValidation'];
7742
7668
  }
7743
7669
  }
7744
- this.myDiagram.contentAlignment =
7745
- this.initialOptions?.contentAlignment ?? go.Spot.Center;
7670
+ this.myDiagram.contentAlignment = this.initialOptions?.contentAlignment ?? go.Spot.Center;
7746
7671
  this.myDiagram.layout = this.initialOptions?.layout;
7747
7672
  // this.myDiagram.minViewportBounds = new go.Rect(0, 0, 1200, 1200);
7748
7673
  if (!!this.editor?.data) {
@@ -7766,8 +7691,7 @@ class AtoDefaultGojsEditor {
7766
7691
  // if (!this.isAddedModelChangedListeners) {
7767
7692
  this.isAddedModelChangedListeners = true;
7768
7693
  this.myDiagram.addModelChangedListener(function (e) {
7769
- if (e.change === go.ChangedEvent.Remove &&
7770
- e.propertyName === 'nodeDataArray') {
7694
+ if (e.change === go.ChangedEvent.Remove && e.propertyName === 'nodeDataArray') {
7771
7695
  const data = e.oldValue;
7772
7696
  self.onDeleteNode.emit(data);
7773
7697
  }
@@ -7996,12 +7920,7 @@ class AtoDefaultGojsEditor {
7996
7920
  }
7997
7921
  initSolarDiagram() {
7998
7922
  const { SOLAR_POWER, POWER_CONDITIONING_UNIT, BATTERIES: BATTERY, INVERTERS: INVERTER, } = AtoGojsEditorModel.ENUM_TEMPLATES;
7999
- const ListItemsCreateEntityTemplate = [
8000
- SOLAR_POWER,
8001
- POWER_CONDITIONING_UNIT,
8002
- BATTERY,
8003
- INVERTER,
8004
- ];
7923
+ const ListItemsCreateEntityTemplate = [SOLAR_POWER, POWER_CONDITIONING_UNIT, BATTERY, INVERTER];
8005
7924
  ListItemsCreateEntityTemplate.map((e) => {
8006
7925
  if (!!AtoGojsEditorModel.NODE_TEMPLATES[e]) {
8007
7926
  this.makeEntityTemplateEnergy(AtoGojsEditorModel.NODE_TEMPLATES[e].icon, AtoGojsEditorModel.NODE_TEMPLATES[e].name);
@@ -8082,11 +8001,7 @@ class AtoDefaultGojsEditor {
8082
8001
  toolTip: this.$('ToolTip', this.$(go.TextBlock, {
8083
8002
  margin: 4,
8084
8003
  }, new go.Binding('text', 'textComponent'))),
8085
- }, new go.Binding('text', 'textComponent'), new go.Binding('background', 'textComponent', (x) => x ? 'white' : 'transparent')
8086
- // new go.Binding('margin', 'isFormat', (x) =>
8087
- // x ? new go.Margin(5, 0, 5, 5) : new go.Margin(5, 5, 5, 5),
8088
- // ),
8089
- )));
8004
+ }, new go.Binding('text', 'textComponent'), new go.Binding('background', 'textComponent', (x) => (x ? 'white' : 'transparent')))));
8090
8005
  // arrow
8091
8006
  elements.push(this.$(go.Shape, // the "from" arrowhead
8092
8007
  {
@@ -8203,9 +8118,7 @@ class AtoDefaultGojsEditor {
8203
8118
  click: function (e, obj) {
8204
8119
  alert('Option 2 clicked!');
8205
8120
  },
8206
- })
8207
- // ... add more options as needed ...
8208
- );
8121
+ }));
8209
8122
  const node = this.$(go.Node, 'Spot', {
8210
8123
  // fromSpot: go.Spot.RightSide,
8211
8124
  // toSpot: go.Spot.LeftSide,
@@ -8256,8 +8169,7 @@ class AtoDefaultGojsEditor {
8256
8169
  },
8257
8170
  doubleClick: (e, obj) => {
8258
8171
  const node = obj.part;
8259
- if (node?.ob?.isTypeInflowOfPlantCell &&
8260
- !this._initialOptions?.isReadOnly) {
8172
+ if (node?.ob?.isTypeInflowOfPlantCell && !this._initialOptions?.isReadOnly) {
8261
8173
  // obj?.data?.onSelected(node?.ob?.nodePlantCellParent);
8262
8174
  // this.isShowNodeInfo
8263
8175
  // ? self.onDoubleClickNode.emit({
@@ -8565,11 +8477,10 @@ class AtoDefaultGojsEditor {
8565
8477
  ? this.generateActionGroup([
8566
8478
  AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.RO_WATER_TREATMENT].name,
8567
8479
  AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.COOLING_TOWER].name,
8568
- AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.BOILER].name,
8569
- AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES
8570
- .IMMERSED_UF_WATER_TREATMENTS].name,
8571
- AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES
8572
- .PRESSURIZED_UF_WATER_TREATMENTS].name,
8480
+ AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.BOILER]
8481
+ .name,
8482
+ AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.IMMERSED_UF_WATER_TREATMENTS].name,
8483
+ AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.PRESSURIZED_UF_WATER_TREATMENTS].name,
8573
8484
  ].includes(title)
8574
8485
  ? [
8575
8486
  AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME,
@@ -8625,8 +8536,7 @@ class AtoDefaultGojsEditor {
8625
8536
  }, new go.Binding('text', 'name').makeTwoWay(), new go.Binding('editable', '', (data) => {
8626
8537
  return !(AtoGojsEditorModel.TYPE_COMPONENT_WATER?.includes(data?.systemType) &&
8627
8538
  data?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER &&
8628
- data?.topologyType !==
8629
- ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL);
8539
+ data?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL);
8630
8540
  })))), this.$(go.Panel, 'Vertical', {
8631
8541
  alignment: go.Spot.Left,
8632
8542
  alignmentFocus: new go.Spot(0, 0.5, 8, 0),
@@ -8813,19 +8723,7 @@ class AtoDefaultGojsEditor {
8813
8723
  AtoDefaultGojsEditor.ENUM_ACTIONS.ONLY_DETAILS,
8814
8724
  // DefaultGojsEditor.ENUM_ACTIONS.OUTFLOW,
8815
8725
  AtoDefaultGojsEditor.ENUM_ACTIONS.DELETE,
8816
- ])
8817
- // new go.Binding('visible', 'isNotAction', (x) => !x),
8818
- )
8819
- // this.$(
8820
- // go.Panel,
8821
- // 'Horizontal',
8822
- // { alignment: go.Spot.TopRight, alignmentFocus: go.Spot.Bottom },
8823
- // this.generateActionGroup([DefaultGojsEditor.ENUM_ACTIONS.ONLY_DETAILS]),
8824
- // new go.Binding('visible', '', (x) => {
8825
- // return x?.isOnlyDetails && !x?.isNotAction ? true : false;
8826
- // }),
8827
- // ),
8828
- ),
8726
+ ]))),
8829
8727
  toolTip: this.$('ToolTip', this.$(go.TextBlock, {
8830
8728
  margin: 4,
8831
8729
  }, new go.Binding('text', 'name').makeTwoWay())),
@@ -8863,7 +8761,8 @@ class AtoDefaultGojsEditor {
8863
8761
  desiredSize: new go.Size(size.w - 20, size.h - 65),
8864
8762
  imageStretch: go.GraphObject.Uniform,
8865
8763
  }, new go.Binding('source', 'pathImage', (x) => x ??
8866
- AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL].icon)), this.$(go.TextBlock, {
8764
+ AtoGojsEditorModel.NODE_TEMPLATES[AtoGojsEditorModel.ENUM_TEMPLATES.PLANT_CELL]
8765
+ .icon)), this.$(go.TextBlock, {
8867
8766
  row: 2,
8868
8767
  margin: new go.Margin(10, 0, 3, 0),
8869
8768
  editable: true,
@@ -8882,12 +8781,7 @@ class AtoDefaultGojsEditor {
8882
8781
  }), this.$(go.Panel, 'Vertical', {
8883
8782
  alignment: go.Spot.Right,
8884
8783
  alignmentFocus: new go.Spot(1, 0.5, -8, 0),
8885
- })
8886
- // this.makePort('T', go.Spot.Top, go.Spot.TopSide, false, true),
8887
- // this.makePort('L', go.Spot.Left, go.Spot.LeftSide, false, true),
8888
- // this.makePort('R', go.Spot.Right, go.Spot.RightSide, true, false),
8889
- // this.makePort('B', go.Spot.Bottom, go.Spot.BottomSide, true, false),
8890
- );
8784
+ }));
8891
8785
  this.myDiagram.nodeTemplateMap.set(title, node);
8892
8786
  }
8893
8787
  makeEntityWithdrawOrDischarge(icon, title, size = {
@@ -8965,15 +8859,7 @@ class AtoDefaultGojsEditor {
8965
8859
  toolTip: this.$('ToolTip', this.$(go.TextBlock, {
8966
8860
  margin: 4,
8967
8861
  }, new go.Binding('text', 'name').makeTwoWay())),
8968
- }, new go.Binding('text', 'name').makeTwoWay()
8969
- // {
8970
- // // define a tooltip for each node that displays the color as text
8971
- // toolTip: this.$(
8972
- // 'ToolTip',
8973
- // this.$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'name')),
8974
- // ), // end of Adornment
8975
- // },
8976
- ))), this.$(go.Panel, 'Vertical', {
8862
+ }, new go.Binding('text', 'name').makeTwoWay()))), this.$(go.Panel, 'Vertical', {
8977
8863
  alignment: go.Spot.Left,
8978
8864
  alignmentFocus: new go.Spot(0, 0.5, 8, 0),
8979
8865
  }), this.$(go.Panel, 'Vertical', {
@@ -9054,38 +8940,31 @@ class AtoDefaultGojsEditor {
9054
8940
  const self = this;
9055
8941
  return this.$('Button', {
9056
8942
  click: function (e, obj) {
9057
- self.openActionMenu();
9058
8943
  const filteredActions = _.filter(obj.part?.['ob']?.actions ?? actions, (action) => {
9059
8944
  // Filter Insight button
9060
8945
  if (action === AtoDefaultGojsEditor.ENUM_ACTIONS.INSIGHT) {
9061
8946
  return !!obj.part?.['ob']?.id;
9062
8947
  }
9063
8948
  if (action === AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME &&
9064
- obj.part?.['ob']?.type !==
9065
- AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE &&
8949
+ obj.part?.['ob']?.type !== AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE &&
9066
8950
  AtoGojsEditorModel.TYPE_COMPONENT_WATER?.includes(obj.part?.['ob']?.systemType) &&
9067
- obj.part?.['ob']?.topologyType !==
9068
- ATO_ECOMPONENT_PLANT_TYPE.WATER &&
9069
- obj.part?.['ob']?.topologyType !==
9070
- ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL) {
8951
+ obj.part?.['ob']?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER &&
8952
+ obj.part?.['ob']?.topologyType !== ATO_ECOMPONENT_PLANT_TYPE.WATER_PLANT_CELL) {
9071
8953
  return false;
9072
8954
  }
9073
8955
  if (action === AtoDefaultGojsEditor.ENUM_ACTIONS.OUTFLOW &&
9074
8956
  self.plantSatus === ATO_EPlantType.BASIC_PLANT &&
9075
- obj.part?.data?.type ===
9076
- AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
8957
+ obj.part?.data?.type === AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
9077
8958
  return false;
9078
8959
  }
9079
8960
  return true;
9080
8961
  }).map((e) => {
9081
- if (ATO_ECOMPONENT_PLANT_TYPE.STEAM ===
9082
- obj.part?.['ob']?.topologyType &&
8962
+ if (ATO_ECOMPONENT_PLANT_TYPE.STEAM === obj.part?.['ob']?.topologyType &&
9083
8963
  e === AtoDefaultGojsEditor.ENUM_ACTIONS.INSIGHT) {
9084
8964
  return AtoDefaultGojsEditor.ENUM_ACTIONS.DATA_MAPPING;
9085
8965
  }
9086
8966
  if (e === AtoDefaultGojsEditor.ENUM_ACTIONS.FLOW_DETAILS &&
9087
- obj?.part?.['ob']?.systemType ===
9088
- AtoGojsEditorModel.ENUM_TYPES.COOLING_TOWER) {
8967
+ obj?.part?.['ob']?.systemType === AtoGojsEditorModel.ENUM_TYPES.COOLING_TOWER) {
9089
8968
  return AtoDefaultGojsEditor.ENUM_ACTIONS.FLOW_DETAILS_AND_WIZARD;
9090
8969
  }
9091
8970
  return e;
@@ -9126,8 +9005,7 @@ class AtoDefaultGojsEditor {
9126
9005
  break;
9127
9006
  case AtoDefaultGojsEditor.ENUM_ACTIONS.RENAME:
9128
9007
  onClickFn = () => {
9129
- if (obj.part?.data?.type ===
9130
- AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
9008
+ if (obj.part?.data?.type === AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE) {
9131
9009
  self.onRename.emit({
9132
9010
  left: e?.['Wr']?.x - 50,
9133
9011
  top: e?.['Wr']?.y,
@@ -9182,6 +9060,7 @@ class AtoDefaultGojsEditor {
9182
9060
  },
9183
9061
  };
9184
9062
  });
9063
+ self.openActionMenu();
9185
9064
  },
9186
9065
  'ButtonBorder.strokeWidth': 0,
9187
9066
  'ButtonBorder.fill': 'white',
@@ -9237,8 +9116,7 @@ class AtoDefaultGojsEditor {
9237
9116
  if (nodedata?.movable !== undefined && nodedata?.movable !== null) {
9238
9117
  newnode.movable = nodedata?.movable;
9239
9118
  }
9240
- newnode.location = new go.Point(fromnode.location.x + 160, fromnode.location.y +
9241
- this.findLocYFromnode(fromnode) * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT);
9119
+ newnode.location = new go.Point(fromnode.location.x + 160, fromnode.location.y + this.findLocYFromnode(fromnode) * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT);
9242
9120
  e.diagram.commitTransaction('Create Node and Link');
9243
9121
  }
9244
9122
  findLocYFromnode(fromnode) {
@@ -9258,20 +9136,12 @@ class AtoDefaultGojsEditor {
9258
9136
  return this.isEmptyYLoc(locYAlreadyExist, i);
9259
9137
  }
9260
9138
  isEmptyYLoc(locYAlreadyExist, i) {
9261
- if (!_.some(locYAlreadyExist, (x) => x <
9262
- i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT +
9263
- AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
9264
- x >
9265
- i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT -
9266
- AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
9139
+ if (!_.some(locYAlreadyExist, (x) => x < i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT + AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
9140
+ x > i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT - AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
9267
9141
  return i;
9268
9142
  }
9269
- if (!_.some(locYAlreadyExist, (x) => x <
9270
- -i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT +
9271
- AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
9272
- x >
9273
- -i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT -
9274
- AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
9143
+ if (!_.some(locYAlreadyExist, (x) => x < -i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT + AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2 &&
9144
+ x > -i * AtoDefaultGojsEditor.DISTANCE_2_OUTPUT - AtoDefaultGojsEditor.DISTANCE_2_OUTPUT / 2)) {
9275
9145
  return -i;
9276
9146
  }
9277
9147
  return null;
@@ -9307,9 +9177,7 @@ class AtoDefaultGojsEditor {
9307
9177
  width: 40,
9308
9178
  height: 40,
9309
9179
  alignment: align,
9310
- stretch: horizontal
9311
- ? go.GraphObject.Horizontal
9312
- : go.GraphObject.Vertical,
9180
+ stretch: horizontal ? go.GraphObject.Horizontal : go.GraphObject.Vertical,
9313
9181
  portId: name,
9314
9182
  fromSpot: spot,
9315
9183
  fromLinkable: output,
@@ -9356,35 +9224,7 @@ class AtoDefaultGojsEditor {
9356
9224
  stroke: '#919CA5',
9357
9225
  width: 40,
9358
9226
  height: 40, // Match the panel's height
9359
- })
9360
- // this.$(
9361
- // go.TextBlock,
9362
- // {
9363
- // name: 'textBlock',
9364
- // margin: 4,
9365
- // text: '\uf0da', // Mã Unicode tương ứng với fa-caret-left
9366
- // font: '900 12px "Font Awesome 6 Pro"',
9367
- // stroke: 'white', // Đặt màu chữ thành màu trắng
9368
- // cursor: 'pointer',
9369
- // visible: false,
9370
- // },
9371
- // new go.Binding('text', 'name', (_) => {
9372
- // switch (name) {
9373
- // case 'T':
9374
- // case 'B': {
9375
- // return '\uf0d7';
9376
- // }
9377
- // case 'L':
9378
- // case 'R': {
9379
- // return '\uf0da';
9380
- // }
9381
- // default: {
9382
- // return '\uf0d7';
9383
- // }
9384
- // }
9385
- // }),
9386
- // ),
9387
- );
9227
+ }));
9388
9228
  }
9389
9229
  makePort(name, align, spot, output, input) {
9390
9230
  // if (this._initialOptions.isReadOnly) {
@@ -9399,9 +9239,7 @@ class AtoDefaultGojsEditor {
9399
9239
  width: horizontal ? NaN : 8,
9400
9240
  height: !horizontal ? NaN : 8,
9401
9241
  alignment: align,
9402
- stretch: horizontal
9403
- ? go.GraphObject.Horizontal
9404
- : go.GraphObject.Vertical,
9242
+ stretch: horizontal ? go.GraphObject.Horizontal : go.GraphObject.Vertical,
9405
9243
  portId: name,
9406
9244
  fromSpot: spot,
9407
9245
  fromLinkable: output,
@@ -9450,12 +9288,10 @@ class AtoDefaultGojsEditor {
9450
9288
  return false;
9451
9289
  }
9452
9290
  if (data?.flowOfPlantCell) {
9453
- if (data?.flowOfPlantCell === ATO_ENUM_FLOW_DIRECTION.INFLOW &&
9454
- name === 'L') {
9291
+ if (data?.flowOfPlantCell === ATO_ENUM_FLOW_DIRECTION.INFLOW && name === 'L') {
9455
9292
  return true;
9456
9293
  }
9457
- if (data?.flowOfPlantCell === ATO_ENUM_FLOW_DIRECTION.OUTFLOW &&
9458
- name === 'R') {
9294
+ if (data?.flowOfPlantCell === ATO_ENUM_FLOW_DIRECTION.OUTFLOW && name === 'R') {
9459
9295
  return true;
9460
9296
  }
9461
9297
  return false;
@@ -9549,84 +9385,7 @@ class AtoDefaultGojsEditor {
9549
9385
  // stroke: AtoGojsEditorModel.ENUM_COLORS.RESOLUTION_BLUE,
9550
9386
  strokeWidth: 2,
9551
9387
  // strokeDashArray: [5, 5],
9552
- })
9553
- // this.$(go.Placeholder),
9554
- // this.$(go.Placeholder, { padding: new go.Margin(0, 0, 0, 0) }),
9555
- )
9556
- // this.$(go.TextBlock, title, {
9557
- // row: 0,
9558
- // margin: new go.Margin(0, 0, 0, 0),
9559
- // stroke: '#444444',
9560
- // font: 'normal 10pt Arial',
9561
- // textAlign: 'center',
9562
- // alignment: go.Spot.Left,
9563
- // },
9564
- // new go.Binding('text', 'key').makeTwoWay(),),
9565
- // this.$(
9566
- // go.Panel,
9567
- // 'Table',
9568
- // {
9569
- // alignment: go.Spot.TopLeft,
9570
- // alignmentFocus: new go.Spot(0, 0, -10, -10),
9571
- // // padding: new go.Margin(0, 0, 50, 0),
9572
- // },
9573
- // this.$(
9574
- // go.Panel,
9575
- // 'Horizontal',
9576
- // {
9577
- // row: 0,
9578
- // alignment: go.Spot.Left,
9579
- // },
9580
- // this.$(go.Picture, icon, {
9581
- // row: 0,
9582
- // // alignment: go.Spot.Center,
9583
- // alignment: go.Spot.Left,
9584
- // maxSize: new go.Size(40, 40),
9585
- // imageStretch: go.GraphObject.Uniform,
9586
- // }),
9587
- // this.$(
9588
- // go.Panel,
9589
- // 'Table',
9590
- // {
9591
- // column: 1,
9592
- // defaultAlignment: go.Spot.Left,
9593
- // alignmentFocus: new go.Spot(0, 0, 0, 20),
9594
- // },
9595
- // this.$(go.TextBlock, title, {
9596
- // row: 0,
9597
- // margin: new go.Margin(3, 3, 5, 10),
9598
- // // maxSize: new go.Size(size.w - 20, NaN),
9599
- // stroke: '#444444',
9600
- // font: 'normal 10pt Arial',
9601
- // textAlign: 'center',
9602
- // alignment: go.Spot.Left,
9603
- // }),
9604
- // this.$(
9605
- // go.TextBlock,
9606
- // {
9607
- // row: 1,
9608
- // margin: new go.Margin(0, 3, 3, 10),
9609
- // editable: true,
9610
- // // maxSize: new go.Size(size.w - 20, 40),
9611
- // stroke: '#000D42',
9612
- // font: 'bold 10pt Arial',
9613
- // textAlign: 'center',
9614
- // wrap: go.TextBlock.None,
9615
- // overflow: go.TextBlock.OverflowEllipsis,
9616
- // },
9617
- // new go.Binding('text', 'name').makeTwoWay(),
9618
- // {
9619
- // // define a tooltip for each node that displays the color as text
9620
- // toolTip: this.$(
9621
- // 'ToolTip',
9622
- // this.$(go.TextBlock, { margin: 4 }, new go.Binding('text', 'name')),
9623
- // ), // end of Adornment
9624
- // },
9625
- // ),
9626
- // ),
9627
- // ),
9628
- // ),
9629
- );
9388
+ })));
9630
9389
  this.myDiagram.groupTemplateMap.set(title, node);
9631
9390
  }
9632
9391
  makeGroupTemplate(icon, title, size = { w: 80, h: 80 }) {
@@ -9763,9 +9522,7 @@ class AtoDefaultGojsEditor {
9763
9522
  // imageStretch: go.GraphObject.Uniform,
9764
9523
  // margin: new go.Margin(130, 0, 0, 0),
9765
9524
  }, new go.Binding('margin', 'margin'), new go.Binding('width', 'width'), new go.Binding('height', 'height'), new go.Binding('source', '', (data) => {
9766
- return data?.source
9767
- ? data?.source
9768
- : AtoGojsEditorModel.IMAGE_RO_WATER_TREATMENT_PATH;
9525
+ return data?.source ? data?.source : AtoGojsEditorModel.IMAGE_RO_WATER_TREATMENT_PATH;
9769
9526
  }))));
9770
9527
  this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.IMAGE_TEMPLATE, node);
9771
9528
  }
@@ -9866,8 +9623,7 @@ class AtoDefaultGojsEditor {
9866
9623
  itemTemplate: this.$(go.Panel, 'TableRow', {
9867
9624
  cursor: 'pointer',
9868
9625
  click: (e, obj) => {
9869
- if (obj.panel.part.data?.dataTable[obj.row]?.isEditable ===
9870
- false) {
9626
+ if (obj.panel.part.data?.dataTable[obj.row]?.isEditable === false) {
9871
9627
  return;
9872
9628
  }
9873
9629
  self.onClikParamOfTable.emit({
@@ -9926,8 +9682,7 @@ class AtoDefaultGojsEditor {
9926
9682
  ? `${data?.tagName || ''} `
9927
9683
  : ''}${data?.value}`;
9928
9684
  }), new go.Binding('visible', '', (data) => {
9929
- if (!!this._initialOptions.isReadOnly &&
9930
- data?.tagName) {
9685
+ if (!!this._initialOptions.isReadOnly && data?.tagName) {
9931
9686
  return true;
9932
9687
  }
9933
9688
  return !!data?.value;
@@ -9941,9 +9696,7 @@ class AtoDefaultGojsEditor {
9941
9696
  return data.color;
9942
9697
  }), new go.Binding('maxSize', '', (data) => {
9943
9698
  if (!data?.isReadOnly && !this._initialOptions.isReadOnly) {
9944
- return new go.Size(data?.maxSizeValue?.width
9945
- ? data?.maxSizeValue?.width - 15
9946
- : NaN, data?.maxSizeValue?.height ?? NaN);
9699
+ return new go.Size(data?.maxSizeValue?.width ? data?.maxSizeValue?.width - 15 : NaN, data?.maxSizeValue?.height ?? NaN);
9947
9700
  }
9948
9701
  return data?.maxSizeValue;
9949
9702
  }), new go.Binding('font', '', (data) => {
@@ -9963,13 +9716,11 @@ class AtoDefaultGojsEditor {
9963
9716
  height: 14,
9964
9717
  width: 14,
9965
9718
  }, new go.Binding('visible', '', (data, panel) => {
9966
- return (!data?.isReadOnly && !this._initialOptions.isReadOnly);
9719
+ return !data?.isReadOnly && !this._initialOptions.isReadOnly;
9967
9720
  }), new go.Binding('opacity', '', (data, panel) => {
9968
9721
  return data?.isEditable === false ? 0.6 : 1;
9969
9722
  })))),
9970
- }
9971
- // new go.Binding('text', 'name')
9972
- )));
9723
+ })));
9973
9724
  this.myDiagram.nodeTemplateMap.set(AtoGojsEditorModel.ENUM_TEMPLATES.PARAM_TABLE, node);
9974
9725
  }
9975
9726
  makeMassBalance() {
@@ -10067,7 +9818,9 @@ class AtoDefaultGojsEditor {
10067
9818
  fill: '#FCFCFD',
10068
9819
  stroke: AtoGojsEditorModel.ENUM_COLORS.RESOLUTION_BLUE,
10069
9820
  strokeWidth: 2,
10070
- }), this.$(go.Placeholder, new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify), { padding: new go.Margin(0, 0, 0, 0) })), this.$(go.Panel, 'Spot', {
9821
+ }), this.$(go.Placeholder, new go.Binding('location', 'loc', go.Point.parse).makeTwoWay(go.Point.stringify), {
9822
+ padding: new go.Margin(0, 0, 0, 0),
9823
+ })), this.$(go.Panel, 'Spot', {
10071
9824
  width: 0,
10072
9825
  height: 0,
10073
9826
  alignment: new go.Spot(0, 0.5, 0, 112),
@@ -10356,8 +10109,7 @@ class AtoDefaultGojsEditor {
10356
10109
  // : node?.layout;
10357
10110
  if (data?.layoutValue !== data?.layoutValueClone) {
10358
10111
  data.layoutValueClone = data?.layoutValue;
10359
- return data?.layoutValue ===
10360
- AtoGojsEditorModel.ENUM_LAYOUT_EDITOR.AUTO
10112
+ return data?.layoutValue === AtoGojsEditorModel.ENUM_LAYOUT_EDITOR.AUTO
10361
10113
  ? self.$(go.LayeredDigraphLayout, { direction: 0 })
10362
10114
  : self.$(go.Layout);
10363
10115
  }
@@ -10518,82 +10270,7 @@ class AtoDefaultGojsEditor {
10518
10270
  AtoDefaultGojsEditor.ENUM_ACTIONS.DETAILS,
10519
10271
  AtoDefaultGojsEditor.ENUM_ACTIONS.OUTFLOW,
10520
10272
  AtoDefaultGojsEditor.ENUM_ACTIONS.DELETE,
10521
- ])
10522
- // this.$(
10523
- // // Edit Text
10524
- // 'Button',
10525
- // {
10526
- // click: self.editTextGroupZone,
10527
- // 'ButtonBorder.strokeWidth': 0,
10528
- // 'ButtonBorder.fill': 'white',
10529
- // },
10530
- // this.$(go.TextBlock, {
10531
- // margin: 4,
10532
- // text: '\ue1bf',
10533
- // font: '20px "Font Awesome 6 Pro"',
10534
- // cursor: 'pointer',
10535
- // stroke: '#2c2c2c',
10536
- // }),
10537
- // ),
10538
- // this.$(
10539
- // // Open Detail
10540
- // 'Button',
10541
- // {
10542
- // click: (e, obj: any) => {
10543
- // const node = obj.part;
10544
- // self.onOpenDetail.emit({
10545
- // node,
10546
- // });
10547
- // },
10548
- // 'ButtonBorder.strokeWidth': 0,
10549
- // 'ButtonBorder.fill': 'white',
10550
- // },
10551
- //
10552
- // this.$(go.TextBlock, {
10553
- // margin: 4,
10554
- // text: '\ue49a',
10555
- // font: '20px "Font Awesome 6 Pro"',
10556
- // cursor: 'pointer',
10557
- // }),
10558
- // ),
10559
- // !this._initialOptions.isReadOnly
10560
- // ? this.$(
10561
- // 'Button',
10562
- // {
10563
- // actionMove: self.dragNewNode, // defined below, to support dragging from the button
10564
- // _dragData: {
10565
- // type: AtoGojsEditorModel.ENUM_TEMPLATES.TEXT_NODE,
10566
- // name: 0,
10567
- // color: AtoGojsEditorModel.ENUM_COLORS.BLUE,
10568
- // },
10569
- // click: self.clickNewNode, // defined below, to support a click on the button
10570
- // 'ButtonBorder.strokeWidth': 0,
10571
- // 'ButtonBorder.fill': 'white',
10572
- // },
10573
- // this.$(go.TextBlock, {
10574
- // margin: 4,
10575
- // text: '\ue157',
10576
- // font: '20px "Font Awesome 6 Pro"',
10577
- // cursor: 'pointer',
10578
- // stroke: '#2c2c2c',
10579
- // }),
10580
- // )
10581
- // : {},
10582
- // this.$(
10583
- // 'Button',
10584
- // {
10585
- // click: self.deleteNode,
10586
- // 'ButtonBorder.strokeWidth': 0,
10587
- // 'ButtonBorder.fill': 'white',
10588
- // },
10589
- // this.$(go.TextBlock, {
10590
- // margin: 4,
10591
- // text: '\uf2ed',
10592
- // font: '20px "Font Awesome 6 Pro"',
10593
- // cursor: 'pointer',
10594
- // }),
10595
- // ),
10596
- )),
10273
+ ]))),
10597
10274
  }, this.$(go.Panel, 'Auto', this.$(go.Shape, 'RoundedRectangle', {
10598
10275
  fill: 'transparent',
10599
10276
  stroke: AtoGojsEditorModel.ENUM_COLORS.RESOLUTION_BLUE,
@@ -10707,10 +10384,7 @@ class AtoDefaultGojsEditor {
10707
10384
  value: x?.quantity,
10708
10385
  unit: x?.unit,
10709
10386
  });
10710
- return (formatted.shortenedNumber +
10711
- ' ' +
10712
- formatted.unitPrefixes +
10713
- x?.unit ?? '');
10387
+ return formatted.shortenedNumber + ' ' + formatted.unitPrefixes + x?.unit ?? '';
10714
10388
  }), new go.Binding('visible', 'data', (x) => typeof x?.quantity === 'number')), this.$(go.TextBlock, {
10715
10389
  margin: new go.Margin(0, 5, 10, 0),
10716
10390
  textAlign: 'center',
@@ -10965,8 +10639,7 @@ class AtoDefaultGojsEditor {
10965
10639
  // return;
10966
10640
  // }
10967
10641
  // const newDocument = newWindow?.document;
10968
- if (!this.myDiagram?.model?.nodeDataArray?.length &&
10969
- !this.myDiagram?.model?.linkDataArray?.length) {
10642
+ if (!this.myDiagram?.model?.nodeDataArray?.length && !this.myDiagram?.model?.linkDataArray?.length) {
10970
10643
  return;
10971
10644
  }
10972
10645
  const svg = this.myDiagram.makeSvg({
@@ -10987,8 +10660,7 @@ class AtoDefaultGojsEditor {
10987
10660
  svgElement.setAttribute('stroke', 'rgba(64, 181, 206, 0.6)');
10988
10661
  }
10989
10662
  // Empty Value
10990
- if (graphObject?.name === 'textBlockValue' ||
10991
- graphObject?.name === 'textBlockUnitPrefixes') {
10663
+ if (graphObject?.name === 'textBlockValue' || graphObject?.name === 'textBlockUnitPrefixes') {
10992
10664
  svgElement.textContent = '';
10993
10665
  }
10994
10666
  if (svgElement.clipPath) {
@@ -11037,6 +10709,45 @@ class AtoDefaultGojsEditor {
11037
10709
  this.menuTrigger.openMenu();
11038
10710
  }
11039
10711
  }
10712
+ // openActionMenu(data: {
10713
+ // e: any,
10714
+ // obj: any,
10715
+ // type?: string;
10716
+ // }) {
10717
+ // let mousePt = this.myDiagram.lastInput.viewPoint;
10718
+ // let template = document.getElementById(this.actionMenuId);
10719
+ // switch (data?.type) {
10720
+ // case 'droplist': {
10721
+ // // When this node is clicked, adjust the menu position
10722
+ // const buttonRect = data?.obj?.part?.actualBounds;
10723
+ // const diagram = data?.e.diagram;
10724
+ // const point = diagram.transformDocToView(new go.Point(buttonRect?.x, buttonRect?.bottom));
10725
+ // mousePt = {
10726
+ // x: point.x,
10727
+ // y: point.y
10728
+ // }
10729
+ // break;
10730
+ // }
10731
+ // case 'action': {
10732
+ // mousePt = this.myDiagram.lastInput.viewPoint;
10733
+ // this.optionList = this.actions;
10734
+ // template = document.getElementById(this.actionMenuId);
10735
+ // break;
10736
+ // }
10737
+ // default: {
10738
+ // mousePt = this.myDiagram.lastInput.viewPoint;
10739
+ // this.optionList = this.actions;
10740
+ // template = document.getElementById(this.actionMenuId);
10741
+ // }
10742
+ // }
10743
+ // if (template) {
10744
+ // template.style.display = '';
10745
+ // template.style.position = 'absolute';
10746
+ // template.style.left = mousePt.x + 'px';
10747
+ // template.style.top = mousePt.y + 'px';
10748
+ // this.menuTrigger.openMenu();
10749
+ // }
10750
+ // }
11040
10751
  unsubscribeAll() {
11041
10752
  if (this._subscriptionList) {
11042
10753
  this._subscriptionList.unsubscribe();