@dignite-ng/expand.cms 0.0.52 → 0.0.54

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.
Files changed (448) hide show
  1. package/config/cms-config.module.d.ts +8 -0
  2. package/config/components/domains/domains.component.d.ts +29 -0
  3. package/config/components/site-language/site-language.component.d.ts +29 -0
  4. package/config/{src/enums/index.ts → enums/index.d.ts} +1 -1
  5. package/config/enums/route-names.d.ts +8 -0
  6. package/config/index.d.ts +5 -0
  7. package/config/{src/providers/index.ts → providers/index.d.ts} +1 -1
  8. package/config/providers/route.provider.d.ts +9 -0
  9. package/config/proxy/admin/domains/domain-admin.service.d.ts +13 -0
  10. package/config/{src/proxy/dignite/cms/admin/domains/models.ts → proxy/admin/domains/models.d.ts} +7 -9
  11. package/config/proxy/dignite/cms/admin/sites/models.d.ts +4 -0
  12. package/config/proxy/dignite/cms/admin/sites/site-admin.service.d.ts +13 -0
  13. package/config/proxy/dignite/cms/sites/models.d.ts +4 -0
  14. package/config/{src/public-api.ts → public-api.d.ts} +3 -3
  15. package/config/services/validators.service.d.ts +16 -0
  16. package/esm2022/config/cms-config.module.mjs +18 -0
  17. package/esm2022/config/components/domains/domains.component.mjs +102 -0
  18. package/esm2022/config/components/site-language/site-language.component.mjs +105 -0
  19. package/esm2022/config/dignite-ng-expand.cms-config.mjs +5 -0
  20. package/esm2022/config/enums/index.mjs +2 -0
  21. package/esm2022/config/enums/route-names.mjs +10 -0
  22. package/esm2022/config/providers/index.mjs +2 -0
  23. package/esm2022/config/providers/route.provider.mjs +74 -0
  24. package/esm2022/config/proxy/admin/domains/domain-admin.service.mjs +32 -0
  25. package/esm2022/config/proxy/admin/domains/index.mjs +3 -0
  26. package/esm2022/config/proxy/admin/domains/models.mjs +2 -0
  27. package/esm2022/config/proxy/dignite/cms/admin/sites/index.mjs +3 -0
  28. package/esm2022/config/proxy/dignite/cms/admin/sites/models.mjs +2 -0
  29. package/esm2022/config/proxy/dignite/cms/admin/sites/site-admin.service.mjs +27 -0
  30. package/esm2022/config/proxy/dignite/cms/sites/models.mjs +2 -0
  31. package/esm2022/config/public-api.mjs +4 -0
  32. package/esm2022/config/services/validators.service.mjs +83 -0
  33. package/esm2022/dignite-ng-expand.cms.mjs +5 -0
  34. package/esm2022/lib/cms-routing.module.mjs +94 -0
  35. package/esm2022/lib/cms.module.mjs +133 -0
  36. package/esm2022/lib/components/admin/entries/create-or-edit-entries.component.mjs +303 -0
  37. package/esm2022/lib/components/admin/entries/create-or-update-entry-input-base.mjs +32 -0
  38. package/esm2022/lib/components/admin/entries/create.component.mjs +110 -0
  39. package/esm2022/lib/components/admin/entries/edit.component.mjs +110 -0
  40. package/esm2022/lib/components/admin/entries/entries.component.mjs +199 -0
  41. package/esm2022/lib/components/admin/entries/index.mjs +5 -0
  42. package/esm2022/lib/components/admin/fields/create-field.component.mjs +80 -0
  43. package/esm2022/lib/components/admin/fields/create-or-edit-field.component.mjs +114 -0
  44. package/esm2022/lib/components/admin/fields/create-or-update-field-input-base.mjs +25 -0
  45. package/esm2022/lib/components/admin/fields/edit-field.component.mjs +103 -0
  46. package/esm2022/lib/components/admin/fields/field-group.component.mjs +131 -0
  47. package/esm2022/lib/components/admin/fields/fields.component.mjs +108 -0
  48. package/esm2022/lib/components/admin/fields/index.mjs +7 -0
  49. package/esm2022/lib/components/admin/index.mjs +4 -0
  50. package/esm2022/lib/components/admin/sections/create-or-update-sections-input-base.mjs +27 -0
  51. package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.mjs +71 -0
  52. package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.component.mjs +389 -0
  53. package/esm2022/lib/components/admin/sections/entry-types/index.mjs +3 -0
  54. package/esm2022/lib/components/admin/sections/index.mjs +4 -0
  55. package/esm2022/lib/components/admin/sections/sections.component.mjs +292 -0
  56. package/esm2022/lib/components/dynamic-form/entry/entry-config.component.mjs +112 -0
  57. package/esm2022/lib/components/dynamic-form/entry/entry-config.mjs +18 -0
  58. package/esm2022/lib/components/dynamic-form/entry/entry-control.component.mjs +105 -0
  59. package/esm2022/lib/components/dynamic-form/entry/index.mjs +4 -0
  60. package/esm2022/lib/components/dynamic-form/form-control-group.mjs +28 -0
  61. package/esm2022/lib/components/dynamic-form/index.mjs +5 -0
  62. package/esm2022/lib/components/dynamic-form/matrix/index.mjs +4 -0
  63. package/esm2022/lib/components/dynamic-form/matrix/matrix-config.component.mjs +214 -0
  64. package/esm2022/lib/components/dynamic-form/matrix/matrix-config.mjs +50 -0
  65. package/esm2022/lib/components/dynamic-form/matrix/matrix-control.component.mjs +98 -0
  66. package/esm2022/lib/components/dynamic-form/table/index.mjs +4 -0
  67. package/esm2022/lib/components/dynamic-form/table/table-config.component.mjs +151 -0
  68. package/esm2022/lib/components/dynamic-form/table/table-config.mjs +38 -0
  69. package/esm2022/lib/components/dynamic-form/table/table-control.component.mjs +105 -0
  70. package/esm2022/lib/components/index.mjs +3 -0
  71. package/esm2022/lib/constants/styles.mjs +21 -0
  72. package/esm2022/lib/enums/ecms-component.mjs +13 -0
  73. package/esm2022/lib/enums/index.mjs +2 -0
  74. package/esm2022/lib/proxy/admin/dynamic-forms/form-admin.service.mjs +22 -0
  75. package/esm2022/lib/proxy/admin/dynamic-forms/index.mjs +3 -0
  76. package/esm2022/lib/proxy/admin/dynamic-forms/models.mjs +2 -0
  77. package/esm2022/lib/proxy/admin/entries/entry-admin.service.mjs +70 -0
  78. package/esm2022/lib/proxy/admin/entries/index.mjs +3 -0
  79. package/esm2022/lib/proxy/admin/entries/models.mjs +2 -0
  80. package/esm2022/lib/proxy/admin/fields/field-admin.service.mjs +45 -0
  81. package/esm2022/lib/proxy/admin/fields/field-group-admin.service.mjs +41 -0
  82. package/esm2022/lib/proxy/admin/fields/index.mjs +4 -0
  83. package/esm2022/lib/proxy/admin/fields/models.mjs +2 -0
  84. package/esm2022/lib/proxy/admin/sections/entry-type-admin.service.mjs +41 -0
  85. package/esm2022/lib/proxy/admin/sections/index.mjs +4 -0
  86. package/esm2022/lib/proxy/admin/sections/models.mjs +2 -0
  87. package/esm2022/lib/proxy/admin/sections/section-admin.service.mjs +51 -0
  88. package/esm2022/lib/proxy/admin/settings/index.mjs +2 -0
  89. package/esm2022/lib/proxy/admin/settings/site-settings-admin.service.mjs +31 -0
  90. package/esm2022/lib/proxy/dignite/abp/data/models.mjs +2 -0
  91. package/esm2022/lib/proxy/entries/entry-status.enum.mjs +8 -0
  92. package/esm2022/lib/proxy/entries/index.mjs +2 -0
  93. package/esm2022/lib/proxy/fields/models.mjs +2 -0
  94. package/esm2022/lib/proxy/sections/index.mjs +3 -0
  95. package/esm2022/lib/proxy/sections/models.mjs +2 -0
  96. package/esm2022/lib/proxy/sections/section-type.enum.mjs +9 -0
  97. package/esm2022/lib/proxy/settings/models.mjs +2 -0
  98. package/esm2022/lib/proxy/volo/cms-kit/users/models.mjs +2 -0
  99. package/esm2022/lib/resolvers/extensions-props-action-token.resolver.mjs +136 -0
  100. package/esm2022/lib/resolvers/page-default-toolbar-actions.mjs +160 -0
  101. package/esm2022/lib/resolvers/table-default-entity-actions.mjs +49 -0
  102. package/esm2022/lib/resolvers/table-default-entity-props.mjs +54 -0
  103. package/esm2022/lib/services/appent-content.mjs +15 -0
  104. package/esm2022/lib/services/cms-api.service.mjs +70 -0
  105. package/esm2022/lib/services/cms.service.mjs +21 -0
  106. package/esm2022/lib/services/field-abstracts.service.mjs +42 -0
  107. package/esm2022/lib/services/index.mjs +4 -0
  108. package/esm2022/lib/services/validators.service.mjs +83 -0
  109. package/esm2022/public-api.mjs +6 -0
  110. package/fesm2022/dignite-ng-expand.cms-config.mjs +426 -0
  111. package/fesm2022/dignite-ng-expand.cms-config.mjs.map +1 -0
  112. package/fesm2022/dignite-ng-expand.cms.mjs +3932 -0
  113. package/fesm2022/dignite-ng-expand.cms.mjs.map +1 -0
  114. package/index.d.ts +5 -0
  115. package/lib/cms-routing.module.d.ts +7 -0
  116. package/lib/cms.module.d.ts +35 -0
  117. package/lib/components/admin/entries/create-or-edit-entries.component.d.ts +96 -0
  118. package/lib/components/admin/entries/create-or-update-entry-input-base.d.ts +23 -0
  119. package/lib/components/admin/entries/create.component.d.ts +47 -0
  120. package/lib/components/admin/entries/edit.component.d.ts +47 -0
  121. package/lib/components/admin/entries/entries.component.d.ts +66 -0
  122. package/lib/components/admin/entries/index.d.ts +4 -0
  123. package/lib/components/admin/fields/create-field.component.d.ts +37 -0
  124. package/lib/components/admin/fields/create-or-edit-field.component.d.ts +38 -0
  125. package/lib/components/admin/fields/create-or-update-field-input-base.d.ts +16 -0
  126. package/lib/components/admin/fields/edit-field.component.d.ts +46 -0
  127. package/lib/components/admin/fields/field-group.component.d.ts +58 -0
  128. package/lib/components/admin/fields/fields.component.d.ts +35 -0
  129. package/lib/components/admin/fields/index.d.ts +6 -0
  130. package/lib/components/admin/index.d.ts +3 -0
  131. package/lib/components/admin/sections/create-or-update-sections-input-base.d.ts +17 -0
  132. package/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.d.ts +38 -0
  133. package/lib/components/admin/sections/entry-types/create-or-edit.component.d.ts +138 -0
  134. package/lib/components/admin/sections/entry-types/index.d.ts +2 -0
  135. package/lib/components/admin/sections/index.d.ts +3 -0
  136. package/lib/components/admin/sections/sections.component.d.ts +64 -0
  137. package/lib/components/dynamic-form/entry/entry-config.component.d.ts +39 -0
  138. package/lib/components/dynamic-form/entry/entry-config.d.ts +9 -0
  139. package/lib/components/dynamic-form/entry/entry-control.component.d.ts +35 -0
  140. package/lib/components/dynamic-form/entry/index.d.ts +3 -0
  141. package/lib/components/dynamic-form/form-control-group.d.ts +4 -0
  142. package/lib/components/dynamic-form/index.d.ts +4 -0
  143. package/lib/components/dynamic-form/matrix/index.d.ts +3 -0
  144. package/lib/components/dynamic-form/matrix/matrix-config.component.d.ts +73 -0
  145. package/lib/components/dynamic-form/matrix/matrix-config.d.ts +24 -0
  146. package/lib/components/dynamic-form/matrix/matrix-control.component.d.ts +39 -0
  147. package/lib/components/dynamic-form/table/index.d.ts +3 -0
  148. package/lib/components/dynamic-form/table/table-config.component.d.ts +58 -0
  149. package/lib/components/dynamic-form/table/table-config.d.ts +18 -0
  150. package/lib/components/dynamic-form/table/table-control.component.d.ts +39 -0
  151. package/lib/components/index.d.ts +2 -0
  152. package/lib/constants/styles.d.ts +2 -0
  153. package/lib/enums/ecms-component.d.ts +11 -0
  154. package/lib/enums/index.d.ts +1 -0
  155. package/lib/proxy/admin/dynamic-forms/form-admin.service.d.ts +12 -0
  156. package/lib/proxy/admin/dynamic-forms/models.d.ts +4 -0
  157. package/lib/proxy/admin/entries/entry-admin.service.d.ts +22 -0
  158. package/lib/proxy/admin/entries/models.d.ts +60 -0
  159. package/lib/proxy/admin/fields/field-admin.service.d.ts +17 -0
  160. package/lib/proxy/admin/fields/field-group-admin.service.d.ts +16 -0
  161. package/{src/lib/proxy/admin/fields/models.ts → lib/proxy/admin/fields/models.d.ts} +34 -42
  162. package/lib/proxy/admin/sections/entry-type-admin.service.d.ts +15 -0
  163. package/{src/lib/proxy/admin/sections/models.ts → lib/proxy/admin/sections/models.d.ts} +67 -81
  164. package/lib/proxy/admin/sections/section-admin.service.d.ts +18 -0
  165. package/lib/proxy/admin/settings/site-settings-admin.service.d.ts +13 -0
  166. package/lib/proxy/dignite/abp/data/models.d.ts +3 -0
  167. package/lib/proxy/entries/entry-status.enum.d.ts +5 -0
  168. package/lib/proxy/fields/models.d.ts +8 -0
  169. package/lib/proxy/sections/models.d.ts +12 -0
  170. package/lib/proxy/sections/section-type.enum.d.ts +6 -0
  171. package/lib/proxy/settings/models.d.ts +5 -0
  172. package/{src/lib/proxy/volo/cms-kit/users/models.ts → lib/proxy/volo/cms-kit/users/models.d.ts} +7 -8
  173. package/lib/resolvers/extensions-props-action-token.resolver.d.ts +75 -0
  174. package/lib/resolvers/page-default-toolbar-actions.d.ts +18 -0
  175. package/lib/resolvers/table-default-entity-actions.d.ts +5 -0
  176. package/lib/resolvers/table-default-entity-props.d.ts +5 -0
  177. package/lib/services/appent-content.d.ts +1 -0
  178. package/lib/services/cms-api.service.d.ts +16 -0
  179. package/lib/services/cms.service.d.ts +10 -0
  180. package/lib/services/field-abstracts.service.d.ts +20 -0
  181. package/lib/services/index.d.ts +3 -0
  182. package/lib/services/validators.service.d.ts +15 -0
  183. package/package.json +22 -7
  184. package/{src/public-api.ts → public-api.d.ts} +2 -6
  185. package/config/ng-package.json +0 -6
  186. package/config/src/cms-config.module.ts +0 -12
  187. package/config/src/components/domains/domains.component.html +0 -17
  188. package/config/src/components/domains/domains.component.scss +0 -0
  189. package/config/src/components/domains/domains.component.spec.ts +0 -21
  190. package/config/src/components/domains/domains.component.ts +0 -109
  191. package/config/src/components/site-language/site-language.component.html +0 -31
  192. package/config/src/components/site-language/site-language.component.scss +0 -0
  193. package/config/src/components/site-language/site-language.component.spec.ts +0 -21
  194. package/config/src/components/site-language/site-language.component.ts +0 -117
  195. package/config/src/enums/route-names.ts +0 -8
  196. package/config/src/providers/route.provider.ts +0 -82
  197. package/config/src/proxy/admin/domains/domain-admin.service.ts +0 -38
  198. package/config/src/proxy/admin/domains/models.ts +0 -9
  199. package/config/src/proxy/dignite/abp/data/index.ts +0 -1
  200. package/config/src/proxy/dignite/abp/data/models.ts +0 -4
  201. package/config/src/proxy/dignite/abp/index.ts +0 -2
  202. package/config/src/proxy/dignite/cms/admin/domains/domain-admin.service.ts +0 -47
  203. package/config/src/proxy/dignite/cms/admin/domains/index.ts +0 -2
  204. package/config/src/proxy/dignite/cms/admin/dynamic-forms/form-admin.service.ts +0 -21
  205. package/config/src/proxy/dignite/cms/admin/dynamic-forms/models.ts +0 -5
  206. package/config/src/proxy/dignite/cms/admin/entries/entry-admin.service.ts +0 -109
  207. package/config/src/proxy/dignite/cms/admin/entries/models.ts +0 -68
  208. package/config/src/proxy/dignite/cms/admin/fields/field-admin.service.ts +0 -64
  209. package/config/src/proxy/dignite/cms/admin/fields/field-group-admin.service.ts +0 -56
  210. package/config/src/proxy/dignite/cms/admin/fields/models.ts +0 -42
  211. package/config/src/proxy/dignite/cms/admin/index.ts +0 -7
  212. package/config/src/proxy/dignite/cms/admin/sections/entry-type-admin.service.ts +0 -55
  213. package/config/src/proxy/dignite/cms/admin/sections/models.ts +0 -81
  214. package/config/src/proxy/dignite/cms/admin/sections/section-admin.service.ts +0 -74
  215. package/config/src/proxy/dignite/cms/admin/sites/models.ts +0 -5
  216. package/config/src/proxy/dignite/cms/admin/sites/site-admin.service.ts +0 -30
  217. package/config/src/proxy/dignite/cms/entries/entry-status.enum.ts +0 -8
  218. package/config/src/proxy/dignite/cms/fields/index.ts +0 -1
  219. package/config/src/proxy/dignite/cms/fields/models.ts +0 -9
  220. package/config/src/proxy/dignite/cms/index.ts +0 -6
  221. package/config/src/proxy/dignite/cms/sections/models.ts +0 -14
  222. package/config/src/proxy/dignite/cms/sections/section-type.enum.ts +0 -9
  223. package/config/src/proxy/dignite/cms/sites/index.ts +0 -1
  224. package/config/src/proxy/dignite/cms/sites/models.ts +0 -5
  225. package/config/src/proxy/dignite/cms-kit/admin/brand/brand-admin.service.ts +0 -21
  226. package/config/src/proxy/dignite/cms-kit/admin/brand/index.ts +0 -2
  227. package/config/src/proxy/dignite/cms-kit/admin/brand/models.ts +0 -7
  228. package/config/src/proxy/dignite/cms-kit/admin/index.ts +0 -2
  229. package/config/src/proxy/dignite/cms-kit/brand/brand.service.ts +0 -20
  230. package/config/src/proxy/dignite/cms-kit/brand/index.ts +0 -2
  231. package/config/src/proxy/dignite/cms-kit/brand/models.ts +0 -7
  232. package/config/src/proxy/dignite/cms-kit/index.ts +0 -3
  233. package/config/src/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
  234. package/config/src/proxy/dignite/file-explorer/directories/index.ts +0 -2
  235. package/config/src/proxy/dignite/file-explorer/directories/models.ts +0 -35
  236. package/config/src/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -101
  237. package/config/src/proxy/dignite/file-explorer/files/index.ts +0 -2
  238. package/config/src/proxy/dignite/file-explorer/files/models.ts +0 -61
  239. package/config/src/proxy/dignite/file-explorer/index.ts +0 -3
  240. package/config/src/proxy/dignite/index.ts +0 -6
  241. package/config/src/proxy/dignite/travely/areas/index.ts +0 -1
  242. package/config/src/proxy/dignite/travely/areas/models.ts +0 -5
  243. package/config/src/proxy/dignite/travely/common/index.ts +0 -1
  244. package/config/src/proxy/dignite/travely/common/models.ts +0 -5
  245. package/config/src/proxy/dignite/travely/entity-snapshots/index.ts +0 -1
  246. package/config/src/proxy/dignite/travely/entity-snapshots/models.ts +0 -7
  247. package/config/src/proxy/dignite/travely/guides/index.ts +0 -1
  248. package/config/src/proxy/dignite/travely/guides/models.ts +0 -26
  249. package/config/src/proxy/dignite/travely/index.ts +0 -9
  250. package/config/src/proxy/dignite/travely/merchants/index.ts +0 -1
  251. package/config/src/proxy/dignite/travely/merchants/models.ts +0 -9
  252. package/config/src/proxy/dignite/travely/orders/index.ts +0 -1
  253. package/config/src/proxy/dignite/travely/orders/models.ts +0 -52
  254. package/config/src/proxy/dignite/travely/payment/index.ts +0 -1
  255. package/config/src/proxy/dignite/travely/payment/models.ts +0 -9
  256. package/config/src/proxy/dignite/travely/tours/booking-time-type.enum.ts +0 -9
  257. package/config/src/proxy/dignite/travely/tours/index.ts +0 -5
  258. package/config/src/proxy/dignite/travely/tours/models.ts +0 -77
  259. package/config/src/proxy/dignite/travely/tours/period-type.enum.ts +0 -9
  260. package/config/src/proxy/dignite/travely/tours/tour-recommendation-rank.enum.ts +0 -12
  261. package/config/src/proxy/dignite/travely/tours/tourist-type.enum.ts +0 -8
  262. package/config/src/proxy/microsoft/asp-net-core/index.ts +0 -2
  263. package/config/src/proxy/microsoft/asp-net-core/mvc/index.ts +0 -1
  264. package/config/src/proxy/microsoft/asp-net-core/mvc/models.ts +0 -12
  265. package/config/src/proxy/microsoft/extensions/index.ts +0 -2
  266. package/config/src/proxy/microsoft/extensions/primitives/index.ts +0 -1
  267. package/config/src/proxy/microsoft/extensions/primitives/models.ts +0 -9
  268. package/config/src/proxy/microsoft/index.ts +0 -4
  269. package/config/src/proxy/microsoft/net/http/headers/index.ts +0 -1
  270. package/config/src/proxy/microsoft/net/http/headers/models.ts +0 -7
  271. package/config/src/proxy/microsoft/net/http/index.ts +0 -2
  272. package/config/src/proxy/microsoft/net/index.ts +0 -2
  273. package/config/src/services/validators.service.ts +0 -80
  274. package/ng-package.json +0 -10
  275. package/src/lib/cms-routing.module.ts +0 -102
  276. package/src/lib/cms.module.ts +0 -109
  277. package/src/lib/components/admin/entries/create-or-edit-entries.component.html +0 -137
  278. package/src/lib/components/admin/entries/create-or-edit-entries.component.scss +0 -1
  279. package/src/lib/components/admin/entries/create-or-edit-entries.component.spec.ts +0 -21
  280. package/src/lib/components/admin/entries/create-or-edit-entries.component.ts +0 -318
  281. package/src/lib/components/admin/entries/create-or-update-entry-input-base.ts +0 -33
  282. package/src/lib/components/admin/entries/create.component.html +0 -13
  283. package/src/lib/components/admin/entries/create.component.scss +0 -1
  284. package/src/lib/components/admin/entries/create.component.spec.ts +0 -21
  285. package/src/lib/components/admin/entries/create.component.ts +0 -110
  286. package/src/lib/components/admin/entries/edit.component.html +0 -9
  287. package/src/lib/components/admin/entries/edit.component.scss +0 -1
  288. package/src/lib/components/admin/entries/edit.component.spec.ts +0 -21
  289. package/src/lib/components/admin/entries/edit.component.ts +0 -111
  290. package/src/lib/components/admin/entries/entries.component.html +0 -112
  291. package/src/lib/components/admin/entries/entries.component.scss +0 -1
  292. package/src/lib/components/admin/entries/entries.component.spec.ts +0 -21
  293. package/src/lib/components/admin/entries/entries.component.ts +0 -216
  294. package/src/lib/components/admin/entries/index.ts +0 -4
  295. package/src/lib/components/admin/fields/create-field.component.html +0 -12
  296. package/src/lib/components/admin/fields/create-field.component.scss +0 -1
  297. package/src/lib/components/admin/fields/create-field.component.spec.ts +0 -21
  298. package/src/lib/components/admin/fields/create-field.component.ts +0 -82
  299. package/src/lib/components/admin/fields/create-or-edit-field.component.html +0 -40
  300. package/src/lib/components/admin/fields/create-or-edit-field.component.scss +0 -0
  301. package/src/lib/components/admin/fields/create-or-edit-field.component.spec.ts +0 -21
  302. package/src/lib/components/admin/fields/create-or-edit-field.component.ts +0 -121
  303. package/src/lib/components/admin/fields/create-or-update-field-input-base.ts +0 -33
  304. package/src/lib/components/admin/fields/edit-field.component.html +0 -16
  305. package/src/lib/components/admin/fields/edit-field.component.scss +0 -0
  306. package/src/lib/components/admin/fields/edit-field.component.spec.ts +0 -21
  307. package/src/lib/components/admin/fields/edit-field.component.ts +0 -101
  308. package/src/lib/components/admin/fields/field-group.component.html +0 -69
  309. package/src/lib/components/admin/fields/field-group.component.scss +0 -0
  310. package/src/lib/components/admin/fields/field-group.component.spec.ts +0 -21
  311. package/src/lib/components/admin/fields/field-group.component.ts +0 -151
  312. package/src/lib/components/admin/fields/fields.component.html +0 -74
  313. package/src/lib/components/admin/fields/fields.component.scss +0 -1
  314. package/src/lib/components/admin/fields/fields.component.spec.ts +0 -21
  315. package/src/lib/components/admin/fields/fields.component.ts +0 -109
  316. package/src/lib/components/admin/fields/index.ts +0 -6
  317. package/src/lib/components/admin/index.ts +0 -3
  318. package/src/lib/components/admin/sections/create-or-update-sections-input-base.ts +0 -32
  319. package/src/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.ts +0 -79
  320. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.html +0 -187
  321. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.scss +0 -1
  322. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.spec.ts +0 -21
  323. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.ts +0 -424
  324. package/src/lib/components/admin/sections/entry-types/index.ts +0 -2
  325. package/src/lib/components/admin/sections/index.ts +0 -3
  326. package/src/lib/components/admin/sections/sections.component.html +0 -188
  327. package/src/lib/components/admin/sections/sections.component.scss +0 -1
  328. package/src/lib/components/admin/sections/sections.component.spec.ts +0 -21
  329. package/src/lib/components/admin/sections/sections.component.ts +0 -302
  330. package/src/lib/components/dynamic-form/entry/entry-config.component.html +0 -36
  331. package/src/lib/components/dynamic-form/entry/entry-config.component.scss +0 -27
  332. package/src/lib/components/dynamic-form/entry/entry-config.component.spec.ts +0 -21
  333. package/src/lib/components/dynamic-form/entry/entry-config.component.ts +0 -114
  334. package/src/lib/components/dynamic-form/entry/entry-config.ts +0 -24
  335. package/src/lib/components/dynamic-form/entry/entry-control.component.html +0 -26
  336. package/src/lib/components/dynamic-form/entry/entry-control.component.scss +0 -1
  337. package/src/lib/components/dynamic-form/entry/entry-control.component.spec.ts +0 -21
  338. package/src/lib/components/dynamic-form/entry/entry-control.component.ts +0 -111
  339. package/src/lib/components/dynamic-form/entry/index.ts +0 -3
  340. package/src/lib/components/dynamic-form/form-control-group.ts +0 -27
  341. package/src/lib/components/dynamic-form/index.ts +0 -4
  342. package/src/lib/components/dynamic-form/matrix/index.ts +0 -3
  343. package/src/lib/components/dynamic-form/matrix/matrix-config.component.html +0 -148
  344. package/src/lib/components/dynamic-form/matrix/matrix-config.component.scss +0 -0
  345. package/src/lib/components/dynamic-form/matrix/matrix-config.component.spec.ts +0 -21
  346. package/src/lib/components/dynamic-form/matrix/matrix-config.component.ts +0 -239
  347. package/src/lib/components/dynamic-form/matrix/matrix-config.ts +0 -63
  348. package/src/lib/components/dynamic-form/matrix/matrix-control.component.html +0 -42
  349. package/src/lib/components/dynamic-form/matrix/matrix-control.component.scss +0 -0
  350. package/src/lib/components/dynamic-form/matrix/matrix-control.component.spec.ts +0 -21
  351. package/src/lib/components/dynamic-form/matrix/matrix-control.component.ts +0 -106
  352. package/src/lib/components/dynamic-form/table/index.ts +0 -3
  353. package/src/lib/components/dynamic-form/table/table-config.component.html +0 -85
  354. package/src/lib/components/dynamic-form/table/table-config.component.scss +0 -10
  355. package/src/lib/components/dynamic-form/table/table-config.component.spec.ts +0 -21
  356. package/src/lib/components/dynamic-form/table/table-config.component.ts +0 -170
  357. package/src/lib/components/dynamic-form/table/table-config.ts +0 -45
  358. package/src/lib/components/dynamic-form/table/table-control.component.html +0 -54
  359. package/src/lib/components/dynamic-form/table/table-control.component.scss +0 -1
  360. package/src/lib/components/dynamic-form/table/table-control.component.spec.ts +0 -21
  361. package/src/lib/components/dynamic-form/table/table-control.component.ts +0 -114
  362. package/src/lib/components/index.ts +0 -2
  363. package/src/lib/constants/index.ts +0 -1
  364. package/src/lib/constants/styles.ts +0 -20
  365. package/src/lib/enums/ecms-component.ts +0 -11
  366. package/src/lib/enums/index.ts +0 -1
  367. package/src/lib/proxy/README.md +0 -17
  368. package/src/lib/proxy/admin/domains/domain-admin.service.ts +0 -38
  369. package/src/lib/proxy/admin/domains/index.ts +0 -2
  370. package/src/lib/proxy/admin/domains/models.ts +0 -9
  371. package/src/lib/proxy/admin/dynamic-forms/form-admin.service.ts +0 -21
  372. package/src/lib/proxy/admin/dynamic-forms/index.ts +0 -2
  373. package/src/lib/proxy/admin/dynamic-forms/models.ts +0 -5
  374. package/src/lib/proxy/admin/entries/entry-admin.service.ts +0 -109
  375. package/src/lib/proxy/admin/entries/index.ts +0 -2
  376. package/src/lib/proxy/admin/entries/models.ts +0 -68
  377. package/src/lib/proxy/admin/fields/field-admin.service.ts +0 -64
  378. package/src/lib/proxy/admin/fields/field-group-admin.service.ts +0 -56
  379. package/src/lib/proxy/admin/fields/index.ts +0 -3
  380. package/src/lib/proxy/admin/index.ts +0 -7
  381. package/src/lib/proxy/admin/sections/entry-type-admin.service.ts +0 -55
  382. package/src/lib/proxy/admin/sections/index.ts +0 -3
  383. package/src/lib/proxy/admin/sections/section-admin.service.ts +0 -74
  384. package/src/lib/proxy/admin/settings/site-settings-admin.service.ts +0 -37
  385. package/src/lib/proxy/dignite/abp/data/index.ts +0 -1
  386. package/src/lib/proxy/dignite/abp/data/models.ts +0 -4
  387. package/src/lib/proxy/dignite/abp/index.ts +0 -2
  388. package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +0 -65
  389. package/src/lib/proxy/dignite/file-explorer/directories/index.ts +0 -2
  390. package/src/lib/proxy/dignite/file-explorer/directories/models.ts +0 -35
  391. package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +0 -86
  392. package/src/lib/proxy/dignite/file-explorer/files/index.ts +0 -2
  393. package/src/lib/proxy/dignite/file-explorer/files/models.ts +0 -58
  394. package/src/lib/proxy/dignite/file-explorer/index.ts +0 -3
  395. package/src/lib/proxy/dignite/index.ts +0 -3
  396. package/src/lib/proxy/entries/entry-status.enum.ts +0 -8
  397. package/src/lib/proxy/entries/index.ts +0 -1
  398. package/src/lib/proxy/fields/index.ts +0 -1
  399. package/src/lib/proxy/fields/models.ts +0 -9
  400. package/src/lib/proxy/generate-proxy.json +0 -11425
  401. package/src/lib/proxy/index.ts +0 -9
  402. package/src/lib/proxy/microsoft/asp-net-core/index.ts +0 -2
  403. package/src/lib/proxy/microsoft/asp-net-core/mvc/index.ts +0 -1
  404. package/src/lib/proxy/microsoft/asp-net-core/mvc/models.ts +0 -12
  405. package/src/lib/proxy/microsoft/extensions/index.ts +0 -2
  406. package/src/lib/proxy/microsoft/extensions/primitives/index.ts +0 -1
  407. package/src/lib/proxy/microsoft/extensions/primitives/models.ts +0 -9
  408. package/src/lib/proxy/microsoft/index.ts +0 -4
  409. package/src/lib/proxy/microsoft/net/http/headers/index.ts +0 -1
  410. package/src/lib/proxy/microsoft/net/http/headers/models.ts +0 -7
  411. package/src/lib/proxy/microsoft/net/http/index.ts +0 -2
  412. package/src/lib/proxy/microsoft/net/index.ts +0 -2
  413. package/src/lib/proxy/sections/index.ts +0 -2
  414. package/src/lib/proxy/sections/models.ts +0 -14
  415. package/src/lib/proxy/sections/section-type.enum.ts +0 -9
  416. package/src/lib/proxy/settings/index.ts +0 -1
  417. package/src/lib/proxy/settings/models.ts +0 -6
  418. package/src/lib/proxy/volo/abp/content/index.ts +0 -1
  419. package/src/lib/proxy/volo/abp/content/models.ts +0 -6
  420. package/src/lib/proxy/volo/abp/index.ts +0 -2
  421. package/src/lib/proxy/volo/cms-kit/index.ts +0 -2
  422. package/src/lib/proxy/volo/cms-kit/users/index.ts +0 -1
  423. package/src/lib/proxy/volo/index.ts +0 -3
  424. package/src/lib/resolvers/extensions-props-action-token.resolver.ts +0 -178
  425. package/src/lib/resolvers/page-default-toolbar-actions.ts +0 -170
  426. package/src/lib/resolvers/table-default-entity-actions.ts +0 -24
  427. package/src/lib/resolvers/table-default-entity-props.ts +0 -36
  428. package/src/lib/services/appent-content.ts +0 -13
  429. package/src/lib/services/cms-api.service.ts +0 -71
  430. package/src/lib/services/cms.service.ts +0 -18
  431. package/src/lib/services/field-abstracts.service.ts +0 -40
  432. package/src/lib/services/index.ts +0 -4
  433. package/src/lib/services/simple-reuse-strategy.ts +0 -74
  434. package/src/lib/services/update-list.service.ts +0 -15
  435. package/src/lib/services/validators.service.ts +0 -82
  436. package/src/test.ts +0 -26
  437. package/tsconfig.lib.json +0 -16
  438. package/tsconfig.lib.prod.json +0 -10
  439. package/tsconfig.spec.json +0 -17
  440. /package/config/{src/proxy/admin/domains/index.ts → proxy/admin/domains/index.d.ts} +0 -0
  441. /package/config/{src/proxy/dignite/cms/admin/sites/index.ts → proxy/dignite/cms/admin/sites/index.d.ts} +0 -0
  442. /package/{config/src/proxy/dignite/cms/admin/dynamic-forms/index.ts → lib/proxy/admin/dynamic-forms/index.d.ts} +0 -0
  443. /package/{config/src/proxy/dignite/cms/admin/entries/index.ts → lib/proxy/admin/entries/index.d.ts} +0 -0
  444. /package/{config/src/proxy/dignite/cms/admin/fields/index.ts → lib/proxy/admin/fields/index.d.ts} +0 -0
  445. /package/{config/src/proxy/dignite/cms/admin/sections/index.ts → lib/proxy/admin/sections/index.d.ts} +0 -0
  446. /package/{src/lib/proxy/admin/settings/index.ts → lib/proxy/admin/settings/index.d.ts} +0 -0
  447. /package/{config/src/proxy/dignite/cms/entries/index.ts → lib/proxy/entries/index.d.ts} +0 -0
  448. /package/{config/src/proxy/dignite/cms/sections/index.ts → lib/proxy/sections/index.d.ts} +0 -0
@@ -0,0 +1,3932 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, inject, Component, ViewContainerRef, Input, ViewChildren, ViewChild, EventEmitter, Output, RendererFactory2, InjectionToken, 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 { Router, RouterModule } from '@angular/router';
9
+ import * as i12 from '@abp/ng.components/extensible';
10
+ import { EXTENSIONS_IDENTIFIER, ToolbarAction, EntityProp, EntityAction, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps, ExtensibleModule } from '@abp/ng.components/extensible';
11
+ import * as i1$1 from '@angular/forms';
12
+ import { FormBuilder, Validators, FormGroup, FormControl, FormArray, FormsModule } from '@angular/forms';
13
+ import * as i8 from '@swimlane/ngx-datatable';
14
+ import { ColumnMode } from '@swimlane/ngx-datatable';
15
+ import { finalize, map, tap } from 'rxjs';
16
+ import { UpdateListService } from '@dignite-ng/expand.core';
17
+ import * as i2 from '@angular/common';
18
+ import * as i9 from '@ngx-validate/core';
19
+ import * as i10 from '@ng-bootstrap/ng-bootstrap';
20
+ import { NgbNavModule, NgbAccordionModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
21
+ import * as i11 from '@abp/ng.components/page';
22
+ import { PageModule } from '@abp/ng.components/page';
23
+ import { pinyin } from 'pinyin-pro';
24
+ import * as i8$1 from '@dignite-ng/expand.dynamic-form';
25
+ import { DynamicFormModule } from '@dignite-ng/expand.dynamic-form';
26
+ import { finalize as finalize$1 } from 'rxjs/operators';
27
+ import * as i4 from 'ng-zorro-antd/select';
28
+ import { NzSelectModule } from 'ng-zorro-antd/select';
29
+ import { fielFieldControlGroup } from '@dignite-ng/expand.file-explorer';
30
+ import { ckEditorFieldControlGroup } from '@dignite-ng/expand.ck-editor';
31
+
32
+ class SiteSettingsAdminService {
33
+ constructor(restService) {
34
+ this.restService = restService;
35
+ this.apiName = 'CmsAdmin';
36
+ this.getAllLanguages = (config) => this.restService.request({
37
+ method: 'GET',
38
+ url: '/api/cms-admin/site-settings/all-languages',
39
+ }, { apiName: this.apiName, ...config });
40
+ this.getBrand = (config) => this.restService.request({
41
+ method: 'GET',
42
+ url: '/api/cms-admin/site-settings/brand',
43
+ }, { apiName: this.apiName, ...config });
44
+ this.getDefaultLanguage = (config) => this.restService.request({
45
+ method: 'GET',
46
+ responseType: 'text',
47
+ url: '/api/cms-admin/site-settings/default-language',
48
+ }, { apiName: this.apiName, ...config });
49
+ }
50
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SiteSettingsAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
51
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SiteSettingsAdminService, providedIn: 'root' }); }
52
+ }
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SiteSettingsAdminService, decorators: [{
54
+ type: Injectable,
55
+ args: [{
56
+ providedIn: 'root',
57
+ }]
58
+ }], ctorParameters: () => [{ type: i1.RestService }] });
59
+
60
+ var EntryStatus;
61
+ (function (EntryStatus) {
62
+ EntryStatus[EntryStatus["Draft"] = 0] = "Draft";
63
+ EntryStatus[EntryStatus["Published"] = 1] = "Published";
64
+ })(EntryStatus || (EntryStatus = {}));
65
+ const entryStatusOptions = mapEnumToOptions(EntryStatus);
66
+
67
+ var ECmsComponent;
68
+ (function (ECmsComponent) {
69
+ ECmsComponent["Entries"] = "Cms.Entries";
70
+ ECmsComponent["Entries_Create"] = "Cms.Entries.Create";
71
+ ECmsComponent["Entries_Edit"] = "Cms.Entries.Edit";
72
+ ECmsComponent["Fields"] = "Cms.Fields";
73
+ ECmsComponent["FieldsCreate"] = "Cms.Fields.Create";
74
+ ECmsComponent["FieldsEdit"] = "Cms.Fields.Edit";
75
+ ECmsComponent["Sites"] = "Cms.Sites";
76
+ ECmsComponent["Sections"] = "Cms.Sections";
77
+ ECmsComponent["SectionsCreateOrEdit"] = "Cms.Sections.Create.Or.Edit";
78
+ })(ECmsComponent || (ECmsComponent = {}));
79
+
80
+ class EntryAdminService {
81
+ constructor(restService) {
82
+ this.restService = restService;
83
+ this.apiName = 'CmsAdmin';
84
+ this.activate = (id, config) => this.restService.request({
85
+ method: 'POST',
86
+ url: `/api/cms-admin/entries/activate/${id}`,
87
+ }, { apiName: this.apiName, ...config });
88
+ this.create = (input, config) => this.restService.request({
89
+ method: 'POST',
90
+ url: '/api/cms-admin/entries',
91
+ body: input,
92
+ }, { apiName: this.apiName, ...config });
93
+ this.cultureExistWithSingleSection = (input, config) => this.restService.request({
94
+ method: 'GET',
95
+ url: '/api/cms-admin/entries/culture-exists-with-single-section',
96
+ params: { culture: input.culture, sectionId: input.sectionId, entryTypeId: input.entryTypeId },
97
+ }, { apiName: this.apiName, ...config });
98
+ this.delete = (id, config) => this.restService.request({
99
+ method: 'DELETE',
100
+ url: `/api/cms-admin/entries/${id}`,
101
+ }, { apiName: this.apiName, ...config });
102
+ this.get = (id, config) => this.restService.request({
103
+ method: 'GET',
104
+ url: `/api/cms-admin/entries/${id}`,
105
+ }, { apiName: this.apiName, ...config });
106
+ this.getAllVersions = (id, config) => this.restService.request({
107
+ method: 'GET',
108
+ url: `/api/cms-admin/entries/${id}/all-versions`,
109
+ }, { apiName: this.apiName, ...config });
110
+ this.getList = (input, config) => this.restService.request({
111
+ method: 'GET',
112
+ url: '/api/cms-admin/entries',
113
+ 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 },
114
+ }, { apiName: this.apiName, ...config });
115
+ this.getListByIds = (sectionId, ids, config) => this.restService.request({
116
+ method: 'GET',
117
+ url: '/api/cms-admin/entries/search-by-ids',
118
+ params: { sectionId, ids },
119
+ }, { apiName: this.apiName, ...config });
120
+ this.move = (id, input, config) => this.restService.request({
121
+ method: 'POST',
122
+ url: `/api/cms-admin/entries/move/${id}`,
123
+ body: input,
124
+ }, { apiName: this.apiName, ...config });
125
+ this.slugExists = (input, config) => this.restService.request({
126
+ method: 'GET',
127
+ url: '/api/cms-admin/entries/slug-exists',
128
+ params: { culture: input.culture, sectionId: input.sectionId, slug: input.slug },
129
+ }, { apiName: this.apiName, ...config });
130
+ this.update = (id, input, config) => this.restService.request({
131
+ method: 'PUT',
132
+ url: '/api/cms-admin/entries',
133
+ params: { id },
134
+ body: input,
135
+ }, { apiName: this.apiName, ...config });
136
+ }
137
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
138
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryAdminService, providedIn: 'root' }); }
139
+ }
140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryAdminService, decorators: [{
141
+ type: Injectable,
142
+ args: [{
143
+ providedIn: 'root',
144
+ }]
145
+ }], ctorParameters: () => [{ type: i1.RestService }] });
146
+
147
+ class EntryTypeAdminService {
148
+ constructor(restService) {
149
+ this.restService = restService;
150
+ this.apiName = 'CmsAdmin';
151
+ this.create = (input, config) => this.restService.request({
152
+ method: 'POST',
153
+ url: '/api/cms-admin/entry-types',
154
+ body: input,
155
+ }, { apiName: this.apiName, ...config });
156
+ this.delete = (id, config) => this.restService.request({
157
+ method: 'DELETE',
158
+ url: `/api/cms-admin/entry-types/${id}`,
159
+ }, { apiName: this.apiName, ...config });
160
+ this.get = (id, config) => this.restService.request({
161
+ method: 'GET',
162
+ url: `/api/cms-admin/entry-types/${id}`,
163
+ }, { apiName: this.apiName, ...config });
164
+ this.nameExists = (input, config) => this.restService.request({
165
+ method: 'GET',
166
+ url: '/api/cms-admin/entry-types/name-exists',
167
+ params: { sectionId: input.sectionId, name: input.name },
168
+ }, { apiName: this.apiName, ...config });
169
+ this.update = (id, input, config) => this.restService.request({
170
+ method: 'PUT',
171
+ url: `/api/cms-admin/entry-types/${id}`,
172
+ body: input,
173
+ }, { apiName: this.apiName, ...config });
174
+ }
175
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryTypeAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
176
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryTypeAdminService, providedIn: 'root' }); }
177
+ }
178
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryTypeAdminService, decorators: [{
179
+ type: Injectable,
180
+ args: [{
181
+ providedIn: 'root',
182
+ }]
183
+ }], ctorParameters: () => [{ type: i1.RestService }] });
184
+
185
+ class SectionAdminService {
186
+ constructor(restService) {
187
+ this.restService = restService;
188
+ this.apiName = 'CmsAdmin';
189
+ this.create = (input, config) => this.restService.request({
190
+ method: 'POST',
191
+ url: '/api/cms-admin/sections',
192
+ body: input,
193
+ }, { apiName: this.apiName, ...config });
194
+ this.delete = (id, config) => this.restService.request({
195
+ method: 'DELETE',
196
+ url: `/api/cms-admin/sections/${id}`,
197
+ }, { apiName: this.apiName, ...config });
198
+ this.get = (id, config) => this.restService.request({
199
+ method: 'GET',
200
+ url: `/api/cms-admin/sections/${id}`,
201
+ }, { apiName: this.apiName, ...config });
202
+ this.getList = (input, config) => this.restService.request({
203
+ method: 'GET',
204
+ url: '/api/cms-admin/sections',
205
+ params: { filter: input.filter, isActive: input.isActive, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
206
+ }, { apiName: this.apiName, ...config });
207
+ this.nameExists = (input, config) => this.restService.request({
208
+ method: 'GET',
209
+ url: '/api/cms-admin/sections/name-exists',
210
+ params: { name: input.name },
211
+ }, { apiName: this.apiName, ...config });
212
+ this.routeExists = (input, config) => this.restService.request({
213
+ method: 'GET',
214
+ url: '/api/cms-admin/sections/route-exists',
215
+ params: { route: input.route },
216
+ }, { apiName: this.apiName, ...config });
217
+ this.update = (id, input, config) => this.restService.request({
218
+ method: 'PUT',
219
+ url: `/api/cms-admin/sections/${id}`,
220
+ body: input,
221
+ }, { apiName: this.apiName, ...config });
222
+ }
223
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
224
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionAdminService, providedIn: 'root' }); }
225
+ }
226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionAdminService, decorators: [{
227
+ type: Injectable,
228
+ args: [{
229
+ providedIn: 'root',
230
+ }]
231
+ }], ctorParameters: () => [{ type: i1.RestService }] });
232
+
233
+ class EntriesComponent {
234
+ constructor(_EntryAdminService, _SectionAdminService, toaster, confirmation, configState, router, _LocalizationService) {
235
+ this._EntryAdminService = _EntryAdminService;
236
+ this._SectionAdminService = _SectionAdminService;
237
+ this.toaster = toaster;
238
+ this.confirmation = confirmation;
239
+ this.configState = configState;
240
+ this.router = router;
241
+ this._LocalizationService = _LocalizationService;
242
+ this.fb = inject(FormBuilder);
243
+ this._UpdateListService = inject(UpdateListService);
244
+ this.list = inject(ListService);
245
+ /**站点列表 */
246
+ // siteList: any[any] = []
247
+ /**选择的站点id */
248
+ // siteId: string = ''
249
+ /**站点下的版块 */
250
+ this.SiteOfSectionList = [];
251
+ /**版块下的语言列表 */
252
+ this.sectionLanguagesList = [];
253
+ /**版块下的条目类型列表 */
254
+ this.entryTypeList = [];
255
+ /**状态编码 */
256
+ this._entryStatusOptions = entryStatusOptions;
257
+ this.config = inject(ConfigStateService);
258
+ this._SiteSettingsAdminService = inject(SiteSettingsAdminService);
259
+ /**站点设置语言 */
260
+ this.SiteSettingsAdminLanguages = [];
261
+ /**列表相关 */
262
+ this.ColumnMode = ColumnMode;
263
+ this.data = {
264
+ items: [],
265
+ totalCount: 0,
266
+ };
267
+ this.filters = {};
268
+ this.filtersForm = this.fb.group({
269
+ siteId: [''],
270
+ sectionId: [''],
271
+ culture: [''],
272
+ filter: [''],
273
+ });
274
+ }
275
+ ngOnInit() {
276
+ this.getPageDate();
277
+ this._UpdateListService.updateListEvent.subscribe(() => {
278
+ this.list.get();
279
+ });
280
+ }
281
+ /**获取页面数据 */
282
+ async getPageDate() {
283
+ await this.getSiteOfSectionList();
284
+ await this.getSectionLanguagesList();
285
+ this.filters = this.filtersForm.value;
286
+ this.hookToQuery();
287
+ }
288
+ /**切换板块 */
289
+ async sectionIdChange() {
290
+ this.getSectionOfEntryType();
291
+ await this.getSectionLanguagesList();
292
+ this.resetData();
293
+ }
294
+ /**切换语言 */
295
+ async cultureChange() {
296
+ this.resetData();
297
+ }
298
+ /**获取站点下的版块 */
299
+ getSiteOfSectionList() {
300
+ return new Promise((resolve, rejects) => {
301
+ this._SectionAdminService.getList({
302
+ maxResultCount: 1000,
303
+ }).subscribe(res => {
304
+ this.SiteOfSectionList = res.items;
305
+ this.filtersForm.get('sectionId').patchValue(res.items[0]?.id || '');
306
+ this.getSectionOfEntryType();
307
+ resolve(res.items);
308
+ });
309
+ });
310
+ }
311
+ /**获取版块下的条目类型 */
312
+ getSectionOfEntryType() {
313
+ let sectionId = this.filtersForm.get('sectionId').value;
314
+ this.entryTypeList = this.SiteOfSectionList.find(el => el.id == sectionId)?.entryTypes || [];
315
+ }
316
+ /**获取版块下的语言列表 */
317
+ getSectionLanguagesList() {
318
+ return new Promise(async (resolve, rejects) => {
319
+ //获取所有语言 */
320
+ let languagesSystem = this.configState.getDeep('localization.languages');
321
+ //获取系统默认语言 */
322
+ let DefaultLanguage = this.config.getSetting("Abp.Localization.DefaultLanguage");
323
+ const configCmsSiteLanguages = this.config.getSetting("Cms.Site.Languages");
324
+ if (!configCmsSiteLanguages) {
325
+ await this.getSiteSettingsLanguages();
326
+ }
327
+ const LanguagesSite = (configCmsSiteLanguages ? configCmsSiteLanguages.split(',') : '') || this.SiteSettingsAdminLanguages;
328
+ let LanguagesArray = languagesSystem.filter(el => LanguagesSite.includes(el.cultureName));
329
+ //获取当前选择的语言
330
+ let nowculture = this.filtersForm.get('culture').value;
331
+ //当前选择的语言,是否在版块的的语言列表中
332
+ let isexist = LanguagesArray.find(el => el.cultureName == nowculture);
333
+ this.filtersForm.get('culture').patchValue(nowculture ? isexist ? nowculture : DefaultLanguage : DefaultLanguage);
334
+ this.sectionLanguagesList = LanguagesArray;
335
+ resolve(LanguagesArray);
336
+ });
337
+ }
338
+ /**
339
+ * 获取站点设置语言
340
+ */
341
+ getSiteSettingsLanguages() {
342
+ return new Promise((resolve, rejects) => {
343
+ this._SiteSettingsAdminService.getAllLanguages().subscribe(res => {
344
+ this.SiteSettingsAdminLanguages = res;
345
+ resolve(res);
346
+ });
347
+ });
348
+ }
349
+ resetData() {
350
+ this.filters = this.filtersForm.value;
351
+ this.list.page = 0;
352
+ this.data.items = [];
353
+ this.list.get();
354
+ }
355
+ /**新增-单个 */
356
+ createEntriesBtn() {
357
+ this.router.navigate(['/cms/admin/entries/create'], {
358
+ queryParams: { cultureName: this.filters.culture, sectionId: this.filters.sectionId, entryTypeId: this.entryTypeList[0].id }
359
+ });
360
+ }
361
+ hookToQuery() {
362
+ const getData = (query) => this._EntryAdminService.getList({
363
+ ...query,
364
+ ...this.filters,
365
+ });
366
+ const setData = (list) => {
367
+ this.data = list;
368
+ };
369
+ this.list.hookToQuery(getData).subscribe(setData);
370
+ }
371
+ /**删除条目 */
372
+ deletefield(row) {
373
+ this.confirmation.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
374
+ if (status == 'confirm') {
375
+ this._EntryAdminService.delete(row.id).pipe(finalize(() => {
376
+ })).subscribe(res => {
377
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
378
+ this.list.get();
379
+ });
380
+ }
381
+ });
382
+ }
383
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", 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 }); }
384
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EntriesComponent, selector: "cms-entries", providers: [
385
+ ListService,
386
+ // Provide this token if you want a different debounce time.
387
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
388
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
389
+ {
390
+ provide: EXTENSIONS_IDENTIFIER,
391
+ useValue: ECmsComponent.Entries,
392
+ },
393
+ ], 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\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\r\n <abp-extensible-table [data]=\"data?.items\" [recordsTotal]=\"data?.totalCount\" [list]=\"list\"></abp-extensible-table>\r\n\r\n\r\n\r\n\r\n\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::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::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::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 [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"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", "info", "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: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: i11.PageToolbarContainerComponent, selector: "abp-page-toolbar-container" }, { kind: "component", type: i12.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], outputs: ["tableActivate"], exportAs: ["abpExtensibleTable"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
394
+ }
395
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntriesComponent, decorators: [{
396
+ type: Component,
397
+ args: [{ selector: 'cms-entries', providers: [
398
+ ListService,
399
+ // Provide this token if you want a different debounce time.
400
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
401
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
402
+ {
403
+ provide: EXTENSIONS_IDENTIFIER,
404
+ useValue: ECmsComponent.Entries,
405
+ },
406
+ ], 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\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\r\n <abp-extensible-table [data]=\"data?.items\" [recordsTotal]=\"data?.totalCount\" [list]=\"list\"></abp-extensible-table>\r\n\r\n\r\n\r\n\r\n\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::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::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::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 [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"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"] }]
407
+ }], ctorParameters: () => [{ type: EntryAdminService }, { type: SectionAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1.ConfigStateService }, { type: i3$1.Router }, { type: i1.LocalizationService }] });
408
+
409
+ class CreateOrUpdateEntryInputBase {
410
+ constructor(data) {
411
+ /**语言 */
412
+ this.culture = ['', [Validators.required]];
413
+ /**条目id */
414
+ this.entryTypeId = [''];
415
+ /**标题 */
416
+ this.title = ['', [Validators.required]];
417
+ /**别名 */
418
+ this.slug = ['', [Validators.required]];
419
+ /**是否是草稿 */
420
+ this.draft = ['', []];
421
+ /**发布时间 */
422
+ this.publishTime = ['', [Validators.required]];
423
+ /**上级目录 */
424
+ this.parentId = [null];
425
+ /**修订说明 */
426
+ this.versionNotes = [null];
427
+ /**版本 */
428
+ this.initialVersionId = [null];
429
+ this.extraProperties = new FormGroup({});
430
+ if (data) {
431
+ for (const key in data) {
432
+ if (data.hasOwnProperty(key)) {
433
+ this[key] = data[key];
434
+ }
435
+ }
436
+ }
437
+ }
438
+ }
439
+
440
+ class ValidatorsService {
441
+ constructor() {
442
+ this.toaster = inject(ToasterService);
443
+ this._LocalizationService = inject(LocalizationService);
444
+ }
445
+ /**检查表单- */
446
+ isCheckForm(input, module = 'AbpValidation') {
447
+ let keys = Object.keys(input);
448
+ for (let i = 0; i < keys.length; i++) {
449
+ const element = keys[i];
450
+ if (input[element] == false) {
451
+ let info = `"${this._LocalizationService.instant(`${module}::${element}`)}" `;
452
+ if (element.includes('.') && !element.includes('].')) {
453
+ let arr = element.split('.');
454
+ info = `"${this._LocalizationService.instant(`CmsKit::${arr[0]}`)}.${this._LocalizationService.instant(`CmsKit::${arr[1]}`)}"`;
455
+ }
456
+ if (element.includes('].')) {
457
+ let arr = element.split('].');
458
+ let arrStart = arr[0].split('[');
459
+ info = `"${this._LocalizationService.instant(`CmsKit::${arrStart[0]}`)}[${arrStart[1]}].${this._LocalizationService.instant(`CmsKit::${arr[1]}`)}"`;
460
+ }
461
+ info += `${this._LocalizationService.instant(`AbpValidation::ThisFieldIsNotValid`)}`;
462
+ //使用abp多语言提示
463
+ this.toaster.warn(info);
464
+ return true;
465
+ }
466
+ }
467
+ return false;
468
+ }
469
+ /**获取表单所有字段是否通过验证 */
470
+ getFormValidationStatus(formEntity) {
471
+ let validationStatus = {};
472
+ // 递归遍历表单组和表单控件集合
473
+ const traverseForm = (form, prefix = '') => {
474
+ if (form instanceof FormGroup) {
475
+ Object.keys(form.controls).forEach(key => {
476
+ const control = form.controls[key];
477
+ let displayName = key.charAt(0).toUpperCase() + key.slice(1);
478
+ const fullKey = prefix ? `${prefix}.${displayName}` : displayName;
479
+ if (control instanceof FormControl) {
480
+ validationStatus[fullKey] = control.valid;
481
+ }
482
+ else if (control instanceof FormArray) {
483
+ traverseForm(control, fullKey);
484
+ }
485
+ else if (control instanceof FormGroup) {
486
+ traverseForm(control, fullKey);
487
+ }
488
+ });
489
+ }
490
+ else if (form instanceof FormArray) {
491
+ form.controls.forEach((control, index) => {
492
+ const fullKey = prefix ? `${prefix}[${index}]` : `[${index}]`;
493
+ if (control instanceof FormControl) {
494
+ validationStatus[fullKey] = control.valid;
495
+ }
496
+ else if (control instanceof FormArray) {
497
+ traverseForm(control, fullKey);
498
+ }
499
+ else if (control instanceof FormGroup) {
500
+ traverseForm(control, fullKey);
501
+ }
502
+ });
503
+ }
504
+ };
505
+ traverseForm(formEntity);
506
+ return validationStatus;
507
+ }
508
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ValidatorsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
509
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ValidatorsService, providedIn: 'root' }); }
510
+ }
511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ValidatorsService, decorators: [{
512
+ type: Injectable,
513
+ args: [{
514
+ providedIn: 'root'
515
+ }]
516
+ }], ctorParameters: () => [] });
517
+
518
+ class FieldGroupAdminService {
519
+ constructor(restService) {
520
+ this.restService = restService;
521
+ this.apiName = 'CmsAdmin';
522
+ this.create = (input, config) => this.restService.request({
523
+ method: 'POST',
524
+ url: '/api/cms-admin/field-groups',
525
+ body: input,
526
+ }, { apiName: this.apiName, ...config });
527
+ this.delete = (id, config) => this.restService.request({
528
+ method: 'DELETE',
529
+ url: `/api/cms-admin/field-groups/${id}`,
530
+ }, { apiName: this.apiName, ...config });
531
+ this.get = (id, config) => this.restService.request({
532
+ method: 'GET',
533
+ url: `/api/cms-admin/field-groups/${id}`,
534
+ }, { apiName: this.apiName, ...config });
535
+ this.getList = (input, config) => this.restService.request({
536
+ method: 'GET',
537
+ url: '/api/cms-admin/field-groups',
538
+ params: { input },
539
+ }, { apiName: this.apiName, ...config });
540
+ this.update = (id, input, config) => this.restService.request({
541
+ method: 'PUT',
542
+ url: `/api/cms-admin/field-groups/${id}`,
543
+ body: input,
544
+ }, { apiName: this.apiName, ...config });
545
+ }
546
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
547
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupAdminService, providedIn: 'root' }); }
548
+ }
549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupAdminService, decorators: [{
550
+ type: Injectable,
551
+ args: [{
552
+ providedIn: 'root',
553
+ }]
554
+ }], ctorParameters: () => [{ type: i1.RestService }] });
555
+
556
+ class FormAdminService {
557
+ constructor(restService) {
558
+ this.restService = restService;
559
+ this.apiName = 'CmsAdmin';
560
+ this.getFormControls = (config) => this.restService.request({
561
+ method: 'GET',
562
+ url: '/api/cms-admin/dynamic-forms/forms',
563
+ }, { apiName: this.apiName, ...config });
564
+ }
565
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
566
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormAdminService, providedIn: 'root' }); }
567
+ }
568
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormAdminService, decorators: [{
569
+ type: Injectable,
570
+ args: [{
571
+ providedIn: 'root',
572
+ }]
573
+ }], ctorParameters: () => [{ type: i1.RestService }] });
574
+
575
+ class FieldAbstractsService {
576
+ constructor(_FieldGroupAdminService, _FormAdminService) {
577
+ this._FieldGroupAdminService = _FieldGroupAdminService;
578
+ this._FormAdminService = _FormAdminService;
579
+ /**字段分组列表 */
580
+ this.fieldGroupList = [];
581
+ /**表单控件类型 */
582
+ this.fromControlList = [];
583
+ }
584
+ /**获取字段分组列表 */
585
+ getfieldGroupList() {
586
+ this._FieldGroupAdminService.getList({}).subscribe(res => {
587
+ this.fieldGroupList = res.items;
588
+ });
589
+ }
590
+ /**获取表单控件类型 */
591
+ getFromControlList() {
592
+ return new Promise((resolve, reject) => {
593
+ this._FormAdminService.getFormControls({}).subscribe(res => {
594
+ this.fromControlList = res.items;
595
+ resolve(res.items);
596
+ });
597
+ });
598
+ }
599
+ getExcludeAssignControl(typeName) {
600
+ // return this.fromControlList.filter(el => el.name !== typeName)
601
+ return this.fromControlList;
602
+ }
603
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAbstractsService, deps: [{ token: FieldGroupAdminService }, { token: FormAdminService }], target: i0.ɵɵFactoryTarget.Injectable }); }
604
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAbstractsService, providedIn: 'root' }); }
605
+ }
606
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAbstractsService, decorators: [{
607
+ type: Injectable,
608
+ args: [{
609
+ providedIn: 'root'
610
+ }]
611
+ }], ctorParameters: () => [{ type: FieldGroupAdminService }, { type: FormAdminService }] });
612
+
613
+ class CmsService {
614
+ constructor(restService) {
615
+ this.restService = restService;
616
+ this.apiName = 'Cms';
617
+ }
618
+ sample() {
619
+ return this.restService.request({ method: 'GET', url: '/api/Cms/sample' }, { apiName: this.apiName });
620
+ }
621
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
622
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsService, providedIn: 'root' }); }
623
+ }
624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsService, decorators: [{
625
+ type: Injectable,
626
+ args: [{
627
+ providedIn: 'root',
628
+ }]
629
+ }], ctorParameters: () => [{ type: i1.RestService }] });
630
+
631
+ class CmsApiService {
632
+ constructor() { }
633
+ /**
634
+ * 识别中文转化为拼音,固定返回类型
635
+ * 汉字转拼音
636
+ * 大写转小写
637
+ *
638
+ * */
639
+ chineseToPinyin(value) {
640
+ //去除字符串中所有的空格
641
+ let val = value.replaceAll(' ', "-");
642
+ let array = val.split('');
643
+ let newArray = [];
644
+ array.forEach((el, index) => {
645
+ //转化为小写
646
+ let elChange = el.toLowerCase();
647
+ let isChinese = (str) => {
648
+ return /^[\u4e00-\u9fa5]+$/.test(str);
649
+ };
650
+ if (isChinese(elChange)) {
651
+ const resultWithoutTone = pinyin(elChange, { toneType: 'none', type: 'array' });
652
+ elChange = resultWithoutTone.toString();
653
+ if (index < array.length - 1)
654
+ elChange += '-';
655
+ }
656
+ ;
657
+ newArray.push(elChange);
658
+ });
659
+ let pinyinstr = newArray.join('');
660
+ return pinyinstr || val;
661
+ }
662
+ /**
663
+ * 深拷贝--方法 */
664
+ deepClone(obj) {
665
+ if (typeof obj !== 'object' || obj === null)
666
+ return obj;
667
+ const result = Array.isArray(obj) ? [] : {};
668
+ for (let key in obj) {
669
+ if (obj.hasOwnProperty(key)) {
670
+ if (typeof obj[key] === 'object' && obj[key] !== null) {
671
+ if (obj[key] instanceof Date) {
672
+ result[key] = new Date(obj[key].getTime());
673
+ }
674
+ else if (obj[key] instanceof RegExp) {
675
+ result[key] = new RegExp(obj[key]);
676
+ }
677
+ else {
678
+ result[key] = this.deepClone(obj[key]);
679
+ }
680
+ }
681
+ else {
682
+ result[key] = obj[key];
683
+ }
684
+ }
685
+ }
686
+ return result;
687
+ }
688
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
689
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsApiService, providedIn: 'root' }); }
690
+ }
691
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsApiService, decorators: [{
692
+ type: Injectable,
693
+ args: [{
694
+ providedIn: 'root'
695
+ }]
696
+ }], ctorParameters: () => [] });
697
+
698
+ class CreateOrEditEntriesComponent {
699
+ constructor(toaster, _location, configState, _SectionAdminService, _EntryAdminService, datePipe, _LocalizationService, router, _CmsApiService) {
700
+ this.toaster = toaster;
701
+ this._location = _location;
702
+ this.configState = configState;
703
+ this._SectionAdminService = _SectionAdminService;
704
+ this._EntryAdminService = _EntryAdminService;
705
+ this.datePipe = datePipe;
706
+ this._LocalizationService = _LocalizationService;
707
+ this.router = router;
708
+ this._CmsApiService = _CmsApiService;
709
+ /**语言 */
710
+ this.cultureName = '';
711
+ /**条目类型id */
712
+ this.entryTypeId = '';
713
+ /**新建版本的版本id,同条目id */
714
+ this.RevisionEntryId = '';
715
+ /**选择的条目项 */
716
+ this.entryTypesItem = '';
717
+ /**版块id */
718
+ this.sectionId = '';
719
+ /**版块详情 */
720
+ this.SectionSelect = '';
721
+ /**语言列表 */
722
+ this.languagesList = [];
723
+ /**条目类型列表-用于选择上级条目 */
724
+ this.entryTypesList = [];
725
+ /**版本列表 */
726
+ this.AllVersionsList = [];
727
+ /**是否是编辑 */
728
+ this.isEdit = false;
729
+ /**来自父组件的传值 */
730
+ this.FromParentQueryParams = '';
731
+ /**指定id的条目信息 */
732
+ this.entrySelect = '';
733
+ this.time = 0;
734
+ this.config = inject(ConfigStateService);
735
+ }
736
+ set ParentQueryParams(v) {
737
+ if (v) {
738
+ this.FromParentQueryParams = v;
739
+ }
740
+ }
741
+ set entity(v) {
742
+ if (v) {
743
+ this._entity = v;
744
+ }
745
+ }
746
+ set parentEntrySelect(v) {
747
+ if (v) {
748
+ let V_extraProperties = this._CmsApiService.deepClone(this.convertExtraProperties(v.extraProperties));
749
+ v.extraProperties = V_extraProperties;
750
+ this.entrySelect = v;
751
+ }
752
+ }
753
+ /**将对象中的ExtraProperties赋值到extraProperties */
754
+ convertExtraProperties(obj) {
755
+ for (let key in obj) {
756
+ if (Array.isArray(obj[key])) {
757
+ obj[key].forEach(item => {
758
+ if (item.hasOwnProperty('ExtraProperties')) {
759
+ item['extraProperties'] = item['ExtraProperties'];
760
+ }
761
+ });
762
+ }
763
+ }
764
+ return obj;
765
+ }
766
+ /**别名表单实体 */
767
+ get sluginput() {
768
+ return this._entity.get('slug');
769
+ }
770
+ /**语言表单实体 */
771
+ get cultureinput() {
772
+ return this._entity.get('culture');
773
+ }
774
+ /**语言表单实体影子 */
775
+ get culture_shadowInput() {
776
+ return this._entity.get('culture_shadow');
777
+ }
778
+ /**extraProperties配置表单实体 */
779
+ get extraProperties() {
780
+ return this._entity.get('extraProperties');
781
+ }
782
+ async ngAfterContentInit() {
783
+ //Called after ngOnInit when the component's or directive's content has been initialized.
784
+ //Add 'implements AfterContentInit' to the class.
785
+ let queryParams = this.FromParentQueryParams;
786
+ if (this._entity && this.FromParentQueryParams) {
787
+ this._entity.setControl('slug', new FormControl('', {
788
+ validators: Validators.required,
789
+ asyncValidators: this.repetitionAsyncValidator(),
790
+ updateOn: 'blur'
791
+ }));
792
+ this._entity.setControl('culture_shadow', new FormControl('', {
793
+ validators: [Validators.required],
794
+ asyncValidators: this.cultureAsyncValidator_test(),
795
+ }));
796
+ this._entity.get('culture').disable();
797
+ if (queryParams.RevisionEntryId && this.entrySelect) {
798
+ this.RevisionEntryId = queryParams.RevisionEntryId;
799
+ this.setEntryconfig(this.entrySelect);
800
+ }
801
+ else {
802
+ this.setEntryconfig(queryParams);
803
+ }
804
+ if (this.sectionId)
805
+ await this.getSectionSelect();
806
+ if (this.RevisionEntryId)
807
+ await this.getAllVersionsList();
808
+ }
809
+ }
810
+ /**定义自定义异步验证 */
811
+ cultureAsyncValidator_test() {
812
+ return (ctrl) => {
813
+ return new Promise(resolve => {
814
+ let subculture = this._entity?.get('culture').value;
815
+ if (subculture == this.entrySelect?.culture || this.SectionSelect.type !== 0) {
816
+ resolve(null);
817
+ return;
818
+ }
819
+ this._EntryAdminService.cultureExistWithSingleSection({
820
+ culture: subculture,
821
+ sectionId: this.sectionId,
822
+ entryTypeId: this.entryTypeId
823
+ }).subscribe(res => {
824
+ if (res) {
825
+ resolve({ repetition: this._LocalizationService.instant(`Cms::EntriesAlreadyExistEntryType`, this.entryTypesItem.displayName, this.languagesList.find(el => el.cultureName == subculture).displayName) });
826
+ }
827
+ else {
828
+ resolve(null);
829
+ }
830
+ });
831
+ });
832
+ };
833
+ }
834
+ /**
835
+ * 设置条目详情
836
+ * @param {object} source - 数据源对象
837
+ */
838
+ setEntryconfig(source) {
839
+ this.entryTypeId = source.entryTypeId;
840
+ this.cultureName = source.culture || source.cultureName;
841
+ this.sectionId = source.sectionId;
842
+ }
843
+ /**定义自定义异步验证 */
844
+ repetitionAsyncValidator() {
845
+ return (ctrl) => {
846
+ return new Promise(resolve => {
847
+ let subslug = this._entity?.get('slug').value;
848
+ if (subslug == this.entrySelect?.slug) {
849
+ resolve(null);
850
+ return;
851
+ }
852
+ this._EntryAdminService.slugExists({
853
+ culture: this.cultureName,
854
+ sectionId: this.sectionId,
855
+ slug: subslug
856
+ }).subscribe(res => {
857
+ if (res) {
858
+ resolve({ repetition: this._LocalizationService.instant(`Cms::EntrySlug{0}AlreadyExist`, ctrl.value) });
859
+ }
860
+ else {
861
+ resolve(null);
862
+ }
863
+ });
864
+ });
865
+ };
866
+ }
867
+ /**获取版块详情 */
868
+ getSectionSelect() {
869
+ return new Promise((resolve, rejects) => {
870
+ this._SectionAdminService.get(this.sectionId).subscribe(async (res) => {
871
+ let languages = this.configState.getDeep('localization.languages');
872
+ this.languagesList = languages;
873
+ let entryTypesItem = res.entryTypes.find(el => el.id == this.entryTypeId);
874
+ this.SectionSelect = res;
875
+ await this.getTypeEntryList();
876
+ this.entryTypesItem = entryTypesItem;
877
+ this.entryTypesList = res.entryTypes.filter(el => el.id == this.entryTypeId);
878
+ this._entity.patchValue({
879
+ ...this.entrySelect,
880
+ initialVersionId: this.entrySelect?.initialVersionId || this.RevisionEntryId || '',
881
+ culture: this.cultureName,
882
+ culture_shadow: this.cultureName,
883
+ entryTypeId: this.entryTypeId,
884
+ publishTime: this.datePipe.transform(new Date(), 'yyyy-MM-dd HH:mm:ss'),
885
+ });
886
+ resolve(true);
887
+ });
888
+ });
889
+ }
890
+ /**获取条目类型下所有条目列表 */
891
+ getTypeEntryList() {
892
+ return new Promise((resolve, rejects) => {
893
+ this._EntryAdminService.getList({
894
+ sectionId: this.sectionId,
895
+ maxResultCount: 1000,
896
+ culture: this.cultureName
897
+ }).subscribe((res) => {
898
+ let entryTypesList = res.items.filter(el => el.id != this.entrySelect.id);
899
+ let parentList = entryTypesList.filter(el => !el.parentId);
900
+ parentList.forEach(el => {
901
+ let layer = 0;
902
+ el.layer = new Array(layer);
903
+ el.children = this.groupByParentId(entryTypesList, el.id, (layer + 1));
904
+ });
905
+ this.entryTypesList = parentList;
906
+ resolve(res);
907
+ });
908
+ });
909
+ }
910
+ /**对数组按照父子关系进行分组 */
911
+ groupByParentId(arr, id = '', layer) {
912
+ let result = [];
913
+ result = arr.filter(el => el.parentId == id);
914
+ result.forEach(el => {
915
+ el.layer = new Array(layer);
916
+ el.children = this.groupByParentId(arr, el.id, (layer + 1));
917
+ });
918
+ return result;
919
+ }
920
+ /**获取条目版本列表 */
921
+ getAllVersionsList() {
922
+ return new Promise((resolve, rejects) => {
923
+ this._EntryAdminService.getAllVersions(this.RevisionEntryId).subscribe(res => {
924
+ this.AllVersionsList = res.items;
925
+ resolve(res);
926
+ });
927
+ });
928
+ }
929
+ /**标题转化别名 */
930
+ setTitleToSlugBlur(event) {
931
+ let val = event.target.value;
932
+ let slug = this._entity.get('slug');
933
+ let pinyinstr = '';
934
+ if (slug.value)
935
+ return;
936
+ pinyinstr = this._CmsApiService.chineseToPinyin(val);
937
+ this._entity.patchValue({
938
+ slug: pinyinstr || val
939
+ });
940
+ }
941
+ /**使用Unicode编码范围判断是否是中文字符 */
942
+ isChinese(str) {
943
+ return /^[\u4e00-\u9fa5]+$/.test(str);
944
+ }
945
+ /**激活 */
946
+ ActivatedVersion(VersionId) {
947
+ this._EntryAdminService.activate(VersionId).subscribe((res) => {
948
+ this.AllVersionsList.forEach(el => {
949
+ el.isActivatedVersion = el.id === VersionId;
950
+ });
951
+ return;
952
+ });
953
+ }
954
+ /**编辑版本 */
955
+ toEditUrl(id) {
956
+ this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
957
+ this.router.navigate([`/cms/admin/entries/${id}/edit`]);
958
+ });
959
+ }
960
+ /**删除版本 */
961
+ delectVersion(vid) {
962
+ this._EntryAdminService.delete(vid).subscribe(res => {
963
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
964
+ this.getAllVersionsList();
965
+ });
966
+ }
967
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", 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 }); }
968
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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 <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\" *ngIf=\"SectionSelect.type===1\">\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.title}}</option>\n <ng-container *ngFor=\"let el of item.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n <ng-template #childTemplate let-data>\n <option [value]=\"data.value.id\">\n <ng-container *ngFor=\"let item of data.value.layer\">--</ng-container>\n {{data.value.title}}</option>\n <ng-container *ngFor=\"let el of data.value.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n </ng-container>\n\n </ng-template>\n </ng-container>\n\n </ng-container>\n </select>\n\n\n\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\n 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: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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", "info", "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: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { 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" }] }); }
969
+ }
970
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditEntriesComponent, decorators: [{
971
+ type: Component,
972
+ 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 <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\" *ngIf=\"SectionSelect.type===1\">\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.title}}</option>\n <ng-container *ngFor=\"let el of item.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n <ng-template #childTemplate let-data>\n <option [value]=\"data.value.id\">\n <ng-container *ngFor=\"let item of data.value.layer\">--</ng-container>\n {{data.value.title}}</option>\n <ng-container *ngFor=\"let el of data.value.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n </ng-container>\n\n </ng-template>\n </ng-container>\n\n </ng-container>\n </select>\n\n\n\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\n 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"] }]
973
+ }], ctorParameters: () => [{ 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: [{
974
+ type: Input
975
+ }], ParentQueryParams: [{
976
+ type: Input
977
+ }], entity: [{
978
+ type: Input
979
+ }], parentEntrySelect: [{
980
+ type: Input
981
+ }], FormDynamicontrolRef: [{
982
+ type: ViewChildren,
983
+ args: ['FormDynamicontrolRef', { read: ViewContainerRef }]
984
+ }] } });
985
+
986
+ class CreateComponent {
987
+ constructor(toaster, _location, route, _EntryAdminService, _LocalizationService) {
988
+ this.toaster = toaster;
989
+ this._location = _location;
990
+ this.route = route;
991
+ this._EntryAdminService = _EntryAdminService;
992
+ this._LocalizationService = _LocalizationService;
993
+ this.fb = inject(FormBuilder);
994
+ this._updateListService = inject(UpdateListService);
995
+ /**是否是草稿 */
996
+ this.draftType = false;
997
+ /**页面传值用于传递到子组件 */
998
+ this.queryParams = '';
999
+ /**指定id的条目信息 */
1000
+ this.entrySelect = '';
1001
+ this._ValidatorsService = inject(ValidatorsService);
1002
+ /**表单验证状态
1003
+ * {
1004
+ * title:true,
1005
+ * }
1006
+ */
1007
+ this.formValidation = '';
1008
+ this.isSubmit = false;
1009
+ }
1010
+ async ngOnInit() {
1011
+ this.queryParams = this.route.snapshot.queryParams;
1012
+ this.newEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
1013
+ if (this.queryParams.RevisionEntryId)
1014
+ await this.getEntrySelect();
1015
+ }
1016
+ /**获取条目信息 */
1017
+ getEntrySelect() {
1018
+ return new Promise((resolve, rejects) => {
1019
+ this._EntryAdminService.get(this.queryParams.RevisionEntryId).subscribe(res => {
1020
+ this.entrySelect = res;
1021
+ resolve(res);
1022
+ });
1023
+ });
1024
+ }
1025
+ /**保存 */
1026
+ save(draft) {
1027
+ this.newEntity.patchValue({
1028
+ draft: draft
1029
+ });
1030
+ this.newEntity.get('culture').enable();
1031
+ let input = this.newEntity.value;
1032
+ input.publishTime = new Date(new Date(input.publishTime).getTime() + (8 * 60 * 60 * 1000)).toISOString();
1033
+ input.culture = this.newEntity.get('culture').value;
1034
+ if (!this.isSubmit)
1035
+ return;
1036
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1037
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1038
+ return;
1039
+ if (!this.newEntity.valid)
1040
+ return;
1041
+ this._EntryAdminService.create(input).subscribe(res => {
1042
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1043
+ this._location.back();
1044
+ this._updateListService.updateList();
1045
+ });
1046
+ }
1047
+ /**触发点击按钮替身 */
1048
+ clickSubmit(type) {
1049
+ this.isSubmit = true;
1050
+ this.draftType = type;
1051
+ this.submitclick.nativeElement.click();
1052
+ }
1053
+ /**返回上一页 */
1054
+ backTo() {
1055
+ this._location.back();
1056
+ }
1057
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: EntryAdminService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1058
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateComponent, selector: "cms-create", providers: [
1059
+ {
1060
+ provide: EXTENSIONS_IDENTIFIER,
1061
+ useValue: ECmsComponent.Entries_Create,
1062
+ },
1063
+ ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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: 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" }] }); }
1064
+ }
1065
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateComponent, decorators: [{
1066
+ type: Component,
1067
+ args: [{ selector: 'cms-create', providers: [
1068
+ {
1069
+ provide: EXTENSIONS_IDENTIFIER,
1070
+ useValue: ECmsComponent.Entries_Create,
1071
+ },
1072
+ ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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"] }]
1073
+ }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: EntryAdminService }, { type: i1.LocalizationService }], propDecorators: { submitclick: [{
1074
+ type: ViewChild,
1075
+ args: ['submitclick', { static: true }]
1076
+ }] } });
1077
+
1078
+ /* eslint-disable @angular-eslint/use-lifecycle-interface */
1079
+ class EditComponent {
1080
+ constructor(toaster, _location, route, _EntryAdminService, _LocalizationService) {
1081
+ this.toaster = toaster;
1082
+ this._location = _location;
1083
+ this.route = route;
1084
+ this._EntryAdminService = _EntryAdminService;
1085
+ this._LocalizationService = _LocalizationService;
1086
+ this.fb = inject(FormBuilder);
1087
+ this._updateListService = inject(UpdateListService);
1088
+ /**是否是草稿 */
1089
+ this.draftType = false;
1090
+ /**页面传值用于传递到子组件 */
1091
+ this.queryParams = {};
1092
+ /**指定id的条目信息 */
1093
+ this.entrySelect = '';
1094
+ this._ValidatorsService = inject(ValidatorsService);
1095
+ /**表单验证状态
1096
+ * {
1097
+ * title:true,
1098
+ * }
1099
+ */
1100
+ this.formValidation = '';
1101
+ this.isSubmit = false;
1102
+ }
1103
+ async ngOnInit() {
1104
+ this.queryParams.RevisionEntryId = this.route.snapshot.params.entrieId;
1105
+ this.newEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
1106
+ await this.getEntrySelect();
1107
+ }
1108
+ /**获取条目信息 */
1109
+ getEntrySelect() {
1110
+ return new Promise((resolve, rejects) => {
1111
+ this._EntryAdminService.get(this.queryParams.RevisionEntryId).subscribe(res => {
1112
+ this.entrySelect = res;
1113
+ resolve(res);
1114
+ });
1115
+ });
1116
+ }
1117
+ /**保存 */
1118
+ save(draft) {
1119
+ this.newEntity.patchValue({
1120
+ draft: draft,
1121
+ });
1122
+ this.newEntity.get('culture').enable();
1123
+ let input = this.newEntity.value;
1124
+ input.publishTime = new Date(new Date(input.publishTime).getTime() + 8 * 60 * 60 * 1000).toISOString();
1125
+ input.culture = this.newEntity.get('culture').value;
1126
+ input.concurrencyStamp = this.entrySelect.concurrencyStamp;
1127
+ if (!this.isSubmit)
1128
+ return;
1129
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1130
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1131
+ return;
1132
+ if (!this.newEntity.valid)
1133
+ return;
1134
+ this._EntryAdminService.update(this.entrySelect.id, input).subscribe(res => {
1135
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1136
+ this.backTo();
1137
+ this._updateListService.updateList();
1138
+ });
1139
+ }
1140
+ /**触发点击按钮替身 */
1141
+ clickSubmit(type) {
1142
+ this.draftType = type;
1143
+ this.isSubmit = true;
1144
+ this.submitclick.nativeElement.click();
1145
+ }
1146
+ /**返回上一页 */
1147
+ backTo() {
1148
+ this._location.back();
1149
+ }
1150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: EntryAdminService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1151
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EditComponent, selector: "cms-edit", providers: [
1152
+ {
1153
+ provide: EXTENSIONS_IDENTIFIER,
1154
+ useValue: ECmsComponent.Entries_Edit,
1155
+ },
1156
+ ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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: 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" }] }); }
1157
+ }
1158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditComponent, decorators: [{
1159
+ type: Component,
1160
+ args: [{ selector: 'cms-edit', providers: [
1161
+ {
1162
+ provide: EXTENSIONS_IDENTIFIER,
1163
+ useValue: ECmsComponent.Entries_Edit,
1164
+ },
1165
+ ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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"] }]
1166
+ }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: EntryAdminService }, { type: i1.LocalizationService }], propDecorators: { submitclick: [{
1167
+ type: ViewChild,
1168
+ args: ['submitclick', { static: true }]
1169
+ }] } });
1170
+
1171
+ class FieldAdminService {
1172
+ constructor(restService) {
1173
+ this.restService = restService;
1174
+ this.apiName = 'CmsAdmin';
1175
+ this.create = (input, config) => this.restService.request({
1176
+ method: 'POST',
1177
+ url: '/api/cms-admin/fields',
1178
+ body: input,
1179
+ }, { apiName: this.apiName, ...config });
1180
+ this.delete = (id, config) => this.restService.request({
1181
+ method: 'DELETE',
1182
+ url: `/api/cms-admin/fields/${id}`,
1183
+ }, { apiName: this.apiName, ...config });
1184
+ this.get = (id, config) => this.restService.request({
1185
+ method: 'GET',
1186
+ url: `/api/cms-admin/fields/${id}`,
1187
+ }, { apiName: this.apiName, ...config });
1188
+ this.getList = (input, config) => this.restService.request({
1189
+ method: 'GET',
1190
+ url: '/api/cms-admin/fields',
1191
+ params: { filter: input.filter, groupId: input.groupId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
1192
+ }, { apiName: this.apiName, ...config });
1193
+ this.nameExists = (name, config) => this.restService.request({
1194
+ method: 'GET',
1195
+ url: `/api/cms-admin/fields/name-exists/${name}`,
1196
+ }, { apiName: this.apiName, ...config });
1197
+ this.update = (id, input, config) => this.restService.request({
1198
+ method: 'PUT',
1199
+ url: `/api/cms-admin/fields/${id}`,
1200
+ body: input,
1201
+ }, { apiName: this.apiName, ...config });
1202
+ }
1203
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAdminService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
1204
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAdminService, providedIn: 'root' }); }
1205
+ }
1206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAdminService, decorators: [{
1207
+ type: Injectable,
1208
+ args: [{
1209
+ providedIn: 'root',
1210
+ }]
1211
+ }], ctorParameters: () => [{ type: i1.RestService }] });
1212
+
1213
+ class FieldGroupComponent {
1214
+ constructor(fb, _FieldGroupAdminService, toaster, confirmation, _FieldAbstractsService, _LocalizationService) {
1215
+ this.fb = fb;
1216
+ this._FieldGroupAdminService = _FieldGroupAdminService;
1217
+ this.toaster = toaster;
1218
+ this.confirmation = confirmation;
1219
+ this._FieldAbstractsService = _FieldAbstractsService;
1220
+ this._LocalizationService = _LocalizationService;
1221
+ /**表单已存在的值 */
1222
+ this.selected = {};
1223
+ /**选择的字段分组id */
1224
+ this.fieldGroupId = '';
1225
+ /**创建分组模态框状态 */
1226
+ this.createGroupOpen = false;
1227
+ /**用于确定模态的繁忙状态是否为真 */
1228
+ this.modalBusy = false;
1229
+ /**编辑分组模态框状态 */
1230
+ this.editGroupOpen = false;
1231
+ /**点击分组回调 */
1232
+ this.OnGroupClickBack = new EventEmitter();
1233
+ this._ValidatorsService = inject(ValidatorsService);
1234
+ /**表单验证状态
1235
+ * {
1236
+ * title:true,
1237
+ * }
1238
+ */
1239
+ this.formValidation = '';
1240
+ }
1241
+ ngOnInit() {
1242
+ this._FieldAbstractsService.getfieldGroupList();
1243
+ }
1244
+ /**创建字段分组 */
1245
+ createGroupBtn() {
1246
+ this.createGroupOpen = true;
1247
+ this.formValidation = '';
1248
+ this.createForm = this.fb.group({
1249
+ name: ['', [Validators.required]],
1250
+ });
1251
+ }
1252
+ /**创建分组模态框状态改变 */
1253
+ createGroupVisibleChange(event) {
1254
+ if (!event) {
1255
+ return;
1256
+ }
1257
+ }
1258
+ /**编辑字段分组 */
1259
+ editGroupBtn(itemName) {
1260
+ this.editGroupOpen = true;
1261
+ this.formValidation = '';
1262
+ this.editGroupForm = this.fb.group({
1263
+ name: [itemName, [Validators.required]],
1264
+ });
1265
+ }
1266
+ /**编辑分组模态框状态改变 */
1267
+ editGroupVisibleChange(event) {
1268
+ if (!event) {
1269
+ return;
1270
+ }
1271
+ }
1272
+ /**创建字段分组保存 */
1273
+ createSave() {
1274
+ let input = this.createForm.value;
1275
+ this.modalBusy = true;
1276
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createForm);
1277
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1278
+ return;
1279
+ this._FieldGroupAdminService.create(input).pipe(finalize$1(() => {
1280
+ this.modalBusy = false;
1281
+ this.createGroupOpen = false;
1282
+ this.formValidation = '';
1283
+ })).subscribe(res => {
1284
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1285
+ this._FieldAbstractsService.getfieldGroupList();
1286
+ });
1287
+ }
1288
+ /**编辑字段分组保存 */
1289
+ editSave() {
1290
+ let input = this.editGroupForm.value;
1291
+ this.modalBusy = true;
1292
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createForm);
1293
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1294
+ return;
1295
+ this._FieldGroupAdminService.update(this.fieldGroupId, input).pipe(finalize$1(() => {
1296
+ this.modalBusy = false;
1297
+ this.editGroupOpen = false;
1298
+ this.formValidation = '';
1299
+ })).subscribe(res => {
1300
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1301
+ this._FieldAbstractsService.getfieldGroupList();
1302
+ });
1303
+ }
1304
+ /**删除字段分组1 */
1305
+ deleteGroupbtn(fieldGroupitem) {
1306
+ this.confirmation.warn(fieldGroupitem.name, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
1307
+ if (status == 'confirm') {
1308
+ this._FieldGroupAdminService.delete(this.fieldGroupId).pipe(finalize$1(() => {
1309
+ })).subscribe(res => {
1310
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1311
+ this.fieldGroupId = '';
1312
+ this._FieldAbstractsService.getfieldGroupList();
1313
+ });
1314
+ }
1315
+ });
1316
+ }
1317
+ /**字段分组改变 */
1318
+ fieldGroupChange(event) {
1319
+ this.fieldGroupId = event;
1320
+ this.OnGroupClickBack.emit(event);
1321
+ }
1322
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", 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 }); }
1323
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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.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" }] }); }
1324
+ }
1325
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupComponent, decorators: [{
1326
+ type: Component,
1327
+ 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\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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>" }]
1328
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: FieldGroupAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: FieldAbstractsService }, { type: i1.LocalizationService }], propDecorators: { OnGroupClickBack: [{
1329
+ type: Output
1330
+ }] } });
1331
+
1332
+ // import { UpdateListService } from "../../../services/update-list.service";
1333
+ class FieldsComponent {
1334
+ constructor(list, _FieldAdminService, toaster, confirmation, _LocalizationService, router) {
1335
+ this.list = list;
1336
+ this._FieldAdminService = _FieldAdminService;
1337
+ this.toaster = toaster;
1338
+ this.confirmation = confirmation;
1339
+ this._LocalizationService = _LocalizationService;
1340
+ this.router = router;
1341
+ this._UpdateListService = inject(UpdateListService);
1342
+ /**表格单元格布局类型 */
1343
+ this.ColumnMode = ColumnMode;
1344
+ /**表格数据 */
1345
+ this.data = {
1346
+ items: [],
1347
+ totalCount: 0,
1348
+ };
1349
+ /**过滤器 */
1350
+ this.filters = {};
1351
+ }
1352
+ ngOnInit() {
1353
+ this.hookToQuery();
1354
+ this._UpdateListService.updateListEvent.subscribe(() => {
1355
+ this.list.get();
1356
+ });
1357
+ }
1358
+ getData() {
1359
+ this.list.get();
1360
+ }
1361
+ /**字段分组选择回调 */
1362
+ fieldGroupChange(event) {
1363
+ this.filters.groupId = event;
1364
+ this.list.page = 0;
1365
+ this.list.get();
1366
+ }
1367
+ /**使用abp的list获取表格的字段数据列表 */
1368
+ hookToQuery() {
1369
+ const getData = (query) => this._FieldAdminService.getList({
1370
+ ...query,
1371
+ ...this.filters,
1372
+ });
1373
+ const setData = (list) => (this.data = list);
1374
+ this.list.hookToQuery(getData).subscribe(setData);
1375
+ }
1376
+ /**新建字段按钮 */
1377
+ toFieldsCreateBtn() {
1378
+ this.router.navigate(['/cms/admin/fields/create'], {
1379
+ queryParams: {}
1380
+ });
1381
+ }
1382
+ /**删除字段 */
1383
+ deletefield(row) {
1384
+ this.confirmation.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
1385
+ if (status == 'confirm') {
1386
+ this._FieldAdminService.delete(row.id).pipe(finalize(() => {
1387
+ })).subscribe(res => {
1388
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1389
+ this.list.get();
1390
+ });
1391
+ }
1392
+ });
1393
+ }
1394
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldsComponent, deps: [{ token: i1.ListService }, { token: FieldAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1.LocalizationService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1395
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FieldsComponent, selector: "cms-fields", providers: [
1396
+ // [Required]
1397
+ ListService,
1398
+ // [Optional]
1399
+ // Provide this token if you want a different debounce time.
1400
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1401
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1402
+ {
1403
+ provide: EXTENSIONS_IDENTIFIER,
1404
+ useValue: ECmsComponent.Fields,
1405
+ },
1406
+ ], 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 <abp-extensible-table [data]=\"data?.items\" [recordsTotal]=\"data?.totalCount\" [list]=\"list\"></abp-extensible-table>\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: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: i12.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], outputs: ["tableActivate"], exportAs: ["abpExtensibleTable"] }, { kind: "component", type: FieldGroupComponent, selector: "cms-field-group", outputs: ["OnGroupClickBack"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1407
+ }
1408
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldsComponent, decorators: [{
1409
+ type: Component,
1410
+ args: [{ selector: 'cms-fields', providers: [
1411
+ // [Required]
1412
+ ListService,
1413
+ // [Optional]
1414
+ // Provide this token if you want a different debounce time.
1415
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1416
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1417
+ {
1418
+ provide: EXTENSIONS_IDENTIFIER,
1419
+ useValue: ECmsComponent.Fields,
1420
+ },
1421
+ ], 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 <abp-extensible-table [data]=\"data?.items\" [recordsTotal]=\"data?.totalCount\" [list]=\"list\"></abp-extensible-table>\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"] }]
1422
+ }], ctorParameters: () => [{ type: i1.ListService }, { type: FieldAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1.LocalizationService }, { type: i3$1.Router }] });
1423
+
1424
+ class CreateOrUpdateFieldInputBase {
1425
+ constructor(data) {
1426
+ /**分组id */
1427
+ this.groupId = ['', []];
1428
+ /**字段名称 Display name of this field */
1429
+ this.displayName = ['', [Validators.required]];
1430
+ /**字段唯一名称 Unique Name*/
1431
+ this.name = ['', [Validators.required]];
1432
+ /**描述 说明 */
1433
+ this.description = ['', []];
1434
+ /**FieldType字段类型 表单控件名称 */
1435
+ this.formControlName = [undefined, [Validators.required]];
1436
+ /**动态表单配置 */
1437
+ this.formConfiguration = new FormGroup({});
1438
+ if (data) {
1439
+ for (const key in data) {
1440
+ if (data.hasOwnProperty(key)) {
1441
+ this[key] = data[key];
1442
+ }
1443
+ }
1444
+ }
1445
+ }
1446
+ }
1447
+
1448
+ class CreateOrEditFieldComponent {
1449
+ constructor(_FieldAbstractsService, _CmsApiService, _FieldAdminService, _LocalizationService) {
1450
+ this._FieldAbstractsService = _FieldAbstractsService;
1451
+ this._CmsApiService = _CmsApiService;
1452
+ this._FieldAdminService = _FieldAdminService;
1453
+ this._LocalizationService = _LocalizationService;
1454
+ if (this._FieldAbstractsService.fieldGroupList.length == 0) {
1455
+ this._FieldAbstractsService.getfieldGroupList();
1456
+ }
1457
+ }
1458
+ set Entity(v) {
1459
+ if (v) {
1460
+ this._Entity = v;
1461
+ this.dataLoaded();
1462
+ }
1463
+ }
1464
+ get formControlName() {
1465
+ return this._Entity.get('formControlName');
1466
+ }
1467
+ set selected(v) {
1468
+ if (v) {
1469
+ this._selected = v || '';
1470
+ this._selected_copy = v;
1471
+ // this.dataLoaded()
1472
+ }
1473
+ }
1474
+ async dataLoaded() {
1475
+ if (this._FieldAbstractsService.fromControlList.length == 0) {
1476
+ await this._FieldAbstractsService.getFromControlList();
1477
+ }
1478
+ if (this._Entity) {
1479
+ if (!this.formControlName.value) {
1480
+ this._Entity.patchValue({
1481
+ formControlName: this._FieldAbstractsService.fromControlList[0]?.name,
1482
+ });
1483
+ }
1484
+ this._Entity.setControl('name', new FormControl(this.nameInput.value || '', {
1485
+ validators: Validators.required,
1486
+ asyncValidators: [this.repetitionAsyncValidator()],
1487
+ updateOn: 'change'
1488
+ }));
1489
+ setTimeout(() => {
1490
+ this.submitclick.nativeElement.click();
1491
+ }, 0);
1492
+ }
1493
+ }
1494
+ /**name表单控件 */
1495
+ get nameInput() {
1496
+ return this._Entity.get('name');
1497
+ }
1498
+ nameInputBlur(event) {
1499
+ let value = event.target.value;
1500
+ this.nameInput.patchValue(value);
1501
+ }
1502
+ /**字段标签input失去标点生成字段名字 */
1503
+ disPlayNameInputBlur(event) {
1504
+ let value = event.target.value;
1505
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
1506
+ let nameInput = this.nameInput;
1507
+ if (nameInput.value)
1508
+ return;
1509
+ nameInput.patchValue(pinyin);
1510
+ }
1511
+ /**定义异步验证方法 */
1512
+ repetitionAsyncValidator() {
1513
+ return (ctrl) => {
1514
+ return new Promise(resolve => {
1515
+ if (ctrl.value == this._selected?.name || !ctrl.value) {
1516
+ resolve(null);
1517
+ return;
1518
+ }
1519
+ this._FieldAdminService.nameExists(ctrl.value).subscribe(res => {
1520
+ if (res) {
1521
+ resolve({ repetition: this._LocalizationService.instant(`Cms::FieldName{0}AlreadyExist`, ctrl.value) });
1522
+ }
1523
+ else {
1524
+ resolve(null);
1525
+ }
1526
+ });
1527
+ });
1528
+ };
1529
+ }
1530
+ formControlNameChange(event) {
1531
+ // this._selected='';
1532
+ }
1533
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditFieldComponent, deps: [{ token: FieldAbstractsService }, { token: CmsApiService }, { token: FieldAdminService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1534
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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 }, { propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\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\" required (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($event)\">\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.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { 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" }] }); }
1535
+ }
1536
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditFieldComponent, decorators: [{
1537
+ type: Component,
1538
+ args: [{ selector: 'cms-create-or-edit-field', template: "<form [formGroup]=\"_Entity\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\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\" required (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($event)\">\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>" }]
1539
+ }], ctorParameters: () => [{ type: FieldAbstractsService }, { type: CmsApiService }, { type: FieldAdminService }, { type: i1.LocalizationService }], propDecorators: { FormDynamicRef: [{
1540
+ type: ViewChild,
1541
+ args: ['FormDynamicRef', { read: ViewContainerRef, static: true }]
1542
+ }], submitclick: [{
1543
+ type: ViewChild,
1544
+ args: ['submitclick', { static: true }]
1545
+ }], Entity: [{
1546
+ type: Input
1547
+ }], selected: [{
1548
+ type: Input
1549
+ }] } });
1550
+
1551
+ class CreateFieldComponent {
1552
+ constructor(fb, _FieldAdminService, toaster, _location, _LocalizationService, _CmsApiService) {
1553
+ this.fb = fb;
1554
+ this._FieldAdminService = _FieldAdminService;
1555
+ this.toaster = toaster;
1556
+ this._location = _location;
1557
+ this._LocalizationService = _LocalizationService;
1558
+ this._CmsApiService = _CmsApiService;
1559
+ this._UpdateListService = inject(UpdateListService);
1560
+ this.isSubmit = false;
1561
+ this._ValidatorsService = inject(ValidatorsService);
1562
+ /**表单验证状态
1563
+ * {
1564
+ * title:true,
1565
+ * }
1566
+ */
1567
+ this.formValidation = '';
1568
+ }
1569
+ ngOnInit() {
1570
+ //Called after the constructor, initializing input properties, and the first call to ngOnChanges.
1571
+ //Add 'implements OnInit' to the class.
1572
+ this.newEntity = this.fb.group(new CreateOrUpdateFieldInputBase());
1573
+ }
1574
+ /**触发提交按钮 */
1575
+ submitclickBtn() {
1576
+ this.isSubmit = true;
1577
+ this.submitclick.nativeElement.click();
1578
+ }
1579
+ /**保存表单 */
1580
+ save() {
1581
+ let input = this.newEntity.value;
1582
+ // if (!this.isSubmit) return;
1583
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1584
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1585
+ return;
1586
+ if (!this.newEntity.valid)
1587
+ return;
1588
+ this._FieldAdminService.create(input).subscribe(res => {
1589
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1590
+ this._location.back();
1591
+ this._UpdateListService.updateList();
1592
+ });
1593
+ }
1594
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateFieldComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldAdminService }, { token: i3.ToasterService }, { token: i2.Location }, { token: i1.LocalizationService }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
1595
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateFieldComponent, selector: "cms-create-field", providers: [
1596
+ {
1597
+ provide: EXTENSIONS_IDENTIFIER,
1598
+ useValue: ECmsComponent.FieldsCreate,
1599
+ },
1600
+ ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"'Cms::CreateField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button form-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: 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" }] }); }
1601
+ }
1602
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateFieldComponent, decorators: [{
1603
+ type: Component,
1604
+ args: [{ selector: 'cms-create-field', providers: [
1605
+ {
1606
+ provide: EXTENSIONS_IDENTIFIER,
1607
+ useValue: ECmsComponent.FieldsCreate,
1608
+ },
1609
+ ], template: "<form [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"'Cms::CreateField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button form-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"] }]
1610
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: FieldAdminService }, { type: i3.ToasterService }, { type: i2.Location }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { submitclick: [{
1611
+ type: ViewChild,
1612
+ args: ['submitclick', { static: true }]
1613
+ }] } });
1614
+
1615
+ class EditFieldComponent {
1616
+ constructor(fb, _FieldAbstractsService, _FieldAdminService, route, toaster, _location, _LocalizationService, _CmsApiService) {
1617
+ this.fb = fb;
1618
+ this._FieldAbstractsService = _FieldAbstractsService;
1619
+ this._FieldAdminService = _FieldAdminService;
1620
+ this.route = route;
1621
+ this.toaster = toaster;
1622
+ this._location = _location;
1623
+ this._LocalizationService = _LocalizationService;
1624
+ this._CmsApiService = _CmsApiService;
1625
+ this._UpdateListService = inject(UpdateListService);
1626
+ this._ValidatorsService = inject(ValidatorsService);
1627
+ /**字段id */
1628
+ this.fieldId = '';
1629
+ this.isSubmit = false;
1630
+ /**表单验证状态
1631
+ * {
1632
+ * title:true,
1633
+ * }
1634
+ */
1635
+ this.formValidation = '';
1636
+ }
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([this._FieldAbstractsService.getFromControlList(), this.getFieldEdit()]);
1643
+ this.newEntity.patchValue({
1644
+ ...this.fieldDetails,
1645
+ formConfiguration: this.fieldDetails.formConfiguration,
1646
+ });
1647
+ }
1648
+ }
1649
+ /**获取字段详情 */
1650
+ getFieldEdit() {
1651
+ return new Promise((resolve, reject) => {
1652
+ this._FieldAdminService.get(this.fieldId).subscribe(res => {
1653
+ res.groupId = res.groupId ? res.groupId : '';
1654
+ this.fieldDetails = res;
1655
+ resolve(res);
1656
+ });
1657
+ });
1658
+ }
1659
+ /**触发提交按钮 */
1660
+ submitclickBtn() {
1661
+ this.isSubmit = true;
1662
+ this.submitclick.nativeElement.click();
1663
+ }
1664
+ /**保存表单 */
1665
+ save() {
1666
+ let input = this.newEntity.value;
1667
+ if (!this.isSubmit)
1668
+ return;
1669
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1670
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1671
+ return;
1672
+ if (!this.newEntity.valid)
1673
+ return;
1674
+ this._FieldAdminService.update(this.fieldId, input).subscribe(res => {
1675
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1676
+ this._location.back();
1677
+ this._UpdateListService.updateList();
1678
+ });
1679
+ }
1680
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", 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 }], target: i0.ɵɵFactoryTarget.Component }); }
1681
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EditFieldComponent, selector: "cms-edit-field", providers: [
1682
+ {
1683
+ provide: EXTENSIONS_IDENTIFIER,
1684
+ useValue: ECmsComponent.FieldsEdit,
1685
+ },
1686
+ ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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=\"card\">\n <div class=\"card-body\">\n <ng-container *ngIf=\"newEntity&&fieldDetails\">\n <cms-create-or-edit-field [selected]=\"fieldDetails\" [Entity]=\"newEntity\"></cms-create-or-edit-field>\n </ng-container>\n </div>\n </div>\n </div>\n </abp-page>\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.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: 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" }] }); }
1687
+ }
1688
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditFieldComponent, decorators: [{
1689
+ type: Component,
1690
+ args: [{ selector: 'cms-edit-field', providers: [
1691
+ {
1692
+ provide: EXTENSIONS_IDENTIFIER,
1693
+ useValue: ECmsComponent.FieldsEdit,
1694
+ },
1695
+ ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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=\"card\">\n <div class=\"card-body\">\n <ng-container *ngIf=\"newEntity&&fieldDetails\">\n <cms-create-or-edit-field [selected]=\"fieldDetails\" [Entity]=\"newEntity\"></cms-create-or-edit-field>\n </ng-container>\n </div>\n </div>\n </div>\n </abp-page>\n</form>" }]
1696
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: FieldAbstractsService }, { type: FieldAdminService }, { type: i3$1.ActivatedRoute }, { type: i3.ToasterService }, { type: i2.Location }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { submitclick: [{
1697
+ type: ViewChild,
1698
+ args: ['submitclick', { static: true }]
1699
+ }] } });
1700
+
1701
+ var SectionType;
1702
+ (function (SectionType) {
1703
+ SectionType[SectionType["Single"] = 0] = "Single";
1704
+ SectionType[SectionType["Structure"] = 1] = "Structure";
1705
+ SectionType[SectionType["Channel"] = 2] = "Channel";
1706
+ })(SectionType || (SectionType = {}));
1707
+ const sectionTypeOptions = mapEnumToOptions(SectionType);
1708
+
1709
+ class CreateOrUpdateSectionsInputBase {
1710
+ constructor(data) {
1711
+ /**版块类型 */
1712
+ this.type = [0, [Validators.required]];
1713
+ /**字段名称 Display name of this field */
1714
+ this.displayName = ['', [Validators.required]];
1715
+ /**字段唯一名称 Unique Name*/
1716
+ this.name = ['', [Validators.required]];
1717
+ /**条目路由 */
1718
+ this.route = ['', [Validators.required]];
1719
+ /**页面模板 */
1720
+ this.template = ['', [Validators.required]];
1721
+ /**是否默认 */
1722
+ this.isDefault = [false, []];
1723
+ /**是否激活 */
1724
+ this.isActive = [true, []];
1725
+ if (data) {
1726
+ for (const key in data) {
1727
+ if (data.hasOwnProperty(key)) {
1728
+ this[key] = data[key];
1729
+ }
1730
+ }
1731
+ }
1732
+ }
1733
+ }
1734
+
1735
+ class SectionsComponent {
1736
+ constructor(list, _SectionAdminService, toaster, confirmation, fb, _EntryTypeAdminService, _LocalizationService, _CmsApiService) {
1737
+ this.list = list;
1738
+ this._SectionAdminService = _SectionAdminService;
1739
+ this.toaster = toaster;
1740
+ this.confirmation = confirmation;
1741
+ this.fb = fb;
1742
+ this._EntryTypeAdminService = _EntryTypeAdminService;
1743
+ this._LocalizationService = _LocalizationService;
1744
+ this._CmsApiService = _CmsApiService;
1745
+ this._UpdateListService = inject(UpdateListService);
1746
+ this.siteList = [];
1747
+ this.ColumnMode = ColumnMode;
1748
+ this.data = { items: [], totalCount: 0 };
1749
+ this.filters = {};
1750
+ this.visibleOpen = false;
1751
+ this.modalBusy = false;
1752
+ this._SectionType = SectionType;
1753
+ this._sectionTypeOptions = sectionTypeOptions;
1754
+ this._ValidatorsService = inject(ValidatorsService);
1755
+ /**表单验证状态
1756
+ * {
1757
+ * title:true,
1758
+ * }
1759
+ */
1760
+ this.formValidation = '';
1761
+ }
1762
+ hookToQuery() {
1763
+ const getData = (query) => this._SectionAdminService.getList({ ...query, ...this.filters });
1764
+ const setData = (list) => (this.data = list);
1765
+ this.list.hookToQuery(getData).subscribe(setData);
1766
+ }
1767
+ async ngOnInit() {
1768
+ this.hookToQuery();
1769
+ this._UpdateListService.updateListEvent.subscribe(() => {
1770
+ this.list.get();
1771
+ });
1772
+ }
1773
+ siteIdChange() {
1774
+ this.list.page = 0;
1775
+ this.list.get();
1776
+ }
1777
+ VisibleChange(event) {
1778
+ if (!event) {
1779
+ this.selected = '';
1780
+ return;
1781
+ }
1782
+ }
1783
+ createSectionBtn() {
1784
+ this.visibleOpen = true;
1785
+ this.createOrEditForm = this.fb.group(new CreateOrUpdateSectionsInputBase());
1786
+ this.setAsyncValidatorsFn();
1787
+ }
1788
+ editSectionBtn(row) {
1789
+ this.visibleOpen = true;
1790
+ this.createOrEditForm = this.fb.group(new CreateOrUpdateSectionsInputBase());
1791
+ this.setAsyncValidatorsFn();
1792
+ this._SectionAdminService.get(row.id).subscribe(res => {
1793
+ this.createOrEditForm.patchValue(res);
1794
+ this.selected = res;
1795
+ });
1796
+ }
1797
+ deleteEntryType(row) {
1798
+ this.confirmation
1799
+ .warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`))
1800
+ .subscribe((status) => {
1801
+ if (status == 'confirm') {
1802
+ this._EntryTypeAdminService
1803
+ .delete(row.id)
1804
+ .pipe(finalize(() => { }))
1805
+ .subscribe(res => {
1806
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1807
+ this.list.get();
1808
+ });
1809
+ }
1810
+ });
1811
+ }
1812
+ createOrEditSave() {
1813
+ if (this.selected) {
1814
+ return this.EditSave();
1815
+ }
1816
+ this.createSave();
1817
+ }
1818
+ createSave() {
1819
+ let input = this.createOrEditForm.value;
1820
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createOrEditForm);
1821
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1822
+ return;
1823
+ if (!this.createOrEditForm.valid)
1824
+ return;
1825
+ this.modalBusy = true;
1826
+ this._SectionAdminService
1827
+ .create(input)
1828
+ .pipe(finalize(() => {
1829
+ this.modalBusy = false;
1830
+ this.visibleOpen = false;
1831
+ }))
1832
+ .subscribe(res => {
1833
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1834
+ this.list.get();
1835
+ });
1836
+ }
1837
+ EditSave() {
1838
+ setTimeout(() => {
1839
+ let input = this.createOrEditForm.value;
1840
+ input.concurrencyStamp = this.selected.concurrencyStamp;
1841
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createOrEditForm);
1842
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1843
+ return;
1844
+ if (!this.createOrEditForm.valid)
1845
+ return;
1846
+ this.modalBusy = true;
1847
+ this._SectionAdminService
1848
+ .update(this.selected.id, input)
1849
+ .pipe(finalize(() => {
1850
+ this.modalBusy = false;
1851
+ this.visibleOpen = false;
1852
+ }))
1853
+ .subscribe(res => {
1854
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1855
+ this.list.get();
1856
+ });
1857
+ }, 100);
1858
+ }
1859
+ deletefield(row) {
1860
+ this.confirmation
1861
+ .warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`))
1862
+ .subscribe((status) => {
1863
+ if (status == 'confirm') {
1864
+ this._SectionAdminService
1865
+ .delete(row.id)
1866
+ .pipe(finalize(() => { }))
1867
+ .subscribe(res => {
1868
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1869
+ this.list.get();
1870
+ });
1871
+ }
1872
+ });
1873
+ }
1874
+ get displayNameInput() {
1875
+ return this.createOrEditForm.get('displayName');
1876
+ }
1877
+ get nameInput() {
1878
+ return this.createOrEditForm.get('name');
1879
+ }
1880
+ get routeInput() {
1881
+ return this.createOrEditForm.get('route');
1882
+ }
1883
+ get templateInput() {
1884
+ return this.createOrEditForm.get('template');
1885
+ }
1886
+ get typeInput() {
1887
+ return this.createOrEditForm.get('type');
1888
+ }
1889
+ radiochange() {
1890
+ this.routeInput.patchValue(this.routeInput.value);
1891
+ }
1892
+ disPlayNameInputBlur(event) {
1893
+ let value = event.target.value;
1894
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
1895
+ let nameInput = this.nameInput;
1896
+ let routeInput = this.routeInput;
1897
+ let templateInput = this.templateInput;
1898
+ if (nameInput.value)
1899
+ return;
1900
+ nameInput.patchValue(pinyin);
1901
+ if (routeInput.value)
1902
+ return;
1903
+ routeInput.patchValue(pinyin + (this.typeInput.value === 0 ? '' : '/{slug}'));
1904
+ if (templateInput.value)
1905
+ return;
1906
+ templateInput.patchValue(pinyin + '/index');
1907
+ }
1908
+ setAsyncValidatorsFn() {
1909
+ this.createOrEditForm.setControl('name', new FormControl(this.nameInput.value || '', {
1910
+ validators: Validators.required,
1911
+ asyncValidators: this.nameRepetitionAsyncValidator(),
1912
+ }));
1913
+ this.createOrEditForm.setControl('route', new FormControl(this.routeInput.value || '', {
1914
+ validators: [Validators.required, this.forbiddenNameValidator()],
1915
+ asyncValidators: [this.routeRepetitionAsyncValidator()],
1916
+ }));
1917
+ }
1918
+ forbiddenNameValidator() {
1919
+ return (control) => {
1920
+ let inputValue = control.value.toLocaleLowerCase();
1921
+ let forbidden = this.typeInput.value == 0 ? false : inputValue.includes('{slug}') ? false : true;
1922
+ return forbidden
1923
+ ? {
1924
+ repetition: this._LocalizationService.instant(`Cms::RouteVerificationTips`, this._LocalizationService.instant(`Cms::Enum:SectionType:` + SectionType[this.typeInput.value]), '{slug}'),
1925
+ }
1926
+ : null;
1927
+ };
1928
+ }
1929
+ nameRepetitionAsyncValidator() {
1930
+ return (ctrl) => {
1931
+ return new Promise(resolve => {
1932
+ let subslug = this.createOrEditForm?.get('name');
1933
+ if (subslug.value == this.selected?.name) {
1934
+ resolve(null);
1935
+ return;
1936
+ }
1937
+ this._SectionAdminService.nameExists({ name: subslug.value }).subscribe(res => {
1938
+ if (res) {
1939
+ resolve({
1940
+ repetition: this._LocalizationService.instant(`Cms::SectionName{0}AlreadyExist`, ctrl.value),
1941
+ });
1942
+ }
1943
+ else {
1944
+ resolve(null);
1945
+ }
1946
+ });
1947
+ });
1948
+ };
1949
+ }
1950
+ routeRepetitionAsyncValidator() {
1951
+ return (ctrl) => {
1952
+ return new Promise(resolve => {
1953
+ let subslug = this.createOrEditForm?.get('route').value;
1954
+ if (subslug == this.selected?.route) {
1955
+ resolve(null);
1956
+ return;
1957
+ }
1958
+ this._SectionAdminService.routeExists({ route: subslug }).subscribe(res => {
1959
+ if (res) {
1960
+ resolve({
1961
+ repetition: this._LocalizationService.instant(`Cms::SectionRoute{0}AlreadyExist`, ctrl.value),
1962
+ });
1963
+ }
1964
+ else {
1965
+ resolve(null);
1966
+ }
1967
+ });
1968
+ });
1969
+ };
1970
+ }
1971
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", 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 }], target: i0.ɵɵFactoryTarget.Component }); }
1972
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: SectionsComponent, selector: "cms-sections", providers: [
1973
+ // [Required]
1974
+ ListService,
1975
+ // [Optional]
1976
+ // Provide this token if you want a different debounce time.
1977
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1978
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1979
+ {
1980
+ provide: EXTENSIONS_IDENTIFIER,
1981
+ useValue: ECmsComponent.Sections,
1982
+ },
1983
+ ], 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\" [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/'+item.id+'/edit'\"\n >{{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 [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/create'\"><i\n class=\"fas fa-plus-circle me-2\"></i>{{'Cms::New' |\n abpLocalization}}</li>\n </div>\n </div>\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\" [name]=\"'AbpUi::Actions' | abpLocalization\" [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"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\" 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\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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 &nbsp;&nbsp;blog<br>\n &nbsp;&nbsp;{{'blog/{slug}'}}<br>\n &nbsp;&nbsp;{{'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 </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: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "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: 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: "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: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { 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" }] }); }
1984
+ }
1985
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionsComponent, decorators: [{
1986
+ type: Component,
1987
+ args: [{ selector: 'cms-sections', providers: [
1988
+ // [Required]
1989
+ ListService,
1990
+ // [Optional]
1991
+ // Provide this token if you want a different debounce time.
1992
+ // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1993
+ { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1994
+ {
1995
+ provide: EXTENSIONS_IDENTIFIER,
1996
+ useValue: ECmsComponent.Sections,
1997
+ },
1998
+ ], 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\" [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/'+item.id+'/edit'\"\n >{{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 [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/create'\"><i\n class=\"fas fa-plus-circle me-2\"></i>{{'Cms::New' |\n abpLocalization}}</li>\n </div>\n </div>\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\" [name]=\"'AbpUi::Actions' | abpLocalization\" [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"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\" 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\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"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 &nbsp;&nbsp;blog<br>\n &nbsp;&nbsp;{{'blog/{slug}'}}<br>\n &nbsp;&nbsp;{{'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 </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"] }]
1999
+ }], ctorParameters: () => [{ type: i1.ListService }, { type: SectionAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1$1.FormBuilder }, { type: EntryTypeAdminService }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { createOrEditModalSubmitBtn: [{
2000
+ type: ViewChild,
2001
+ args: ['createOrEditModalSubmitBtn', { static: false }]
2002
+ }] } });
2003
+
2004
+ class CreateOrEditEntryTypeInputBase {
2005
+ constructor(data) {
2006
+ /**显示名称 Display name of this field */
2007
+ this.displayName = ['', [Validators.required]];
2008
+ /**名称 Unique Name*/
2009
+ this.name = ['', [Validators.required]];
2010
+ /**条目路由 */
2011
+ this.fieldTabs = new FormArray([]);
2012
+ if (data) {
2013
+ for (const key in data) {
2014
+ if (data.hasOwnProperty(key)) {
2015
+ this[key] = data[key];
2016
+ }
2017
+ }
2018
+ }
2019
+ }
2020
+ }
2021
+ class fieldTabsBase {
2022
+ constructor(data) {
2023
+ /**名称 Unique Name*/
2024
+ this.name = ['', [Validators.required]];
2025
+ this.fields = [[], []];
2026
+ if (data) {
2027
+ for (const key in data) {
2028
+ if (data.hasOwnProperty(key)) {
2029
+ this[key] = data[key];
2030
+ }
2031
+ }
2032
+ }
2033
+ }
2034
+ }
2035
+ class fieldsBase {
2036
+ constructor(data) {
2037
+ /**字段id Unique Name*/
2038
+ this.fieldId = ['', [Validators.required]];
2039
+ /**显示名称 Unique Name*/
2040
+ this.displayName = ['', [Validators.required]];
2041
+ /**必填 Unique Name*/
2042
+ this.required = [false, []];
2043
+ /**是否在列表中显示 Unique Name*/
2044
+ this.showOnList = [false, []];
2045
+ if (data) {
2046
+ for (const key in data) {
2047
+ if (data.hasOwnProperty(key)) {
2048
+ this[key] = data[key];
2049
+ }
2050
+ }
2051
+ }
2052
+ }
2053
+ }
2054
+ class fieldsInputBase {
2055
+ constructor(data) {
2056
+ /**字段id */
2057
+ this.fieldId = ['', [Validators.required]];
2058
+ /**显示名称 Display name of this field */
2059
+ this.displayName = ['', [Validators.required]];
2060
+ /**是否必填 Unique Name*/
2061
+ this.required = [false, []];
2062
+ /**在列表中展示 Unique Name*/
2063
+ this.showOnList = [false, []];
2064
+ if (data) {
2065
+ for (const key in data) {
2066
+ if (data.hasOwnProperty(key)) {
2067
+ this[key] = data[key];
2068
+ }
2069
+ }
2070
+ }
2071
+ }
2072
+ }
2073
+
2074
+ class CreateOrEditComponent {
2075
+ constructor(toaster, _location, route, _FieldGroupAdminService, _FieldAdminService, _EntryTypeAdminService, _LocalizationService, _CmsApiService) {
2076
+ this.toaster = toaster;
2077
+ this._location = _location;
2078
+ this.route = route;
2079
+ this._FieldGroupAdminService = _FieldGroupAdminService;
2080
+ this._FieldAdminService = _FieldAdminService;
2081
+ this._EntryTypeAdminService = _EntryTypeAdminService;
2082
+ this._LocalizationService = _LocalizationService;
2083
+ this._CmsApiService = _CmsApiService;
2084
+ this.fb = inject(FormBuilder);
2085
+ this._UpdateListService = inject(UpdateListService);
2086
+ /**表单实体 */
2087
+ this.newEntity = this.fb.group(new CreateOrEditEntryTypeInputBase());
2088
+ /**版块id */
2089
+ this.sectionId = '';
2090
+ /**条目类型id */
2091
+ this.entryTypesId = '';
2092
+ /**
2093
+ * 拖拽 功能*/
2094
+ /**数据源 */
2095
+ /**数据源-字段分组数据-包含字段数据 fields */
2096
+ this.fieldGroupList = [];
2097
+ /**数据源-所有字段列表 */
2098
+ this.fieldList = [];
2099
+ /**目标源 结果*/
2100
+ this.resultSource = [];
2101
+ /**来自数据源的集合,用于从目标源拖回数据源时的判断,与取值 */
2102
+ this.formRightGroup = [];
2103
+ this._ValidatorsService = inject(ValidatorsService);
2104
+ /**表单验证状态
2105
+ * {
2106
+ * title:true,
2107
+ * }
2108
+ */
2109
+ this.formValidation = '';
2110
+ /**模态框状态 */
2111
+ this.visibleTabsOpen = false;
2112
+ /**是否是忙碌状态 */
2113
+ this.modalBusy = false;
2114
+ /**正在选中的nav */
2115
+ this.navActive = 0;
2116
+ /**编辑字段模态框状态 */
2117
+ this.visibleEditFieldOpen = false;
2118
+ }
2119
+ get fieldTabs() {
2120
+ return this.newEntity.get('fieldTabs');
2121
+ }
2122
+ /**触发提交按钮 */
2123
+ submitclickBtn() {
2124
+ this.submitclick.nativeElement.click();
2125
+ }
2126
+ ngOnInit() {
2127
+ let sectionId = this.route.snapshot.params.sectionsId;
2128
+ this.entryTypesId = this.route.snapshot.params.entryTypesId || '';
2129
+ if (sectionId) {
2130
+ this.sectionId = sectionId;
2131
+ this.addControlToFieldTabs();
2132
+ this.getFieldGroup();
2133
+ }
2134
+ }
2135
+ /**给fieldTabs添加新控件 */
2136
+ addControlToFieldTabs(nameValue = '') {
2137
+ const newFormGroup = this.fb.group(new fieldTabsBase({
2138
+ name: this.fieldTabs.length === 0
2139
+ ? this._LocalizationService.instant(`Cms::FieldTab`)
2140
+ : nameValue,
2141
+ }));
2142
+ this.fieldTabs.push(newFormGroup);
2143
+ this.resultSource.push(newFormGroup.value);
2144
+ this.navActive = this.resultSource.length - 1;
2145
+ }
2146
+ /**获取字段分组 */
2147
+ getFieldGroup() {
2148
+ this._FieldGroupAdminService.getList({}).subscribe(async (res) => {
2149
+ let fieldList = await this.getFieldList();
2150
+ let fieldGroupList = res.items;
2151
+ fieldGroupList.unshift({
2152
+ id: null,
2153
+ name: 'UngroupedFields',
2154
+ });
2155
+ fieldGroupList.forEach((el, index) => {
2156
+ el.fields = fieldList.filter(els => els.groupId === el.id);
2157
+ });
2158
+ this.fieldGroupList = fieldGroupList;
2159
+ this.fieldList = this.deepClone(fieldList);
2160
+ let entryTypesId = this.entryTypesId;
2161
+ if (entryTypesId) {
2162
+ this.entryTypesId = entryTypesId;
2163
+ this.getEntryTypes();
2164
+ }
2165
+ });
2166
+ }
2167
+ /**获取条目类型详情 */
2168
+ getEntryTypes() {
2169
+ let fieldList = this.deepClone(this.fieldList);
2170
+ this._EntryTypeAdminService.get(this.entryTypesId).subscribe(res => {
2171
+ res.fieldTabs.forEach(el => {
2172
+ el.fields.forEach((eld) => {
2173
+ eld.id = eld.fieldId;
2174
+ eld.groupId = fieldList.find(elfd => elfd.id == eld.fieldId).groupId;
2175
+ this.formRightGroup.push(eld);
2176
+ let fieldindex = fieldList.findIndex(elfl => elfl.id == eld.fieldId);
2177
+ fieldList.splice(fieldindex, 1);
2178
+ });
2179
+ });
2180
+ this.fieldGroupList.forEach((el, index) => {
2181
+ el.fields = fieldList.filter(els => els.groupId === el.id);
2182
+ });
2183
+ this.newEntity.patchValue(res);
2184
+ this.entryTypesSelect = res;
2185
+ this.resultSource = res.fieldTabs;
2186
+ });
2187
+ }
2188
+ /**
2189
+ * 深拷贝--方法
2190
+ * $api.deepClone() */
2191
+ deepClone(obj) {
2192
+ if (typeof obj !== 'object' || obj === null)
2193
+ return obj;
2194
+ const result = Array.isArray(obj) ? [] : {};
2195
+ for (let key in obj) {
2196
+ if (obj.hasOwnProperty(key)) {
2197
+ if (typeof obj[key] === 'object' && obj[key] !== null) {
2198
+ if (obj[key] instanceof Date) {
2199
+ result[key] = new Date(obj[key].getTime());
2200
+ }
2201
+ else if (obj[key] instanceof RegExp) {
2202
+ result[key] = new RegExp(obj[key]);
2203
+ }
2204
+ else {
2205
+ result[key] = this.deepClone(obj[key]);
2206
+ }
2207
+ }
2208
+ else {
2209
+ result[key] = obj[key];
2210
+ }
2211
+ }
2212
+ }
2213
+ return result;
2214
+ }
2215
+ /**
2216
+ *
2217
+ * @param nameValue 获取所有字段
2218
+ */
2219
+ getFieldList() {
2220
+ return new Promise((resolve, rejects) => {
2221
+ this._FieldAdminService
2222
+ .getList({
2223
+ maxResultCount: 1000,
2224
+ })
2225
+ .subscribe((res) => {
2226
+ res.items.forEach(el => {
2227
+ el.required = false;
2228
+ el.showOnList = false;
2229
+ });
2230
+ resolve(res.items);
2231
+ });
2232
+ });
2233
+ }
2234
+ /**从数据源开始拖拽 */
2235
+ fromDataSourceDragStart(element, fieldIndex, groupIndex) {
2236
+ this.fromDataSourceDragEl = element;
2237
+ this.DataSourceFieldIndex = fieldIndex;
2238
+ this.DataSourceGroupIndex = groupIndex;
2239
+ this.fromResultSourceDragEl = undefined;
2240
+ }
2241
+ /**从目标源开始拖拽 */
2242
+ fromResultSourceDragStart(element) {
2243
+ this.fromResultSourceDragEl = element;
2244
+ this.fromDataSourceDragEl = undefined;
2245
+ this.DataSourceFieldIndex = undefined;
2246
+ this.DataSourceGroupIndex = undefined;
2247
+ }
2248
+ /**拖拽到数据源时触发 */
2249
+ dragToDataSourceDropped() {
2250
+ //从数据源拖拽到数据源-排序
2251
+ if (this.fromDataSourceDragEl) {
2252
+ }
2253
+ let _fromResultSourceDragEl = this.fromResultSourceDragEl;
2254
+ let formRightGroup = this.deepClone(this.formRightGroup);
2255
+ let fieldList = this.deepClone(this.fieldList);
2256
+ if (_fromResultSourceDragEl) {
2257
+ //移动
2258
+ //从目标源拖拽到数据源
2259
+ // 拖拽目标源的下标
2260
+ let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(el => el.id == _fromResultSourceDragEl.id);
2261
+ //删除目标源中的数据
2262
+ this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
2263
+ formRightGroup.splice(formRightGroup.findIndex(el => el.id == _fromResultSourceDragEl.id), 1);
2264
+ this.fieldGroupList.forEach(el => {
2265
+ if (el.id == _fromResultSourceDragEl.groupId) {
2266
+ const elFieldsAll = fieldList.filter(els => els.groupId === el.id);
2267
+ el.fields = elFieldsAll.filter(item => !formRightGroup.some(itemB => item.id === itemB.id));
2268
+ }
2269
+ });
2270
+ this.formRightGroup = formRightGroup;
2271
+ }
2272
+ this.setfieldTabsFrom();
2273
+ }
2274
+ /**拖拽到目标源时触发
2275
+ *
2276
+ */
2277
+ dragToResultSourceDropped(fieldTabstem, fieldTabsIndex) {
2278
+ const _fromDataSourceDragEl = this.fromDataSourceDragEl;
2279
+ //从数据源拖拽到目标源
2280
+ if (_fromDataSourceDragEl) {
2281
+ this.fieldGroupList[this.DataSourceGroupIndex].fields.splice(this.DataSourceFieldIndex, 1);
2282
+ this.resultSource[fieldTabsIndex].fields.push(_fromDataSourceDragEl);
2283
+ this.formRightGroup.push(_fromDataSourceDragEl);
2284
+ }
2285
+ this.setfieldTabsFrom();
2286
+ }
2287
+ /** 从目标源拖拽到目标源*/
2288
+ dragToResultSourceItemDropped(fieldsIndex) {
2289
+ const _fromResultSourceDragEl = this.fromResultSourceDragEl;
2290
+ if (_fromResultSourceDragEl) {
2291
+ // 拖拽目标源的下标
2292
+ let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(el => el.id == _fromResultSourceDragEl.id);
2293
+ //删除目标源中的数据
2294
+ this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
2295
+ this.resultSource[this.navActive].fields.splice(fieldsIndex, 0, _fromResultSourceDragEl);
2296
+ }
2297
+ this.setfieldTabsFrom();
2298
+ }
2299
+ /**设置formA表单 */
2300
+ setfieldTabsFrom() {
2301
+ let setArray = [];
2302
+ this.resultSource.forEach(el => {
2303
+ let fieldsArray = [];
2304
+ el.fields.forEach(item => {
2305
+ fieldsArray.push({
2306
+ fieldId: item.id || item.fieldId,
2307
+ displayName: item.displayName,
2308
+ required: item?.required,
2309
+ showOnList: item?.showOnList,
2310
+ });
2311
+ });
2312
+ setArray.push({
2313
+ name: el.name,
2314
+ fields: fieldsArray,
2315
+ });
2316
+ });
2317
+ this.newEntity.patchValue({
2318
+ fieldTabs: setArray,
2319
+ });
2320
+ }
2321
+ /**保存表单 */
2322
+ save() {
2323
+ let input = this.newEntity.value;
2324
+ this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
2325
+ if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
2326
+ return;
2327
+ if (this.entryTypesSelect) {
2328
+ this._EntryTypeAdminService.update(this.entryTypesSelect.id, input).subscribe(res => {
2329
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
2330
+ this._location.back();
2331
+ this._UpdateListService.updateList();
2332
+ });
2333
+ return;
2334
+ }
2335
+ input.sectionId = this.sectionId;
2336
+ this._EntryTypeAdminService.create(input).subscribe(res => {
2337
+ this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
2338
+ this._location.back();
2339
+ this._UpdateListService.updateList();
2340
+ });
2341
+ }
2342
+ /**模态框状态改变回调 */
2343
+ VisibleTabsChange(event) {
2344
+ if (!event) {
2345
+ this.editFieldTabsSelect = '';
2346
+ return;
2347
+ }
2348
+ }
2349
+ /**新建增加FieldTabs */
2350
+ addFieldTabs() {
2351
+ this.editFieldTabsFrom = this.fb.group(new fieldTabsBase());
2352
+ this.visibleTabsOpen = true;
2353
+ }
2354
+ /**编辑FieldTabs */
2355
+ editFieldTabs(item, i) {
2356
+ this.editFieldTabsFrom = this.fb.group(new fieldTabsBase({
2357
+ name: item.name,
2358
+ }));
2359
+ this.editFieldTabsSelect = item;
2360
+ this.visibleTabsOpen = true;
2361
+ this.newEditFieldTabsIndex = i;
2362
+ }
2363
+ /**保存编辑tabs表单 */
2364
+ editFieldTabsSave() {
2365
+ //编辑
2366
+ if (this.editFieldTabsSelect) {
2367
+ this.resultSource[this.newEditFieldTabsIndex].name = this.editFieldTabsFrom.value.name;
2368
+ this.navActive = this.newEditFieldTabsIndex;
2369
+ }
2370
+ else {
2371
+ //新建
2372
+ this.addControlToFieldTabs(this.editFieldTabsFrom.value.name);
2373
+ }
2374
+ this.visibleTabsOpen = false;
2375
+ this.setfieldTabsFrom();
2376
+ }
2377
+ /**删除某个tabs表单 */
2378
+ deleteFieldTabs(index) {
2379
+ this.fieldTabs.removeAt(index);
2380
+ this.resultSource.splice(index, 1);
2381
+ }
2382
+ /**编辑字段模态框状态状态改变回调 */
2383
+ VisibleEditFieldChange(event) {
2384
+ if (!event) {
2385
+ this.EditFieldIndex = undefined;
2386
+ return;
2387
+ }
2388
+ }
2389
+ /**打开编辑字段模态框 */
2390
+ EditFieldModalOpen(items, elIndex) {
2391
+ this.visibleEditFieldOpen = true;
2392
+ this.EditFieldIndex = elIndex;
2393
+ this.editFieldFrom = this.fb.group(new fieldsBase(this.fieldTabs.value[this.navActive].fields[elIndex]));
2394
+ }
2395
+ /**保存编辑字段 */
2396
+ editFieldSave() {
2397
+ let input = this.editFieldFrom.value;
2398
+ this.resultSource[this.navActive].fields[this.EditFieldIndex].displayName = input.displayName;
2399
+ this.resultSource[this.navActive].fields[this.EditFieldIndex].required = input.required;
2400
+ this.resultSource[this.navActive].fields[this.EditFieldIndex].showOnList = input.showOnList;
2401
+ this.visibleEditFieldOpen = false;
2402
+ this.setfieldTabsFrom();
2403
+ }
2404
+ /**name表单控件 */
2405
+ get nameInput() {
2406
+ return this.newEntity.get('name');
2407
+ }
2408
+ /**字段标签input失去标点生成字段名字 */
2409
+ disPlayNameInputBlur(event) {
2410
+ let value = event.target.value;
2411
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
2412
+ let nameInput = this.nameInput;
2413
+ if (nameInput.value)
2414
+ return;
2415
+ nameInput.patchValue(pinyin);
2416
+ }
2417
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", 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 }], target: i0.ɵɵFactoryTarget.Component }); }
2418
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateOrEditComponent, selector: "cms-create-or-edit", providers: [
2419
+ {
2420
+ provide: EXTENSIONS_IDENTIFIER,
2421
+ useValue: ECmsComponent.SectionsCreateOrEdit,
2422
+ },
2423
+ ], 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\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"entryTypesId ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)\"\n [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 <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 *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 *ngFor=\"let el of item.fields; let iel = index\">\n <li draggable=\"true\" (dragstart)=\"fromResultSourceDragStart(el)\"\n (drop)=\"dragToResultSourceItemDropped(iel)\"\n class=\"list-group-item d-flex align-items-center justify-content-between py-1\"\n 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 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\" (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\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToDataSourceDropped()\" 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\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"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\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"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}}\n </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.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: ["tabindex", "disabled"] }, { kind: "component", type: i11.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2424
+ }
2425
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditComponent, decorators: [{
2426
+ type: Component,
2427
+ args: [{ selector: 'cms-create-or-edit', providers: [
2428
+ {
2429
+ provide: EXTENSIONS_IDENTIFIER,
2430
+ useValue: ECmsComponent.SectionsCreateOrEdit,
2431
+ },
2432
+ ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"entryTypesId ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)\"\n [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 <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 *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 *ngFor=\"let el of item.fields; let iel = index\">\n <li draggable=\"true\" (dragstart)=\"fromResultSourceDragStart(el)\"\n (drop)=\"dragToResultSourceItemDropped(iel)\"\n class=\"list-group-item d-flex align-items-center justify-content-between py-1\"\n 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 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\" (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\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToDataSourceDropped()\" 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\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"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\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"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}}\n </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"] }]
2433
+ }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: FieldGroupAdminService }, { type: FieldAdminService }, { type: EntryTypeAdminService }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { submitclick: [{
2434
+ type: ViewChild,
2435
+ args: ['submitclick', { static: true }]
2436
+ }], editFieldTabsModalSubmitBtn: [{
2437
+ type: ViewChild,
2438
+ args: ['editFieldTabsModalSubmitBtn', { static: false }]
2439
+ }], editFieldModalSubmitBtn: [{
2440
+ type: ViewChild,
2441
+ args: ['editFieldModalSubmitBtn', { static: false }]
2442
+ }] } });
2443
+
2444
+ class EntryConfig {
2445
+ constructor(data) {
2446
+ /**多选 */
2447
+ this['Entry.Multiple'] = [false, []];
2448
+ /**占位符 */
2449
+ this['Entry.Placeholder'] = ['', []];
2450
+ /**版块id */
2451
+ this['Entry.SectionId'] = ['', []];
2452
+ if (data) {
2453
+ for (const key in data) {
2454
+ if (data.hasOwnProperty(key)) {
2455
+ this[key] = data[key];
2456
+ }
2457
+ }
2458
+ }
2459
+ }
2460
+ }
2461
+
2462
+ class EntryConfigComponent {
2463
+ constructor(fb,
2464
+ // private _SiteAdminService: SiteAdminService,
2465
+ _SectionAdminService) {
2466
+ this.fb = fb;
2467
+ this._SectionAdminService = _SectionAdminService;
2468
+ /**站点列表 */
2469
+ this.siteList = [];
2470
+ /**选择的站点id */
2471
+ // siteId: string = ''
2472
+ this.siteId = new FormControl('');
2473
+ /**站点下的版块 */
2474
+ this.SiteOfSectionList = [];
2475
+ }
2476
+ set type(v) {
2477
+ if (v == this._type)
2478
+ return;
2479
+ this._type = v;
2480
+ }
2481
+ set Entity(v) {
2482
+ this._Entity = v;
2483
+ }
2484
+ set selected(v) {
2485
+ this._selected = v;
2486
+ }
2487
+ set culture(v) {
2488
+ this._culture = v;
2489
+ }
2490
+ get formConfiguration() {
2491
+ return this._Entity.get('formConfiguration');
2492
+ }
2493
+ ngAfterContentInit() {
2494
+ //Called after ngOnInit when the component's or directive's content has been initialized.
2495
+ //Add 'implements AfterContentInit' to the class.
2496
+ this.dataLoaded(2);
2497
+ }
2498
+ async dataLoaded(val) {
2499
+ if (this._Entity && this._type) {
2500
+ await this.AfterInit();
2501
+ this.submitclick.nativeElement.click();
2502
+ }
2503
+ }
2504
+ AfterInit() {
2505
+ return new Promise(async (resolve, rejects) => {
2506
+ this._Entity.setControl('formConfiguration', this.fb.group(new EntryConfig()));
2507
+ // await this.getsiteList()
2508
+ await this.getSiteOfSectionList();
2509
+ if (this._selected) {
2510
+ this.formConfiguration.patchValue({
2511
+ ...this._selected.formConfiguration
2512
+ });
2513
+ }
2514
+ resolve(true);
2515
+ });
2516
+ }
2517
+ /**获取站点列表 */
2518
+ // getsiteList() {
2519
+ // return new Promise((resolve, rejects) => {
2520
+ // this._SiteAdminService.getList({}).subscribe(res => {
2521
+ // this.siteList = res.items
2522
+ // this.siteId = res.items[0]?.id || ''
2523
+ // resolve(res.items)
2524
+ // })
2525
+ // })
2526
+ // }
2527
+ /**获取站点下的版块 */
2528
+ getSiteOfSectionList() {
2529
+ return new Promise((resolve, rejects) => {
2530
+ this._SectionAdminService.getList({
2531
+ maxResultCount: 1000,
2532
+ // siteId: this.siteId
2533
+ }).subscribe(res => {
2534
+ this.SiteOfSectionList = res.items;
2535
+ this.formConfiguration.patchValue({
2536
+ 'Entry.SectionId': res.items[0]?.id || ''
2537
+ });
2538
+ resolve(res.items);
2539
+ });
2540
+ });
2541
+ }
2542
+ /**切换站点 */
2543
+ async siteIdChange() {
2544
+ await this.getSiteOfSectionList();
2545
+ }
2546
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: SectionAdminService }], target: i0.ɵɵFactoryTarget.Component }); }
2547
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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: [":ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background-color:transparent!important;border:none!important}:ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent!important;box-shadow:none!important}.selectclassliveview{overflow:hidden}::ng-deep .ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:transparent}::ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent;box-shadow:none}::ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background:transparent;border:1px solid transparent}\n"], 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.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" }] }); }
2548
+ }
2549
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryConfigComponent, decorators: [{
2550
+ type: Component,
2551
+ 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>", styles: [":ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background-color:transparent!important;border:none!important}:ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent!important;box-shadow:none!important}.selectclassliveview{overflow:hidden}::ng-deep .ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:transparent}::ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent;box-shadow:none}::ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background:transparent;border:1px solid transparent}\n"] }]
2552
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: SectionAdminService }], propDecorators: { type: [{
2553
+ type: Input
2554
+ }], Entity: [{
2555
+ type: Input
2556
+ }], selected: [{
2557
+ type: Input
2558
+ }], culture: [{
2559
+ type: Input
2560
+ }], submitclick: [{
2561
+ type: ViewChild,
2562
+ args: ['submitclick', { static: true }]
2563
+ }] } });
2564
+
2565
+ /* eslint-disable @angular-eslint/component-selector */
2566
+ class EntryControlComponent {
2567
+ constructor() {
2568
+ this.fb = inject(FormBuilder);
2569
+ this._EntryAdminService = inject(EntryAdminService);
2570
+ /**字段配置列表 */
2571
+ this._fields = '';
2572
+ /** */
2573
+ this.listOfOption = [];
2574
+ }
2575
+ set entity(v) {
2576
+ this._entity = v;
2577
+ if (v)
2578
+ this.dataLoaded();
2579
+ }
2580
+ set fields(v) {
2581
+ this._fields = v;
2582
+ if (v)
2583
+ this.dataLoaded();
2584
+ }
2585
+ set parentFiledName(v) {
2586
+ this._parentFiledName = v;
2587
+ if (v)
2588
+ this.dataLoaded();
2589
+ }
2590
+ set selected(v) {
2591
+ this._selected = v || [];
2592
+ if (v)
2593
+ this.dataLoaded();
2594
+ }
2595
+ set culture(v) {
2596
+ if (v) {
2597
+ this._culture = v;
2598
+ this.dataLoaded();
2599
+ }
2600
+ }
2601
+ async dataLoaded() {
2602
+ if (this._fields && this._entity && this._parentFiledName && this._culture) {
2603
+ await this.AfterInit();
2604
+ await this.getEntryAssignList();
2605
+ this.submitclick.nativeElement.click();
2606
+ }
2607
+ }
2608
+ AfterInit() {
2609
+ return new Promise((resolve, rejects) => {
2610
+ let ValidatorsArray = [];
2611
+ if (this._fields.required) {
2612
+ ValidatorsArray.push(Validators.required);
2613
+ }
2614
+ let newControl = this.fb.control(this._selected, ValidatorsArray);
2615
+ let extraProperties = this._entity.get(this._parentFiledName);
2616
+ extraProperties.setControl(this._fields.field.name, newControl);
2617
+ resolve(true);
2618
+ });
2619
+ }
2620
+ /**获取对应的条目 */
2621
+ getEntryAssignList(filter = '') {
2622
+ return new Promise((resolve, rejects) => {
2623
+ this._EntryAdminService.getList({
2624
+ culture: this._culture,
2625
+ sectionId: this._fields.field.formConfiguration['Entry.SectionId'],
2626
+ skipCount: 0,
2627
+ maxResultCount: 30,
2628
+ status: EntryStatus.Published,
2629
+ filter: filter
2630
+ }).subscribe(res => {
2631
+ this.listOfOption = res.items;
2632
+ resolve(true);
2633
+ });
2634
+ });
2635
+ }
2636
+ /** */
2637
+ async SelectChange(event) {
2638
+ await this.getEntryAssignList(event);
2639
+ }
2640
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2641
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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: ["nzTitle", "nzLabel", "nzValue", "nzKey", "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"] }] }); }
2642
+ }
2643
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryControlComponent, decorators: [{
2644
+ type: Component,
2645
+ 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"] }]
2646
+ }], ctorParameters: () => [], propDecorators: { entity: [{
2647
+ type: Input
2648
+ }], fields: [{
2649
+ type: Input
2650
+ }], parentFiledName: [{
2651
+ type: Input
2652
+ }], selected: [{
2653
+ type: Input
2654
+ }], culture: [{
2655
+ type: Input
2656
+ }], submitclick: [{
2657
+ type: ViewChild,
2658
+ args: ['submitclick', { static: true }]
2659
+ }] } });
2660
+
2661
+ class MatrixConfig {
2662
+ constructor(data) {
2663
+ // 矩阵类型
2664
+ this['MatrixBlockTypes'] = new FormArray([]);
2665
+ if (data) {
2666
+ for (const key in data) {
2667
+ if (data.hasOwnProperty(key)) {
2668
+ this[key] = data[key];
2669
+ }
2670
+ }
2671
+ }
2672
+ }
2673
+ }
2674
+ class MatrixItemConfig {
2675
+ constructor(data) {
2676
+ this.displayName = ['', [Validators.required]];
2677
+ /**字段名字 */
2678
+ this.name = ['', [Validators.required]];
2679
+ if (data) {
2680
+ for (const key in data) {
2681
+ if (data.hasOwnProperty(key)) {
2682
+ this[key] = data[key];
2683
+ }
2684
+ }
2685
+ }
2686
+ }
2687
+ }
2688
+ class matrixFieldInputBase {
2689
+ constructor(data) {
2690
+ /**字段名称 Display name of this field */
2691
+ this.displayName = ['', [Validators.required]];
2692
+ /**字段唯一名称 Unique Name*/
2693
+ this.name = ['', [Validators.required]];
2694
+ /**描述 说明 */
2695
+ this.description = ['', []];
2696
+ /**FieldType字段类型 表单控件名称 */
2697
+ this.formControlName = ['TextEdit', [Validators.required]];
2698
+ /**动态表单配置 */
2699
+ this.formConfiguration = new FormGroup({});
2700
+ if (data) {
2701
+ for (const key in data) {
2702
+ if (data.hasOwnProperty(key)) {
2703
+ this[key] = data[key];
2704
+ }
2705
+ }
2706
+ }
2707
+ }
2708
+ }
2709
+
2710
+ /* eslint-disable @angular-eslint/component-selector */
2711
+ class MatrixConfigComponent {
2712
+ constructor(fb, _CmsApiService, _FieldAbstractsService) {
2713
+ this.fb = fb;
2714
+ this._CmsApiService = _CmsApiService;
2715
+ this._FieldAbstractsService = _FieldAbstractsService;
2716
+ /**模态框-状态 */
2717
+ this.matrixModalOpen = false;
2718
+ /**模态框-是否正在编辑 */
2719
+ this.isMatrixModalEdit = false;
2720
+ /**模态框-用于确定模态的繁忙状态是否为真 */
2721
+ this.modalBusy = false;
2722
+ /**矩阵块-选择的下标 */
2723
+ this.selectMatrixBlockIndex = 0;
2724
+ /**矩阵块-选择的矩阵下字段的下标 */
2725
+ this.selectMatrixFieldIndex = 0;
2726
+ }
2727
+ set type(v) {
2728
+ this._type = v;
2729
+ this.dataLoaded();
2730
+ }
2731
+ set Entity(v) {
2732
+ this._Entity = v;
2733
+ this.dataLoaded();
2734
+ }
2735
+ set selected(v) {
2736
+ if (v) {
2737
+ this._selected = v;
2738
+ this.dataLoaded();
2739
+ }
2740
+ }
2741
+ async dataLoaded() {
2742
+ if (this._Entity && this._type) {
2743
+ await this.AfterInit();
2744
+ this.submitclick.nativeElement.click();
2745
+ }
2746
+ }
2747
+ AfterInit() {
2748
+ return new Promise(async (resolve, rejects) => {
2749
+ this._FieldControlGroup = this._FieldAbstractsService.getExcludeAssignControl(this._type);
2750
+ this._Entity.setControl('formConfiguration', this.fb.group(new MatrixConfig()));
2751
+ await this.setSelectValue();
2752
+ this.formConfiguration.patchValue(this._selected.formConfiguration);
2753
+ resolve(true);
2754
+ });
2755
+ }
2756
+ setSelectValue() {
2757
+ return new Promise((resolve, rejects) => {
2758
+ if (this._selected && this._selected.formControlName == this._type) {
2759
+ this._selected.formConfiguration['MatrixBlockTypes'].forEach(((el, index) => {
2760
+ this.addMatrixBlockTypeItem(el);
2761
+ el.fields.forEach((elf, indexf) => {
2762
+ this.addMatrixFieldItem(elf, index);
2763
+ });
2764
+ }));
2765
+ resolve(true);
2766
+ }
2767
+ });
2768
+ }
2769
+ /**获取表单配置 */
2770
+ get formConfiguration() {
2771
+ return this._Entity.get('formConfiguration');
2772
+ }
2773
+ /**获取表单配置下的矩阵块表单数组 */
2774
+ get MatrixBlockTypes() {
2775
+ return this.formConfiguration.controls['MatrixBlockTypes'];
2776
+ }
2777
+ /**模态框-状态改变 */
2778
+ matrixModalVisibleChange(event) {
2779
+ if (!event) {
2780
+ this.isMatrixModalEdit = false;
2781
+ this.matrixModalForm = undefined;
2782
+ return;
2783
+ }
2784
+ }
2785
+ /**矩阵块--新增-打开模态框 */
2786
+ addMatrixBlockType() {
2787
+ this.matrixModalForm = this.fb.group(new MatrixItemConfig());
2788
+ this.matrixModalOpen = true;
2789
+ }
2790
+ /**模态框--矩阵表单保存提交 */
2791
+ createOrEditSave() {
2792
+ let input = this.matrixModalForm.value;
2793
+ if (!this.matrixModalForm.valid)
2794
+ return;
2795
+ if (this.isMatrixModalEdit) {
2796
+ let MatrixBlockTypesItem = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
2797
+ MatrixBlockTypesItem.patchValue({
2798
+ ...input
2799
+ });
2800
+ }
2801
+ else {
2802
+ this.addMatrixBlockTypeItem(input);
2803
+ }
2804
+ this.matrixModalOpen = false;
2805
+ }
2806
+ /**新增矩阵块-向数组表单中增加项 */
2807
+ addMatrixBlockTypeItem(input) {
2808
+ this.MatrixBlockTypes.push(new FormGroup({
2809
+ displayName: new FormControl(input.displayName, Validators.required),
2810
+ name: new FormControl(input.name, Validators.required),
2811
+ fields: new FormArray([])
2812
+ }));
2813
+ }
2814
+ /**编辑矩阵块 */
2815
+ EditMatrixBlock(input) {
2816
+ this.matrixModalForm = this.fb.group(new MatrixItemConfig());
2817
+ this.matrixModalForm.patchValue({
2818
+ ...input
2819
+ });
2820
+ this.matrixModalOpen = true;
2821
+ this.isMatrixModalEdit = true;
2822
+ }
2823
+ /**删除矩阵块 */
2824
+ DeleteMatrixBlock(index) {
2825
+ this.MatrixBlockTypes.removeAt(index);
2826
+ }
2827
+ /**矩阵块-选择 */
2828
+ selectMatrixBlockChange(index) {
2829
+ this.selectMatrixBlockIndex = index;
2830
+ }
2831
+ /**矩阵字段-新增 */
2832
+ addMatrixField() {
2833
+ this.addMatrixFieldItem('', this.selectMatrixBlockIndex);
2834
+ let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
2835
+ let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
2836
+ this.selectMatrixFieldChange(0, MatrixFieldItemForm.length - 1);
2837
+ }
2838
+ /**矩阵字段-新增矩阵字段项 */
2839
+ addMatrixFieldItem(input = '', selectMatrixBlockIndex) {
2840
+ /**矩阵下标的矩阵项Form */
2841
+ let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(selectMatrixBlockIndex);
2842
+ let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
2843
+ MatrixFieldItemForm.push(this.fb.group({
2844
+ /**字段名称 Display name of this field */
2845
+ displayName: [input.displayName, [Validators.required]],
2846
+ /**字段唯一名称 Unique Name*/
2847
+ name: [input.name, [Validators.required]],
2848
+ /**描述 说明 */
2849
+ description: [input.description, []],
2850
+ /**FieldType字段类型 表单控件名称 */
2851
+ formControlName: [input.formControlName || 'TextEdit', [Validators.required]],
2852
+ //动态表单配置
2853
+ formConfiguration: new FormGroup({}),
2854
+ }));
2855
+ //
2856
+ }
2857
+ /**删除矩阵字段项 */
2858
+ deleteMatrixField(MatrixFieldForm, index) {
2859
+ MatrixFieldForm.removeAt(index);
2860
+ this.selectMatrixFieldIndex = 0;
2861
+ }
2862
+ /**矩阵字段-选择 */
2863
+ selectMatrixFieldChange(MatrixBlockIndex, MatrixFieldIndex) {
2864
+ this.selectMatrixFieldIndex = MatrixFieldIndex;
2865
+ }
2866
+ get nameInput() {
2867
+ return this.matrixModalForm?.get('name');
2868
+ }
2869
+ get FieldnameInput() {
2870
+ let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
2871
+ let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
2872
+ return MatrixFieldItemForm.at(this.selectMatrixFieldIndex).get('name');
2873
+ }
2874
+ /**矩阵displayNameInput字段失去焦点 */
2875
+ displayNameInputBlur(event) {
2876
+ let value = event.target.value;
2877
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
2878
+ let nameInput = this.nameInput;
2879
+ if (nameInput.value)
2880
+ return;
2881
+ nameInput.patchValue(pinyin);
2882
+ }
2883
+ /**矩阵displayNameInput字段失去焦点 */
2884
+ MatrixFieldDisplayNameInputBlur(event) {
2885
+ let value = event.target.value;
2886
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
2887
+ let FieldnameInput = this.FieldnameInput;
2888
+ if (FieldnameInput.value)
2889
+ return;
2890
+ FieldnameInput.patchValue(pinyin);
2891
+ }
2892
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: CmsApiService }, { token: FieldAbstractsService }], target: i0.ɵɵFactoryTarget.Component }); }
2893
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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&&itemf\">\n <df-dynamic [type]=\"itemf.value.formControlName\" [entity]=\"itemf\"\n [selected]=\"_selected?_selected.formConfiguration?.MatrixBlockTypes[i]?.fields[fi]:''\"></df-dynamic>\n \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 (keydown.enter)=\"$event.preventDefault()\" (submit)=\"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.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: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$1.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2894
+ }
2895
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixConfigComponent, decorators: [{
2896
+ type: Component,
2897
+ 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&&itemf\">\n <df-dynamic [type]=\"itemf.value.formControlName\" [entity]=\"itemf\"\n [selected]=\"_selected?_selected.formConfiguration?.MatrixBlockTypes[i]?.fields[fi]:''\"></df-dynamic>\n \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 (keydown.enter)=\"$event.preventDefault()\" (submit)=\"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>" }]
2898
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: CmsApiService }, { type: FieldAbstractsService }], propDecorators: { type: [{
2899
+ type: Input
2900
+ }], Entity: [{
2901
+ type: Input
2902
+ }], selected: [{
2903
+ type: Input
2904
+ }], submitclick: [{
2905
+ type: ViewChild,
2906
+ args: ['submitclick', { static: true }]
2907
+ }], matrixModalModalSubmit: [{
2908
+ type: ViewChild,
2909
+ args: ['matrixModalModalSubmit', { static: false }]
2910
+ }] } });
2911
+
2912
+ /* eslint-disable @angular-eslint/component-selector */
2913
+ class MatrixControlComponent {
2914
+ constructor(fb) {
2915
+ this.fb = fb;
2916
+ /**字段配置列表 */
2917
+ this._fields = '';
2918
+ /**矩阵列表 */
2919
+ this.MatrixBlockTypesList = [];
2920
+ }
2921
+ set entity(v) {
2922
+ this._entity = v;
2923
+ this.dataLoaded();
2924
+ }
2925
+ set fields(v) {
2926
+ this._fields = v;
2927
+ this.dataLoaded();
2928
+ }
2929
+ set parentFiledName(v) {
2930
+ this._parentFiledName = v;
2931
+ this.dataLoaded();
2932
+ }
2933
+ set selected(v) {
2934
+ this._selected = v;
2935
+ if (v) {
2936
+ this.dataLoaded();
2937
+ }
2938
+ }
2939
+ set culture(v) {
2940
+ this._culture = v;
2941
+ }
2942
+ /**数据加载完成 */
2943
+ async dataLoaded() {
2944
+ if (this._fields && this._entity && this._parentFiledName) {
2945
+ this.extraProperties = this._entity.get(this._parentFiledName);
2946
+ await this.AfterInit();
2947
+ this.submitclick.nativeElement.click();
2948
+ if (this._selected)
2949
+ this.fieldNameControl.patchValue(this._selected);
2950
+ }
2951
+ }
2952
+ AfterInit() {
2953
+ return new Promise((resolve, rejects) => {
2954
+ let formConfiguration = this._fields.field.formConfiguration;
2955
+ let newArrayGroup = this.fb.array([]);
2956
+ this.extraProperties.setControl(this._fields.field.name, newArrayGroup);
2957
+ this.fieldNameControl = this.extraProperties.get(this._fields.field.name);
2958
+ if (this._selected) {
2959
+ this._selected.forEach(el => {
2960
+ this.addMatrixControl(formConfiguration.MatrixBlockTypes.find(item => item.name == el.matrixBlockTypeName));
2961
+ });
2962
+ }
2963
+ this.MatrixBlockTypesList = formConfiguration.MatrixBlockTypes;
2964
+ resolve(true);
2965
+ });
2966
+ }
2967
+ /**增加指定矩阵控件项 */
2968
+ addMatrixControl(item) {
2969
+ this.fieldNameControl.push(this.fb.group({
2970
+ extraProperties: new FormGroup({
2971
+ name: new FormControl('')
2972
+ }),
2973
+ matrixBlockTypeName: [item.name],
2974
+ displayName: [item.displayName]
2975
+ }));
2976
+ }
2977
+ /**删除矩阵控件 */
2978
+ deleteMatrixControl(index) {
2979
+ this.fieldNameControl.removeAt(index);
2980
+ }
2981
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixControlComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
2982
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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 *ngIf=\"item&&elf&&_culture\">\n <df-dynamic [entity]=\"item\"\n [fields]=\"{ field: elf,displayName:elf.displayName }\"\n [selected]=\"_selected ? _selected[i]?_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"] }] }); }
2983
+ }
2984
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixControlComponent, decorators: [{
2985
+ type: Component,
2986
+ 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 *ngIf=\"item&&elf&&_culture\">\n <df-dynamic [entity]=\"item\"\n [fields]=\"{ field: elf,displayName:elf.displayName }\"\n [selected]=\"_selected ? _selected[i]?_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>" }]
2987
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { entity: [{
2988
+ type: Input
2989
+ }], fields: [{
2990
+ type: Input
2991
+ }], parentFiledName: [{
2992
+ type: Input
2993
+ }], selected: [{
2994
+ type: Input
2995
+ }], culture: [{
2996
+ type: Input
2997
+ }], submitclick: [{
2998
+ type: ViewChild,
2999
+ args: ['submitclick', { static: true }]
3000
+ }] } });
3001
+
3002
+ class TableConfig {
3003
+ constructor(data) {
3004
+ // 选项
3005
+ this.TableColumns = new FormArray([]);
3006
+ if (data) {
3007
+ for (const key in data) {
3008
+ if (data.hasOwnProperty(key)) {
3009
+ this[key] = data[key];
3010
+ }
3011
+ }
3012
+ }
3013
+ }
3014
+ }
3015
+ class TableFormControl {
3016
+ constructor(data) {
3017
+ /**列标题 */
3018
+ this.displayName = ['', [Validators.required]];
3019
+ /**空间配置 */
3020
+ this.formConfiguration = new FormGroup({});
3021
+ /**列名 */
3022
+ this.name = ['', [Validators.required]];
3023
+ //控件标识
3024
+ this.formControlName = ['', [Validators.required]];
3025
+ /**是否必填 */
3026
+ this.required = [false];
3027
+ /**描述 */
3028
+ this.description = [''];
3029
+ if (data) {
3030
+ for (const key in data) {
3031
+ if (data.hasOwnProperty(key)) {
3032
+ this[key] = data[key];
3033
+ }
3034
+ }
3035
+ }
3036
+ }
3037
+ }
3038
+
3039
+ /* eslint-disable @angular-eslint/component-selector */
3040
+ class TableConfigComponent {
3041
+ constructor(fb, _CmsApiService, _FieldAbstractsService) {
3042
+ this.fb = fb;
3043
+ this._CmsApiService = _CmsApiService;
3044
+ this._FieldAbstractsService = _FieldAbstractsService;
3045
+ /**创建站点模态框状态 */
3046
+ this.tableSelectOpen = false;
3047
+ /**用于确定模态的繁忙状态是否为真 */
3048
+ this.modalBusy = false;
3049
+ }
3050
+ set Entity(v) {
3051
+ this._Entity = v;
3052
+ this.dataLoaded();
3053
+ }
3054
+ set selected(v) {
3055
+ if (v) {
3056
+ this._selected = v;
3057
+ this.dataLoaded();
3058
+ }
3059
+ }
3060
+ set type(v) {
3061
+ this._type = v;
3062
+ this.dataLoaded();
3063
+ }
3064
+ get formConfiguration() {
3065
+ return this._Entity.get('formConfiguration');
3066
+ }
3067
+ get TableColumns() {
3068
+ return this.formConfiguration.controls['TableColumns'];
3069
+ }
3070
+ async dataLoaded() {
3071
+ if (this._Entity && this._type) {
3072
+ await this.AfterInit();
3073
+ this.submitclick.nativeElement.click();
3074
+ }
3075
+ }
3076
+ /**增加选项 */
3077
+ addTableColumns() {
3078
+ this.TableColumns.push(this.fb.group({
3079
+ ...new TableFormControl(),
3080
+ formConfiguration: [{}]
3081
+ }));
3082
+ }
3083
+ /**删除某个选项 */
3084
+ deleteTableColumns(index) {
3085
+ this.TableColumns.removeAt(index);
3086
+ }
3087
+ AfterInit() {
3088
+ return new Promise((resolve, rejects) => {
3089
+ this._Entity.setControl('formConfiguration', this.fb.group(new TableConfig()));
3090
+ this._fieldControlGroup = this._FieldAbstractsService.getExcludeAssignControl(this._type);
3091
+ if (this._selected && this._selected.formControlName == this._type) {
3092
+ this._selected.formConfiguration['TableColumns'].forEach(el => {
3093
+ this.addTableColumns();
3094
+ });
3095
+ this.formConfiguration.patchValue(this._selected.formConfiguration);
3096
+ }
3097
+ else {
3098
+ this.addTableColumns();
3099
+ }
3100
+ resolve(true);
3101
+ });
3102
+ }
3103
+ /**选择表格的表单控件 */
3104
+ selectTableControl(event, i, item) {
3105
+ this.CurrentSelectionTableControlName = event.target.value;
3106
+ this.tableSelectOpen = true;
3107
+ this.tableSelectForm = this.fb.group(new TableFormControl());
3108
+ this.TableColumnsIndex = i;
3109
+ this.itemForm = item;
3110
+ }
3111
+ /**创建站点模态框状态改变 */
3112
+ tableSelectVisibleChange(event) {
3113
+ if (!event) {
3114
+ this._tableSelected = undefined;
3115
+ this.tableSelectForm = undefined;
3116
+ this.CurrentSelectionTableControlName = undefined;
3117
+ this.TableColumnsIndex = undefined;
3118
+ return;
3119
+ }
3120
+ }
3121
+ /**表单保存提交 */
3122
+ createOrEditSave() {
3123
+ const formGroup = this.TableColumns.at(this.TableColumnsIndex);
3124
+ let formConfigurationgroup = formGroup.get('formConfiguration');
3125
+ formConfigurationgroup.setValue({
3126
+ ...this.tableSelectForm.value['formConfiguration'],
3127
+ });
3128
+ this.tableSelectOpen = false;
3129
+ }
3130
+ /**编辑站点按钮 */
3131
+ EditSitesBtn(rows, i) {
3132
+ this.CurrentSelectionTableControlName = rows.get('formControlName').value;
3133
+ this.tableSelectForm = this.fb.group(new TableFormControl());
3134
+ this.tableSelectForm.patchValue({
3135
+ ...rows.value
3136
+ });
3137
+ this.tableSelectForm.get('formConfiguration').patchValue({
3138
+ ...rows.value['formConfiguration']
3139
+ });
3140
+ this._tableSelected = rows.value;
3141
+ this.TableColumnsIndex = i;
3142
+ this.tableSelectOpen = true;
3143
+ }
3144
+ /**调整表格位置 */
3145
+ TableArrowUpOrDown(type, index) {
3146
+ let controlAt = this.TableColumns.at(index);
3147
+ this.TableColumns.removeAt(index);
3148
+ let lastindex = type == 'up' ? index - 1 : index + 1;
3149
+ this.TableColumns.insert(lastindex, controlAt);
3150
+ }
3151
+ /**字段标签input失去标点生成字段名字 */
3152
+ disPlayNameInputBlur(event, item) {
3153
+ let value = event.target.value;
3154
+ let pinyin = this._CmsApiService.chineseToPinyin(value);
3155
+ let nameInput = item.get('name');
3156
+ if (nameInput.value)
3157
+ return;
3158
+ nameInput.patchValue(pinyin);
3159
+ }
3160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: CmsApiService }, { token: FieldAbstractsService }], target: i0.ɵɵFactoryTarget.Component }); }
3161
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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 (keydown.enter)=\"$event.preventDefault()\" (submit)=\"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.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" }] }); }
3162
+ }
3163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableConfigComponent, decorators: [{
3164
+ type: Component,
3165
+ 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 (keydown.enter)=\"$event.preventDefault()\" (submit)=\"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"] }]
3166
+ }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: CmsApiService }, { type: FieldAbstractsService }], propDecorators: { Entity: [{
3167
+ type: Input
3168
+ }], selected: [{
3169
+ type: Input
3170
+ }], type: [{
3171
+ type: Input
3172
+ }], submitclick: [{
3173
+ type: ViewChild,
3174
+ args: ['submitclick', { static: true }]
3175
+ }], tableSelectModalSubmit: [{
3176
+ type: ViewChild,
3177
+ args: ['tableSelectModalSubmit', { static: false }]
3178
+ }] } });
3179
+
3180
+ class TableControlComponent {
3181
+ constructor() {
3182
+ this.fb = inject(FormBuilder);
3183
+ /**字段配置列表 */
3184
+ this._fields = '';
3185
+ }
3186
+ set entity(v) {
3187
+ this._entity = v;
3188
+ this.dataLoaded();
3189
+ }
3190
+ set fields(v) {
3191
+ this._fields = v;
3192
+ this.dataLoaded();
3193
+ }
3194
+ set parentFiledName(v) {
3195
+ this._parentFiledName = v;
3196
+ this.dataLoaded();
3197
+ }
3198
+ set selected(v) {
3199
+ this._selected = v;
3200
+ if (v) {
3201
+ this.dataLoaded();
3202
+ }
3203
+ }
3204
+ set culture(v) {
3205
+ this._culture = v;
3206
+ }
3207
+ /**数据加载完成 */
3208
+ async dataLoaded() {
3209
+ if (this._fields && this._entity && this._parentFiledName) {
3210
+ this.extraProperties = this._entity.get(this._parentFiledName);
3211
+ await this.AfterInit();
3212
+ this.submitclick.nativeElement.click();
3213
+ }
3214
+ }
3215
+ AfterInit() {
3216
+ return new Promise((resolve, rejects) => {
3217
+ let ValidatorsArray = [];
3218
+ if (this._fields.required) {
3219
+ ValidatorsArray.push(Validators.required);
3220
+ }
3221
+ let formConfiguration = this._fields.field.formConfiguration;
3222
+ this.formConfiguration = formConfiguration;
3223
+ let newArrayGroup = this.fb.array([]);
3224
+ this.extraProperties.setControl(this._fields.field.name, newArrayGroup);
3225
+ this.fieldNameControl = this.extraProperties.get(this._fields.field.name);
3226
+ if (this._selected) {
3227
+ this._selected.forEach(el => {
3228
+ this.addTableControlItem();
3229
+ });
3230
+ this.fieldNameControl.patchValue(this._selected);
3231
+ }
3232
+ else {
3233
+ this.addTableControlItem();
3234
+ }
3235
+ resolve(true);
3236
+ });
3237
+ }
3238
+ /**增加表格项 */
3239
+ addTableControlItem() {
3240
+ this.fieldNameControl.push(this.fb.group({
3241
+ 'extraProperties': this.fb.group({})
3242
+ }));
3243
+ }
3244
+ /**删除表格项 */
3245
+ minusTableControlItem(index) {
3246
+ this.fieldNameControl.removeAt(index);
3247
+ }
3248
+ /**调整表格位置 */
3249
+ TableArrowUpOrDown(type, index) {
3250
+ let controlAt = this.fieldNameControl.at(index);
3251
+ this.fieldNameControl.removeAt(index);
3252
+ let lastindex = type == 'up' ? index - 1 : index + 1;
3253
+ this.fieldNameControl.insert(lastindex, controlAt);
3254
+ this._selected = this.fieldNameControl.value;
3255
+ }
3256
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3257
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", 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"] }] }); }
3258
+ }
3259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableControlComponent, decorators: [{
3260
+ type: Component,
3261
+ 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"] }]
3262
+ }], ctorParameters: () => [], propDecorators: { entity: [{
3263
+ type: Input
3264
+ }], fields: [{
3265
+ type: Input
3266
+ }], parentFiledName: [{
3267
+ type: Input
3268
+ }], selected: [{
3269
+ type: Input
3270
+ }], culture: [{
3271
+ type: Input
3272
+ }], submitclick: [{
3273
+ type: ViewChild,
3274
+ args: ['submitclick', { static: true }]
3275
+ }] } });
3276
+
3277
+ /**
3278
+ * 表单控件分组-包含配置,控件,显示的数组
3279
+ */
3280
+ const FieldControlGroup = [
3281
+ {
3282
+ displayName: '表格',
3283
+ name: 'Table',
3284
+ fieldConfigComponent: TableConfigComponent,
3285
+ fieldComponent: TableControlComponent,
3286
+ },
3287
+ {
3288
+ displayName: '矩阵',
3289
+ name: 'Matrix',
3290
+ fieldConfigComponent: MatrixConfigComponent,
3291
+ fieldComponent: MatrixControlComponent,
3292
+ },
3293
+ {
3294
+ displayName: '条目',
3295
+ name: 'Entry',
3296
+ fieldConfigComponent: EntryConfigComponent,
3297
+ fieldComponent: EntryControlComponent,
3298
+ },
3299
+ ];
3300
+
3301
+ var styles = `
3302
+ .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}
3303
+ a {
3304
+ text-decoration: unset;
3305
+ }
3306
+
3307
+ .form-label{
3308
+ font-size: 12px;
3309
+ }
3310
+ :root select{
3311
+ cursor: pointer; /* this will show the pointer when hovering */
3312
+ }
3313
+ .cdk-global-overlay-wrapper, .cdk-overlay-container {pointer-events: none;top: 0;left: 0;height: 100%;width: 100% }.cdk-overlay-container {position: fixed;z-index: 1000 }.cdk-overlay-container:empty {display: none }.cdk-global-overlay-wrapper, .cdk-overlay-connected-position-bounding-box, .cdk-overlay-pane {position: absolute;z-index: 1000;display: flex }.cdk-overlay-pane {pointer-events: auto;box-sizing: border-box;max-width: 100%;max-height: 100% }.cdk-overlay-backdrop {position: absolute;top: 0;bottom: 0;left: 0;right: 0;z-index: 1000;pointer-events: auto;transition: opacity .4s cubic-bezier(.25, .8, .25, 1);opacity: 0 }.cdk-overlay-backdrop.cdk-overlay-backdrop-showing {opacity: 1 }.cdk-high-contrast-active .cdk-overlay-backdrop.cdk-overlay-backdrop-showing {opacity: .6 }.cdk-overlay-dark-backdrop {background: rgba(0, 0, 0, .32) }.cdk-overlay-transparent-backdrop {transition: visibility 1ms linear, opacity 1ms linear;visibility: hidden;opacity: 1 }.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing {opacity: 0;visibility: visible }.cdk-overlay-backdrop-noop-animation {transition: none }.cdk-overlay-connected-position-bounding-box {flex-direction: column;min-width: 1px;min-height: 1px }.cdk-global-scrollblock {position: fixed;width: 100%;overflow-y: scroll }.cdk-visually-hidden {border: 0;clip: rect(0 0 0 0);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;outline: 0;-webkit-appearance: none;-moz-appearance: none }.nz-overlay-transparent-backdrop, .nz-overlay-transparent-backdrop.cdk-overlay-backdrop-showing {opacity: 0 }.ant-select, .ant-select-dropdown {margin: 0;line-height: 1.5715;box-sizing: border-box;font-feature-settings: 'tnum';list-style: none }.ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottom, .ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottomLeft, .ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottomRight, .ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottom, .ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottomLeft, .ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottomRight, .ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-bottomLeft, .ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-bottomLeft {animation-name: antSlideUpIn }.ant-select-dropdown.ant-select-tree-dropdown {top: 100%;left: 0;position: relative;width: 100%;margin-top: 4px;margin-bottom: 4px;overflow: auto }.ant-select-dropdown-hidden, .ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-delete, .ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-eye, .ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info::before {display: none }.ant-select-dropdown {top: 100%;left: 0;position: relative;width: 100%;margin-top: 4px;margin-bottom: 4px;display: block }.ant-select-dropdown .cdk-virtual-scroll-content-wrapper {right: 0 }.ant-select-dropdown .full-width {contain: initial }.ant-select-dropdown .full-width .cdk-virtual-scroll-content-wrapper {position: static }.ant-select-dropdown .full-width .cdk-virtual-scroll-spacer {position: absolute;top: 0;width: 1px }.ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-topLeft, .ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-topLeft {animation-name: antSlideDownIn }.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-bottomLeft {animation-name: antSlideUpOut }.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-topLeft {animation-name: antSlideDownOut }
3314
+
3315
+ /*** 表单验证样式 start */
3316
+ .was-validated .form-control:invalid, .form-control.is-invalid{
3317
+ border-color: #c00d49 !important;
3318
+ }
3319
+ /*** 表单验证样式 end */
3320
+ `;
3321
+
3322
+ let isAppentStyle = false;
3323
+ function appentStyle() {
3324
+ /**确保该路由守卫只会执行一次 */
3325
+ if (isAppentStyle)
3326
+ return;
3327
+ isAppentStyle = true;
3328
+ const rendererFactory = inject(RendererFactory2);
3329
+ let renderer = rendererFactory.createRenderer(null, null);
3330
+ const style = renderer.createElement('style');
3331
+ renderer.setProperty(style, 'innerHTML', styles);
3332
+ renderer.appendChild(document.head, style);
3333
+ }
3334
+
3335
+ /**版块 */
3336
+ const Sections_Defaults_Toolbar_Action = ToolbarAction.createMany([
3337
+ {
3338
+ text: 'Cms::New',
3339
+ action: data => {
3340
+ const component = data.getInjected(SectionsComponent);
3341
+ component.createSectionBtn();
3342
+ },
3343
+ btnClass: '',
3344
+ permission: 'CmsAdmin.Entry.Create',
3345
+ icon: 'fa fa-plus',
3346
+ },
3347
+ ]);
3348
+ /**版块-创建-编辑 */
3349
+ const Sections_Create_Or_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
3350
+ {
3351
+ text: 'AbpUi::Save',
3352
+ action: data => {
3353
+ const component = data.getInjected(CreateOrEditComponent);
3354
+ component.submitclickBtn();
3355
+ },
3356
+ btnClass: '',
3357
+ permission: 'CmsAdmin.Entry.Create',
3358
+ icon: 'fas fa-save',
3359
+ },
3360
+ ]);
3361
+ /**站点 */
3362
+ // export const Sites_Defaults_Toolbar_Action = ToolbarAction.createMany<any[]>([
3363
+ // {
3364
+ // text: 'Cms::New',
3365
+ // action: data => {
3366
+ // const component = data.getInjected(SitesComponent);
3367
+ // // component.createSitesBtn();
3368
+ // },
3369
+ // btnClass: '',
3370
+ // permission: 'CmsAdmin.Entry.Create',
3371
+ // icon: 'fa fa-plus',
3372
+ // },
3373
+ // ]);
3374
+ /**字段 */
3375
+ const Fields_Defaults_Toolbar_Action = ToolbarAction.createMany([
3376
+ {
3377
+ text: 'Cms::New',
3378
+ action: data => {
3379
+ const component = data.getInjected(FieldsComponent);
3380
+ component.toFieldsCreateBtn();
3381
+ },
3382
+ btnClass: '',
3383
+ permission: 'CmsAdmin.Entry.Create',
3384
+ icon: 'fa fa-plus',
3385
+ },
3386
+ ]);
3387
+ /**字段-创建 */
3388
+ const Fields_Create_Defaults_Toolbar_Action = ToolbarAction.createMany([
3389
+ {
3390
+ text: 'AbpUi::Save',
3391
+ action: data => {
3392
+ const component = data.getInjected(CreateFieldComponent);
3393
+ component.submitclickBtn();
3394
+ },
3395
+ btnClass: '',
3396
+ permission: 'CmsAdmin.Entry.Create',
3397
+ icon: 'fas fa-save',
3398
+ },
3399
+ ]);
3400
+ /**字段-创建 */
3401
+ const Fields_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
3402
+ {
3403
+ text: 'AbpUi::Save',
3404
+ action: data => {
3405
+ const component = data.getInjected(EditFieldComponent);
3406
+ component.submitclickBtn();
3407
+ },
3408
+ btnClass: '',
3409
+ permission: 'CmsAdmin.Entry.Create',
3410
+ icon: 'fas fa-save',
3411
+ },
3412
+ ]);
3413
+ /**条目 */
3414
+ const Entries_Defaults_Toolbar_Action = ToolbarAction.createMany([
3415
+ {
3416
+ text: 'Cms::New',
3417
+ action: data => {
3418
+ const component = data.getInjected(EntriesComponent);
3419
+ component.createEntriesBtn();
3420
+ },
3421
+ btnClass: '',
3422
+ permission: 'CmsAdmin.Entry.Create',
3423
+ icon: 'fa fa-plus',
3424
+ },
3425
+ ]);
3426
+ /**条目-创建 */
3427
+ const Entries_Create_Defaults_Toolbar_Action = ToolbarAction.createMany([
3428
+ {
3429
+ text: 'AbpUi::Cancel',
3430
+ action: data => {
3431
+ const component = data.getInjected(CreateComponent);
3432
+ component.backTo();
3433
+ },
3434
+ btnClass: 'btn btn-light btn-sm',
3435
+ permission: 'CmsAdmin.Entry.Create',
3436
+ icon: '',
3437
+ },
3438
+ {
3439
+ text: 'AbpUi::Save',
3440
+ action: data => {
3441
+ const component = data.getInjected(CreateComponent);
3442
+ component.clickSubmit(true);
3443
+ },
3444
+ btnClass: 'btn btn-info btn-sm',
3445
+ permission: 'CmsAdmin.Entry.Create',
3446
+ icon: 'fas fa-save',
3447
+ },
3448
+ {
3449
+ text: 'Cms::Publish',
3450
+ action: data => {
3451
+ const component = data.getInjected(CreateComponent);
3452
+ component.clickSubmit(false);
3453
+ },
3454
+ btnClass: '',
3455
+ permission: 'CmsAdmin.Entry.Create',
3456
+ icon: 'fa fa-paper-plane',
3457
+ },
3458
+ ]);
3459
+ /**条目编辑 */
3460
+ const Entries_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
3461
+ {
3462
+ text: 'AbpUi::Cancel',
3463
+ action: data => {
3464
+ const component = data.getInjected(EditComponent);
3465
+ component.backTo();
3466
+ },
3467
+ btnClass: 'btn btn-light btn-sm',
3468
+ permission: 'CmsAdmin.Entry.Create',
3469
+ icon: '',
3470
+ },
3471
+ {
3472
+ text: 'AbpUi::Save',
3473
+ action: data => {
3474
+ const component = data.getInjected(EditComponent);
3475
+ component.clickSubmit(true);
3476
+ },
3477
+ btnClass: 'btn btn-info btn-sm',
3478
+ permission: 'CmsAdmin.Entry.Create',
3479
+ icon: 'fas fa-save',
3480
+ },
3481
+ {
3482
+ text: 'Cms::Publish',
3483
+ action: data => {
3484
+ const component = data.getInjected(EditComponent);
3485
+ component.clickSubmit(false);
3486
+ },
3487
+ btnClass: '',
3488
+ permission: 'CmsAdmin.Entry.Create',
3489
+ icon: 'fa fa-paper-plane',
3490
+ },
3491
+ ]);
3492
+
3493
+ /**
3494
+ [ECmsComponent.Fields]: Fields_Entity_Props,
3495
+ */
3496
+ const Fields_Entity_Props = EntityProp.createMany([
3497
+ {
3498
+ type: "string" /* ePropType.String */,
3499
+ name: 'displayName',
3500
+ displayName: 'Cms::DisplayName',
3501
+ sortable: true,
3502
+ },
3503
+ {
3504
+ type: "string" /* ePropType.String */,
3505
+ name: 'name',
3506
+ displayName: 'Cms::Name',
3507
+ sortable: true,
3508
+ },
3509
+ {
3510
+ type: "string" /* ePropType.String */,
3511
+ name: 'formControlName',
3512
+ displayName: 'Cms::FormControlName',
3513
+ sortable: true,
3514
+ },
3515
+ {
3516
+ type: "string" /* ePropType.String */,
3517
+ name: 'groupName',
3518
+ displayName: 'Cms::Group',
3519
+ sortable: true,
3520
+ },
3521
+ {
3522
+ type: "datetime" /* ePropType.DateTime */,
3523
+ name: 'creationTime',
3524
+ displayName: 'Cms::CreationTime',
3525
+ sortable: true,
3526
+ },
3527
+ ]);
3528
+ // PageName.Guides
3529
+ // export const Guides_Entity_Props = EntityProp.createMany<any>([
3530
+ // {
3531
+ // type: ePropType.String,
3532
+ // name: 'fullName',
3533
+ // displayName: 'AbpTenantManagement::全称',
3534
+ // sortable: true,
3535
+ // // valueResolver: (data: any) => {
3536
+ // // let sss = `<a href="/guides/${data.record.id}" class="underline-animate" title="${data.record.fullName}">${data.record.fullName}</a>`
3537
+ // // return of(sss);
3538
+ // // },
3539
+ // action: data => {
3540
+ // //EntriesComponent对应的工具栏页面
3541
+ // console.log(111111, 'data',data);
3542
+ // },
3543
+ // },
3544
+ // ]);
3545
+
3546
+ // import { AbpTableComponent } from "../view/table/abp-table.component";
3547
+ // [PageName.Area]:Area_Entity_Action,
3548
+ /**
3549
+ [ECmsComponent.Fields]: Fields_Entity_Action,
3550
+ */
3551
+ const Fields_Entity_Action = EntityAction.createMany([
3552
+ {
3553
+ text: 'AbpUi::Edit',
3554
+ action: data => {
3555
+ const router = data.getInjected(Router);
3556
+ router.navigate([`/cms/admin/fields/${data.record.id}/edit`]);
3557
+ },
3558
+ permission: 'TravelyAdmin.Area.Update',
3559
+ },
3560
+ {
3561
+ text: 'AbpUi::Delete',
3562
+ action: data => {
3563
+ const component = data.getInjected(FieldsComponent);
3564
+ // component.clickbtn({ data, type: 'delete' })
3565
+ component.deletefield(data.record);
3566
+ },
3567
+ permission: 'TravelyAdmin.Area.Delete',
3568
+ },
3569
+ ]);
3570
+ // [PageName.Area]:Area_Entity_Action,
3571
+ // export const Area_Entity_Action = EntityAction.createMany<any>([
3572
+ // {
3573
+ // text: 'AbpUi::Edit',
3574
+ // action: data => {
3575
+ // const component = data.getInjected(AreaComponent);
3576
+ // // component.clickbtn({ data, type: 'edit' })
3577
+ // component.createOrEditArea(data.record)
3578
+ // },
3579
+ // permission: 'TravelyAdmin.Area.Update',
3580
+ // },
3581
+ // {
3582
+ // text: 'AbpUi::Delete',
3583
+ // action: data => {
3584
+ // const component = data.getInjected(AreaComponent);
3585
+ // // component.clickbtn({ data, type: 'delete' })
3586
+ // component.deleteArea(data.record)
3587
+ // },
3588
+ // permission: 'TravelyAdmin.Area.Delete',
3589
+ // },
3590
+ // ]);
3591
+
3592
+ /**默认-实体-操作 */
3593
+ const Default_Entity_Actions = {
3594
+ // [ModuleComponent.AbpTable]: Abp_Table_Entity_Action,
3595
+ [ECmsComponent.Fields]: Fields_Entity_Action,
3596
+ };
3597
+ /**默认实体属性-表格列名 */
3598
+ const Default_Entity_Props = {
3599
+ // [PageName.Guides]: Guides_Entity_Props,
3600
+ [ECmsComponent.Fields]: Fields_Entity_Props,
3601
+ };
3602
+ /**默认-工具栏-操作 */
3603
+ const Default_Toolbar_Actions = {
3604
+ // [ModuleComponent.Page]: Page_Toolbar_Action,
3605
+ // [eCmsKitPageName.FaqQuestion]:FaqQuestion_Toolbar_Action
3606
+ [ECmsComponent.Entries]: Entries_Defaults_Toolbar_Action,
3607
+ [ECmsComponent.Entries_Create]: Entries_Create_Defaults_Toolbar_Action,
3608
+ [ECmsComponent.Entries_Edit]: Entries_Edit_Defaults_Toolbar_Action,
3609
+ [ECmsComponent.Fields]: Fields_Defaults_Toolbar_Action,
3610
+ [ECmsComponent.FieldsCreate]: Fields_Create_Defaults_Toolbar_Action,
3611
+ [ECmsComponent.FieldsEdit]: Fields_Edit_Defaults_Toolbar_Action,
3612
+ [ECmsComponent.Sections]: Sections_Defaults_Toolbar_Action,
3613
+ [ECmsComponent.SectionsCreateOrEdit]: Sections_Create_Or_Edit_Defaults_Toolbar_Action,
3614
+ };
3615
+ /**
3616
+ *
3617
+ * @param 在Extensions_Props_Action_Token_Resolver方法中使用
3618
+ * @param 在.module.ts中使用,
3619
+ export class CmsModule {
3620
+ static forChild(options: any = {}): ModuleWithProviders<CmsModule> {
3621
+ return {
3622
+ ngModule: CmsModule,
3623
+ providers: [
3624
+ {
3625
+ provide: Toolbar_Action_Contributors,
3626
+ useValue: options.toolbarActionContributors,
3627
+ },
3628
+ {
3629
+ provide: Entity_Action_Contributors,
3630
+ useValue: options.entityActionContributors,
3631
+ },
3632
+ {
3633
+ provide: Entity_Props_Contributors,
3634
+ useValue: options.entityPropContributors,
3635
+ },
3636
+ ]
3637
+ };
3638
+ }
3639
+ static forLazy(options: any = {}): NgModuleFactory<CmsModule> {
3640
+ return new LazyModuleFactory(CmsModule.forChild(options));
3641
+ }
3642
+ }
3643
+ *
3644
+ *
3645
+ */
3646
+ /**实体-操作-贡献者 */
3647
+ const Entity_Action_Contributors = new InjectionToken('Entity_Action_Contributors');
3648
+ /**实体-属性-贡献者 */
3649
+ const Entity_Props_Contributors = new InjectionToken('Entity_Props_Contributors');
3650
+ const Toolbar_Action_Contributors = new InjectionToken('Toolbar_Action_Contributors');
3651
+ /**
3652
+ * 属性-操作-贡献者-解析器
3653
+ *
3654
+ * 用于放在-routing.module.ts路由守卫中
3655
+ *
3656
+ *
3657
+ const routes: Routes = [
3658
+ {
3659
+ path: 'demo',
3660
+ canActivate: [AuthGuard, PermissionGuard],
3661
+ resolve: [Extensions_Props_Action_Token_Resolver],
3662
+ children: []
3663
+ },
3664
+ ]
3665
+ *
3666
+ *
3667
+ */
3668
+ const Extensions_Props_Action_Token_Resolver = () => {
3669
+ const configState = inject(ConfigStateService);
3670
+ const extensions = inject(ExtensionsService);
3671
+ const config = { optional: true };
3672
+ const actionContributors = inject(Entity_Action_Contributors, config) || {};
3673
+ const propContributors = inject(Entity_Props_Contributors, config) || {};
3674
+ const toolbarContributors = inject(Toolbar_Action_Contributors, config) || {};
3675
+ return getObjectExtensionEntitiesFromStore(configState, 'TenantManagement').pipe(map(entities => ({
3676
+ // [ModuleComponent.AbpTable]: entities.Tenant,
3677
+ })), mapEntitiesToContributors(configState, 'TenantManagement'), tap(objectExtensionContributors => {
3678
+ //actions
3679
+ mergeWithDefaultActions(extensions.entityActions, Default_Entity_Actions, actionContributors);
3680
+ //props
3681
+ mergeWithDefaultProps(extensions.entityProps, Default_Entity_Props, objectExtensionContributors.prop, propContributors);
3682
+ //Toolbar
3683
+ mergeWithDefaultActions(extensions.toolbarActions, Default_Toolbar_Actions, toolbarContributors);
3684
+ }));
3685
+ };
3686
+ // /**
3687
+ // * @deprecated Use `tenantManagementExtensions_Props_Action_Token_Resolver` *function* instead.
3688
+ // */
3689
+ // @Injectable()
3690
+ // export class TenantManagementExtensionsGuard implements IAbpGuard {
3691
+ // protected readonly configState = inject(ConfigStateService);
3692
+ // protected readonly extensions = inject(ExtensionsService);
3693
+ // canActivate(): Observable<boolean> {
3694
+ // const config = { optional: true };
3695
+ // const actionContributors = inject(TENANT_MANAGEMENT_Entity_Action_Contributors, config) || {};
3696
+ // const propContributors = inject(TENANT_MANAGEMENT_Entity_Props_Contributors, config) || {};
3697
+ // return getObjectExtensionEntitiesFromStore(this.configState, 'TenantManagement').pipe(
3698
+ // map(entities => ({
3699
+ // // [eTenantManagementComponents.Tenants]: entities.Tenant,
3700
+ // })),
3701
+ // mapEntitiesToContributors(this.configState, 'TenantManagement'),
3702
+ // tap(objectExtensionContributors => {
3703
+ // mergeWithDefaultActions(
3704
+ // this.extensions.entityActions,
3705
+ // DEFAULT_TENANT_MANAGEMENT_ENTITY_ACTIONS,
3706
+ // actionContributors,
3707
+ // );
3708
+ // mergeWithDefaultProps(
3709
+ // this.extensions.entityProps,
3710
+ // DEFAULT_TENANT_MANAGEMENT_ENTITY_PROPS,
3711
+ // objectExtensionContributors.prop,
3712
+ // propContributors,
3713
+ // );
3714
+ // }),
3715
+ // map(() => true),
3716
+ // );
3717
+ // }
3718
+ // }
3719
+
3720
+ const routes = [
3721
+ {
3722
+ path: 'admin',
3723
+ canActivate: [AuthGuard, PermissionGuard],
3724
+ resolve: [Extensions_Props_Action_Token_Resolver, appentStyle],
3725
+ children: [
3726
+ {
3727
+ path: 'entries',
3728
+ children: [
3729
+ {
3730
+ path: '',
3731
+ component: EntriesComponent,
3732
+ data: { keep: true }
3733
+ },
3734
+ {
3735
+ path: 'create',
3736
+ component: CreateComponent,
3737
+ },
3738
+ {
3739
+ path: ':entrieId/edit',
3740
+ component: EditComponent,
3741
+ },
3742
+ ],
3743
+ },
3744
+ {
3745
+ path: '',
3746
+ children: [
3747
+ {
3748
+ path: 'fields',
3749
+ children: [
3750
+ {
3751
+ path: '',
3752
+ component: FieldsComponent,
3753
+ data: { keep: true }
3754
+ },
3755
+ {
3756
+ path: 'create',
3757
+ component: CreateFieldComponent,
3758
+ },
3759
+ {
3760
+ path: ':id/edit',
3761
+ component: EditFieldComponent,
3762
+ },
3763
+ ],
3764
+ },
3765
+ {
3766
+ path: 'sections',
3767
+ children: [
3768
+ {
3769
+ path: '',
3770
+ data: { keep: true },
3771
+ component: SectionsComponent,
3772
+ },
3773
+ {
3774
+ path: ':sectionsId/entry-types',
3775
+ children: [
3776
+ {
3777
+ path: 'create',
3778
+ component: CreateOrEditComponent,
3779
+ },
3780
+ {
3781
+ path: ':entryTypesId/edit',
3782
+ component: CreateOrEditComponent,
3783
+ },
3784
+ ],
3785
+ },
3786
+ ],
3787
+ },
3788
+ ],
3789
+ },
3790
+ ],
3791
+ },
3792
+ ];
3793
+ class CmsRoutingModule {
3794
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3795
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] }); }
3796
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
3797
+ }
3798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, decorators: [{
3799
+ type: NgModule,
3800
+ args: [{
3801
+ imports: [RouterModule.forChild(routes)],
3802
+ exports: [RouterModule],
3803
+ }]
3804
+ }] });
3805
+
3806
+ class CmsModule {
3807
+ static forChild(options = {}) {
3808
+ return {
3809
+ ngModule: CmsModule,
3810
+ providers: [
3811
+ {
3812
+ provide: Toolbar_Action_Contributors,
3813
+ useValue: options.toolbarActionContributors,
3814
+ },
3815
+ {
3816
+ provide: Entity_Action_Contributors,
3817
+ useValue: options.entityActionContributors,
3818
+ },
3819
+ {
3820
+ provide: Entity_Props_Contributors,
3821
+ useValue: options.entityPropContributors,
3822
+ },
3823
+ ],
3824
+ };
3825
+ }
3826
+ static forLazy(options = {}) {
3827
+ return new LazyModuleFactory(CmsModule.forChild(options));
3828
+ }
3829
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3830
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, declarations: [EntriesComponent,
3831
+ FieldsComponent,
3832
+ SectionsComponent,
3833
+ FieldGroupComponent,
3834
+ CreateFieldComponent,
3835
+ EditFieldComponent,
3836
+ CreateOrEditFieldComponent,
3837
+ CreateOrEditComponent,
3838
+ CreateComponent,
3839
+ EditComponent,
3840
+ CreateOrEditEntriesComponent,
3841
+ TableConfigComponent,
3842
+ TableControlComponent,
3843
+ MatrixConfigComponent,
3844
+ MatrixControlComponent,
3845
+ EntryConfigComponent,
3846
+ EntryControlComponent], imports: [CoreModule,
3847
+ ThemeSharedModule,
3848
+ FormsModule,
3849
+ CmsRoutingModule,
3850
+ NgbNavModule,
3851
+ NgbAccordionModule,
3852
+ NgbDropdownModule,
3853
+ PageModule,
3854
+ NzSelectModule, i8$1.DynamicFormModule, ExtensibleModule], exports: [TableConfigComponent,
3855
+ TableControlComponent,
3856
+ MatrixConfigComponent,
3857
+ MatrixControlComponent,
3858
+ EntryConfigComponent,
3859
+ EntryControlComponent] }); }
3860
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, imports: [CoreModule,
3861
+ ThemeSharedModule,
3862
+ FormsModule,
3863
+ CmsRoutingModule,
3864
+ NgbNavModule,
3865
+ NgbAccordionModule,
3866
+ NgbDropdownModule,
3867
+ PageModule,
3868
+ NzSelectModule,
3869
+ DynamicFormModule.forRoot({
3870
+ cmsFieldControlGroup: [...FieldControlGroup, ...fielFieldControlGroup, ...ckEditorFieldControlGroup]
3871
+ }),
3872
+ ExtensibleModule] }); }
3873
+ }
3874
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, decorators: [{
3875
+ type: NgModule,
3876
+ args: [{
3877
+ declarations: [
3878
+ EntriesComponent,
3879
+ FieldsComponent,
3880
+ SectionsComponent,
3881
+ FieldGroupComponent,
3882
+ CreateFieldComponent,
3883
+ EditFieldComponent,
3884
+ CreateOrEditFieldComponent,
3885
+ CreateOrEditComponent,
3886
+ CreateComponent,
3887
+ EditComponent,
3888
+ CreateOrEditEntriesComponent,
3889
+ TableConfigComponent,
3890
+ TableControlComponent,
3891
+ MatrixConfigComponent,
3892
+ MatrixControlComponent,
3893
+ EntryConfigComponent,
3894
+ EntryControlComponent,
3895
+ ],
3896
+ imports: [
3897
+ CoreModule,
3898
+ ThemeSharedModule,
3899
+ FormsModule,
3900
+ CmsRoutingModule,
3901
+ NgbNavModule,
3902
+ NgbAccordionModule,
3903
+ NgbDropdownModule,
3904
+ PageModule,
3905
+ NzSelectModule,
3906
+ DynamicFormModule.forRoot({
3907
+ cmsFieldControlGroup: [...FieldControlGroup, ...fielFieldControlGroup, ...ckEditorFieldControlGroup]
3908
+ }),
3909
+ ExtensibleModule
3910
+ ],
3911
+ exports: [
3912
+ TableConfigComponent,
3913
+ TableControlComponent,
3914
+ MatrixConfigComponent,
3915
+ MatrixControlComponent,
3916
+ EntryConfigComponent,
3917
+ EntryControlComponent,
3918
+ ],
3919
+ providers: [],
3920
+ }]
3921
+ }] });
3922
+
3923
+ /*
3924
+ * Public API Surface of cms
3925
+ */
3926
+
3927
+ /**
3928
+ * Generated bundle index. Do not edit.
3929
+ */
3930
+
3931
+ export { CmsModule, EntryConfig, EntryConfigComponent, EntryControlComponent, FieldControlGroup, MatrixConfig, MatrixConfigComponent, MatrixControlComponent, MatrixItemConfig, TableConfig, TableConfigComponent, TableControlComponent, TableFormControl, matrixFieldInputBase };
3932
+ //# sourceMappingURL=dignite-ng-expand.cms.mjs.map