@dignite-ng/expand.cms 0.0.30 → 0.0.33
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/config/ng-package.json +7 -0
- package/config/src/cms-config.module.ts +12 -0
- package/config/{enums/index.d.ts → src/enums/index.ts} +1 -1
- package/config/src/enums/route-names.ts +8 -0
- package/config/{providers/index.d.ts → src/providers/index.ts} +1 -1
- package/config/src/providers/route.provider.ts +82 -0
- package/config/{public-api.d.ts → src/public-api.ts} +3 -3
- package/ng-package.json +7 -0
- package/package.json +6 -21
- package/src/lib/cms-routing.module.ts +108 -0
- package/src/lib/cms.module.ts +108 -0
- package/src/lib/components/admin/domains/domains.component.html +19 -0
- package/src/lib/components/admin/domains/domains.component.scss +0 -0
- package/src/lib/components/admin/domains/domains.component.spec.ts +21 -0
- package/src/lib/components/admin/domains/domains.component.ts +99 -0
- package/src/lib/components/admin/domains/index.ts +1 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.html +113 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.scss +1 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/create-or-edit-entries.component.ts +284 -0
- package/src/lib/components/admin/entries/create-or-update-entry-input-base.ts +33 -0
- package/src/lib/components/admin/entries/create.component.html +13 -0
- package/src/lib/components/admin/entries/create.component.scss +1 -0
- package/src/lib/components/admin/entries/create.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/create.component.ts +104 -0
- package/src/lib/components/admin/entries/edit.component.html +9 -0
- package/src/lib/components/admin/entries/edit.component.scss +1 -0
- package/src/lib/components/admin/entries/edit.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/edit.component.ts +98 -0
- package/src/lib/components/admin/entries/entries.component.html +112 -0
- package/src/lib/components/admin/entries/entries.component.scss +1 -0
- package/src/lib/components/admin/entries/entries.component.spec.ts +21 -0
- package/src/lib/components/admin/entries/entries.component.ts +219 -0
- package/src/lib/components/admin/entries/index.ts +4 -0
- package/src/lib/components/admin/fields/create-field.component.html +12 -0
- package/src/lib/components/admin/fields/create-field.component.scss +1 -0
- package/src/lib/components/admin/fields/create-field.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/create-field.component.ts +68 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.html +39 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.scss +0 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/create-or-edit-field.component.ts +116 -0
- package/src/lib/components/admin/fields/create-or-update-field-input-base.ts +33 -0
- package/src/lib/components/admin/fields/edit-field.component.html +13 -0
- package/src/lib/components/admin/fields/edit-field.component.scss +0 -0
- package/src/lib/components/admin/fields/edit-field.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/edit-field.component.ts +100 -0
- package/src/lib/components/admin/fields/field-group.component.html +69 -0
- package/src/lib/components/admin/fields/field-group.component.scss +0 -0
- package/src/lib/components/admin/fields/field-group.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/field-group.component.ts +132 -0
- package/src/lib/components/admin/fields/fields.component.html +74 -0
- package/src/lib/components/admin/fields/fields.component.scss +1 -0
- package/src/lib/components/admin/fields/fields.component.spec.ts +21 -0
- package/src/lib/components/admin/fields/fields.component.ts +111 -0
- package/src/lib/components/admin/fields/index.ts +6 -0
- package/src/lib/components/admin/index.ts +5 -0
- package/src/lib/components/admin/sections/create-or-update-sections-input-base.ts +36 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.ts +79 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.html +191 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.scss +1 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.spec.ts +21 -0
- package/src/lib/components/admin/sections/entry-types/create-or-edit.component.ts +408 -0
- package/src/lib/components/admin/sections/entry-types/index.ts +2 -0
- package/src/lib/components/admin/sections/index.ts +3 -0
- package/src/lib/components/admin/sections/sections.component.html +190 -0
- package/src/lib/components/admin/sections/sections.component.scss +1 -0
- package/src/lib/components/admin/sections/sections.component.spec.ts +21 -0
- package/src/lib/components/admin/sections/sections.component.ts +370 -0
- package/src/lib/components/admin/sites/create-or-update-sites-input-base.ts +18 -0
- package/src/lib/components/admin/sites/index.ts +2 -0
- package/src/lib/components/admin/sites/sites.component.html +136 -0
- package/src/lib/components/admin/sites/sites.component.scss +1 -0
- package/src/lib/components/admin/sites/sites.component.spec.ts +21 -0
- package/src/lib/components/admin/sites/sites.component.ts +250 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.html +36 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.scss +0 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/entry/entry-config.component.ts +115 -0
- package/src/lib/components/dynamic-form/entry/entry-config.ts +24 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.html +26 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.scss +1 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/entry/entry-control.component.ts +109 -0
- package/src/lib/components/dynamic-form/entry/index.ts +3 -0
- package/src/lib/components/dynamic-form/form-control-group.ts +27 -0
- package/src/lib/components/dynamic-form/index.ts +4 -0
- package/src/lib/components/dynamic-form/matrix/index.ts +3 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.html +147 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.scss +0 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.component.ts +236 -0
- package/src/lib/components/dynamic-form/matrix/matrix-config.ts +63 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.html +42 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.scss +0 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/matrix/matrix-control.component.ts +104 -0
- package/src/lib/components/dynamic-form/table/index.ts +3 -0
- package/src/lib/components/dynamic-form/table/table-config.component.html +85 -0
- package/src/lib/components/dynamic-form/table/table-config.component.scss +10 -0
- package/src/lib/components/dynamic-form/table/table-config.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/table/table-config.component.ts +170 -0
- package/src/lib/components/dynamic-form/table/table-config.ts +45 -0
- package/src/lib/components/dynamic-form/table/table-control.component.html +54 -0
- package/src/lib/components/dynamic-form/table/table-control.component.scss +1 -0
- package/src/lib/components/dynamic-form/table/table-control.component.spec.ts +21 -0
- package/src/lib/components/dynamic-form/table/table-control.component.ts +115 -0
- package/src/lib/components/index.ts +2 -0
- package/src/lib/constants/index.ts +1 -0
- package/src/lib/constants/styles.ts +13 -0
- package/src/lib/enums/ecms-component.ts +11 -0
- package/src/lib/enums/index.ts +1 -0
- package/src/lib/proxy/README.md +17 -0
- package/src/lib/proxy/admin/domains/domain-admin.service.ts +38 -0
- package/{lib/proxy/admin/domains/models.d.ts → src/lib/proxy/admin/domains/models.ts} +9 -7
- package/src/lib/proxy/admin/dynamic-forms/form-admin.service.ts +21 -0
- package/src/lib/proxy/admin/dynamic-forms/models.ts +5 -0
- package/src/lib/proxy/admin/entries/entry-admin.service.ts +109 -0
- package/src/lib/proxy/admin/entries/models.ts +68 -0
- package/src/lib/proxy/admin/fields/field-admin.service.ts +64 -0
- package/src/lib/proxy/admin/fields/field-group-admin.service.ts +56 -0
- package/{lib/proxy/admin/fields/models.d.ts → src/lib/proxy/admin/fields/models.ts} +42 -34
- package/src/lib/proxy/admin/index.ts +7 -0
- package/src/lib/proxy/admin/sections/entry-type-admin.service.ts +55 -0
- package/{lib/proxy/admin/sections/models.d.ts → src/lib/proxy/admin/sections/models.ts} +81 -67
- package/src/lib/proxy/admin/sections/section-admin.service.ts +74 -0
- package/src/lib/proxy/admin/settings/site-settings-admin.service.ts +37 -0
- package/src/lib/proxy/dignite/abp/data/index.ts +1 -0
- package/src/lib/proxy/dignite/abp/data/models.ts +4 -0
- package/src/lib/proxy/dignite/abp/index.ts +2 -0
- package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +65 -0
- package/src/lib/proxy/dignite/file-explorer/directories/index.ts +2 -0
- package/src/lib/proxy/dignite/file-explorer/directories/models.ts +35 -0
- package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +86 -0
- package/src/lib/proxy/dignite/file-explorer/files/index.ts +2 -0
- package/src/lib/proxy/dignite/file-explorer/files/models.ts +58 -0
- package/src/lib/proxy/dignite/file-explorer/index.ts +3 -0
- package/src/lib/proxy/dignite/index.ts +3 -0
- package/src/lib/proxy/entries/entry-status.enum.ts +8 -0
- package/src/lib/proxy/fields/index.ts +1 -0
- package/src/lib/proxy/fields/models.ts +9 -0
- package/src/lib/proxy/generate-proxy.json +11425 -0
- package/src/lib/proxy/index.ts +9 -0
- package/src/lib/proxy/microsoft/asp-net-core/index.ts +2 -0
- package/src/lib/proxy/microsoft/asp-net-core/mvc/index.ts +1 -0
- package/src/lib/proxy/microsoft/asp-net-core/mvc/models.ts +12 -0
- package/src/lib/proxy/microsoft/extensions/index.ts +2 -0
- package/src/lib/proxy/microsoft/extensions/primitives/index.ts +1 -0
- package/src/lib/proxy/microsoft/extensions/primitives/models.ts +9 -0
- package/src/lib/proxy/microsoft/index.ts +4 -0
- package/src/lib/proxy/microsoft/net/http/headers/index.ts +1 -0
- package/src/lib/proxy/microsoft/net/http/headers/models.ts +7 -0
- package/src/lib/proxy/microsoft/net/http/index.ts +2 -0
- package/src/lib/proxy/microsoft/net/index.ts +2 -0
- package/src/lib/proxy/sections/models.ts +14 -0
- package/src/lib/proxy/sections/section-type.enum.ts +9 -0
- package/src/lib/proxy/settings/index.ts +1 -0
- package/src/lib/proxy/settings/models.ts +6 -0
- package/src/lib/proxy/volo/abp/content/index.ts +1 -0
- package/src/lib/proxy/volo/abp/content/models.ts +6 -0
- package/src/lib/proxy/volo/abp/index.ts +2 -0
- package/src/lib/proxy/volo/cms-kit/index.ts +2 -0
- package/src/lib/proxy/volo/cms-kit/users/index.ts +1 -0
- package/{lib/proxy/volo/cms-kit/users/models.d.ts → src/lib/proxy/volo/cms-kit/users/models.ts} +8 -7
- package/src/lib/proxy/volo/index.ts +3 -0
- package/src/lib/proxy.zip +0 -0
- package/src/lib/services/appent-content.ts +13 -0
- package/src/lib/services/cms-api.service.ts +71 -0
- package/src/lib/services/cms.service.ts +18 -0
- package/src/lib/services/field-abstracts.service.ts +40 -0
- package/src/lib/services/index.ts +4 -0
- package/src/lib/services/simple-reuse-strategy.ts +49 -0
- package/src/lib/services/update-list.service.ts +15 -0
- package/src/lib/toolbar/index.ts +2 -0
- package/src/lib/toolbar/toolbar-btn-default-action.ts +171 -0
- package/src/lib/toolbar/toolbar-config.ts +93 -0
- package/{public-api.d.ts → src/public-api.ts} +10 -4
- package/src/test.ts +26 -0
- package/tsconfig.lib.json +34 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/config/cms-config.module.d.ts +0 -8
- package/config/enums/route-names.d.ts +0 -7
- package/config/index.d.ts +0 -5
- package/config/providers/route.provider.d.ts +0 -9
- package/esm2022/config/cms-config.module.mjs +0 -19
- package/esm2022/config/dignite-ng-expand.cms-config.mjs +0 -5
- package/esm2022/config/enums/index.mjs +0 -2
- package/esm2022/config/enums/route-names.mjs +0 -2
- package/esm2022/config/providers/index.mjs +0 -2
- package/esm2022/config/providers/route.provider.mjs +0 -92
- package/esm2022/config/public-api.mjs +0 -4
- package/esm2022/dignite-ng-expand.cms.mjs +0 -5
- package/esm2022/lib/cms-routing.module.mjs +0 -100
- package/esm2022/lib/cms.module.mjs +0 -132
- package/esm2022/lib/components/admin/domains/domains.component.mjs +0 -86
- package/esm2022/lib/components/admin/domains/index.mjs +0 -2
- package/esm2022/lib/components/admin/entries/create-or-edit-entries.component.mjs +0 -286
- package/esm2022/lib/components/admin/entries/create-or-update-entry-input-base.mjs +0 -32
- package/esm2022/lib/components/admin/entries/create.component.mjs +0 -108
- package/esm2022/lib/components/admin/entries/edit.component.mjs +0 -107
- package/esm2022/lib/components/admin/entries/entries.component.mjs +0 -211
- package/esm2022/lib/components/admin/entries/index.mjs +0 -5
- package/esm2022/lib/components/admin/fields/create-field.component.mjs +0 -82
- package/esm2022/lib/components/admin/fields/create-or-edit-field.component.mjs +0 -119
- package/esm2022/lib/components/admin/fields/create-or-update-field-input-base.mjs +0 -25
- package/esm2022/lib/components/admin/fields/edit-field.component.mjs +0 -110
- package/esm2022/lib/components/admin/fields/field-group.component.mjs +0 -124
- package/esm2022/lib/components/admin/fields/fields.component.mjs +0 -119
- package/esm2022/lib/components/admin/fields/index.mjs +0 -7
- package/esm2022/lib/components/admin/index.mjs +0 -6
- package/esm2022/lib/components/admin/sections/create-or-update-sections-input-base.mjs +0 -27
- package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.mjs +0 -71
- package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.component.mjs +0 -416
- package/esm2022/lib/components/admin/sections/entry-types/index.mjs +0 -3
- package/esm2022/lib/components/admin/sections/index.mjs +0 -4
- package/esm2022/lib/components/admin/sections/sections.component.mjs +0 -344
- package/esm2022/lib/components/admin/sites/create-or-update-sites-input-base.mjs +0 -18
- package/esm2022/lib/components/admin/sites/index.mjs +0 -3
- package/esm2022/lib/components/admin/sites/sites.component.mjs +0 -29
- package/esm2022/lib/components/dynamic-form/entry/entry-config.component.mjs +0 -124
- package/esm2022/lib/components/dynamic-form/entry/entry-config.mjs +0 -18
- package/esm2022/lib/components/dynamic-form/entry/entry-control.component.mjs +0 -115
- package/esm2022/lib/components/dynamic-form/entry/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/form-control-group.mjs +0 -28
- package/esm2022/lib/components/dynamic-form/index.mjs +0 -5
- package/esm2022/lib/components/dynamic-form/matrix/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/matrix/matrix-config.component.mjs +0 -227
- package/esm2022/lib/components/dynamic-form/matrix/matrix-config.mjs +0 -50
- package/esm2022/lib/components/dynamic-form/matrix/matrix-control.component.mjs +0 -111
- package/esm2022/lib/components/dynamic-form/table/index.mjs +0 -4
- package/esm2022/lib/components/dynamic-form/table/table-config.component.mjs +0 -173
- package/esm2022/lib/components/dynamic-form/table/table-config.mjs +0 -38
- package/esm2022/lib/components/dynamic-form/table/table-control.component.mjs +0 -121
- package/esm2022/lib/components/index.mjs +0 -3
- package/esm2022/lib/constants/styles.mjs +0 -14
- package/esm2022/lib/enums/ecms-component.mjs +0 -13
- package/esm2022/lib/enums/index.mjs +0 -2
- package/esm2022/lib/proxy/admin/domains/domain-admin.service.mjs +0 -34
- package/esm2022/lib/proxy/admin/domains/index.mjs +0 -3
- package/esm2022/lib/proxy/admin/domains/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/dynamic-forms/form-admin.service.mjs +0 -24
- package/esm2022/lib/proxy/admin/dynamic-forms/index.mjs +0 -3
- package/esm2022/lib/proxy/admin/dynamic-forms/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/entries/entry-admin.service.mjs +0 -72
- package/esm2022/lib/proxy/admin/entries/index.mjs +0 -3
- package/esm2022/lib/proxy/admin/entries/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/fields/field-admin.service.mjs +0 -47
- package/esm2022/lib/proxy/admin/fields/field-group-admin.service.mjs +0 -43
- package/esm2022/lib/proxy/admin/fields/index.mjs +0 -4
- package/esm2022/lib/proxy/admin/fields/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/sections/entry-type-admin.service.mjs +0 -43
- package/esm2022/lib/proxy/admin/sections/index.mjs +0 -4
- package/esm2022/lib/proxy/admin/sections/models.mjs +0 -2
- package/esm2022/lib/proxy/admin/sections/section-admin.service.mjs +0 -53
- package/esm2022/lib/proxy/admin/settings/index.mjs +0 -2
- package/esm2022/lib/proxy/admin/settings/site-settings-admin.service.mjs +0 -33
- package/esm2022/lib/proxy/dignite/abp/data/models.mjs +0 -2
- package/esm2022/lib/proxy/entries/entry-status.enum.mjs +0 -8
- package/esm2022/lib/proxy/entries/index.mjs +0 -2
- package/esm2022/lib/proxy/fields/models.mjs +0 -2
- package/esm2022/lib/proxy/sections/index.mjs +0 -3
- package/esm2022/lib/proxy/sections/models.mjs +0 -2
- package/esm2022/lib/proxy/sections/section-type.enum.mjs +0 -9
- package/esm2022/lib/proxy/settings/models.mjs +0 -2
- package/esm2022/lib/proxy/volo/cms-kit/users/models.mjs +0 -2
- package/esm2022/lib/services/appent-content.mjs +0 -15
- package/esm2022/lib/services/cms-api.service.mjs +0 -80
- package/esm2022/lib/services/cms.service.mjs +0 -23
- package/esm2022/lib/services/field-abstracts.service.mjs +0 -45
- package/esm2022/lib/services/index.mjs +0 -5
- package/esm2022/lib/services/simple-reuse-strategy.mjs +0 -43
- package/esm2022/lib/services/update-list.service.mjs +0 -19
- package/esm2022/lib/toolbar/index.mjs +0 -3
- package/esm2022/lib/toolbar/toolbar-btn-default-action.mjs +0 -160
- package/esm2022/lib/toolbar/toolbar-config.mjs +0 -79
- package/esm2022/public-api.mjs +0 -10
- package/fesm2022/dignite-ng-expand.cms-config.mjs +0 -115
- package/fesm2022/dignite-ng-expand.cms-config.mjs.map +0 -1
- package/fesm2022/dignite-ng-expand.cms.mjs +0 -4075
- package/fesm2022/dignite-ng-expand.cms.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/cms-routing.module.d.ts +0 -7
- package/lib/cms.module.d.ts +0 -35
- package/lib/components/admin/domains/domains.component.d.ts +0 -21
- package/lib/components/admin/domains/index.d.ts +0 -1
- package/lib/components/admin/entries/create-or-edit-entries.component.d.ts +0 -92
- package/lib/components/admin/entries/create-or-update-entry-input-base.d.ts +0 -23
- package/lib/components/admin/entries/create.component.d.ts +0 -40
- package/lib/components/admin/entries/edit.component.d.ts +0 -40
- package/lib/components/admin/entries/entries.component.d.ts +0 -66
- package/lib/components/admin/entries/index.d.ts +0 -4
- package/lib/components/admin/fields/create-field.component.d.ts +0 -31
- package/lib/components/admin/fields/create-or-edit-field.component.d.ts +0 -36
- package/lib/components/admin/fields/create-or-update-field-input-base.d.ts +0 -16
- package/lib/components/admin/fields/edit-field.component.d.ts +0 -40
- package/lib/components/admin/fields/field-group.component.d.ts +0 -51
- package/lib/components/admin/fields/fields.component.d.ts +0 -37
- package/lib/components/admin/fields/index.d.ts +0 -6
- package/lib/components/admin/index.d.ts +0 -5
- package/lib/components/admin/sections/create-or-update-sections-input-base.d.ts +0 -17
- package/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.d.ts +0 -38
- package/lib/components/admin/sections/entry-types/create-or-edit.component.d.ts +0 -132
- package/lib/components/admin/sections/entry-types/index.d.ts +0 -2
- package/lib/components/admin/sections/index.d.ts +0 -3
- package/lib/components/admin/sections/sections.component.d.ts +0 -90
- package/lib/components/admin/sites/create-or-update-sites-input-base.d.ts +0 -8
- package/lib/components/admin/sites/index.d.ts +0 -2
- package/lib/components/admin/sites/sites.component.d.ts +0 -5
- package/lib/components/dynamic-form/entry/entry-config.component.d.ts +0 -39
- package/lib/components/dynamic-form/entry/entry-config.d.ts +0 -9
- package/lib/components/dynamic-form/entry/entry-control.component.d.ts +0 -35
- package/lib/components/dynamic-form/entry/index.d.ts +0 -3
- package/lib/components/dynamic-form/form-control-group.d.ts +0 -4
- package/lib/components/dynamic-form/index.d.ts +0 -4
- package/lib/components/dynamic-form/matrix/index.d.ts +0 -3
- package/lib/components/dynamic-form/matrix/matrix-config.component.d.ts +0 -73
- package/lib/components/dynamic-form/matrix/matrix-config.d.ts +0 -24
- package/lib/components/dynamic-form/matrix/matrix-control.component.d.ts +0 -39
- package/lib/components/dynamic-form/table/index.d.ts +0 -3
- package/lib/components/dynamic-form/table/table-config.component.d.ts +0 -58
- package/lib/components/dynamic-form/table/table-config.d.ts +0 -18
- package/lib/components/dynamic-form/table/table-control.component.d.ts +0 -39
- package/lib/components/index.d.ts +0 -2
- package/lib/constants/styles.d.ts +0 -2
- package/lib/enums/ecms-component.d.ts +0 -11
- package/lib/enums/index.d.ts +0 -1
- package/lib/proxy/admin/domains/domain-admin.service.d.ts +0 -13
- package/lib/proxy/admin/dynamic-forms/form-admin.service.d.ts +0 -12
- package/lib/proxy/admin/dynamic-forms/models.d.ts +0 -4
- package/lib/proxy/admin/entries/entry-admin.service.d.ts +0 -22
- package/lib/proxy/admin/entries/models.d.ts +0 -60
- package/lib/proxy/admin/fields/field-admin.service.d.ts +0 -17
- package/lib/proxy/admin/fields/field-group-admin.service.d.ts +0 -16
- package/lib/proxy/admin/sections/entry-type-admin.service.d.ts +0 -15
- package/lib/proxy/admin/sections/section-admin.service.d.ts +0 -18
- package/lib/proxy/admin/settings/site-settings-admin.service.d.ts +0 -13
- package/lib/proxy/dignite/abp/data/models.d.ts +0 -3
- package/lib/proxy/entries/entry-status.enum.d.ts +0 -5
- package/lib/proxy/fields/models.d.ts +0 -8
- package/lib/proxy/sections/models.d.ts +0 -12
- package/lib/proxy/sections/section-type.enum.d.ts +0 -6
- package/lib/proxy/settings/models.d.ts +0 -5
- package/lib/services/appent-content.d.ts +0 -1
- package/lib/services/cms-api.service.d.ts +0 -20
- package/lib/services/cms.service.d.ts +0 -10
- package/lib/services/field-abstracts.service.d.ts +0 -20
- package/lib/services/index.d.ts +0 -4
- package/lib/services/simple-reuse-strategy.d.ts +0 -11
- package/lib/services/update-list.service.d.ts +0 -9
- package/lib/toolbar/index.d.ts +0 -2
- package/lib/toolbar/toolbar-btn-default-action.d.ts +0 -18
- package/lib/toolbar/toolbar-config.d.ts +0 -56
- /package/{lib/proxy/admin/domains/index.d.ts → src/lib/proxy/admin/domains/index.ts} +0 -0
- /package/{lib/proxy/admin/dynamic-forms/index.d.ts → src/lib/proxy/admin/dynamic-forms/index.ts} +0 -0
- /package/{lib/proxy/admin/entries/index.d.ts → src/lib/proxy/admin/entries/index.ts} +0 -0
- /package/{lib/proxy/admin/fields/index.d.ts → src/lib/proxy/admin/fields/index.ts} +0 -0
- /package/{lib/proxy/admin/sections/index.d.ts → src/lib/proxy/admin/sections/index.ts} +0 -0
- /package/{lib/proxy/admin/settings/index.d.ts → src/lib/proxy/admin/settings/index.ts} +0 -0
- /package/{lib/proxy/entries/index.d.ts → src/lib/proxy/entries/index.ts} +0 -0
- /package/{lib/proxy/sections/index.d.ts → src/lib/proxy/sections/index.ts} +0 -0
|
@@ -1,4075 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Injectable, inject, Component, ViewContainerRef, Input, ViewChildren, ViewChild, Output, InjectionToken, RendererFactory2, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '@abp/ng.core';
|
|
4
|
-
import { mapEnumToOptions, ListService, ConfigStateService, LIST_QUERY_DEBOUNCE_TIME, LocalizationService, AuthGuard, PermissionGuard, LazyModuleFactory, CoreModule } from '@abp/ng.core';
|
|
5
|
-
import * as i3 from '@abp/ng.theme.shared';
|
|
6
|
-
import { ToasterService, ThemeSharedModule } from '@abp/ng.theme.shared';
|
|
7
|
-
import * as i3$1 from '@angular/router';
|
|
8
|
-
import { RouterModule } from '@angular/router';
|
|
9
|
-
import * as i1$1 from '@angular/forms';
|
|
10
|
-
import { FormBuilder, Validators, FormGroup, FormControl, FormArray, FormsModule } from '@angular/forms';
|
|
11
|
-
import * as i8 from '@swimlane/ngx-datatable';
|
|
12
|
-
import { ColumnMode } from '@swimlane/ngx-datatable';
|
|
13
|
-
import { finalize } from 'rxjs/operators';
|
|
14
|
-
import { EXTENSIONS_IDENTIFIER, ToolbarAction, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions } from '@abp/ng.theme.shared/extensions';
|
|
15
|
-
import * as i2 from '@angular/common';
|
|
16
|
-
import * as i9 from '@ngx-validate/core';
|
|
17
|
-
import * as i10 from '@ng-bootstrap/ng-bootstrap';
|
|
18
|
-
import { NgbNavModule, NgbAccordionModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
19
|
-
import * as i11 from '@abp/ng.components/page';
|
|
20
|
-
import { PageModule } from '@abp/ng.components/page';
|
|
21
|
-
import { pinyin } from 'pinyin-pro';
|
|
22
|
-
import * as i1$2 from '@angular/platform-browser';
|
|
23
|
-
import * as i8$1 from '@dignite-ng/expand.dynamic-form';
|
|
24
|
-
import { DynamicFormModule } from '@dignite-ng/expand.dynamic-form';
|
|
25
|
-
import * as i4 from 'ng-zorro-antd/select';
|
|
26
|
-
import { NzSelectModule } from 'ng-zorro-antd/select';
|
|
27
|
-
import { map, tap } from 'rxjs';
|
|
28
|
-
import { fielFieldControlGroup } from '@dignite-ng/expand.file-explorer';
|
|
29
|
-
import { ckEditorFieldControlGroup } from '@dignite-ng/expand.ck-editor';
|
|
30
|
-
|
|
31
|
-
var EntryStatus;
|
|
32
|
-
(function (EntryStatus) {
|
|
33
|
-
EntryStatus[EntryStatus["Draft"] = 0] = "Draft";
|
|
34
|
-
EntryStatus[EntryStatus["Published"] = 1] = "Published";
|
|
35
|
-
})(EntryStatus || (EntryStatus = {}));
|
|
36
|
-
const entryStatusOptions = mapEnumToOptions(EntryStatus);
|
|
37
|
-
|
|
38
|
-
var ECmsComponent;
|
|
39
|
-
(function (ECmsComponent) {
|
|
40
|
-
ECmsComponent["Entries"] = "Cms.Entries";
|
|
41
|
-
ECmsComponent["Entries_Create"] = "Cms.Entries.Create";
|
|
42
|
-
ECmsComponent["Entries_Edit"] = "Cms.Entries.Edit";
|
|
43
|
-
ECmsComponent["Fields"] = "Cms.Fields";
|
|
44
|
-
ECmsComponent["FieldsCreate"] = "Cms.Fields.Create";
|
|
45
|
-
ECmsComponent["FieldsEdit"] = "Cms.Fields.Edit";
|
|
46
|
-
ECmsComponent["Sites"] = "Cms.Sites";
|
|
47
|
-
ECmsComponent["Sections"] = "Cms.Sections";
|
|
48
|
-
ECmsComponent["SectionsCreateOrEdit"] = "Cms.Sections.Create.Or.Edit";
|
|
49
|
-
})(ECmsComponent || (ECmsComponent = {}));
|
|
50
|
-
|
|
51
|
-
class UpdateListService {
|
|
52
|
-
updateListEvent = new EventEmitter();
|
|
53
|
-
constructor() { }
|
|
54
|
-
updateList() {
|
|
55
|
-
this.updateListEvent.emit();
|
|
56
|
-
}
|
|
57
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UpdateListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
58
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UpdateListService, providedIn: 'root' });
|
|
59
|
-
}
|
|
60
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: UpdateListService, decorators: [{
|
|
61
|
-
type: Injectable,
|
|
62
|
-
args: [{
|
|
63
|
-
providedIn: 'root'
|
|
64
|
-
}]
|
|
65
|
-
}], ctorParameters: function () { return []; } });
|
|
66
|
-
|
|
67
|
-
class SiteSettingsAdminService {
|
|
68
|
-
restService;
|
|
69
|
-
apiName = 'CmsAdmin';
|
|
70
|
-
getAllLanguages = (config) => this.restService.request({
|
|
71
|
-
method: 'GET',
|
|
72
|
-
url: '/api/cms-admin/site-settings/all-languages',
|
|
73
|
-
}, { apiName: this.apiName, ...config });
|
|
74
|
-
getBrand = (config) => this.restService.request({
|
|
75
|
-
method: 'GET',
|
|
76
|
-
url: '/api/cms-admin/site-settings/brand',
|
|
77
|
-
}, { apiName: this.apiName, ...config });
|
|
78
|
-
getDefaultLanguage = (config) => this.restService.request({
|
|
79
|
-
method: 'GET',
|
|
80
|
-
responseType: 'text',
|
|
81
|
-
url: '/api/cms-admin/site-settings/default-language',
|
|
82
|
-
}, { apiName: this.apiName, ...config });
|
|
83
|
-
constructor(restService) {
|
|
84
|
-
this.restService = restService;
|
|
85
|
-
}
|
|
86
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SiteSettingsAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
87
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SiteSettingsAdminService, providedIn: 'root' });
|
|
88
|
-
}
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SiteSettingsAdminService, decorators: [{
|
|
90
|
-
type: Injectable,
|
|
91
|
-
args: [{
|
|
92
|
-
providedIn: 'root',
|
|
93
|
-
}]
|
|
94
|
-
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
95
|
-
|
|
96
|
-
class EntryAdminService {
|
|
97
|
-
restService;
|
|
98
|
-
apiName = 'CmsAdmin';
|
|
99
|
-
activate = (id, config) => this.restService.request({
|
|
100
|
-
method: 'POST',
|
|
101
|
-
url: `/api/cms-admin/entries/activate/${id}`,
|
|
102
|
-
}, { apiName: this.apiName, ...config });
|
|
103
|
-
create = (input, config) => this.restService.request({
|
|
104
|
-
method: 'POST',
|
|
105
|
-
url: '/api/cms-admin/entries',
|
|
106
|
-
body: input,
|
|
107
|
-
}, { apiName: this.apiName, ...config });
|
|
108
|
-
cultureExistWithSingleSection = (input, config) => this.restService.request({
|
|
109
|
-
method: 'GET',
|
|
110
|
-
url: '/api/cms-admin/entries/culture-exists-with-single-section',
|
|
111
|
-
params: { culture: input.culture, sectionId: input.sectionId, entryTypeId: input.entryTypeId },
|
|
112
|
-
}, { apiName: this.apiName, ...config });
|
|
113
|
-
delete = (id, config) => this.restService.request({
|
|
114
|
-
method: 'DELETE',
|
|
115
|
-
url: `/api/cms-admin/entries/${id}`,
|
|
116
|
-
}, { apiName: this.apiName, ...config });
|
|
117
|
-
get = (id, config) => this.restService.request({
|
|
118
|
-
method: 'GET',
|
|
119
|
-
url: `/api/cms-admin/entries/${id}`,
|
|
120
|
-
}, { apiName: this.apiName, ...config });
|
|
121
|
-
getAllVersions = (id, config) => this.restService.request({
|
|
122
|
-
method: 'GET',
|
|
123
|
-
url: `/api/cms-admin/entries/${id}/all-versions`,
|
|
124
|
-
}, { apiName: this.apiName, ...config });
|
|
125
|
-
getList = (input, config) => this.restService.request({
|
|
126
|
-
method: 'GET',
|
|
127
|
-
url: '/api/cms-admin/entries',
|
|
128
|
-
params: { culture: input.culture, sectionId: input.sectionId, entryTypeId: input.entryTypeId, startPublishDate: input.startPublishDate, expiryPublishDate: input.expiryPublishDate, filter: input.filter, status: input.status, creatorId: input.creatorId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
|
|
129
|
-
}, { apiName: this.apiName, ...config });
|
|
130
|
-
getListByIds = (sectionId, ids, config) => this.restService.request({
|
|
131
|
-
method: 'GET',
|
|
132
|
-
url: '/api/cms-admin/entries/search-by-ids',
|
|
133
|
-
params: { sectionId, ids },
|
|
134
|
-
}, { apiName: this.apiName, ...config });
|
|
135
|
-
move = (id, input, config) => this.restService.request({
|
|
136
|
-
method: 'POST',
|
|
137
|
-
url: `/api/cms-admin/entries/move/${id}`,
|
|
138
|
-
body: input,
|
|
139
|
-
}, { apiName: this.apiName, ...config });
|
|
140
|
-
slugExists = (input, config) => this.restService.request({
|
|
141
|
-
method: 'GET',
|
|
142
|
-
url: '/api/cms-admin/entries/slug-exists',
|
|
143
|
-
params: { culture: input.culture, sectionId: input.sectionId, slug: input.slug },
|
|
144
|
-
}, { apiName: this.apiName, ...config });
|
|
145
|
-
update = (id, input, config) => this.restService.request({
|
|
146
|
-
method: 'PUT',
|
|
147
|
-
url: '/api/cms-admin/entries',
|
|
148
|
-
params: { id },
|
|
149
|
-
body: input,
|
|
150
|
-
}, { apiName: this.apiName, ...config });
|
|
151
|
-
constructor(restService) {
|
|
152
|
-
this.restService = restService;
|
|
153
|
-
}
|
|
154
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
155
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryAdminService, providedIn: 'root' });
|
|
156
|
-
}
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryAdminService, decorators: [{
|
|
158
|
-
type: Injectable,
|
|
159
|
-
args: [{
|
|
160
|
-
providedIn: 'root',
|
|
161
|
-
}]
|
|
162
|
-
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
163
|
-
|
|
164
|
-
class EntryTypeAdminService {
|
|
165
|
-
restService;
|
|
166
|
-
apiName = 'CmsAdmin';
|
|
167
|
-
create = (input, config) => this.restService.request({
|
|
168
|
-
method: 'POST',
|
|
169
|
-
url: '/api/cms-admin/entry-types',
|
|
170
|
-
body: input,
|
|
171
|
-
}, { apiName: this.apiName, ...config });
|
|
172
|
-
delete = (id, config) => this.restService.request({
|
|
173
|
-
method: 'DELETE',
|
|
174
|
-
url: `/api/cms-admin/entry-types/${id}`,
|
|
175
|
-
}, { apiName: this.apiName, ...config });
|
|
176
|
-
get = (id, config) => this.restService.request({
|
|
177
|
-
method: 'GET',
|
|
178
|
-
url: `/api/cms-admin/entry-types/${id}`,
|
|
179
|
-
}, { apiName: this.apiName, ...config });
|
|
180
|
-
nameExists = (input, config) => this.restService.request({
|
|
181
|
-
method: 'GET',
|
|
182
|
-
url: '/api/cms-admin/entry-types/name-exists',
|
|
183
|
-
params: { sectionId: input.sectionId, name: input.name },
|
|
184
|
-
}, { apiName: this.apiName, ...config });
|
|
185
|
-
update = (id, input, config) => this.restService.request({
|
|
186
|
-
method: 'PUT',
|
|
187
|
-
url: `/api/cms-admin/entry-types/${id}`,
|
|
188
|
-
body: input,
|
|
189
|
-
}, { apiName: this.apiName, ...config });
|
|
190
|
-
constructor(restService) {
|
|
191
|
-
this.restService = restService;
|
|
192
|
-
}
|
|
193
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryTypeAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
194
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryTypeAdminService, providedIn: 'root' });
|
|
195
|
-
}
|
|
196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryTypeAdminService, decorators: [{
|
|
197
|
-
type: Injectable,
|
|
198
|
-
args: [{
|
|
199
|
-
providedIn: 'root',
|
|
200
|
-
}]
|
|
201
|
-
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
202
|
-
|
|
203
|
-
class SectionAdminService {
|
|
204
|
-
restService;
|
|
205
|
-
apiName = 'CmsAdmin';
|
|
206
|
-
create = (input, config) => this.restService.request({
|
|
207
|
-
method: 'POST',
|
|
208
|
-
url: '/api/cms-admin/sections',
|
|
209
|
-
body: input,
|
|
210
|
-
}, { apiName: this.apiName, ...config });
|
|
211
|
-
delete = (id, config) => this.restService.request({
|
|
212
|
-
method: 'DELETE',
|
|
213
|
-
url: `/api/cms-admin/sections/${id}`,
|
|
214
|
-
}, { apiName: this.apiName, ...config });
|
|
215
|
-
get = (id, config) => this.restService.request({
|
|
216
|
-
method: 'GET',
|
|
217
|
-
url: `/api/cms-admin/sections/${id}`,
|
|
218
|
-
}, { apiName: this.apiName, ...config });
|
|
219
|
-
getList = (input, config) => this.restService.request({
|
|
220
|
-
method: 'GET',
|
|
221
|
-
url: '/api/cms-admin/sections',
|
|
222
|
-
params: { filter: input.filter, isActive: input.isActive, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
|
|
223
|
-
}, { apiName: this.apiName, ...config });
|
|
224
|
-
nameExists = (input, config) => this.restService.request({
|
|
225
|
-
method: 'GET',
|
|
226
|
-
url: '/api/cms-admin/sections/name-exists',
|
|
227
|
-
params: { name: input.name },
|
|
228
|
-
}, { apiName: this.apiName, ...config });
|
|
229
|
-
routeExists = (input, config) => this.restService.request({
|
|
230
|
-
method: 'GET',
|
|
231
|
-
url: '/api/cms-admin/sections/route-exists',
|
|
232
|
-
params: { route: input.route },
|
|
233
|
-
}, { apiName: this.apiName, ...config });
|
|
234
|
-
update = (id, input, config) => this.restService.request({
|
|
235
|
-
method: 'PUT',
|
|
236
|
-
url: `/api/cms-admin/sections/${id}`,
|
|
237
|
-
body: input,
|
|
238
|
-
}, { apiName: this.apiName, ...config });
|
|
239
|
-
constructor(restService) {
|
|
240
|
-
this.restService = restService;
|
|
241
|
-
}
|
|
242
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SectionAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
243
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SectionAdminService, providedIn: 'root' });
|
|
244
|
-
}
|
|
245
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SectionAdminService, decorators: [{
|
|
246
|
-
type: Injectable,
|
|
247
|
-
args: [{
|
|
248
|
-
providedIn: 'root',
|
|
249
|
-
}]
|
|
250
|
-
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
251
|
-
|
|
252
|
-
class EntriesComponent {
|
|
253
|
-
_EntryAdminService;
|
|
254
|
-
_SectionAdminService;
|
|
255
|
-
toaster;
|
|
256
|
-
confirmation;
|
|
257
|
-
configState;
|
|
258
|
-
router;
|
|
259
|
-
_LocalizationService;
|
|
260
|
-
constructor(_EntryAdminService,
|
|
261
|
-
// private _SiteAdminService: SiteAdminService,
|
|
262
|
-
_SectionAdminService, toaster, confirmation, configState, router, _LocalizationService) {
|
|
263
|
-
this._EntryAdminService = _EntryAdminService;
|
|
264
|
-
this._SectionAdminService = _SectionAdminService;
|
|
265
|
-
this.toaster = toaster;
|
|
266
|
-
this.confirmation = confirmation;
|
|
267
|
-
this.configState = configState;
|
|
268
|
-
this.router = router;
|
|
269
|
-
this._LocalizationService = _LocalizationService;
|
|
270
|
-
}
|
|
271
|
-
fb = inject(FormBuilder);
|
|
272
|
-
_UpdateListService = inject(UpdateListService);
|
|
273
|
-
list = inject(ListService);
|
|
274
|
-
ngOnInit() {
|
|
275
|
-
this.getPageDate();
|
|
276
|
-
this._UpdateListService.updateListEvent.subscribe(() => {
|
|
277
|
-
this.list.get();
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
/**站点列表 */
|
|
281
|
-
// siteList: any[any] = []
|
|
282
|
-
/**选择的站点id */
|
|
283
|
-
// siteId: string = ''
|
|
284
|
-
/**站点下的版块 */
|
|
285
|
-
SiteOfSectionList = [];
|
|
286
|
-
/**版块下的语言列表 */
|
|
287
|
-
sectionLanguagesList = [];
|
|
288
|
-
/**版块下的条目类型列表 */
|
|
289
|
-
entryTypeList = [];
|
|
290
|
-
/**状态编码 */
|
|
291
|
-
_entryStatusOptions = entryStatusOptions;
|
|
292
|
-
/**获取页面数据 */
|
|
293
|
-
async getPageDate() {
|
|
294
|
-
// await this.getsiteList()
|
|
295
|
-
await this.getSiteOfSectionList();
|
|
296
|
-
await this.getSectionLanguagesList();
|
|
297
|
-
this.filters = this.filtersForm.value;
|
|
298
|
-
this.hookToQuery();
|
|
299
|
-
}
|
|
300
|
-
/**切换板块 */
|
|
301
|
-
async sectionIdChange() {
|
|
302
|
-
this.getSectionOfEntryType();
|
|
303
|
-
await this.getSectionLanguagesList();
|
|
304
|
-
this.resetData();
|
|
305
|
-
}
|
|
306
|
-
/**切换语言 */
|
|
307
|
-
async cultureChange() {
|
|
308
|
-
this.resetData();
|
|
309
|
-
}
|
|
310
|
-
/**获取站点下的版块 */
|
|
311
|
-
getSiteOfSectionList() {
|
|
312
|
-
return new Promise((resolve, rejects) => {
|
|
313
|
-
// let siteId = this.filtersForm.get('siteId').value
|
|
314
|
-
this._SectionAdminService.getList({
|
|
315
|
-
maxResultCount: 1000,
|
|
316
|
-
// siteId: siteId
|
|
317
|
-
}).subscribe(res => {
|
|
318
|
-
this.SiteOfSectionList = res.items;
|
|
319
|
-
this.filtersForm.get('sectionId').patchValue(res.items[0]?.id || '');
|
|
320
|
-
this.getSectionOfEntryType();
|
|
321
|
-
resolve(res.items);
|
|
322
|
-
});
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
/**获取版块下的条目类型 */
|
|
326
|
-
getSectionOfEntryType() {
|
|
327
|
-
let sectionId = this.filtersForm.get('sectionId').value;
|
|
328
|
-
this.entryTypeList = this.SiteOfSectionList.find(el => el.id == sectionId)?.entryTypes || [];
|
|
329
|
-
}
|
|
330
|
-
config = inject(ConfigStateService);
|
|
331
|
-
_SiteSettingsAdminService = inject(SiteSettingsAdminService);
|
|
332
|
-
/**获取版块下的语言列表 */
|
|
333
|
-
getSectionLanguagesList() {
|
|
334
|
-
return new Promise(async (resolve, rejects) => {
|
|
335
|
-
//获取所有语言 */
|
|
336
|
-
let languagesSystem = this.configState.getDeep('localization.languages');
|
|
337
|
-
//获取系统默认语言 */
|
|
338
|
-
let DefaultLanguage = this.config.getSetting("Abp.Localization.DefaultLanguage");
|
|
339
|
-
const configCmsSiteLanguages = this.config.getSetting("Cms.Site.Languages");
|
|
340
|
-
if (!configCmsSiteLanguages) {
|
|
341
|
-
await this.getSiteSettingsLanguages();
|
|
342
|
-
}
|
|
343
|
-
const LanguagesSite = (configCmsSiteLanguages ? configCmsSiteLanguages.split(',') : '') || this.SiteSettingsAdminLanguages;
|
|
344
|
-
let LanguagesArray = languagesSystem.filter(el => LanguagesSite.includes(el.cultureName));
|
|
345
|
-
//获取当前选择的语言
|
|
346
|
-
let nowculture = this.filtersForm.get('culture').value;
|
|
347
|
-
//当前选择的语言,是否在版块的的语言列表中
|
|
348
|
-
let isexist = LanguagesArray.find(el => el.cultureName == nowculture);
|
|
349
|
-
this.filtersForm.get('culture').patchValue(nowculture ? isexist ? nowculture : DefaultLanguage : DefaultLanguage);
|
|
350
|
-
this.sectionLanguagesList = LanguagesArray;
|
|
351
|
-
resolve(LanguagesArray);
|
|
352
|
-
});
|
|
353
|
-
}
|
|
354
|
-
/**站点设置语言 */
|
|
355
|
-
SiteSettingsAdminLanguages = [];
|
|
356
|
-
/**
|
|
357
|
-
* 获取站点设置语言
|
|
358
|
-
*/
|
|
359
|
-
getSiteSettingsLanguages() {
|
|
360
|
-
return new Promise((resolve, rejects) => {
|
|
361
|
-
this._SiteSettingsAdminService.getAllLanguages().subscribe(res => {
|
|
362
|
-
this.SiteSettingsAdminLanguages = res;
|
|
363
|
-
resolve(res);
|
|
364
|
-
});
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
resetData() {
|
|
368
|
-
this.filters = this.filtersForm.value;
|
|
369
|
-
this.list.page = 0;
|
|
370
|
-
this.data.items = [];
|
|
371
|
-
this.list.get();
|
|
372
|
-
}
|
|
373
|
-
/**新增-单个 */
|
|
374
|
-
createEntriesBtn() {
|
|
375
|
-
this.router.navigate(['/cms/admin/entries/create'], {
|
|
376
|
-
queryParams: { cultureName: this.filters.culture, sectionId: this.filters.sectionId, entryTypeId: this.entryTypeList[0].id }
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
/**列表相关 */
|
|
380
|
-
ColumnMode = ColumnMode;
|
|
381
|
-
data = {
|
|
382
|
-
items: [],
|
|
383
|
-
totalCount: 0,
|
|
384
|
-
};
|
|
385
|
-
filters = {};
|
|
386
|
-
filtersForm = this.fb.group({
|
|
387
|
-
siteId: [''],
|
|
388
|
-
sectionId: [''],
|
|
389
|
-
culture: [''],
|
|
390
|
-
filter: [''],
|
|
391
|
-
});
|
|
392
|
-
hookToQuery() {
|
|
393
|
-
const getData = (query) => this._EntryAdminService.getList({
|
|
394
|
-
...query,
|
|
395
|
-
...this.filters,
|
|
396
|
-
});
|
|
397
|
-
const setData = (list) => {
|
|
398
|
-
this.data = list;
|
|
399
|
-
};
|
|
400
|
-
this.list.hookToQuery(getData).subscribe(setData);
|
|
401
|
-
}
|
|
402
|
-
/**删除条目 */
|
|
403
|
-
deletefield(row) {
|
|
404
|
-
this.confirmation.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
|
|
405
|
-
if (status == 'confirm') {
|
|
406
|
-
this._EntryAdminService.delete(row.id).pipe(finalize(() => {
|
|
407
|
-
})).subscribe(res => {
|
|
408
|
-
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
409
|
-
this.list.get();
|
|
410
|
-
});
|
|
411
|
-
}
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntriesComponent, deps: [{ token: EntryAdminService }, { token: SectionAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1.ConfigStateService }, { token: i3$1.Router }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
415
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EntriesComponent, selector: "cms-entries", providers: [
|
|
416
|
-
ListService,
|
|
417
|
-
// Provide this token if you want a different debounce time.
|
|
418
|
-
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
419
|
-
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
420
|
-
{
|
|
421
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
422
|
-
useValue: ECmsComponent.Entries,
|
|
423
|
-
},
|
|
424
|
-
], ngImport: i0, template: "<abp-page [title]=\"'Cms::Entries' | abpLocalization\" [toolbar]=\"true\">\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length < 1\" class=\"col \"></abp-page-toolbar-container>\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length > 1\" class=\"col \">\r\n <div class=\"row justify-content-end mx-0 gap-2\" *abpPermission=\"'CmsAdmin.Entry.Create'\">\r\n <div class=\"col-auto px-0 pt-0\">\r\n <div ngbDropdown class=\"d-inline-block\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm ms-2\" id=\"dropdownBasic1\" ngbDropdownToggle>\r\n <i class=\"fa fa-plus pe-1\" aria-hidden=\"true\"></i>{{'Cms::New' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <button ngbDropdownItem [routerLink]=\"['/cms/admin/entries/create']\"\r\n [queryParams]=\"{cultureName: filters.culture,sectionId:filters.sectionId,entryTypeId:item.id}\">{{item.displayName}}</button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </abp-page-toolbar-container>\r\n <div id=\"sites-page\" class=\"sites-page\">\r\n <div class=\"card\">\r\n <div class=\"card-body px-2 py-sm-2 border-bottom\" [formGroup]=\"filtersForm\">\r\n <div class=\"row align-items-end\">\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"sectionId\" (change)=\"sectionIdChange()\">\r\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\r\n <option [value]=\"item.id\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Languages' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"culture\" (change)=\"cultureChange()\">\r\n <ng-container *ngFor=\"let item of sectionLanguagesList\">\r\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n \r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"filter\"\r\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"resetData()\">\r\n <i class=\"fa fa-search\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\">\r\n <div class=\"card-body p-0\">\r\n <div class=\"table-responsive table-fixed-header\">\r\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\r\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\r\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\r\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"entryTypeId\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <ng-container *ngIf=\"item.id === value\">{{item.displayName}}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Title' | abpLocalization\" prop=\"title\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Slug' | abpLocalization\" prop=\"slug\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Status' | abpLocalization\" prop=\"status\" [width]=\"80\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of _entryStatusOptions\">\r\n <ng-container *ngIf=\"item.value=== value\">{{ 'Cms::Enum:EntryStatus:'+item.key |\r\n abpLocalization }}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::PublishTime' | abpLocalization\" prop=\"publishTime\" [width]=\"190\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{value | date: 'YYYY/MM/dd HH:mm:s' }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n cellClass=\"cellClassRight\" [frozenRight]=\"true\" [width]=\"110\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\r\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem\r\n routerLink=\"/cms/admin/entries/{{row.id}}/edit\">{{'AbpUi::Edit' |\r\n abpLocalization}}</button>\r\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\r\n abpLocalization}}</button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</abp-page>", styles: ["::ng-deep .sites-page .dignite_page{background:transparent}::ng-deep .sites-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sites-page .card-header input{flex:2 1 auto}::ng-deep .sites-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-page .morentr{border:2px solid transparent}::ng-deep .sites-page .borderdrag{border:2px solid var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .borderdragtd{background-color:var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .testtr{border-color:transparent}::ng-deep .sites-page .testtr td{padding:2px}::ng-deep .sites-page .testtr:hover{background-color:transparent}.cdk-drag-preview{display:table;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:0}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission", "abpPermissionRunChangeDetection"] }, { kind: "component", type: i8.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i8.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i8.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i3.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: i11.PageToolbarContainerComponent, selector: "abp-page-toolbar-container" }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
425
|
-
}
|
|
426
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntriesComponent, decorators: [{
|
|
427
|
-
type: Component,
|
|
428
|
-
args: [{ selector: 'cms-entries', providers: [
|
|
429
|
-
ListService,
|
|
430
|
-
// Provide this token if you want a different debounce time.
|
|
431
|
-
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
432
|
-
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
433
|
-
{
|
|
434
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
435
|
-
useValue: ECmsComponent.Entries,
|
|
436
|
-
},
|
|
437
|
-
], template: "<abp-page [title]=\"'Cms::Entries' | abpLocalization\" [toolbar]=\"true\">\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length < 1\" class=\"col \"></abp-page-toolbar-container>\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length > 1\" class=\"col \">\r\n <div class=\"row justify-content-end mx-0 gap-2\" *abpPermission=\"'CmsAdmin.Entry.Create'\">\r\n <div class=\"col-auto px-0 pt-0\">\r\n <div ngbDropdown class=\"d-inline-block\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm ms-2\" id=\"dropdownBasic1\" ngbDropdownToggle>\r\n <i class=\"fa fa-plus pe-1\" aria-hidden=\"true\"></i>{{'Cms::New' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <button ngbDropdownItem [routerLink]=\"['/cms/admin/entries/create']\"\r\n [queryParams]=\"{cultureName: filters.culture,sectionId:filters.sectionId,entryTypeId:item.id}\">{{item.displayName}}</button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </abp-page-toolbar-container>\r\n <div id=\"sites-page\" class=\"sites-page\">\r\n <div class=\"card\">\r\n <div class=\"card-body px-2 py-sm-2 border-bottom\" [formGroup]=\"filtersForm\">\r\n <div class=\"row align-items-end\">\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"sectionId\" (change)=\"sectionIdChange()\">\r\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\r\n <option [value]=\"item.id\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Languages' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"culture\" (change)=\"cultureChange()\">\r\n <ng-container *ngFor=\"let item of sectionLanguagesList\">\r\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n \r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"filter\"\r\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"resetData()\">\r\n <i class=\"fa fa-search\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\">\r\n <div class=\"card-body p-0\">\r\n <div class=\"table-responsive table-fixed-header\">\r\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\r\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\r\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\r\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"entryTypeId\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <ng-container *ngIf=\"item.id === value\">{{item.displayName}}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Title' | abpLocalization\" prop=\"title\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Slug' | abpLocalization\" prop=\"slug\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Status' | abpLocalization\" prop=\"status\" [width]=\"80\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of _entryStatusOptions\">\r\n <ng-container *ngIf=\"item.value=== value\">{{ 'Cms::Enum:EntryStatus:'+item.key |\r\n abpLocalization }}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::PublishTime' | abpLocalization\" prop=\"publishTime\" [width]=\"190\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{value | date: 'YYYY/MM/dd HH:mm:s' }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n cellClass=\"cellClassRight\" [frozenRight]=\"true\" [width]=\"110\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\r\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem\r\n routerLink=\"/cms/admin/entries/{{row.id}}/edit\">{{'AbpUi::Edit' |\r\n abpLocalization}}</button>\r\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\r\n abpLocalization}}</button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</abp-page>", styles: ["::ng-deep .sites-page .dignite_page{background:transparent}::ng-deep .sites-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sites-page .card-header input{flex:2 1 auto}::ng-deep .sites-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-page .morentr{border:2px solid transparent}::ng-deep .sites-page .borderdrag{border:2px solid var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .borderdragtd{background-color:var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .testtr{border-color:transparent}::ng-deep .sites-page .testtr td{padding:2px}::ng-deep .sites-page .testtr:hover{background-color:transparent}.cdk-drag-preview{display:table;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:0}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"] }]
|
|
438
|
-
}], ctorParameters: function () { return [{ type: EntryAdminService }, { type: SectionAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1.ConfigStateService }, { type: i3$1.Router }, { type: i1.LocalizationService }]; } });
|
|
439
|
-
|
|
440
|
-
class CreateOrUpdateEntryInputBase {
|
|
441
|
-
/**语言 */
|
|
442
|
-
culture = ['', [Validators.required]];
|
|
443
|
-
/**条目id */
|
|
444
|
-
entryTypeId = [''];
|
|
445
|
-
/**标题 */
|
|
446
|
-
title = ['', [Validators.required]];
|
|
447
|
-
/**别名 */
|
|
448
|
-
slug = ['', [Validators.required]];
|
|
449
|
-
/**是否是草稿 */
|
|
450
|
-
draft = ['', []];
|
|
451
|
-
/**发布时间 */
|
|
452
|
-
publishTime = ['', [Validators.required]];
|
|
453
|
-
/**上级目录 */
|
|
454
|
-
parentId = [null];
|
|
455
|
-
/**修订说明 */
|
|
456
|
-
versionNotes = [null];
|
|
457
|
-
/**版本 */
|
|
458
|
-
initialVersionId = [null];
|
|
459
|
-
extraProperties = new FormGroup({});
|
|
460
|
-
constructor(data) {
|
|
461
|
-
if (data) {
|
|
462
|
-
for (const key in data) {
|
|
463
|
-
if (data.hasOwnProperty(key)) {
|
|
464
|
-
this[key] = data[key];
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
class FieldGroupAdminService {
|
|
472
|
-
restService;
|
|
473
|
-
apiName = 'CmsAdmin';
|
|
474
|
-
create = (input, config) => this.restService.request({
|
|
475
|
-
method: 'POST',
|
|
476
|
-
url: '/api/cms-admin/field-groups',
|
|
477
|
-
body: input,
|
|
478
|
-
}, { apiName: this.apiName, ...config });
|
|
479
|
-
delete = (id, config) => this.restService.request({
|
|
480
|
-
method: 'DELETE',
|
|
481
|
-
url: `/api/cms-admin/field-groups/${id}`,
|
|
482
|
-
}, { apiName: this.apiName, ...config });
|
|
483
|
-
get = (id, config) => this.restService.request({
|
|
484
|
-
method: 'GET',
|
|
485
|
-
url: `/api/cms-admin/field-groups/${id}`,
|
|
486
|
-
}, { apiName: this.apiName, ...config });
|
|
487
|
-
getList = (input, config) => this.restService.request({
|
|
488
|
-
method: 'GET',
|
|
489
|
-
url: '/api/cms-admin/field-groups',
|
|
490
|
-
params: { input },
|
|
491
|
-
}, { apiName: this.apiName, ...config });
|
|
492
|
-
update = (id, input, config) => this.restService.request({
|
|
493
|
-
method: 'PUT',
|
|
494
|
-
url: `/api/cms-admin/field-groups/${id}`,
|
|
495
|
-
body: input,
|
|
496
|
-
}, { apiName: this.apiName, ...config });
|
|
497
|
-
constructor(restService) {
|
|
498
|
-
this.restService = restService;
|
|
499
|
-
}
|
|
500
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldGroupAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
501
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldGroupAdminService, providedIn: 'root' });
|
|
502
|
-
}
|
|
503
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldGroupAdminService, decorators: [{
|
|
504
|
-
type: Injectable,
|
|
505
|
-
args: [{
|
|
506
|
-
providedIn: 'root',
|
|
507
|
-
}]
|
|
508
|
-
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
509
|
-
|
|
510
|
-
class FormAdminService {
|
|
511
|
-
restService;
|
|
512
|
-
apiName = 'CmsAdmin';
|
|
513
|
-
getFormControls = (config) => this.restService.request({
|
|
514
|
-
method: 'GET',
|
|
515
|
-
url: '/api/cms-admin/dynamic-forms/forms',
|
|
516
|
-
}, { apiName: this.apiName, ...config });
|
|
517
|
-
constructor(restService) {
|
|
518
|
-
this.restService = restService;
|
|
519
|
-
}
|
|
520
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
521
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormAdminService, providedIn: 'root' });
|
|
522
|
-
}
|
|
523
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FormAdminService, decorators: [{
|
|
524
|
-
type: Injectable,
|
|
525
|
-
args: [{
|
|
526
|
-
providedIn: 'root',
|
|
527
|
-
}]
|
|
528
|
-
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
529
|
-
|
|
530
|
-
class FieldAbstractsService {
|
|
531
|
-
_FieldGroupAdminService;
|
|
532
|
-
_FormAdminService;
|
|
533
|
-
constructor(_FieldGroupAdminService, _FormAdminService) {
|
|
534
|
-
this._FieldGroupAdminService = _FieldGroupAdminService;
|
|
535
|
-
this._FormAdminService = _FormAdminService;
|
|
536
|
-
}
|
|
537
|
-
/**字段分组列表 */
|
|
538
|
-
fieldGroupList = [];
|
|
539
|
-
/**获取字段分组列表 */
|
|
540
|
-
getfieldGroupList() {
|
|
541
|
-
this._FieldGroupAdminService.getList({}).subscribe(res => {
|
|
542
|
-
this.fieldGroupList = res.items;
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
/**表单控件类型 */
|
|
546
|
-
fromControlList = [];
|
|
547
|
-
/**获取表单控件类型 */
|
|
548
|
-
getFromControlList() {
|
|
549
|
-
return new Promise((resolve, reject) => {
|
|
550
|
-
this._FormAdminService.getFormControls({}).subscribe(res => {
|
|
551
|
-
this.fromControlList = res.items;
|
|
552
|
-
resolve(res.items);
|
|
553
|
-
});
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
getExcludeAssignControl(typeName) {
|
|
557
|
-
// return this.fromControlList.filter(el => el.name !== typeName)
|
|
558
|
-
return this.fromControlList;
|
|
559
|
-
}
|
|
560
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldAbstractsService, deps: [{ token: FieldGroupAdminService }, { token: FormAdminService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
561
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldAbstractsService, providedIn: 'root' });
|
|
562
|
-
}
|
|
563
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldAbstractsService, decorators: [{
|
|
564
|
-
type: Injectable,
|
|
565
|
-
args: [{
|
|
566
|
-
providedIn: 'root'
|
|
567
|
-
}]
|
|
568
|
-
}], ctorParameters: function () { return [{ type: FieldGroupAdminService }, { type: FormAdminService }]; } });
|
|
569
|
-
|
|
570
|
-
class CmsService {
|
|
571
|
-
restService;
|
|
572
|
-
apiName = 'Cms';
|
|
573
|
-
constructor(restService) {
|
|
574
|
-
this.restService = restService;
|
|
575
|
-
}
|
|
576
|
-
sample() {
|
|
577
|
-
return this.restService.request({ method: 'GET', url: '/api/Cms/sample' }, { apiName: this.apiName });
|
|
578
|
-
}
|
|
579
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
580
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsService, providedIn: 'root' });
|
|
581
|
-
}
|
|
582
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsService, decorators: [{
|
|
583
|
-
type: Injectable,
|
|
584
|
-
args: [{
|
|
585
|
-
providedIn: 'root',
|
|
586
|
-
}]
|
|
587
|
-
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
588
|
-
|
|
589
|
-
class CmsApiService {
|
|
590
|
-
titleService;
|
|
591
|
-
constructor(titleService) {
|
|
592
|
-
this.titleService = titleService;
|
|
593
|
-
}
|
|
594
|
-
/**动态设置浏览器标题 */
|
|
595
|
-
setBrowserTitle(title) {
|
|
596
|
-
this.titleService.setTitle(title);
|
|
597
|
-
}
|
|
598
|
-
/**
|
|
599
|
-
* 识别中文转化为拼音,固定返回类型
|
|
600
|
-
* 汉字转拼音
|
|
601
|
-
* 大写转小写
|
|
602
|
-
*
|
|
603
|
-
* */
|
|
604
|
-
chineseToPinyin(value) {
|
|
605
|
-
//去除字符串中所有的空格
|
|
606
|
-
// let val = value
|
|
607
|
-
let val = value.replaceAll(' ', "-");
|
|
608
|
-
let array = val.split('');
|
|
609
|
-
let newArray = [];
|
|
610
|
-
array.forEach((el, index) => {
|
|
611
|
-
//转化为小写
|
|
612
|
-
let elChange = el.toLowerCase();
|
|
613
|
-
let isChinese = (str) => {
|
|
614
|
-
return /^[\u4e00-\u9fa5]+$/.test(str);
|
|
615
|
-
};
|
|
616
|
-
if (isChinese(elChange)) {
|
|
617
|
-
const resultWithoutTone = pinyin(elChange, { toneType: 'none', type: 'array' });
|
|
618
|
-
elChange = resultWithoutTone.toString();
|
|
619
|
-
if (index < array.length - 1)
|
|
620
|
-
elChange += '-';
|
|
621
|
-
}
|
|
622
|
-
;
|
|
623
|
-
newArray.push(elChange);
|
|
624
|
-
});
|
|
625
|
-
let pinyinstr = newArray.join('');
|
|
626
|
-
return pinyinstr || val;
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* 深拷贝--方法 */
|
|
630
|
-
deepClone(obj) {
|
|
631
|
-
if (typeof obj !== 'object' || obj === null)
|
|
632
|
-
return obj;
|
|
633
|
-
const result = Array.isArray(obj) ? [] : {};
|
|
634
|
-
for (let key in obj) {
|
|
635
|
-
if (obj.hasOwnProperty(key)) {
|
|
636
|
-
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
637
|
-
if (obj[key] instanceof Date) {
|
|
638
|
-
result[key] = new Date(obj[key].getTime());
|
|
639
|
-
}
|
|
640
|
-
else if (obj[key] instanceof RegExp) {
|
|
641
|
-
result[key] = new RegExp(obj[key]);
|
|
642
|
-
}
|
|
643
|
-
else {
|
|
644
|
-
result[key] = this.deepClone(obj[key]);
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
else {
|
|
648
|
-
result[key] = obj[key];
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
return result;
|
|
653
|
-
}
|
|
654
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsApiService, deps: [{ token: i1$2.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
655
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsApiService, providedIn: 'root' });
|
|
656
|
-
}
|
|
657
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsApiService, decorators: [{
|
|
658
|
-
type: Injectable,
|
|
659
|
-
args: [{
|
|
660
|
-
providedIn: 'root'
|
|
661
|
-
}]
|
|
662
|
-
}], ctorParameters: function () { return [{ type: i1$2.Title }]; } });
|
|
663
|
-
|
|
664
|
-
class SimpleReuseStrategy {
|
|
665
|
-
handlers = {};
|
|
666
|
-
//表示对路由允许复用
|
|
667
|
-
shouldDetach(route) {
|
|
668
|
-
//默认对所有路由复用 可通过给路由配置项增加data: { keep: true }来进行选择性使用,代码如下
|
|
669
|
-
//如果是懒加载路由需要在生命组件的位置进行配置
|
|
670
|
-
if (!route.data.keep) {
|
|
671
|
-
return false;
|
|
672
|
-
}
|
|
673
|
-
return true;
|
|
674
|
-
}
|
|
675
|
-
//当路由离开时会触发。按path作为key存储路由快照&组件当前实例对象
|
|
676
|
-
store(route, handle) {
|
|
677
|
-
const key = route.component.name;
|
|
678
|
-
if (key) {
|
|
679
|
-
this.handlers[key] = handle;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
//若path在缓存中有的都认为允许还原路由
|
|
683
|
-
shouldAttach(route) {
|
|
684
|
-
if (route.component?.name) {
|
|
685
|
-
return !!this.handlers[route.component?.name];
|
|
686
|
-
}
|
|
687
|
-
return false;
|
|
688
|
-
}
|
|
689
|
-
// 从缓存中获取快照,若无则返回null
|
|
690
|
-
retrieve(route) {
|
|
691
|
-
if (!route.routeConfig)
|
|
692
|
-
return null;
|
|
693
|
-
//在loadChildren路径上通过修改自定义RouteReuseStrategy中的检索函数时从不检索分离的路由。
|
|
694
|
-
if (route.routeConfig.loadChildren)
|
|
695
|
-
return null;
|
|
696
|
-
if (route.component?.name) {
|
|
697
|
-
return this.handlers[route.component?.name];
|
|
698
|
-
}
|
|
699
|
-
return null;
|
|
700
|
-
}
|
|
701
|
-
//进入路由触发,判断是否同一路由
|
|
702
|
-
shouldReuseRoute(future, current) {
|
|
703
|
-
return future.routeConfig === current.routeConfig;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
class CreateOrEditEntriesComponent {
|
|
708
|
-
toaster;
|
|
709
|
-
_location;
|
|
710
|
-
configState;
|
|
711
|
-
_SectionAdminService;
|
|
712
|
-
_EntryAdminService;
|
|
713
|
-
datePipe;
|
|
714
|
-
_LocalizationService;
|
|
715
|
-
router;
|
|
716
|
-
_CmsApiService;
|
|
717
|
-
constructor(toaster, _location, configState, _SectionAdminService, _EntryAdminService, datePipe, _LocalizationService, router, _CmsApiService) {
|
|
718
|
-
this.toaster = toaster;
|
|
719
|
-
this._location = _location;
|
|
720
|
-
this.configState = configState;
|
|
721
|
-
this._SectionAdminService = _SectionAdminService;
|
|
722
|
-
this._EntryAdminService = _EntryAdminService;
|
|
723
|
-
this.datePipe = datePipe;
|
|
724
|
-
this._LocalizationService = _LocalizationService;
|
|
725
|
-
this.router = router;
|
|
726
|
-
this._CmsApiService = _CmsApiService;
|
|
727
|
-
}
|
|
728
|
-
/**语言 */
|
|
729
|
-
cultureName = '';
|
|
730
|
-
/**条目id */
|
|
731
|
-
entryTypeId = '';
|
|
732
|
-
/**新建版本的版本id,同条目id */
|
|
733
|
-
RevisionEntryId = '';
|
|
734
|
-
/**选择的条目项 */
|
|
735
|
-
entryTypesItem = '';
|
|
736
|
-
/**版块id */
|
|
737
|
-
sectionId = '';
|
|
738
|
-
/**版块详情 */
|
|
739
|
-
SectionSelect = '';
|
|
740
|
-
/**语言列表 */
|
|
741
|
-
languagesList = [];
|
|
742
|
-
/**条目类型列表-用于选择上级条目 */
|
|
743
|
-
entryTypesList = [];
|
|
744
|
-
/**版本列表 */
|
|
745
|
-
AllVersionsList = [];
|
|
746
|
-
/**是否是编辑 */
|
|
747
|
-
isEdit = false;
|
|
748
|
-
/**来自父组件的传值 */
|
|
749
|
-
FromParentQueryParams = '';
|
|
750
|
-
set ParentQueryParams(v) {
|
|
751
|
-
if (v) {
|
|
752
|
-
this.FromParentQueryParams = v;
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
/**表单实体 */
|
|
756
|
-
_entity;
|
|
757
|
-
set entity(v) {
|
|
758
|
-
if (v) {
|
|
759
|
-
this._entity = v;
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
/**指定id的条目信息 */
|
|
763
|
-
entrySelect = '';
|
|
764
|
-
set parentEntrySelect(v) {
|
|
765
|
-
if (v) {
|
|
766
|
-
let V_extraProperties = this._CmsApiService.deepClone(this.convertExtraProperties(v.extraProperties));
|
|
767
|
-
v.extraProperties = V_extraProperties;
|
|
768
|
-
this.entrySelect = v;
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
/**将对象中的ExtraProperties赋值到extraProperties */
|
|
772
|
-
convertExtraProperties(obj) {
|
|
773
|
-
for (let key in obj) {
|
|
774
|
-
if (Array.isArray(obj[key])) {
|
|
775
|
-
obj[key].forEach(item => {
|
|
776
|
-
if (item.hasOwnProperty('ExtraProperties')) {
|
|
777
|
-
item['extraProperties'] = item['ExtraProperties'];
|
|
778
|
-
}
|
|
779
|
-
});
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
return obj;
|
|
783
|
-
}
|
|
784
|
-
/**别名表单实体 */
|
|
785
|
-
get sluginput() {
|
|
786
|
-
return this._entity.get('slug');
|
|
787
|
-
}
|
|
788
|
-
/**语言表单实体 */
|
|
789
|
-
get cultureinput() {
|
|
790
|
-
return this._entity.get('culture');
|
|
791
|
-
}
|
|
792
|
-
/**语言表单实体影子 */
|
|
793
|
-
get culture_shadowInput() {
|
|
794
|
-
return this._entity.get('culture_shadow');
|
|
795
|
-
}
|
|
796
|
-
/**extraProperties配置表单实体 */
|
|
797
|
-
get extraProperties() {
|
|
798
|
-
return this._entity.get('extraProperties');
|
|
799
|
-
}
|
|
800
|
-
async ngAfterContentInit() {
|
|
801
|
-
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
802
|
-
//Add 'implements AfterContentInit' to the class.
|
|
803
|
-
let queryParams = this.FromParentQueryParams;
|
|
804
|
-
if (this._entity && this.FromParentQueryParams) {
|
|
805
|
-
this._entity.setControl('slug', new FormControl('', {
|
|
806
|
-
validators: Validators.required,
|
|
807
|
-
asyncValidators: this.repetitionAsyncValidator(),
|
|
808
|
-
updateOn: 'blur'
|
|
809
|
-
}));
|
|
810
|
-
this._entity.setControl('culture_shadow', new FormControl('', {
|
|
811
|
-
validators: [Validators.required],
|
|
812
|
-
asyncValidators: this.cultureAsyncValidator_test(),
|
|
813
|
-
}));
|
|
814
|
-
this._entity.get('culture').disable();
|
|
815
|
-
if (queryParams.RevisionEntryId && this.entrySelect) {
|
|
816
|
-
this.RevisionEntryId = queryParams.RevisionEntryId;
|
|
817
|
-
this.setEntryconfig(this.entrySelect);
|
|
818
|
-
}
|
|
819
|
-
else {
|
|
820
|
-
this.setEntryconfig(queryParams);
|
|
821
|
-
}
|
|
822
|
-
if (this.sectionId)
|
|
823
|
-
await this.getSectionSelect();
|
|
824
|
-
if (this.RevisionEntryId)
|
|
825
|
-
await this.getAllVersionsList();
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
/**表单控件模板-动态表单配置组件 */
|
|
829
|
-
FormDynamicontrolRef;
|
|
830
|
-
/**定义自定义异步验证 */
|
|
831
|
-
cultureAsyncValidator_test() {
|
|
832
|
-
return (ctrl) => {
|
|
833
|
-
return new Promise(resolve => {
|
|
834
|
-
let subculture = this._entity?.get('culture').value;
|
|
835
|
-
if (subculture == this.entrySelect?.culture || this.SectionSelect.type !== 0) {
|
|
836
|
-
resolve(null);
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
|
-
this._EntryAdminService.cultureExistWithSingleSection({
|
|
840
|
-
culture: subculture,
|
|
841
|
-
sectionId: this.sectionId,
|
|
842
|
-
entryTypeId: this.entryTypeId
|
|
843
|
-
}).subscribe(res => {
|
|
844
|
-
if (res) {
|
|
845
|
-
resolve({ repetition: this._LocalizationService.instant(`Cms::EntriesAlreadyExistEntryType`, this.entryTypesItem.displayName, this.languagesList.find(el => el.cultureName == subculture).displayName) });
|
|
846
|
-
}
|
|
847
|
-
else {
|
|
848
|
-
resolve(null);
|
|
849
|
-
}
|
|
850
|
-
});
|
|
851
|
-
});
|
|
852
|
-
};
|
|
853
|
-
}
|
|
854
|
-
/**
|
|
855
|
-
* 设置条目详情
|
|
856
|
-
* @param {object} source - 数据源对象
|
|
857
|
-
*/
|
|
858
|
-
setEntryconfig(source) {
|
|
859
|
-
this.entryTypeId = source.entryTypeId;
|
|
860
|
-
this.cultureName = source.culture || source.cultureName;
|
|
861
|
-
this.sectionId = source.sectionId;
|
|
862
|
-
}
|
|
863
|
-
time = 0;
|
|
864
|
-
/**定义自定义异步验证 */
|
|
865
|
-
repetitionAsyncValidator() {
|
|
866
|
-
return (ctrl) => {
|
|
867
|
-
return new Promise(resolve => {
|
|
868
|
-
let subslug = this._entity?.get('slug').value;
|
|
869
|
-
if (subslug == this.entrySelect?.slug) {
|
|
870
|
-
resolve(null);
|
|
871
|
-
return;
|
|
872
|
-
}
|
|
873
|
-
this._EntryAdminService.slugExists({
|
|
874
|
-
culture: this.cultureName,
|
|
875
|
-
sectionId: this.sectionId,
|
|
876
|
-
slug: subslug
|
|
877
|
-
}).subscribe(res => {
|
|
878
|
-
if (res) {
|
|
879
|
-
resolve({ repetition: this._LocalizationService.instant(`Cms::EntrySlug{0}AlreadyExist`, ctrl.value) });
|
|
880
|
-
}
|
|
881
|
-
else {
|
|
882
|
-
resolve(null);
|
|
883
|
-
}
|
|
884
|
-
});
|
|
885
|
-
});
|
|
886
|
-
};
|
|
887
|
-
}
|
|
888
|
-
config = inject(ConfigStateService);
|
|
889
|
-
/**获取版块详情 */
|
|
890
|
-
getSectionSelect() {
|
|
891
|
-
return new Promise((resolve, rejects) => {
|
|
892
|
-
this._SectionAdminService.get(this.sectionId).subscribe(async (res) => {
|
|
893
|
-
let languages = this.configState.getDeep('localization.languages');
|
|
894
|
-
this.languagesList = languages;
|
|
895
|
-
let entryTypesItem = res.entryTypes.find(el => el.id == this.entryTypeId);
|
|
896
|
-
this.SectionSelect = res;
|
|
897
|
-
this.entryTypesItem = entryTypesItem;
|
|
898
|
-
this.entryTypesList = res.entryTypes.filter(el => el.id == this.entryTypeId);
|
|
899
|
-
this._entity.patchValue({
|
|
900
|
-
...this.entrySelect,
|
|
901
|
-
initialVersionId: this.entrySelect?.initialVersionId || this.RevisionEntryId || '',
|
|
902
|
-
culture: this.cultureName,
|
|
903
|
-
culture_shadow: this.cultureName,
|
|
904
|
-
entryTypeId: this.entryTypeId,
|
|
905
|
-
publishTime: this.datePipe.transform(new Date(), 'yyyy-MM-dd HH:mm:ss'),
|
|
906
|
-
});
|
|
907
|
-
resolve(true);
|
|
908
|
-
});
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
|
-
/**获取条目版本列表 */
|
|
912
|
-
getAllVersionsList() {
|
|
913
|
-
return new Promise((resolve, rejects) => {
|
|
914
|
-
this._EntryAdminService.getAllVersions(this.RevisionEntryId).subscribe(res => {
|
|
915
|
-
this.AllVersionsList = res.items;
|
|
916
|
-
resolve(res);
|
|
917
|
-
});
|
|
918
|
-
});
|
|
919
|
-
}
|
|
920
|
-
/**标题转化别名 */
|
|
921
|
-
setTitleToSlugBlur(event) {
|
|
922
|
-
let val = event.target.value;
|
|
923
|
-
let slug = this._entity.get('slug');
|
|
924
|
-
let pinyinstr = '';
|
|
925
|
-
if (slug.value)
|
|
926
|
-
return;
|
|
927
|
-
pinyinstr = this._CmsApiService.chineseToPinyin(val);
|
|
928
|
-
this._entity.patchValue({
|
|
929
|
-
slug: pinyinstr || val
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
/**使用Unicode编码范围判断是否是中文字符 */
|
|
933
|
-
isChinese(str) {
|
|
934
|
-
return /^[\u4e00-\u9fa5]+$/.test(str);
|
|
935
|
-
}
|
|
936
|
-
/**激活 */
|
|
937
|
-
ActivatedVersion(VersionId) {
|
|
938
|
-
this._EntryAdminService.activate(VersionId).subscribe((res) => {
|
|
939
|
-
this.AllVersionsList.forEach(el => {
|
|
940
|
-
el.isActivatedVersion = el.id === VersionId;
|
|
941
|
-
});
|
|
942
|
-
return;
|
|
943
|
-
});
|
|
944
|
-
}
|
|
945
|
-
/**编辑版本 */
|
|
946
|
-
toEditUrl(id) {
|
|
947
|
-
this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
|
|
948
|
-
this.router.navigate([`/cms/admin/entries/${id}/edit`]);
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
/**删除版本 */
|
|
952
|
-
delectVersion(vid) {
|
|
953
|
-
this._EntryAdminService.delete(vid).subscribe(res => {
|
|
954
|
-
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
955
|
-
this.getAllVersionsList();
|
|
956
|
-
});
|
|
957
|
-
}
|
|
958
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateOrEditEntriesComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i1.ConfigStateService }, { token: SectionAdminService }, { token: EntryAdminService }, { token: i2.DatePipe }, { token: i1.LocalizationService }, { token: i3$1.Router }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component });
|
|
959
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CreateOrEditEntriesComponent, selector: "cms-create-or-edit-entries", inputs: { isEdit: "isEdit", ParentQueryParams: "ParentQueryParams", entity: "entity", parentEntrySelect: "parentEntrySelect" }, viewQueries: [{ propertyName: "FormDynamicontrolRef", predicate: ["FormDynamicontrolRef"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"create-or-edit-entry-page\" [formGroup]=\"_entity\">\n <div class=\"container \">\n <div class=\"row\">\n <div class=\"col-md-8 \">\n <div class=\"card p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"title\">{{'Cms::Title' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" (blur)=\"setTitleToSlugBlur($event)\"\n formControlName=\"title\">\n </div>\n <template #FormDynamicRef></template>\n <ng-container *ngFor=\"let item of entryTypesItem?.fieldTabs;let i =index\">\n <ng-container *ngFor=\"let el of item.fields;let i1 =index\">\n <ng-container *ngIf=\"el&&_entity\">\n <df-dynamic [entity]=\"_entity\" [fields]=\"el\"\n [selected]=\"entrySelect ? entrySelect.extraProperties[el.field.name] : ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"cultureinput.value\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-4 \">\n <div class=\"card mb-0 p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"slug\">{{'Cms::Slug' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"slug\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"sluginput.errors?.repetition\">\n {{sluginput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"culture\">{{'AbpUi::Languages' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"culture\">\n <ng-container *ngFor=\"let item of languagesList;let i =index\">\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\n </ng-container>\n </select>\n <input type=\"text\" formControlName=\"culture_shadow\"\n style=\"position: absolute;z-index: -1;opacity: 0;\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"culture_shadowInput.errors?.repetition\">\n {{culture_shadowInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"parentId\">{{'Cms::ParentEntry' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"parentId\">\n <option value=\"\"></option>\n <ng-container *ngFor=\"let item of entryTypesList;let i =index\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::PublishTime' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"publishTime\">\n </div>\n <div class=\"mb-2\" *ngIf=\"isEdit\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::Version' | abpLocalization}}</label>\n <ul class=\"list-group\">\n <ng-container *ngFor=\"let item of AllVersionsList\">\n <li class=\"list-group-item flex-between\">\n <div>\n {{item.initialVersionId?(item.creationTime| date: 'YYYY/MM/dd HH:mm:s'):('Cms::InitialVersion' | abpLocalization)}}\n <span class=\"badge text-bg-success ms-1\"\n *ngIf=\"item.isActivatedVersion\">{{'Cms::IsActive' | abpLocalization}}</span>\n <span class=\"badge text-bg-primary ms-1\"\n *ngIf=\"item.id === RevisionEntryId\">{{'Cms::Editing' |\n abpLocalization}}</span>\n </div>\n <div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-link-primary p-2 \"\n style=\"line-height: 0;\" id=\"dropdownBasic1\" ngbDropdownToggle>\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <button ngbDropdownItem type=\"button\" *ngIf=\"!item.isActivatedVersion\"\n (click)=\"ActivatedVersion(item.id)\">\n <i class=\"fas fa-check me-1\"></i>{{'Cms::IsActive' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n routerLink=\"/cms/admin/entries/create\"\n [queryParams]=\"{RevisionEntryId:item.id}\">\n <i class=\"fas fa-plus me-1\"></i>{{'Cms::NewVersion' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\" (click.stop)=\"toEditUrl(item.id)\"\n *ngIf=\"item.id !== RevisionEntryId\">\n <i class=\"fas fa-edit me-1\"></i>{{'AbpUi::Edit' | abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n (click.stop)=\"delectVersion(item.id)\"\n *ngIf=\"item.initialVersionId&&!item.isActivatedVersion&&item.id !== RevisionEntryId\">\n <i class=\"fas fa-trash me-1\"></i>{{'AbpUi::Delete' |\n abpLocalization}}\n </button>\n </div>\n </div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"versionNotes\">{{'Cms::RevisionNotes' | abpLocalization}}</label>\n <textarea class=\"form-control\" formControlName=\"versionNotes\" rows=\"3\"></textarea>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .create-or-edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "component", type: i8$1.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
960
|
-
}
|
|
961
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateOrEditEntriesComponent, decorators: [{
|
|
962
|
-
type: Component,
|
|
963
|
-
args: [{ selector: 'cms-create-or-edit-entries', template: "<div class=\"create-or-edit-entry-page\" [formGroup]=\"_entity\">\n <div class=\"container \">\n <div class=\"row\">\n <div class=\"col-md-8 \">\n <div class=\"card p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"title\">{{'Cms::Title' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" (blur)=\"setTitleToSlugBlur($event)\"\n formControlName=\"title\">\n </div>\n <template #FormDynamicRef></template>\n <ng-container *ngFor=\"let item of entryTypesItem?.fieldTabs;let i =index\">\n <ng-container *ngFor=\"let el of item.fields;let i1 =index\">\n <ng-container *ngIf=\"el&&_entity\">\n <df-dynamic [entity]=\"_entity\" [fields]=\"el\"\n [selected]=\"entrySelect ? entrySelect.extraProperties[el.field.name] : ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"cultureinput.value\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-4 \">\n <div class=\"card mb-0 p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"slug\">{{'Cms::Slug' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"slug\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"sluginput.errors?.repetition\">\n {{sluginput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"culture\">{{'AbpUi::Languages' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"culture\">\n <ng-container *ngFor=\"let item of languagesList;let i =index\">\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\n </ng-container>\n </select>\n <input type=\"text\" formControlName=\"culture_shadow\"\n style=\"position: absolute;z-index: -1;opacity: 0;\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"culture_shadowInput.errors?.repetition\">\n {{culture_shadowInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"parentId\">{{'Cms::ParentEntry' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"parentId\">\n <option value=\"\"></option>\n <ng-container *ngFor=\"let item of entryTypesList;let i =index\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::PublishTime' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"publishTime\">\n </div>\n <div class=\"mb-2\" *ngIf=\"isEdit\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::Version' | abpLocalization}}</label>\n <ul class=\"list-group\">\n <ng-container *ngFor=\"let item of AllVersionsList\">\n <li class=\"list-group-item flex-between\">\n <div>\n {{item.initialVersionId?(item.creationTime| date: 'YYYY/MM/dd HH:mm:s'):('Cms::InitialVersion' | abpLocalization)}}\n <span class=\"badge text-bg-success ms-1\"\n *ngIf=\"item.isActivatedVersion\">{{'Cms::IsActive' | abpLocalization}}</span>\n <span class=\"badge text-bg-primary ms-1\"\n *ngIf=\"item.id === RevisionEntryId\">{{'Cms::Editing' |\n abpLocalization}}</span>\n </div>\n <div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-link-primary p-2 \"\n style=\"line-height: 0;\" id=\"dropdownBasic1\" ngbDropdownToggle>\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <button ngbDropdownItem type=\"button\" *ngIf=\"!item.isActivatedVersion\"\n (click)=\"ActivatedVersion(item.id)\">\n <i class=\"fas fa-check me-1\"></i>{{'Cms::IsActive' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n routerLink=\"/cms/admin/entries/create\"\n [queryParams]=\"{RevisionEntryId:item.id}\">\n <i class=\"fas fa-plus me-1\"></i>{{'Cms::NewVersion' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\" (click.stop)=\"toEditUrl(item.id)\"\n *ngIf=\"item.id !== RevisionEntryId\">\n <i class=\"fas fa-edit me-1\"></i>{{'AbpUi::Edit' | abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n (click.stop)=\"delectVersion(item.id)\"\n *ngIf=\"item.initialVersionId&&!item.isActivatedVersion&&item.id !== RevisionEntryId\">\n <i class=\"fas fa-trash me-1\"></i>{{'AbpUi::Delete' |\n abpLocalization}}\n </button>\n </div>\n </div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"versionNotes\">{{'Cms::RevisionNotes' | abpLocalization}}</label>\n <textarea class=\"form-control\" formControlName=\"versionNotes\" rows=\"3\"></textarea>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .create-or-edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"] }]
|
|
964
|
-
}], ctorParameters: function () { return [{ type: i3.ToasterService }, { type: i2.Location }, { type: i1.ConfigStateService }, { type: SectionAdminService }, { type: EntryAdminService }, { type: i2.DatePipe }, { type: i1.LocalizationService }, { type: i3$1.Router }, { type: CmsApiService }]; }, propDecorators: { isEdit: [{
|
|
965
|
-
type: Input
|
|
966
|
-
}], ParentQueryParams: [{
|
|
967
|
-
type: Input
|
|
968
|
-
}], entity: [{
|
|
969
|
-
type: Input
|
|
970
|
-
}], parentEntrySelect: [{
|
|
971
|
-
type: Input
|
|
972
|
-
}], FormDynamicontrolRef: [{
|
|
973
|
-
type: ViewChildren,
|
|
974
|
-
args: ['FormDynamicontrolRef', { read: ViewContainerRef }]
|
|
975
|
-
}] } });
|
|
976
|
-
|
|
977
|
-
class CreateComponent {
|
|
978
|
-
toaster;
|
|
979
|
-
_location;
|
|
980
|
-
route;
|
|
981
|
-
_EntryAdminService;
|
|
982
|
-
_LocalizationService;
|
|
983
|
-
router;
|
|
984
|
-
constructor(toaster, _location, route, _EntryAdminService, _LocalizationService, router) {
|
|
985
|
-
this.toaster = toaster;
|
|
986
|
-
this._location = _location;
|
|
987
|
-
this.route = route;
|
|
988
|
-
this._EntryAdminService = _EntryAdminService;
|
|
989
|
-
this._LocalizationService = _LocalizationService;
|
|
990
|
-
this.router = router;
|
|
991
|
-
}
|
|
992
|
-
fb = inject(FormBuilder);
|
|
993
|
-
_updateListService = inject(UpdateListService);
|
|
994
|
-
/**表单实体 */
|
|
995
|
-
newEntity;
|
|
996
|
-
/**是否是草稿 */
|
|
997
|
-
draftType = false;
|
|
998
|
-
/**页面传值用于传递到子组件 */
|
|
999
|
-
queryParams = '';
|
|
1000
|
-
/**指定id的条目信息 */
|
|
1001
|
-
entrySelect = '';
|
|
1002
|
-
/**获取提交按钮替身,用于真实触发表单提交 */
|
|
1003
|
-
submitclick;
|
|
1004
|
-
async ngOnInit() {
|
|
1005
|
-
this.queryParams = this.route.snapshot.queryParams;
|
|
1006
|
-
this.newEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
|
|
1007
|
-
if (this.queryParams.RevisionEntryId)
|
|
1008
|
-
await this.getEntrySelect();
|
|
1009
|
-
}
|
|
1010
|
-
/**获取条目信息 */
|
|
1011
|
-
getEntrySelect() {
|
|
1012
|
-
return new Promise((resolve, rejects) => {
|
|
1013
|
-
this._EntryAdminService.get(this.queryParams.RevisionEntryId).subscribe(res => {
|
|
1014
|
-
this.entrySelect = res;
|
|
1015
|
-
resolve(res);
|
|
1016
|
-
});
|
|
1017
|
-
});
|
|
1018
|
-
}
|
|
1019
|
-
/**保存 */
|
|
1020
|
-
save(draft) {
|
|
1021
|
-
this.newEntity.patchValue({
|
|
1022
|
-
draft: draft
|
|
1023
|
-
});
|
|
1024
|
-
let input = this.newEntity.value;
|
|
1025
|
-
input.publishTime = new Date(new Date(input.publishTime).getTime() + (8 * 60 * 60 * 1000)).toISOString();
|
|
1026
|
-
input.culture = this.newEntity.get('culture').value;
|
|
1027
|
-
console.log(input, '保存', this.newEntity);
|
|
1028
|
-
if (!this.newEntity.valid)
|
|
1029
|
-
return;
|
|
1030
|
-
this._EntryAdminService.create(input).subscribe(res => {
|
|
1031
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
1032
|
-
this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
|
|
1033
|
-
this.router.navigate([`/cms/admin/entries`]);
|
|
1034
|
-
this._updateListService.updateList();
|
|
1035
|
-
});
|
|
1036
|
-
});
|
|
1037
|
-
}
|
|
1038
|
-
/**触发点击按钮替身 */
|
|
1039
|
-
clickSubmit(type) {
|
|
1040
|
-
this.draftType = type;
|
|
1041
|
-
this.submitclick.nativeElement.click();
|
|
1042
|
-
}
|
|
1043
|
-
/**返回上一页 */
|
|
1044
|
-
backTo() {
|
|
1045
|
-
this._location.back();
|
|
1046
|
-
}
|
|
1047
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: EntryAdminService }, { token: i1.LocalizationService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
1048
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CreateComponent, selector: "cms-create", providers: [
|
|
1049
|
-
{
|
|
1050
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1051
|
-
useValue: ECmsComponent.Entries_Create,
|
|
1052
|
-
},
|
|
1053
|
-
], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save(draftType)\">\n <abp-page [title]=\"'Cms::New'| abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect; else elseTemplate\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" ></cms-create-or-edit-entries>\n </ng-container>\n <ng-template #elseTemplate>\n <cms-create-or-edit-entries [entity]=\"newEntity\"\n [ParentQueryParams]=\"queryParams\" ></cms-create-or-edit-entries>\n </ng-template>\n </abp-page>\n</form>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditEntriesComponent, selector: "cms-create-or-edit-entries", inputs: ["isEdit", "ParentQueryParams", "entity", "parentEntrySelect"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
1054
|
-
}
|
|
1055
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateComponent, decorators: [{
|
|
1056
|
-
type: Component,
|
|
1057
|
-
args: [{ selector: 'cms-create', providers: [
|
|
1058
|
-
{
|
|
1059
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1060
|
-
useValue: ECmsComponent.Entries_Create,
|
|
1061
|
-
},
|
|
1062
|
-
], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save(draftType)\">\n <abp-page [title]=\"'Cms::New'| abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect; else elseTemplate\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" ></cms-create-or-edit-entries>\n </ng-container>\n <ng-template #elseTemplate>\n <cms-create-or-edit-entries [entity]=\"newEntity\"\n [ParentQueryParams]=\"queryParams\" ></cms-create-or-edit-entries>\n </ng-template>\n </abp-page>\n</form>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}\n"] }]
|
|
1063
|
-
}], ctorParameters: function () { return [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: EntryAdminService }, { type: i1.LocalizationService }, { type: i3$1.Router }]; }, propDecorators: { submitclick: [{
|
|
1064
|
-
type: ViewChild,
|
|
1065
|
-
args: ['submitclick', { static: true }]
|
|
1066
|
-
}] } });
|
|
1067
|
-
|
|
1068
|
-
class EditComponent {
|
|
1069
|
-
toaster;
|
|
1070
|
-
_location;
|
|
1071
|
-
route;
|
|
1072
|
-
_EntryAdminService;
|
|
1073
|
-
router;
|
|
1074
|
-
_LocalizationService;
|
|
1075
|
-
constructor(toaster, _location, route, _EntryAdminService, router, _LocalizationService) {
|
|
1076
|
-
this.toaster = toaster;
|
|
1077
|
-
this._location = _location;
|
|
1078
|
-
this.route = route;
|
|
1079
|
-
this._EntryAdminService = _EntryAdminService;
|
|
1080
|
-
this.router = router;
|
|
1081
|
-
this._LocalizationService = _LocalizationService;
|
|
1082
|
-
}
|
|
1083
|
-
fb = inject(FormBuilder);
|
|
1084
|
-
_updateListService = inject(UpdateListService);
|
|
1085
|
-
/**表单实体 */
|
|
1086
|
-
newEntity;
|
|
1087
|
-
/**是否是草稿 */
|
|
1088
|
-
draftType = false;
|
|
1089
|
-
/**页面传值用于传递到子组件 */
|
|
1090
|
-
queryParams = '' || {};
|
|
1091
|
-
/**指定id的条目信息 */
|
|
1092
|
-
entrySelect = '';
|
|
1093
|
-
/**获取提交按钮替身,用于真实触发表单提交 */
|
|
1094
|
-
submitclick;
|
|
1095
|
-
async ngOnInit() {
|
|
1096
|
-
this.queryParams.RevisionEntryId = this.route.snapshot.params.entrieId;
|
|
1097
|
-
this.newEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
|
|
1098
|
-
await this.getEntrySelect();
|
|
1099
|
-
}
|
|
1100
|
-
/**获取条目信息 */
|
|
1101
|
-
getEntrySelect() {
|
|
1102
|
-
return new Promise((resolve, rejects) => {
|
|
1103
|
-
this._EntryAdminService.get(this.queryParams.RevisionEntryId).subscribe(res => {
|
|
1104
|
-
this.entrySelect = res;
|
|
1105
|
-
resolve(res);
|
|
1106
|
-
});
|
|
1107
|
-
});
|
|
1108
|
-
}
|
|
1109
|
-
/**保存 */
|
|
1110
|
-
save(draft) {
|
|
1111
|
-
this.newEntity.patchValue({
|
|
1112
|
-
draft: draft,
|
|
1113
|
-
});
|
|
1114
|
-
let input = this.newEntity.value;
|
|
1115
|
-
input.publishTime = new Date(new Date(input.publishTime).getTime() + 8 * 60 * 60 * 1000).toISOString();
|
|
1116
|
-
input.culture = this.newEntity.get('culture').value;
|
|
1117
|
-
input.concurrencyStamp = this.entrySelect.concurrencyStamp;
|
|
1118
|
-
if (!this.newEntity.valid)
|
|
1119
|
-
return;
|
|
1120
|
-
this._EntryAdminService.update(this.entrySelect.id, input).subscribe(res => {
|
|
1121
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
1122
|
-
this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
|
|
1123
|
-
this.router.navigate([`/cms/admin/entries`]);
|
|
1124
|
-
this._updateListService.updateList();
|
|
1125
|
-
});
|
|
1126
|
-
});
|
|
1127
|
-
}
|
|
1128
|
-
/**触发点击按钮替身 */
|
|
1129
|
-
clickSubmit(type) {
|
|
1130
|
-
this.draftType = type;
|
|
1131
|
-
this.submitclick.nativeElement.click();
|
|
1132
|
-
}
|
|
1133
|
-
/**返回上一页 */
|
|
1134
|
-
backTo() {
|
|
1135
|
-
this._location.back();
|
|
1136
|
-
}
|
|
1137
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: EntryAdminService }, { token: i3$1.Router }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1138
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EditComponent, selector: "cms-edit", providers: [
|
|
1139
|
-
{
|
|
1140
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1141
|
-
useValue: ECmsComponent.Entries_Edit,
|
|
1142
|
-
},
|
|
1143
|
-
], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save(draftType)\">\n <abp-page [title]=\"'AbpUi::Edit' | abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" [isEdit]=\"true\"></cms-create-or-edit-entries>\n </ng-container>\n </abp-page>\n</form>", styles: ["::ng-deep .edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .edit-entry-page .form-control,::ng-deep .edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .edit-entry-page .cursor-move{cursor:move}::ng-deep .edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditEntriesComponent, selector: "cms-create-or-edit-entries", inputs: ["isEdit", "ParentQueryParams", "entity", "parentEntrySelect"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
1144
|
-
}
|
|
1145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditComponent, decorators: [{
|
|
1146
|
-
type: Component,
|
|
1147
|
-
args: [{ selector: 'cms-edit', providers: [
|
|
1148
|
-
{
|
|
1149
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1150
|
-
useValue: ECmsComponent.Entries_Edit,
|
|
1151
|
-
},
|
|
1152
|
-
], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save(draftType)\">\n <abp-page [title]=\"'AbpUi::Edit' | abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" [isEdit]=\"true\"></cms-create-or-edit-entries>\n </ng-container>\n </abp-page>\n</form>", styles: ["::ng-deep .edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .edit-entry-page .form-control,::ng-deep .edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .edit-entry-page .cursor-move{cursor:move}::ng-deep .edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"] }]
|
|
1153
|
-
}], ctorParameters: function () { return [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: EntryAdminService }, { type: i3$1.Router }, { type: i1.LocalizationService }]; }, propDecorators: { submitclick: [{
|
|
1154
|
-
type: ViewChild,
|
|
1155
|
-
args: ['submitclick', { static: true }]
|
|
1156
|
-
}] } });
|
|
1157
|
-
|
|
1158
|
-
class FieldAdminService {
|
|
1159
|
-
restService;
|
|
1160
|
-
apiName = 'CmsAdmin';
|
|
1161
|
-
create = (input, config) => this.restService.request({
|
|
1162
|
-
method: 'POST',
|
|
1163
|
-
url: '/api/cms-admin/fields',
|
|
1164
|
-
body: input,
|
|
1165
|
-
}, { apiName: this.apiName, ...config });
|
|
1166
|
-
delete = (id, config) => this.restService.request({
|
|
1167
|
-
method: 'DELETE',
|
|
1168
|
-
url: `/api/cms-admin/fields/${id}`,
|
|
1169
|
-
}, { apiName: this.apiName, ...config });
|
|
1170
|
-
get = (id, config) => this.restService.request({
|
|
1171
|
-
method: 'GET',
|
|
1172
|
-
url: `/api/cms-admin/fields/${id}`,
|
|
1173
|
-
}, { apiName: this.apiName, ...config });
|
|
1174
|
-
getList = (input, config) => this.restService.request({
|
|
1175
|
-
method: 'GET',
|
|
1176
|
-
url: '/api/cms-admin/fields',
|
|
1177
|
-
params: { filter: input.filter, groupId: input.groupId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
|
|
1178
|
-
}, { apiName: this.apiName, ...config });
|
|
1179
|
-
nameExists = (name, config) => this.restService.request({
|
|
1180
|
-
method: 'GET',
|
|
1181
|
-
url: `/api/cms-admin/fields/name-exists/${name}`,
|
|
1182
|
-
}, { apiName: this.apiName, ...config });
|
|
1183
|
-
update = (id, input, config) => this.restService.request({
|
|
1184
|
-
method: 'PUT',
|
|
1185
|
-
url: `/api/cms-admin/fields/${id}`,
|
|
1186
|
-
body: input,
|
|
1187
|
-
}, { apiName: this.apiName, ...config });
|
|
1188
|
-
constructor(restService) {
|
|
1189
|
-
this.restService = restService;
|
|
1190
|
-
}
|
|
1191
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1192
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldAdminService, providedIn: 'root' });
|
|
1193
|
-
}
|
|
1194
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldAdminService, decorators: [{
|
|
1195
|
-
type: Injectable,
|
|
1196
|
-
args: [{
|
|
1197
|
-
providedIn: 'root',
|
|
1198
|
-
}]
|
|
1199
|
-
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
1200
|
-
|
|
1201
|
-
class FieldGroupComponent {
|
|
1202
|
-
fb;
|
|
1203
|
-
_FieldGroupAdminService;
|
|
1204
|
-
toaster;
|
|
1205
|
-
confirmation;
|
|
1206
|
-
_FieldAbstractsService;
|
|
1207
|
-
_LocalizationService;
|
|
1208
|
-
constructor(fb, _FieldGroupAdminService, toaster, confirmation, _FieldAbstractsService, _LocalizationService) {
|
|
1209
|
-
this.fb = fb;
|
|
1210
|
-
this._FieldGroupAdminService = _FieldGroupAdminService;
|
|
1211
|
-
this.toaster = toaster;
|
|
1212
|
-
this.confirmation = confirmation;
|
|
1213
|
-
this._FieldAbstractsService = _FieldAbstractsService;
|
|
1214
|
-
this._LocalizationService = _LocalizationService;
|
|
1215
|
-
}
|
|
1216
|
-
/**创建分组表单 */
|
|
1217
|
-
createForm;
|
|
1218
|
-
/** 编辑分组表单*/
|
|
1219
|
-
editGroupForm;
|
|
1220
|
-
/**表单已存在的值 */
|
|
1221
|
-
selected = {};
|
|
1222
|
-
/**选择的字段分组id */
|
|
1223
|
-
fieldGroupId = '';
|
|
1224
|
-
/**创建分组模态框状态 */
|
|
1225
|
-
createGroupOpen = false;
|
|
1226
|
-
/**用于确定模态的繁忙状态是否为真 */
|
|
1227
|
-
modalBusy = false;
|
|
1228
|
-
/**编辑分组模态框状态 */
|
|
1229
|
-
editGroupOpen = false;
|
|
1230
|
-
/**点击分组回调 */
|
|
1231
|
-
OnGroupClickBack = new EventEmitter();
|
|
1232
|
-
ngOnInit() {
|
|
1233
|
-
this._FieldAbstractsService.getfieldGroupList();
|
|
1234
|
-
}
|
|
1235
|
-
/**创建字段分组 */
|
|
1236
|
-
createGroupBtn() {
|
|
1237
|
-
this.createGroupOpen = true;
|
|
1238
|
-
this.createForm = this.fb.group({
|
|
1239
|
-
name: ['', [Validators.required]],
|
|
1240
|
-
});
|
|
1241
|
-
}
|
|
1242
|
-
/**创建分组模态框状态改变 */
|
|
1243
|
-
createGroupVisibleChange(event) {
|
|
1244
|
-
if (!event) {
|
|
1245
|
-
return;
|
|
1246
|
-
}
|
|
1247
|
-
}
|
|
1248
|
-
/**编辑字段分组 */
|
|
1249
|
-
editGroupBtn(itemName) {
|
|
1250
|
-
this.editGroupOpen = true;
|
|
1251
|
-
this.editGroupForm = this.fb.group({
|
|
1252
|
-
name: [itemName, [Validators.required]],
|
|
1253
|
-
});
|
|
1254
|
-
}
|
|
1255
|
-
/**编辑分组模态框状态改变 */
|
|
1256
|
-
editGroupVisibleChange(event) {
|
|
1257
|
-
if (!event) {
|
|
1258
|
-
return;
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
/**创建字段分组保存 */
|
|
1262
|
-
createSave() {
|
|
1263
|
-
let input = this.createForm.value;
|
|
1264
|
-
this.modalBusy = true;
|
|
1265
|
-
this._FieldGroupAdminService.create(input).pipe(finalize(() => {
|
|
1266
|
-
this.modalBusy = false;
|
|
1267
|
-
this.createGroupOpen = false;
|
|
1268
|
-
})).subscribe(res => {
|
|
1269
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
1270
|
-
this._FieldAbstractsService.getfieldGroupList();
|
|
1271
|
-
});
|
|
1272
|
-
}
|
|
1273
|
-
/**编辑字段分组保存 */
|
|
1274
|
-
editSave() {
|
|
1275
|
-
let input = this.editGroupForm.value;
|
|
1276
|
-
this.modalBusy = true;
|
|
1277
|
-
this._FieldGroupAdminService.update(this.fieldGroupId, input).pipe(finalize(() => {
|
|
1278
|
-
this.modalBusy = false;
|
|
1279
|
-
this.editGroupOpen = false;
|
|
1280
|
-
})).subscribe(res => {
|
|
1281
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
1282
|
-
this._FieldAbstractsService.getfieldGroupList();
|
|
1283
|
-
});
|
|
1284
|
-
}
|
|
1285
|
-
/**删除字段分组1 */
|
|
1286
|
-
deleteGroupbtn(fieldGroupitem) {
|
|
1287
|
-
this.confirmation.warn(fieldGroupitem.name, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
|
|
1288
|
-
if (status == 'confirm') {
|
|
1289
|
-
this._FieldGroupAdminService.delete(this.fieldGroupId).pipe(finalize(() => {
|
|
1290
|
-
})).subscribe(res => {
|
|
1291
|
-
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1292
|
-
this.fieldGroupId = '';
|
|
1293
|
-
this._FieldAbstractsService.getfieldGroupList();
|
|
1294
|
-
});
|
|
1295
|
-
}
|
|
1296
|
-
});
|
|
1297
|
-
}
|
|
1298
|
-
/**字段分组改变 */
|
|
1299
|
-
fieldGroupChange(event) {
|
|
1300
|
-
this.fieldGroupId = event;
|
|
1301
|
-
this.OnGroupClickBack.emit(event);
|
|
1302
|
-
}
|
|
1303
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldGroupComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldGroupAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: FieldAbstractsService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1304
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FieldGroupComponent, selector: "cms-field-group", outputs: { OnGroupClickBack: "OnGroupClickBack" }, ngImport: i0, template: "<div class=\"card-header px-2 py-sm-2 d-flex justify-content-between align-items-center\">\n <h6 class=\"h6 mb-0\">{{'Cms::FieldGroup' | abpLocalization}}</h6>\n <button type=\"button\" class=\"btn btn-link btn-sm ms-2\"><i class=\"fas fa-plus-circle\" aria-hidden=\"true\"\n (click)=\"createGroupBtn()\"></i></button>\n</div>\n<div class=\"card-body p-0\">\n <div class=\"container-height overflow-auto\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item list-group-item-action active\" [class.active]=\"fieldGroupId===''\"\n (click)=\"fieldGroupChange('')\">{{'Cms::AllFields' | abpLocalization}}</li>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <li class=\"list-group-item list-group-item-action d-flex justify-content-between align-items-center\"\n [class.active]=\"fieldGroupId===item.id\" (click)=\"fieldGroupChange(item.id)\">\n <div>{{item.name}}</div>\n <div *ngIf=\"fieldGroupId===item.id\">\n <i class=\"fas fa-trash px-1\" role=\"button\" (click.stop)=\"deleteGroupbtn(item)\"></i>\n <i class=\"fas fa-edit px-1\" role=\"button\" (click.stop)=\"editGroupBtn(item.name)\"></i>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"createGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"createGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'Cms::New' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"createForm; else loaderRef\" [formGroup]=\"createForm\" (ngSubmit)=\"createSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"createForm?.invalid\" (click)=\"createSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n<abp-modal [(visible)]=\"editGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"editGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"editGroupForm; else loaderRef\" [formGroup]=\"editGroupForm\" (ngSubmit)=\"editSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"editGroupForm?.invalid\" (click)=\"editSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
1305
|
-
}
|
|
1306
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldGroupComponent, decorators: [{
|
|
1307
|
-
type: Component,
|
|
1308
|
-
args: [{ selector: 'cms-field-group', template: "<div class=\"card-header px-2 py-sm-2 d-flex justify-content-between align-items-center\">\n <h6 class=\"h6 mb-0\">{{'Cms::FieldGroup' | abpLocalization}}</h6>\n <button type=\"button\" class=\"btn btn-link btn-sm ms-2\"><i class=\"fas fa-plus-circle\" aria-hidden=\"true\"\n (click)=\"createGroupBtn()\"></i></button>\n</div>\n<div class=\"card-body p-0\">\n <div class=\"container-height overflow-auto\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item list-group-item-action active\" [class.active]=\"fieldGroupId===''\"\n (click)=\"fieldGroupChange('')\">{{'Cms::AllFields' | abpLocalization}}</li>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <li class=\"list-group-item list-group-item-action d-flex justify-content-between align-items-center\"\n [class.active]=\"fieldGroupId===item.id\" (click)=\"fieldGroupChange(item.id)\">\n <div>{{item.name}}</div>\n <div *ngIf=\"fieldGroupId===item.id\">\n <i class=\"fas fa-trash px-1\" role=\"button\" (click.stop)=\"deleteGroupbtn(item)\"></i>\n <i class=\"fas fa-edit px-1\" role=\"button\" (click.stop)=\"editGroupBtn(item.name)\"></i>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"createGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"createGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'Cms::New' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"createForm; else loaderRef\" [formGroup]=\"createForm\" (ngSubmit)=\"createSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"createForm?.invalid\" (click)=\"createSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n<abp-modal [(visible)]=\"editGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"editGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"editGroupForm; else loaderRef\" [formGroup]=\"editGroupForm\" (ngSubmit)=\"editSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"editGroupForm?.invalid\" (click)=\"editSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>" }]
|
|
1309
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: FieldGroupAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: FieldAbstractsService }, { type: i1.LocalizationService }]; }, propDecorators: { OnGroupClickBack: [{
|
|
1310
|
-
type: Output
|
|
1311
|
-
}] } });
|
|
1312
|
-
|
|
1313
|
-
class FieldsComponent {
|
|
1314
|
-
list;
|
|
1315
|
-
_FieldAdminService;
|
|
1316
|
-
toaster;
|
|
1317
|
-
confirmation;
|
|
1318
|
-
_LocalizationService;
|
|
1319
|
-
router;
|
|
1320
|
-
_CmsApiService;
|
|
1321
|
-
constructor(list, _FieldAdminService, toaster, confirmation, _LocalizationService, router, _CmsApiService) {
|
|
1322
|
-
this.list = list;
|
|
1323
|
-
this._FieldAdminService = _FieldAdminService;
|
|
1324
|
-
this.toaster = toaster;
|
|
1325
|
-
this.confirmation = confirmation;
|
|
1326
|
-
this._LocalizationService = _LocalizationService;
|
|
1327
|
-
this.router = router;
|
|
1328
|
-
this._CmsApiService = _CmsApiService;
|
|
1329
|
-
}
|
|
1330
|
-
_UpdateListService = inject(UpdateListService);
|
|
1331
|
-
/**表格单元格布局类型 */
|
|
1332
|
-
ColumnMode = ColumnMode;
|
|
1333
|
-
/**表格数据 */
|
|
1334
|
-
data = {
|
|
1335
|
-
items: [],
|
|
1336
|
-
totalCount: 0,
|
|
1337
|
-
};
|
|
1338
|
-
/**过滤器 */
|
|
1339
|
-
filters = {};
|
|
1340
|
-
ngOnInit() {
|
|
1341
|
-
this.hookToQuery();
|
|
1342
|
-
this._UpdateListService.updateListEvent.subscribe(() => {
|
|
1343
|
-
this.list.get();
|
|
1344
|
-
});
|
|
1345
|
-
}
|
|
1346
|
-
getData() {
|
|
1347
|
-
this.list.get();
|
|
1348
|
-
}
|
|
1349
|
-
/**字段分组选择回调 */
|
|
1350
|
-
fieldGroupChange(event) {
|
|
1351
|
-
this.filters.groupId = event;
|
|
1352
|
-
this.list.page = 0;
|
|
1353
|
-
this.list.get();
|
|
1354
|
-
}
|
|
1355
|
-
/**使用abp的list获取表格的字段数据列表 */
|
|
1356
|
-
hookToQuery() {
|
|
1357
|
-
const getData = (query) => this._FieldAdminService.getList({
|
|
1358
|
-
...query,
|
|
1359
|
-
...this.filters,
|
|
1360
|
-
});
|
|
1361
|
-
const setData = (list) => (this.data = list);
|
|
1362
|
-
this.list.hookToQuery(getData).subscribe(setData);
|
|
1363
|
-
}
|
|
1364
|
-
/**新建字段按钮 */
|
|
1365
|
-
toFieldsCreateBtn() {
|
|
1366
|
-
this.router.navigate(['/cms/admin/fields/create'], {
|
|
1367
|
-
queryParams: {}
|
|
1368
|
-
});
|
|
1369
|
-
}
|
|
1370
|
-
/**删除字段 */
|
|
1371
|
-
deletefield(row) {
|
|
1372
|
-
this.confirmation.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
|
|
1373
|
-
if (status == 'confirm') {
|
|
1374
|
-
this._FieldAdminService.delete(row.id).pipe(finalize(() => {
|
|
1375
|
-
})).subscribe(res => {
|
|
1376
|
-
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1377
|
-
this.list.get();
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
|
-
});
|
|
1381
|
-
}
|
|
1382
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldsComponent, deps: [{ token: i1.ListService }, { token: FieldAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1.LocalizationService }, { token: i3$1.Router }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1383
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FieldsComponent, selector: "cms-fields", providers: [
|
|
1384
|
-
// [Required]
|
|
1385
|
-
ListService,
|
|
1386
|
-
// [Optional]
|
|
1387
|
-
// Provide this token if you want a different debounce time.
|
|
1388
|
-
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
1389
|
-
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
1390
|
-
{
|
|
1391
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1392
|
-
useValue: ECmsComponent.Fields,
|
|
1393
|
-
},
|
|
1394
|
-
], ngImport: i0, template: "<abp-page [title]=\"'Cms::Fields' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"fields-page\">\n <div class=\"row \">\n <div class=\"col-3\">\n <div class=\"card mb-0\" style=\"height: 100%;\">\n <cms-field-group (OnGroupClickBack)=\"fieldGroupChange($event)\"></cms-field-group>\n </div>\n </div>\n <div class=\"col-9\">\n <div class=\"card mb-0\">\n <div class=\"card-header px-2 py-sm-2 border-bottom\">\n <div class=\"input-group\">\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\"\n (click)=\"list.get()\"><i class=\"fa fa-search\"></i></button>\n </div>\n </div>\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\"\n [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::FormControlName' | abpLocalization\"\n prop=\"formControlName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Group' | abpLocalization\" prop=\"groupId\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{row.groupName}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [width]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value|date:'YYYY/MM/dd HH:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\n cellClass=\"cellClassRight\" [frozenRight]=\"true\" [width]=\"110\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\"\n ngbDropdownToggle> <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}</button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n routerLink=\"/cms/admin/fields/{{row.id}}/edit\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"deletefield(row)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</abp-page>", styles: ["::ng-deep .fields-page .dignite_page{background:transparent}::ng-deep .fields-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .fields-page .container-height{height:calc(100vh - 200px)}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i8.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i8.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i8.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i3.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: FieldGroupComponent, selector: "cms-field-group", outputs: ["OnGroupClickBack"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
1395
|
-
}
|
|
1396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FieldsComponent, decorators: [{
|
|
1397
|
-
type: Component,
|
|
1398
|
-
args: [{ selector: 'cms-fields', providers: [
|
|
1399
|
-
// [Required]
|
|
1400
|
-
ListService,
|
|
1401
|
-
// [Optional]
|
|
1402
|
-
// Provide this token if you want a different debounce time.
|
|
1403
|
-
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
1404
|
-
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
1405
|
-
{
|
|
1406
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1407
|
-
useValue: ECmsComponent.Fields,
|
|
1408
|
-
},
|
|
1409
|
-
], template: "<abp-page [title]=\"'Cms::Fields' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"fields-page\">\n <div class=\"row \">\n <div class=\"col-3\">\n <div class=\"card mb-0\" style=\"height: 100%;\">\n <cms-field-group (OnGroupClickBack)=\"fieldGroupChange($event)\"></cms-field-group>\n </div>\n </div>\n <div class=\"col-9\">\n <div class=\"card mb-0\">\n <div class=\"card-header px-2 py-sm-2 border-bottom\">\n <div class=\"input-group\">\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\"\n (click)=\"list.get()\"><i class=\"fa fa-search\"></i></button>\n </div>\n </div>\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\"\n [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::FormControlName' | abpLocalization\"\n prop=\"formControlName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Group' | abpLocalization\" prop=\"groupId\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{row.groupName}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [width]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value|date:'YYYY/MM/dd HH:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\n cellClass=\"cellClassRight\" [frozenRight]=\"true\" [width]=\"110\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\"\n ngbDropdownToggle> <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}</button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n routerLink=\"/cms/admin/fields/{{row.id}}/edit\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"deletefield(row)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</abp-page>", styles: ["::ng-deep .fields-page .dignite_page{background:transparent}::ng-deep .fields-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .fields-page .container-height{height:calc(100vh - 200px)}\n"] }]
|
|
1410
|
-
}], ctorParameters: function () { return [{ type: i1.ListService }, { type: FieldAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1.LocalizationService }, { type: i3$1.Router }, { type: CmsApiService }]; } });
|
|
1411
|
-
|
|
1412
|
-
class CreateOrUpdateFieldInputBase {
|
|
1413
|
-
/**分组id */
|
|
1414
|
-
groupId = ['', []];
|
|
1415
|
-
/**字段名称 Display name of this field */
|
|
1416
|
-
displayName = ['', [Validators.required]];
|
|
1417
|
-
/**字段唯一名称 Unique Name*/
|
|
1418
|
-
name = ['', [Validators.required]];
|
|
1419
|
-
/**描述 说明 */
|
|
1420
|
-
description = ['', []];
|
|
1421
|
-
/**FieldType字段类型 表单控件名称 */
|
|
1422
|
-
formControlName = [undefined, [Validators.required]];
|
|
1423
|
-
/**动态表单配置 */
|
|
1424
|
-
formConfiguration = new FormGroup({});
|
|
1425
|
-
constructor(data) {
|
|
1426
|
-
if (data) {
|
|
1427
|
-
for (const key in data) {
|
|
1428
|
-
if (data.hasOwnProperty(key)) {
|
|
1429
|
-
this[key] = data[key];
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
class CreateOrEditFieldComponent {
|
|
1437
|
-
_FieldAbstractsService;
|
|
1438
|
-
_CmsApiService;
|
|
1439
|
-
_FieldAdminService;
|
|
1440
|
-
_LocalizationService;
|
|
1441
|
-
/**表单控件模板-动态表单配置组件 */
|
|
1442
|
-
FormDynamicRef;
|
|
1443
|
-
constructor(_FieldAbstractsService, _CmsApiService, _FieldAdminService, _LocalizationService) {
|
|
1444
|
-
this._FieldAbstractsService = _FieldAbstractsService;
|
|
1445
|
-
this._CmsApiService = _CmsApiService;
|
|
1446
|
-
this._FieldAdminService = _FieldAdminService;
|
|
1447
|
-
this._LocalizationService = _LocalizationService;
|
|
1448
|
-
if (this._FieldAbstractsService.fieldGroupList.length == 0) {
|
|
1449
|
-
this._FieldAbstractsService.getfieldGroupList();
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
/**表单实体 */
|
|
1453
|
-
_Entity;
|
|
1454
|
-
set Entity(v) {
|
|
1455
|
-
if (v) {
|
|
1456
|
-
this._Entity = v;
|
|
1457
|
-
this.dataLoaded();
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
get formControlName() {
|
|
1461
|
-
return this._Entity.get('formControlName');
|
|
1462
|
-
}
|
|
1463
|
-
/**选择的表单信息 */
|
|
1464
|
-
_selected_copy;
|
|
1465
|
-
_selected;
|
|
1466
|
-
set selected(v) {
|
|
1467
|
-
if (v) {
|
|
1468
|
-
this._selected = v || '';
|
|
1469
|
-
this._selected_copy = v;
|
|
1470
|
-
this.dataLoaded();
|
|
1471
|
-
}
|
|
1472
|
-
}
|
|
1473
|
-
async dataLoaded() {
|
|
1474
|
-
if (this._FieldAbstractsService.fromControlList.length == 0) {
|
|
1475
|
-
await this._FieldAbstractsService.getFromControlList();
|
|
1476
|
-
}
|
|
1477
|
-
if (this._Entity) {
|
|
1478
|
-
if (!this.formControlName.value) {
|
|
1479
|
-
this._Entity.patchValue({
|
|
1480
|
-
formControlName: this._FieldAbstractsService.fromControlList[0]?.name,
|
|
1481
|
-
});
|
|
1482
|
-
}
|
|
1483
|
-
this._Entity.setControl('name', new FormControl(this.nameInput.value || '', {
|
|
1484
|
-
validators: Validators.required,
|
|
1485
|
-
asyncValidators: [this.repetitionAsyncValidator()],
|
|
1486
|
-
updateOn: 'blur'
|
|
1487
|
-
}));
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
/**name表单控件 */
|
|
1491
|
-
get nameInput() {
|
|
1492
|
-
return this._Entity.get('name');
|
|
1493
|
-
}
|
|
1494
|
-
nameInputBlur(event) {
|
|
1495
|
-
let value = event.target.value;
|
|
1496
|
-
this.nameInput.patchValue(value);
|
|
1497
|
-
}
|
|
1498
|
-
/**字段标签input失去标点生成字段名字 */
|
|
1499
|
-
disPlayNameInputBlur(event) {
|
|
1500
|
-
let value = event.target.value;
|
|
1501
|
-
let pinyin = this._CmsApiService.chineseToPinyin(value);
|
|
1502
|
-
let nameInput = this.nameInput;
|
|
1503
|
-
if (nameInput.value)
|
|
1504
|
-
return;
|
|
1505
|
-
nameInput.patchValue(pinyin);
|
|
1506
|
-
}
|
|
1507
|
-
/**定义异步验证方法 */
|
|
1508
|
-
repetitionAsyncValidator() {
|
|
1509
|
-
return (ctrl) => {
|
|
1510
|
-
return new Promise(resolve => {
|
|
1511
|
-
if (ctrl.value == this._selected?.name || !ctrl.value) {
|
|
1512
|
-
resolve(null);
|
|
1513
|
-
return;
|
|
1514
|
-
}
|
|
1515
|
-
this._FieldAdminService.nameExists(ctrl.value).subscribe(res => {
|
|
1516
|
-
if (res) {
|
|
1517
|
-
resolve({ repetition: this._LocalizationService.instant(`Cms::FieldName{0}AlreadyExist`, ctrl.value) });
|
|
1518
|
-
}
|
|
1519
|
-
else {
|
|
1520
|
-
resolve(null);
|
|
1521
|
-
}
|
|
1522
|
-
});
|
|
1523
|
-
});
|
|
1524
|
-
};
|
|
1525
|
-
}
|
|
1526
|
-
formControlNameChange() {
|
|
1527
|
-
}
|
|
1528
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateOrEditFieldComponent, deps: [{ token: FieldAbstractsService }, { token: CmsApiService }, { token: FieldAdminService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1529
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CreateOrEditFieldComponent, selector: "cms-create-or-edit-field", inputs: { Entity: "Entity", selected: "selected" }, viewQueries: [{ propertyName: "FormDynamicRef", first: true, predicate: ["FormDynamicRef"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"groupId\">{{'Cms::FieldGroup' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"groupId\">\n <option value=\"\">{{'Cms::OptionalGrouping' | abpLocalization}}</option>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <option [value]=\"item.id\">{{item.name}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'DigniteAbpForms::FieldDisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" (blur)=\"disPlayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" (input)=\"nameInputBlur($event)\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">{{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"formControlNameChange()\">\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fromControlList;let i =index\">\n <option [value]=\"item.name\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"_Entity.value.formControlName&&_Entity\"> \n <df-dynamic [type]=\"_Entity.value.formControlName\" [entity]=\"_Entity\" [selected]=\"_selected\"></df-dynamic>\n </ng-container>\n\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i8$1.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
1530
|
-
}
|
|
1531
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateOrEditFieldComponent, decorators: [{
|
|
1532
|
-
type: Component,
|
|
1533
|
-
args: [{ selector: 'cms-create-or-edit-field', template: "<form [formGroup]=\"_Entity\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"groupId\">{{'Cms::FieldGroup' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"groupId\">\n <option value=\"\">{{'Cms::OptionalGrouping' | abpLocalization}}</option>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <option [value]=\"item.id\">{{item.name}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'DigniteAbpForms::FieldDisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" (blur)=\"disPlayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" (input)=\"nameInputBlur($event)\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">{{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"formControlNameChange()\">\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fromControlList;let i =index\">\n <option [value]=\"item.name\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"_Entity.value.formControlName&&_Entity\"> \n <df-dynamic [type]=\"_Entity.value.formControlName\" [entity]=\"_Entity\" [selected]=\"_selected\"></df-dynamic>\n </ng-container>\n\n</form>" }]
|
|
1534
|
-
}], ctorParameters: function () { return [{ type: FieldAbstractsService }, { type: CmsApiService }, { type: FieldAdminService }, { type: i1.LocalizationService }]; }, propDecorators: { FormDynamicRef: [{
|
|
1535
|
-
type: ViewChild,
|
|
1536
|
-
args: ['FormDynamicRef', { read: ViewContainerRef, static: true }]
|
|
1537
|
-
}], Entity: [{
|
|
1538
|
-
type: Input
|
|
1539
|
-
}], selected: [{
|
|
1540
|
-
type: Input
|
|
1541
|
-
}] } });
|
|
1542
|
-
|
|
1543
|
-
class CreateFieldComponent {
|
|
1544
|
-
fb;
|
|
1545
|
-
_FieldAdminService;
|
|
1546
|
-
toaster;
|
|
1547
|
-
_location;
|
|
1548
|
-
_LocalizationService;
|
|
1549
|
-
_CmsApiService;
|
|
1550
|
-
router;
|
|
1551
|
-
constructor(fb, _FieldAdminService, toaster, _location, _LocalizationService, _CmsApiService, router) {
|
|
1552
|
-
this.fb = fb;
|
|
1553
|
-
this._FieldAdminService = _FieldAdminService;
|
|
1554
|
-
this.toaster = toaster;
|
|
1555
|
-
this._location = _location;
|
|
1556
|
-
this._LocalizationService = _LocalizationService;
|
|
1557
|
-
this._CmsApiService = _CmsApiService;
|
|
1558
|
-
this.router = router;
|
|
1559
|
-
}
|
|
1560
|
-
_UpdateListService = inject(UpdateListService);
|
|
1561
|
-
/**表单实体 */
|
|
1562
|
-
newEntity;
|
|
1563
|
-
/**获取提交按钮替身,用于真实触发表单提交 */
|
|
1564
|
-
submitclick;
|
|
1565
|
-
ngOnInit() {
|
|
1566
|
-
//Called after the constructor, initializing input properties, and the first call to ngOnChanges.
|
|
1567
|
-
//Add 'implements OnInit' to the class.
|
|
1568
|
-
this.newEntity = this.fb.group(new CreateOrUpdateFieldInputBase());
|
|
1569
|
-
}
|
|
1570
|
-
/**触发提交按钮 */
|
|
1571
|
-
submitclickBtn() {
|
|
1572
|
-
this.submitclick.nativeElement.click();
|
|
1573
|
-
}
|
|
1574
|
-
/**保存表单 */
|
|
1575
|
-
save() {
|
|
1576
|
-
let input = this.newEntity.value;
|
|
1577
|
-
if (!this.newEntity.valid)
|
|
1578
|
-
return;
|
|
1579
|
-
this._FieldAdminService.create(input).subscribe(res => {
|
|
1580
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
1581
|
-
this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
|
|
1582
|
-
this.router.navigate([`/cms/admin/fields`]);
|
|
1583
|
-
this._UpdateListService.updateList();
|
|
1584
|
-
});
|
|
1585
|
-
});
|
|
1586
|
-
}
|
|
1587
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateFieldComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldAdminService }, { token: i3.ToasterService }, { token: i2.Location }, { token: i1.LocalizationService }, { token: CmsApiService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
1588
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CreateFieldComponent, selector: "cms-create-field", providers: [
|
|
1589
|
-
{
|
|
1590
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1591
|
-
useValue: ECmsComponent.FieldsCreate,
|
|
1592
|
-
},
|
|
1593
|
-
], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save()\">\n <abp-page [title]=\"'Cms::CreateField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card\">\n <div class=\"card-body\">\n <cms-create-or-edit-field [Entity]=\"newEntity\"></cms-create-or-edit-field>\n </div>\n </div>\n </div>\n </abp-page>\n</form>", styles: ["::ng-deep .create-field-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-field-page .form-control,::ng-deep .create-field-page .form-select{padding:.475rem 1.25rem}\n"], dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditFieldComponent, selector: "cms-create-or-edit-field", inputs: ["Entity", "selected"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
1594
|
-
}
|
|
1595
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateFieldComponent, decorators: [{
|
|
1596
|
-
type: Component,
|
|
1597
|
-
args: [{ selector: 'cms-create-field', providers: [
|
|
1598
|
-
{
|
|
1599
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1600
|
-
useValue: ECmsComponent.FieldsCreate,
|
|
1601
|
-
},
|
|
1602
|
-
], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save()\">\n <abp-page [title]=\"'Cms::CreateField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card\">\n <div class=\"card-body\">\n <cms-create-or-edit-field [Entity]=\"newEntity\"></cms-create-or-edit-field>\n </div>\n </div>\n </div>\n </abp-page>\n</form>", styles: ["::ng-deep .create-field-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-field-page .form-control,::ng-deep .create-field-page .form-select{padding:.475rem 1.25rem}\n"] }]
|
|
1603
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: FieldAdminService }, { type: i3.ToasterService }, { type: i2.Location }, { type: i1.LocalizationService }, { type: CmsApiService }, { type: i3$1.Router }]; }, propDecorators: { submitclick: [{
|
|
1604
|
-
type: ViewChild,
|
|
1605
|
-
args: ['submitclick', { static: true }]
|
|
1606
|
-
}] } });
|
|
1607
|
-
|
|
1608
|
-
class EditFieldComponent {
|
|
1609
|
-
fb;
|
|
1610
|
-
_FieldAbstractsService;
|
|
1611
|
-
_FieldAdminService;
|
|
1612
|
-
route;
|
|
1613
|
-
toaster;
|
|
1614
|
-
_location;
|
|
1615
|
-
_LocalizationService;
|
|
1616
|
-
_CmsApiService;
|
|
1617
|
-
router;
|
|
1618
|
-
constructor(fb, _FieldAbstractsService, _FieldAdminService, route, toaster, _location, _LocalizationService, _CmsApiService, router) {
|
|
1619
|
-
this.fb = fb;
|
|
1620
|
-
this._FieldAbstractsService = _FieldAbstractsService;
|
|
1621
|
-
this._FieldAdminService = _FieldAdminService;
|
|
1622
|
-
this.route = route;
|
|
1623
|
-
this.toaster = toaster;
|
|
1624
|
-
this._location = _location;
|
|
1625
|
-
this._LocalizationService = _LocalizationService;
|
|
1626
|
-
this._CmsApiService = _CmsApiService;
|
|
1627
|
-
this.router = router;
|
|
1628
|
-
}
|
|
1629
|
-
/**表单实体 */
|
|
1630
|
-
newEntity;
|
|
1631
|
-
/**字段id */
|
|
1632
|
-
fieldId = '';
|
|
1633
|
-
/**字段详情 */
|
|
1634
|
-
fieldDetails;
|
|
1635
|
-
/**获取提交按钮替身,用于真实触发表单提交 */
|
|
1636
|
-
submitclick;
|
|
1637
|
-
async ngOnInit() {
|
|
1638
|
-
const _fieldId = this.route.snapshot.params.id;
|
|
1639
|
-
if (_fieldId) {
|
|
1640
|
-
this.fieldId = _fieldId;
|
|
1641
|
-
this.newEntity = this.fb.group(new CreateOrUpdateFieldInputBase());
|
|
1642
|
-
await Promise.all([
|
|
1643
|
-
this._FieldAbstractsService.getFromControlList(),
|
|
1644
|
-
this.getFieldEdit(),
|
|
1645
|
-
]);
|
|
1646
|
-
this.newEntity.patchValue({
|
|
1647
|
-
...this.fieldDetails,
|
|
1648
|
-
});
|
|
1649
|
-
}
|
|
1650
|
-
}
|
|
1651
|
-
/**获取字段详情 */
|
|
1652
|
-
getFieldEdit() {
|
|
1653
|
-
return new Promise((resolve, reject) => {
|
|
1654
|
-
this._FieldAdminService.get(this.fieldId).subscribe(res => {
|
|
1655
|
-
res.groupId = res.groupId ? res.groupId : '';
|
|
1656
|
-
this.fieldDetails = res;
|
|
1657
|
-
resolve(res);
|
|
1658
|
-
});
|
|
1659
|
-
});
|
|
1660
|
-
}
|
|
1661
|
-
/**触发提交按钮 */
|
|
1662
|
-
submitclickBtn() {
|
|
1663
|
-
this.submitclick.nativeElement.click();
|
|
1664
|
-
}
|
|
1665
|
-
_UpdateListService = inject(UpdateListService);
|
|
1666
|
-
/**保存表单 */
|
|
1667
|
-
save() {
|
|
1668
|
-
let input = this.newEntity.value;
|
|
1669
|
-
if (!this.newEntity.valid)
|
|
1670
|
-
return;
|
|
1671
|
-
this._FieldAdminService.update(this.fieldId, input).subscribe((res => {
|
|
1672
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
1673
|
-
this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
|
|
1674
|
-
this.router.navigate([`/cms/admin/fields`]);
|
|
1675
|
-
this._UpdateListService.updateList();
|
|
1676
|
-
});
|
|
1677
|
-
}));
|
|
1678
|
-
}
|
|
1679
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditFieldComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldAbstractsService }, { token: FieldAdminService }, { token: i3$1.ActivatedRoute }, { token: i3.ToasterService }, { token: i2.Location }, { token: i1.LocalizationService }, { token: CmsApiService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
1680
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EditFieldComponent, selector: "cms-edit-field", providers: [
|
|
1681
|
-
{
|
|
1682
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1683
|
-
useValue: ECmsComponent.FieldsEdit,
|
|
1684
|
-
},
|
|
1685
|
-
], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save()\">\n <abp-page [title]=\"'Cms::EditField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <!-- <div class=\"p-3 bg-white rounded-1\"> -->\n <div class=\"card\">\n <div class=\"card-body\">\n <cms-create-or-edit-field [Entity]=\"newEntity\" [selected]=\"fieldDetails\"></cms-create-or-edit-field>\n </div>\n </div>\n </div>\n </abp-page>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditFieldComponent, selector: "cms-create-or-edit-field", inputs: ["Entity", "selected"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
1686
|
-
}
|
|
1687
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditFieldComponent, decorators: [{
|
|
1688
|
-
type: Component,
|
|
1689
|
-
args: [{ selector: 'cms-edit-field', providers: [
|
|
1690
|
-
{
|
|
1691
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1692
|
-
useValue: ECmsComponent.FieldsEdit,
|
|
1693
|
-
},
|
|
1694
|
-
], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save()\">\n <abp-page [title]=\"'Cms::EditField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <!-- <div class=\"p-3 bg-white rounded-1\"> -->\n <div class=\"card\">\n <div class=\"card-body\">\n <cms-create-or-edit-field [Entity]=\"newEntity\" [selected]=\"fieldDetails\"></cms-create-or-edit-field>\n </div>\n </div>\n </div>\n </abp-page>\n</form>" }]
|
|
1695
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: FieldAbstractsService }, { type: FieldAdminService }, { type: i3$1.ActivatedRoute }, { type: i3.ToasterService }, { type: i2.Location }, { type: i1.LocalizationService }, { type: CmsApiService }, { type: i3$1.Router }]; }, propDecorators: { submitclick: [{
|
|
1696
|
-
type: ViewChild,
|
|
1697
|
-
args: ['submitclick', { static: true }]
|
|
1698
|
-
}] } });
|
|
1699
|
-
|
|
1700
|
-
class SitesComponent {
|
|
1701
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SitesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1702
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SitesComponent, selector: "cms-sites", providers: [
|
|
1703
|
-
ListService,
|
|
1704
|
-
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
1705
|
-
{
|
|
1706
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1707
|
-
useValue: ECmsComponent.Sites,
|
|
1708
|
-
},
|
|
1709
|
-
], ngImport: i0, template: "<!-- <abp-page [title]=\"'Cms::Sites' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"sites-page\">\n <div class=\"card\">\n <div class=\"card-body px-2 py-sm-2 border-bottom\">\n <div class=\"input-group\">\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"list.get()\">\n <i class=\"fa fa-search\"></i>\n </button>\n </div>\n </div>\n </div>\n <div class=\"card mb-0\">\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material container-height\" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"'force'\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [scrollbarV]=\"true\" [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsActive' | abpLocalization\" prop=\"isActive\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Host' | abpLocalization\" prop=\"host\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'yyyy-MM-dd hh:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-outline-primary btn-sm\" ngbDropdownToggle>\n {{'AbpUi::Actions' | abpLocalization}}\n </button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n (click)=\"EditSitesBtn(row)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click)=\"deletefield(row)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n</abp-page>\n<abp-modal [(visible)]=\"createSitesOpen\" [busy]=\"modalBusy\" (visibleChange)=\"createGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{selected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"createOrEditForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"createOrEditForm\"\n (ngSubmit)=\"createOrEditSave()\">\n <button type=\"submit\" #createModalSubmit style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Host' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"host\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"hostInput.errors?.repetition\">\n {{hostInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isActive\"\n id=\"flexRadioDefault1\" />\n <label class=\"form-check-label\" for=\"flexRadioDefault1\"> {{'Cms::IsActive' | abpLocalization}}\n </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Languages' | abpLocalization}}</label>\n <ul class=\"list-group list-group-flush\">\n <ng-container *ngFor=\"let item of languages; let i = index\">\n <li class=\"list-group-item d-flex justify-content-between align-items-center\">\n <div>\n <input class=\"form-check-input me-1\" type=\"checkbox\" [value]=\"item.cultureName\"\n id=\"firstRadio{{ i }}\" [checked]=\"item.ischecked\"\n (change)=\"languagesChange($event);!item.ischecked\" />\n <label class=\"form-check-label\" for=\"firstRadio{{ i }}\">{{ item.displayName\n }}</label>\n </div>\n <ng-container *ngIf=\"item.ischecked\">\n <div class=\"text-primary\" *ngIf=\"item.isDefault\">{{'Cms::Default' | abpLocalization}}\n </div>\n <div (click.stop)=\"setDefault(item)\" *ngIf=\"!item.isDefault\">\n {{'Cms::SetDefault' | abpLocalization}}</div>\n </ng-container>\n </li>\n </ng-container>\n </ul>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"createModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal> -->", styles: ["::ng-deep .sites-page .dignite_page{background:transparent}::ng-deep .sites-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sites-page .container-height{height:calc(100vh - 220px)}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"] });
|
|
1710
|
-
}
|
|
1711
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SitesComponent, decorators: [{
|
|
1712
|
-
type: Component,
|
|
1713
|
-
args: [{ selector: 'cms-sites', providers: [
|
|
1714
|
-
ListService,
|
|
1715
|
-
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
1716
|
-
{
|
|
1717
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
1718
|
-
useValue: ECmsComponent.Sites,
|
|
1719
|
-
},
|
|
1720
|
-
], template: "<!-- <abp-page [title]=\"'Cms::Sites' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"sites-page\">\n <div class=\"card\">\n <div class=\"card-body px-2 py-sm-2 border-bottom\">\n <div class=\"input-group\">\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"list.get()\">\n <i class=\"fa fa-search\"></i>\n </button>\n </div>\n </div>\n </div>\n <div class=\"card mb-0\">\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material container-height\" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"'force'\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [scrollbarV]=\"true\" [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsActive' | abpLocalization\" prop=\"isActive\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Host' | abpLocalization\" prop=\"host\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'yyyy-MM-dd hh:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-outline-primary btn-sm\" ngbDropdownToggle>\n {{'AbpUi::Actions' | abpLocalization}}\n </button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n (click)=\"EditSitesBtn(row)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click)=\"deletefield(row)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n</abp-page>\n<abp-modal [(visible)]=\"createSitesOpen\" [busy]=\"modalBusy\" (visibleChange)=\"createGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{selected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"createOrEditForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"createOrEditForm\"\n (ngSubmit)=\"createOrEditSave()\">\n <button type=\"submit\" #createModalSubmit style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Host' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"host\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"hostInput.errors?.repetition\">\n {{hostInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isActive\"\n id=\"flexRadioDefault1\" />\n <label class=\"form-check-label\" for=\"flexRadioDefault1\"> {{'Cms::IsActive' | abpLocalization}}\n </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Languages' | abpLocalization}}</label>\n <ul class=\"list-group list-group-flush\">\n <ng-container *ngFor=\"let item of languages; let i = index\">\n <li class=\"list-group-item d-flex justify-content-between align-items-center\">\n <div>\n <input class=\"form-check-input me-1\" type=\"checkbox\" [value]=\"item.cultureName\"\n id=\"firstRadio{{ i }}\" [checked]=\"item.ischecked\"\n (change)=\"languagesChange($event);!item.ischecked\" />\n <label class=\"form-check-label\" for=\"firstRadio{{ i }}\">{{ item.displayName\n }}</label>\n </div>\n <ng-container *ngIf=\"item.ischecked\">\n <div class=\"text-primary\" *ngIf=\"item.isDefault\">{{'Cms::Default' | abpLocalization}}\n </div>\n <div (click.stop)=\"setDefault(item)\" *ngIf=\"!item.isDefault\">\n {{'Cms::SetDefault' | abpLocalization}}</div>\n </ng-container>\n </li>\n </ng-container>\n </ul>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"createModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal> -->", styles: ["::ng-deep .sites-page .dignite_page{background:transparent}::ng-deep .sites-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sites-page .container-height{height:calc(100vh - 220px)}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"] }]
|
|
1721
|
-
}] });
|
|
1722
|
-
|
|
1723
|
-
class CreateOrUpdateSitesInputBase {
|
|
1724
|
-
displayName = ['', [Validators.required]];
|
|
1725
|
-
name = ['', [Validators.required]];
|
|
1726
|
-
host = ['https://', [Validators.required]];
|
|
1727
|
-
isActive = [true, []];
|
|
1728
|
-
languages = [[], [Validators.required]];
|
|
1729
|
-
constructor(data) {
|
|
1730
|
-
if (data) {
|
|
1731
|
-
for (const key in data) {
|
|
1732
|
-
if (data.hasOwnProperty(key)) {
|
|
1733
|
-
this[key] = data[key];
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
}
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
|
|
1740
|
-
class CreateOrUpdateSectionsInputBase {
|
|
1741
|
-
/**版块类型 */
|
|
1742
|
-
type = [0, [Validators.required]];
|
|
1743
|
-
/**字段名称 Display name of this field */
|
|
1744
|
-
displayName = ['', [Validators.required]];
|
|
1745
|
-
/**字段唯一名称 Unique Name*/
|
|
1746
|
-
name = ['', [Validators.required]];
|
|
1747
|
-
/**条目路由 */
|
|
1748
|
-
route = ['', [Validators.required]];
|
|
1749
|
-
/**页面模板 */
|
|
1750
|
-
template = ['', [Validators.required]];
|
|
1751
|
-
/**是否默认 */
|
|
1752
|
-
isDefault = [false, []];
|
|
1753
|
-
/**是否激活 */
|
|
1754
|
-
isActive = [true, []];
|
|
1755
|
-
constructor(data) {
|
|
1756
|
-
if (data) {
|
|
1757
|
-
for (const key in data) {
|
|
1758
|
-
if (data.hasOwnProperty(key)) {
|
|
1759
|
-
this[key] = data[key];
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
var SectionType;
|
|
1767
|
-
(function (SectionType) {
|
|
1768
|
-
SectionType[SectionType["Single"] = 0] = "Single";
|
|
1769
|
-
SectionType[SectionType["Structure"] = 1] = "Structure";
|
|
1770
|
-
SectionType[SectionType["Channel"] = 2] = "Channel";
|
|
1771
|
-
})(SectionType || (SectionType = {}));
|
|
1772
|
-
const sectionTypeOptions = mapEnumToOptions(SectionType);
|
|
1773
|
-
|
|
1774
|
-
class SectionsComponent {
|
|
1775
|
-
list;
|
|
1776
|
-
_SectionAdminService;
|
|
1777
|
-
toaster;
|
|
1778
|
-
confirmation;
|
|
1779
|
-
fb;
|
|
1780
|
-
_EntryTypeAdminService;
|
|
1781
|
-
_LocalizationService;
|
|
1782
|
-
_CmsApiService;
|
|
1783
|
-
router;
|
|
1784
|
-
constructor(list, _SectionAdminService,
|
|
1785
|
-
// private _SiteAdminService: SiteAdminService,
|
|
1786
|
-
toaster, confirmation, fb, _EntryTypeAdminService, _LocalizationService, _CmsApiService, router) {
|
|
1787
|
-
this.list = list;
|
|
1788
|
-
this._SectionAdminService = _SectionAdminService;
|
|
1789
|
-
this.toaster = toaster;
|
|
1790
|
-
this.confirmation = confirmation;
|
|
1791
|
-
this.fb = fb;
|
|
1792
|
-
this._EntryTypeAdminService = _EntryTypeAdminService;
|
|
1793
|
-
this._LocalizationService = _LocalizationService;
|
|
1794
|
-
this._CmsApiService = _CmsApiService;
|
|
1795
|
-
this.router = router;
|
|
1796
|
-
}
|
|
1797
|
-
_UpdateListService = inject(UpdateListService);
|
|
1798
|
-
/**跳转编辑 */
|
|
1799
|
-
jumpSectionsEdit(row, item) {
|
|
1800
|
-
this.router.navigate([`/cms/admin/sections/${row.id}/entry-types/${item.id}/edit`], {});
|
|
1801
|
-
}
|
|
1802
|
-
/**跳转新建 */
|
|
1803
|
-
jumpSectionsCreate(row) {
|
|
1804
|
-
this.router.navigate([`/cms/admin/sections/${row.id}/entry-types/create`], {});
|
|
1805
|
-
}
|
|
1806
|
-
/**版块列表 */
|
|
1807
|
-
siteList = [];
|
|
1808
|
-
/*** */
|
|
1809
|
-
ColumnMode = ColumnMode;
|
|
1810
|
-
data = {
|
|
1811
|
-
items: [],
|
|
1812
|
-
totalCount: 0,
|
|
1813
|
-
};
|
|
1814
|
-
/** */
|
|
1815
|
-
filters = {};
|
|
1816
|
-
/**获取页面列表 */
|
|
1817
|
-
hookToQuery() {
|
|
1818
|
-
const getData = (query) => this._SectionAdminService.getList({
|
|
1819
|
-
...query,
|
|
1820
|
-
...this.filters,
|
|
1821
|
-
});
|
|
1822
|
-
const setData = (list) => (this.data = list);
|
|
1823
|
-
this.list.hookToQuery(getData).subscribe(setData);
|
|
1824
|
-
}
|
|
1825
|
-
async ngOnInit() {
|
|
1826
|
-
this.hookToQuery();
|
|
1827
|
-
this._UpdateListService.updateListEvent.subscribe(() => {
|
|
1828
|
-
this.list.get();
|
|
1829
|
-
});
|
|
1830
|
-
}
|
|
1831
|
-
/**站点切换 */
|
|
1832
|
-
siteIdChange() {
|
|
1833
|
-
this.list.page = 0;
|
|
1834
|
-
this.list.get();
|
|
1835
|
-
}
|
|
1836
|
-
/**创建版块模态框状态 */
|
|
1837
|
-
visibleOpen = false;
|
|
1838
|
-
/**用于确定模态的繁忙状态是否为真 */
|
|
1839
|
-
modalBusy = false;
|
|
1840
|
-
/**创建版块表单 */
|
|
1841
|
-
createOrEditForm;
|
|
1842
|
-
/**版块给定的表单值 */
|
|
1843
|
-
selected;
|
|
1844
|
-
_SectionType = SectionType;
|
|
1845
|
-
_sectionTypeOptions = sectionTypeOptions;
|
|
1846
|
-
/**表单控件模板-动态赋值表单控件 */
|
|
1847
|
-
createOrEditModalSubmitBtn;
|
|
1848
|
-
/**创建版块模态框状态改变 */
|
|
1849
|
-
VisibleChange(event) {
|
|
1850
|
-
if (!event) {
|
|
1851
|
-
this.selected = '';
|
|
1852
|
-
return;
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
/**创建版块,打开模态框 */
|
|
1856
|
-
createSectionBtn() {
|
|
1857
|
-
this.visibleOpen = true;
|
|
1858
|
-
this.createOrEditForm = this.fb.group(new CreateOrUpdateSectionsInputBase());
|
|
1859
|
-
this.setAsyncValidatorsFn();
|
|
1860
|
-
}
|
|
1861
|
-
/**编辑版块,打开模态框 */
|
|
1862
|
-
editSectionBtn(row) {
|
|
1863
|
-
this.visibleOpen = true;
|
|
1864
|
-
this.createOrEditForm = this.fb.group(new CreateOrUpdateSectionsInputBase());
|
|
1865
|
-
this.setAsyncValidatorsFn();
|
|
1866
|
-
this._SectionAdminService.get(row.id).subscribe(res => {
|
|
1867
|
-
this.createOrEditForm.patchValue(res);
|
|
1868
|
-
this.selected = res;
|
|
1869
|
-
});
|
|
1870
|
-
}
|
|
1871
|
-
/**删除某个条目类型 */
|
|
1872
|
-
deleteEntryType(row) {
|
|
1873
|
-
this.confirmation
|
|
1874
|
-
.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`))
|
|
1875
|
-
.subscribe((status) => {
|
|
1876
|
-
if (status == 'confirm') {
|
|
1877
|
-
this._EntryTypeAdminService
|
|
1878
|
-
.delete(row.id)
|
|
1879
|
-
.pipe(finalize(() => { }))
|
|
1880
|
-
.subscribe(res => {
|
|
1881
|
-
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1882
|
-
this.list.get();
|
|
1883
|
-
});
|
|
1884
|
-
}
|
|
1885
|
-
});
|
|
1886
|
-
}
|
|
1887
|
-
/**表单保存提交 */
|
|
1888
|
-
createOrEditSave() {
|
|
1889
|
-
if (this.selected) {
|
|
1890
|
-
return this.EditSave();
|
|
1891
|
-
}
|
|
1892
|
-
this.createSave();
|
|
1893
|
-
}
|
|
1894
|
-
/** */
|
|
1895
|
-
createSave() {
|
|
1896
|
-
let input = this.createOrEditForm.value;
|
|
1897
|
-
// input.siteId = this.filters.siteId;
|
|
1898
|
-
if (!this.createOrEditForm.valid)
|
|
1899
|
-
return;
|
|
1900
|
-
this.modalBusy = true;
|
|
1901
|
-
this._SectionAdminService
|
|
1902
|
-
.create(input)
|
|
1903
|
-
.pipe(finalize(() => {
|
|
1904
|
-
this.modalBusy = false;
|
|
1905
|
-
this.visibleOpen = false;
|
|
1906
|
-
}))
|
|
1907
|
-
.subscribe(res => {
|
|
1908
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
1909
|
-
this.list.get();
|
|
1910
|
-
});
|
|
1911
|
-
}
|
|
1912
|
-
/**创建版块保存 */
|
|
1913
|
-
EditSave() {
|
|
1914
|
-
let input = this.createOrEditForm.value;
|
|
1915
|
-
// input.siteId = this.filters.siteId;
|
|
1916
|
-
input.concurrencyStamp = this.selected.concurrencyStamp;
|
|
1917
|
-
if (!this.createOrEditForm.valid)
|
|
1918
|
-
return;
|
|
1919
|
-
this.modalBusy = true;
|
|
1920
|
-
this._SectionAdminService
|
|
1921
|
-
.update(this.selected.id, input)
|
|
1922
|
-
.pipe(finalize(() => {
|
|
1923
|
-
this.modalBusy = false;
|
|
1924
|
-
this.visibleOpen = false;
|
|
1925
|
-
}))
|
|
1926
|
-
.subscribe(res => {
|
|
1927
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
1928
|
-
this.list.get();
|
|
1929
|
-
});
|
|
1930
|
-
}
|
|
1931
|
-
/**删除版块 */
|
|
1932
|
-
deletefield(row) {
|
|
1933
|
-
this.confirmation
|
|
1934
|
-
.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`))
|
|
1935
|
-
.subscribe((status) => {
|
|
1936
|
-
if (status == 'confirm') {
|
|
1937
|
-
this._SectionAdminService
|
|
1938
|
-
.delete(row.id)
|
|
1939
|
-
.pipe(finalize(() => { }))
|
|
1940
|
-
.subscribe(res => {
|
|
1941
|
-
this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
|
|
1942
|
-
this.list.get();
|
|
1943
|
-
});
|
|
1944
|
-
}
|
|
1945
|
-
});
|
|
1946
|
-
}
|
|
1947
|
-
/**name表单控件 */
|
|
1948
|
-
get displayNameInput() {
|
|
1949
|
-
return this.createOrEditForm.get('displayName');
|
|
1950
|
-
}
|
|
1951
|
-
/**name表单控件 */
|
|
1952
|
-
get nameInput() {
|
|
1953
|
-
return this.createOrEditForm.get('name');
|
|
1954
|
-
}
|
|
1955
|
-
/**route表单控件 */
|
|
1956
|
-
get routeInput() {
|
|
1957
|
-
return this.createOrEditForm.get('route');
|
|
1958
|
-
}
|
|
1959
|
-
/**route表单控件 */
|
|
1960
|
-
get templateInput() {
|
|
1961
|
-
return this.createOrEditForm.get('template');
|
|
1962
|
-
}
|
|
1963
|
-
/**route表单控件 */
|
|
1964
|
-
get typeInput() {
|
|
1965
|
-
return this.createOrEditForm.get('type');
|
|
1966
|
-
}
|
|
1967
|
-
radiochange() {
|
|
1968
|
-
this.routeInput.patchValue(this.routeInput.value);
|
|
1969
|
-
}
|
|
1970
|
-
/**字段标签input失去标点生成字段名字 */
|
|
1971
|
-
disPlayNameInputBlur(event) {
|
|
1972
|
-
let value = event.target.value;
|
|
1973
|
-
let pinyin = this._CmsApiService.chineseToPinyin(value);
|
|
1974
|
-
let nameInput = this.nameInput;
|
|
1975
|
-
let routeInput = this.routeInput;
|
|
1976
|
-
let templateInput = this.templateInput;
|
|
1977
|
-
if (nameInput.value)
|
|
1978
|
-
return;
|
|
1979
|
-
nameInput.patchValue(pinyin);
|
|
1980
|
-
if (routeInput.value)
|
|
1981
|
-
return;
|
|
1982
|
-
routeInput.patchValue(pinyin + (this.typeInput.value === 0 ? '' : '/{slug}'));
|
|
1983
|
-
if (templateInput.value)
|
|
1984
|
-
return;
|
|
1985
|
-
templateInput.patchValue(pinyin + '/index');
|
|
1986
|
-
}
|
|
1987
|
-
/**设置字段控件异步验证 */
|
|
1988
|
-
setAsyncValidatorsFn() {
|
|
1989
|
-
this.createOrEditForm.setControl('name', new FormControl(this.nameInput.value || '', {
|
|
1990
|
-
validators: Validators.required,
|
|
1991
|
-
asyncValidators: this.nameRepetitionAsyncValidator(),
|
|
1992
|
-
}));
|
|
1993
|
-
this.createOrEditForm.setControl('route', new FormControl(this.routeInput.value || '', {
|
|
1994
|
-
validators: [Validators.required, this.forbiddenNameValidator()],
|
|
1995
|
-
asyncValidators: [this.routeRepetitionAsyncValidator()],
|
|
1996
|
-
}));
|
|
1997
|
-
}
|
|
1998
|
-
forbiddenNameValidator() {
|
|
1999
|
-
return (control) => {
|
|
2000
|
-
let inputValue = control.value.toLocaleLowerCase();
|
|
2001
|
-
let forbidden = this.typeInput.value == 0 ? false : inputValue.includes('{slug}') ? false : true;
|
|
2002
|
-
return forbidden
|
|
2003
|
-
? {
|
|
2004
|
-
repetition: this._LocalizationService.instant(`Cms::RouteVerificationTips`, this._LocalizationService.instant(`Cms::Enum:SectionType:` + SectionType[this.typeInput.value]), '{slug}'),
|
|
2005
|
-
}
|
|
2006
|
-
: null;
|
|
2007
|
-
};
|
|
2008
|
-
}
|
|
2009
|
-
/**定义异步验证方法 */
|
|
2010
|
-
nameRepetitionAsyncValidator() {
|
|
2011
|
-
return (ctrl) => {
|
|
2012
|
-
return new Promise(resolve => {
|
|
2013
|
-
let subslug = this.createOrEditForm?.get('name');
|
|
2014
|
-
if (subslug.value == this.selected?.name) {
|
|
2015
|
-
resolve(null);
|
|
2016
|
-
return;
|
|
2017
|
-
}
|
|
2018
|
-
this._SectionAdminService
|
|
2019
|
-
.nameExists({
|
|
2020
|
-
name: subslug.value,
|
|
2021
|
-
})
|
|
2022
|
-
.subscribe(res => {
|
|
2023
|
-
if (res) {
|
|
2024
|
-
resolve({
|
|
2025
|
-
repetition: this._LocalizationService.instant(`Cms::SectionName{0}AlreadyExist`, ctrl.value),
|
|
2026
|
-
});
|
|
2027
|
-
}
|
|
2028
|
-
else {
|
|
2029
|
-
resolve(null);
|
|
2030
|
-
}
|
|
2031
|
-
});
|
|
2032
|
-
});
|
|
2033
|
-
};
|
|
2034
|
-
}
|
|
2035
|
-
/**定义异步验证方法 */
|
|
2036
|
-
routeRepetitionAsyncValidator() {
|
|
2037
|
-
return (ctrl) => {
|
|
2038
|
-
return new Promise(resolve => {
|
|
2039
|
-
let subslug = this.createOrEditForm?.get('route').value;
|
|
2040
|
-
if (subslug == this.selected?.route) {
|
|
2041
|
-
resolve(null);
|
|
2042
|
-
return;
|
|
2043
|
-
}
|
|
2044
|
-
this._SectionAdminService
|
|
2045
|
-
.routeExists({
|
|
2046
|
-
// siteId: this.filters.siteId,
|
|
2047
|
-
route: subslug,
|
|
2048
|
-
})
|
|
2049
|
-
.subscribe(res => {
|
|
2050
|
-
if (res) {
|
|
2051
|
-
resolve({
|
|
2052
|
-
repetition: this._LocalizationService.instant(`Cms::SectionRoute{0}AlreadyExist`, ctrl.value),
|
|
2053
|
-
});
|
|
2054
|
-
}
|
|
2055
|
-
else {
|
|
2056
|
-
resolve(null);
|
|
2057
|
-
}
|
|
2058
|
-
});
|
|
2059
|
-
});
|
|
2060
|
-
};
|
|
2061
|
-
}
|
|
2062
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SectionsComponent, deps: [{ token: i1.ListService }, { token: SectionAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1$1.FormBuilder }, { token: EntryTypeAdminService }, { token: i1.LocalizationService }, { token: CmsApiService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
2063
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: SectionsComponent, selector: "cms-sections", providers: [
|
|
2064
|
-
// [Required]
|
|
2065
|
-
ListService,
|
|
2066
|
-
// [Optional]
|
|
2067
|
-
// Provide this token if you want a different debounce time.
|
|
2068
|
-
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
2069
|
-
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
2070
|
-
{
|
|
2071
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
2072
|
-
useValue: ECmsComponent.Sections,
|
|
2073
|
-
},
|
|
2074
|
-
], viewQueries: [{ propertyName: "createOrEditModalSubmitBtn", first: true, predicate: ["createOrEditModalSubmitBtn"], descendants: true }], ngImport: i0, template: "<abp-page [title]=\"'Cms::Sections' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"sections-page\">\n <div class=\"card \" >\n <div class=\"card-body px-2 py-sm-2 border-bottom\">\n <div class=\"row align-items-end\">\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'Cms::IsActive' | abpLocalization}}\uFF1A</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"filters.isActive\" (change)=\"siteIdChange()\">\n <option [value]=\"\"></option>\n <option [value]=\"true\">\u662F</option>\n <option [value]=\"false\">\u5426</option>\n </select>\n </div>\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\n </div>\n <div class=\"mb-2 col-4\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"list.get()\">\n <i class=\"fa fa-search\"></i>\n </button>\n </div>\n </div> \n </div>\n </div>\n <div class=\"card mb-0\">\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::SectionType' | abpLocalization\" prop=\"type\" [width]=\"80\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{('Cms::Enum:SectionType:'+_SectionType[value]) | abpLocalization}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsDefault' | abpLocalization\" prop=\"isDefault\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsActive' | abpLocalization\" prop=\"isActive\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"SiteId\" [width]=\"100\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-link\" ngbDropdownToggle id=\"dropdownBasic1\">\n {{'Cms::EntryType' | abpLocalization}}\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <ng-container *ngFor=\"let item of row.entryTypes;let i =index\">\n <li ngbDropdownItem\n class=\"d-flex align-items-center justify-content-between\"\n (click.stop)=\"jumpSectionsEdit(row,item)\">{{item.displayName}}\n <button class=\"btn btn-light btn-sm p-0\"\n (click.stop)=\"deleteEntryType(item)\"><i class=\"fas fa-trash p-sm-1\"\n style=\"font-size: 12px;\" role=\"button\"></i></button>\n </li>\n </ng-container>\n <li ngbDropdownItem (click.stop)=\"jumpSectionsCreate(row)\"><i\n class=\"fas fa-plus-circle me-2\"></i>{{'Cms::New' |\n abpLocalization}}</li>\n </div>\n </div>\n\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [minWidth]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'yyyy/MM/dd hh:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [frozenRight]=\"true\" [name]=\"'AbpUi::Actions' | abpLocalization\" cellClass=\"cellClassRight\" [width]=\"100\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\n </button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem (click)=\"editSectionBtn(row)\">{{'AbpUi::Edit' |\n abpLocalization}}</button>\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\n abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n</abp-page>\n<abp-modal [(visible)]=\"visibleOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{selected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"createOrEditForm; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"createOrEditForm\" (ngSubmit)=\"createOrEditSave()\">\n <button type=\"submit\" #createOrEditModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::EntryType' | abpLocalization}}</label>\n <div>\n <ng-container *ngFor=\"let item of _sectionTypeOptions;let i =index\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"item.value\"\n (change)=\"radiochange()\" formControlName=\"type\" id=\"flexRadioDefault{{i}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{i}}\">\n {{ 'Cms::Enum:SectionType:'+item.key | abpLocalization }}\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Route' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"route\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"routeInput.errors?.repetition\">\n {{routeInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">\n {{'Cms::RouteTips' | abpLocalization}}<br>\n blog<br>\n {{'blog/{slug}'}}<br>\n {{'blog/{publishTime:yyyy}/{publishTime:MM}/{slug}'}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Template' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"template\" placeholder=\"\" />\n <div class=\"form-text\">\n {{\"Cms::TemplateTips\" | abpLocalization}}\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isDefault\"\n id=\"isDefault\" />\n <label class=\"form-check-label\" for=\"isDefault\"> {{'Cms::Default' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isActive\"\n id=\"isActive\" />\n <label class=\"form-check-label\" for=\"isActive\"> {{'Cms::IsActive' | abpLocalization}}</label>\n </div>\n </div>\n\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"createOrEditModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' |\n abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .sections-page .dignite_page{background:transparent}::ng-deep .sections-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sections-page .card-header input{flex:2 1 auto}::ng-deep .sections-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i8.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i8.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i8.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
2075
|
-
}
|
|
2076
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SectionsComponent, decorators: [{
|
|
2077
|
-
type: Component,
|
|
2078
|
-
args: [{ selector: 'cms-sections', providers: [
|
|
2079
|
-
// [Required]
|
|
2080
|
-
ListService,
|
|
2081
|
-
// [Optional]
|
|
2082
|
-
// Provide this token if you want a different debounce time.
|
|
2083
|
-
// Default is 300. Cannot be 0. Any value below 100 is not recommended.
|
|
2084
|
-
{ provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
|
|
2085
|
-
{
|
|
2086
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
2087
|
-
useValue: ECmsComponent.Sections,
|
|
2088
|
-
},
|
|
2089
|
-
], template: "<abp-page [title]=\"'Cms::Sections' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"sections-page\">\n <div class=\"card \" >\n <div class=\"card-body px-2 py-sm-2 border-bottom\">\n <div class=\"row align-items-end\">\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'Cms::IsActive' | abpLocalization}}\uFF1A</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"filters.isActive\" (change)=\"siteIdChange()\">\n <option [value]=\"\"></option>\n <option [value]=\"true\">\u662F</option>\n <option [value]=\"false\">\u5426</option>\n </select>\n </div>\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\n </div>\n <div class=\"mb-2 col-4\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"list.get()\">\n <i class=\"fa fa-search\"></i>\n </button>\n </div>\n </div> \n </div>\n </div>\n <div class=\"card mb-0\">\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::SectionType' | abpLocalization\" prop=\"type\" [width]=\"80\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{('Cms::Enum:SectionType:'+_SectionType[value]) | abpLocalization}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsDefault' | abpLocalization\" prop=\"isDefault\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsActive' | abpLocalization\" prop=\"isActive\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"SiteId\" [width]=\"100\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-link\" ngbDropdownToggle id=\"dropdownBasic1\">\n {{'Cms::EntryType' | abpLocalization}}\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <ng-container *ngFor=\"let item of row.entryTypes;let i =index\">\n <li ngbDropdownItem\n class=\"d-flex align-items-center justify-content-between\"\n (click.stop)=\"jumpSectionsEdit(row,item)\">{{item.displayName}}\n <button class=\"btn btn-light btn-sm p-0\"\n (click.stop)=\"deleteEntryType(item)\"><i class=\"fas fa-trash p-sm-1\"\n style=\"font-size: 12px;\" role=\"button\"></i></button>\n </li>\n </ng-container>\n <li ngbDropdownItem (click.stop)=\"jumpSectionsCreate(row)\"><i\n class=\"fas fa-plus-circle me-2\"></i>{{'Cms::New' |\n abpLocalization}}</li>\n </div>\n </div>\n\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [minWidth]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'yyyy/MM/dd hh:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [frozenRight]=\"true\" [name]=\"'AbpUi::Actions' | abpLocalization\" cellClass=\"cellClassRight\" [width]=\"100\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\n </button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem (click)=\"editSectionBtn(row)\">{{'AbpUi::Edit' |\n abpLocalization}}</button>\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\n abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n</abp-page>\n<abp-modal [(visible)]=\"visibleOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{selected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"createOrEditForm; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"createOrEditForm\" (ngSubmit)=\"createOrEditSave()\">\n <button type=\"submit\" #createOrEditModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::EntryType' | abpLocalization}}</label>\n <div>\n <ng-container *ngFor=\"let item of _sectionTypeOptions;let i =index\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"item.value\"\n (change)=\"radiochange()\" formControlName=\"type\" id=\"flexRadioDefault{{i}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{i}}\">\n {{ 'Cms::Enum:SectionType:'+item.key | abpLocalization }}\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Route' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"route\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"routeInput.errors?.repetition\">\n {{routeInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">\n {{'Cms::RouteTips' | abpLocalization}}<br>\n blog<br>\n {{'blog/{slug}'}}<br>\n {{'blog/{publishTime:yyyy}/{publishTime:MM}/{slug}'}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Template' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"template\" placeholder=\"\" />\n <div class=\"form-text\">\n {{\"Cms::TemplateTips\" | abpLocalization}}\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isDefault\"\n id=\"isDefault\" />\n <label class=\"form-check-label\" for=\"isDefault\"> {{'Cms::Default' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isActive\"\n id=\"isActive\" />\n <label class=\"form-check-label\" for=\"isActive\"> {{'Cms::IsActive' | abpLocalization}}</label>\n </div>\n </div>\n\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"createOrEditModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' |\n abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .sections-page .dignite_page{background:transparent}::ng-deep .sections-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sections-page .card-header input{flex:2 1 auto}::ng-deep .sections-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"] }]
|
|
2090
|
-
}], ctorParameters: function () { return [{ type: i1.ListService }, { type: SectionAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1$1.FormBuilder }, { type: EntryTypeAdminService }, { type: i1.LocalizationService }, { type: CmsApiService }, { type: i3$1.Router }]; }, propDecorators: { createOrEditModalSubmitBtn: [{
|
|
2091
|
-
type: ViewChild,
|
|
2092
|
-
args: ['createOrEditModalSubmitBtn', { static: false }]
|
|
2093
|
-
}] } });
|
|
2094
|
-
|
|
2095
|
-
class CreateOrEditEntryTypeInputBase {
|
|
2096
|
-
/**显示名称 Display name of this field */
|
|
2097
|
-
displayName = ['', [Validators.required]];
|
|
2098
|
-
/**名称 Unique Name*/
|
|
2099
|
-
name = ['', [Validators.required]];
|
|
2100
|
-
/**条目路由 */
|
|
2101
|
-
fieldTabs = new FormArray([]);
|
|
2102
|
-
constructor(data) {
|
|
2103
|
-
if (data) {
|
|
2104
|
-
for (const key in data) {
|
|
2105
|
-
if (data.hasOwnProperty(key)) {
|
|
2106
|
-
this[key] = data[key];
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
class fieldTabsBase {
|
|
2113
|
-
/**名称 Unique Name*/
|
|
2114
|
-
name = ['', [Validators.required]];
|
|
2115
|
-
fields = [[], []];
|
|
2116
|
-
constructor(data) {
|
|
2117
|
-
if (data) {
|
|
2118
|
-
for (const key in data) {
|
|
2119
|
-
if (data.hasOwnProperty(key)) {
|
|
2120
|
-
this[key] = data[key];
|
|
2121
|
-
}
|
|
2122
|
-
}
|
|
2123
|
-
}
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
2126
|
-
class fieldsBase {
|
|
2127
|
-
/**字段id Unique Name*/
|
|
2128
|
-
fieldId = ['', [Validators.required]];
|
|
2129
|
-
/**显示名称 Unique Name*/
|
|
2130
|
-
displayName = ['', [Validators.required]];
|
|
2131
|
-
/**必填 Unique Name*/
|
|
2132
|
-
required = [false, []];
|
|
2133
|
-
/**是否在列表中显示 Unique Name*/
|
|
2134
|
-
showOnList = [false, []];
|
|
2135
|
-
constructor(data) {
|
|
2136
|
-
if (data) {
|
|
2137
|
-
for (const key in data) {
|
|
2138
|
-
if (data.hasOwnProperty(key)) {
|
|
2139
|
-
this[key] = data[key];
|
|
2140
|
-
}
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
}
|
|
2145
|
-
class fieldsInputBase {
|
|
2146
|
-
/**字段id */
|
|
2147
|
-
fieldId = ['', [Validators.required]];
|
|
2148
|
-
/**显示名称 Display name of this field */
|
|
2149
|
-
displayName = ['', [Validators.required]];
|
|
2150
|
-
/**是否必填 Unique Name*/
|
|
2151
|
-
required = [false, []];
|
|
2152
|
-
/**在列表中展示 Unique Name*/
|
|
2153
|
-
showOnList = [false, []];
|
|
2154
|
-
constructor(data) {
|
|
2155
|
-
if (data) {
|
|
2156
|
-
for (const key in data) {
|
|
2157
|
-
if (data.hasOwnProperty(key)) {
|
|
2158
|
-
this[key] = data[key];
|
|
2159
|
-
}
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
}
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
class CreateOrEditComponent {
|
|
2166
|
-
toaster;
|
|
2167
|
-
_location;
|
|
2168
|
-
route;
|
|
2169
|
-
_FieldGroupAdminService;
|
|
2170
|
-
_FieldAdminService;
|
|
2171
|
-
_EntryTypeAdminService;
|
|
2172
|
-
_LocalizationService;
|
|
2173
|
-
_CmsApiService;
|
|
2174
|
-
router;
|
|
2175
|
-
constructor(
|
|
2176
|
-
// private fb: FormBuilder,
|
|
2177
|
-
toaster, _location, route, _FieldGroupAdminService, _FieldAdminService, _EntryTypeAdminService, _LocalizationService, _CmsApiService, router) {
|
|
2178
|
-
this.toaster = toaster;
|
|
2179
|
-
this._location = _location;
|
|
2180
|
-
this.route = route;
|
|
2181
|
-
this._FieldGroupAdminService = _FieldGroupAdminService;
|
|
2182
|
-
this._FieldAdminService = _FieldAdminService;
|
|
2183
|
-
this._EntryTypeAdminService = _EntryTypeAdminService;
|
|
2184
|
-
this._LocalizationService = _LocalizationService;
|
|
2185
|
-
this._CmsApiService = _CmsApiService;
|
|
2186
|
-
this.router = router;
|
|
2187
|
-
}
|
|
2188
|
-
fb = inject(FormBuilder);
|
|
2189
|
-
_UpdateListService = inject(UpdateListService);
|
|
2190
|
-
/**表单实体 */
|
|
2191
|
-
newEntity = this.fb.group(new CreateOrEditEntryTypeInputBase());
|
|
2192
|
-
/**版块id */
|
|
2193
|
-
sectionId = '';
|
|
2194
|
-
/**条目类型id */
|
|
2195
|
-
entryTypesId = '';
|
|
2196
|
-
/**条目类型详情 */
|
|
2197
|
-
entryTypesSelect;
|
|
2198
|
-
get fieldTabs() {
|
|
2199
|
-
return this.newEntity.get('fieldTabs');
|
|
2200
|
-
}
|
|
2201
|
-
/**获取提交按钮替身,用于真实触发表单提交 */
|
|
2202
|
-
submitclick;
|
|
2203
|
-
/**触发提交按钮 */
|
|
2204
|
-
submitclickBtn() {
|
|
2205
|
-
this.submitclick.nativeElement.click();
|
|
2206
|
-
}
|
|
2207
|
-
ngOnInit() {
|
|
2208
|
-
let sectionId = this.route.snapshot.params.sectionsId;
|
|
2209
|
-
this.entryTypesId = this.route.snapshot.params.entryTypesId || '';
|
|
2210
|
-
if (sectionId) {
|
|
2211
|
-
this.sectionId = sectionId;
|
|
2212
|
-
this.addControlToFieldTabs();
|
|
2213
|
-
this.getFieldGroup();
|
|
2214
|
-
}
|
|
2215
|
-
}
|
|
2216
|
-
/**给fieldTabs添加新控件 */
|
|
2217
|
-
addControlToFieldTabs(nameValue = '') {
|
|
2218
|
-
const newFormGroup = this.fb.group(new fieldTabsBase({
|
|
2219
|
-
name: this.fieldTabs.length === 0 ? this._LocalizationService.instant(`Cms::FieldTab`) : nameValue,
|
|
2220
|
-
}));
|
|
2221
|
-
this.fieldTabs.push(newFormGroup);
|
|
2222
|
-
this.resultSource.push(newFormGroup.value);
|
|
2223
|
-
this.navActive = this.resultSource.length - 1;
|
|
2224
|
-
}
|
|
2225
|
-
/**获取字段分组 */
|
|
2226
|
-
getFieldGroup() {
|
|
2227
|
-
this._FieldGroupAdminService.getList({}).subscribe(async (res) => {
|
|
2228
|
-
let fieldList = await this.getFieldList();
|
|
2229
|
-
let fieldGroupList = res.items;
|
|
2230
|
-
fieldGroupList.unshift({
|
|
2231
|
-
id: null,
|
|
2232
|
-
name: 'UngroupedFields'
|
|
2233
|
-
});
|
|
2234
|
-
fieldGroupList.forEach((el, index) => {
|
|
2235
|
-
el.fields = fieldList.filter(els => els.groupId === el.id);
|
|
2236
|
-
});
|
|
2237
|
-
this.fieldGroupList = fieldGroupList;
|
|
2238
|
-
this.fieldList = this.deepClone(fieldList);
|
|
2239
|
-
let entryTypesId = this.entryTypesId;
|
|
2240
|
-
if (entryTypesId) {
|
|
2241
|
-
this.entryTypesId = entryTypesId;
|
|
2242
|
-
this.getEntryTypes();
|
|
2243
|
-
}
|
|
2244
|
-
});
|
|
2245
|
-
}
|
|
2246
|
-
/**获取条目类型详情 */
|
|
2247
|
-
getEntryTypes() {
|
|
2248
|
-
let fieldList = this.deepClone(this.fieldList);
|
|
2249
|
-
this._EntryTypeAdminService.get(this.entryTypesId).subscribe(res => {
|
|
2250
|
-
res.fieldTabs.forEach(el => {
|
|
2251
|
-
el.fields.forEach((eld) => {
|
|
2252
|
-
eld.id = eld.fieldId;
|
|
2253
|
-
eld.groupId = fieldList.find(elfd => elfd.id == eld.fieldId).groupId;
|
|
2254
|
-
this.formRightGroup.push(eld);
|
|
2255
|
-
let fieldindex = fieldList.findIndex(elfl => elfl.id == eld.fieldId);
|
|
2256
|
-
fieldList.splice(fieldindex, 1);
|
|
2257
|
-
});
|
|
2258
|
-
});
|
|
2259
|
-
this.fieldGroupList.forEach((el, index) => {
|
|
2260
|
-
el.fields = fieldList.filter(els => els.groupId === el.id);
|
|
2261
|
-
});
|
|
2262
|
-
this.newEntity.patchValue(res);
|
|
2263
|
-
this.entryTypesSelect = res;
|
|
2264
|
-
this.resultSource = res.fieldTabs;
|
|
2265
|
-
});
|
|
2266
|
-
}
|
|
2267
|
-
/**
|
|
2268
|
-
* 深拷贝--方法
|
|
2269
|
-
* $api.deepClone() */
|
|
2270
|
-
deepClone(obj) {
|
|
2271
|
-
if (typeof obj !== 'object' || obj === null)
|
|
2272
|
-
return obj;
|
|
2273
|
-
const result = Array.isArray(obj) ? [] : {};
|
|
2274
|
-
for (let key in obj) {
|
|
2275
|
-
if (obj.hasOwnProperty(key)) {
|
|
2276
|
-
if (typeof obj[key] === 'object' && obj[key] !== null) {
|
|
2277
|
-
if (obj[key] instanceof Date) {
|
|
2278
|
-
result[key] = new Date(obj[key].getTime());
|
|
2279
|
-
}
|
|
2280
|
-
else if (obj[key] instanceof RegExp) {
|
|
2281
|
-
result[key] = new RegExp(obj[key]);
|
|
2282
|
-
}
|
|
2283
|
-
else {
|
|
2284
|
-
result[key] = this.deepClone(obj[key]);
|
|
2285
|
-
}
|
|
2286
|
-
}
|
|
2287
|
-
else {
|
|
2288
|
-
result[key] = obj[key];
|
|
2289
|
-
}
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
|
-
return result;
|
|
2293
|
-
}
|
|
2294
|
-
/**
|
|
2295
|
-
*
|
|
2296
|
-
* @param nameValue 获取所有字段
|
|
2297
|
-
*/
|
|
2298
|
-
getFieldList() {
|
|
2299
|
-
return new Promise((resolve, rejects) => {
|
|
2300
|
-
this._FieldAdminService.getList({
|
|
2301
|
-
maxResultCount: 1000
|
|
2302
|
-
}).subscribe((res) => {
|
|
2303
|
-
res.items.forEach(el => {
|
|
2304
|
-
el.required = false;
|
|
2305
|
-
el.showOnList = false;
|
|
2306
|
-
});
|
|
2307
|
-
resolve(res.items);
|
|
2308
|
-
});
|
|
2309
|
-
});
|
|
2310
|
-
}
|
|
2311
|
-
/**
|
|
2312
|
-
* 拖拽 功能*/
|
|
2313
|
-
/**数据源 */
|
|
2314
|
-
/**数据源-字段分组数据-包含字段数据 fields */
|
|
2315
|
-
fieldGroupList = [];
|
|
2316
|
-
/**数据源-所有字段列表 */
|
|
2317
|
-
fieldList = [];
|
|
2318
|
-
/**数据源拖拽的分组下标 */
|
|
2319
|
-
DataSourceGroupIndex;
|
|
2320
|
-
/**数据源拖拽的字段下标 */
|
|
2321
|
-
DataSourceFieldIndex;
|
|
2322
|
-
/**目标源 结果*/
|
|
2323
|
-
resultSource = [];
|
|
2324
|
-
/**从数据源拖拽的元素 */
|
|
2325
|
-
fromDataSourceDragEl;
|
|
2326
|
-
/**从目标源拖拽的元素 */
|
|
2327
|
-
fromResultSourceDragEl;
|
|
2328
|
-
/**来自数据源的集合,用于从目标源拖回数据源时的判断,与取值 */
|
|
2329
|
-
formRightGroup = [];
|
|
2330
|
-
/**从数据源开始拖拽 */
|
|
2331
|
-
fromDataSourceDragStart(element, fieldIndex, groupIndex) {
|
|
2332
|
-
this.fromDataSourceDragEl = element;
|
|
2333
|
-
this.DataSourceFieldIndex = fieldIndex;
|
|
2334
|
-
this.DataSourceGroupIndex = groupIndex;
|
|
2335
|
-
this.fromResultSourceDragEl = undefined;
|
|
2336
|
-
}
|
|
2337
|
-
/**从目标源开始拖拽 */
|
|
2338
|
-
fromResultSourceDragStart(element) {
|
|
2339
|
-
this.fromResultSourceDragEl = element;
|
|
2340
|
-
this.fromDataSourceDragEl = undefined;
|
|
2341
|
-
this.DataSourceFieldIndex = undefined;
|
|
2342
|
-
this.DataSourceGroupIndex = undefined;
|
|
2343
|
-
}
|
|
2344
|
-
/**拖拽到数据源时触发 */
|
|
2345
|
-
dragToDataSourceDropped() {
|
|
2346
|
-
//从数据源拖拽到数据源-排序
|
|
2347
|
-
if (this.fromDataSourceDragEl) {
|
|
2348
|
-
}
|
|
2349
|
-
let _fromResultSourceDragEl = this.fromResultSourceDragEl;
|
|
2350
|
-
let formRightGroup = this.deepClone(this.formRightGroup);
|
|
2351
|
-
let fieldList = this.deepClone(this.fieldList);
|
|
2352
|
-
if (_fromResultSourceDragEl) { //移动
|
|
2353
|
-
//从目标源拖拽到数据源
|
|
2354
|
-
// 拖拽目标源的下标
|
|
2355
|
-
let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(el => el.id == _fromResultSourceDragEl.id);
|
|
2356
|
-
//删除目标源中的数据
|
|
2357
|
-
this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
|
|
2358
|
-
formRightGroup.splice(formRightGroup.findIndex(el => el.id == _fromResultSourceDragEl.id), 1);
|
|
2359
|
-
this.fieldGroupList.forEach(el => {
|
|
2360
|
-
if (el.id == _fromResultSourceDragEl.groupId) {
|
|
2361
|
-
const elFieldsAll = fieldList.filter(els => els.groupId === el.id);
|
|
2362
|
-
el.fields = elFieldsAll.filter(item => !formRightGroup.some(itemB => item.id === itemB.id));
|
|
2363
|
-
}
|
|
2364
|
-
});
|
|
2365
|
-
this.formRightGroup = formRightGroup;
|
|
2366
|
-
}
|
|
2367
|
-
this.setfieldTabsFrom();
|
|
2368
|
-
}
|
|
2369
|
-
/**拖拽到目标源时触发
|
|
2370
|
-
*
|
|
2371
|
-
*/
|
|
2372
|
-
dragToResultSourceDropped(fieldTabstem, fieldTabsIndex) {
|
|
2373
|
-
const _fromDataSourceDragEl = this.fromDataSourceDragEl;
|
|
2374
|
-
//从数据源拖拽到目标源
|
|
2375
|
-
if (_fromDataSourceDragEl) {
|
|
2376
|
-
this.fieldGroupList[this.DataSourceGroupIndex].fields.splice(this.DataSourceFieldIndex, 1);
|
|
2377
|
-
this.resultSource[fieldTabsIndex].fields.push(_fromDataSourceDragEl);
|
|
2378
|
-
this.formRightGroup.push(_fromDataSourceDragEl);
|
|
2379
|
-
}
|
|
2380
|
-
this.setfieldTabsFrom();
|
|
2381
|
-
}
|
|
2382
|
-
/** 从目标源拖拽到目标源*/
|
|
2383
|
-
dragToResultSourceItemDropped(fieldsIndex) {
|
|
2384
|
-
const _fromResultSourceDragEl = this.fromResultSourceDragEl;
|
|
2385
|
-
if (_fromResultSourceDragEl) {
|
|
2386
|
-
// 拖拽目标源的下标
|
|
2387
|
-
let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(el => el.id == _fromResultSourceDragEl.id);
|
|
2388
|
-
//删除目标源中的数据
|
|
2389
|
-
this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
|
|
2390
|
-
this.resultSource[this.navActive].fields.splice(fieldsIndex, 0, _fromResultSourceDragEl);
|
|
2391
|
-
}
|
|
2392
|
-
this.setfieldTabsFrom();
|
|
2393
|
-
}
|
|
2394
|
-
/**设置formA表单 */
|
|
2395
|
-
setfieldTabsFrom() {
|
|
2396
|
-
let setArray = [];
|
|
2397
|
-
this.resultSource.forEach(el => {
|
|
2398
|
-
let fieldsArray = [];
|
|
2399
|
-
el.fields.forEach(item => {
|
|
2400
|
-
fieldsArray.push({
|
|
2401
|
-
"fieldId": item.id || item.fieldId,
|
|
2402
|
-
"displayName": item.displayName,
|
|
2403
|
-
"required": item?.required,
|
|
2404
|
-
"showOnList": item?.showOnList
|
|
2405
|
-
});
|
|
2406
|
-
});
|
|
2407
|
-
setArray.push({
|
|
2408
|
-
name: el.name,
|
|
2409
|
-
fields: fieldsArray
|
|
2410
|
-
});
|
|
2411
|
-
});
|
|
2412
|
-
this.newEntity.patchValue({
|
|
2413
|
-
fieldTabs: setArray
|
|
2414
|
-
});
|
|
2415
|
-
}
|
|
2416
|
-
/**保存表单 */
|
|
2417
|
-
save() {
|
|
2418
|
-
let input = this.newEntity.value;
|
|
2419
|
-
if (this.entryTypesSelect) {
|
|
2420
|
-
this._EntryTypeAdminService.update(this.entryTypesSelect.id, input).subscribe(res => {
|
|
2421
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
2422
|
-
this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
|
|
2423
|
-
this.router.navigate([`/cms/admin/sections`]);
|
|
2424
|
-
this._UpdateListService.updateList();
|
|
2425
|
-
});
|
|
2426
|
-
});
|
|
2427
|
-
return;
|
|
2428
|
-
}
|
|
2429
|
-
input.sectionId = this.sectionId;
|
|
2430
|
-
this._EntryTypeAdminService.create(input).subscribe(res => {
|
|
2431
|
-
this.toaster.success(this._LocalizationService.instant(`CmsKit::SavedSuccessfully`));
|
|
2432
|
-
this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
|
|
2433
|
-
this.router.navigate([`/cms/admin/sections`]);
|
|
2434
|
-
this._UpdateListService.updateList();
|
|
2435
|
-
});
|
|
2436
|
-
});
|
|
2437
|
-
}
|
|
2438
|
-
/**编辑Tabs表单 */
|
|
2439
|
-
editFieldTabsFrom;
|
|
2440
|
-
/**模态框状态 */
|
|
2441
|
-
visibleTabsOpen = false;
|
|
2442
|
-
/**是否是忙碌状态 */
|
|
2443
|
-
modalBusy = false;
|
|
2444
|
-
/**正在编辑的tabs */
|
|
2445
|
-
editFieldTabsSelect;
|
|
2446
|
-
/**正在选中的nav */
|
|
2447
|
-
navActive = 0;
|
|
2448
|
-
/**表单控件模板-动态赋值表单控件 */
|
|
2449
|
-
editFieldTabsModalSubmitBtn;
|
|
2450
|
-
/**模态框状态改变回调 */
|
|
2451
|
-
VisibleTabsChange(event) {
|
|
2452
|
-
if (!event) {
|
|
2453
|
-
this.editFieldTabsSelect = '';
|
|
2454
|
-
return;
|
|
2455
|
-
}
|
|
2456
|
-
}
|
|
2457
|
-
/**新建增加FieldTabs */
|
|
2458
|
-
addFieldTabs() {
|
|
2459
|
-
this.editFieldTabsFrom = this.fb.group(new fieldTabsBase());
|
|
2460
|
-
this.visibleTabsOpen = true;
|
|
2461
|
-
}
|
|
2462
|
-
/**正在编辑的tab下标 */
|
|
2463
|
-
newEditFieldTabsIndex;
|
|
2464
|
-
/**编辑FieldTabs */
|
|
2465
|
-
editFieldTabs(item, i) {
|
|
2466
|
-
this.editFieldTabsFrom = this.fb.group(new fieldTabsBase({
|
|
2467
|
-
name: item.name
|
|
2468
|
-
}));
|
|
2469
|
-
this.editFieldTabsSelect = item;
|
|
2470
|
-
this.visibleTabsOpen = true;
|
|
2471
|
-
this.newEditFieldTabsIndex = i;
|
|
2472
|
-
}
|
|
2473
|
-
/**保存编辑tabs表单 */
|
|
2474
|
-
editFieldTabsSave() {
|
|
2475
|
-
//编辑
|
|
2476
|
-
if (this.editFieldTabsSelect) {
|
|
2477
|
-
this.resultSource[this.newEditFieldTabsIndex].name = this.editFieldTabsFrom.value.name;
|
|
2478
|
-
this.navActive = this.newEditFieldTabsIndex;
|
|
2479
|
-
}
|
|
2480
|
-
else {
|
|
2481
|
-
//新建
|
|
2482
|
-
this.addControlToFieldTabs(this.editFieldTabsFrom.value.name);
|
|
2483
|
-
}
|
|
2484
|
-
this.visibleTabsOpen = false;
|
|
2485
|
-
this.setfieldTabsFrom();
|
|
2486
|
-
}
|
|
2487
|
-
/**删除某个tabs表单 */
|
|
2488
|
-
deleteFieldTabs(index) {
|
|
2489
|
-
this.fieldTabs.removeAt(index);
|
|
2490
|
-
this.resultSource.splice(index, 1);
|
|
2491
|
-
}
|
|
2492
|
-
/**编辑字段模态框状态 */
|
|
2493
|
-
visibleEditFieldOpen = false;
|
|
2494
|
-
/**编辑字段模态框表单 */
|
|
2495
|
-
editFieldFrom;
|
|
2496
|
-
/**表单控件模板-动态赋值表单控件-编辑字段 */
|
|
2497
|
-
editFieldModalSubmitBtn;
|
|
2498
|
-
/**正在编辑的字段下标 */
|
|
2499
|
-
EditFieldIndex;
|
|
2500
|
-
/**编辑字段模态框状态状态改变回调 */
|
|
2501
|
-
VisibleEditFieldChange(event) {
|
|
2502
|
-
if (!event) {
|
|
2503
|
-
this.EditFieldIndex = undefined;
|
|
2504
|
-
return;
|
|
2505
|
-
}
|
|
2506
|
-
}
|
|
2507
|
-
/**打开编辑字段模态框 */
|
|
2508
|
-
EditFieldModalOpen(items, elIndex) {
|
|
2509
|
-
this.visibleEditFieldOpen = true;
|
|
2510
|
-
this.EditFieldIndex = elIndex;
|
|
2511
|
-
this.editFieldFrom = this.fb.group(new fieldsBase(this.fieldTabs.value[this.navActive].fields[elIndex]));
|
|
2512
|
-
}
|
|
2513
|
-
/**保存编辑字段 */
|
|
2514
|
-
editFieldSave() {
|
|
2515
|
-
let input = this.editFieldFrom.value;
|
|
2516
|
-
this.resultSource[this.navActive].fields[this.EditFieldIndex].displayName = input.displayName;
|
|
2517
|
-
this.resultSource[this.navActive].fields[this.EditFieldIndex].required = input.required;
|
|
2518
|
-
this.resultSource[this.navActive].fields[this.EditFieldIndex].showOnList = input.showOnList;
|
|
2519
|
-
this.visibleEditFieldOpen = false;
|
|
2520
|
-
this.setfieldTabsFrom();
|
|
2521
|
-
}
|
|
2522
|
-
/**name表单控件 */
|
|
2523
|
-
get nameInput() {
|
|
2524
|
-
return this.newEntity.get('name');
|
|
2525
|
-
}
|
|
2526
|
-
/**字段标签input失去标点生成字段名字 */
|
|
2527
|
-
disPlayNameInputBlur(event) {
|
|
2528
|
-
let value = event.target.value;
|
|
2529
|
-
let pinyin = this._CmsApiService.chineseToPinyin(value);
|
|
2530
|
-
let nameInput = this.nameInput;
|
|
2531
|
-
if (nameInput.value)
|
|
2532
|
-
return;
|
|
2533
|
-
nameInput.patchValue(pinyin);
|
|
2534
|
-
}
|
|
2535
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateOrEditComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: FieldGroupAdminService }, { token: FieldAdminService }, { token: EntryTypeAdminService }, { token: i1.LocalizationService }, { token: CmsApiService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
2536
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CreateOrEditComponent, selector: "cms-create-or-edit", providers: [
|
|
2537
|
-
{
|
|
2538
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
2539
|
-
useValue: ECmsComponent.SectionsCreateOrEdit,
|
|
2540
|
-
},
|
|
2541
|
-
], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }, { propertyName: "editFieldTabsModalSubmitBtn", first: true, predicate: ["editFieldTabsModalSubmitBtn"], descendants: true }, { propertyName: "editFieldModalSubmitBtn", first: true, predicate: ["editFieldModalSubmitBtn"], descendants: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save()\">\n <abp-page [title]=\"entryTypesId ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)\" [toolbar]=\"true\">\n <div class=\"create-or-edit-entry-type-page\">\n <div class=\"card\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card-body\">\n <div class=\"\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n <div formArrayName=\"fieldTabs\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::FieldLayout' | abpLocalization}}</label>\n <div class=\"container\">\n <!-- -->\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"navActive\" class=\"nav nav-tabs\">\n <ng-container *ngFor=\"let item of resultSource; let i = index\">\n <li [ngbNavItem]=\"i\">\n <button type=\"button\" ngbDropdown ngbNavLink>\n {{ item.name }}\n <span class=\"ms-1\" (click.stop)=\"$event.stopPropagation()\"\n ngbDropdownToggle></span>\n <div ngbDropdownMenu style=\"z-index: 999;\">\n <li ngbDropdownItem type=\"button\"\n (click.stop)=\"editFieldTabs(item,i)\">\n <i class=\"fas fa-edit\"></i>\n {{'AbpUi::Edit' | abpLocalization}}\n </li>\n <li ngbDropdownItem\n *ngIf=\"resultSource.length !== 1\" type=\"button\"\n (click.stop)=\"deleteFieldTabs(i)\">\n <i class=\"fas fa-trash\"></i>\n {{'AbpUi::Delete' | abpLocalization}}\n </li>\n </div>\n </button>\n <ng-template ngbNavContent>\n <div class=\"p-2\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToResultSourceDropped(item,i)\" style=\"height: 100%;\">\n <p class=\"form-text\" *ngIf=\"item.fields.length === 0\">\n {{'Cms::DragAndDropFieldTips' | abpLocalization}}\n </p>\n <ul class=\"list-group\" style=\"height: 100%;\">\n <ng-container\n *ngFor=\"let el of item.fields; let iel = index\">\n <li draggable=\"true\"\n (dragstart)=\"fromResultSourceDragStart(el)\"\n (drop)=\"dragToResultSourceItemDropped(iel)\"\n class=\"list-group-item d-flex align-items-center justify-content-between py-1\" style=\"position: unset;\">\n {{ el.displayName }}\n <button class=\"p-0 btn btn-sm btn-light\"\n (click.stop)=\"EditFieldModalOpen(el,iel)\"\n type=\"button\"><i\n class=\"fas fa-wrench p-sm-1\"\n role=\"button\"></i></button>\n </li>\n </ng-container>\n </ul>\n \n </div>\n </ng-template>\n </li>\n </ng-container>\n <li class=\"nav-item\" role=\"presentation\">\n <button type=\"button\" class=\"nav-link\"\n (click.stop)=\"addFieldTabs()\">\n <i class=\"fas fa-plus-circle\"></i>\n {{'Cms::NewTab' | abpLocalization}}\n </button>\n </li>\n </ul>\n <div [ngbNavOutlet]=\"nav\" class=\"mt-2 bordernNavs p-0\"></div>\n </div>\n <div class=\"col-sm-4\">\n <div ngbAccordion #accordion=\"ngbAccordion\"\n ondragover=\"event.preventDefault();\" (drop)=\"dragToDataSourceDropped()\"\n style=\"min-height: 80px;\">\n <ng-container *ngFor=\"let item of fieldGroupList; let i = index\">\n <div [ngbAccordionItem]=\"item.name\" *ngIf=\"item.fields.length > 0\">\n <h2 ngbAccordionHeader>\n <button ngbAccordionButton>{{\n ('Cms::'+item.name) | abpLocalization }}</button>\n </h2>\n <div ngbAccordionCollapse>\n <div ngbAccordionBody>\n <ng-template>\n <ul class=\"list-group\">\n <ng-container\n *ngFor=\"let el of item.fields; let ii = index\">\n <li draggable=\"true\"\n (dragstart)=\"fromDataSourceDragStart(el,ii,i)\"\n class=\"list-group-item\">\n {{ el.displayName }}\n </li>\n </ng-container>\n </ul>\n </ng-template>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n\n\n </div>\n </abp-page>\n\n</form>\n\n<abp-modal [(visible)]=\"visibleTabsOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleTabsChange($event)\">\n <ng-template #abpHeader>\n <h3>{{ editFieldTabsSelect ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldTabsFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldTabsFrom\" (ngSubmit)=\"editFieldTabsSave()\">\n <button type=\"submit\" #editFieldTabsModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldTabsFrom.valid\"\n (click)=\"editFieldTabsModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n\n<abp-modal [(visible)]=\"visibleEditFieldOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleEditFieldChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldFrom\" (ngSubmit)=\"editFieldSave()\">\n <button type=\"submit\" #editFieldModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"required\"\n id=\"required\" />\n <label class=\"form-check-label\" for=\"required\"> {{'Cms::Required' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"showOnList\"\n id=\"showOnList\" />\n <label class=\"form-check-label\" for=\"showOnList\"> {{'Cms::ShowOnList' | abpLocalization}} </label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldFrom.valid\"\n (click)=\"editFieldModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .create-or-edit-entry-type-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-or-edit-entry-type-page .form-control,::ng-deep .create-or-edit-entry-type-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-type-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-type-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit;height:calc(100% - 60px)}::ng-deep .create-or-edit-entry-type-page .tab-pane{height:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i10.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { kind: "directive", type: i10.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i10.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i10.NgbNavItemRole, selector: "[ngbNavItem]:not(ng-container)" }, { kind: "directive", type: i10.NgbNavLinkButton, selector: "button[ngbNavLink]" }, { kind: "directive", type: i10.NgbNavLinkBase, selector: "[ngbNavLink]" }, { kind: "component", type: i10.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { kind: "directive", type: i10.NgbAccordionButton, selector: "button[ngbAccordionButton]" }, { kind: "directive", type: i10.NgbAccordionDirective, selector: "[ngbAccordion]", inputs: ["animation", "closeOthers", "destroyOnHide"], outputs: ["show", "shown", "hide", "hidden"], exportAs: ["ngbAccordion"] }, { kind: "directive", type: i10.NgbAccordionItem, selector: "[ngbAccordionItem]", inputs: ["ngbAccordionItem", "destroyOnHide", "disabled", "collapsed"], outputs: ["show", "shown", "hide", "hidden"], exportAs: ["ngbAccordionItem"] }, { kind: "directive", type: i10.NgbAccordionHeader, selector: "[ngbAccordionHeader]" }, { kind: "directive", type: i10.NgbAccordionBody, selector: "[ngbAccordionBody]" }, { kind: "directive", type: i10.NgbAccordionCollapse, selector: "[ngbAccordionCollapse]", exportAs: ["ngbAccordionCollapse"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
2542
|
-
}
|
|
2543
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CreateOrEditComponent, decorators: [{
|
|
2544
|
-
type: Component,
|
|
2545
|
-
args: [{ selector: 'cms-create-or-edit', providers: [
|
|
2546
|
-
{
|
|
2547
|
-
provide: EXTENSIONS_IDENTIFIER,
|
|
2548
|
-
useValue: ECmsComponent.SectionsCreateOrEdit,
|
|
2549
|
-
},
|
|
2550
|
-
], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (ngSubmit)=\"save()\">\n <abp-page [title]=\"entryTypesId ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)\" [toolbar]=\"true\">\n <div class=\"create-or-edit-entry-type-page\">\n <div class=\"card\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card-body\">\n <div class=\"\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n <div formArrayName=\"fieldTabs\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::FieldLayout' | abpLocalization}}</label>\n <div class=\"container\">\n <!-- -->\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"navActive\" class=\"nav nav-tabs\">\n <ng-container *ngFor=\"let item of resultSource; let i = index\">\n <li [ngbNavItem]=\"i\">\n <button type=\"button\" ngbDropdown ngbNavLink>\n {{ item.name }}\n <span class=\"ms-1\" (click.stop)=\"$event.stopPropagation()\"\n ngbDropdownToggle></span>\n <div ngbDropdownMenu style=\"z-index: 999;\">\n <li ngbDropdownItem type=\"button\"\n (click.stop)=\"editFieldTabs(item,i)\">\n <i class=\"fas fa-edit\"></i>\n {{'AbpUi::Edit' | abpLocalization}}\n </li>\n <li ngbDropdownItem\n *ngIf=\"resultSource.length !== 1\" type=\"button\"\n (click.stop)=\"deleteFieldTabs(i)\">\n <i class=\"fas fa-trash\"></i>\n {{'AbpUi::Delete' | abpLocalization}}\n </li>\n </div>\n </button>\n <ng-template ngbNavContent>\n <div class=\"p-2\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToResultSourceDropped(item,i)\" style=\"height: 100%;\">\n <p class=\"form-text\" *ngIf=\"item.fields.length === 0\">\n {{'Cms::DragAndDropFieldTips' | abpLocalization}}\n </p>\n <ul class=\"list-group\" style=\"height: 100%;\">\n <ng-container\n *ngFor=\"let el of item.fields; let iel = index\">\n <li draggable=\"true\"\n (dragstart)=\"fromResultSourceDragStart(el)\"\n (drop)=\"dragToResultSourceItemDropped(iel)\"\n class=\"list-group-item d-flex align-items-center justify-content-between py-1\" style=\"position: unset;\">\n {{ el.displayName }}\n <button class=\"p-0 btn btn-sm btn-light\"\n (click.stop)=\"EditFieldModalOpen(el,iel)\"\n type=\"button\"><i\n class=\"fas fa-wrench p-sm-1\"\n role=\"button\"></i></button>\n </li>\n </ng-container>\n </ul>\n \n </div>\n </ng-template>\n </li>\n </ng-container>\n <li class=\"nav-item\" role=\"presentation\">\n <button type=\"button\" class=\"nav-link\"\n (click.stop)=\"addFieldTabs()\">\n <i class=\"fas fa-plus-circle\"></i>\n {{'Cms::NewTab' | abpLocalization}}\n </button>\n </li>\n </ul>\n <div [ngbNavOutlet]=\"nav\" class=\"mt-2 bordernNavs p-0\"></div>\n </div>\n <div class=\"col-sm-4\">\n <div ngbAccordion #accordion=\"ngbAccordion\"\n ondragover=\"event.preventDefault();\" (drop)=\"dragToDataSourceDropped()\"\n style=\"min-height: 80px;\">\n <ng-container *ngFor=\"let item of fieldGroupList; let i = index\">\n <div [ngbAccordionItem]=\"item.name\" *ngIf=\"item.fields.length > 0\">\n <h2 ngbAccordionHeader>\n <button ngbAccordionButton>{{\n ('Cms::'+item.name) | abpLocalization }}</button>\n </h2>\n <div ngbAccordionCollapse>\n <div ngbAccordionBody>\n <ng-template>\n <ul class=\"list-group\">\n <ng-container\n *ngFor=\"let el of item.fields; let ii = index\">\n <li draggable=\"true\"\n (dragstart)=\"fromDataSourceDragStart(el,ii,i)\"\n class=\"list-group-item\">\n {{ el.displayName }}\n </li>\n </ng-container>\n </ul>\n </ng-template>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n\n\n </div>\n </abp-page>\n\n</form>\n\n<abp-modal [(visible)]=\"visibleTabsOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleTabsChange($event)\">\n <ng-template #abpHeader>\n <h3>{{ editFieldTabsSelect ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldTabsFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldTabsFrom\" (ngSubmit)=\"editFieldTabsSave()\">\n <button type=\"submit\" #editFieldTabsModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldTabsFrom.valid\"\n (click)=\"editFieldTabsModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n\n<abp-modal [(visible)]=\"visibleEditFieldOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleEditFieldChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldFrom\" (ngSubmit)=\"editFieldSave()\">\n <button type=\"submit\" #editFieldModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"required\"\n id=\"required\" />\n <label class=\"form-check-label\" for=\"required\"> {{'Cms::Required' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"showOnList\"\n id=\"showOnList\" />\n <label class=\"form-check-label\" for=\"showOnList\"> {{'Cms::ShowOnList' | abpLocalization}} </label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldFrom.valid\"\n (click)=\"editFieldModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .create-or-edit-entry-type-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-or-edit-entry-type-page .form-control,::ng-deep .create-or-edit-entry-type-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-type-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-type-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit;height:calc(100% - 60px)}::ng-deep .create-or-edit-entry-type-page .tab-pane{height:100%}\n"] }]
|
|
2551
|
-
}], ctorParameters: function () { return [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: FieldGroupAdminService }, { type: FieldAdminService }, { type: EntryTypeAdminService }, { type: i1.LocalizationService }, { type: CmsApiService }, { type: i3$1.Router }]; }, propDecorators: { submitclick: [{
|
|
2552
|
-
type: ViewChild,
|
|
2553
|
-
args: ['submitclick', { static: true }]
|
|
2554
|
-
}], editFieldTabsModalSubmitBtn: [{
|
|
2555
|
-
type: ViewChild,
|
|
2556
|
-
args: ['editFieldTabsModalSubmitBtn', { static: false }]
|
|
2557
|
-
}], editFieldModalSubmitBtn: [{
|
|
2558
|
-
type: ViewChild,
|
|
2559
|
-
args: ['editFieldModalSubmitBtn', { static: false }]
|
|
2560
|
-
}] } });
|
|
2561
|
-
|
|
2562
|
-
class DomainAdminService {
|
|
2563
|
-
restService;
|
|
2564
|
-
apiName = 'CmsAdmin';
|
|
2565
|
-
getBound = (config) => this.restService.request({
|
|
2566
|
-
method: 'GET',
|
|
2567
|
-
url: '/api/cms-admin/domains/bound',
|
|
2568
|
-
}, { apiName: this.apiName, ...config });
|
|
2569
|
-
nameExists = (domainName, config) => this.restService.request({
|
|
2570
|
-
method: 'GET',
|
|
2571
|
-
url: '/api/cms-admin/domains/name-exists',
|
|
2572
|
-
params: { domainName },
|
|
2573
|
-
}, { apiName: this.apiName, ...config });
|
|
2574
|
-
update = (input, config) => this.restService.request({
|
|
2575
|
-
method: 'POST',
|
|
2576
|
-
url: '/api/cms-admin/domains',
|
|
2577
|
-
body: input,
|
|
2578
|
-
}, { apiName: this.apiName, ...config });
|
|
2579
|
-
constructor(restService) {
|
|
2580
|
-
this.restService = restService;
|
|
2581
|
-
}
|
|
2582
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DomainAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2583
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DomainAdminService, providedIn: 'root' });
|
|
2584
|
-
}
|
|
2585
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DomainAdminService, decorators: [{
|
|
2586
|
-
type: Injectable,
|
|
2587
|
-
args: [{
|
|
2588
|
-
providedIn: 'root',
|
|
2589
|
-
}]
|
|
2590
|
-
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
2591
|
-
|
|
2592
|
-
class DomainsComponent {
|
|
2593
|
-
toaster = inject(ToasterService);
|
|
2594
|
-
_DomainAdminService = inject(DomainAdminService);
|
|
2595
|
-
_LocalizationService = inject(LocalizationService);
|
|
2596
|
-
/**表单实体 */
|
|
2597
|
-
newEntity;
|
|
2598
|
-
/**domain详情 */
|
|
2599
|
-
domainInfo = '';
|
|
2600
|
-
get domainNameInput() {
|
|
2601
|
-
return this.newEntity.get('domainName');
|
|
2602
|
-
}
|
|
2603
|
-
async ngOnInit() {
|
|
2604
|
-
//Called after the constructor, initializing input properties, and the first call to ngOnChanges.
|
|
2605
|
-
//Add 'implements OnInit' to the class.
|
|
2606
|
-
this.newEntity = new FormGroup({
|
|
2607
|
-
domainName: new FormControl('', {
|
|
2608
|
-
asyncValidators: this.repetitionAsyncValidator(),
|
|
2609
|
-
updateOn: 'blur'
|
|
2610
|
-
})
|
|
2611
|
-
});
|
|
2612
|
-
await this.getDomainsBound();
|
|
2613
|
-
}
|
|
2614
|
-
/**用于获取已绑定的域名 */
|
|
2615
|
-
getDomainsBound() {
|
|
2616
|
-
// console.log(111111111,'');
|
|
2617
|
-
return new Promise((resolve, rejects) => {
|
|
2618
|
-
this._DomainAdminService.getBound().subscribe(res => {
|
|
2619
|
-
this.domainNameInput.patchValue(res.domainName);
|
|
2620
|
-
this.domainInfo = res;
|
|
2621
|
-
resolve(res);
|
|
2622
|
-
});
|
|
2623
|
-
});
|
|
2624
|
-
}
|
|
2625
|
-
//检验域名是否已经绑定
|
|
2626
|
-
repetitionAsyncValidator() {
|
|
2627
|
-
return (ctrl) => {
|
|
2628
|
-
return new Promise(resolve => {
|
|
2629
|
-
let domainNameInput = this.domainNameInput.value;
|
|
2630
|
-
if (!domainNameInput) {
|
|
2631
|
-
resolve(null);
|
|
2632
|
-
return;
|
|
2633
|
-
}
|
|
2634
|
-
if (this.domainInfo?.domainName === domainNameInput) {
|
|
2635
|
-
resolve(null);
|
|
2636
|
-
return;
|
|
2637
|
-
}
|
|
2638
|
-
this._DomainAdminService.nameExists(domainNameInput).subscribe(res => {
|
|
2639
|
-
console.log(res, '检验域名是否已经绑定');
|
|
2640
|
-
if (res) {
|
|
2641
|
-
resolve({ repetition: this._LocalizationService.instant(`Cms::DomainName{0}AlreadyExist`, ctrl.value) });
|
|
2642
|
-
}
|
|
2643
|
-
else {
|
|
2644
|
-
resolve(null);
|
|
2645
|
-
}
|
|
2646
|
-
});
|
|
2647
|
-
});
|
|
2648
|
-
};
|
|
2649
|
-
}
|
|
2650
|
-
/**保存 */
|
|
2651
|
-
SaveSubmit() {
|
|
2652
|
-
let input = this.newEntity.value;
|
|
2653
|
-
console.log(input, '保存');
|
|
2654
|
-
this._DomainAdminService.update(input).subscribe(async (res) => {
|
|
2655
|
-
this.toaster.success(this._LocalizationService.instant(`AbpUi::保存成功`));
|
|
2656
|
-
await this.getDomainsBound();
|
|
2657
|
-
});
|
|
2658
|
-
}
|
|
2659
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DomainsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2660
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DomainsComponent, selector: "cms-domains", ngImport: i0, template: "<form [formGroup]=\"newEntity\" (ngSubmit)=\"SaveSubmit()\">\n <h2>{{'Cms::Domain'|abpLocalization}}</h2>\n <hr class=\"my-3\" />\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"title\">{{'Cms::Domain' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"domainName\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"domainNameInput.errors?.repetition\">\n {{sluginput.errors?.repetition}}\n </div>\n </div>\n <hr class=\"my-3\" />\n <button class=\"btn btn-primary \" type=\"submit\"><i\n class=\"me-1 fas fa-save\"></i>{{'AbpUi::Save'|abpLocalization}}</button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
2661
|
-
}
|
|
2662
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DomainsComponent, decorators: [{
|
|
2663
|
-
type: Component,
|
|
2664
|
-
args: [{ selector: 'cms-domains', template: "<form [formGroup]=\"newEntity\" (ngSubmit)=\"SaveSubmit()\">\n <h2>{{'Cms::Domain'|abpLocalization}}</h2>\n <hr class=\"my-3\" />\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"title\">{{'Cms::Domain' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"domainName\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"domainNameInput.errors?.repetition\">\n {{sluginput.errors?.repetition}}\n </div>\n </div>\n <hr class=\"my-3\" />\n <button class=\"btn btn-primary \" type=\"submit\"><i\n class=\"me-1 fas fa-save\"></i>{{'AbpUi::Save'|abpLocalization}}</button>\n</form>" }]
|
|
2665
|
-
}] });
|
|
2666
|
-
|
|
2667
|
-
class EntryConfig {
|
|
2668
|
-
/**多选 */
|
|
2669
|
-
'Entry.Multiple' = [false, []];
|
|
2670
|
-
/**占位符 */
|
|
2671
|
-
'Entry.Placeholder' = ['', []];
|
|
2672
|
-
/**版块id */
|
|
2673
|
-
'Entry.SectionId' = ['', []];
|
|
2674
|
-
constructor(data) {
|
|
2675
|
-
if (data) {
|
|
2676
|
-
for (const key in data) {
|
|
2677
|
-
if (data.hasOwnProperty(key)) {
|
|
2678
|
-
this[key] = data[key];
|
|
2679
|
-
}
|
|
2680
|
-
}
|
|
2681
|
-
}
|
|
2682
|
-
}
|
|
2683
|
-
}
|
|
2684
|
-
|
|
2685
|
-
class EntryConfigComponent {
|
|
2686
|
-
fb;
|
|
2687
|
-
_SectionAdminService;
|
|
2688
|
-
constructor(fb,
|
|
2689
|
-
// private _SiteAdminService: SiteAdminService,
|
|
2690
|
-
_SectionAdminService) {
|
|
2691
|
-
this.fb = fb;
|
|
2692
|
-
this._SectionAdminService = _SectionAdminService;
|
|
2693
|
-
}
|
|
2694
|
-
/**表单控件类型 */
|
|
2695
|
-
_type;
|
|
2696
|
-
set type(v) {
|
|
2697
|
-
if (v == this._type)
|
|
2698
|
-
return;
|
|
2699
|
-
this._type = v;
|
|
2700
|
-
}
|
|
2701
|
-
/**表单实体 */
|
|
2702
|
-
_Entity;
|
|
2703
|
-
set Entity(v) {
|
|
2704
|
-
this._Entity = v;
|
|
2705
|
-
}
|
|
2706
|
-
/**选择的表单信息 */
|
|
2707
|
-
_selected;
|
|
2708
|
-
set selected(v) {
|
|
2709
|
-
this._selected = v;
|
|
2710
|
-
}
|
|
2711
|
-
/**语言 */
|
|
2712
|
-
_culture;
|
|
2713
|
-
set culture(v) {
|
|
2714
|
-
this._culture = v;
|
|
2715
|
-
}
|
|
2716
|
-
get formConfiguration() {
|
|
2717
|
-
return this._Entity.get('formConfiguration');
|
|
2718
|
-
}
|
|
2719
|
-
submitclick;
|
|
2720
|
-
/**站点列表 */
|
|
2721
|
-
siteList = [];
|
|
2722
|
-
/**选择的站点id */
|
|
2723
|
-
// siteId: string = ''
|
|
2724
|
-
siteId = new FormControl('');
|
|
2725
|
-
/**站点下的版块 */
|
|
2726
|
-
SiteOfSectionList = [];
|
|
2727
|
-
ngAfterContentInit() {
|
|
2728
|
-
//Called after ngOnInit when the component's or directive's content has been initialized.
|
|
2729
|
-
//Add 'implements AfterContentInit' to the class.
|
|
2730
|
-
this.dataLoaded(2);
|
|
2731
|
-
}
|
|
2732
|
-
async dataLoaded(val) {
|
|
2733
|
-
if (this._Entity && this._type) {
|
|
2734
|
-
await this.AfterInit();
|
|
2735
|
-
this.submitclick.nativeElement.click();
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
AfterInit() {
|
|
2739
|
-
return new Promise(async (resolve, rejects) => {
|
|
2740
|
-
this._Entity.setControl('formConfiguration', this.fb.group(new EntryConfig()));
|
|
2741
|
-
// await this.getsiteList()
|
|
2742
|
-
await this.getSiteOfSectionList();
|
|
2743
|
-
if (this._selected) {
|
|
2744
|
-
this.formConfiguration.patchValue({
|
|
2745
|
-
...this._selected.formConfiguration
|
|
2746
|
-
});
|
|
2747
|
-
}
|
|
2748
|
-
resolve(true);
|
|
2749
|
-
});
|
|
2750
|
-
}
|
|
2751
|
-
/**获取站点列表 */
|
|
2752
|
-
// getsiteList() {
|
|
2753
|
-
// return new Promise((resolve, rejects) => {
|
|
2754
|
-
// this._SiteAdminService.getList({}).subscribe(res => {
|
|
2755
|
-
// this.siteList = res.items
|
|
2756
|
-
// this.siteId = res.items[0]?.id || ''
|
|
2757
|
-
// resolve(res.items)
|
|
2758
|
-
// })
|
|
2759
|
-
// })
|
|
2760
|
-
// }
|
|
2761
|
-
/**获取站点下的版块 */
|
|
2762
|
-
getSiteOfSectionList() {
|
|
2763
|
-
return new Promise((resolve, rejects) => {
|
|
2764
|
-
this._SectionAdminService.getList({
|
|
2765
|
-
maxResultCount: 1000,
|
|
2766
|
-
// siteId: this.siteId
|
|
2767
|
-
}).subscribe(res => {
|
|
2768
|
-
this.SiteOfSectionList = res.items;
|
|
2769
|
-
this.formConfiguration.patchValue({
|
|
2770
|
-
'Entry.SectionId': res.items[0]?.id || ''
|
|
2771
|
-
});
|
|
2772
|
-
resolve(res.items);
|
|
2773
|
-
});
|
|
2774
|
-
});
|
|
2775
|
-
}
|
|
2776
|
-
/**切换站点 */
|
|
2777
|
-
async siteIdChange() {
|
|
2778
|
-
await this.getSiteOfSectionList();
|
|
2779
|
-
}
|
|
2780
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: SectionAdminService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2781
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EntryConfigComponent, selector: "cms-entry-config", inputs: { type: "type", Entity: "Entity", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sites' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"siteId\" (change)=\"siteIdChange()\">\n <ng-container *ngFor=\"let item of siteList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n</div>\n<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n \n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" formControlName=\"Entry.SectionId\">\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Entry.Multiple\" id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'Cms::Multiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Entry.Placeholder\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
2782
|
-
}
|
|
2783
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryConfigComponent, decorators: [{
|
|
2784
|
-
type: Component,
|
|
2785
|
-
args: [{ selector: 'cms-entry-config', template: "<div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sites' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"siteId\" (change)=\"siteIdChange()\">\n <ng-container *ngFor=\"let item of siteList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n</div>\n<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n \n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" formControlName=\"Entry.SectionId\">\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Entry.Multiple\" id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'Cms::Multiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Entry.Placeholder\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>" }]
|
|
2786
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: SectionAdminService }]; }, propDecorators: { type: [{
|
|
2787
|
-
type: Input
|
|
2788
|
-
}], Entity: [{
|
|
2789
|
-
type: Input
|
|
2790
|
-
}], selected: [{
|
|
2791
|
-
type: Input
|
|
2792
|
-
}], culture: [{
|
|
2793
|
-
type: Input
|
|
2794
|
-
}], submitclick: [{
|
|
2795
|
-
type: ViewChild,
|
|
2796
|
-
args: ['submitclick', { static: true }]
|
|
2797
|
-
}] } });
|
|
2798
|
-
|
|
2799
|
-
class EntryControlComponent {
|
|
2800
|
-
constructor() {
|
|
2801
|
-
}
|
|
2802
|
-
fb = inject(FormBuilder);
|
|
2803
|
-
_EntryAdminService = inject(EntryAdminService);
|
|
2804
|
-
/**表单实体 */
|
|
2805
|
-
_entity;
|
|
2806
|
-
set entity(v) {
|
|
2807
|
-
this._entity = v;
|
|
2808
|
-
if (v)
|
|
2809
|
-
this.dataLoaded();
|
|
2810
|
-
}
|
|
2811
|
-
/**字段配置列表 */
|
|
2812
|
-
_fields = '';
|
|
2813
|
-
set fields(v) {
|
|
2814
|
-
this._fields = v;
|
|
2815
|
-
if (v)
|
|
2816
|
-
this.dataLoaded();
|
|
2817
|
-
}
|
|
2818
|
-
/**父级字段名称,用于为表单设置控件赋值 */
|
|
2819
|
-
_parentFiledName;
|
|
2820
|
-
set parentFiledName(v) {
|
|
2821
|
-
this._parentFiledName = v;
|
|
2822
|
-
if (v)
|
|
2823
|
-
this.dataLoaded();
|
|
2824
|
-
}
|
|
2825
|
-
/**父级字段名称,用于为表单设置控件赋值 */
|
|
2826
|
-
_selected;
|
|
2827
|
-
set selected(v) {
|
|
2828
|
-
this._selected = v || [];
|
|
2829
|
-
if (v)
|
|
2830
|
-
this.dataLoaded();
|
|
2831
|
-
}
|
|
2832
|
-
/**语言 */
|
|
2833
|
-
_culture;
|
|
2834
|
-
set culture(v) {
|
|
2835
|
-
if (v) {
|
|
2836
|
-
this._culture = v;
|
|
2837
|
-
this.dataLoaded();
|
|
2838
|
-
}
|
|
2839
|
-
}
|
|
2840
|
-
submitclick;
|
|
2841
|
-
extraProperties;
|
|
2842
|
-
/** */
|
|
2843
|
-
listOfOption = [];
|
|
2844
|
-
async dataLoaded() {
|
|
2845
|
-
if (this._fields && this._entity && this._parentFiledName && this._culture) {
|
|
2846
|
-
await this.AfterInit();
|
|
2847
|
-
await this.getEntryAssignList();
|
|
2848
|
-
this.submitclick.nativeElement.click();
|
|
2849
|
-
}
|
|
2850
|
-
}
|
|
2851
|
-
AfterInit() {
|
|
2852
|
-
return new Promise((resolve, rejects) => {
|
|
2853
|
-
let ValidatorsArray = [];
|
|
2854
|
-
if (this._fields.required) {
|
|
2855
|
-
ValidatorsArray.push(Validators.required);
|
|
2856
|
-
}
|
|
2857
|
-
let newControl = this.fb.control(this._selected, ValidatorsArray);
|
|
2858
|
-
let extraProperties = this._entity.get(this._parentFiledName);
|
|
2859
|
-
extraProperties.setControl(this._fields.field.name, newControl);
|
|
2860
|
-
resolve(true);
|
|
2861
|
-
});
|
|
2862
|
-
}
|
|
2863
|
-
/**获取对应的条目 */
|
|
2864
|
-
getEntryAssignList(filter = '') {
|
|
2865
|
-
return new Promise((resolve, rejects) => {
|
|
2866
|
-
this._EntryAdminService.getList({
|
|
2867
|
-
culture: this._culture,
|
|
2868
|
-
sectionId: this._fields.field.formConfiguration['Entry.SectionId'],
|
|
2869
|
-
skipCount: 0,
|
|
2870
|
-
maxResultCount: 30,
|
|
2871
|
-
status: EntryStatus.Published,
|
|
2872
|
-
filter: filter
|
|
2873
|
-
}).subscribe(res => {
|
|
2874
|
-
this.listOfOption = res.items;
|
|
2875
|
-
resolve(true);
|
|
2876
|
-
});
|
|
2877
|
-
});
|
|
2878
|
-
}
|
|
2879
|
-
/** */
|
|
2880
|
-
async SelectChange(event) {
|
|
2881
|
-
await this.getEntryAssignList(event);
|
|
2882
|
-
}
|
|
2883
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2884
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: EntryControlComponent, selector: "cms-entry-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\r\n <div [formGroupName]=\"_parentFiledName\" class=\"entry-control-page\">\r\n <div class=\"mb-2\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <ng-container *ngIf=\"_fields.field.formConfiguration['Entry.Multiple']; else elseTemplate\">\r\n <div class=\"form-select\">\r\n <nz-select [nzMaxTagCount]=\"5\" (nzOnSearch)=\"SelectChange($event)\" nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <div class=\"form-select\">\r\n <nz-select nzShowSearch (nzOnSearch)=\"SelectChange($event)\" [nzMaxMultipleCount]=\"1\" nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>", styles: ["::ng-deep .entry-control-page .form-select{padding:0}::ng-deep .entry-control-page nz-select{width:100%}::ng-deep .entry-control-page nz-select .ant-select-selector{background:transparent!important;border:none!important;padding:.275rem 1.25rem!important;box-shadow:none!important;height:auto!important}::ng-deep .entry-control-page nz-select .anticon-search,::ng-deep .entry-control-page nz-select .anticon-down{display:none}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i4.NzOptionComponent, selector: "nz-option", inputs: ["nzLabel", "nzValue", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus"], exportAs: ["nzSelect"] }] });
|
|
2885
|
-
}
|
|
2886
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EntryControlComponent, decorators: [{
|
|
2887
|
-
type: Component,
|
|
2888
|
-
args: [{ selector: 'cms-entry-control', template: "<form [formGroup]=\"_entity\">\r\n <div [formGroupName]=\"_parentFiledName\" class=\"entry-control-page\">\r\n <div class=\"mb-2\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <ng-container *ngIf=\"_fields.field.formConfiguration['Entry.Multiple']; else elseTemplate\">\r\n <div class=\"form-select\">\r\n <nz-select [nzMaxTagCount]=\"5\" (nzOnSearch)=\"SelectChange($event)\" nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <div class=\"form-select\">\r\n <nz-select nzShowSearch (nzOnSearch)=\"SelectChange($event)\" [nzMaxMultipleCount]=\"1\" nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>", styles: ["::ng-deep .entry-control-page .form-select{padding:0}::ng-deep .entry-control-page nz-select{width:100%}::ng-deep .entry-control-page nz-select .ant-select-selector{background:transparent!important;border:none!important;padding:.275rem 1.25rem!important;box-shadow:none!important;height:auto!important}::ng-deep .entry-control-page nz-select .anticon-search,::ng-deep .entry-control-page nz-select .anticon-down{display:none}\n"] }]
|
|
2889
|
-
}], ctorParameters: function () { return []; }, propDecorators: { entity: [{
|
|
2890
|
-
type: Input
|
|
2891
|
-
}], fields: [{
|
|
2892
|
-
type: Input
|
|
2893
|
-
}], parentFiledName: [{
|
|
2894
|
-
type: Input
|
|
2895
|
-
}], selected: [{
|
|
2896
|
-
type: Input
|
|
2897
|
-
}], culture: [{
|
|
2898
|
-
type: Input
|
|
2899
|
-
}], submitclick: [{
|
|
2900
|
-
type: ViewChild,
|
|
2901
|
-
args: ['submitclick', { static: true }]
|
|
2902
|
-
}] } });
|
|
2903
|
-
|
|
2904
|
-
class MatrixConfig {
|
|
2905
|
-
// 矩阵类型
|
|
2906
|
-
'MatrixBlockTypes' = new FormArray([]);
|
|
2907
|
-
constructor(data) {
|
|
2908
|
-
if (data) {
|
|
2909
|
-
for (const key in data) {
|
|
2910
|
-
if (data.hasOwnProperty(key)) {
|
|
2911
|
-
this[key] = data[key];
|
|
2912
|
-
}
|
|
2913
|
-
}
|
|
2914
|
-
}
|
|
2915
|
-
}
|
|
2916
|
-
}
|
|
2917
|
-
class MatrixItemConfig {
|
|
2918
|
-
displayName = ['', [Validators.required]];
|
|
2919
|
-
/**字段名字 */
|
|
2920
|
-
name = ['', [Validators.required]];
|
|
2921
|
-
constructor(data) {
|
|
2922
|
-
if (data) {
|
|
2923
|
-
for (const key in data) {
|
|
2924
|
-
if (data.hasOwnProperty(key)) {
|
|
2925
|
-
this[key] = data[key];
|
|
2926
|
-
}
|
|
2927
|
-
}
|
|
2928
|
-
}
|
|
2929
|
-
}
|
|
2930
|
-
}
|
|
2931
|
-
class matrixFieldInputBase {
|
|
2932
|
-
/**字段名称 Display name of this field */
|
|
2933
|
-
displayName = ['', [Validators.required]];
|
|
2934
|
-
/**字段唯一名称 Unique Name*/
|
|
2935
|
-
name = ['', [Validators.required]];
|
|
2936
|
-
/**描述 说明 */
|
|
2937
|
-
description = ['', []];
|
|
2938
|
-
/**FieldType字段类型 表单控件名称 */
|
|
2939
|
-
formControlName = ['TextEdit', [Validators.required]];
|
|
2940
|
-
/**动态表单配置 */
|
|
2941
|
-
formConfiguration = new FormGroup({});
|
|
2942
|
-
constructor(data) {
|
|
2943
|
-
if (data) {
|
|
2944
|
-
for (const key in data) {
|
|
2945
|
-
if (data.hasOwnProperty(key)) {
|
|
2946
|
-
this[key] = data[key];
|
|
2947
|
-
}
|
|
2948
|
-
}
|
|
2949
|
-
}
|
|
2950
|
-
}
|
|
2951
|
-
}
|
|
2952
|
-
|
|
2953
|
-
class MatrixConfigComponent {
|
|
2954
|
-
fb;
|
|
2955
|
-
_CmsApiService;
|
|
2956
|
-
_FieldAbstractsService;
|
|
2957
|
-
constructor(fb, _CmsApiService, _FieldAbstractsService) {
|
|
2958
|
-
this.fb = fb;
|
|
2959
|
-
this._CmsApiService = _CmsApiService;
|
|
2960
|
-
this._FieldAbstractsService = _FieldAbstractsService;
|
|
2961
|
-
}
|
|
2962
|
-
/**表单控件组 */
|
|
2963
|
-
_FieldControlGroup;
|
|
2964
|
-
/**表单控件类型 */
|
|
2965
|
-
_type;
|
|
2966
|
-
set type(v) {
|
|
2967
|
-
this._type = v;
|
|
2968
|
-
this.dataLoaded();
|
|
2969
|
-
}
|
|
2970
|
-
/**表单实体 */
|
|
2971
|
-
_Entity;
|
|
2972
|
-
set Entity(v) {
|
|
2973
|
-
this._Entity = v;
|
|
2974
|
-
this.dataLoaded();
|
|
2975
|
-
}
|
|
2976
|
-
/**选择的表单信息 */
|
|
2977
|
-
_selected;
|
|
2978
|
-
set selected(v) {
|
|
2979
|
-
if (v) {
|
|
2980
|
-
this._selected = v;
|
|
2981
|
-
this.dataLoaded();
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
|
-
submitclick;
|
|
2985
|
-
async dataLoaded() {
|
|
2986
|
-
if (this._Entity && this._type) {
|
|
2987
|
-
await this.AfterInit();
|
|
2988
|
-
this.submitclick.nativeElement.click();
|
|
2989
|
-
}
|
|
2990
|
-
}
|
|
2991
|
-
AfterInit() {
|
|
2992
|
-
return new Promise(async (resolve, rejects) => {
|
|
2993
|
-
this._FieldControlGroup = this._FieldAbstractsService.getExcludeAssignControl(this._type);
|
|
2994
|
-
this._Entity.setControl('formConfiguration', this.fb.group(new MatrixConfig()));
|
|
2995
|
-
await this.setSelectValue();
|
|
2996
|
-
this.formConfiguration.patchValue(this._selected.formConfiguration);
|
|
2997
|
-
resolve(true);
|
|
2998
|
-
});
|
|
2999
|
-
}
|
|
3000
|
-
setSelectValue() {
|
|
3001
|
-
return new Promise((resolve, rejects) => {
|
|
3002
|
-
if (this._selected && this._selected.formControlName == this._type) {
|
|
3003
|
-
this._selected.formConfiguration['MatrixBlockTypes'].forEach(((el, index) => {
|
|
3004
|
-
this.addMatrixBlockTypeItem(el);
|
|
3005
|
-
el.fields.forEach((elf, indexf) => {
|
|
3006
|
-
this.addMatrixFieldItem(elf, index);
|
|
3007
|
-
});
|
|
3008
|
-
}));
|
|
3009
|
-
resolve(true);
|
|
3010
|
-
}
|
|
3011
|
-
});
|
|
3012
|
-
}
|
|
3013
|
-
/**获取表单配置 */
|
|
3014
|
-
get formConfiguration() {
|
|
3015
|
-
return this._Entity.get('formConfiguration');
|
|
3016
|
-
}
|
|
3017
|
-
/**获取表单配置下的矩阵块表单数组 */
|
|
3018
|
-
get MatrixBlockTypes() {
|
|
3019
|
-
return this.formConfiguration.controls['MatrixBlockTypes'];
|
|
3020
|
-
}
|
|
3021
|
-
/**模态框-状态 */
|
|
3022
|
-
matrixModalOpen = false;
|
|
3023
|
-
/**模态框-是否正在编辑 */
|
|
3024
|
-
isMatrixModalEdit = false;
|
|
3025
|
-
/**模态框-用于确定模态的繁忙状态是否为真 */
|
|
3026
|
-
modalBusy = false;
|
|
3027
|
-
/**模态框-表单 */
|
|
3028
|
-
matrixModalForm;
|
|
3029
|
-
/**表单控件模板-用于在form外提交submit */
|
|
3030
|
-
matrixModalModalSubmit;
|
|
3031
|
-
/**矩阵块-选择的下标 */
|
|
3032
|
-
selectMatrixBlockIndex = 0;
|
|
3033
|
-
/**矩阵块-选择的矩阵下字段的下标 */
|
|
3034
|
-
selectMatrixFieldIndex = 0;
|
|
3035
|
-
/**模态框-状态改变 */
|
|
3036
|
-
matrixModalVisibleChange(event) {
|
|
3037
|
-
if (!event) {
|
|
3038
|
-
this.isMatrixModalEdit = false;
|
|
3039
|
-
this.matrixModalForm = undefined;
|
|
3040
|
-
return;
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3043
|
-
/**矩阵块--新增-打开模态框 */
|
|
3044
|
-
addMatrixBlockType() {
|
|
3045
|
-
this.matrixModalForm = this.fb.group(new MatrixItemConfig());
|
|
3046
|
-
this.matrixModalOpen = true;
|
|
3047
|
-
}
|
|
3048
|
-
/**模态框--矩阵表单保存提交 */
|
|
3049
|
-
createOrEditSave() {
|
|
3050
|
-
let input = this.matrixModalForm.value;
|
|
3051
|
-
if (!this.matrixModalForm.valid)
|
|
3052
|
-
return;
|
|
3053
|
-
if (this.isMatrixModalEdit) {
|
|
3054
|
-
let MatrixBlockTypesItem = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
|
|
3055
|
-
MatrixBlockTypesItem.patchValue({
|
|
3056
|
-
...input
|
|
3057
|
-
});
|
|
3058
|
-
}
|
|
3059
|
-
else {
|
|
3060
|
-
this.addMatrixBlockTypeItem(input);
|
|
3061
|
-
}
|
|
3062
|
-
this.matrixModalOpen = false;
|
|
3063
|
-
}
|
|
3064
|
-
/**新增矩阵块-向数组表单中增加项 */
|
|
3065
|
-
addMatrixBlockTypeItem(input) {
|
|
3066
|
-
this.MatrixBlockTypes.push(new FormGroup({
|
|
3067
|
-
displayName: new FormControl(input.displayName, Validators.required),
|
|
3068
|
-
name: new FormControl(input.name, Validators.required),
|
|
3069
|
-
fields: new FormArray([])
|
|
3070
|
-
}));
|
|
3071
|
-
}
|
|
3072
|
-
/**编辑矩阵块 */
|
|
3073
|
-
EditMatrixBlock(input) {
|
|
3074
|
-
this.matrixModalForm = this.fb.group(new MatrixItemConfig());
|
|
3075
|
-
this.matrixModalForm.patchValue({
|
|
3076
|
-
...input
|
|
3077
|
-
});
|
|
3078
|
-
this.matrixModalOpen = true;
|
|
3079
|
-
this.isMatrixModalEdit = true;
|
|
3080
|
-
}
|
|
3081
|
-
/**删除矩阵块 */
|
|
3082
|
-
DeleteMatrixBlock(index) {
|
|
3083
|
-
this.MatrixBlockTypes.removeAt(index);
|
|
3084
|
-
}
|
|
3085
|
-
/**矩阵块-选择 */
|
|
3086
|
-
selectMatrixBlockChange(index) {
|
|
3087
|
-
this.selectMatrixBlockIndex = index;
|
|
3088
|
-
}
|
|
3089
|
-
/**矩阵字段-新增 */
|
|
3090
|
-
addMatrixField() {
|
|
3091
|
-
this.addMatrixFieldItem('', this.selectMatrixBlockIndex);
|
|
3092
|
-
}
|
|
3093
|
-
/**矩阵字段-新增矩阵字段项 */
|
|
3094
|
-
addMatrixFieldItem(input = '', selectMatrixBlockIndex) {
|
|
3095
|
-
/**矩阵下标的矩阵项Form */
|
|
3096
|
-
let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(selectMatrixBlockIndex);
|
|
3097
|
-
let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
|
|
3098
|
-
MatrixFieldItemForm.push(this.fb.group({
|
|
3099
|
-
/**字段名称 Display name of this field */
|
|
3100
|
-
displayName: [input.displayName, [Validators.required]],
|
|
3101
|
-
/**字段唯一名称 Unique Name*/
|
|
3102
|
-
name: [input.name, [Validators.required]],
|
|
3103
|
-
/**描述 说明 */
|
|
3104
|
-
description: [input.description, []],
|
|
3105
|
-
/**FieldType字段类型 表单控件名称 */
|
|
3106
|
-
formControlName: [input.formControlName || 'TextEdit', [Validators.required]],
|
|
3107
|
-
//动态表单配置
|
|
3108
|
-
formConfiguration: new FormGroup({}),
|
|
3109
|
-
}));
|
|
3110
|
-
//
|
|
3111
|
-
}
|
|
3112
|
-
/**删除矩阵字段项 */
|
|
3113
|
-
deleteMatrixField(MatrixFieldForm, index) {
|
|
3114
|
-
MatrixFieldForm.removeAt(index);
|
|
3115
|
-
this.selectMatrixFieldIndex = 0;
|
|
3116
|
-
}
|
|
3117
|
-
/**矩阵字段-选择 */
|
|
3118
|
-
selectMatrixFieldChange(MatrixBlockIndex, MatrixFieldIndex) {
|
|
3119
|
-
this.selectMatrixFieldIndex = MatrixFieldIndex;
|
|
3120
|
-
}
|
|
3121
|
-
get nameInput() {
|
|
3122
|
-
return this.matrixModalForm?.get('name');
|
|
3123
|
-
}
|
|
3124
|
-
get FieldnameInput() {
|
|
3125
|
-
let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
|
|
3126
|
-
let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
|
|
3127
|
-
return MatrixFieldItemForm.at(this.selectMatrixFieldIndex).get('name');
|
|
3128
|
-
}
|
|
3129
|
-
/**矩阵displayNameInput字段失去焦点 */
|
|
3130
|
-
displayNameInputBlur(event) {
|
|
3131
|
-
let value = event.target.value;
|
|
3132
|
-
let pinyin = this._CmsApiService.chineseToPinyin(value);
|
|
3133
|
-
let nameInput = this.nameInput;
|
|
3134
|
-
if (nameInput.value)
|
|
3135
|
-
return;
|
|
3136
|
-
nameInput.patchValue(pinyin);
|
|
3137
|
-
}
|
|
3138
|
-
/**矩阵displayNameInput字段失去焦点 */
|
|
3139
|
-
MatrixFieldDisplayNameInputBlur(event) {
|
|
3140
|
-
let value = event.target.value;
|
|
3141
|
-
let pinyin = this._CmsApiService.chineseToPinyin(value);
|
|
3142
|
-
let FieldnameInput = this.FieldnameInput;
|
|
3143
|
-
if (FieldnameInput.value)
|
|
3144
|
-
return;
|
|
3145
|
-
FieldnameInput.patchValue(pinyin);
|
|
3146
|
-
}
|
|
3147
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MatrixConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: CmsApiService }, { token: FieldAbstractsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3148
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MatrixConfigComponent, selector: "df-matrix-config", inputs: { type: "type", Entity: "Entity", selected: "selected" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }, { propertyName: "matrixModalModalSubmit", first: true, predicate: ["matrixModalModalSubmit"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::::FormControl:Matrix' | abpLocalization}}</label>\n <div class=\"row\">\n <div class=\"col-md-3\">\n <div class=\"list-group\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::MatrixBlockType' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixBlockType()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixBlockChange(i)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"i===selectMatrixBlockIndex\">\n <div>\n <div>{{item.value.displayName}}</div>\n <div>{{item.value.name}}</div>\n </div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-light btn-sm\" id=\"dropdownBasic1\"\n style=\"z-index: 8;\" ngbDropdownToggle></button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\" style=\"z-index: 9;\">\n <button ngbDropdownItem\n (click.stop)=\"EditMatrixBlock(item.value)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"DeleteMatrixBlock(i)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"list-group\" *ngIf=\"MatrixBlockTypes?.controls.length>0\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::Fields' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixField()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <ng-container *ngIf=\"i === selectMatrixBlockIndex\">\n <ng-container *ngFor=\"let el of item.controls['fields'].controls;let fi =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixFieldChange(i,fi)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"fi===selectMatrixFieldIndex\">\n <div>\n <div>{{el.value.displayName}}</div>\n <div>{{el.value.name}}</div>\n </div>\n <button type=\"button\"\n (click.stop)=\"deleteMatrixField(item.controls['fields'],fi)\"\n class=\"btn btn-sm btn-li\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-6\" formArrayName=\"MatrixBlockTypes\">\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <div [formGroupName]=\"i\" [hidden]=\"i !== selectMatrixBlockIndex\">\n <div formArrayName=\"fields\">\n <ng-container *ngFor=\"let itemf of item.controls['fields'].controls;let fi =index\">\n <div [formGroupName]=\"fi\" [hidden]=\"fi !== selectMatrixFieldIndex\">\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"MatrixFieldDisplayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n <div class=\"form-text\">\n {{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"setConfigComponent()\">\n <ng-container *ngFor=\"let itemC of _FieldControlGroup;let i =index\">\n <option [value]=\"itemC.name\">{{itemC.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"itemf.value.formControlName&&item\">\n <df-dynamic [type]=\"itemf.value.formControlName\" [entity]=\"item\"\n [selected]=\"_selected?_selected['formConfiguration']['MatrixBlockTypes'][i]['fields'][fi]:''\"></df-dynamic>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n\n<abp-modal [(visible)]=\"matrixModalOpen\" [busy]=\"modalBusy\" (visibleChange)=\"matrixModalVisibleChange($event)\" >\n <ng-template #abpHeader>\n <h3>{{isMatrixEdit?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"matrixModalForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"matrixModalForm\"\n (ngSubmit)=\"createOrEditSave()\">\n <button type=\"submit\" #matrixModalModalSubmit style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"displayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"matrixModalModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["disabled"] }, { kind: "component", type: i8$1.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
3149
|
-
}
|
|
3150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MatrixConfigComponent, decorators: [{
|
|
3151
|
-
type: Component,
|
|
3152
|
-
args: [{ selector: 'df-matrix-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::::FormControl:Matrix' | abpLocalization}}</label>\n <div class=\"row\">\n <div class=\"col-md-3\">\n <div class=\"list-group\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::MatrixBlockType' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixBlockType()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixBlockChange(i)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"i===selectMatrixBlockIndex\">\n <div>\n <div>{{item.value.displayName}}</div>\n <div>{{item.value.name}}</div>\n </div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-light btn-sm\" id=\"dropdownBasic1\"\n style=\"z-index: 8;\" ngbDropdownToggle></button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\" style=\"z-index: 9;\">\n <button ngbDropdownItem\n (click.stop)=\"EditMatrixBlock(item.value)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"DeleteMatrixBlock(i)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"list-group\" *ngIf=\"MatrixBlockTypes?.controls.length>0\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::Fields' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixField()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <ng-container *ngIf=\"i === selectMatrixBlockIndex\">\n <ng-container *ngFor=\"let el of item.controls['fields'].controls;let fi =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixFieldChange(i,fi)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"fi===selectMatrixFieldIndex\">\n <div>\n <div>{{el.value.displayName}}</div>\n <div>{{el.value.name}}</div>\n </div>\n <button type=\"button\"\n (click.stop)=\"deleteMatrixField(item.controls['fields'],fi)\"\n class=\"btn btn-sm btn-li\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-6\" formArrayName=\"MatrixBlockTypes\">\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <div [formGroupName]=\"i\" [hidden]=\"i !== selectMatrixBlockIndex\">\n <div formArrayName=\"fields\">\n <ng-container *ngFor=\"let itemf of item.controls['fields'].controls;let fi =index\">\n <div [formGroupName]=\"fi\" [hidden]=\"fi !== selectMatrixFieldIndex\">\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"MatrixFieldDisplayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n <div class=\"form-text\">\n {{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"setConfigComponent()\">\n <ng-container *ngFor=\"let itemC of _FieldControlGroup;let i =index\">\n <option [value]=\"itemC.name\">{{itemC.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"itemf.value.formControlName&&item\">\n <df-dynamic [type]=\"itemf.value.formControlName\" [entity]=\"item\"\n [selected]=\"_selected?_selected['formConfiguration']['MatrixBlockTypes'][i]['fields'][fi]:''\"></df-dynamic>\n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n\n<abp-modal [(visible)]=\"matrixModalOpen\" [busy]=\"modalBusy\" (visibleChange)=\"matrixModalVisibleChange($event)\" >\n <ng-template #abpHeader>\n <h3>{{isMatrixEdit?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"matrixModalForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"matrixModalForm\"\n (ngSubmit)=\"createOrEditSave()\">\n <button type=\"submit\" #matrixModalModalSubmit style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"displayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"matrixModalModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>" }]
|
|
3153
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: CmsApiService }, { type: FieldAbstractsService }]; }, propDecorators: { type: [{
|
|
3154
|
-
type: Input
|
|
3155
|
-
}], Entity: [{
|
|
3156
|
-
type: Input
|
|
3157
|
-
}], selected: [{
|
|
3158
|
-
type: Input
|
|
3159
|
-
}], submitclick: [{
|
|
3160
|
-
type: ViewChild,
|
|
3161
|
-
args: ['submitclick', { static: true }]
|
|
3162
|
-
}], matrixModalModalSubmit: [{
|
|
3163
|
-
type: ViewChild,
|
|
3164
|
-
args: ['matrixModalModalSubmit', { static: false }]
|
|
3165
|
-
}] } });
|
|
3166
|
-
|
|
3167
|
-
class MatrixControlComponent {
|
|
3168
|
-
fb;
|
|
3169
|
-
constructor(fb) {
|
|
3170
|
-
this.fb = fb;
|
|
3171
|
-
}
|
|
3172
|
-
/**表单实体 */
|
|
3173
|
-
_entity;
|
|
3174
|
-
set entity(v) {
|
|
3175
|
-
this._entity = v;
|
|
3176
|
-
this.dataLoaded();
|
|
3177
|
-
}
|
|
3178
|
-
/**字段配置列表 */
|
|
3179
|
-
_fields = '';
|
|
3180
|
-
set fields(v) {
|
|
3181
|
-
this._fields = v;
|
|
3182
|
-
this.dataLoaded();
|
|
3183
|
-
}
|
|
3184
|
-
/**父级字段名称,用于为表单设置控件赋值 */
|
|
3185
|
-
_parentFiledName;
|
|
3186
|
-
set parentFiledName(v) {
|
|
3187
|
-
this._parentFiledName = v;
|
|
3188
|
-
this.dataLoaded();
|
|
3189
|
-
}
|
|
3190
|
-
/**父级字段名称,用于为表单设置控件赋值 */
|
|
3191
|
-
_selected;
|
|
3192
|
-
set selected(v) {
|
|
3193
|
-
this._selected = v;
|
|
3194
|
-
if (v) {
|
|
3195
|
-
this.dataLoaded();
|
|
3196
|
-
}
|
|
3197
|
-
}
|
|
3198
|
-
/**语言 */
|
|
3199
|
-
_culture;
|
|
3200
|
-
set culture(v) {
|
|
3201
|
-
this._culture = v;
|
|
3202
|
-
}
|
|
3203
|
-
submitclick;
|
|
3204
|
-
/** 获取父级字段代表的表单组*/
|
|
3205
|
-
extraProperties;
|
|
3206
|
-
/**数据加载完成 */
|
|
3207
|
-
async dataLoaded() {
|
|
3208
|
-
if (this._fields && this._entity && this._parentFiledName) {
|
|
3209
|
-
this.extraProperties = this._entity.get(this._parentFiledName);
|
|
3210
|
-
await this.AfterInit();
|
|
3211
|
-
this.submitclick.nativeElement.click();
|
|
3212
|
-
if (this._selected)
|
|
3213
|
-
this.fieldNameControl.patchValue(this._selected);
|
|
3214
|
-
}
|
|
3215
|
-
}
|
|
3216
|
-
formConfiguration;
|
|
3217
|
-
/**获取表格字段代表的控件 */
|
|
3218
|
-
fieldNameControl;
|
|
3219
|
-
AfterInit() {
|
|
3220
|
-
return new Promise((resolve, rejects) => {
|
|
3221
|
-
let formConfiguration = this._fields.field.formConfiguration;
|
|
3222
|
-
let newArrayGroup = this.fb.array([]);
|
|
3223
|
-
this.extraProperties.setControl(this._fields.field.name, newArrayGroup);
|
|
3224
|
-
this.fieldNameControl = this.extraProperties.get(this._fields.field.name);
|
|
3225
|
-
if (this._selected) {
|
|
3226
|
-
this._selected.forEach(el => {
|
|
3227
|
-
this.addMatrixControl(formConfiguration.MatrixBlockTypes.find(item => item.name == el.matrixBlockTypeName));
|
|
3228
|
-
});
|
|
3229
|
-
}
|
|
3230
|
-
this.MatrixBlockTypesList = formConfiguration.MatrixBlockTypes;
|
|
3231
|
-
resolve(true);
|
|
3232
|
-
});
|
|
3233
|
-
}
|
|
3234
|
-
/**矩阵列表 */
|
|
3235
|
-
MatrixBlockTypesList = [];
|
|
3236
|
-
/**增加指定矩阵控件项 */
|
|
3237
|
-
addMatrixControl(item) {
|
|
3238
|
-
this.fieldNameControl.push(this.fb.group({
|
|
3239
|
-
extraProperties: new FormGroup({}),
|
|
3240
|
-
matrixBlockTypeName: [item.name],
|
|
3241
|
-
displayName: [item.displayName]
|
|
3242
|
-
}));
|
|
3243
|
-
}
|
|
3244
|
-
/**删除矩阵控件 */
|
|
3245
|
-
deleteMatrixControl(index) {
|
|
3246
|
-
this.fieldNameControl.removeAt(index);
|
|
3247
|
-
}
|
|
3248
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MatrixControlComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
|
|
3249
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MatrixControlComponent, selector: "df-matrix-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <div [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls;let i=index\">\n <div class=\"card mb-3 border \" [formGroupName]=\"i\">\n <div class=\"card-header d-flex align-items-center justify-content-between border-bottom pt-1\">\n <div>{{item.value.displayName}}</div>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteMatrixControl(i)\"><i\n class=\"fas fa-trash p-2\"></i></button>\n </div>\n <div class=\"card-body\">\n <ng-container *ngFor=\"let el of MatrixBlockTypesList;let il =index\">\n <ng-container *ngIf=\"el.name===item.value.matrixBlockTypeName\">\n <ng-container *ngFor=\"let elf of el.fields; let fi=index\">\n <ng-container>\n <df-dynamic [entity]=\"item\"\n [fields]=\"{ field: elf,displayName:elf.displayName }\"\n [selected]=\"_selected ? _selected[i][_parentFiledName][elf.name]: ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n <div>\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">\n <ng-container *ngFor=\"let item of MatrixBlockTypesList;let i =index\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" (click.stop)=\"addMatrixControl(item)\"><i\n class=\"fas fa-plus me-1\"></i>{{item.displayName}}</button>\n </ng-container>\n </div>\n </div>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }] });
|
|
3250
|
-
}
|
|
3251
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MatrixControlComponent, decorators: [{
|
|
3252
|
-
type: Component,
|
|
3253
|
-
args: [{ selector: 'df-matrix-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <div [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls;let i=index\">\n <div class=\"card mb-3 border \" [formGroupName]=\"i\">\n <div class=\"card-header d-flex align-items-center justify-content-between border-bottom pt-1\">\n <div>{{item.value.displayName}}</div>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteMatrixControl(i)\"><i\n class=\"fas fa-trash p-2\"></i></button>\n </div>\n <div class=\"card-body\">\n <ng-container *ngFor=\"let el of MatrixBlockTypesList;let il =index\">\n <ng-container *ngIf=\"el.name===item.value.matrixBlockTypeName\">\n <ng-container *ngFor=\"let elf of el.fields; let fi=index\">\n <ng-container>\n <df-dynamic [entity]=\"item\"\n [fields]=\"{ field: elf,displayName:elf.displayName }\"\n [selected]=\"_selected ? _selected[i][_parentFiledName][elf.name]: ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n <div>\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">\n <ng-container *ngFor=\"let item of MatrixBlockTypesList;let i =index\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" (click.stop)=\"addMatrixControl(item)\"><i\n class=\"fas fa-plus me-1\"></i>{{item.displayName}}</button>\n </ng-container>\n </div>\n </div>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>" }]
|
|
3254
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }]; }, propDecorators: { entity: [{
|
|
3255
|
-
type: Input
|
|
3256
|
-
}], fields: [{
|
|
3257
|
-
type: Input
|
|
3258
|
-
}], parentFiledName: [{
|
|
3259
|
-
type: Input
|
|
3260
|
-
}], selected: [{
|
|
3261
|
-
type: Input
|
|
3262
|
-
}], culture: [{
|
|
3263
|
-
type: Input
|
|
3264
|
-
}], submitclick: [{
|
|
3265
|
-
type: ViewChild,
|
|
3266
|
-
args: ['submitclick', { static: true }]
|
|
3267
|
-
}] } });
|
|
3268
|
-
|
|
3269
|
-
class TableConfig {
|
|
3270
|
-
// 选项
|
|
3271
|
-
TableColumns = new FormArray([]);
|
|
3272
|
-
constructor(data) {
|
|
3273
|
-
if (data) {
|
|
3274
|
-
for (const key in data) {
|
|
3275
|
-
if (data.hasOwnProperty(key)) {
|
|
3276
|
-
this[key] = data[key];
|
|
3277
|
-
}
|
|
3278
|
-
}
|
|
3279
|
-
}
|
|
3280
|
-
}
|
|
3281
|
-
}
|
|
3282
|
-
class TableFormControl {
|
|
3283
|
-
/**列标题 */
|
|
3284
|
-
displayName = ['', [Validators.required]];
|
|
3285
|
-
/**空间配置 */
|
|
3286
|
-
formConfiguration = new FormGroup({});
|
|
3287
|
-
/**列名 */
|
|
3288
|
-
name = ['', [Validators.required]];
|
|
3289
|
-
//控件标识
|
|
3290
|
-
formControlName = ['', [Validators.required]];
|
|
3291
|
-
/**是否必填 */
|
|
3292
|
-
required = [false];
|
|
3293
|
-
/**描述 */
|
|
3294
|
-
description = [''];
|
|
3295
|
-
constructor(data) {
|
|
3296
|
-
if (data) {
|
|
3297
|
-
for (const key in data) {
|
|
3298
|
-
if (data.hasOwnProperty(key)) {
|
|
3299
|
-
this[key] = data[key];
|
|
3300
|
-
}
|
|
3301
|
-
}
|
|
3302
|
-
}
|
|
3303
|
-
}
|
|
3304
|
-
}
|
|
3305
|
-
|
|
3306
|
-
class TableConfigComponent {
|
|
3307
|
-
fb;
|
|
3308
|
-
_CmsApiService;
|
|
3309
|
-
_FieldAbstractsService;
|
|
3310
|
-
constructor(fb, _CmsApiService, _FieldAbstractsService) {
|
|
3311
|
-
this.fb = fb;
|
|
3312
|
-
this._CmsApiService = _CmsApiService;
|
|
3313
|
-
this._FieldAbstractsService = _FieldAbstractsService;
|
|
3314
|
-
}
|
|
3315
|
-
/**表单实体 */
|
|
3316
|
-
_Entity;
|
|
3317
|
-
set Entity(v) {
|
|
3318
|
-
this._Entity = v;
|
|
3319
|
-
this.dataLoaded();
|
|
3320
|
-
}
|
|
3321
|
-
/**选择的表单信息 */
|
|
3322
|
-
_selected;
|
|
3323
|
-
set selected(v) {
|
|
3324
|
-
if (v) {
|
|
3325
|
-
this._selected = v;
|
|
3326
|
-
this.dataLoaded();
|
|
3327
|
-
}
|
|
3328
|
-
}
|
|
3329
|
-
/**表单控件组 */
|
|
3330
|
-
_fieldControlGroup;
|
|
3331
|
-
/**表单控件类型 */
|
|
3332
|
-
_type;
|
|
3333
|
-
set type(v) {
|
|
3334
|
-
this._type = v;
|
|
3335
|
-
this.dataLoaded();
|
|
3336
|
-
}
|
|
3337
|
-
get formConfiguration() {
|
|
3338
|
-
return this._Entity.get('formConfiguration');
|
|
3339
|
-
}
|
|
3340
|
-
get TableColumns() {
|
|
3341
|
-
return this.formConfiguration.controls['TableColumns'];
|
|
3342
|
-
}
|
|
3343
|
-
submitclick;
|
|
3344
|
-
async dataLoaded() {
|
|
3345
|
-
if (this._Entity && this._type) {
|
|
3346
|
-
await this.AfterInit();
|
|
3347
|
-
this.submitclick.nativeElement.click();
|
|
3348
|
-
}
|
|
3349
|
-
}
|
|
3350
|
-
/**增加选项 */
|
|
3351
|
-
addTableColumns() {
|
|
3352
|
-
this.TableColumns.push(this.fb.group({
|
|
3353
|
-
...new TableFormControl(),
|
|
3354
|
-
formConfiguration: [{}]
|
|
3355
|
-
}));
|
|
3356
|
-
}
|
|
3357
|
-
/**删除某个选项 */
|
|
3358
|
-
deleteTableColumns(index) {
|
|
3359
|
-
this.TableColumns.removeAt(index);
|
|
3360
|
-
}
|
|
3361
|
-
AfterInit() {
|
|
3362
|
-
return new Promise((resolve, rejects) => {
|
|
3363
|
-
this._Entity.setControl('formConfiguration', this.fb.group(new TableConfig()));
|
|
3364
|
-
this._fieldControlGroup = this._FieldAbstractsService.getExcludeAssignControl(this._type);
|
|
3365
|
-
if (this._selected && this._selected.formControlName == this._type) {
|
|
3366
|
-
this._selected.formConfiguration['TableColumns'].forEach(el => {
|
|
3367
|
-
this.addTableColumns();
|
|
3368
|
-
});
|
|
3369
|
-
this.formConfiguration.patchValue(this._selected.formConfiguration);
|
|
3370
|
-
}
|
|
3371
|
-
else {
|
|
3372
|
-
this.addTableColumns();
|
|
3373
|
-
}
|
|
3374
|
-
resolve(true);
|
|
3375
|
-
});
|
|
3376
|
-
}
|
|
3377
|
-
itemForm;
|
|
3378
|
-
/**选择表格的表单控件 */
|
|
3379
|
-
selectTableControl(event, i, item) {
|
|
3380
|
-
this.CurrentSelectionTableControlName = event.target.value;
|
|
3381
|
-
this.tableSelectOpen = true;
|
|
3382
|
-
this.tableSelectForm = this.fb.group(new TableFormControl());
|
|
3383
|
-
this.TableColumnsIndex = i;
|
|
3384
|
-
this.itemForm = item;
|
|
3385
|
-
}
|
|
3386
|
-
CurrentSelectionTableControlName;
|
|
3387
|
-
/**正在创建或编辑的表格项下标 */
|
|
3388
|
-
TableColumnsIndex;
|
|
3389
|
-
/**创建站点模态框状态 */
|
|
3390
|
-
tableSelectOpen = false;
|
|
3391
|
-
/**用于确定模态的繁忙状态是否为真 */
|
|
3392
|
-
modalBusy = false;
|
|
3393
|
-
/**创建站点表单 */
|
|
3394
|
-
tableSelectForm;
|
|
3395
|
-
/**表格已选择数据 */
|
|
3396
|
-
_tableSelected;
|
|
3397
|
-
/**表单控件模板-动态赋值表单控件 */
|
|
3398
|
-
tableSelectModalSubmit;
|
|
3399
|
-
/**创建站点模态框状态改变 */
|
|
3400
|
-
tableSelectVisibleChange(event) {
|
|
3401
|
-
if (!event) {
|
|
3402
|
-
this._tableSelected = undefined;
|
|
3403
|
-
this.tableSelectForm = undefined;
|
|
3404
|
-
this.CurrentSelectionTableControlName = undefined;
|
|
3405
|
-
this.TableColumnsIndex = undefined;
|
|
3406
|
-
return;
|
|
3407
|
-
}
|
|
3408
|
-
}
|
|
3409
|
-
/**表单保存提交 */
|
|
3410
|
-
createOrEditSave() {
|
|
3411
|
-
const formGroup = this.TableColumns.at(this.TableColumnsIndex);
|
|
3412
|
-
let formConfigurationgroup = formGroup.get('formConfiguration');
|
|
3413
|
-
formConfigurationgroup.setValue({
|
|
3414
|
-
...this.tableSelectForm.value['formConfiguration'],
|
|
3415
|
-
});
|
|
3416
|
-
this.tableSelectOpen = false;
|
|
3417
|
-
}
|
|
3418
|
-
/**编辑站点按钮 */
|
|
3419
|
-
EditSitesBtn(rows, i) {
|
|
3420
|
-
this.CurrentSelectionTableControlName = rows.get('formControlName').value;
|
|
3421
|
-
this.tableSelectForm = this.fb.group(new TableFormControl());
|
|
3422
|
-
this.tableSelectForm.patchValue({
|
|
3423
|
-
...rows.value
|
|
3424
|
-
});
|
|
3425
|
-
this.tableSelectForm.get('formConfiguration').patchValue({
|
|
3426
|
-
...rows.value['formConfiguration']
|
|
3427
|
-
});
|
|
3428
|
-
this._tableSelected = rows.value;
|
|
3429
|
-
this.TableColumnsIndex = i;
|
|
3430
|
-
this.tableSelectOpen = true;
|
|
3431
|
-
}
|
|
3432
|
-
/**调整表格位置 */
|
|
3433
|
-
TableArrowUpOrDown(type, index) {
|
|
3434
|
-
let controlAt = this.TableColumns.at(index);
|
|
3435
|
-
this.TableColumns.removeAt(index);
|
|
3436
|
-
let lastindex = type == 'up' ? index - 1 : index + 1;
|
|
3437
|
-
this.TableColumns.insert(lastindex, controlAt);
|
|
3438
|
-
}
|
|
3439
|
-
/**字段标签input失去标点生成字段名字 */
|
|
3440
|
-
disPlayNameInputBlur(event, item) {
|
|
3441
|
-
let value = event.target.value;
|
|
3442
|
-
let pinyin = this._CmsApiService.chineseToPinyin(value);
|
|
3443
|
-
let nameInput = item.get('name');
|
|
3444
|
-
if (nameInput.value)
|
|
3445
|
-
return;
|
|
3446
|
-
nameInput.patchValue(pinyin);
|
|
3447
|
-
}
|
|
3448
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: CmsApiService }, { token: FieldAbstractsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3449
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TableConfigComponent, selector: "df-table-config", inputs: { Entity: "Entity", selected: "selected", type: "type" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }, { propertyName: "tableSelectModalSubmit", first: true, predicate: ["tableSelectModalSubmit"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'Cms::TableColumnDisplayName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnForm' | abpLocalization}}</th>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableColumns()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"TableColumns\">\n <ng-container *ngFor=\"let item of TableColumns.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"displayName\" (blur)=\"disPlayNameInputBlur($event,item)\" ></td>\n <td><input type=\"text\" class=\"form-control\" formControlName=\"name\"></td>\n <td>\n <select class=\"form-select\" formControlName=\"formControlName\"\n (change)=\"selectTableControl($event,i,item)\">\n <option value=\"\">SelectFrom</option>\n <ng-container *ngFor=\"let item_f of _fieldControlGroup;let i_f =index\">\n <option [value]=\"item_f.name\">{{item_f.displayName}}</option>\n </ng-container>\n </select>\n </td>\n <td scope=\"row\">\n <div class=\"flex-start\">\n <button class=\"btn btn-light btn-sm \" (click.stop)=\"EditSitesBtn(item,i)\">\n <i class=\"fas fa-edit\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"deleteTableColumns(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==0\"\n (click.stop)=\"TableArrowUpOrDown('up',i)\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==TableColumns.controls.length-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n<abp-modal [(visible)]=\"tableSelectOpen\" [busy]=\"modalBusy\" (visibleChange)=\"tableSelectVisibleChange($event)\" [options]=\"{ size: CurrentSelectionTableControlName=='Matrix'?'xl':'' ,scrollable:false }\">\n <ng-template #abpHeader>\n <h3>{{_tableSelected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"tableSelectForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"tableSelectForm\"\n (ngSubmit)=\"createOrEditSave()\">\n <button type=\"submit\" #tableSelectModalSubmit style=\"display: none\"></button>\n <ng-container *ngIf=\"CurrentSelectionTableControlName&&tableSelectForm\">\n <df-dynamic [type]=\"CurrentSelectionTableControlName\" [entity]=\"tableSelectForm\"\n [selected]=\"_tableSelected\" [formGroup]=\"tableSelectForm\"></df-dynamic>\n </ng-container>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"tableSelectModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i8$1.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] });
|
|
3450
|
-
}
|
|
3451
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableConfigComponent, decorators: [{
|
|
3452
|
-
type: Component,
|
|
3453
|
-
args: [{ selector: 'df-table-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'Cms::TableColumnDisplayName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnForm' | abpLocalization}}</th>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableColumns()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"TableColumns\">\n <ng-container *ngFor=\"let item of TableColumns.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"displayName\" (blur)=\"disPlayNameInputBlur($event,item)\" ></td>\n <td><input type=\"text\" class=\"form-control\" formControlName=\"name\"></td>\n <td>\n <select class=\"form-select\" formControlName=\"formControlName\"\n (change)=\"selectTableControl($event,i,item)\">\n <option value=\"\">SelectFrom</option>\n <ng-container *ngFor=\"let item_f of _fieldControlGroup;let i_f =index\">\n <option [value]=\"item_f.name\">{{item_f.displayName}}</option>\n </ng-container>\n </select>\n </td>\n <td scope=\"row\">\n <div class=\"flex-start\">\n <button class=\"btn btn-light btn-sm \" (click.stop)=\"EditSitesBtn(item,i)\">\n <i class=\"fas fa-edit\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"deleteTableColumns(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==0\"\n (click.stop)=\"TableArrowUpOrDown('up',i)\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==TableColumns.controls.length-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n<abp-modal [(visible)]=\"tableSelectOpen\" [busy]=\"modalBusy\" (visibleChange)=\"tableSelectVisibleChange($event)\" [options]=\"{ size: CurrentSelectionTableControlName=='Matrix'?'xl':'' ,scrollable:false }\">\n <ng-template #abpHeader>\n <h3>{{_tableSelected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"tableSelectForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"tableSelectForm\"\n (ngSubmit)=\"createOrEditSave()\">\n <button type=\"submit\" #tableSelectModalSubmit style=\"display: none\"></button>\n <ng-container *ngIf=\"CurrentSelectionTableControlName&&tableSelectForm\">\n <df-dynamic [type]=\"CurrentSelectionTableControlName\" [entity]=\"tableSelectForm\"\n [selected]=\"_tableSelected\" [formGroup]=\"tableSelectForm\"></df-dynamic>\n </ng-container>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"tableSelectModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"] }]
|
|
3454
|
-
}], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: CmsApiService }, { type: FieldAbstractsService }]; }, propDecorators: { Entity: [{
|
|
3455
|
-
type: Input
|
|
3456
|
-
}], selected: [{
|
|
3457
|
-
type: Input
|
|
3458
|
-
}], type: [{
|
|
3459
|
-
type: Input
|
|
3460
|
-
}], submitclick: [{
|
|
3461
|
-
type: ViewChild,
|
|
3462
|
-
args: ['submitclick', { static: true }]
|
|
3463
|
-
}], tableSelectModalSubmit: [{
|
|
3464
|
-
type: ViewChild,
|
|
3465
|
-
args: ['tableSelectModalSubmit', { static: false }]
|
|
3466
|
-
}] } });
|
|
3467
|
-
|
|
3468
|
-
class TableControlComponent {
|
|
3469
|
-
constructor() {
|
|
3470
|
-
}
|
|
3471
|
-
fb = inject(FormBuilder);
|
|
3472
|
-
/**表单实体 */
|
|
3473
|
-
_entity;
|
|
3474
|
-
set entity(v) {
|
|
3475
|
-
this._entity = v;
|
|
3476
|
-
this.dataLoaded();
|
|
3477
|
-
}
|
|
3478
|
-
/**字段配置列表 */
|
|
3479
|
-
_fields = '';
|
|
3480
|
-
set fields(v) {
|
|
3481
|
-
this._fields = v;
|
|
3482
|
-
this.dataLoaded();
|
|
3483
|
-
}
|
|
3484
|
-
/**父级字段名称,用于为表单设置控件赋值 */
|
|
3485
|
-
_parentFiledName;
|
|
3486
|
-
set parentFiledName(v) {
|
|
3487
|
-
this._parentFiledName = v;
|
|
3488
|
-
this.dataLoaded();
|
|
3489
|
-
}
|
|
3490
|
-
/**父级字段名称,用于为表单设置控件赋值 */
|
|
3491
|
-
_selected;
|
|
3492
|
-
set selected(v) {
|
|
3493
|
-
this._selected = v;
|
|
3494
|
-
if (v) {
|
|
3495
|
-
this.dataLoaded();
|
|
3496
|
-
}
|
|
3497
|
-
}
|
|
3498
|
-
/**语言 */
|
|
3499
|
-
_culture;
|
|
3500
|
-
set culture(v) {
|
|
3501
|
-
this._culture = v;
|
|
3502
|
-
}
|
|
3503
|
-
submitclick;
|
|
3504
|
-
/** 获取父级字段代表的表单组*/
|
|
3505
|
-
extraProperties;
|
|
3506
|
-
/**数据加载完成 */
|
|
3507
|
-
async dataLoaded() {
|
|
3508
|
-
if (this._fields && this._entity && this._parentFiledName) {
|
|
3509
|
-
this.extraProperties = this._entity.get(this._parentFiledName);
|
|
3510
|
-
await this.AfterInit();
|
|
3511
|
-
this.submitclick.nativeElement.click();
|
|
3512
|
-
}
|
|
3513
|
-
}
|
|
3514
|
-
formConfiguration;
|
|
3515
|
-
/**获取表格字段代表的控件 */
|
|
3516
|
-
fieldNameControl;
|
|
3517
|
-
AfterInit() {
|
|
3518
|
-
return new Promise((resolve, rejects) => {
|
|
3519
|
-
let ValidatorsArray = [];
|
|
3520
|
-
if (this._fields.required) {
|
|
3521
|
-
ValidatorsArray.push(Validators.required);
|
|
3522
|
-
}
|
|
3523
|
-
let formConfiguration = this._fields.field.formConfiguration;
|
|
3524
|
-
this.formConfiguration = formConfiguration;
|
|
3525
|
-
console.log(formConfiguration, 'formConfiguration');
|
|
3526
|
-
let newArrayGroup = this.fb.array([]);
|
|
3527
|
-
this.extraProperties.setControl(this._fields.field.name, newArrayGroup);
|
|
3528
|
-
this.fieldNameControl = this.extraProperties.get(this._fields.field.name);
|
|
3529
|
-
if (this._selected) {
|
|
3530
|
-
this._selected.forEach(el => {
|
|
3531
|
-
this.addTableControlItem();
|
|
3532
|
-
});
|
|
3533
|
-
this.fieldNameControl.patchValue(this._selected);
|
|
3534
|
-
}
|
|
3535
|
-
else {
|
|
3536
|
-
this.addTableControlItem();
|
|
3537
|
-
}
|
|
3538
|
-
resolve(true);
|
|
3539
|
-
});
|
|
3540
|
-
}
|
|
3541
|
-
/**增加表格项 */
|
|
3542
|
-
addTableControlItem() {
|
|
3543
|
-
this.fieldNameControl.push(this.fb.group({
|
|
3544
|
-
'extraProperties': this.fb.group({})
|
|
3545
|
-
}));
|
|
3546
|
-
}
|
|
3547
|
-
/**删除表格项 */
|
|
3548
|
-
minusTableControlItem(index) {
|
|
3549
|
-
this.fieldNameControl.removeAt(index);
|
|
3550
|
-
}
|
|
3551
|
-
/**调整表格位置 */
|
|
3552
|
-
TableArrowUpOrDown(type, index) {
|
|
3553
|
-
let controlAt = this.fieldNameControl.at(index);
|
|
3554
|
-
this.fieldNameControl.removeAt(index);
|
|
3555
|
-
let lastindex = type == 'up' ? index - 1 : index + 1;
|
|
3556
|
-
this.fieldNameControl.insert(lastindex, controlAt);
|
|
3557
|
-
this._selected = this.fieldNameControl.value;
|
|
3558
|
-
}
|
|
3559
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3560
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TableControlComponent, selector: "df-table-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let item of formConfiguration.TableColumns\">\n <th scope=\"col\">{{ item.displayName }}</th>\n </ng-container>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableControlItem()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls; let i = index\">\n <tr>\n <ng-container *ngFor=\"let el of formConfiguration.TableColumns\">\n <td>\n <ng-container *ngIf=\"item&&el\">\n <df-dynamic [entity]=\"item\" [fields]=\"{ field: el }\"\n [selected]=\"_selected[i]?.extraProperties[''+el.name+'']\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </td>\n </ng-container>\n <td scope=\"row\" class=\"\">\n <div class=\"flex-end mb-2\">\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"minusTableControlItem(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"TableArrowUpOrDown('up',i)\"\n *ngIf=\"i!==0\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\"\n *ngIf=\"i!==fieldNameControl.controls.length-1\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }] });
|
|
3561
|
-
}
|
|
3562
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TableControlComponent, decorators: [{
|
|
3563
|
-
type: Component,
|
|
3564
|
-
args: [{ selector: 'df-table-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let item of formConfiguration.TableColumns\">\n <th scope=\"col\">{{ item.displayName }}</th>\n </ng-container>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableControlItem()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls; let i = index\">\n <tr>\n <ng-container *ngFor=\"let el of formConfiguration.TableColumns\">\n <td>\n <ng-container *ngIf=\"item&&el\">\n <df-dynamic [entity]=\"item\" [fields]=\"{ field: el }\"\n [selected]=\"_selected[i]?.extraProperties[''+el.name+'']\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </td>\n </ng-container>\n <td scope=\"row\" class=\"\">\n <div class=\"flex-end mb-2\">\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"minusTableControlItem(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"TableArrowUpOrDown('up',i)\"\n *ngIf=\"i!==0\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\"\n *ngIf=\"i!==fieldNameControl.controls.length-1\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"] }]
|
|
3565
|
-
}], ctorParameters: function () { return []; }, propDecorators: { entity: [{
|
|
3566
|
-
type: Input
|
|
3567
|
-
}], fields: [{
|
|
3568
|
-
type: Input
|
|
3569
|
-
}], parentFiledName: [{
|
|
3570
|
-
type: Input
|
|
3571
|
-
}], selected: [{
|
|
3572
|
-
type: Input
|
|
3573
|
-
}], culture: [{
|
|
3574
|
-
type: Input
|
|
3575
|
-
}], submitclick: [{
|
|
3576
|
-
type: ViewChild,
|
|
3577
|
-
args: ['submitclick', { static: true }]
|
|
3578
|
-
}] } });
|
|
3579
|
-
|
|
3580
|
-
/**
|
|
3581
|
-
* 表单控件分组-包含配置,控件,显示的数组
|
|
3582
|
-
*/
|
|
3583
|
-
const FieldControlGroup = [
|
|
3584
|
-
{
|
|
3585
|
-
displayName: '表格',
|
|
3586
|
-
name: 'Table',
|
|
3587
|
-
fieldConfigComponent: TableConfigComponent,
|
|
3588
|
-
fieldComponent: TableControlComponent,
|
|
3589
|
-
},
|
|
3590
|
-
{
|
|
3591
|
-
displayName: '矩阵',
|
|
3592
|
-
name: 'Matrix',
|
|
3593
|
-
fieldConfigComponent: MatrixConfigComponent,
|
|
3594
|
-
fieldComponent: MatrixControlComponent,
|
|
3595
|
-
},
|
|
3596
|
-
{
|
|
3597
|
-
displayName: '条目',
|
|
3598
|
-
name: 'Entry',
|
|
3599
|
-
fieldConfigComponent: EntryConfigComponent,
|
|
3600
|
-
fieldComponent: EntryControlComponent,
|
|
3601
|
-
},
|
|
3602
|
-
];
|
|
3603
|
-
|
|
3604
|
-
/**版块 */
|
|
3605
|
-
const Sections_Defaults_Toolbar_Action = ToolbarAction.createMany([
|
|
3606
|
-
{
|
|
3607
|
-
text: 'Cms::New',
|
|
3608
|
-
action: data => {
|
|
3609
|
-
const component = data.getInjected(SectionsComponent);
|
|
3610
|
-
component.createSectionBtn();
|
|
3611
|
-
},
|
|
3612
|
-
btnClass: '',
|
|
3613
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3614
|
-
icon: 'fa fa-plus',
|
|
3615
|
-
},
|
|
3616
|
-
]);
|
|
3617
|
-
/**版块-创建-编辑 */
|
|
3618
|
-
const Sections_Create_Or_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
|
|
3619
|
-
{
|
|
3620
|
-
text: 'AbpUi::Save',
|
|
3621
|
-
action: data => {
|
|
3622
|
-
const component = data.getInjected(CreateOrEditComponent);
|
|
3623
|
-
component.submitclickBtn();
|
|
3624
|
-
},
|
|
3625
|
-
btnClass: '',
|
|
3626
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3627
|
-
icon: 'fas fa-save',
|
|
3628
|
-
},
|
|
3629
|
-
]);
|
|
3630
|
-
/**站点 */
|
|
3631
|
-
// export const Sites_Defaults_Toolbar_Action = ToolbarAction.createMany<any[]>([
|
|
3632
|
-
// {
|
|
3633
|
-
// text: 'Cms::New',
|
|
3634
|
-
// action: data => {
|
|
3635
|
-
// const component = data.getInjected(SitesComponent);
|
|
3636
|
-
// // component.createSitesBtn();
|
|
3637
|
-
// },
|
|
3638
|
-
// btnClass: '',
|
|
3639
|
-
// permission: 'CmsAdmin.Entry.Create',
|
|
3640
|
-
// icon: 'fa fa-plus',
|
|
3641
|
-
// },
|
|
3642
|
-
// ]);
|
|
3643
|
-
/**字段 */
|
|
3644
|
-
const Fields_Defaults_Toolbar_Action = ToolbarAction.createMany([
|
|
3645
|
-
{
|
|
3646
|
-
text: 'Cms::New',
|
|
3647
|
-
action: data => {
|
|
3648
|
-
const component = data.getInjected(FieldsComponent);
|
|
3649
|
-
component.toFieldsCreateBtn();
|
|
3650
|
-
},
|
|
3651
|
-
btnClass: '',
|
|
3652
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3653
|
-
icon: 'fa fa-plus',
|
|
3654
|
-
},
|
|
3655
|
-
]);
|
|
3656
|
-
/**字段-创建 */
|
|
3657
|
-
const Fields_Create_Defaults_Toolbar_Action = ToolbarAction.createMany([
|
|
3658
|
-
{
|
|
3659
|
-
text: 'AbpUi::Save',
|
|
3660
|
-
action: data => {
|
|
3661
|
-
const component = data.getInjected(CreateFieldComponent);
|
|
3662
|
-
component.submitclickBtn();
|
|
3663
|
-
},
|
|
3664
|
-
btnClass: '',
|
|
3665
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3666
|
-
icon: 'fas fa-save',
|
|
3667
|
-
},
|
|
3668
|
-
]);
|
|
3669
|
-
/**字段-创建 */
|
|
3670
|
-
const Fields_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
|
|
3671
|
-
{
|
|
3672
|
-
text: 'AbpUi::Save',
|
|
3673
|
-
action: data => {
|
|
3674
|
-
const component = data.getInjected(EditFieldComponent);
|
|
3675
|
-
component.submitclickBtn();
|
|
3676
|
-
},
|
|
3677
|
-
btnClass: '',
|
|
3678
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3679
|
-
icon: 'fas fa-save',
|
|
3680
|
-
},
|
|
3681
|
-
]);
|
|
3682
|
-
/**条目 */
|
|
3683
|
-
const Entries_Defaults_Toolbar_Action = ToolbarAction.createMany([
|
|
3684
|
-
{
|
|
3685
|
-
text: 'Cms::New',
|
|
3686
|
-
action: data => {
|
|
3687
|
-
const component = data.getInjected(EntriesComponent);
|
|
3688
|
-
component.createEntriesBtn();
|
|
3689
|
-
},
|
|
3690
|
-
btnClass: '',
|
|
3691
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3692
|
-
icon: 'fa fa-plus',
|
|
3693
|
-
},
|
|
3694
|
-
]);
|
|
3695
|
-
/**条目-创建 */
|
|
3696
|
-
const Entries_Create_Defaults_Toolbar_Action = ToolbarAction.createMany([
|
|
3697
|
-
{
|
|
3698
|
-
text: 'AbpUi::Cancel',
|
|
3699
|
-
action: data => {
|
|
3700
|
-
const component = data.getInjected(CreateComponent);
|
|
3701
|
-
component.backTo();
|
|
3702
|
-
},
|
|
3703
|
-
btnClass: 'btn btn-light btn-sm',
|
|
3704
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3705
|
-
icon: '',
|
|
3706
|
-
},
|
|
3707
|
-
{
|
|
3708
|
-
text: 'AbpUi::Save',
|
|
3709
|
-
action: data => {
|
|
3710
|
-
const component = data.getInjected(CreateComponent);
|
|
3711
|
-
component.clickSubmit(true);
|
|
3712
|
-
},
|
|
3713
|
-
btnClass: 'btn btn-info btn-sm',
|
|
3714
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3715
|
-
icon: 'fas fa-save',
|
|
3716
|
-
},
|
|
3717
|
-
{
|
|
3718
|
-
text: 'Cms::Publish',
|
|
3719
|
-
action: data => {
|
|
3720
|
-
const component = data.getInjected(CreateComponent);
|
|
3721
|
-
component.clickSubmit(false);
|
|
3722
|
-
},
|
|
3723
|
-
btnClass: '',
|
|
3724
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3725
|
-
icon: 'fa fa-paper-plane',
|
|
3726
|
-
},
|
|
3727
|
-
]);
|
|
3728
|
-
/**条目编辑 */
|
|
3729
|
-
const Entries_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
|
|
3730
|
-
{
|
|
3731
|
-
text: 'AbpUi::Cancel',
|
|
3732
|
-
action: data => {
|
|
3733
|
-
const component = data.getInjected(EditComponent);
|
|
3734
|
-
component.backTo();
|
|
3735
|
-
},
|
|
3736
|
-
btnClass: 'btn btn-light btn-sm',
|
|
3737
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3738
|
-
icon: '',
|
|
3739
|
-
},
|
|
3740
|
-
{
|
|
3741
|
-
text: 'AbpUi::Save',
|
|
3742
|
-
action: data => {
|
|
3743
|
-
const component = data.getInjected(EditComponent);
|
|
3744
|
-
component.clickSubmit(true);
|
|
3745
|
-
},
|
|
3746
|
-
btnClass: 'btn btn-info btn-sm',
|
|
3747
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3748
|
-
icon: 'fas fa-save',
|
|
3749
|
-
},
|
|
3750
|
-
{
|
|
3751
|
-
text: 'Cms::Publish',
|
|
3752
|
-
action: data => {
|
|
3753
|
-
const component = data.getInjected(EditComponent);
|
|
3754
|
-
component.clickSubmit(false);
|
|
3755
|
-
},
|
|
3756
|
-
btnClass: '',
|
|
3757
|
-
permission: 'CmsAdmin.Entry.Create',
|
|
3758
|
-
icon: 'fa fa-paper-plane',
|
|
3759
|
-
},
|
|
3760
|
-
]);
|
|
3761
|
-
|
|
3762
|
-
const ActionGroup = {
|
|
3763
|
-
Entries: Entries_Defaults_Toolbar_Action,
|
|
3764
|
-
Entries_Create: Entries_Create_Defaults_Toolbar_Action,
|
|
3765
|
-
Entries_Edit: Entries_Edit_Defaults_Toolbar_Action,
|
|
3766
|
-
Fields: Fields_Defaults_Toolbar_Action,
|
|
3767
|
-
FieldsCreate: Fields_Create_Defaults_Toolbar_Action,
|
|
3768
|
-
FieldsEdit: Fields_Edit_Defaults_Toolbar_Action,
|
|
3769
|
-
Sections: Sections_Defaults_Toolbar_Action,
|
|
3770
|
-
SectionsCreateOrEdit: Sections_Create_Or_Edit_Defaults_Toolbar_Action,
|
|
3771
|
-
};
|
|
3772
|
-
const setCmsAction = () => {
|
|
3773
|
-
let Cms_Default = {};
|
|
3774
|
-
for (const iterator in ECmsComponent) {
|
|
3775
|
-
Cms_Default[ECmsComponent[iterator]] = ActionGroup[iterator];
|
|
3776
|
-
}
|
|
3777
|
-
return Cms_Default;
|
|
3778
|
-
};
|
|
3779
|
-
/**用于路由守卫增加工具栏按钮 */
|
|
3780
|
-
const Cms_Default_Toolbar_Actions = setCmsAction();
|
|
3781
|
-
/**
|
|
3782
|
-
*
|
|
3783
|
-
* @param 在identityExtensionsResolver方法中使用
|
|
3784
|
-
*
|
|
3785
|
-
* @param 在cms.module.ts中使用,
|
|
3786
|
-
export class CmsModule {
|
|
3787
|
-
static forChild(options: any = {}): ModuleWithProviders<CmsModule> {
|
|
3788
|
-
return {
|
|
3789
|
-
ngModule: CmsModule,
|
|
3790
|
-
providers: [
|
|
3791
|
-
{
|
|
3792
|
-
provide: CMS_TOOLBAR_ACTION_CONTRIBUTORS,
|
|
3793
|
-
useValue: options.toolbarActionContributors,
|
|
3794
|
-
// useValue: identityToolbarActionContributors,
|
|
3795
|
-
},
|
|
3796
|
-
// IdentityExtensionsGuard,
|
|
3797
|
-
]
|
|
3798
|
-
};
|
|
3799
|
-
}
|
|
3800
|
-
static forLazy(options: any = {}): NgModuleFactory<CmsModule> {
|
|
3801
|
-
return new LazyModuleFactory(CmsModule.forChild(options));
|
|
3802
|
-
}
|
|
3803
|
-
}
|
|
3804
|
-
*
|
|
3805
|
-
*
|
|
3806
|
-
*/
|
|
3807
|
-
const CMS_TOOLBAR_ACTION_CONTRIBUTORS = new InjectionToken('CMS_TOOLBAR_ACTION_CONTRIBUTORS');
|
|
3808
|
-
/**用于放在cms-routing.module.ts路由守卫中
|
|
3809
|
-
*
|
|
3810
|
-
*
|
|
3811
|
-
const routes: Routes = [
|
|
3812
|
-
{
|
|
3813
|
-
path: 'demo',
|
|
3814
|
-
canActivate: [AuthGuard, PermissionGuard],
|
|
3815
|
-
resolve: [identityExtensionsResolver],
|
|
3816
|
-
children: []
|
|
3817
|
-
},
|
|
3818
|
-
]
|
|
3819
|
-
*
|
|
3820
|
-
*
|
|
3821
|
-
*/
|
|
3822
|
-
const CmsExtensionsResolver = () => {
|
|
3823
|
-
const configState = inject(ConfigStateService);
|
|
3824
|
-
const extensions = inject(ExtensionsService);
|
|
3825
|
-
const config = { optional: true };
|
|
3826
|
-
const toolbarContributors = inject(CMS_TOOLBAR_ACTION_CONTRIBUTORS, config) || {};
|
|
3827
|
-
return getObjectExtensionEntitiesFromStore(configState, 'Cms').pipe(map(entities => ({
|
|
3828
|
-
// [ECmseComponents.UsePage]: entities.Role,
|
|
3829
|
-
// [eIdentityComponents.Users]: entities.User,
|
|
3830
|
-
})), mapEntitiesToContributors(configState, 'Cms'), tap(objectExtensionContributors => {
|
|
3831
|
-
mergeWithDefaultActions(extensions.toolbarActions, Cms_Default_Toolbar_Actions, toolbarContributors);
|
|
3832
|
-
}));
|
|
3833
|
-
};
|
|
3834
|
-
|
|
3835
|
-
var styles = `
|
|
3836
|
-
.lpx-content-container .lpx-content{min-height:calc(100vh - 34px);padding:1.25em 2em 1.25em}h1,h2,h3,h4,h5,h6{color:inherit}.lpx-settings .lpx-context-menu{overflow:auto}
|
|
3837
|
-
a {
|
|
3838
|
-
text-decoration: unset;
|
|
3839
|
-
}
|
|
3840
|
-
:root .cellClassRight{
|
|
3841
|
-
transform: translateX(17px);
|
|
3842
|
-
background: var(--lpx-card-bg);
|
|
3843
|
-
}
|
|
3844
|
-
.form-label{
|
|
3845
|
-
font-size: 12px;
|
|
3846
|
-
}
|
|
3847
|
-
`;
|
|
3848
|
-
|
|
3849
|
-
let isAppentStyle = false;
|
|
3850
|
-
function appentStyle() {
|
|
3851
|
-
/**确保该路由守卫只会执行一次 */
|
|
3852
|
-
if (isAppentStyle)
|
|
3853
|
-
return;
|
|
3854
|
-
isAppentStyle = true;
|
|
3855
|
-
const rendererFactory = inject(RendererFactory2);
|
|
3856
|
-
let renderer = rendererFactory.createRenderer(null, null);
|
|
3857
|
-
const style = renderer.createElement('style');
|
|
3858
|
-
renderer.setProperty(style, 'innerHTML', styles);
|
|
3859
|
-
renderer.appendChild(document.head, style);
|
|
3860
|
-
}
|
|
3861
|
-
|
|
3862
|
-
const routes = [
|
|
3863
|
-
{
|
|
3864
|
-
path: 'admin',
|
|
3865
|
-
canActivate: [AuthGuard, PermissionGuard],
|
|
3866
|
-
resolve: [CmsExtensionsResolver, appentStyle],
|
|
3867
|
-
children: [
|
|
3868
|
-
{
|
|
3869
|
-
path: 'entries',
|
|
3870
|
-
children: [
|
|
3871
|
-
{
|
|
3872
|
-
path: '',
|
|
3873
|
-
component: EntriesComponent,
|
|
3874
|
-
data: { keep: true }
|
|
3875
|
-
},
|
|
3876
|
-
{
|
|
3877
|
-
path: 'create',
|
|
3878
|
-
component: CreateComponent,
|
|
3879
|
-
},
|
|
3880
|
-
{
|
|
3881
|
-
path: ':entrieId/edit',
|
|
3882
|
-
component: EditComponent,
|
|
3883
|
-
},
|
|
3884
|
-
],
|
|
3885
|
-
},
|
|
3886
|
-
{
|
|
3887
|
-
path: '',
|
|
3888
|
-
children: [
|
|
3889
|
-
{
|
|
3890
|
-
path: 'fields',
|
|
3891
|
-
children: [
|
|
3892
|
-
{
|
|
3893
|
-
path: '',
|
|
3894
|
-
component: FieldsComponent,
|
|
3895
|
-
data: { keep: true }
|
|
3896
|
-
},
|
|
3897
|
-
{
|
|
3898
|
-
path: 'create',
|
|
3899
|
-
component: CreateFieldComponent,
|
|
3900
|
-
},
|
|
3901
|
-
{
|
|
3902
|
-
path: ':id/edit',
|
|
3903
|
-
component: EditFieldComponent,
|
|
3904
|
-
},
|
|
3905
|
-
],
|
|
3906
|
-
},
|
|
3907
|
-
// {
|
|
3908
|
-
// path: 'sites',
|
|
3909
|
-
// component: SitesComponent,
|
|
3910
|
-
// data: { keep: true }
|
|
3911
|
-
// },
|
|
3912
|
-
{
|
|
3913
|
-
path: 'sections',
|
|
3914
|
-
children: [
|
|
3915
|
-
{
|
|
3916
|
-
path: '',
|
|
3917
|
-
data: { keep: true },
|
|
3918
|
-
component: SectionsComponent,
|
|
3919
|
-
},
|
|
3920
|
-
{
|
|
3921
|
-
path: ':sectionsId/entry-types',
|
|
3922
|
-
children: [
|
|
3923
|
-
{
|
|
3924
|
-
path: 'create',
|
|
3925
|
-
component: CreateOrEditComponent,
|
|
3926
|
-
},
|
|
3927
|
-
{
|
|
3928
|
-
path: ':entryTypesId/edit',
|
|
3929
|
-
component: CreateOrEditComponent,
|
|
3930
|
-
},
|
|
3931
|
-
],
|
|
3932
|
-
},
|
|
3933
|
-
],
|
|
3934
|
-
},
|
|
3935
|
-
],
|
|
3936
|
-
},
|
|
3937
|
-
],
|
|
3938
|
-
},
|
|
3939
|
-
];
|
|
3940
|
-
class CmsRoutingModule {
|
|
3941
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3942
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: CmsRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] });
|
|
3943
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
|
|
3944
|
-
}
|
|
3945
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsRoutingModule, decorators: [{
|
|
3946
|
-
type: NgModule,
|
|
3947
|
-
args: [{
|
|
3948
|
-
imports: [RouterModule.forChild(routes)],
|
|
3949
|
-
exports: [RouterModule],
|
|
3950
|
-
}]
|
|
3951
|
-
}] });
|
|
3952
|
-
|
|
3953
|
-
class CmsModule {
|
|
3954
|
-
static forChild(options = {}) {
|
|
3955
|
-
return {
|
|
3956
|
-
ngModule: CmsModule,
|
|
3957
|
-
providers: [
|
|
3958
|
-
{
|
|
3959
|
-
provide: CMS_TOOLBAR_ACTION_CONTRIBUTORS,
|
|
3960
|
-
useValue: options.toolbarActionContributors,
|
|
3961
|
-
},
|
|
3962
|
-
],
|
|
3963
|
-
};
|
|
3964
|
-
}
|
|
3965
|
-
static forLazy(options = {}) {
|
|
3966
|
-
return new LazyModuleFactory(CmsModule.forChild(options));
|
|
3967
|
-
}
|
|
3968
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3969
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: CmsModule, declarations: [EntriesComponent,
|
|
3970
|
-
FieldsComponent,
|
|
3971
|
-
// SitesComponent,
|
|
3972
|
-
SectionsComponent,
|
|
3973
|
-
FieldGroupComponent,
|
|
3974
|
-
CreateFieldComponent,
|
|
3975
|
-
EditFieldComponent,
|
|
3976
|
-
CreateOrEditFieldComponent,
|
|
3977
|
-
CreateOrEditComponent,
|
|
3978
|
-
CreateComponent,
|
|
3979
|
-
EditComponent,
|
|
3980
|
-
CreateOrEditEntriesComponent,
|
|
3981
|
-
TableConfigComponent,
|
|
3982
|
-
TableControlComponent,
|
|
3983
|
-
MatrixConfigComponent,
|
|
3984
|
-
MatrixControlComponent,
|
|
3985
|
-
EntryConfigComponent,
|
|
3986
|
-
EntryControlComponent,
|
|
3987
|
-
DomainsComponent], imports: [CoreModule,
|
|
3988
|
-
ThemeSharedModule,
|
|
3989
|
-
CmsRoutingModule,
|
|
3990
|
-
FormsModule,
|
|
3991
|
-
NgbNavModule,
|
|
3992
|
-
NgbAccordionModule,
|
|
3993
|
-
NgbDropdownModule,
|
|
3994
|
-
PageModule,
|
|
3995
|
-
NzSelectModule, i8$1.DynamicFormModule], exports: [TableConfigComponent,
|
|
3996
|
-
TableControlComponent,
|
|
3997
|
-
MatrixConfigComponent,
|
|
3998
|
-
MatrixControlComponent,
|
|
3999
|
-
EntryConfigComponent,
|
|
4000
|
-
EntryControlComponent,
|
|
4001
|
-
DomainsComponent] });
|
|
4002
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsModule, imports: [CoreModule,
|
|
4003
|
-
ThemeSharedModule,
|
|
4004
|
-
CmsRoutingModule,
|
|
4005
|
-
FormsModule,
|
|
4006
|
-
NgbNavModule,
|
|
4007
|
-
NgbAccordionModule,
|
|
4008
|
-
NgbDropdownModule,
|
|
4009
|
-
PageModule,
|
|
4010
|
-
NzSelectModule,
|
|
4011
|
-
DynamicFormModule.forRoot({
|
|
4012
|
-
cmsFieldControlGroup: [...FieldControlGroup, ...fielFieldControlGroup, ...ckEditorFieldControlGroup]
|
|
4013
|
-
})] });
|
|
4014
|
-
}
|
|
4015
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CmsModule, decorators: [{
|
|
4016
|
-
type: NgModule,
|
|
4017
|
-
args: [{
|
|
4018
|
-
declarations: [
|
|
4019
|
-
EntriesComponent,
|
|
4020
|
-
FieldsComponent,
|
|
4021
|
-
// SitesComponent,
|
|
4022
|
-
SectionsComponent,
|
|
4023
|
-
FieldGroupComponent,
|
|
4024
|
-
CreateFieldComponent,
|
|
4025
|
-
EditFieldComponent,
|
|
4026
|
-
CreateOrEditFieldComponent,
|
|
4027
|
-
CreateOrEditComponent,
|
|
4028
|
-
CreateComponent,
|
|
4029
|
-
EditComponent,
|
|
4030
|
-
CreateOrEditEntriesComponent,
|
|
4031
|
-
TableConfigComponent,
|
|
4032
|
-
TableControlComponent,
|
|
4033
|
-
MatrixConfigComponent,
|
|
4034
|
-
MatrixControlComponent,
|
|
4035
|
-
EntryConfigComponent,
|
|
4036
|
-
EntryControlComponent,
|
|
4037
|
-
DomainsComponent,
|
|
4038
|
-
],
|
|
4039
|
-
imports: [
|
|
4040
|
-
CoreModule,
|
|
4041
|
-
ThemeSharedModule,
|
|
4042
|
-
CmsRoutingModule,
|
|
4043
|
-
FormsModule,
|
|
4044
|
-
NgbNavModule,
|
|
4045
|
-
NgbAccordionModule,
|
|
4046
|
-
NgbDropdownModule,
|
|
4047
|
-
PageModule,
|
|
4048
|
-
NzSelectModule,
|
|
4049
|
-
DynamicFormModule.forRoot({
|
|
4050
|
-
cmsFieldControlGroup: [...FieldControlGroup, ...fielFieldControlGroup, ...ckEditorFieldControlGroup]
|
|
4051
|
-
}),
|
|
4052
|
-
],
|
|
4053
|
-
exports: [
|
|
4054
|
-
TableConfigComponent,
|
|
4055
|
-
TableControlComponent,
|
|
4056
|
-
MatrixConfigComponent,
|
|
4057
|
-
MatrixControlComponent,
|
|
4058
|
-
EntryConfigComponent,
|
|
4059
|
-
EntryControlComponent,
|
|
4060
|
-
DomainsComponent
|
|
4061
|
-
],
|
|
4062
|
-
providers: [],
|
|
4063
|
-
}]
|
|
4064
|
-
}] });
|
|
4065
|
-
|
|
4066
|
-
/*
|
|
4067
|
-
* Public API Surface of cms
|
|
4068
|
-
*/
|
|
4069
|
-
|
|
4070
|
-
/**
|
|
4071
|
-
* Generated bundle index. Do not edit.
|
|
4072
|
-
*/
|
|
4073
|
-
|
|
4074
|
-
export { CmsModule, DomainsComponent, EntryConfig, EntryConfigComponent, EntryControlComponent, FieldControlGroup, MatrixConfig, MatrixConfigComponent, MatrixControlComponent, MatrixItemConfig, SimpleReuseStrategy, TableConfig, TableConfigComponent, TableControlComponent, TableFormControl, matrixFieldInputBase };
|
|
4075
|
-
//# sourceMappingURL=dignite-ng-expand.cms.mjs.map
|