@dignite-ng/expand.cms 2.0.0-rc.10 → 2.0.0-rc.11

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