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

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