@acorex-platform/module-asset-management-client 0.0.56 → 0.0.57
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-platform-module-asset-management-client-acorex-platform-module-asset-management-client-B7YXKaeh.mjs +2789 -0
- package/fesm2022/acorex-platform-module-asset-management-client-acorex-platform-module-asset-management-client-B7YXKaeh.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-asset-management-client-asset-usage-values-widget-edit.component-qauvpIMv.mjs +276 -0
- package/fesm2022/acorex-platform-module-asset-management-client-asset-usage-values-widget-edit.component-qauvpIMv.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-asset-management-client-asset-usage-values-widget-view.component-5psJebph.mjs +55 -0
- package/fesm2022/acorex-platform-module-asset-management-client-asset-usage-values-widget-view.component-5psJebph.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-type.mjs +105 -1
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset-type.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset.mjs +290 -5
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entities-asset.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-acorex-platform-module-asset-management-client-contracts-entity-catalog--qb3bhd-.mjs → acorex-platform-module-asset-management-client-contracts-entity-catalog-acorex-platform-module-asset-management-client-contracts-entity-catalog-CnuEulTO.mjs} +9 -9
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-acorex-platform-module-asset-management-client-contracts-entity-catalog--qb3bhd-.mjs.map → acorex-platform-module-asset-management-client-contracts-entity-catalog-acorex-platform-module-asset-management-client-contracts-entity-catalog-CnuEulTO.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-rental-history.entity-DoXOgclo.mjs → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-rental-history.entity-Cy6qssiv.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-rental-history.entity-DoXOgclo.mjs.map → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-rental-history.entity-Cy6qssiv.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-assignment.entity-DodjW3aR.mjs → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-assignment.entity-BvXjVaqK.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-assignment.entity-DodjW3aR.mjs.map → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-assignment.entity-BvXjVaqK.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-type.entity-BNV5_Bwu.mjs → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-type.entity-DanmgSHH.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-type.entity-BNV5_Bwu.mjs.map → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system-type.entity-DanmgSHH.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system.entity-BBHHbwxU.mjs → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system.entity-BO2GQu2_.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system.entity-BBHHbwxU.mjs.map → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-system.entity-BO2GQu2_.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section-component.entity-D-P7HwQU.mjs → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section-component.entity-DumWQV-O.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section-component.entity-D-P7HwQU.mjs.map → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section-component.entity-DumWQV-O.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section.entity-TsV2eE47.mjs → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section.entity-B5Z8s8_4.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section.entity-TsV2eE47.mjs.map → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section.entity-B5Z8s8_4.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type.entity-CUZ1xIl3.mjs → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type.entity-BO3otOO_.mjs} +65 -3
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type.entity-BO3otOO_.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.entity-Ckx8fhZ-.mjs → acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.entity-CvCBkNVZ.mjs} +250 -7
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.entity-CvCBkNVZ.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.interval-kind-nMKvWqpx.mjs +45 -0
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.interval-kind-nMKvWqpx.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog.mjs +1 -1
- package/fesm2022/acorex-platform-module-asset-management-client-contracts.mjs +241 -1
- package/fesm2022/acorex-platform-module-asset-management-client-contracts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-asset-management-client-recalculate-asset-operational-status.activity-ueTauO_k.mjs → acorex-platform-module-asset-management-client-recalculate-asset-operational-status.activity-RGXS9fI1.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-asset-management-client-recalculate-asset-operational-status.activity-ueTauO_k.mjs.map → acorex-platform-module-asset-management-client-recalculate-asset-operational-status.activity-RGXS9fI1.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-asset-management-client.mjs +1 -2496
- package/fesm2022/acorex-platform-module-asset-management-client.mjs.map +1 -1
- package/i18n/en-AU/asset-management.json +44 -0
- package/i18n/en-US/asset-management.json +44 -0
- package/i18n/fa-IR/asset-management.json +44 -0
- package/package.json +2 -2
- package/types/acorex-platform-module-asset-management-client-contracts.d.ts +72 -2
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type.entity-CUZ1xIl3.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.entity-Ckx8fhZ-.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section.entity-TsV2eE47.mjs","sources":["../../../../libs/modules/asset-management/contracts/src/entities/asset-type-section/asset-type-section.entity.ts"],"sourcesContent":["import { AXPWidgetsList } from '@acorex-platform/framework-shared/core';\nimport { AXPEntity, createAllQueryView, entityMasterCrudActions, entityMasterRecordActions } from '@acorex-platform/framework-shared/entity';\n//#region ---- Imports ----\nimport { RootConfig } from '../../root-config';\nimport { ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY } from '../../ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY';\n\n//#endregion\n\n//#region ---- Entity Factory ----\n\n/**\n * Section header/metadata ({@link AXMAssetManagementAssetTypeSectionEntityModel}) with related\n * component rows ({@link AXMAssetManagementAssetTypeSectionComponentEntityModel}), similar in spirit\n * to report parameter groups (title + nested items) in report-management report definitions.\n */\nexport async function factoryAssetTypeSection(): Promise<AXPEntity | null> {\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.assetTypeSection.name,\n title: RootConfig.entities.assetTypeSection.title,\n icon: RootConfig.entities.assetTypeSection.icon,\n searchTags: [\n 'asset-type-section',\n 'section',\n 'structure',\n 'component-group',\n 'asset-type',\n 'blueprint',\n 'folder',\n 'بخش نوع دارایی',\n 'بخشهای نوع دارایی',\n 'ساختار',\n 'نوع دارایی',\n 'قسم',\n 'هيكل',\n ],\n plugins: [{ name: 'unique-fields', options: { fields: 'code', scope: 'global' } } ,\n {name : 'notes'}\n ],\n pages: [\n {\n componentKey: ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY,\n field: 'questions',\n title: '@assessment-management:questionnaires.entities.questionnaire.fields.questions.title',\n icon: 'fa-light fa-list-check',\n layout: { order: 1, position: 'after' },\n },\n ],\n relatedEntities: [\n // {\n // entity: `${RootConfig.module.name}.${RootConfig.entities.assetTypeSectionComponent.name}`,\n // title:\n // '@asset-management:assetTypeSections.entities.assetTypeSection.related-entities.assetTypeSectionComponents.title',\n // //icon: RootConfig.entities.assetTypeSectionComponent.icon,\n // //columns: ['roleName', 'count', 'hasMaintenance'],\n // conditions: [entityDetailsSimpleCondition('assetTypeSectionId')],\n // actions: [...entityDetailsCrudActions('assetTypeSectionId')],\n // layout: { type: 'tab-list' },\n // },\n ],\n formats: {\n individual: RootConfig.entities.assetTypeSection.title,\n plural: RootConfig.entities.assetTypeSection.titlePlural,\n searchResult: { title: '{{ title }}' },\n },\n groups: [\n {\n id: 'basic-info',\n title: '@asset-management:assetTypeSections.entities.assetTypeSection.groups.basic-info',\n },\n ],\n properties: [\n {\n name: 'id',\n title: 'ID',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },\n },\n {\n name: 'assetTypeId',\n title: 'Asset Type ID',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true },\n options: { sort: { enabled: false }, filter: { advance: { enabled: false }, inline: { enabled: false } } },\n },\n {\n name: 'code',\n title: '@asset-management:assetTypeSections.entities.assetTypeSection.fields.code.title',\n groupId: 'basic-info',\n schema: {\n dataType: 'number',\n unique: { enabled: true },\n interface: {\n type: AXPWidgetsList.Editors.NumberBox,\n options: {\n placeholder: '@asset-management:assetTypeSections.entities.assetTypeSection.fields.code.placeholder',\n },\n },\n },\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'title',\n title: '@asset-management:assetTypeSections.entities.assetTypeSection.fields.title.title',\n groupId: 'basic-info',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsList.Editors.TextBox,\n options: {\n placeholder: '@asset-management:assetTypeSections.entities.assetTypeSection.fields.title.placeholder',\n },\n },\n },\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n validations: [{ rule: 'required' }],\n },\n ],\n columns: [{ name: 'code' }, { name: 'title' } ],\n queries: {},\n interfaces: {\n master: {\n create: {\n sections: [{ id: 'basic-info', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],\n properties: [\n { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n ],\n },\n update: {\n sections: [{ id: 'basic-info', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],\n properties: [\n { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 2 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n ],\n },\n single: {\n title: '{{ title }}',\n sections: [{ id: 'basic-info', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],\n properties: [\n { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n ],\n actions: [...entityMasterRecordActions()],\n },\n list: {\n actions: [...entityMasterCrudActions()],\n views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })],\n },\n },\n },\n };\n\n return entityDef;\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAMA;AAEA;AAEA;;;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,EAAE,EAAE,EAAE,CAAC;AAC1F,oBAAA,UAAU,EAAE;wBACV,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;wBACzE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;AAC5E,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,GAAG,yBAAyB,EAAE,CAAC;AAC1C,iBAAA;AACD,gBAAA,IAAI,EAAE;AACJ,oBAAA,OAAO,EAAE,CAAC,GAAG,uBAAuB,EAAE,CAAC;oBACvC,KAAK,EAAE,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACxE,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;AAEA;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type-section.entity-B5Z8s8_4.mjs","sources":["../../../../libs/modules/asset-management/contracts/src/entities/asset-type-section/asset-type-section.entity.ts"],"sourcesContent":["import { AXPWidgetsList } from '@acorex-platform/framework-shared/core';\nimport { AXPEntity, createAllQueryView, entityMasterCrudActions, entityMasterRecordActions } from '@acorex-platform/framework-shared/entity';\n//#region ---- Imports ----\nimport { RootConfig } from '../../root-config';\nimport { ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY } from '../../ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY';\n\n//#endregion\n\n//#region ---- Entity Factory ----\n\n/**\n * Section header/metadata ({@link AXMAssetManagementAssetTypeSectionEntityModel}) with related\n * component rows ({@link AXMAssetManagementAssetTypeSectionComponentEntityModel}), similar in spirit\n * to report parameter groups (title + nested items) in report-management report definitions.\n */\nexport async function factoryAssetTypeSection(): Promise<AXPEntity | null> {\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.assetTypeSection.name,\n title: RootConfig.entities.assetTypeSection.title,\n icon: RootConfig.entities.assetTypeSection.icon,\n searchTags: [\n 'asset-type-section',\n 'section',\n 'structure',\n 'component-group',\n 'asset-type',\n 'blueprint',\n 'folder',\n 'بخش نوع دارایی',\n 'بخشهای نوع دارایی',\n 'ساختار',\n 'نوع دارایی',\n 'قسم',\n 'هيكل',\n ],\n plugins: [{ name: 'unique-fields', options: { fields: 'code', scope: 'global' } } ,\n {name : 'notes'}\n ],\n pages: [\n {\n componentKey: ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY,\n field: 'questions',\n title: '@assessment-management:questionnaires.entities.questionnaire.fields.questions.title',\n icon: 'fa-light fa-list-check',\n layout: { order: 1, position: 'after' },\n },\n ],\n relatedEntities: [\n // {\n // entity: `${RootConfig.module.name}.${RootConfig.entities.assetTypeSectionComponent.name}`,\n // title:\n // '@asset-management:assetTypeSections.entities.assetTypeSection.related-entities.assetTypeSectionComponents.title',\n // //icon: RootConfig.entities.assetTypeSectionComponent.icon,\n // //columns: ['roleName', 'count', 'hasMaintenance'],\n // conditions: [entityDetailsSimpleCondition('assetTypeSectionId')],\n // actions: [...entityDetailsCrudActions('assetTypeSectionId')],\n // layout: { type: 'tab-list' },\n // },\n ],\n formats: {\n individual: RootConfig.entities.assetTypeSection.title,\n plural: RootConfig.entities.assetTypeSection.titlePlural,\n searchResult: { title: '{{ title }}' },\n },\n groups: [\n {\n id: 'basic-info',\n title: '@asset-management:assetTypeSections.entities.assetTypeSection.groups.basic-info',\n },\n ],\n properties: [\n {\n name: 'id',\n title: 'ID',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },\n },\n {\n name: 'assetTypeId',\n title: 'Asset Type ID',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true },\n options: { sort: { enabled: false }, filter: { advance: { enabled: false }, inline: { enabled: false } } },\n },\n {\n name: 'code',\n title: '@asset-management:assetTypeSections.entities.assetTypeSection.fields.code.title',\n groupId: 'basic-info',\n schema: {\n dataType: 'number',\n unique: { enabled: true },\n interface: {\n type: AXPWidgetsList.Editors.NumberBox,\n options: {\n placeholder: '@asset-management:assetTypeSections.entities.assetTypeSection.fields.code.placeholder',\n },\n },\n },\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'title',\n title: '@asset-management:assetTypeSections.entities.assetTypeSection.fields.title.title',\n groupId: 'basic-info',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsList.Editors.TextBox,\n options: {\n placeholder: '@asset-management:assetTypeSections.entities.assetTypeSection.fields.title.placeholder',\n },\n },\n },\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n validations: [{ rule: 'required' }],\n },\n ],\n columns: [{ name: 'code' }, { name: 'title' } ],\n queries: {},\n interfaces: {\n master: {\n create: {\n sections: [{ id: 'basic-info', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],\n properties: [\n { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n ],\n },\n update: {\n sections: [{ id: 'basic-info', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],\n properties: [\n { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 2 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n ],\n },\n single: {\n title: '{{ title }}',\n sections: [{ id: 'basic-info', order: 1, layout: { positions: { lg: { colSpan: 12 } } } }],\n properties: [\n { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n { name: 'title', layout: { positions: { lg: { colSpan: 12, order: 3 } } } },\n ],\n actions: [...entityMasterRecordActions()],\n },\n list: {\n actions: [...entityMasterCrudActions()],\n views: [createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] })],\n },\n },\n },\n };\n\n return entityDef;\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAMA;AAEA;AAEA;;;;AAIG;AACI,eAAe,uBAAuB,GAAA;AAC3C,IAAA,MAAM,SAAS,GAAc;AAC3B,QAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC9B,QAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI;AAC/C,QAAA,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,KAAK;AACjD,QAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI;AAC/C,QAAA,UAAU,EAAE;YACV,oBAAoB;YACpB,SAAS;YACT,WAAW;YACX,iBAAiB;YACjB,YAAY;YACZ,WAAW;YACX,QAAQ;YACR,gBAAgB;YAChB,oBAAoB;YACpB,QAAQ;YACR,YAAY;YACZ,KAAK;YACL,MAAM;AACP,SAAA;AACD,QAAA,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACvE,EAAC,IAAI,EAAG,OAAO;AACxB,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA;AACE,gBAAA,YAAY,EAAE,wCAAwC;AACtD,gBAAA,KAAK,EAAE,WAAW;AAClB,gBAAA,KAAK,EAAE,qFAAqF;AAC5F,gBAAA,IAAI,EAAE,wBAAwB;gBAC9B,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE;AACxC,aAAA;AACF,SAAA;AACD,QAAA,eAAe,EAAE;;;;;;;;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5E,qBAAA;AACF,iBAAA;AACD,gBAAA,MAAM,EAAE;AACN,oBAAA,KAAK,EAAE,aAAa;oBACpB,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAC1F,oBAAA,UAAU,EAAE;wBACV,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;wBACzE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE;AAC5E,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,GAAG,yBAAyB,EAAE,CAAC;AAC1C,iBAAA;AACD,gBAAA,IAAI,EAAE;AACJ,oBAAA,OAAO,EAAE,CAAC,GAAG,uBAAuB,EAAE,CAAC;oBACvC,KAAK,EAAE,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACxE,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;AAEA;;"}
|
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import { AXPWidgetsCatalog, AXPSystemActionType } from '@acorex-platform/framework-shared/core';
|
|
2
2
|
import { createAllQueryView, entityMasterCrudActions, entityMasterRecordActions, AXPEntityCommandScope, entityDetailsCrudActions, entityDetailsSimpleCondition } from '@acorex-platform/framework-shared/entity';
|
|
3
|
-
import {
|
|
3
|
+
import { A as AXMAssetIntervalKind } from './acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.interval-kind-nMKvWqpx.mjs';
|
|
4
|
+
import { R as RootConfig } from './acorex-platform-module-asset-management-client-contracts-entity-catalog-acorex-platform-module-asset-management-client-contracts-entity-catalog-CnuEulTO.mjs';
|
|
4
5
|
import { A as ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY } from './acorex-platform-module-asset-management-client-contracts-entity-catalog-ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY-Jlv8czA2.mjs';
|
|
5
6
|
|
|
7
|
+
const supportedIntervalKindDataSource = [
|
|
8
|
+
{
|
|
9
|
+
id: AXMAssetIntervalKind.Date,
|
|
10
|
+
title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.options.date',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: AXMAssetIntervalKind.Distance,
|
|
14
|
+
title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.options.distance',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: AXMAssetIntervalKind.OperatingHours,
|
|
18
|
+
title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.options.operating-hours',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: AXMAssetIntervalKind.OperationCount,
|
|
22
|
+
title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.options.operation-count',
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
const maintenanceFieldVisible = `{{ [true, "true"].includes(context.eval("hasMaintenance")) }}`;
|
|
6
26
|
//#endregion
|
|
7
27
|
//#region ---- Entity Factory ----
|
|
8
28
|
/**
|
|
@@ -211,7 +231,7 @@ async function factoryAssetType() {
|
|
|
211
231
|
dataType: 'array',
|
|
212
232
|
nullable: true,
|
|
213
233
|
defaultValue: [],
|
|
214
|
-
visible:
|
|
234
|
+
visible: maintenanceFieldVisible,
|
|
215
235
|
interface: {
|
|
216
236
|
type: AXPWidgetsCatalog.lookup,
|
|
217
237
|
options: {
|
|
@@ -228,6 +248,31 @@ async function factoryAssetType() {
|
|
|
228
248
|
filter: { advance: { enabled: false }, inline: { enabled: false } },
|
|
229
249
|
},
|
|
230
250
|
},
|
|
251
|
+
{
|
|
252
|
+
name: 'supportedIntervalKinds',
|
|
253
|
+
title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.title',
|
|
254
|
+
groupId: 'maintenance-info',
|
|
255
|
+
schema: {
|
|
256
|
+
dataType: 'array',
|
|
257
|
+
nullable: true,
|
|
258
|
+
defaultValue: [],
|
|
259
|
+
visible: maintenanceFieldVisible,
|
|
260
|
+
interface: {
|
|
261
|
+
type: AXPWidgetsCatalog.select,
|
|
262
|
+
options: {
|
|
263
|
+
valueField: 'id',
|
|
264
|
+
textField: 'title',
|
|
265
|
+
multiple: true,
|
|
266
|
+
allowSearch: false,
|
|
267
|
+
dataSource: supportedIntervalKindDataSource,
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
options: {
|
|
272
|
+
sort: { enabled: false },
|
|
273
|
+
filter: { advance: { enabled: false }, inline: { enabled: false } },
|
|
274
|
+
},
|
|
275
|
+
},
|
|
231
276
|
{
|
|
232
277
|
name: 'description',
|
|
233
278
|
title: '@asset-management:assetTypes.entities.assetType.fields.description.title',
|
|
@@ -276,6 +321,11 @@ async function factoryAssetType() {
|
|
|
276
321
|
title: '@asset-management:assetTypes.entities.assetType.fields.maintenanceTypeIds.gridTitle',
|
|
277
322
|
options: { order: 5 },
|
|
278
323
|
},
|
|
324
|
+
{
|
|
325
|
+
name: 'supportedIntervalKinds',
|
|
326
|
+
title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.gridTitle',
|
|
327
|
+
options: { order: 6 },
|
|
328
|
+
},
|
|
279
329
|
],
|
|
280
330
|
queries: {},
|
|
281
331
|
interfaces: {
|
|
@@ -306,6 +356,10 @@ async function factoryAssetType() {
|
|
|
306
356
|
name: 'maintenanceTypeIds',
|
|
307
357
|
layout: { positions: { lg: { colSpan: 12, order: 6 } } },
|
|
308
358
|
},
|
|
359
|
+
{
|
|
360
|
+
name: 'supportedIntervalKinds',
|
|
361
|
+
layout: { positions: { lg: { colSpan: 12, order: 7 } } },
|
|
362
|
+
},
|
|
309
363
|
],
|
|
310
364
|
},
|
|
311
365
|
update: {
|
|
@@ -334,6 +388,10 @@ async function factoryAssetType() {
|
|
|
334
388
|
name: 'maintenanceTypeIds',
|
|
335
389
|
layout: { positions: { lg: { colSpan: 12, order: 6 } } },
|
|
336
390
|
},
|
|
391
|
+
{
|
|
392
|
+
name: 'supportedIntervalKinds',
|
|
393
|
+
layout: { positions: { lg: { colSpan: 12, order: 7 } } },
|
|
394
|
+
},
|
|
337
395
|
],
|
|
338
396
|
},
|
|
339
397
|
single: {
|
|
@@ -364,6 +422,10 @@ async function factoryAssetType() {
|
|
|
364
422
|
name: 'maintenanceTypeIds',
|
|
365
423
|
layout: { positions: { lg: { colSpan: 12, order: 6 } } },
|
|
366
424
|
},
|
|
425
|
+
{
|
|
426
|
+
name: 'supportedIntervalKinds',
|
|
427
|
+
layout: { positions: { lg: { colSpan: 12, order: 7 } } },
|
|
428
|
+
},
|
|
367
429
|
],
|
|
368
430
|
actions: [...entityMasterRecordActions()],
|
|
369
431
|
},
|
|
@@ -381,4 +443,4 @@ async function factoryAssetType() {
|
|
|
381
443
|
//#endregion
|
|
382
444
|
|
|
383
445
|
export { factoryAssetType };
|
|
384
|
-
//# sourceMappingURL=acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type.entity-
|
|
446
|
+
//# sourceMappingURL=acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type.entity-BO3otOO_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-asset-management-client-contracts-entity-catalog-asset-type.entity-BO3otOO_.mjs","sources":["../../../../libs/modules/asset-management/contracts/src/entities/asset-type/asset-type.entity.ts"],"sourcesContent":["import {\n AXPSystemActionType,\n AXPWidgetsCatalog,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXPEntity,\n AXPEntityCommandScope,\n createAllQueryView,\n entityDetailsCrudActions,\n entityDetailsSimpleCondition,\n entityMasterCrudActions,\n entityMasterRecordActions,\n} from '@acorex-platform/framework-shared/entity';\n//#region ---- Imports ----\nimport { AXMAssetIntervalKind } from '../../asset.interval-kind';\nimport { RootConfig } from '../../root-config';\nimport { ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY } from '../../ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY';\n\nconst supportedIntervalKindDataSource = [\n {\n id: AXMAssetIntervalKind.Date,\n title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.options.date',\n },\n {\n id: AXMAssetIntervalKind.Distance,\n title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.options.distance',\n },\n {\n id: AXMAssetIntervalKind.OperatingHours,\n title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.options.operating-hours',\n },\n {\n id: AXMAssetIntervalKind.OperationCount,\n title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.options.operation-count',\n },\n];\n\nconst maintenanceFieldVisible = `{{ [true, \"true\"].includes(context.eval(\"hasMaintenance\")) }}`;\n\n//#endregion\n\n//#region ---- Entity Factory ----\n\n/**\n * Entity definition aligned with {@link AXMAssetManagementAssetTypeEntityModel}.\n * Categories use `categoryIds` (see category plugin `propertyName`). `maintenanceTypeIds` is shown when `hasMaintenance` is enabled.\n */\nexport async function factoryAssetType(): Promise<AXPEntity | null> {\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.assetType.name,\n title: RootConfig.entities.assetType.title,\n icon: RootConfig.entities.assetType.icon,\n searchTags: [\n 'asset-type',\n 'type',\n 'classification',\n 'category',\n 'template',\n 'maintenance',\n 'inspection',\n 'نوع دارایی',\n 'انواع دارایی',\n 'دستهبندی دارایی',\n 'قالب',\n 'نوع',\n 'تصنيف',\n ],\n plugins: [\n // { name: 'unique-fields', options: { fields: 'code', scope: 'global' } },\n { name: 'history' },\n {\n name: 'category',\n options: { appearance: { icon: true, color: true } },\n },\n {\n name: 'meta-data-builder',\n options: {\n display: 'page',\n order: 3,\n },\n },\n // { name: 'identifier', options: { field: 'code', rule: 'asset-type-code' } },\n { name: 'reports' },\n ],\n pages: [\n {\n componentKey: ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY,\n field: 'components',\n title:\n '@asset-management:assetTypes.entities.assetType.components.components.title',\n icon: 'fa-light fa-sitemap',\n layout: { order: 2, position: 'after' },\n options: { order: 2, allowEditSection: false },\n },\n ],\n relatedEntities: [\n {\n entity: 'MaintenanceManagement.ActivityTypeAssetType',\n title:\n '@asset-management:assetTypes.entities.assetType.related-entities.activity-type-asset-types.title',\n icon: 'fa-light fa-link',\n hidden: `{{ ![true, \"true\", 1, \"1\"].includes(context.eval(\"hasMaintenance\")) }}`,\n conditions: [entityDetailsSimpleCondition('assetTypeId')],\n actions: [...entityDetailsCrudActions('assetTypeId')],\n layout: { type: 'page-list', position: 'after', order: 4 },\n },\n {\n entity: 'MaintenanceManagement.MaintenanceTemplate',\n title:\n '@asset-management:assetTypes.entities.assetType.related-entities.maintenance-templates.title',\n icon: 'fa-light fa-clipboard-list',\n hidden: `{{ ![true, \"true\", 1, \"1\"].includes(context.eval(\"hasMaintenance\")) }}`,\n conditions: [entityDetailsSimpleCondition('assetTypeId')],\n actions: [\n {\n title: '@general:actions.create.title',\n command: {\n name: 'Entity:Create',\n options: {\n process: {\n redirect: false,\n canCreateNewOne: true,\n data: {\n assetTypeId: '{{ context.eval(\"id\") }}',\n assetType: {\n id: '{{ context.eval(\"id\") }}',\n title:\n '{{ context.eval(\"title\", { pipes: [\"translate\"] }) }}',\n maintenanceTypeIds:\n '{{ context.eval(\"maintenanceTypeIds\") }}',\n },\n },\n },\n },\n },\n priority: 'primary',\n type: AXPSystemActionType.Create,\n scope: AXPEntityCommandScope.TypeLevel,\n },\n ...entityDetailsCrudActions('assetTypeId', { create: false }),\n ],\n layout: { type: 'page-list', position: 'after', order: 6 },\n },\n ],\n formats: {\n individual: RootConfig.entities.assetType.title,\n plural: RootConfig.entities.assetType.titlePlural,\n searchResult: { title: '{{ title }}' },\n displayName: '@general:terms.common.overview',\n },\n groups: [\n {\n id: 'basic-info',\n title:\n '@asset-management:assetTypes.entities.assetType.groups.basic-info',\n },\n {\n id: 'maintenance-info',\n title:\n '@asset-management:assetTypes.entities.assetType.groups.maintenance-info',\n },\n {\n id: 'components',\n title:\n '@asset-management:assetTypes.entities.assetType.groups.components',\n },\n ],\n properties: [\n {\n name: 'id',\n title: 'ID',\n schema: {\n dataType: 'uuid',\n visible: false,\n nullable: false,\n readonly: true,\n unique: { enabled: true },\n },\n },\n // {\n // name: 'code',\n // title: '@asset-management:assetTypes.entities.assetType.fields.code.title',\n // groupId: 'basic-info',\n // schema: {\n // dataType: 'string',\n // unique: { enabled: true },\n // interface: {\n // type: AXPWidgetsCatalog.text,\n // options: {\n // disabled: true,\n // },\n // },\n // },\n // options: {\n // sort: { enabled: true },\n // filter: { advance: { enabled: true }, inline: { enabled: true } },\n // },\n // validations: [{ rule: 'required' }],\n // },\n {\n name: 'name',\n title:\n '@asset-management:assetTypes.entities.assetType.fields.name.title',\n groupId: 'basic-info',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.text,\n },\n },\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'title',\n title:\n '@asset-management:assetTypes.entities.assetType.fields.title.title',\n groupId: 'basic-info',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.text,\n },\n },\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'hasMaintenance',\n title:\n '@asset-management:assetTypes.entities.assetType.fields.hasMaintenance.title',\n groupId: 'maintenance-info',\n schema: {\n dataType: 'boolean',\n defaultValue: false,\n interface: {\n type: AXPWidgetsCatalog.toggle,\n },\n },\n options: {\n sort: { enabled: true },\n filter: { advance: { enabled: true }, inline: { enabled: true } },\n },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'maintenanceTypeIds',\n title:\n '@asset-management:assetTypes.entities.assetType.fields.maintenanceTypeIds.title',\n groupId: 'maintenance-info',\n schema: {\n dataType: 'array',\n nullable: true,\n defaultValue: [],\n visible: maintenanceFieldVisible,\n interface: {\n type: AXPWidgetsCatalog.lookup,\n options: {\n entity: 'MaintenanceManagement.MaintenanceType',\n textField: 'title',\n valueField: 'id',\n look: 'drop-down',\n multiple: true,\n },\n },\n },\n options: {\n sort: { enabled: false },\n filter: { advance: { enabled: false }, inline: { enabled: false } },\n },\n },\n {\n name: 'supportedIntervalKinds',\n title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.title',\n groupId: 'maintenance-info',\n schema: {\n dataType: 'array',\n nullable: true,\n defaultValue: [],\n visible: maintenanceFieldVisible,\n interface: {\n type: AXPWidgetsCatalog.select,\n options: {\n valueField: 'id',\n textField: 'title',\n multiple: true,\n allowSearch: false,\n dataSource: supportedIntervalKindDataSource,\n },\n },\n },\n options: {\n sort: { enabled: false },\n filter: { advance: { enabled: false }, inline: { enabled: false } },\n },\n },\n {\n name: 'description',\n title:\n '@asset-management:assetTypes.entities.assetType.fields.description.title',\n groupId: 'basic-info',\n schema: {\n dataType: 'string',\n interface: {\n type: AXPWidgetsCatalog.largeText,\n options: {\n rows: 4,\n },\n },\n },\n options: {\n sort: { enabled: false },\n filter: { advance: { enabled: true }, inline: { enabled: false } },\n },\n },\n {\n name: 'components',\n title:\n '@asset-management:assetTypes.entities.assetType.components.components.title',\n groupId: 'components',\n options: {\n sort: { enabled: false },\n filter: { advance: { enabled: false }, inline: { enabled: false } },\n },\n schema: {\n dataType: 'object',\n defaultValue: { sections: [] },\n visible: false,\n nullable: true,\n },\n },\n ],\n columns: [\n { name: 'name', options: { order: 1 } },\n { name: 'title', options: { order: 2 } },\n { name: 'description', options: { order: 3 } },\n {\n name: 'hasMaintenance',\n title:\n '@asset-management:assetTypes.entities.assetType.fields.hasMaintenance.gridTitle',\n options: { order: 4 },\n },\n {\n name: 'maintenanceTypeIds',\n title:\n '@asset-management:assetTypes.entities.assetType.fields.maintenanceTypeIds.gridTitle',\n options: { order: 5 },\n },\n {\n name: 'supportedIntervalKinds',\n title: '@asset-management:assetTypes.entities.assetType.fields.supported-interval-kinds.gridTitle',\n options: { order: 6 },\n },\n ],\n queries: {},\n interfaces: {\n master: {\n create: {\n sections: [\n { id: 'basic-info', order: 1 },\n { id: 'maintenance-info', order: 2 },\n ],\n properties: [\n {\n name: 'name',\n layout: { positions: { lg: { colSpan: 6, order: 2 } } },\n },\n {\n name: 'title',\n layout: { positions: { lg: { colSpan: 6, order: 3 } } },\n },\n {\n name: 'description',\n layout: { positions: { lg: { colSpan: 12, order: 4 } } },\n },\n {\n name: 'hasMaintenance',\n layout: { positions: { lg: { colSpan: 12, order: 5 } } },\n },\n {\n name: 'maintenanceTypeIds',\n layout: { positions: { lg: { colSpan: 12, order: 6 } } },\n },\n {\n name: 'supportedIntervalKinds',\n layout: { positions: { lg: { colSpan: 12, order: 7 } } },\n },\n ],\n },\n update: {\n sections: [\n { id: 'basic-info', order: 1 },\n { id: 'maintenance-info', order: 2 },\n ],\n properties: [\n {\n name: 'name',\n layout: { positions: { lg: { colSpan: 6, order: 2 } } },\n },\n {\n name: 'title',\n layout: { positions: { lg: { colSpan: 6, order: 3 } } },\n },\n {\n name: 'description',\n layout: { positions: { lg: { colSpan: 12, order: 4 } } },\n },\n {\n name: 'hasMaintenance',\n layout: { positions: { lg: { colSpan: 12, order: 5 } } },\n },\n {\n name: 'maintenanceTypeIds',\n layout: { positions: { lg: { colSpan: 12, order: 6 } } },\n },\n {\n name: 'supportedIntervalKinds',\n layout: { positions: { lg: { colSpan: 12, order: 7 } } },\n },\n ],\n },\n single: {\n title: '{{ title }}',\n sections: [\n { id: 'basic-info', order: 1 },\n { id: 'maintenance-info', order: 2 },\n ],\n properties: [\n // { name: 'code', layout: { positions: { lg: { colSpan: 6, order: 1 } } } },\n {\n name: 'name',\n layout: { positions: { lg: { colSpan: 6, order: 2 } } },\n },\n {\n name: 'title',\n layout: { positions: { lg: { colSpan: 6, order: 3 } } },\n },\n {\n name: 'description',\n layout: { positions: { lg: { colSpan: 12, order: 4 } } },\n },\n {\n name: 'hasMaintenance',\n layout: { positions: { lg: { colSpan: 12, order: 5 } } },\n },\n {\n name: 'maintenanceTypeIds',\n layout: { positions: { lg: { colSpan: 12, order: 6 } } },\n },\n {\n name: 'supportedIntervalKinds',\n layout: { positions: { lg: { colSpan: 12, order: 7 } } },\n },\n ],\n actions: [...entityMasterRecordActions()],\n },\n list: {\n actions: [...entityMasterCrudActions()],\n views: [\n createAllQueryView({ sorts: [{ name: 'name', dir: 'asc' }] }),\n ],\n },\n },\n },\n };\n\n return entityDef;\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AAkBA,MAAM,+BAA+B,GAAG;AACtC,IAAA;QACE,EAAE,EAAE,oBAAoB,CAAC,IAAI;AAC7B,QAAA,KAAK,EAAE,8FAA8F;AACtG,KAAA;AACD,IAAA;QACE,EAAE,EAAE,oBAAoB,CAAC,QAAQ;AACjC,QAAA,KAAK,EAAE,kGAAkG;AAC1G,KAAA;AACD,IAAA;QACE,EAAE,EAAE,oBAAoB,CAAC,cAAc;AACvC,QAAA,KAAK,EAAE,yGAAyG;AACjH,KAAA;AACD,IAAA;QACE,EAAE,EAAE,oBAAoB,CAAC,cAAc;AACvC,QAAA,KAAK,EAAE,yGAAyG;AACjH,KAAA;CACF;AAED,MAAM,uBAAuB,GAAG,CAAA,6DAAA,CAA+D;AAE/F;AAEA;AAEA;;;AAGG;AACI,eAAe,gBAAgB,GAAA;AACpC,IAAA,MAAM,SAAS,GAAc;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EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;AACzD,yBAAA;AACD,wBAAA;AACE,4BAAA,IAAI,EAAE,oBAAoB;AAC1B,4BAAA,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;AACzD,yBAAA;AACD,wBAAA;AACE,4BAAA,IAAI,EAAE,wBAAwB;AAC9B,4BAAA,MAAM,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;AACzD,yBAAA;AACF,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,GAAG,yBAAyB,EAAE,CAAC;AAC1C,iBAAA;AACD,gBAAA,IAAI,EAAE;AACJ,oBAAA,OAAO,EAAE,CAAC,GAAG,uBAAuB,EAAE,CAAC;AACvC,oBAAA,KAAK,EAAE;AACL,wBAAA,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAC9D,qBAAA;AACF,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;AAEA;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AXPSystemActionType, AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
|
|
2
2
|
import { AXPEntityCommandScope, entityMasterCrudActions, createAllQueryView, entityMasterRecordActions, entityDetailsEditAction, entityDetailsSimpleCondition, entityDetailsCrudActions } from '@acorex-platform/framework-shared/entity';
|
|
3
3
|
import { A as ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY } from './acorex-platform-module-asset-management-client-contracts-entity-catalog-ASSET_TYPE_COMPONENTS_PAGE_COMPONENT_KEY-Jlv8czA2.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { A as AXMAssetIntervalKind } from './acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.interval-kind-nMKvWqpx.mjs';
|
|
5
|
+
import { R as RootConfig } from './acorex-platform-module-asset-management-client-contracts-entity-catalog-acorex-platform-module-asset-management-client-contracts-entity-catalog-CnuEulTO.mjs';
|
|
5
6
|
|
|
6
7
|
/** Asset booking catalog scope for questionnaires, question bank items, and workflow definitions. */
|
|
7
8
|
const ASSET_CATALOG_SCOPE_BOOKING = 'asset-management.booking';
|
|
@@ -85,6 +86,203 @@ var AXMAssetStatus;
|
|
|
85
86
|
})(AXMAssetStatus || (AXMAssetStatus = {}));
|
|
86
87
|
//#endregion
|
|
87
88
|
|
|
89
|
+
//#region ----- Interval unit -----
|
|
90
|
+
/** Unit stored on an asset usage reading. Same stored strings as maintenance interval units. */
|
|
91
|
+
var AXMAssetIntervalUnit;
|
|
92
|
+
(function (AXMAssetIntervalUnit) {
|
|
93
|
+
AXMAssetIntervalUnit["Kilometer"] = "kilometer";
|
|
94
|
+
AXMAssetIntervalUnit["Mile"] = "mile";
|
|
95
|
+
AXMAssetIntervalUnit["Hour"] = "hour";
|
|
96
|
+
AXMAssetIntervalUnit["Operation"] = "operation";
|
|
97
|
+
})(AXMAssetIntervalUnit || (AXMAssetIntervalUnit = {}));
|
|
98
|
+
const ASSET_INTERVAL_UNITS = new Set(Object.values(AXMAssetIntervalUnit));
|
|
99
|
+
function isAXMAssetIntervalUnit(value) {
|
|
100
|
+
return ASSET_INTERVAL_UNITS.has(value);
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region ----- Constants -----
|
|
106
|
+
/** Entity widget that edits and displays `usageValues`. */
|
|
107
|
+
const AXM_ASSET_USAGE_VALUES_WIDGET = 'asset-usage-values-editor';
|
|
108
|
+
const I18N = '@asset-management:assets.entities.asset.fields.usage-values.validation';
|
|
109
|
+
const AXM_ASSET_USAGE_WRITE_ERRORS = {
|
|
110
|
+
invalid: { message: `${I18N}.invalid`, code: 'ASSET_USAGE_VALUE_INVALID' },
|
|
111
|
+
'date-kind': { message: `${I18N}.date-kind`, code: 'ASSET_USAGE_VALUE_DATE_KIND' },
|
|
112
|
+
negative: { message: `${I18N}.negative`, code: 'ASSET_USAGE_VALUE_NEGATIVE' },
|
|
113
|
+
'not-integer': { message: `${I18N}.not-integer`, code: 'ASSET_USAGE_VALUE_NOT_INTEGER' },
|
|
114
|
+
unit: { message: `${I18N}.unit`, code: 'ASSET_USAGE_VALUE_UNIT' },
|
|
115
|
+
'unsupported-kind': { message: `${I18N}.unsupported-kind`, code: 'ASSET_USAGE_VALUE_UNSUPPORTED_KIND' },
|
|
116
|
+
decreased: { message: `${I18N}.decreased`, code: 'ASSET_USAGE_VALUE_DECREASED' },
|
|
117
|
+
'unit-changed': { message: `${I18N}.unit-changed`, code: 'ASSET_USAGE_VALUE_UNIT_CHANGED' },
|
|
118
|
+
'invalid-reading-at': { message: `${I18N}.invalid-reading-at`, code: 'ASSET_USAGE_VALUE_READING_AT' },
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region ----- Kind and unit -----
|
|
122
|
+
function isAXMAssetUsageKind(value) {
|
|
123
|
+
return (value === AXMAssetIntervalKind.Distance ||
|
|
124
|
+
value === AXMAssetIntervalKind.OperatingHours ||
|
|
125
|
+
value === AXMAssetIntervalKind.OperationCount);
|
|
126
|
+
}
|
|
127
|
+
function isAXMAssetUsageUnitForKind(kind, unit) {
|
|
128
|
+
switch (kind) {
|
|
129
|
+
case AXMAssetIntervalKind.Distance:
|
|
130
|
+
return unit === AXMAssetIntervalUnit.Kilometer || unit === AXMAssetIntervalUnit.Mile;
|
|
131
|
+
case AXMAssetIntervalKind.OperatingHours:
|
|
132
|
+
return unit === AXMAssetIntervalUnit.Hour;
|
|
133
|
+
case AXMAssetIntervalKind.OperationCount:
|
|
134
|
+
return unit === AXMAssetIntervalUnit.Operation;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function supportedUsageKinds(kinds) {
|
|
138
|
+
const set = new Set();
|
|
139
|
+
for (const kind of kinds) {
|
|
140
|
+
if (isAXMAssetUsageKind(kind)) {
|
|
141
|
+
set.add(kind);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return set;
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region ----- Read -----
|
|
148
|
+
function toIsoTimestamp(value) {
|
|
149
|
+
if (value instanceof Date) {
|
|
150
|
+
return Number.isNaN(value.getTime()) ? null : value.toISOString();
|
|
151
|
+
}
|
|
152
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
const parsed = new Date(value);
|
|
156
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed.toISOString();
|
|
157
|
+
}
|
|
158
|
+
function readOne(item) {
|
|
159
|
+
if (!item || typeof item !== 'object' || Array.isArray(item)) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
const record = item;
|
|
163
|
+
const kind = record['kind'];
|
|
164
|
+
if (typeof kind !== 'string' || !isAXMAssetUsageKind(kind)) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
const currentValue = record['currentValue'];
|
|
168
|
+
if (typeof currentValue !== 'number' || !Number.isFinite(currentValue) || currentValue < 0) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
if (kind === AXMAssetIntervalKind.OperationCount && !Number.isInteger(currentValue)) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
const unit = record['unit'];
|
|
175
|
+
if (typeof unit !== 'string' || !isAXMAssetIntervalUnit(unit) || !isAXMAssetUsageUnitForKind(kind, unit)) {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
const value = { kind, currentValue, unit };
|
|
179
|
+
if (record['lastReadingAt'] != null) {
|
|
180
|
+
const lastReadingAt = toIsoTimestamp(record['lastReadingAt']);
|
|
181
|
+
if (!lastReadingAt) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
value.lastReadingAt = lastReadingAt;
|
|
185
|
+
}
|
|
186
|
+
return value;
|
|
187
|
+
}
|
|
188
|
+
/** Missing, invalid, or date readings become `[]` or are dropped. The last item of a kind wins. */
|
|
189
|
+
function readAssetUsageValues(value) {
|
|
190
|
+
if (!Array.isArray(value)) {
|
|
191
|
+
return [];
|
|
192
|
+
}
|
|
193
|
+
const byKind = new Map();
|
|
194
|
+
for (const item of value) {
|
|
195
|
+
const reading = readOne(item);
|
|
196
|
+
if (reading) {
|
|
197
|
+
byKind.set(reading.kind, reading);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return [...byKind.values()];
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region ----- Write -----
|
|
204
|
+
function parseOne(item) {
|
|
205
|
+
if (!item || typeof item !== 'object' || Array.isArray(item)) {
|
|
206
|
+
return { issue: 'invalid' };
|
|
207
|
+
}
|
|
208
|
+
const record = item;
|
|
209
|
+
const kind = record['kind'];
|
|
210
|
+
if (kind === AXMAssetIntervalKind.Date) {
|
|
211
|
+
return { issue: 'date-kind' };
|
|
212
|
+
}
|
|
213
|
+
if (typeof kind !== 'string' || !isAXMAssetUsageKind(kind)) {
|
|
214
|
+
return { issue: 'invalid' };
|
|
215
|
+
}
|
|
216
|
+
const currentValue = record['currentValue'];
|
|
217
|
+
if (typeof currentValue !== 'number' || !Number.isFinite(currentValue)) {
|
|
218
|
+
return { issue: 'invalid' };
|
|
219
|
+
}
|
|
220
|
+
if (currentValue < 0) {
|
|
221
|
+
return { issue: 'negative' };
|
|
222
|
+
}
|
|
223
|
+
if (kind === AXMAssetIntervalKind.OperationCount && !Number.isInteger(currentValue)) {
|
|
224
|
+
return { issue: 'not-integer' };
|
|
225
|
+
}
|
|
226
|
+
const unit = record['unit'];
|
|
227
|
+
if (typeof unit !== 'string' || !isAXMAssetIntervalUnit(unit) || !isAXMAssetUsageUnitForKind(kind, unit)) {
|
|
228
|
+
return { issue: 'unit' };
|
|
229
|
+
}
|
|
230
|
+
const value = { kind, currentValue, unit };
|
|
231
|
+
if (record['lastReadingAt'] != null) {
|
|
232
|
+
const lastReadingAt = toIsoTimestamp(record['lastReadingAt']);
|
|
233
|
+
if (!lastReadingAt) {
|
|
234
|
+
return { issue: 'invalid-reading-at' };
|
|
235
|
+
}
|
|
236
|
+
value.lastReadingAt = lastReadingAt;
|
|
237
|
+
}
|
|
238
|
+
return { value };
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Normalizes a create/update payload.
|
|
242
|
+
* One item per kind; a later item replaces the earlier one.
|
|
243
|
+
* On update, kinds omitted from the payload stay. A lower value or a unit change is rejected.
|
|
244
|
+
*/
|
|
245
|
+
function resolveAssetUsageWrite(value, options) {
|
|
246
|
+
const previous = options.mergeWithPrevious ? readAssetUsageValues(options.previous) : [];
|
|
247
|
+
const previousByKind = new Map(previous.map((item) => [item.kind, item]));
|
|
248
|
+
if (value == null) {
|
|
249
|
+
return { values: previous, issue: null };
|
|
250
|
+
}
|
|
251
|
+
if (!Array.isArray(value)) {
|
|
252
|
+
return { values: [], issue: 'invalid' };
|
|
253
|
+
}
|
|
254
|
+
const incoming = new Map();
|
|
255
|
+
for (const item of value) {
|
|
256
|
+
const parsed = parseOne(item);
|
|
257
|
+
if ('issue' in parsed) {
|
|
258
|
+
return { values: [], issue: parsed.issue };
|
|
259
|
+
}
|
|
260
|
+
incoming.set(parsed.value.kind, parsed.value);
|
|
261
|
+
}
|
|
262
|
+
const supported = supportedUsageKinds(options.supportedKinds);
|
|
263
|
+
for (const reading of incoming.values()) {
|
|
264
|
+
if (!supported.has(reading.kind)) {
|
|
265
|
+
return { values: [], issue: 'unsupported-kind' };
|
|
266
|
+
}
|
|
267
|
+
const stored = previousByKind.get(reading.kind);
|
|
268
|
+
if (!stored) {
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
if (stored.unit !== reading.unit) {
|
|
272
|
+
return { values: [], issue: 'unit-changed' };
|
|
273
|
+
}
|
|
274
|
+
if (reading.currentValue < stored.currentValue) {
|
|
275
|
+
return { values: [], issue: 'decreased' };
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
const merged = new Map(previousByKind);
|
|
279
|
+
for (const [kind, reading] of incoming) {
|
|
280
|
+
merged.set(kind, reading);
|
|
281
|
+
}
|
|
282
|
+
return { values: [...merged.values()], issue: null };
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
|
|
88
286
|
//#endregion
|
|
89
287
|
async function factoryAsset() {
|
|
90
288
|
const hideMaintenanceRelatedEntities = '{{ ![true, "true", 1, "1"].includes(context.eval("assetType.hasMaintenance")) && ![true, "true", 1, "1"].includes(context.eval("hasMaintenance")) }}';
|
|
@@ -309,6 +507,10 @@ async function factoryAsset() {
|
|
|
309
507
|
id: 'operation-requirements',
|
|
310
508
|
title: '@asset-management:assets.entities.asset.groups.operation-requirements',
|
|
311
509
|
},
|
|
510
|
+
{
|
|
511
|
+
id: 'usage',
|
|
512
|
+
title: '@asset-management:assets.entities.asset.groups.usage',
|
|
513
|
+
},
|
|
312
514
|
{
|
|
313
515
|
id: 'lifecycle-status',
|
|
314
516
|
title: '@asset-management:assets.entities.asset.groups.lifecycle-status',
|
|
@@ -380,6 +582,10 @@ async function factoryAsset() {
|
|
|
380
582
|
source: 'maintenanceTypeIds',
|
|
381
583
|
target: 'assetType.maintenanceTypeIds',
|
|
382
584
|
},
|
|
585
|
+
{
|
|
586
|
+
source: 'supportedIntervalKinds',
|
|
587
|
+
target: 'assetType.supportedIntervalKinds',
|
|
588
|
+
},
|
|
383
589
|
],
|
|
384
590
|
},
|
|
385
591
|
triggers: [
|
|
@@ -659,6 +865,19 @@ async function factoryAsset() {
|
|
|
659
865
|
},
|
|
660
866
|
},
|
|
661
867
|
},
|
|
868
|
+
{
|
|
869
|
+
name: 'usageValues',
|
|
870
|
+
title: '@asset-management:assets.entities.asset.fields.usage-values.title',
|
|
871
|
+
groupId: 'usage',
|
|
872
|
+
schema: {
|
|
873
|
+
dataType: 'array',
|
|
874
|
+
nullable: true,
|
|
875
|
+
defaultValue: [],
|
|
876
|
+
interface: {
|
|
877
|
+
type: AXM_ASSET_USAGE_VALUES_WIDGET,
|
|
878
|
+
},
|
|
879
|
+
},
|
|
880
|
+
},
|
|
662
881
|
{
|
|
663
882
|
name: 'assetComponents',
|
|
664
883
|
title: '@asset-management:assets.entities.asset.components.asset-component.title',
|
|
@@ -721,7 +940,8 @@ async function factoryAsset() {
|
|
|
721
940
|
{ id: 'booking', order: 6 },
|
|
722
941
|
{ id: 'rental', order: 7 },
|
|
723
942
|
{ id: 'operation-requirements', order: 8 },
|
|
724
|
-
{ id: '
|
|
943
|
+
{ id: 'usage', order: 9 },
|
|
944
|
+
{ id: 'media', order: 10 },
|
|
725
945
|
],
|
|
726
946
|
properties: [
|
|
727
947
|
{
|
|
@@ -778,6 +998,13 @@ async function factoryAsset() {
|
|
|
778
998
|
name: 'licenseTypeId',
|
|
779
999
|
layout: { positions: { lg: { colSpan: 6, order: 14 } } },
|
|
780
1000
|
},
|
|
1001
|
+
{
|
|
1002
|
+
name: 'usageValues',
|
|
1003
|
+
layout: {
|
|
1004
|
+
label: { visible: false },
|
|
1005
|
+
positions: { lg: { colSpan: 12, order: 16 } },
|
|
1006
|
+
},
|
|
1007
|
+
},
|
|
781
1008
|
{
|
|
782
1009
|
name: 'qrCode',
|
|
783
1010
|
layout: {
|
|
@@ -813,10 +1040,11 @@ async function factoryAsset() {
|
|
|
813
1040
|
{ id: 'booking', order: 6 },
|
|
814
1041
|
{ id: 'rental', order: 7 },
|
|
815
1042
|
{ id: 'operation-requirements', order: 8 },
|
|
816
|
-
{ id: '
|
|
1043
|
+
{ id: 'usage', order: 9 },
|
|
1044
|
+
{ id: 'media', order: 10 },
|
|
817
1045
|
{
|
|
818
1046
|
id: 'lifecycle-status',
|
|
819
|
-
order:
|
|
1047
|
+
order: 11,
|
|
820
1048
|
layout: { positions: { lg: { colSpan: 12, colStart: 1 } } },
|
|
821
1049
|
},
|
|
822
1050
|
],
|
|
@@ -876,6 +1104,13 @@ async function factoryAsset() {
|
|
|
876
1104
|
name: 'licenseTypeId',
|
|
877
1105
|
layout: { positions: { lg: { colSpan: 6, order: 14 } } },
|
|
878
1106
|
},
|
|
1107
|
+
{
|
|
1108
|
+
name: 'usageValues',
|
|
1109
|
+
layout: {
|
|
1110
|
+
label: { visible: false },
|
|
1111
|
+
positions: { lg: { colSpan: 12, order: 16 } },
|
|
1112
|
+
},
|
|
1113
|
+
},
|
|
879
1114
|
{
|
|
880
1115
|
name: 'lifecycleStatusId',
|
|
881
1116
|
layout: { positions: { lg: { colSpan: 6, order: 15 } } },
|
|
@@ -920,10 +1155,11 @@ async function factoryAsset() {
|
|
|
920
1155
|
{ id: 'booking', order: 6 },
|
|
921
1156
|
{ id: 'rental', order: 7 },
|
|
922
1157
|
{ id: 'operation-requirements', order: 8 },
|
|
923
|
-
{ id: '
|
|
1158
|
+
{ id: 'usage', order: 9 },
|
|
1159
|
+
{ id: 'media', order: 10 },
|
|
924
1160
|
{
|
|
925
1161
|
id: 'lifecycle-status',
|
|
926
|
-
order:
|
|
1162
|
+
order: 11,
|
|
927
1163
|
layout: { positions: { lg: { colSpan: 12, colStart: 1 } } },
|
|
928
1164
|
},
|
|
929
1165
|
],
|
|
@@ -983,6 +1219,13 @@ async function factoryAsset() {
|
|
|
983
1219
|
name: 'licenseTypeId',
|
|
984
1220
|
layout: { positions: { lg: { colSpan: 6, order: 14 } } },
|
|
985
1221
|
},
|
|
1222
|
+
{
|
|
1223
|
+
name: 'usageValues',
|
|
1224
|
+
layout: {
|
|
1225
|
+
label: { visible: false },
|
|
1226
|
+
positions: { lg: { colSpan: 12, order: 16 } },
|
|
1227
|
+
},
|
|
1228
|
+
},
|
|
986
1229
|
{
|
|
987
1230
|
name: 'lifecycleStatusId',
|
|
988
1231
|
layout: { positions: { lg: { colSpan: 6, order: 15 } } },
|
|
@@ -1016,4 +1259,4 @@ async function factoryAsset() {
|
|
|
1016
1259
|
}
|
|
1017
1260
|
|
|
1018
1261
|
export { factoryAsset };
|
|
1019
|
-
//# sourceMappingURL=acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.entity-
|
|
1262
|
+
//# sourceMappingURL=acorex-platform-module-asset-management-client-contracts-entity-catalog-asset.entity-CvCBkNVZ.mjs.map
|