ato-water-lib 0.0.33 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- package/ng-package.json +11 -0
- package/package.json +3 -22
- package/src/lib/ato-water-lib.component.spec.ts +23 -0
- package/src/lib/ato-water-lib.component.ts +15 -0
- package/src/lib/ato-water-lib.module.ts +31 -0
- package/src/lib/ato-water-lib.service.spec.ts +16 -0
- package/src/lib/ato-water-lib.service.ts +9 -0
- package/src/lib/components/asset-flow/asset-flow.component.html +21 -0
- package/src/lib/components/asset-flow/asset-flow.component.scss +4 -0
- package/src/lib/components/asset-flow/asset-flow.component.spec.ts +23 -0
- package/src/lib/components/asset-flow/asset-flow.component.ts +137 -0
- package/src/lib/components/asset-params-view/asset-params-view.component.html +85 -0
- package/src/lib/components/asset-params-view/asset-params-view.component.scss +37 -0
- package/src/lib/components/asset-params-view/asset-params-view.component.spec.ts +23 -0
- package/src/lib/components/asset-params-view/asset-params-view.component.ts +16 -0
- package/src/lib/components/flow-diagram-lib/flow-diagram-lib.component.css +0 -0
- package/src/lib/components/flow-diagram-lib/flow-diagram-lib.component.html +25 -0
- package/src/lib/components/flow-diagram-lib/flow-diagram-lib.component.ts +69 -0
- package/src/lib/constants/applicable-prefixes-const.ts +452 -0
- package/src/lib/constants/base64.const.ts +5 -0
- package/src/lib/constants/components-group-const.ts +1637 -0
- package/src/lib/constants/icon-base64.const.ts +3 -0
- package/src/lib/constants/icon-svg.const.ts +8 -0
- package/src/lib/constants/key.const.ts +5 -0
- package/src/lib/constants/plant.constant.ts +52 -0
- package/src/lib/constants/value.const.ts +822 -0
- package/src/lib/directive/ato-loading.directive.ts +55 -0
- package/src/lib/directive/ng-var.directive.ts +28 -0
- package/src/lib/models/default-gojs-editor.model.ts +4906 -0
- package/{lib/models/gojs-data.model.d.ts → src/lib/models/gojs-data.model.ts} +3 -3
- package/src/lib/models/gojs-editor.model.ts +1901 -0
- package/src/lib/services/utils/utils.service.ts +141 -0
- package/{public-api.d.ts → src/public-api.ts} +10 -0
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2020/ato-water-lib.mjs +0 -5
- package/esm2020/lib/ato-water-lib.component.mjs +0 -19
- package/esm2020/lib/ato-water-lib.module.mjs +0 -49
- package/esm2020/lib/ato-water-lib.service.mjs +0 -14
- package/esm2020/lib/components/asset-flow/asset-flow.component.mjs +0 -121
- package/esm2020/lib/components/asset-params-view/asset-params-view.component.mjs +0 -26
- package/esm2020/lib/components/flow-diagram-lib/flow-diagram-lib.component.mjs +0 -54
- package/esm2020/lib/constants/applicable-prefixes-const.mjs +0 -441
- package/esm2020/lib/constants/base64.const.mjs +0 -5
- package/esm2020/lib/constants/components-group-const.mjs +0 -1476
- package/esm2020/lib/constants/icon-base64.const.mjs +0 -4
- package/esm2020/lib/constants/key.const.mjs +0 -4
- package/esm2020/lib/constants/plant.constant.mjs +0 -51
- package/esm2020/lib/constants/value.const.mjs +0 -782
- package/esm2020/lib/directive/ato-loading.directive.mjs +0 -55
- package/esm2020/lib/directive/ng-var.directive.mjs +0 -31
- package/esm2020/lib/models/default-gojs-editor.model.mjs +0 -3227
- package/esm2020/lib/models/gojs-data.model.mjs +0 -6
- package/esm2020/lib/models/gojs-editor.model.mjs +0 -1754
- package/esm2020/lib/services/utils/utils.service.mjs +0 -133
- package/esm2020/public-api.mjs +0 -15
- package/fesm2015/ato-water-lib.mjs +0 -8018
- package/fesm2015/ato-water-lib.mjs.map +0 -1
- package/fesm2020/ato-water-lib.mjs +0 -8205
- package/fesm2020/ato-water-lib.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/ato-water-lib.component.d.ts +0 -5
- package/lib/ato-water-lib.module.d.ts +0 -13
- package/lib/ato-water-lib.service.d.ts +0 -6
- package/lib/components/asset-flow/asset-flow.component.d.ts +0 -1336
- package/lib/components/asset-params-view/asset-params-view.component.d.ts +0 -10
- package/lib/components/flow-diagram-lib/flow-diagram-lib.component.d.ts +0 -16
- package/lib/constants/applicable-prefixes-const.d.ts +0 -162
- package/lib/constants/base64.const.d.ts +0 -3
- package/lib/constants/components-group-const.d.ts +0 -1561
- package/lib/constants/icon-base64.const.d.ts +0 -3
- package/lib/constants/key.const.d.ts +0 -1
- package/lib/constants/plant.constant.d.ts +0 -7
- package/lib/constants/value.const.d.ts +0 -71
- package/lib/directive/ato-loading.directive.d.ts +0 -14
- package/lib/directive/ng-var.directive.d.ts +0 -12
- package/lib/models/default-gojs-editor.model.d.ts +0 -197
- package/lib/models/gojs-editor.model.d.ts +0 -436
- package/lib/services/utils/utils.service.d.ts +0 -24
package/ng-package.json
ADDED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ato-water-lib",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.34",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@angular/common": "^15.1.0 || ^16.2.0",
|
6
6
|
"@angular/core": "^15.1.0 || ^16.2.0",
|
@@ -11,24 +11,5 @@
|
|
11
11
|
"dependencies": {
|
12
12
|
"tslib": "^2.3.0"
|
13
13
|
},
|
14
|
-
"sideEffects": false
|
15
|
-
|
16
|
-
"es2020": "fesm2020/ato-water-lib.mjs",
|
17
|
-
"esm2020": "esm2020/ato-water-lib.mjs",
|
18
|
-
"fesm2020": "fesm2020/ato-water-lib.mjs",
|
19
|
-
"fesm2015": "fesm2015/ato-water-lib.mjs",
|
20
|
-
"typings": "index.d.ts",
|
21
|
-
"exports": {
|
22
|
-
"./package.json": {
|
23
|
-
"default": "./package.json"
|
24
|
-
},
|
25
|
-
".": {
|
26
|
-
"types": "./index.d.ts",
|
27
|
-
"esm2020": "./esm2020/ato-water-lib.mjs",
|
28
|
-
"es2020": "./fesm2020/ato-water-lib.mjs",
|
29
|
-
"es2015": "./fesm2015/ato-water-lib.mjs",
|
30
|
-
"node": "./fesm2015/ato-water-lib.mjs",
|
31
|
-
"default": "./fesm2020/ato-water-lib.mjs"
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
14
|
+
"sideEffects": false
|
15
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
2
|
+
|
3
|
+
import { AtoWaterLibComponent } from './ato-water-lib.component';
|
4
|
+
|
5
|
+
describe('AtoWaterLibComponent', () => {
|
6
|
+
let component: AtoWaterLibComponent;
|
7
|
+
let fixture: ComponentFixture<AtoWaterLibComponent>;
|
8
|
+
|
9
|
+
beforeEach(async () => {
|
10
|
+
await TestBed.configureTestingModule({
|
11
|
+
declarations: [ AtoWaterLibComponent ]
|
12
|
+
})
|
13
|
+
.compileComponents();
|
14
|
+
|
15
|
+
fixture = TestBed.createComponent(AtoWaterLibComponent);
|
16
|
+
component = fixture.componentInstance;
|
17
|
+
fixture.detectChanges();
|
18
|
+
});
|
19
|
+
|
20
|
+
it('should create', () => {
|
21
|
+
expect(component).toBeTruthy();
|
22
|
+
});
|
23
|
+
});
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { NgModule } from '@angular/core';
|
2
|
+
import { AtoWaterLibComponent } from './ato-water-lib.component';
|
3
|
+
import { AtoFlowDiagramLibComponent } from './components/flow-diagram-lib/flow-diagram-lib.component';
|
4
|
+
import { AssetFlowComponent } from './components/asset-flow/asset-flow.component';
|
5
|
+
import { CommonModule } from '@angular/common';
|
6
|
+
import { AtoLoadingDirective } from './directive/ato-loading.directive';
|
7
|
+
import { AtoAssetParamsViewComponent } from './components/asset-params-view/asset-params-view.component';
|
8
|
+
import { AtoNgVarDirective } from './directive/ng-var.directive';
|
9
|
+
|
10
|
+
@NgModule({
|
11
|
+
declarations: [
|
12
|
+
AtoWaterLibComponent,
|
13
|
+
AtoFlowDiagramLibComponent,
|
14
|
+
AssetFlowComponent,
|
15
|
+
AtoLoadingDirective,
|
16
|
+
AtoAssetParamsViewComponent,
|
17
|
+
AtoNgVarDirective,
|
18
|
+
],
|
19
|
+
imports: [
|
20
|
+
CommonModule,
|
21
|
+
],
|
22
|
+
exports: [
|
23
|
+
AtoWaterLibComponent,
|
24
|
+
AtoFlowDiagramLibComponent,
|
25
|
+
AssetFlowComponent,
|
26
|
+
AtoLoadingDirective,
|
27
|
+
AtoAssetParamsViewComponent,
|
28
|
+
AtoNgVarDirective,
|
29
|
+
]
|
30
|
+
})
|
31
|
+
export class AtoWaterLibModule { }
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
2
|
+
|
3
|
+
import { AtoWaterLibService } from './ato-water-lib.service';
|
4
|
+
|
5
|
+
describe('AtoWaterLibService', () => {
|
6
|
+
let service: AtoWaterLibService;
|
7
|
+
|
8
|
+
beforeEach(() => {
|
9
|
+
TestBed.configureTestingModule({});
|
10
|
+
service = TestBed.inject(AtoWaterLibService);
|
11
|
+
});
|
12
|
+
|
13
|
+
it('should be created', () => {
|
14
|
+
expect(service).toBeTruthy();
|
15
|
+
});
|
16
|
+
});
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div class="h-100 d-flex flex-column flex-gap-3 flex-grow-1 overflow-auto px-3 pb-3">
|
2
|
+
<div class="h-100 d-flex flex-column" atoLoading [appLoading]="flowData === null">
|
3
|
+
<ato-flow-diagram-lib
|
4
|
+
*ngIf="flowData !== null"
|
5
|
+
#gjFlowDiagramTemp
|
6
|
+
[data]="flowData"
|
7
|
+
[initialOptions]="options"
|
8
|
+
(onClikParamOfTable)="onClickParamOfTable($event)"
|
9
|
+
[class]="!!isResponsiveView ? 'diagram-responsive-view' : 'flex-grow-1'"
|
10
|
+
></ato-flow-diagram-lib>
|
11
|
+
<div class="mt-2" *ngIf="isResponsiveView">
|
12
|
+
<ato-asset-params-view
|
13
|
+
#assetParamsViewTemp
|
14
|
+
[data]="dataTableAssetParams"
|
15
|
+
[isEditView]="true"
|
16
|
+
(clickParamTableRow)="onClickParamOfTable($event)"
|
17
|
+
></ato-asset-params-view>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
2
|
+
|
3
|
+
import { AssetFlowComponent } from './asset-flow.component';
|
4
|
+
|
5
|
+
describe('AssetFlowComponent', () => {
|
6
|
+
let component: AssetFlowComponent;
|
7
|
+
let fixture: ComponentFixture<AssetFlowComponent>;
|
8
|
+
|
9
|
+
beforeEach(async () => {
|
10
|
+
await TestBed.configureTestingModule({
|
11
|
+
declarations: [ AssetFlowComponent ]
|
12
|
+
})
|
13
|
+
.compileComponents();
|
14
|
+
|
15
|
+
fixture = TestBed.createComponent(AssetFlowComponent);
|
16
|
+
component = fixture.componentInstance;
|
17
|
+
fixture.detectChanges();
|
18
|
+
});
|
19
|
+
|
20
|
+
it('should create', () => {
|
21
|
+
expect(component).toBeTruthy();
|
22
|
+
});
|
23
|
+
});
|
@@ -0,0 +1,137 @@
|
|
1
|
+
import {
|
2
|
+
Component,
|
3
|
+
EventEmitter,
|
4
|
+
HostListener,
|
5
|
+
Input,
|
6
|
+
OnInit,
|
7
|
+
Output,
|
8
|
+
ViewChild,
|
9
|
+
} from '@angular/core';
|
10
|
+
import * as go from 'gojs';
|
11
|
+
import _ from 'lodash';
|
12
|
+
import { AtoGoJSBase64 } from '../../constants/base64.const';
|
13
|
+
import { ATO_ASSET_LAYERS, ATO_COMPONENTS_GROUP_DATA } from '../../constants/components-group-const';
|
14
|
+
import { AtoGoJSData } from '../../models/gojs-data.model';
|
15
|
+
import { AtoGojsEditorModel } from '../../models/gojs-editor.model';
|
16
|
+
import { AtoAssetParamsViewComponent } from '../asset-params-view/asset-params-view.component';
|
17
|
+
import { AtoFlowDiagramLibComponent } from '../flow-diagram-lib/flow-diagram-lib.component';
|
18
|
+
|
19
|
+
export interface AtoDefaultFlowData {
|
20
|
+
systemType: string;
|
21
|
+
isUseBase64?: boolean;
|
22
|
+
assetLayer?: string;
|
23
|
+
}
|
24
|
+
|
25
|
+
@Component({
|
26
|
+
selector: 'ato-asset-flow',
|
27
|
+
templateUrl: './asset-flow.component.html',
|
28
|
+
styleUrls: ['./asset-flow.component.scss'],
|
29
|
+
})
|
30
|
+
export class AssetFlowComponent implements OnInit {
|
31
|
+
@Input() assetLayer: string;
|
32
|
+
@ViewChild(AtoFlowDiagramLibComponent)
|
33
|
+
gjFlowDiagramTemp: AtoFlowDiagramLibComponent;
|
34
|
+
@ViewChild(AtoAssetParamsViewComponent)
|
35
|
+
assetParamsViewTemp: AtoAssetParamsViewComponent;
|
36
|
+
@Input() selectedComponent: any;
|
37
|
+
@Input() systemType: AtoGojsEditorModel.ENUM_TYPES;
|
38
|
+
@Output() onClickParamOfTableEvent: EventEmitter<any> =
|
39
|
+
new EventEmitter<any>();
|
40
|
+
@Input() isUseBase64 = false;
|
41
|
+
$ = go.GraphObject.make;
|
42
|
+
options = {
|
43
|
+
layout: this.$(go.LayeredDigraphLayout, {
|
44
|
+
// direction: 0,
|
45
|
+
}),
|
46
|
+
// isReadOnly: true,
|
47
|
+
};
|
48
|
+
@Input() flowData: AtoGoJSData = {} as AtoGoJSData;
|
49
|
+
|
50
|
+
// Reponsive
|
51
|
+
dataTableAssetParams: any[];
|
52
|
+
@Input() isResponsiveView = false;
|
53
|
+
@Input() getFlowDataCallBack: Function;
|
54
|
+
|
55
|
+
timeoutResizeWindow;
|
56
|
+
@HostListener('window:resize', ['$event'])
|
57
|
+
onResize(event: Event): void {
|
58
|
+
// Now only Support Cooling Tower Responsive
|
59
|
+
if (this.timeoutResizeWindow) {
|
60
|
+
clearTimeout(this.timeoutResizeWindow);
|
61
|
+
}
|
62
|
+
this.timeoutResizeWindow = setTimeout(() => {
|
63
|
+
this.checkResponsiveView();
|
64
|
+
this.updateLocationReponsive();
|
65
|
+
}, 1000);
|
66
|
+
}
|
67
|
+
|
68
|
+
checkResponsiveView() {
|
69
|
+
if (
|
70
|
+
this?.systemType ===
|
71
|
+
AtoGojsEditorModel.ENUM_TYPES.COOLING_TOWER
|
72
|
+
) {
|
73
|
+
this.isResponsiveView = window.innerWidth < 1024;
|
74
|
+
} else {
|
75
|
+
this.isResponsiveView = false;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
updateLocationReponsive() {
|
80
|
+
if (!this.flowData?.nodeDataArray) {
|
81
|
+
this.flowData = AssetFlowComponent.getDefaultFlowData({
|
82
|
+
systemType: this.systemType,
|
83
|
+
isUseBase64: this.isUseBase64,
|
84
|
+
assetLayer: this.assetLayer
|
85
|
+
});
|
86
|
+
}
|
87
|
+
_.forEach(
|
88
|
+
this.flowData?.nodeDataArray,
|
89
|
+
(node: any) => {
|
90
|
+
node = _.merge(node, node[`extendedData${this.isResponsiveView ? 'Responsive' : ''}`]);
|
91
|
+
}
|
92
|
+
);
|
93
|
+
this.setFlowData(_.cloneDeep(this.flowData));
|
94
|
+
}
|
95
|
+
|
96
|
+
ngOnInit() {
|
97
|
+
this.checkResponsiveView();
|
98
|
+
this.updateLocationReponsive();
|
99
|
+
}
|
100
|
+
onClickParamOfTable($event: any) {
|
101
|
+
this.onClickParamOfTableEvent.emit($event);
|
102
|
+
}
|
103
|
+
|
104
|
+
static getDefaultFlowData(defaultData: AtoDefaultFlowData) {
|
105
|
+
const flowData = {
|
106
|
+
..._.cloneDeep(ATO_COMPONENTS_GROUP_DATA)[
|
107
|
+
defaultData?.systemType
|
108
|
+
],
|
109
|
+
linkFromPortIdProperty: 'fromPort',
|
110
|
+
linkToPortIdProperty: 'toPort',
|
111
|
+
};
|
112
|
+
// assetLayer
|
113
|
+
flowData.nodeDataArray = _.filter(flowData.nodeDataArray, x => !x?.assetLayers || (x?.assetLayers && x?.assetLayers === (defaultData?.assetLayer ?? ATO_ASSET_LAYERS.FLOW)))
|
114
|
+
if (defaultData?.isUseBase64) {
|
115
|
+
const itemImageTemp = (flowData as AtoGoJSData)?.nodeDataArray?.find(
|
116
|
+
(x) => x?.type === 'Image Template'
|
117
|
+
);
|
118
|
+
if (itemImageTemp) {
|
119
|
+
itemImageTemp.source = AtoGoJSBase64[defaultData?.systemType];
|
120
|
+
}
|
121
|
+
}
|
122
|
+
return flowData;
|
123
|
+
}
|
124
|
+
|
125
|
+
setFlowData(data: AtoGoJSData) {
|
126
|
+
this.flowData = { ...data };
|
127
|
+
this.dataTableAssetParams = _.forEach(
|
128
|
+
this.flowData?.nodeDataArray?.filter(
|
129
|
+
(e) => e?.type === AtoGojsEditorModel.ENUM_TEMPLATES.PARAM_TABLE && e?.assetLayers?.includes(this?.assetLayer ?? ATO_ASSET_LAYERS.FLOW)
|
130
|
+
), x => {
|
131
|
+
if (!data?.isRefresh) {
|
132
|
+
x.isCollapsed = this.assetParamsViewTemp?.data?.find(y => y?.key === x?.key)?.isCollapsed;
|
133
|
+
}
|
134
|
+
}
|
135
|
+
);
|
136
|
+
}
|
137
|
+
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
<div class="d-flex flex-column flex-gap-2">
|
2
|
+
<div class="" *ngFor="let tableParam of data">
|
3
|
+
<ng-template
|
4
|
+
[ngTemplateOutlet]="tableParamTemplate"
|
5
|
+
[ngTemplateOutletContext]="{
|
6
|
+
data: tableParam
|
7
|
+
}"
|
8
|
+
></ng-template>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<ng-template #tableParamTemplate let-data="data">
|
13
|
+
<div
|
14
|
+
class="d-flex flex-column asset-param-item w-100"
|
15
|
+
[style.backgroundColor]="data?.color"
|
16
|
+
>
|
17
|
+
<div
|
18
|
+
class="d-flex align-items-center justify-content-between py-1 pl-1 pr-2 cursor-pointer"
|
19
|
+
(click)="data.isCollapsed = !data.isCollapsed"
|
20
|
+
>
|
21
|
+
<div class="font-size-14px flex-grow-1 text-truncate color-white">
|
22
|
+
{{ data?.title }}
|
23
|
+
</div>
|
24
|
+
<svg
|
25
|
+
*ngIf="data.isCollapsed"
|
26
|
+
xmlns="http://www.w3.org/2000/svg"
|
27
|
+
viewBox="0 0 320 512"
|
28
|
+
fill="#FFFF"
|
29
|
+
class="fa-solid font-size-14px color-white svg-15px"
|
30
|
+
>
|
31
|
+
<path
|
32
|
+
d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"
|
33
|
+
/>
|
34
|
+
</svg>
|
35
|
+
<svg
|
36
|
+
*ngIf="!data.isCollapsed"
|
37
|
+
xmlns="http://www.w3.org/2000/svg"
|
38
|
+
viewBox="0 0 448 512"
|
39
|
+
fill="#FFFF"
|
40
|
+
class="fa-solid font-size-14px color-white svg-15px"
|
41
|
+
>
|
42
|
+
<path
|
43
|
+
d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"
|
44
|
+
/>
|
45
|
+
</svg>
|
46
|
+
</div>
|
47
|
+
<div class="px-1 pb-1" *ngIf="!data.isCollapsed">
|
48
|
+
<div
|
49
|
+
class="table-asset-param-wrapper"
|
50
|
+
[style.backgroundColor]="data?.bgColor"
|
51
|
+
>
|
52
|
+
<table>
|
53
|
+
<tbody>
|
54
|
+
<tr
|
55
|
+
*ngFor="let itemTable of data?.dataTable"
|
56
|
+
(click)="onClickRowParam(itemTable)"
|
57
|
+
class="cursor-pointer"
|
58
|
+
>
|
59
|
+
<td
|
60
|
+
class="font-size-13px"
|
61
|
+
[style.borderColor]="data?.borderTable"
|
62
|
+
>
|
63
|
+
{{ itemTable?.name }}
|
64
|
+
</td>
|
65
|
+
<td
|
66
|
+
class="font-size-13px"
|
67
|
+
[style.borderColor]="data?.borderTable"
|
68
|
+
>
|
69
|
+
<div class="d-flex align-items-center">
|
70
|
+
<div
|
71
|
+
class="mr-auto font-size-13px text-truncate flex-grow-1"
|
72
|
+
[style.color]="itemTable?.color"
|
73
|
+
>
|
74
|
+
{{ itemTable?.value }}
|
75
|
+
</div>
|
76
|
+
<svg *ngIf="isEditView" class="svg-15px" fill="#333333" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M441 58.9L453.1 71c9.4 9.4 9.4 24.6 0 33.9L424 134.1 377.9 88 407 58.9c9.4-9.4 24.6-9.4 33.9 0zM209.8 256.2L344 121.9 390.1 168 255.8 302.2c-2.9 2.9-6.5 5-10.4 6.1l-58.5 16.7 16.7-58.5c1.1-3.9 3.2-7.5 6.1-10.4zM373.1 25L175.8 222.2c-8.7 8.7-15 19.4-18.3 31.1l-28.6 100c-2.4 8.4-.1 17.4 6.1 23.6s15.2 8.5 23.6 6.1l100-28.6c11.8-3.4 22.5-9.7 31.1-18.3L487 138.9c28.1-28.1 28.1-73.7 0-101.8L474.9 25C446.8-3.1 401.2-3.1 373.1 25zM88 64C39.4 64 0 103.4 0 152V424c0 48.6 39.4 88 88 88H360c48.6 0 88-39.4 88-88V312c0-13.3-10.7-24-24-24s-24 10.7-24 24V424c0 22.1-17.9 40-40 40H88c-22.1 0-40-17.9-40-40V152c0-22.1 17.9-40 40-40H200c13.3 0 24-10.7 24-24s-10.7-24-24-24H88z"/></svg>
|
77
|
+
</div>
|
78
|
+
</td>
|
79
|
+
</tr>
|
80
|
+
</tbody>
|
81
|
+
</table>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
</div>
|
85
|
+
</ng-template>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
.asset-param-item {
|
2
|
+
border-radius: 5px;
|
3
|
+
|
4
|
+
.table-asset-param-wrapper {
|
5
|
+
border-radius: 5px;
|
6
|
+
background-color: aliceblue;
|
7
|
+
table {
|
8
|
+
border-collapse: collapse;
|
9
|
+
width: 100%;
|
10
|
+
|
11
|
+
tbody {
|
12
|
+
tr {
|
13
|
+
td {
|
14
|
+
border: 1px solid red;
|
15
|
+
height: 30px;
|
16
|
+
padding: 4px;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
|
25
|
+
.color-white {
|
26
|
+
color: white;
|
27
|
+
}
|
28
|
+
|
29
|
+
.flex-gap-2 {
|
30
|
+
gap: 0.5rem;
|
31
|
+
}
|
32
|
+
|
33
|
+
.svg-15px {
|
34
|
+
width: 15px;
|
35
|
+
height: 15px;
|
36
|
+
flex: 0 0 15px;
|
37
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
2
|
+
|
3
|
+
import { AssetParamsViewComponent } from './asset-params-view.component';
|
4
|
+
|
5
|
+
describe('AssetParamsViewComponent', () => {
|
6
|
+
let component: AssetParamsViewComponent;
|
7
|
+
let fixture: ComponentFixture<AssetParamsViewComponent>;
|
8
|
+
|
9
|
+
beforeEach(async () => {
|
10
|
+
await TestBed.configureTestingModule({
|
11
|
+
declarations: [ AssetParamsViewComponent ]
|
12
|
+
})
|
13
|
+
.compileComponents();
|
14
|
+
|
15
|
+
fixture = TestBed.createComponent(AssetParamsViewComponent);
|
16
|
+
component = fixture.componentInstance;
|
17
|
+
fixture.detectChanges();
|
18
|
+
});
|
19
|
+
|
20
|
+
it('should create', () => {
|
21
|
+
expect(component).toBeTruthy();
|
22
|
+
});
|
23
|
+
});
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
2
|
+
|
3
|
+
@Component({
|
4
|
+
selector: 'ato-asset-params-view',
|
5
|
+
templateUrl: './asset-params-view.component.html',
|
6
|
+
styleUrls: ['./asset-params-view.component.scss']
|
7
|
+
})
|
8
|
+
export class AtoAssetParamsViewComponent {
|
9
|
+
@Input() isEditView = false;
|
10
|
+
@Input() data: any[] = [];
|
11
|
+
@Output() clickParamTableRow = new EventEmitter();
|
12
|
+
|
13
|
+
onClickRowParam(itemTable) {
|
14
|
+
this.clickParamTableRow.emit(itemTable);
|
15
|
+
}
|
16
|
+
}
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="w-100 h-100 gj-flow-diagram-wrapper" atoLoading [appLoading]="data === null || !!isLoading">
|
2
|
+
<div class="w-100 h-100 d-flex">
|
3
|
+
<!-- <button
|
4
|
+
id="actionMenuId"
|
5
|
+
class="invisible-btn"
|
6
|
+
mat-button
|
7
|
+
[matMenuTriggerFor]="menu"
|
8
|
+
#menuTrigger="matMenuTrigger"
|
9
|
+
></button>
|
10
|
+
<mat-menu #menu="matMenu">
|
11
|
+
<button mat-menu-item *ngFor="let item of actions" (click)="item?.onClick($event)">
|
12
|
+
<div class="d-flex flex-gap-2">
|
13
|
+
<div><i class="{{ item?.iconClassName }}"></i></div>
|
14
|
+
<div>{{ item?.name }}</div>
|
15
|
+
</div>
|
16
|
+
</button>
|
17
|
+
</mat-menu> -->
|
18
|
+
|
19
|
+
<div #myDiagramDivTemp [id]="myDiagramDiv" class="flex-grow-1"></div>
|
20
|
+
<div *ngIf="initialOptions?.isReadOnly && !data?.nodeDataArray?.length" class="empty-data">
|
21
|
+
<!-- <nz-empty nzNotFoundImage="simple"></nz-empty> -->
|
22
|
+
No Data
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
|
2
|
+
import _ from 'lodash';
|
3
|
+
|
4
|
+
import { AtoDefaultGojsEditor } from '../../models/default-gojs-editor.model';
|
5
|
+
import { AtoGojsEditorModel } from '../../models/gojs-editor.model';
|
6
|
+
|
7
|
+
@Component({
|
8
|
+
selector: 'ato-flow-diagram-lib',
|
9
|
+
templateUrl: './flow-diagram-lib.component.html',
|
10
|
+
styleUrls: ['./flow-diagram-lib.component.css']
|
11
|
+
})
|
12
|
+
export class AtoFlowDiagramLibComponent extends AtoDefaultGojsEditor implements OnInit {
|
13
|
+
@ViewChild('myDiagramDivTemp') myDiagramDivTemp: any;
|
14
|
+
_data: any = null;
|
15
|
+
@Input() set data(v) {
|
16
|
+
this._data = v;
|
17
|
+
this.loadDiagram();
|
18
|
+
}
|
19
|
+
|
20
|
+
@Input() isLoading = false;
|
21
|
+
|
22
|
+
get data() {
|
23
|
+
return this._data;
|
24
|
+
}
|
25
|
+
|
26
|
+
constructor(
|
27
|
+
_elRef: ElementRef,
|
28
|
+
) {
|
29
|
+
super(_elRef);
|
30
|
+
this.actions = [
|
31
|
+
AtoDefaultGojsEditor.ACTIONS[AtoDefaultGojsEditor.ENUM_ACTIONS.DETAILS],
|
32
|
+
AtoDefaultGojsEditor.ACTIONS[AtoDefaultGojsEditor.ENUM_ACTIONS.DELETE],
|
33
|
+
];
|
34
|
+
this.unsubscribeAll();
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
ngOnInit(): void {
|
40
|
+
this.addSubscribes(
|
41
|
+
this.committedTransactionSubject?.subscribe((e) => {
|
42
|
+
this.onModelChangeListenerEvent.emit(e);
|
43
|
+
}),
|
44
|
+
// this._GjUtilsService?.updateNameDataBox$?.subscribe((rs) => {
|
45
|
+
// if (rs && rs?.key) {
|
46
|
+
// const node = this.myDiagram.findNodeForKey(rs?.key);
|
47
|
+
// this.myDiagram.model.setDataProperty(node?.data, 'name', rs?.name);
|
48
|
+
// }
|
49
|
+
// }),
|
50
|
+
);
|
51
|
+
}
|
52
|
+
|
53
|
+
loadDiagram() {
|
54
|
+
this.editor = new AtoGojsEditorModel({
|
55
|
+
class: 'go.GraphLinksModel',
|
56
|
+
nodeCategoryProperty: 'type',
|
57
|
+
...this.data,
|
58
|
+
});
|
59
|
+
}
|
60
|
+
|
61
|
+
findNodeForKey(key: number | string) {
|
62
|
+
this.myDiagram.select(this.myDiagram.findNodeForKey(key));
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|