@acorex/modules 19.1.9 → 19.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/acorex-modules-notification-management.mjs +240 -240
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-organization-managment-chart-design.page-eE-nOaMw.mjs +305 -0
- package/fesm2022/acorex-modules-organization-managment-chart-design.page-eE-nOaMw.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment-chart.entity-C_1rAJrs.mjs +257 -0
- package/fesm2022/acorex-modules-organization-managment-chart.entity-C_1rAJrs.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment-company.entity-5qijWD6i.mjs +199 -0
- package/fesm2022/acorex-modules-organization-managment-company.entity-5qijWD6i.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment-department.entity-BW18skLD.mjs +199 -0
- package/fesm2022/acorex-modules-organization-managment-department.entity-BW18skLD.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment-employment.entity-D28NBRYg.mjs +199 -0
- package/fesm2022/acorex-modules-organization-managment-employment.entity-D28NBRYg.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment-position.entity-DhndysSH.mjs +199 -0
- package/fesm2022/acorex-modules-organization-managment-position.entity-DhndysSH.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment.mjs +482 -0
- package/fesm2022/acorex-modules-organization-managment.mjs.map +1 -0
- package/fesm2022/acorex-modules-security-management.mjs +55 -55
- package/fesm2022/acorex-modules-security-management.mjs.map +1 -1
- package/notification-management/lib/entities/index.d.ts +1 -0
- package/organization-managment/README.md +3 -0
- package/organization-managment/index.d.ts +8 -0
- package/organization-managment/lib/const.d.ts +38 -0
- package/organization-managment/lib/entities/chart/chart.entity.d.ts +3 -0
- package/organization-managment/lib/entities/chart/chart.module.d.ts +6 -0
- package/organization-managment/lib/entities/chart/chart.service.d.ts +10 -0
- package/organization-managment/lib/entities/chart/chart.types.d.ts +6 -0
- package/organization-managment/lib/entities/company/company.entity.d.ts +3 -0
- package/organization-managment/lib/entities/company/company.module.d.ts +6 -0
- package/organization-managment/lib/entities/company/company.service.d.ts +10 -0
- package/organization-managment/lib/entities/company/company.types.d.ts +4 -0
- package/organization-managment/lib/entities/department/department.entity.d.ts +3 -0
- package/organization-managment/lib/entities/department/department.module.d.ts +6 -0
- package/organization-managment/lib/entities/department/department.service.d.ts +10 -0
- package/organization-managment/lib/entities/department/department.types.d.ts +4 -0
- package/organization-managment/lib/entities/employment/employment.entity.d.ts +3 -0
- package/organization-managment/lib/entities/employment/employment.module.d.ts +6 -0
- package/organization-managment/lib/entities/employment/employment.service.d.ts +10 -0
- package/organization-managment/lib/entities/employment/employment.types.d.ts +4 -0
- package/organization-managment/lib/entities/index.d.ts +5 -0
- package/organization-managment/lib/entities/position/position.entity.d.ts +3 -0
- package/organization-managment/lib/entities/position/position.module.d.ts +6 -0
- package/organization-managment/lib/entities/position/position.service.d.ts +10 -0
- package/organization-managment/lib/entities/position/position.types.d.ts +4 -0
- package/organization-managment/lib/entity.provider.d.ts +10 -0
- package/organization-managment/lib/menu.provider.d.ts +5 -0
- package/organization-managment/lib/organization-managment.module.d.ts +13 -0
- package/organization-managment/lib/pages/chart-design/add-item/add-item.component.d.ts +14 -0
- package/organization-managment/lib/pages/chart-design/chart-design.page.d.ts +26 -0
- package/organization-managment/lib/pages/chart-design/chart-design.service.d.ts +23 -0
- package/organization-managment/lib/pages/chart-design/chart.type.d.ts +9 -0
- package/organization-managment/lib/setting.provider.d.ts +4 -0
- package/organization-managment/lib/workflows/chart.workflow.d.ts +12 -0
- package/package.json +11 -7
- package/security-management/index.d.ts +1 -0
- package/security-management/lib/entities/index.d.ts +3 -0
@@ -0,0 +1,305 @@
|
|
1
|
+
import * as i1$1 from '@acorex/components/menu';
|
2
|
+
import { AXMenuModule } from '@acorex/components/menu';
|
3
|
+
import { AXPopupService } from '@acorex/components/popup';
|
4
|
+
import * as am5 from '@amcharts/amcharts5';
|
5
|
+
import * as am5hierarchy from '@amcharts/amcharts5/hierarchy';
|
6
|
+
import am5themes_Animated from '@amcharts/amcharts5/themes/Animated';
|
7
|
+
import am5themes_Responsive from '@amcharts/amcharts5/themes/Responsive';
|
8
|
+
import * as i0 from '@angular/core';
|
9
|
+
import { inject, Injectable, Component, signal, afterNextRender, ViewChild } from '@angular/core';
|
10
|
+
import * as i2 from '@acorex/components/button';
|
11
|
+
import { AXButtonModule } from '@acorex/components/button';
|
12
|
+
import { AXDataSource } from '@acorex/components/common';
|
13
|
+
import * as i4 from '@acorex/components/form';
|
14
|
+
import { AXFormModule } from '@acorex/components/form';
|
15
|
+
import * as i3 from '@acorex/components/label';
|
16
|
+
import { AXLabelModule } from '@acorex/components/label';
|
17
|
+
import { AXBasePageComponent } from '@acorex/components/page';
|
18
|
+
import * as i5 from '@acorex/components/search-box';
|
19
|
+
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
20
|
+
import * as i1 from '@acorex/components/select-box';
|
21
|
+
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
22
|
+
import { AXMOrganizationManagementCompanyEntityService, AXMOrganizationManagementDepartmentEntityService, AXMOrganizationManagementEmploymentEntityService, AXMOrganizationManagementPositionEntityService, AXMOrganizationManagementChartEntityService } from './acorex-modules-organization-managment.mjs';
|
23
|
+
|
24
|
+
class AXMChartDesignService {
|
25
|
+
constructor() {
|
26
|
+
this.companyService = inject(AXMOrganizationManagementCompanyEntityService);
|
27
|
+
this.departmentService = inject(AXMOrganizationManagementDepartmentEntityService);
|
28
|
+
this.employmentService = inject(AXMOrganizationManagementEmploymentEntityService);
|
29
|
+
this.positionService = inject(AXMOrganizationManagementPositionEntityService);
|
30
|
+
this.chartService = inject(AXMOrganizationManagementChartEntityService);
|
31
|
+
}
|
32
|
+
/* public abstract save(id: string, content: AXPDesignerContent): Promise<boolean>;
|
33
|
+
|
34
|
+
public abstract saveAs(content: AXPDesignerContent): Promise<boolean>;
|
35
|
+
|
36
|
+
public abstract load(id: T): Promise<string | null>; */
|
37
|
+
async load(id) {
|
38
|
+
const item = await this.chartService.getOne(id);
|
39
|
+
if (item) {
|
40
|
+
return item;
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
throw Error('Invalid Id');
|
44
|
+
}
|
45
|
+
} //get Chart Data
|
46
|
+
async save(context, id) {
|
47
|
+
if (id) {
|
48
|
+
await this.chartService.updateOne(id, { structure: context });
|
49
|
+
return true;
|
50
|
+
}
|
51
|
+
else {
|
52
|
+
await this.chartService.insertOne({ name: 'test', structure: context, version: '0.0.0' }); //felan intori bashe
|
53
|
+
return true;
|
54
|
+
}
|
55
|
+
} // save, update chart and after user select from selectbox
|
56
|
+
async listItemType(type, event) {
|
57
|
+
switch (type.text.toLowerCase()) {
|
58
|
+
case 'company':
|
59
|
+
return await this.companyService.query({
|
60
|
+
skip: event.skip,
|
61
|
+
take: event.take,
|
62
|
+
filter: event.filter,
|
63
|
+
sort: event.sort,
|
64
|
+
});
|
65
|
+
case 'country':
|
66
|
+
break;
|
67
|
+
case 'city':
|
68
|
+
break;
|
69
|
+
case 'department':
|
70
|
+
return (await this.departmentService.query({
|
71
|
+
skip: event.skip,
|
72
|
+
take: event.take,
|
73
|
+
filter: event.filter,
|
74
|
+
sort: event.sort,
|
75
|
+
}));
|
76
|
+
case 'position':
|
77
|
+
return (await this.positionService.query({
|
78
|
+
skip: event.skip,
|
79
|
+
take: event.take,
|
80
|
+
filter: event.filter,
|
81
|
+
sort: event.sort,
|
82
|
+
}));
|
83
|
+
case 'employment':
|
84
|
+
return (await this.employmentService.query({
|
85
|
+
skip: event.skip,
|
86
|
+
take: event.take,
|
87
|
+
filter: event.filter,
|
88
|
+
sort: event.sort,
|
89
|
+
}));
|
90
|
+
}
|
91
|
+
}
|
92
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMChartDesignService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
93
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMChartDesignService }); }
|
94
|
+
}
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMChartDesignService, decorators: [{
|
96
|
+
type: Injectable
|
97
|
+
}] });
|
98
|
+
|
99
|
+
class AddItemComponent extends AXBasePageComponent {
|
100
|
+
constructor() {
|
101
|
+
super();
|
102
|
+
this.service = inject(AXMChartDesignService);
|
103
|
+
this.entityName = '';
|
104
|
+
this.dataSource = new AXDataSource({
|
105
|
+
pageSize: 10,
|
106
|
+
key: 'id',
|
107
|
+
load: async (e) => {
|
108
|
+
/* const items = await this.service.listItemType(this.entityName, e);
|
109
|
+
console.log(items, 'items');*/
|
110
|
+
return await this.service.listItemType(this.entityName, e);
|
111
|
+
},
|
112
|
+
});
|
113
|
+
}
|
114
|
+
handleSelectedItem(e) {
|
115
|
+
this.selectItem = e.component.dataService.selectedItems[0];
|
116
|
+
}
|
117
|
+
save() {
|
118
|
+
console.log(this.selectItem);
|
119
|
+
this.close(this.selectItem);
|
120
|
+
}
|
121
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AddItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
122
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: AddItemComponent, isStandalone: true, selector: "ng-component", providers: [AXMChartDesignService], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-flex ax-flex-col ax-gap-2 ax-p-3\">\n <ax-form-field>\n <ax-label>Select </ax-label>\n <ax-select-box\n [dataSource]=\"dataSource\"\n textField=\"title\"\n valueField=\"id\"\n placeholder=\"Choose...\"\n (onValueChanged)=\"handleSelectedItem($event)\"\n >\n <ax-search-box look=\"fill\"></ax-search-box>\n <ax-validation-rule message=\"field can't be empty\" rule=\"required\"> </ax-validation-rule>\n </ax-select-box>\n </ax-form-field>\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-3 ax-p-3\">\n <ax-button color=\"primary\" text=\"Save\" (onClick)=\"save()\"> </ax-button>\n <ax-button color=\"primary\" look=\"outline\" text=\"Close\" (onClick)=\"this.close()\"> </ax-button>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "textTemplate", "dataSource", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "responsiveOn", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "responsiveOnChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i3.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i4.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "directive", type: i4.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i5.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }] }); }
|
123
|
+
}
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AddItemComponent, decorators: [{
|
125
|
+
type: Component,
|
126
|
+
args: [{ imports: [AXSelectBoxModule, AXButtonModule, AXLabelModule, AXFormModule, AXSearchBoxModule], providers: [AXMChartDesignService], template: "<div class=\"ax-flex ax-flex-col ax-gap-2 ax-p-3\">\n <ax-form-field>\n <ax-label>Select </ax-label>\n <ax-select-box\n [dataSource]=\"dataSource\"\n textField=\"title\"\n valueField=\"id\"\n placeholder=\"Choose...\"\n (onValueChanged)=\"handleSelectedItem($event)\"\n >\n <ax-search-box look=\"fill\"></ax-search-box>\n <ax-validation-rule message=\"field can't be empty\" rule=\"required\"> </ax-validation-rule>\n </ax-select-box>\n </ax-form-field>\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-3 ax-p-3\">\n <ax-button color=\"primary\" text=\"Save\" (onClick)=\"save()\"> </ax-button>\n <ax-button color=\"primary\" look=\"outline\" text=\"Close\" (onClick)=\"this.close()\"> </ax-button>\n </div>\n</div>\n" }]
|
127
|
+
}], ctorParameters: () => [] });
|
128
|
+
|
129
|
+
class AXMChartDesignPage {
|
130
|
+
constructor() {
|
131
|
+
this.service = inject(AXMChartDesignService);
|
132
|
+
this.popupService = inject(AXPopupService);
|
133
|
+
this.menuItem = signal([]);
|
134
|
+
this.chartEntityType = ['Company', 'Country', 'City', 'Department', 'Position', 'Employment'];
|
135
|
+
this.chartData = {};
|
136
|
+
afterNextRender(async () => {
|
137
|
+
this.id = history.state.id;
|
138
|
+
await this.loadChartData();
|
139
|
+
// can comment code move to chart-draw.service
|
140
|
+
this.root = am5.Root.new(this.chartDiv.nativeElement);
|
141
|
+
this.root.setThemes([am5themes_Animated.new(this.root), am5themes_Responsive.new(this.root)]);
|
142
|
+
const zoomableContainer = this.root.container.children.push(am5.ZoomableContainer.new(this.root, {
|
143
|
+
width: am5.p100,
|
144
|
+
height: am5.p100,
|
145
|
+
wheelable: true,
|
146
|
+
pinchZoom: true,
|
147
|
+
}));
|
148
|
+
const zoomTools = zoomableContainer.children.push(am5.ZoomTools.new(this.root, {
|
149
|
+
target: zoomableContainer,
|
150
|
+
}));
|
151
|
+
this.series = zoomableContainer.contents.children.push(am5hierarchy.Tree.new(this.root, {
|
152
|
+
singleBranchOnly: false, // if true when click node, collapse other node
|
153
|
+
downDepth: 1, // به ازای هر کلیک چند سطح باز بشود
|
154
|
+
initialDepth: 3, // if set to 1 just show root and children
|
155
|
+
valueField: 'idNode',
|
156
|
+
categoryField: 'title',
|
157
|
+
childDataField: 'children', //field name
|
158
|
+
paddingTop: 70,
|
159
|
+
paddingBottom: 50,
|
160
|
+
paddingLeft: 50,
|
161
|
+
paddingRight: 50,
|
162
|
+
}));
|
163
|
+
this.series.nodes.template.setAll({
|
164
|
+
tooltipText: '[bold]{title}[/]',
|
165
|
+
width: 100,
|
166
|
+
height: 50,
|
167
|
+
interactive: true,
|
168
|
+
//expandable: true,
|
169
|
+
});
|
170
|
+
this.series.circles.template.setAll({
|
171
|
+
fillOpacity: 0.9,
|
172
|
+
strokeWidth: 1,
|
173
|
+
strokeOpacity: 1,
|
174
|
+
radius: 50,
|
175
|
+
});
|
176
|
+
this.series.labels.template.setAll({
|
177
|
+
fill: am5.color(0x000000),
|
178
|
+
oversizedBehavior: 'fit',
|
179
|
+
});
|
180
|
+
this.series.nodes.template.events.on('pointerdown', (ev) => {
|
181
|
+
this.rcNode = null;
|
182
|
+
if (ev.originalEvent.button === 2) {
|
183
|
+
ev.originalEvent.preventDefault();
|
184
|
+
const dataItem = ev.target.dataItem;
|
185
|
+
if (dataItem) {
|
186
|
+
this.rcNode = { ...dataItem.dataContext };
|
187
|
+
this.handleOpen();
|
188
|
+
}
|
189
|
+
}
|
190
|
+
});
|
191
|
+
this.series.data.setAll(this.chartData.title ? [this.chartData] : []);
|
192
|
+
});
|
193
|
+
}
|
194
|
+
async loadChartData() {
|
195
|
+
debugger;
|
196
|
+
if (this.id) {
|
197
|
+
const data = await this.service.load(this.id);
|
198
|
+
if (data.structure)
|
199
|
+
this.chartData = JSON.parse(data.structure);
|
200
|
+
}
|
201
|
+
}
|
202
|
+
removeNode(nodeId, node = this.chartData) {
|
203
|
+
if (!node || !node.children) {
|
204
|
+
return false; // Base case: no children or empty node
|
205
|
+
}
|
206
|
+
// Check if any child matches the ID to be removed
|
207
|
+
const index = node.children.findIndex((child) => child.idNode === nodeId);
|
208
|
+
if (index !== -1) {
|
209
|
+
node.children.splice(index, 1); // Remove the child node
|
210
|
+
return true; // Node removed successfully
|
211
|
+
}
|
212
|
+
// Recursively search in children
|
213
|
+
return node.children.some((child) => this.removeNode(nodeId, child));
|
214
|
+
}
|
215
|
+
addNodeToChart(newChild, nodeChart = this.chartData) {
|
216
|
+
if (nodeChart.idNode === this.rcNode.idNode) {
|
217
|
+
nodeChart.children = nodeChart.children || [];
|
218
|
+
nodeChart.children.push(newChild);
|
219
|
+
return true;
|
220
|
+
}
|
221
|
+
return nodeChart.children?.some((child) => this.addNodeToChart(newChild, child)) ?? false;
|
222
|
+
}
|
223
|
+
handleOpen() {
|
224
|
+
if (this.chartData.title && !this.rcNode)
|
225
|
+
this.menuItem.set([]);
|
226
|
+
else {
|
227
|
+
const filteredEntities = this.rcNode?.nodeType
|
228
|
+
? this.chartEntityType.slice(Math.max(this.chartEntityType.findIndex((entity) => entity.toLowerCase() === this.rcNode.nodeType.toLowerCase()) +
|
229
|
+
1, 0 // Ensure index is non-negative
|
230
|
+
))
|
231
|
+
: this.chartEntityType;
|
232
|
+
// Ensure the result is an array before mapping
|
233
|
+
if (Array.isArray(filteredEntities)) {
|
234
|
+
const items = filteredEntities.map((entity) => ({
|
235
|
+
name: entity.toLowerCase(),
|
236
|
+
text: entity,
|
237
|
+
}));
|
238
|
+
if (this.rcNode)
|
239
|
+
items.push({
|
240
|
+
text: 'Delete',
|
241
|
+
name: 'delete',
|
242
|
+
color: 'danger',
|
243
|
+
icon: 'fa-solid fa-trash-can',
|
244
|
+
});
|
245
|
+
this.menuItem.set(items);
|
246
|
+
}
|
247
|
+
else {
|
248
|
+
this.menuItem.set([]);
|
249
|
+
}
|
250
|
+
}
|
251
|
+
}
|
252
|
+
handleOpenContext(e) {
|
253
|
+
if (!this.chartData?.title)
|
254
|
+
this.handleOpen();
|
255
|
+
else {
|
256
|
+
this.menuItem.set([]);
|
257
|
+
}
|
258
|
+
}
|
259
|
+
updateChartData(result) {
|
260
|
+
if (result) {
|
261
|
+
this.series.data.setAll([this.chartData]);
|
262
|
+
this.service.save(JSON.stringify(this.chartData), this.id);
|
263
|
+
}
|
264
|
+
}
|
265
|
+
async handleContextMenuOnItemClick(event) {
|
266
|
+
let result = true;
|
267
|
+
if (event.item.name === 'delete') {
|
268
|
+
result = await this.removeNode(this.rcNode.idNode);
|
269
|
+
this.updateChartData(result);
|
270
|
+
}
|
271
|
+
else {
|
272
|
+
this.popupService
|
273
|
+
.open(AddItemComponent, {
|
274
|
+
title: 'Select Node',
|
275
|
+
size: 'sm',
|
276
|
+
data: { entityName: event.item },
|
277
|
+
})
|
278
|
+
.then(async (data) => {
|
279
|
+
console.log(data.data);
|
280
|
+
const newChild = Object.assign(data.data, {
|
281
|
+
nodeType: event.item.name,
|
282
|
+
idNode: Date.now().toString(36) + Math.random().toString(36).substr(2, 9),
|
283
|
+
});
|
284
|
+
console.log(newChild, 'newChild');
|
285
|
+
if (this.rcNode)
|
286
|
+
result = await this.addNodeToChart(newChild);
|
287
|
+
else
|
288
|
+
this.chartData = newChild;
|
289
|
+
this.updateChartData(result);
|
290
|
+
});
|
291
|
+
}
|
292
|
+
}
|
293
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMChartDesignPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
294
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.3", type: AXMChartDesignPage, isStandalone: true, selector: "ng-component", providers: [AXMChartDesignService], viewQueries: [{ propertyName: "chartDiv", first: true, predicate: ["chartDiv"], descendants: true }], ngImport: i0, template: "<div #chartDiv class=\"ctx ax-w-full ax-h-5/6\"></div>\n\n<ax-context-menu\n (onItemClick)=\"handleContextMenuOnItemClick($event)\"\n [items]=\"menuItem()\"\n [target]=\"'.ctx'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onOpening)=\"handleOpenContext($event)\"\n>\n</ax-context-menu>\n", dependencies: [{ kind: "ngmodule", type: AXMenuModule }, { kind: "component", type: i1$1.AXContextMenuComponent, selector: "ax-context-menu", inputs: ["orientation", "openOn", "closeOn", "items", "target"], outputs: ["onItemClick", "onOpening"] }] }); }
|
295
|
+
}
|
296
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMChartDesignPage, decorators: [{
|
297
|
+
type: Component,
|
298
|
+
args: [{ imports: [AXMenuModule], providers: [AXMChartDesignService], template: "<div #chartDiv class=\"ctx ax-w-full ax-h-5/6\"></div>\n\n<ax-context-menu\n (onItemClick)=\"handleContextMenuOnItemClick($event)\"\n [items]=\"menuItem()\"\n [target]=\"'.ctx'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onOpening)=\"handleOpenContext($event)\"\n>\n</ax-context-menu>\n" }]
|
299
|
+
}], ctorParameters: () => [], propDecorators: { chartDiv: [{
|
300
|
+
type: ViewChild,
|
301
|
+
args: ['chartDiv']
|
302
|
+
}] } });
|
303
|
+
|
304
|
+
export { AXMChartDesignPage };
|
305
|
+
//# sourceMappingURL=acorex-modules-organization-managment-chart-design.page-eE-nOaMw.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"acorex-modules-organization-managment-chart-design.page-eE-nOaMw.mjs","sources":["../../../../libs/modules/organization-managment/src/lib/pages/chart-design/chart-design.service.ts","../../../../libs/modules/organization-managment/src/lib/pages/chart-design/add-item/add-item.component.ts","../../../../libs/modules/organization-managment/src/lib/pages/chart-design/add-item/add-item.component.html","../../../../libs/modules/organization-managment/src/lib/pages/chart-design/chart-design.page.ts","../../../../libs/modules/organization-managment/src/lib/pages/chart-design/chart-design.page.html"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXMOrganizationManagementChartEntityService } from '../../entities/chart/chart.service';\nimport { AXMOrganizationManagementChartEntityModel } from '../../entities/chart/chart.types';\nimport { AXMOrganizationManagementCompanyEntityService } from '../../entities/company/company.service';\nimport { AXMOrganizationManagementDepartmentEntityService } from '../../entities/department/department.service';\nimport { AXMOrganizationManagementEmploymentEntityService } from '../../entities/employment/employment.service';\nimport { AXMOrganizationManagementPositionEntityService } from '../../entities/position/position.service';\n\nexport interface AXPDesignerContent {\n json: string;\n html?: string;\n}\n\n@Injectable()\nexport class AXMChartDesignService<T = string> {\n companyService = inject(AXMOrganizationManagementCompanyEntityService);\n departmentService = inject(AXMOrganizationManagementDepartmentEntityService);\n employmentService = inject(AXMOrganizationManagementEmploymentEntityService);\n positionService = inject(AXMOrganizationManagementPositionEntityService);\n chartService = inject(AXMOrganizationManagementChartEntityService);\n /* public abstract save(id: string, content: AXPDesignerContent): Promise<boolean>;\n\n public abstract saveAs(content: AXPDesignerContent): Promise<boolean>;\n\n public abstract load(id: T): Promise<string | null>; */\n\n public async load(id: string): Promise<AXMOrganizationManagementChartEntityModel> {\n const item = await this.chartService.getOne(id);\n if (item) {\n return item;\n } else {\n throw Error('Invalid Id');\n }\n } //get Chart Data\n\n public async save(context: string, id?: string): Promise<boolean> {\n if (id) {\n await this.chartService.updateOne(id, { structure: context });\n return true;\n } else {\n await this.chartService.insertOne({ name: 'test', structure: context, version: '0.0.0' }); //felan intori bashe\n return true;\n }\n } // save, update chart and after user select from selectbox\n\n public async listItemType(type: any, event: any): Promise<any> {\n switch (type.text.toLowerCase()) {\n case 'company':\n return await this.companyService.query({\n skip: event.skip,\n take: event.take,\n filter: event.filter,\n sort: event.sort,\n });\n case 'country':\n break;\n case 'city':\n break;\n case 'department':\n return (await this.departmentService.query({\n skip: event.skip,\n take: event.take,\n filter: event.filter,\n sort: event.sort,\n })) as any;\n case 'position':\n return (await this.positionService.query({\n skip: event.skip,\n take: event.take,\n filter: event.filter,\n sort: event.sort,\n })) as any;\n case 'employment':\n return (await this.employmentService.query({\n skip: event.skip,\n take: event.take,\n filter: event.filter,\n sort: event.sort,\n })) as any;\n }\n }\n}\n","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDataSource } from '@acorex/components/common';\nimport { AXFormModule } from '@acorex/components/form';\nimport { AXLabelModule } from '@acorex/components/label';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXSearchBoxModule } from '@acorex/components/search-box';\nimport { AXSelectBoxModule } from '@acorex/components/select-box';\nimport { Component, inject } from '@angular/core';\nimport { AXMChartDesignService } from '../chart-design.service';\n@Component({\n templateUrl: './add-item.component.html',\n imports: [AXSelectBoxModule, AXButtonModule, AXLabelModule, AXFormModule, AXSearchBoxModule],\n providers: [AXMChartDesignService],\n})\nexport class AddItemComponent extends AXBasePageComponent {\n private service = inject(AXMChartDesignService);\n private entityName = '';\n selectItem: any;\n constructor() {\n super();\n }\n\n protected dataSource = new AXDataSource<any>({\n pageSize: 10,\n key: 'id',\n load: async (e) => {\n /* const items = await this.service.listItemType(this.entityName, e);\n console.log(items, 'items');*/\n return await this.service.listItemType(this.entityName, e);\n },\n });\n\n handleSelectedItem(e: any) {\n this.selectItem = e.component.dataService.selectedItems[0];\n }\n\n save() {\n console.log(this.selectItem);\n this.close(this.selectItem);\n }\n}\n","<div class=\"ax-flex ax-flex-col ax-gap-2 ax-p-3\">\n <ax-form-field>\n <ax-label>Select </ax-label>\n <ax-select-box\n [dataSource]=\"dataSource\"\n textField=\"title\"\n valueField=\"id\"\n placeholder=\"Choose...\"\n (onValueChanged)=\"handleSelectedItem($event)\"\n >\n <ax-search-box look=\"fill\"></ax-search-box>\n <ax-validation-rule message=\"field can't be empty\" rule=\"required\"> </ax-validation-rule>\n </ax-select-box>\n </ax-form-field>\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-3 ax-p-3\">\n <ax-button color=\"primary\" text=\"Save\" (onClick)=\"save()\"> </ax-button>\n <ax-button color=\"primary\" look=\"outline\" text=\"Close\" (onClick)=\"this.close()\"> </ax-button>\n </div>\n</div>\n","import { AXContextMenuItemsClickEvent, AXMenuItem, AXMenuModule } from '@acorex/components/menu';\nimport { AXPopupService } from '@acorex/components/popup';\nimport * as am5 from '@amcharts/amcharts5';\nimport * as am5hierarchy from '@amcharts/amcharts5/hierarchy';\nimport am5themes_Animated from '@amcharts/amcharts5/themes/Animated';\nimport am5themes_Responsive from '@amcharts/amcharts5/themes/Responsive';\nimport { afterNextRender, Component, ElementRef, inject, signal, ViewChild } from '@angular/core';\nimport { AddItemComponent } from './add-item/add-item.component';\nimport { AXMChartDesignService } from './chart-design.service';\nimport { AXMOrganizationManagementChartNodeEntityModel } from './chart.type';\n@Component({\n templateUrl: './chart-design.page.html',\n imports: [AXMenuModule],\n providers: [AXMChartDesignService],\n})\nexport class AXMChartDesignPage {\n private service = inject(AXMChartDesignService);\n private popupService = inject(AXPopupService);\n\n @ViewChild('chartDiv') chartDiv!: ElementRef;\n\n private root!: am5.Root;\n private series!: am5hierarchy.Tree;\n\n menuItem = signal<AXMenuItem[]>([]);\n chartEntityType = ['Company', 'Country', 'City', 'Department', 'Position', 'Employment'];\n chartData: AXMOrganizationManagementChartNodeEntityModel = {};\n id?: string;\n rcNode?: any;\n\n constructor() {\n afterNextRender(async () => {\n this.id = history.state.id;\n await this.loadChartData();\n // can comment code move to chart-draw.service\n this.root = am5.Root.new(this.chartDiv.nativeElement);\n this.root.setThemes([am5themes_Animated.new(this.root), am5themes_Responsive.new(this.root)]);\n const zoomableContainer = this.root.container.children.push(\n am5.ZoomableContainer.new(this.root, {\n width: am5.p100,\n height: am5.p100,\n wheelable: true,\n pinchZoom: true,\n })\n );\n\n const zoomTools = zoomableContainer.children.push(\n am5.ZoomTools.new(this.root, {\n target: zoomableContainer,\n })\n );\n\n this.series = zoomableContainer.contents.children.push(\n am5hierarchy.Tree.new(this.root, {\n singleBranchOnly: false, // if true when click node, collapse other node\n downDepth: 1, // به ازای هر کلیک چند سطح باز بشود\n initialDepth: 3, // if set to 1 just show root and children\n valueField: 'idNode',\n categoryField: 'title',\n childDataField: 'children', //field name\n paddingTop: 70,\n paddingBottom: 50,\n paddingLeft: 50,\n paddingRight: 50,\n })\n );\n this.series.nodes.template.setAll({\n tooltipText: '[bold]{title}[/]',\n width: 100,\n height: 50,\n interactive: true,\n //expandable: true,\n });\n this.series.circles.template.setAll({\n fillOpacity: 0.9,\n strokeWidth: 1,\n strokeOpacity: 1,\n radius: 50,\n });\n this.series.labels.template.setAll({\n fill: am5.color(0x000000),\n oversizedBehavior: 'fit',\n });\n this.series.nodes.template.events.on('pointerdown', (ev: any) => {\n this.rcNode = null;\n if (ev.originalEvent.button === 2) {\n ev.originalEvent.preventDefault();\n const dataItem = ev.target.dataItem;\n if (dataItem) {\n this.rcNode = { ...dataItem.dataContext };\n this.handleOpen();\n }\n }\n });\n this.series.data.setAll(this.chartData.title ? [this.chartData] : []);\n });\n }\n\n async loadChartData() {\n debugger;\n if (this.id) {\n const data = await this.service.load(this.id);\n if (data.structure) this.chartData = JSON.parse(data.structure as string);\n }\n }\n\n private removeNode(nodeId: string, node: AXMOrganizationManagementChartNodeEntityModel = this.chartData): boolean {\n if (!node || !node.children) {\n return false; // Base case: no children or empty node\n }\n\n // Check if any child matches the ID to be removed\n const index = node.children.findIndex((child: any) => child.idNode === nodeId);\n if (index !== -1) {\n node.children.splice(index, 1); // Remove the child node\n return true; // Node removed successfully\n }\n\n // Recursively search in children\n return node.children.some((child: any) => this.removeNode(nodeId, child));\n }\n\n private addNodeToChart(newChild: any, nodeChart = this.chartData): boolean {\n if (nodeChart.idNode === this.rcNode.idNode) {\n nodeChart.children = nodeChart.children || [];\n nodeChart.children.push(newChild);\n return true;\n }\n return nodeChart.children?.some((child: any) => this.addNodeToChart(newChild, child)) ?? false;\n }\n\n handleOpen() {\n if (this.chartData.title && !this.rcNode) this.menuItem.set([]);\n else {\n const filteredEntities = this.rcNode?.nodeType\n ? this.chartEntityType.slice(\n Math.max(\n this.chartEntityType.findIndex((entity) => entity.toLowerCase() === this.rcNode.nodeType.toLowerCase()) +\n 1,\n 0 // Ensure index is non-negative\n )\n )\n : this.chartEntityType;\n // Ensure the result is an array before mapping\n if (Array.isArray(filteredEntities)) {\n const items: any = filteredEntities.map((entity) => ({\n name: entity.toLowerCase(),\n text: entity,\n }));\n if (this.rcNode)\n items.push({\n text: 'Delete',\n name: 'delete',\n color: 'danger',\n icon: 'fa-solid fa-trash-can',\n });\n\n this.menuItem.set(items);\n } else {\n this.menuItem.set([]);\n }\n }\n }\n handleOpenContext(e: any) {\n if (!this.chartData?.title) this.handleOpen();\n else {\n this.menuItem.set([]);\n }\n }\n updateChartData(result: boolean) {\n if (result) {\n this.series.data.setAll([this.chartData]);\n this.service.save(JSON.stringify(this.chartData), this.id);\n }\n }\n\n async handleContextMenuOnItemClick(event: AXContextMenuItemsClickEvent) {\n let result = true;\n if (event.item.name === 'delete') {\n result = await this.removeNode(this.rcNode.idNode);\n this.updateChartData(result);\n } else {\n this.popupService\n .open(AddItemComponent, {\n title: 'Select Node',\n size: 'sm',\n data: { entityName: event.item },\n })\n .then(async (data: any) => {\n console.log(data.data);\n const newChild = Object.assign(data.data, {\n nodeType: event.item.name,\n idNode: Date.now().toString(36) + Math.random().toString(36).substr(2, 9),\n });\n console.log(newChild, 'newChild');\n if (this.rcNode) result = await this.addNodeToChart(newChild);\n else this.chartData = newChild;\n this.updateChartData(result);\n });\n }\n }\n}\n","<div #chartDiv class=\"ctx ax-w-full ax-h-5/6\"></div>\n\n<ax-context-menu\n (onItemClick)=\"handleContextMenuOnItemClick($event)\"\n [items]=\"menuItem()\"\n [target]=\"'.ctx'\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Y,CAAC,EACZ,SAAA,EAAA,CAAC,qBAAqB,CAAC,EAAA,QAAA,EAAA,sTAAA,EAAA;wDAMX,QAAQ,EAAA,CAAA;sBAA9B,SAAS;uBAAC,UAAU;;;;;"}
|
@@ -0,0 +1,257 @@
|
|
1
|
+
import { AXPEntityQueryType, AXPEntityCommandScope } from '@acorex/platform/common';
|
2
|
+
import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
|
3
|
+
import { AXMOrganizationManagementChartEntityService, RootConfig } from './acorex-modules-organization-managment.mjs';
|
4
|
+
|
5
|
+
async function factory(injector) {
|
6
|
+
const dataService = injector.get(AXMOrganizationManagementChartEntityService);
|
7
|
+
const i18n = RootConfig.config.i18n;
|
8
|
+
const entityDef = {
|
9
|
+
module: RootConfig.module.name,
|
10
|
+
name: RootConfig.entities.chart.name,
|
11
|
+
source: '',
|
12
|
+
title: RootConfig.entities.chart.title,
|
13
|
+
formats: {
|
14
|
+
individual: `t("chart", { scope: "${i18n}" })`,
|
15
|
+
plural: `t("charts", { scope: "${i18n}" })`,
|
16
|
+
searchResult: {
|
17
|
+
title: '{{ title }}',
|
18
|
+
description: RootConfig.module.title,
|
19
|
+
},
|
20
|
+
},
|
21
|
+
relatedEntities: [],
|
22
|
+
groups: [
|
23
|
+
{
|
24
|
+
id: 'section',
|
25
|
+
title: `t("chart", { scope: "${i18n}" })`,
|
26
|
+
},
|
27
|
+
],
|
28
|
+
properties: [
|
29
|
+
{
|
30
|
+
name: 'name',
|
31
|
+
title: `t("name", { scope: "${i18n}" })`,
|
32
|
+
groupId: 'section',
|
33
|
+
schema: {
|
34
|
+
dataType: 'string',
|
35
|
+
interface: {
|
36
|
+
type: AXPWidgetsCatalog.text,
|
37
|
+
},
|
38
|
+
},
|
39
|
+
validations: [
|
40
|
+
{
|
41
|
+
rule: 'required',
|
42
|
+
},
|
43
|
+
],
|
44
|
+
},
|
45
|
+
{
|
46
|
+
name: 'version',
|
47
|
+
title: `t("version", { scope: "${i18n}" })`,
|
48
|
+
groupId: 'section',
|
49
|
+
schema: {
|
50
|
+
dataType: 'string',
|
51
|
+
interface: {
|
52
|
+
type: AXPWidgetsCatalog.text,
|
53
|
+
},
|
54
|
+
},
|
55
|
+
},
|
56
|
+
{
|
57
|
+
name: 'structure',
|
58
|
+
title: `t("structure", { scope: "${i18n}" })`,
|
59
|
+
groupId: 'section',
|
60
|
+
schema: {
|
61
|
+
dataType: 'string',
|
62
|
+
interface: {
|
63
|
+
type: AXPWidgetsCatalog.text,
|
64
|
+
},
|
65
|
+
defaultValue: '',
|
66
|
+
},
|
67
|
+
},
|
68
|
+
],
|
69
|
+
columns: [{ name: 'name' }, { name: 'version' }],
|
70
|
+
commands: {
|
71
|
+
create: {
|
72
|
+
execute: async (data) => {
|
73
|
+
console.log(data);
|
74
|
+
const res = await dataService.insertOne(data);
|
75
|
+
return { id: res };
|
76
|
+
},
|
77
|
+
},
|
78
|
+
delete: {
|
79
|
+
execute: async (id) => {
|
80
|
+
return await dataService.deleteOne(id);
|
81
|
+
},
|
82
|
+
},
|
83
|
+
update: {
|
84
|
+
execute: async (data) => {
|
85
|
+
return await dataService.updateOne(data.id, data);
|
86
|
+
},
|
87
|
+
},
|
88
|
+
},
|
89
|
+
queries: {
|
90
|
+
byKey: {
|
91
|
+
execute: async (id) => {
|
92
|
+
return await dataService.getOne(id);
|
93
|
+
},
|
94
|
+
type: AXPEntityQueryType.Single,
|
95
|
+
},
|
96
|
+
list: {
|
97
|
+
execute: async (e) => {
|
98
|
+
return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter, sort: e.sort });
|
99
|
+
},
|
100
|
+
type: AXPEntityQueryType.List,
|
101
|
+
},
|
102
|
+
},
|
103
|
+
interfaces: {
|
104
|
+
master: {
|
105
|
+
create: {
|
106
|
+
sections: [
|
107
|
+
{
|
108
|
+
id: 'section',
|
109
|
+
},
|
110
|
+
],
|
111
|
+
properties: [
|
112
|
+
{
|
113
|
+
name: 'name',
|
114
|
+
layout: {
|
115
|
+
positions: {
|
116
|
+
lg: {
|
117
|
+
colSpan: 6,
|
118
|
+
},
|
119
|
+
},
|
120
|
+
},
|
121
|
+
},
|
122
|
+
{
|
123
|
+
name: 'version',
|
124
|
+
layout: {
|
125
|
+
positions: {
|
126
|
+
lg: {
|
127
|
+
colSpan: 6,
|
128
|
+
},
|
129
|
+
},
|
130
|
+
},
|
131
|
+
},
|
132
|
+
],
|
133
|
+
},
|
134
|
+
update: {
|
135
|
+
sections: [
|
136
|
+
{
|
137
|
+
id: 'section',
|
138
|
+
},
|
139
|
+
],
|
140
|
+
properties: [
|
141
|
+
{
|
142
|
+
name: 'name',
|
143
|
+
layout: {
|
144
|
+
positions: {
|
145
|
+
lg: {
|
146
|
+
colSpan: 6,
|
147
|
+
},
|
148
|
+
},
|
149
|
+
},
|
150
|
+
},
|
151
|
+
{
|
152
|
+
name: 'version',
|
153
|
+
layout: {
|
154
|
+
positions: {
|
155
|
+
lg: {
|
156
|
+
colSpan: 6,
|
157
|
+
},
|
158
|
+
},
|
159
|
+
},
|
160
|
+
},
|
161
|
+
],
|
162
|
+
},
|
163
|
+
single: {
|
164
|
+
title: '{{name}}',
|
165
|
+
sections: [
|
166
|
+
{
|
167
|
+
id: 'section',
|
168
|
+
layout: {
|
169
|
+
positions: {
|
170
|
+
lg: {
|
171
|
+
colSpan: 12,
|
172
|
+
},
|
173
|
+
},
|
174
|
+
},
|
175
|
+
},
|
176
|
+
],
|
177
|
+
properties: [
|
178
|
+
{
|
179
|
+
name: 'name',
|
180
|
+
layout: {
|
181
|
+
positions: {
|
182
|
+
lg: {
|
183
|
+
colSpan: 6,
|
184
|
+
},
|
185
|
+
},
|
186
|
+
},
|
187
|
+
},
|
188
|
+
{
|
189
|
+
name: 'version',
|
190
|
+
layout: {
|
191
|
+
positions: {
|
192
|
+
lg: {
|
193
|
+
colSpan: 6,
|
194
|
+
},
|
195
|
+
},
|
196
|
+
},
|
197
|
+
},
|
198
|
+
],
|
199
|
+
actions: [],
|
200
|
+
},
|
201
|
+
list: {
|
202
|
+
actions: [
|
203
|
+
{
|
204
|
+
title: `t("create", { scope: "common" })`,
|
205
|
+
command: 'create-entity',
|
206
|
+
priority: 'primary',
|
207
|
+
type: 'create',
|
208
|
+
scope: AXPEntityCommandScope.TypeLevel,
|
209
|
+
},
|
210
|
+
{
|
211
|
+
title: 't("deleteItems", { scope: "common" })',
|
212
|
+
command: 'delete-entity',
|
213
|
+
priority: 'primary',
|
214
|
+
type: 'delete',
|
215
|
+
scope: AXPEntityCommandScope.Selected,
|
216
|
+
},
|
217
|
+
{
|
218
|
+
title: 't("detail", { scope: "common" })',
|
219
|
+
command: 'open-entity',
|
220
|
+
priority: 'secondary',
|
221
|
+
type: 'view',
|
222
|
+
scope: AXPEntityCommandScope.Individual,
|
223
|
+
},
|
224
|
+
{
|
225
|
+
title: 't("View Chart", { scope: "common" })',
|
226
|
+
command: 'view-chart',
|
227
|
+
priority: 'secondary',
|
228
|
+
type: 'view',
|
229
|
+
scope: AXPEntityCommandScope.Individual,
|
230
|
+
},
|
231
|
+
{
|
232
|
+
title: 't("delete", { scope: "common" })',
|
233
|
+
command: 'delete-entity',
|
234
|
+
priority: 'secondary',
|
235
|
+
type: 'delete',
|
236
|
+
scope: AXPEntityCommandScope.Individual,
|
237
|
+
},
|
238
|
+
],
|
239
|
+
views: [
|
240
|
+
{
|
241
|
+
name: 'all',
|
242
|
+
title: 't("allItem", { scope: "common" })',
|
243
|
+
fixed: true,
|
244
|
+
columns: [],
|
245
|
+
conditions: [],
|
246
|
+
sorts: [],
|
247
|
+
},
|
248
|
+
],
|
249
|
+
},
|
250
|
+
},
|
251
|
+
},
|
252
|
+
};
|
253
|
+
return entityDef;
|
254
|
+
}
|
255
|
+
|
256
|
+
export { factory };
|
257
|
+
//# sourceMappingURL=acorex-modules-organization-managment-chart.entity-C_1rAJrs.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"acorex-modules-organization-managment-chart.entity-C_1rAJrs.mjs","sources":["../../../../libs/modules/organization-managment/src/lib/entities/chart/chart.entity.ts"],"sourcesContent":["import { AXPEntity, AXPEntityCommandScope, AXPEntityQueryType } from '@acorex/platform/common';\nimport { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';\nimport { Injector } from '@angular/core';\nimport { RootConfig } from '../../const';\nimport { AXMOrganizationManagementChartEntityService } from './chart.service';\n\nexport async function factory(injector: Injector): Promise<AXPEntity | null> {\n const dataService = injector.get(AXMOrganizationManagementChartEntityService);\n const i18n = RootConfig.config.i18n;\n\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.chart.name,\n source: '',\n title: RootConfig.entities.chart.title,\n formats: {\n individual: `t(\"chart\", { scope: \"${i18n}\" })`,\n plural: `t(\"charts\", { scope: \"${i18n}\" })`,\n searchResult: {\n title: '{{ title }}',\n description: RootConfig.module.title,\n },\n },\n relatedEntities: [],\n groups: [\n {\n id: 'section',\n title: `t(\"chart\", { scope: \"${i18n}\" })`,\n },\n ],\n properties: [\n {\n name: 'name',\n title: `t(\"name\", { scope: \"${i18n}\" })`,\n groupId: 'section',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.text,\n },\n },\n validations: [\n {\n rule: 'required',\n },\n ],\n },\n {\n name: 'version',\n title: `t(\"version\", { scope: \"${i18n}\" })`,\n groupId: 'section',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.text,\n },\n },\n },\n {\n name: 'structure',\n title: `t(\"structure\", { scope: \"${i18n}\" })`,\n groupId: 'section',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.text,\n },\n defaultValue: '',\n },\n },\n ],\n columns: [{ name: 'name' }, { name: 'version' }],\n commands: {\n create: {\n execute: async (data: any) => {\n console.log(data);\n const res = await dataService.insertOne(data);\n return { id: res };\n },\n },\n delete: {\n execute: async (id: any) => {\n return await dataService.deleteOne(id);\n },\n },\n update: {\n execute: async (data: any) => {\n return await dataService.updateOne(data.id, data);\n },\n },\n },\n queries: {\n byKey: {\n execute: async (id: string) => {\n return await dataService.getOne(id);\n },\n type: AXPEntityQueryType.Single,\n },\n list: {\n execute: async (e: any) => {\n return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter, sort: e.sort });\n },\n type: AXPEntityQueryType.List,\n },\n },\n interfaces: {\n master: {\n create: {\n sections: [\n {\n id: 'section',\n },\n ],\n properties: [\n {\n name: 'name',\n layout: {\n positions: {\n lg: {\n colSpan: 6,\n },\n },\n },\n },\n {\n name: 'version',\n layout: {\n positions: {\n lg: {\n colSpan: 6,\n },\n },\n },\n },\n ],\n },\n update: {\n sections: [\n {\n id: 'section',\n },\n ],\n properties: [\n {\n name: 'name',\n layout: {\n positions: {\n lg: {\n colSpan: 6,\n },\n },\n },\n },\n {\n name: 'version',\n layout: {\n positions: {\n lg: {\n colSpan: 6,\n },\n },\n },\n },\n ],\n },\n single: {\n title: '{{name}}',\n sections: [\n {\n id: 'section',\n layout: {\n positions: {\n lg: {\n colSpan: 12,\n },\n },\n },\n },\n ],\n properties: [\n {\n name: 'name',\n layout: {\n positions: {\n lg: {\n colSpan: 6,\n },\n },\n },\n },\n {\n name: 'version',\n layout: {\n positions: {\n lg: {\n colSpan: 6,\n },\n },\n },\n },\n ],\n actions: [],\n },\n list: {\n actions: [\n {\n title: `t(\"create\", { scope: \"common\" })`,\n command: 'create-entity',\n priority: 'primary',\n type: 'create',\n scope: AXPEntityCommandScope.TypeLevel,\n },\n {\n title: 't(\"deleteItems\", { scope: \"common\" })',\n command: 'delete-entity',\n priority: 'primary',\n type: 'delete',\n scope: AXPEntityCommandScope.Selected,\n },\n {\n title: 't(\"detail\", { scope: \"common\" })',\n command: 'open-entity',\n priority: 'secondary',\n type: 'view',\n scope: AXPEntityCommandScope.Individual,\n },\n {\n title: 't(\"View Chart\", { scope: \"common\" })',\n command: 'view-chart',\n priority: 'secondary',\n type: 'view',\n scope: AXPEntityCommandScope.Individual,\n },\n {\n title: 't(\"delete\", { scope: \"common\" })',\n command: 'delete-entity',\n priority: 'secondary',\n type: 'delete',\n scope: AXPEntityCommandScope.Individual,\n },\n ],\n views: [\n {\n name: 'all',\n title: 't(\"allItem\", { scope: \"common\" })',\n fixed: true,\n columns: [],\n conditions: [],\n sorts: [],\n },\n ],\n },\n },\n },\n };\n\n return entityDef;\n}\n"],"names":[],"mappings":";;;;AAMO,eAAe,OAAO,CAAC,QAAkB,EAAA;IAC9C,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,2CAA2C,CAAC;AAC7E,IAAA,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI;AAEnC,IAAA,MAAM,SAAS,GAAc;AAC3B,QAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC9B,QAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;AACpC,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK;AACtC,QAAA,OAAO,EAAE;YACP,UAAU,EAAE,CAAwB,qBAAA,EAAA,IAAI,CAAM,IAAA,CAAA;YAC9C,MAAM,EAAE,CAAyB,sBAAA,EAAA,IAAI,CAAM,IAAA,CAAA;AAC3C,YAAA,YAAY,EAAE;AACZ,gBAAA,KAAK,EAAE,aAAa;AACpB,gBAAA,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK;AACrC,aAAA;AACF,SAAA;AACD,QAAA,eAAe,EAAE,EAAE;AACnB,QAAA,MAAM,EAAE;AACN,YAAA;AACE,gBAAA,EAAE,EAAE,SAAS;gBACb,KAAK,EAAE,CAAwB,qBAAA,EAAA,IAAI,CAAM,IAAA,CAAA;AAC1C,aAAA;AACF,SAAA;AACD,QAAA,UAAU,EAAE;AACV,YAAA;AACE,gBAAA,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,CAAuB,oBAAA,EAAA,IAAI,CAAM,IAAA,CAAA;AAC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