@dignite-ng/expand.cms 0.0.51 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (448) hide show
  1. package/config/ng-package.json +6 -0
  2. package/config/src/cms-config.module.ts +12 -0
  3. package/config/src/components/domains/domains.component.html +17 -0
  4. package/config/src/components/domains/domains.component.scss +0 -0
  5. package/config/src/components/domains/domains.component.spec.ts +21 -0
  6. package/config/src/components/domains/domains.component.ts +109 -0
  7. package/config/src/components/site-language/site-language.component.html +31 -0
  8. package/config/src/components/site-language/site-language.component.scss +0 -0
  9. package/config/src/components/site-language/site-language.component.spec.ts +21 -0
  10. package/config/src/components/site-language/site-language.component.ts +117 -0
  11. package/config/{enums/index.d.ts → src/enums/index.ts} +1 -1
  12. package/config/src/enums/route-names.ts +8 -0
  13. package/config/{providers/index.d.ts → src/providers/index.ts} +1 -1
  14. package/config/src/providers/route.provider.ts +82 -0
  15. package/config/src/proxy/admin/domains/domain-admin.service.ts +38 -0
  16. package/config/{proxy/admin/domains/models.d.ts → src/proxy/admin/domains/models.ts} +9 -7
  17. package/config/src/proxy/dignite/abp/data/index.ts +1 -0
  18. package/config/src/proxy/dignite/abp/data/models.ts +4 -0
  19. package/config/src/proxy/dignite/abp/index.ts +2 -0
  20. package/config/src/proxy/dignite/cms/admin/domains/domain-admin.service.ts +47 -0
  21. package/config/src/proxy/dignite/cms/admin/domains/index.ts +2 -0
  22. package/config/src/proxy/dignite/cms/admin/domains/models.ts +9 -0
  23. package/config/src/proxy/dignite/cms/admin/dynamic-forms/form-admin.service.ts +21 -0
  24. package/config/src/proxy/dignite/cms/admin/dynamic-forms/models.ts +5 -0
  25. package/config/src/proxy/dignite/cms/admin/entries/entry-admin.service.ts +109 -0
  26. package/config/src/proxy/dignite/cms/admin/entries/models.ts +68 -0
  27. package/config/src/proxy/dignite/cms/admin/fields/field-admin.service.ts +64 -0
  28. package/config/src/proxy/dignite/cms/admin/fields/field-group-admin.service.ts +56 -0
  29. package/config/src/proxy/dignite/cms/admin/fields/models.ts +42 -0
  30. package/config/src/proxy/dignite/cms/admin/index.ts +7 -0
  31. package/config/src/proxy/dignite/cms/admin/sections/entry-type-admin.service.ts +55 -0
  32. package/{lib/proxy/admin/sections/models.d.ts → config/src/proxy/dignite/cms/admin/sections/models.ts} +81 -67
  33. package/config/src/proxy/dignite/cms/admin/sections/section-admin.service.ts +74 -0
  34. package/config/src/proxy/dignite/cms/admin/sites/models.ts +5 -0
  35. package/config/src/proxy/dignite/cms/admin/sites/site-admin.service.ts +30 -0
  36. package/config/src/proxy/dignite/cms/entries/entry-status.enum.ts +8 -0
  37. package/config/src/proxy/dignite/cms/fields/index.ts +1 -0
  38. package/config/src/proxy/dignite/cms/fields/models.ts +9 -0
  39. package/config/src/proxy/dignite/cms/index.ts +6 -0
  40. package/config/src/proxy/dignite/cms/sections/models.ts +14 -0
  41. package/config/src/proxy/dignite/cms/sections/section-type.enum.ts +9 -0
  42. package/config/src/proxy/dignite/cms/sites/index.ts +1 -0
  43. package/config/src/proxy/dignite/cms/sites/models.ts +5 -0
  44. package/config/src/proxy/dignite/cms-kit/admin/brand/brand-admin.service.ts +21 -0
  45. package/config/src/proxy/dignite/cms-kit/admin/brand/index.ts +2 -0
  46. package/config/src/proxy/dignite/cms-kit/admin/brand/models.ts +7 -0
  47. package/config/src/proxy/dignite/cms-kit/admin/index.ts +2 -0
  48. package/config/src/proxy/dignite/cms-kit/brand/brand.service.ts +20 -0
  49. package/config/src/proxy/dignite/cms-kit/brand/index.ts +2 -0
  50. package/config/src/proxy/dignite/cms-kit/brand/models.ts +7 -0
  51. package/config/src/proxy/dignite/cms-kit/index.ts +3 -0
  52. package/config/src/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +65 -0
  53. package/config/src/proxy/dignite/file-explorer/directories/index.ts +2 -0
  54. package/config/src/proxy/dignite/file-explorer/directories/models.ts +35 -0
  55. package/config/src/proxy/dignite/file-explorer/files/file-descriptor.service.ts +101 -0
  56. package/config/src/proxy/dignite/file-explorer/files/index.ts +2 -0
  57. package/config/src/proxy/dignite/file-explorer/files/models.ts +61 -0
  58. package/config/src/proxy/dignite/file-explorer/index.ts +3 -0
  59. package/config/src/proxy/dignite/index.ts +6 -0
  60. package/config/src/proxy/dignite/travely/areas/index.ts +1 -0
  61. package/config/src/proxy/dignite/travely/areas/models.ts +5 -0
  62. package/config/src/proxy/dignite/travely/common/index.ts +1 -0
  63. package/config/src/proxy/dignite/travely/common/models.ts +5 -0
  64. package/config/src/proxy/dignite/travely/entity-snapshots/index.ts +1 -0
  65. package/config/src/proxy/dignite/travely/entity-snapshots/models.ts +7 -0
  66. package/config/src/proxy/dignite/travely/guides/index.ts +1 -0
  67. package/config/src/proxy/dignite/travely/guides/models.ts +26 -0
  68. package/config/src/proxy/dignite/travely/index.ts +9 -0
  69. package/config/src/proxy/dignite/travely/merchants/index.ts +1 -0
  70. package/config/src/proxy/dignite/travely/merchants/models.ts +9 -0
  71. package/config/src/proxy/dignite/travely/orders/index.ts +1 -0
  72. package/config/src/proxy/dignite/travely/orders/models.ts +52 -0
  73. package/config/src/proxy/dignite/travely/payment/index.ts +1 -0
  74. package/config/src/proxy/dignite/travely/payment/models.ts +9 -0
  75. package/config/src/proxy/dignite/travely/tours/booking-time-type.enum.ts +9 -0
  76. package/config/src/proxy/dignite/travely/tours/index.ts +5 -0
  77. package/config/src/proxy/dignite/travely/tours/models.ts +77 -0
  78. package/config/src/proxy/dignite/travely/tours/period-type.enum.ts +9 -0
  79. package/config/src/proxy/dignite/travely/tours/tour-recommendation-rank.enum.ts +12 -0
  80. package/config/src/proxy/dignite/travely/tours/tourist-type.enum.ts +8 -0
  81. package/config/src/proxy/microsoft/asp-net-core/index.ts +2 -0
  82. package/config/src/proxy/microsoft/asp-net-core/mvc/index.ts +1 -0
  83. package/config/src/proxy/microsoft/asp-net-core/mvc/models.ts +12 -0
  84. package/config/src/proxy/microsoft/extensions/index.ts +2 -0
  85. package/config/src/proxy/microsoft/extensions/primitives/index.ts +1 -0
  86. package/config/src/proxy/microsoft/extensions/primitives/models.ts +9 -0
  87. package/config/src/proxy/microsoft/index.ts +4 -0
  88. package/config/src/proxy/microsoft/net/http/headers/index.ts +1 -0
  89. package/config/src/proxy/microsoft/net/http/headers/models.ts +7 -0
  90. package/config/src/proxy/microsoft/net/http/index.ts +2 -0
  91. package/config/src/proxy/microsoft/net/index.ts +2 -0
  92. package/config/{public-api.d.ts → src/public-api.ts} +3 -3
  93. package/config/src/services/validators.service.ts +80 -0
  94. package/ng-package.json +10 -0
  95. package/package.json +7 -22
  96. package/src/lib/cms-routing.module.ts +102 -0
  97. package/src/lib/cms.module.ts +109 -0
  98. package/src/lib/components/admin/entries/create-or-edit-entries.component.html +137 -0
  99. package/src/lib/components/admin/entries/create-or-edit-entries.component.scss +1 -0
  100. package/src/lib/components/admin/entries/create-or-edit-entries.component.spec.ts +21 -0
  101. package/src/lib/components/admin/entries/create-or-edit-entries.component.ts +318 -0
  102. package/src/lib/components/admin/entries/create-or-update-entry-input-base.ts +33 -0
  103. package/src/lib/components/admin/entries/create.component.html +13 -0
  104. package/src/lib/components/admin/entries/create.component.scss +1 -0
  105. package/src/lib/components/admin/entries/create.component.spec.ts +21 -0
  106. package/src/lib/components/admin/entries/create.component.ts +110 -0
  107. package/src/lib/components/admin/entries/edit.component.html +9 -0
  108. package/src/lib/components/admin/entries/edit.component.scss +1 -0
  109. package/src/lib/components/admin/entries/edit.component.spec.ts +21 -0
  110. package/src/lib/components/admin/entries/edit.component.ts +111 -0
  111. package/src/lib/components/admin/entries/entries.component.html +112 -0
  112. package/src/lib/components/admin/entries/entries.component.scss +1 -0
  113. package/src/lib/components/admin/entries/entries.component.spec.ts +21 -0
  114. package/src/lib/components/admin/entries/entries.component.ts +216 -0
  115. package/src/lib/components/admin/entries/index.ts +4 -0
  116. package/src/lib/components/admin/fields/create-field.component.html +12 -0
  117. package/src/lib/components/admin/fields/create-field.component.scss +1 -0
  118. package/src/lib/components/admin/fields/create-field.component.spec.ts +21 -0
  119. package/src/lib/components/admin/fields/create-field.component.ts +82 -0
  120. package/src/lib/components/admin/fields/create-or-edit-field.component.html +40 -0
  121. package/src/lib/components/admin/fields/create-or-edit-field.component.scss +0 -0
  122. package/src/lib/components/admin/fields/create-or-edit-field.component.spec.ts +21 -0
  123. package/src/lib/components/admin/fields/create-or-edit-field.component.ts +121 -0
  124. package/src/lib/components/admin/fields/create-or-update-field-input-base.ts +33 -0
  125. package/src/lib/components/admin/fields/edit-field.component.html +16 -0
  126. package/src/lib/components/admin/fields/edit-field.component.scss +0 -0
  127. package/src/lib/components/admin/fields/edit-field.component.spec.ts +21 -0
  128. package/src/lib/components/admin/fields/edit-field.component.ts +101 -0
  129. package/src/lib/components/admin/fields/field-group.component.html +69 -0
  130. package/src/lib/components/admin/fields/field-group.component.scss +0 -0
  131. package/src/lib/components/admin/fields/field-group.component.spec.ts +21 -0
  132. package/src/lib/components/admin/fields/field-group.component.ts +151 -0
  133. package/src/lib/components/admin/fields/fields.component.html +74 -0
  134. package/src/lib/components/admin/fields/fields.component.scss +1 -0
  135. package/src/lib/components/admin/fields/fields.component.spec.ts +21 -0
  136. package/src/lib/components/admin/fields/fields.component.ts +109 -0
  137. package/src/lib/components/admin/fields/index.ts +6 -0
  138. package/src/lib/components/admin/index.ts +3 -0
  139. package/src/lib/components/admin/sections/create-or-update-sections-input-base.ts +32 -0
  140. package/src/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.ts +79 -0
  141. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.html +187 -0
  142. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.scss +1 -0
  143. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.spec.ts +21 -0
  144. package/src/lib/components/admin/sections/entry-types/create-or-edit.component.ts +424 -0
  145. package/src/lib/components/admin/sections/entry-types/index.ts +2 -0
  146. package/src/lib/components/admin/sections/index.ts +3 -0
  147. package/src/lib/components/admin/sections/sections.component.html +188 -0
  148. package/src/lib/components/admin/sections/sections.component.scss +1 -0
  149. package/src/lib/components/admin/sections/sections.component.spec.ts +21 -0
  150. package/src/lib/components/admin/sections/sections.component.ts +302 -0
  151. package/src/lib/components/dynamic-form/entry/entry-config.component.html +36 -0
  152. package/src/lib/components/dynamic-form/entry/entry-config.component.scss +27 -0
  153. package/src/lib/components/dynamic-form/entry/entry-config.component.spec.ts +21 -0
  154. package/src/lib/components/dynamic-form/entry/entry-config.component.ts +114 -0
  155. package/src/lib/components/dynamic-form/entry/entry-config.ts +24 -0
  156. package/src/lib/components/dynamic-form/entry/entry-control.component.html +26 -0
  157. package/src/lib/components/dynamic-form/entry/entry-control.component.scss +1 -0
  158. package/src/lib/components/dynamic-form/entry/entry-control.component.spec.ts +21 -0
  159. package/src/lib/components/dynamic-form/entry/entry-control.component.ts +111 -0
  160. package/src/lib/components/dynamic-form/entry/index.ts +3 -0
  161. package/src/lib/components/dynamic-form/form-control-group.ts +27 -0
  162. package/src/lib/components/dynamic-form/index.ts +4 -0
  163. package/src/lib/components/dynamic-form/matrix/index.ts +3 -0
  164. package/src/lib/components/dynamic-form/matrix/matrix-config.component.html +148 -0
  165. package/src/lib/components/dynamic-form/matrix/matrix-config.component.scss +0 -0
  166. package/src/lib/components/dynamic-form/matrix/matrix-config.component.spec.ts +21 -0
  167. package/src/lib/components/dynamic-form/matrix/matrix-config.component.ts +239 -0
  168. package/src/lib/components/dynamic-form/matrix/matrix-config.ts +63 -0
  169. package/src/lib/components/dynamic-form/matrix/matrix-control.component.html +42 -0
  170. package/src/lib/components/dynamic-form/matrix/matrix-control.component.scss +0 -0
  171. package/src/lib/components/dynamic-form/matrix/matrix-control.component.spec.ts +21 -0
  172. package/src/lib/components/dynamic-form/matrix/matrix-control.component.ts +106 -0
  173. package/src/lib/components/dynamic-form/table/index.ts +3 -0
  174. package/src/lib/components/dynamic-form/table/table-config.component.html +85 -0
  175. package/src/lib/components/dynamic-form/table/table-config.component.scss +10 -0
  176. package/src/lib/components/dynamic-form/table/table-config.component.spec.ts +21 -0
  177. package/src/lib/components/dynamic-form/table/table-config.component.ts +170 -0
  178. package/src/lib/components/dynamic-form/table/table-config.ts +45 -0
  179. package/src/lib/components/dynamic-form/table/table-control.component.html +54 -0
  180. package/src/lib/components/dynamic-form/table/table-control.component.scss +1 -0
  181. package/src/lib/components/dynamic-form/table/table-control.component.spec.ts +21 -0
  182. package/src/lib/components/dynamic-form/table/table-control.component.ts +114 -0
  183. package/src/lib/components/index.ts +2 -0
  184. package/src/lib/constants/index.ts +1 -0
  185. package/src/lib/constants/styles.ts +20 -0
  186. package/src/lib/enums/ecms-component.ts +11 -0
  187. package/src/lib/enums/index.ts +1 -0
  188. package/src/lib/proxy/README.md +17 -0
  189. package/src/lib/proxy/admin/domains/domain-admin.service.ts +38 -0
  190. package/src/lib/proxy/admin/domains/index.ts +2 -0
  191. package/src/lib/proxy/admin/domains/models.ts +9 -0
  192. package/src/lib/proxy/admin/dynamic-forms/form-admin.service.ts +21 -0
  193. package/src/lib/proxy/admin/dynamic-forms/index.ts +2 -0
  194. package/src/lib/proxy/admin/dynamic-forms/models.ts +5 -0
  195. package/src/lib/proxy/admin/entries/entry-admin.service.ts +109 -0
  196. package/src/lib/proxy/admin/entries/index.ts +2 -0
  197. package/src/lib/proxy/admin/entries/models.ts +68 -0
  198. package/src/lib/proxy/admin/fields/field-admin.service.ts +64 -0
  199. package/src/lib/proxy/admin/fields/field-group-admin.service.ts +56 -0
  200. package/src/lib/proxy/admin/fields/index.ts +3 -0
  201. package/{lib/proxy/admin/fields/models.d.ts → src/lib/proxy/admin/fields/models.ts} +42 -34
  202. package/src/lib/proxy/admin/index.ts +7 -0
  203. package/src/lib/proxy/admin/sections/entry-type-admin.service.ts +55 -0
  204. package/src/lib/proxy/admin/sections/index.ts +3 -0
  205. package/src/lib/proxy/admin/sections/models.ts +81 -0
  206. package/src/lib/proxy/admin/sections/section-admin.service.ts +74 -0
  207. package/src/lib/proxy/admin/settings/site-settings-admin.service.ts +37 -0
  208. package/src/lib/proxy/dignite/abp/data/index.ts +1 -0
  209. package/src/lib/proxy/dignite/abp/data/models.ts +4 -0
  210. package/src/lib/proxy/dignite/abp/index.ts +2 -0
  211. package/src/lib/proxy/dignite/file-explorer/directories/file-descriptor.service.ts +65 -0
  212. package/src/lib/proxy/dignite/file-explorer/directories/index.ts +2 -0
  213. package/src/lib/proxy/dignite/file-explorer/directories/models.ts +35 -0
  214. package/src/lib/proxy/dignite/file-explorer/files/file-descriptor.service.ts +86 -0
  215. package/src/lib/proxy/dignite/file-explorer/files/index.ts +2 -0
  216. package/src/lib/proxy/dignite/file-explorer/files/models.ts +58 -0
  217. package/src/lib/proxy/dignite/file-explorer/index.ts +3 -0
  218. package/src/lib/proxy/dignite/index.ts +3 -0
  219. package/src/lib/proxy/entries/entry-status.enum.ts +8 -0
  220. package/src/lib/proxy/entries/index.ts +1 -0
  221. package/src/lib/proxy/fields/index.ts +1 -0
  222. package/src/lib/proxy/fields/models.ts +9 -0
  223. package/src/lib/proxy/generate-proxy.json +11425 -0
  224. package/src/lib/proxy/index.ts +9 -0
  225. package/src/lib/proxy/microsoft/asp-net-core/index.ts +2 -0
  226. package/src/lib/proxy/microsoft/asp-net-core/mvc/index.ts +1 -0
  227. package/src/lib/proxy/microsoft/asp-net-core/mvc/models.ts +12 -0
  228. package/src/lib/proxy/microsoft/extensions/index.ts +2 -0
  229. package/src/lib/proxy/microsoft/extensions/primitives/index.ts +1 -0
  230. package/src/lib/proxy/microsoft/extensions/primitives/models.ts +9 -0
  231. package/src/lib/proxy/microsoft/index.ts +4 -0
  232. package/src/lib/proxy/microsoft/net/http/headers/index.ts +1 -0
  233. package/src/lib/proxy/microsoft/net/http/headers/models.ts +7 -0
  234. package/src/lib/proxy/microsoft/net/http/index.ts +2 -0
  235. package/src/lib/proxy/microsoft/net/index.ts +2 -0
  236. package/src/lib/proxy/sections/index.ts +2 -0
  237. package/src/lib/proxy/sections/models.ts +14 -0
  238. package/src/lib/proxy/sections/section-type.enum.ts +9 -0
  239. package/src/lib/proxy/settings/index.ts +1 -0
  240. package/src/lib/proxy/settings/models.ts +6 -0
  241. package/src/lib/proxy/volo/abp/content/index.ts +1 -0
  242. package/src/lib/proxy/volo/abp/content/models.ts +6 -0
  243. package/src/lib/proxy/volo/abp/index.ts +2 -0
  244. package/src/lib/proxy/volo/cms-kit/index.ts +2 -0
  245. package/src/lib/proxy/volo/cms-kit/users/index.ts +1 -0
  246. package/{lib/proxy/volo/cms-kit/users/models.d.ts → src/lib/proxy/volo/cms-kit/users/models.ts} +8 -7
  247. package/src/lib/proxy/volo/index.ts +3 -0
  248. package/src/lib/resolvers/extensions-props-action-token.resolver.ts +178 -0
  249. package/src/lib/resolvers/page-default-toolbar-actions.ts +170 -0
  250. package/src/lib/resolvers/table-default-entity-actions.ts +24 -0
  251. package/src/lib/resolvers/table-default-entity-props.ts +36 -0
  252. package/src/lib/services/appent-content.ts +13 -0
  253. package/src/lib/services/cms-api.service.ts +71 -0
  254. package/src/lib/services/cms.service.ts +18 -0
  255. package/src/lib/services/field-abstracts.service.ts +40 -0
  256. package/src/lib/services/index.ts +4 -0
  257. package/src/lib/services/simple-reuse-strategy.ts +74 -0
  258. package/src/lib/services/update-list.service.ts +15 -0
  259. package/src/lib/services/validators.service.ts +82 -0
  260. package/{public-api.d.ts → src/public-api.ts} +6 -2
  261. package/src/test.ts +26 -0
  262. package/tsconfig.lib.json +16 -0
  263. package/tsconfig.lib.prod.json +10 -0
  264. package/tsconfig.spec.json +17 -0
  265. package/config/cms-config.module.d.ts +0 -8
  266. package/config/components/domains/domains.component.d.ts +0 -29
  267. package/config/components/site-language/site-language.component.d.ts +0 -29
  268. package/config/enums/route-names.d.ts +0 -8
  269. package/config/index.d.ts +0 -5
  270. package/config/providers/route.provider.d.ts +0 -9
  271. package/config/proxy/admin/domains/domain-admin.service.d.ts +0 -13
  272. package/config/proxy/dignite/cms/admin/sites/models.d.ts +0 -4
  273. package/config/proxy/dignite/cms/admin/sites/site-admin.service.d.ts +0 -13
  274. package/config/proxy/dignite/cms/sites/models.d.ts +0 -4
  275. package/config/services/validators.service.d.ts +0 -16
  276. package/esm2022/config/cms-config.module.mjs +0 -18
  277. package/esm2022/config/components/domains/domains.component.mjs +0 -102
  278. package/esm2022/config/components/site-language/site-language.component.mjs +0 -108
  279. package/esm2022/config/dignite-ng-expand.cms-config.mjs +0 -5
  280. package/esm2022/config/enums/index.mjs +0 -2
  281. package/esm2022/config/enums/route-names.mjs +0 -10
  282. package/esm2022/config/providers/index.mjs +0 -2
  283. package/esm2022/config/providers/route.provider.mjs +0 -74
  284. package/esm2022/config/proxy/admin/domains/domain-admin.service.mjs +0 -32
  285. package/esm2022/config/proxy/admin/domains/index.mjs +0 -3
  286. package/esm2022/config/proxy/admin/domains/models.mjs +0 -2
  287. package/esm2022/config/proxy/dignite/cms/admin/sites/index.mjs +0 -3
  288. package/esm2022/config/proxy/dignite/cms/admin/sites/models.mjs +0 -2
  289. package/esm2022/config/proxy/dignite/cms/admin/sites/site-admin.service.mjs +0 -27
  290. package/esm2022/config/proxy/dignite/cms/sites/models.mjs +0 -2
  291. package/esm2022/config/public-api.mjs +0 -4
  292. package/esm2022/config/services/validators.service.mjs +0 -83
  293. package/esm2022/dignite-ng-expand.cms.mjs +0 -5
  294. package/esm2022/lib/cms-routing.module.mjs +0 -94
  295. package/esm2022/lib/cms.module.mjs +0 -130
  296. package/esm2022/lib/components/admin/entries/create-or-edit-entries.component.mjs +0 -303
  297. package/esm2022/lib/components/admin/entries/create-or-update-entry-input-base.mjs +0 -32
  298. package/esm2022/lib/components/admin/entries/create.component.mjs +0 -108
  299. package/esm2022/lib/components/admin/entries/edit.component.mjs +0 -109
  300. package/esm2022/lib/components/admin/entries/entries.component.mjs +0 -198
  301. package/esm2022/lib/components/admin/entries/index.mjs +0 -5
  302. package/esm2022/lib/components/admin/fields/create-field.component.mjs +0 -80
  303. package/esm2022/lib/components/admin/fields/create-or-edit-field.component.mjs +0 -112
  304. package/esm2022/lib/components/admin/fields/create-or-update-field-input-base.mjs +0 -25
  305. package/esm2022/lib/components/admin/fields/edit-field.component.mjs +0 -103
  306. package/esm2022/lib/components/admin/fields/field-group.component.mjs +0 -131
  307. package/esm2022/lib/components/admin/fields/fields.component.mjs +0 -109
  308. package/esm2022/lib/components/admin/fields/index.mjs +0 -7
  309. package/esm2022/lib/components/admin/index.mjs +0 -4
  310. package/esm2022/lib/components/admin/sections/create-or-update-sections-input-base.mjs +0 -27
  311. package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.mjs +0 -71
  312. package/esm2022/lib/components/admin/sections/entry-types/create-or-edit.component.mjs +0 -389
  313. package/esm2022/lib/components/admin/sections/entry-types/index.mjs +0 -3
  314. package/esm2022/lib/components/admin/sections/index.mjs +0 -4
  315. package/esm2022/lib/components/admin/sections/sections.component.mjs +0 -292
  316. package/esm2022/lib/components/dynamic-form/entry/entry-config.component.mjs +0 -112
  317. package/esm2022/lib/components/dynamic-form/entry/entry-config.mjs +0 -18
  318. package/esm2022/lib/components/dynamic-form/entry/entry-control.component.mjs +0 -105
  319. package/esm2022/lib/components/dynamic-form/entry/index.mjs +0 -4
  320. package/esm2022/lib/components/dynamic-form/form-control-group.mjs +0 -28
  321. package/esm2022/lib/components/dynamic-form/index.mjs +0 -5
  322. package/esm2022/lib/components/dynamic-form/matrix/index.mjs +0 -4
  323. package/esm2022/lib/components/dynamic-form/matrix/matrix-config.component.mjs +0 -214
  324. package/esm2022/lib/components/dynamic-form/matrix/matrix-config.mjs +0 -50
  325. package/esm2022/lib/components/dynamic-form/matrix/matrix-control.component.mjs +0 -98
  326. package/esm2022/lib/components/dynamic-form/table/index.mjs +0 -4
  327. package/esm2022/lib/components/dynamic-form/table/table-config.component.mjs +0 -151
  328. package/esm2022/lib/components/dynamic-form/table/table-config.mjs +0 -38
  329. package/esm2022/lib/components/dynamic-form/table/table-control.component.mjs +0 -105
  330. package/esm2022/lib/components/index.mjs +0 -3
  331. package/esm2022/lib/constants/styles.mjs +0 -21
  332. package/esm2022/lib/enums/ecms-component.mjs +0 -13
  333. package/esm2022/lib/enums/index.mjs +0 -2
  334. package/esm2022/lib/proxy/admin/dynamic-forms/form-admin.service.mjs +0 -22
  335. package/esm2022/lib/proxy/admin/dynamic-forms/index.mjs +0 -3
  336. package/esm2022/lib/proxy/admin/dynamic-forms/models.mjs +0 -2
  337. package/esm2022/lib/proxy/admin/entries/entry-admin.service.mjs +0 -70
  338. package/esm2022/lib/proxy/admin/entries/index.mjs +0 -3
  339. package/esm2022/lib/proxy/admin/entries/models.mjs +0 -2
  340. package/esm2022/lib/proxy/admin/fields/field-admin.service.mjs +0 -45
  341. package/esm2022/lib/proxy/admin/fields/field-group-admin.service.mjs +0 -41
  342. package/esm2022/lib/proxy/admin/fields/index.mjs +0 -4
  343. package/esm2022/lib/proxy/admin/fields/models.mjs +0 -2
  344. package/esm2022/lib/proxy/admin/sections/entry-type-admin.service.mjs +0 -41
  345. package/esm2022/lib/proxy/admin/sections/index.mjs +0 -4
  346. package/esm2022/lib/proxy/admin/sections/models.mjs +0 -2
  347. package/esm2022/lib/proxy/admin/sections/section-admin.service.mjs +0 -51
  348. package/esm2022/lib/proxy/admin/settings/index.mjs +0 -2
  349. package/esm2022/lib/proxy/admin/settings/site-settings-admin.service.mjs +0 -31
  350. package/esm2022/lib/proxy/dignite/abp/data/models.mjs +0 -2
  351. package/esm2022/lib/proxy/entries/entry-status.enum.mjs +0 -8
  352. package/esm2022/lib/proxy/entries/index.mjs +0 -2
  353. package/esm2022/lib/proxy/fields/models.mjs +0 -2
  354. package/esm2022/lib/proxy/sections/index.mjs +0 -3
  355. package/esm2022/lib/proxy/sections/models.mjs +0 -2
  356. package/esm2022/lib/proxy/sections/section-type.enum.mjs +0 -9
  357. package/esm2022/lib/proxy/settings/models.mjs +0 -2
  358. package/esm2022/lib/proxy/volo/cms-kit/users/models.mjs +0 -2
  359. package/esm2022/lib/resolvers/extensions-props-action-token.resolver.mjs +0 -132
  360. package/esm2022/lib/resolvers/page-default-toolbar-actions.mjs +0 -160
  361. package/esm2022/lib/services/appent-content.mjs +0 -15
  362. package/esm2022/lib/services/cms-api.service.mjs +0 -78
  363. package/esm2022/lib/services/cms.service.mjs +0 -21
  364. package/esm2022/lib/services/field-abstracts.service.mjs +0 -42
  365. package/esm2022/lib/services/index.mjs +0 -5
  366. package/esm2022/lib/services/simple-reuse-strategy.mjs +0 -64
  367. package/esm2022/lib/services/update-list.service.mjs +0 -19
  368. package/esm2022/lib/services/validators.service.mjs +0 -85
  369. package/esm2022/public-api.mjs +0 -6
  370. package/fesm2022/dignite-ng-expand.cms-config.mjs +0 -428
  371. package/fesm2022/dignite-ng-expand.cms-config.mjs.map +0 -1
  372. package/fesm2022/dignite-ng-expand.cms.mjs +0 -3913
  373. package/fesm2022/dignite-ng-expand.cms.mjs.map +0 -1
  374. package/index.d.ts +0 -5
  375. package/lib/cms-routing.module.d.ts +0 -7
  376. package/lib/cms.module.d.ts +0 -34
  377. package/lib/components/admin/entries/create-or-edit-entries.component.d.ts +0 -96
  378. package/lib/components/admin/entries/create-or-update-entry-input-base.d.ts +0 -23
  379. package/lib/components/admin/entries/create.component.d.ts +0 -47
  380. package/lib/components/admin/entries/edit.component.d.ts +0 -47
  381. package/lib/components/admin/entries/entries.component.d.ts +0 -66
  382. package/lib/components/admin/entries/index.d.ts +0 -4
  383. package/lib/components/admin/fields/create-field.component.d.ts +0 -37
  384. package/lib/components/admin/fields/create-or-edit-field.component.d.ts +0 -38
  385. package/lib/components/admin/fields/create-or-update-field-input-base.d.ts +0 -16
  386. package/lib/components/admin/fields/edit-field.component.d.ts +0 -46
  387. package/lib/components/admin/fields/field-group.component.d.ts +0 -58
  388. package/lib/components/admin/fields/fields.component.d.ts +0 -35
  389. package/lib/components/admin/fields/index.d.ts +0 -6
  390. package/lib/components/admin/index.d.ts +0 -3
  391. package/lib/components/admin/sections/create-or-update-sections-input-base.d.ts +0 -17
  392. package/lib/components/admin/sections/entry-types/create-or-edit.-entry-type-input-base.d.ts +0 -38
  393. package/lib/components/admin/sections/entry-types/create-or-edit.component.d.ts +0 -138
  394. package/lib/components/admin/sections/entry-types/index.d.ts +0 -2
  395. package/lib/components/admin/sections/index.d.ts +0 -3
  396. package/lib/components/admin/sections/sections.component.d.ts +0 -64
  397. package/lib/components/dynamic-form/entry/entry-config.component.d.ts +0 -39
  398. package/lib/components/dynamic-form/entry/entry-config.d.ts +0 -9
  399. package/lib/components/dynamic-form/entry/entry-control.component.d.ts +0 -35
  400. package/lib/components/dynamic-form/entry/index.d.ts +0 -3
  401. package/lib/components/dynamic-form/form-control-group.d.ts +0 -4
  402. package/lib/components/dynamic-form/index.d.ts +0 -4
  403. package/lib/components/dynamic-form/matrix/index.d.ts +0 -3
  404. package/lib/components/dynamic-form/matrix/matrix-config.component.d.ts +0 -73
  405. package/lib/components/dynamic-form/matrix/matrix-config.d.ts +0 -24
  406. package/lib/components/dynamic-form/matrix/matrix-control.component.d.ts +0 -39
  407. package/lib/components/dynamic-form/table/index.d.ts +0 -3
  408. package/lib/components/dynamic-form/table/table-config.component.d.ts +0 -58
  409. package/lib/components/dynamic-form/table/table-config.d.ts +0 -18
  410. package/lib/components/dynamic-form/table/table-control.component.d.ts +0 -39
  411. package/lib/components/index.d.ts +0 -2
  412. package/lib/constants/styles.d.ts +0 -2
  413. package/lib/enums/ecms-component.d.ts +0 -11
  414. package/lib/enums/index.d.ts +0 -1
  415. package/lib/proxy/admin/dynamic-forms/form-admin.service.d.ts +0 -12
  416. package/lib/proxy/admin/dynamic-forms/models.d.ts +0 -4
  417. package/lib/proxy/admin/entries/entry-admin.service.d.ts +0 -22
  418. package/lib/proxy/admin/entries/models.d.ts +0 -60
  419. package/lib/proxy/admin/fields/field-admin.service.d.ts +0 -17
  420. package/lib/proxy/admin/fields/field-group-admin.service.d.ts +0 -16
  421. package/lib/proxy/admin/sections/entry-type-admin.service.d.ts +0 -15
  422. package/lib/proxy/admin/sections/section-admin.service.d.ts +0 -18
  423. package/lib/proxy/admin/settings/site-settings-admin.service.d.ts +0 -13
  424. package/lib/proxy/dignite/abp/data/models.d.ts +0 -3
  425. package/lib/proxy/entries/entry-status.enum.d.ts +0 -5
  426. package/lib/proxy/fields/models.d.ts +0 -8
  427. package/lib/proxy/sections/models.d.ts +0 -12
  428. package/lib/proxy/sections/section-type.enum.d.ts +0 -6
  429. package/lib/proxy/settings/models.d.ts +0 -5
  430. package/lib/resolvers/extensions-props-action-token.resolver.d.ts +0 -71
  431. package/lib/resolvers/page-default-toolbar-actions.d.ts +0 -18
  432. package/lib/services/appent-content.d.ts +0 -1
  433. package/lib/services/cms-api.service.d.ts +0 -20
  434. package/lib/services/cms.service.d.ts +0 -10
  435. package/lib/services/field-abstracts.service.d.ts +0 -20
  436. package/lib/services/index.d.ts +0 -4
  437. package/lib/services/simple-reuse-strategy.d.ts +0 -13
  438. package/lib/services/update-list.service.d.ts +0 -9
  439. package/lib/services/validators.service.d.ts +0 -17
  440. /package/config/{proxy/admin/domains/index.d.ts → src/proxy/admin/domains/index.ts} +0 -0
  441. /package/{lib/proxy/admin/dynamic-forms/index.d.ts → config/src/proxy/dignite/cms/admin/dynamic-forms/index.ts} +0 -0
  442. /package/{lib/proxy/admin/entries/index.d.ts → config/src/proxy/dignite/cms/admin/entries/index.ts} +0 -0
  443. /package/{lib/proxy/admin/fields/index.d.ts → config/src/proxy/dignite/cms/admin/fields/index.ts} +0 -0
  444. /package/{lib/proxy/admin/sections/index.d.ts → config/src/proxy/dignite/cms/admin/sections/index.ts} +0 -0
  445. /package/config/{proxy/dignite/cms/admin/sites/index.d.ts → src/proxy/dignite/cms/admin/sites/index.ts} +0 -0
  446. /package/{lib/proxy/entries/index.d.ts → config/src/proxy/dignite/cms/entries/index.ts} +0 -0
  447. /package/{lib/proxy/sections/index.d.ts → config/src/proxy/dignite/cms/sections/index.ts} +0 -0
  448. /package/{lib/proxy/admin/settings/index.d.ts → src/lib/proxy/admin/settings/index.ts} +0 -0
@@ -1,3913 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, EventEmitter, inject, Component, ViewContainerRef, Input, ViewChildren, ViewChild, Output, RendererFactory2, InjectionToken, NgModule } from '@angular/core';
3
- import * as i1 from '@abp/ng.core';
4
- import { mapEnumToOptions, ListService, ConfigStateService, LIST_QUERY_DEBOUNCE_TIME, LocalizationService, AuthGuard, PermissionGuard, LazyModuleFactory, CoreModule } from '@abp/ng.core';
5
- import * as i3 from '@abp/ng.theme.shared';
6
- import { ToasterService, ThemeSharedModule } from '@abp/ng.theme.shared';
7
- import * as i3$1 from '@angular/router';
8
- import { RouterModule } from '@angular/router';
9
- import { EXTENSIONS_IDENTIFIER, ToolbarAction, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps } from '@abp/ng.components/extensible';
10
- import * as i1$1 from '@angular/forms';
11
- import { FormBuilder, Validators, FormGroup, FormControl, FormArray, FormsModule } from '@angular/forms';
12
- import * as i8 from '@swimlane/ngx-datatable';
13
- import { ColumnMode } from '@swimlane/ngx-datatable';
14
- import { finalize, map, tap } from 'rxjs';
15
- import * as i2 from '@angular/common';
16
- import * as i9 from '@ngx-validate/core';
17
- import * as i10 from '@ng-bootstrap/ng-bootstrap';
18
- import { NgbNavModule, NgbAccordionModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
19
- import * as i8$1 from '@abp/ng.components/page';
20
- import { PageModule } from '@abp/ng.components/page';
21
- import { pinyin } from 'pinyin-pro';
22
- import * as i1$2 from '@angular/platform-browser';
23
- import * as i8$2 from '@dignite-ng/expand.dynamic-form';
24
- import { DynamicFormModule } from '@dignite-ng/expand.dynamic-form';
25
- import { finalize as finalize$1 } from 'rxjs/operators';
26
- import * as i4 from 'ng-zorro-antd/select';
27
- import { NzSelectModule } from 'ng-zorro-antd/select';
28
- import { fielFieldControlGroup } from '@dignite-ng/expand.file-explorer';
29
- import { ckEditorFieldControlGroup } from '@dignite-ng/expand.ck-editor';
30
-
31
- class SiteSettingsAdminService {
32
- constructor(restService) {
33
- this.restService = restService;
34
- this.apiName = 'CmsAdmin';
35
- this.getAllLanguages = (config) => this.restService.request({
36
- method: 'GET',
37
- url: '/api/cms-admin/site-settings/all-languages',
38
- }, { apiName: this.apiName, ...config });
39
- this.getBrand = (config) => this.restService.request({
40
- method: 'GET',
41
- url: '/api/cms-admin/site-settings/brand',
42
- }, { apiName: this.apiName, ...config });
43
- this.getDefaultLanguage = (config) => this.restService.request({
44
- method: 'GET',
45
- responseType: 'text',
46
- url: '/api/cms-admin/site-settings/default-language',
47
- }, { apiName: this.apiName, ...config });
48
- }
49
- 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 }); }
50
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SiteSettingsAdminService, providedIn: 'root' }); }
51
- }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SiteSettingsAdminService, decorators: [{
53
- type: Injectable,
54
- args: [{
55
- providedIn: 'root',
56
- }]
57
- }], ctorParameters: () => [{ type: i1.RestService }] });
58
-
59
- var EntryStatus;
60
- (function (EntryStatus) {
61
- EntryStatus[EntryStatus["Draft"] = 0] = "Draft";
62
- EntryStatus[EntryStatus["Published"] = 1] = "Published";
63
- })(EntryStatus || (EntryStatus = {}));
64
- const entryStatusOptions = mapEnumToOptions(EntryStatus);
65
-
66
- var ECmsComponent;
67
- (function (ECmsComponent) {
68
- ECmsComponent["Entries"] = "Cms.Entries";
69
- ECmsComponent["Entries_Create"] = "Cms.Entries.Create";
70
- ECmsComponent["Entries_Edit"] = "Cms.Entries.Edit";
71
- ECmsComponent["Fields"] = "Cms.Fields";
72
- ECmsComponent["FieldsCreate"] = "Cms.Fields.Create";
73
- ECmsComponent["FieldsEdit"] = "Cms.Fields.Edit";
74
- ECmsComponent["Sites"] = "Cms.Sites";
75
- ECmsComponent["Sections"] = "Cms.Sections";
76
- ECmsComponent["SectionsCreateOrEdit"] = "Cms.Sections.Create.Or.Edit";
77
- })(ECmsComponent || (ECmsComponent = {}));
78
-
79
- class UpdateListService {
80
- constructor() {
81
- this.updateListEvent = new EventEmitter();
82
- }
83
- updateList() {
84
- this.updateListEvent.emit();
85
- }
86
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
87
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, providedIn: 'root' }); }
88
- }
89
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: UpdateListService, decorators: [{
90
- type: Injectable,
91
- args: [{
92
- providedIn: 'root'
93
- }]
94
- }], ctorParameters: () => [] });
95
-
96
- class EntryAdminService {
97
- constructor(restService) {
98
- this.restService = restService;
99
- this.apiName = 'CmsAdmin';
100
- this.activate = (id, config) => this.restService.request({
101
- method: 'POST',
102
- url: `/api/cms-admin/entries/activate/${id}`,
103
- }, { apiName: this.apiName, ...config });
104
- this.create = (input, config) => this.restService.request({
105
- method: 'POST',
106
- url: '/api/cms-admin/entries',
107
- body: input,
108
- }, { apiName: this.apiName, ...config });
109
- this.cultureExistWithSingleSection = (input, config) => this.restService.request({
110
- method: 'GET',
111
- url: '/api/cms-admin/entries/culture-exists-with-single-section',
112
- params: { culture: input.culture, sectionId: input.sectionId, entryTypeId: input.entryTypeId },
113
- }, { apiName: this.apiName, ...config });
114
- this.delete = (id, config) => this.restService.request({
115
- method: 'DELETE',
116
- url: `/api/cms-admin/entries/${id}`,
117
- }, { apiName: this.apiName, ...config });
118
- this.get = (id, config) => this.restService.request({
119
- method: 'GET',
120
- url: `/api/cms-admin/entries/${id}`,
121
- }, { apiName: this.apiName, ...config });
122
- this.getAllVersions = (id, config) => this.restService.request({
123
- method: 'GET',
124
- url: `/api/cms-admin/entries/${id}/all-versions`,
125
- }, { apiName: this.apiName, ...config });
126
- this.getList = (input, config) => this.restService.request({
127
- method: 'GET',
128
- url: '/api/cms-admin/entries',
129
- 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 },
130
- }, { apiName: this.apiName, ...config });
131
- this.getListByIds = (sectionId, ids, config) => this.restService.request({
132
- method: 'GET',
133
- url: '/api/cms-admin/entries/search-by-ids',
134
- params: { sectionId, ids },
135
- }, { apiName: this.apiName, ...config });
136
- this.move = (id, input, config) => this.restService.request({
137
- method: 'POST',
138
- url: `/api/cms-admin/entries/move/${id}`,
139
- body: input,
140
- }, { apiName: this.apiName, ...config });
141
- this.slugExists = (input, config) => this.restService.request({
142
- method: 'GET',
143
- url: '/api/cms-admin/entries/slug-exists',
144
- params: { culture: input.culture, sectionId: input.sectionId, slug: input.slug },
145
- }, { apiName: this.apiName, ...config });
146
- this.update = (id, input, config) => this.restService.request({
147
- method: 'PUT',
148
- url: '/api/cms-admin/entries',
149
- params: { id },
150
- body: input,
151
- }, { apiName: this.apiName, ...config });
152
- }
153
- 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 }); }
154
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryAdminService, providedIn: 'root' }); }
155
- }
156
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryAdminService, decorators: [{
157
- type: Injectable,
158
- args: [{
159
- providedIn: 'root',
160
- }]
161
- }], ctorParameters: () => [{ type: i1.RestService }] });
162
-
163
- class EntryTypeAdminService {
164
- constructor(restService) {
165
- this.restService = restService;
166
- this.apiName = 'CmsAdmin';
167
- this.create = (input, config) => this.restService.request({
168
- method: 'POST',
169
- url: '/api/cms-admin/entry-types',
170
- body: input,
171
- }, { apiName: this.apiName, ...config });
172
- this.delete = (id, config) => this.restService.request({
173
- method: 'DELETE',
174
- url: `/api/cms-admin/entry-types/${id}`,
175
- }, { apiName: this.apiName, ...config });
176
- this.get = (id, config) => this.restService.request({
177
- method: 'GET',
178
- url: `/api/cms-admin/entry-types/${id}`,
179
- }, { apiName: this.apiName, ...config });
180
- this.nameExists = (input, config) => this.restService.request({
181
- method: 'GET',
182
- url: '/api/cms-admin/entry-types/name-exists',
183
- params: { sectionId: input.sectionId, name: input.name },
184
- }, { apiName: this.apiName, ...config });
185
- this.update = (id, input, config) => this.restService.request({
186
- method: 'PUT',
187
- url: `/api/cms-admin/entry-types/${id}`,
188
- body: input,
189
- }, { apiName: this.apiName, ...config });
190
- }
191
- 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 }); }
192
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryTypeAdminService, providedIn: 'root' }); }
193
- }
194
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryTypeAdminService, decorators: [{
195
- type: Injectable,
196
- args: [{
197
- providedIn: 'root',
198
- }]
199
- }], ctorParameters: () => [{ type: i1.RestService }] });
200
-
201
- class SectionAdminService {
202
- constructor(restService) {
203
- this.restService = restService;
204
- this.apiName = 'CmsAdmin';
205
- this.create = (input, config) => this.restService.request({
206
- method: 'POST',
207
- url: '/api/cms-admin/sections',
208
- body: input,
209
- }, { apiName: this.apiName, ...config });
210
- this.delete = (id, config) => this.restService.request({
211
- method: 'DELETE',
212
- url: `/api/cms-admin/sections/${id}`,
213
- }, { apiName: this.apiName, ...config });
214
- this.get = (id, config) => this.restService.request({
215
- method: 'GET',
216
- url: `/api/cms-admin/sections/${id}`,
217
- }, { apiName: this.apiName, ...config });
218
- this.getList = (input, config) => this.restService.request({
219
- method: 'GET',
220
- url: '/api/cms-admin/sections',
221
- params: { filter: input.filter, isActive: input.isActive, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
222
- }, { apiName: this.apiName, ...config });
223
- this.nameExists = (input, config) => this.restService.request({
224
- method: 'GET',
225
- url: '/api/cms-admin/sections/name-exists',
226
- params: { name: input.name },
227
- }, { apiName: this.apiName, ...config });
228
- this.routeExists = (input, config) => this.restService.request({
229
- method: 'GET',
230
- url: '/api/cms-admin/sections/route-exists',
231
- params: { route: input.route },
232
- }, { apiName: this.apiName, ...config });
233
- this.update = (id, input, config) => this.restService.request({
234
- method: 'PUT',
235
- url: `/api/cms-admin/sections/${id}`,
236
- body: input,
237
- }, { apiName: this.apiName, ...config });
238
- }
239
- 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 }); }
240
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionAdminService, providedIn: 'root' }); }
241
- }
242
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionAdminService, decorators: [{
243
- type: Injectable,
244
- args: [{
245
- providedIn: 'root',
246
- }]
247
- }], ctorParameters: () => [{ type: i1.RestService }] });
248
-
249
- class EntriesComponent {
250
- constructor(_EntryAdminService, _SectionAdminService, toaster, confirmation, configState, router, _LocalizationService) {
251
- this._EntryAdminService = _EntryAdminService;
252
- this._SectionAdminService = _SectionAdminService;
253
- this.toaster = toaster;
254
- this.confirmation = confirmation;
255
- this.configState = configState;
256
- this.router = router;
257
- this._LocalizationService = _LocalizationService;
258
- this.fb = inject(FormBuilder);
259
- this._UpdateListService = inject(UpdateListService);
260
- this.list = inject(ListService);
261
- /**站点列表 */
262
- // siteList: any[any] = []
263
- /**选择的站点id */
264
- // siteId: string = ''
265
- /**站点下的版块 */
266
- this.SiteOfSectionList = [];
267
- /**版块下的语言列表 */
268
- this.sectionLanguagesList = [];
269
- /**版块下的条目类型列表 */
270
- this.entryTypeList = [];
271
- /**状态编码 */
272
- this._entryStatusOptions = entryStatusOptions;
273
- this.config = inject(ConfigStateService);
274
- this._SiteSettingsAdminService = inject(SiteSettingsAdminService);
275
- /**站点设置语言 */
276
- this.SiteSettingsAdminLanguages = [];
277
- /**列表相关 */
278
- this.ColumnMode = ColumnMode;
279
- this.data = {
280
- items: [],
281
- totalCount: 0,
282
- };
283
- this.filters = {};
284
- this.filtersForm = this.fb.group({
285
- siteId: [''],
286
- sectionId: [''],
287
- culture: [''],
288
- filter: [''],
289
- });
290
- }
291
- ngOnInit() {
292
- this.getPageDate();
293
- this._UpdateListService.updateListEvent.subscribe(() => {
294
- this.list.get();
295
- });
296
- }
297
- /**获取页面数据 */
298
- async getPageDate() {
299
- await this.getSiteOfSectionList();
300
- await this.getSectionLanguagesList();
301
- this.filters = this.filtersForm.value;
302
- this.hookToQuery();
303
- }
304
- /**切换板块 */
305
- async sectionIdChange() {
306
- this.getSectionOfEntryType();
307
- await this.getSectionLanguagesList();
308
- this.resetData();
309
- }
310
- /**切换语言 */
311
- async cultureChange() {
312
- this.resetData();
313
- }
314
- /**获取站点下的版块 */
315
- getSiteOfSectionList() {
316
- return new Promise((resolve, rejects) => {
317
- this._SectionAdminService.getList({
318
- maxResultCount: 1000,
319
- }).subscribe(res => {
320
- this.SiteOfSectionList = res.items;
321
- this.filtersForm.get('sectionId').patchValue(res.items[0]?.id || '');
322
- this.getSectionOfEntryType();
323
- resolve(res.items);
324
- });
325
- });
326
- }
327
- /**获取版块下的条目类型 */
328
- getSectionOfEntryType() {
329
- let sectionId = this.filtersForm.get('sectionId').value;
330
- this.entryTypeList = this.SiteOfSectionList.find(el => el.id == sectionId)?.entryTypes || [];
331
- }
332
- /**获取版块下的语言列表 */
333
- getSectionLanguagesList() {
334
- return new Promise(async (resolve, rejects) => {
335
- //获取所有语言 */
336
- let languagesSystem = this.configState.getDeep('localization.languages');
337
- //获取系统默认语言 */
338
- let DefaultLanguage = this.config.getSetting("Abp.Localization.DefaultLanguage");
339
- const configCmsSiteLanguages = this.config.getSetting("Cms.Site.Languages");
340
- if (!configCmsSiteLanguages) {
341
- await this.getSiteSettingsLanguages();
342
- }
343
- const LanguagesSite = (configCmsSiteLanguages ? configCmsSiteLanguages.split(',') : '') || this.SiteSettingsAdminLanguages;
344
- let LanguagesArray = languagesSystem.filter(el => LanguagesSite.includes(el.cultureName));
345
- //获取当前选择的语言
346
- let nowculture = this.filtersForm.get('culture').value;
347
- //当前选择的语言,是否在版块的的语言列表中
348
- let isexist = LanguagesArray.find(el => el.cultureName == nowculture);
349
- this.filtersForm.get('culture').patchValue(nowculture ? isexist ? nowculture : DefaultLanguage : DefaultLanguage);
350
- this.sectionLanguagesList = LanguagesArray;
351
- resolve(LanguagesArray);
352
- });
353
- }
354
- /**
355
- * 获取站点设置语言
356
- */
357
- getSiteSettingsLanguages() {
358
- return new Promise((resolve, rejects) => {
359
- this._SiteSettingsAdminService.getAllLanguages().subscribe(res => {
360
- this.SiteSettingsAdminLanguages = res;
361
- resolve(res);
362
- });
363
- });
364
- }
365
- resetData() {
366
- this.filters = this.filtersForm.value;
367
- this.list.page = 0;
368
- this.data.items = [];
369
- this.list.get();
370
- }
371
- /**新增-单个 */
372
- createEntriesBtn() {
373
- this.router.navigate(['/cms/admin/entries/create'], {
374
- queryParams: { cultureName: this.filters.culture, sectionId: this.filters.sectionId, entryTypeId: this.entryTypeList[0].id }
375
- });
376
- }
377
- hookToQuery() {
378
- const getData = (query) => this._EntryAdminService.getList({
379
- ...query,
380
- ...this.filters,
381
- });
382
- const setData = (list) => {
383
- this.data = list;
384
- };
385
- this.list.hookToQuery(getData).subscribe(setData);
386
- }
387
- /**删除条目 */
388
- deletefield(row) {
389
- this.confirmation.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
390
- if (status == 'confirm') {
391
- this._EntryAdminService.delete(row.id).pipe(finalize(() => {
392
- })).subscribe(res => {
393
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
394
- this.list.get();
395
- });
396
- }
397
- });
398
- }
399
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntriesComponent, deps: [{ token: EntryAdminService }, { token: SectionAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1.ConfigStateService }, { token: i3$1.Router }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
400
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EntriesComponent, selector: "cms-entries", providers: [
401
- ListService,
402
- // Provide this token if you want a different debounce time.
403
- // Default is 300. Cannot be 0. Any value below 100 is not recommended.
404
- { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
405
- {
406
- provide: EXTENSIONS_IDENTIFIER,
407
- useValue: ECmsComponent.Entries,
408
- },
409
- ], ngImport: i0, template: "<abp-page [title]=\"'Cms::Entries' | abpLocalization\" [toolbar]=\"true\">\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length < 1\" class=\"col \"></abp-page-toolbar-container>\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length > 1\" class=\"col \">\r\n <div class=\"row justify-content-end mx-0 gap-2\" *abpPermission=\"'CmsAdmin.Entry.Create'\">\r\n <div class=\"col-auto px-0 pt-0\">\r\n <div ngbDropdown class=\"d-inline-block\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm ms-2\" id=\"dropdownBasic1\" ngbDropdownToggle>\r\n <i class=\"fa fa-plus pe-1\" aria-hidden=\"true\"></i>{{'Cms::New' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <button ngbDropdownItem [routerLink]=\"['/cms/admin/entries/create']\"\r\n [queryParams]=\"{cultureName: filters.culture,sectionId:filters.sectionId,entryTypeId:item.id}\">{{item.displayName}}</button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </abp-page-toolbar-container>\r\n <div id=\"sites-page\" class=\"sites-page\">\r\n <div class=\"card\">\r\n <div class=\"card-body px-2 py-sm-2 border-bottom\" [formGroup]=\"filtersForm\">\r\n <div class=\"row align-items-end\">\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"sectionId\" (change)=\"sectionIdChange()\">\r\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\r\n <option [value]=\"item.id\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Languages' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"culture\" (change)=\"cultureChange()\">\r\n <ng-container *ngFor=\"let item of sectionLanguagesList\">\r\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n \r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"filter\"\r\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"resetData()\">\r\n <i class=\"fa fa-search\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\">\r\n <div class=\"card-body p-0\">\r\n <div class=\"table-responsive table-fixed-header\">\r\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\r\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\r\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\r\n <ngx-datatable-column [name]=\"'Cms::Title' | abpLocalization\" prop=\"title\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"entryTypeId\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <ng-container *ngIf=\"item.id === value\">{{item.displayName}}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Slug' | abpLocalization\" prop=\"slug\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{ value }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::Status' | abpLocalization\" prop=\"status\" [width]=\"80\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <ng-container *ngFor=\"let item of _entryStatusOptions\">\r\n <ng-container *ngIf=\"item.value=== value\">{{ 'Cms::Enum:EntryStatus:'+item.key |\r\n abpLocalization }}</ng-container>\r\n </ng-container>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [name]=\"'Cms::PublishTime' | abpLocalization\" prop=\"publishTime\" [width]=\"190\">\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n {{value | date: 'YYYY/MM/dd HH:mm:s' }}\r\n </ng-template>\r\n </ngx-datatable-column>\r\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\r\n [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"110\" >\r\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\r\n <div ngbDropdown container=\"body\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\r\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu>\r\n <button ngbDropdownItem\r\n routerLink=\"/cms/admin/entries/{{row.id}}/edit\">{{'AbpUi::Edit' |\r\n abpLocalization}}</button>\r\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\r\n abpLocalization}}</button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </ngx-datatable-column>\r\n </ngx-datatable>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</abp-page>", styles: ["::ng-deep .sites-page .dignite_page{background:transparent}::ng-deep .sites-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sites-page .card-header input{flex:2 1 auto}::ng-deep .sites-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-page .morentr{border:2px solid transparent}::ng-deep .sites-page .borderdrag{border:2px solid var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .borderdragtd{background-color:var(--ck-color-selector-column-resizer-hover)!important}::ng-deep .sites-page .testtr{border-color:transparent}::ng-deep .sites-page .testtr td{padding:2px}::ng-deep .sites-page .testtr:hover{background-color:transparent}.cdk-drag-preview{display:table;box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder{opacity:0}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.example-box:last-child{border:0}.example-list.cdk-drop-list-dragging .example-box:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.PermissionDirective, selector: "[abpPermission]", inputs: ["abpPermission", "abpPermissionRunChangeDetection"] }, { kind: "component", type: i8.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i8.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i8.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i3.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: i8$1.PageToolbarContainerComponent, selector: "abp-page-toolbar-container" }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
410
- }
411
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntriesComponent, decorators: [{
412
- type: Component,
413
- args: [{ selector: 'cms-entries', providers: [
414
- ListService,
415
- // Provide this token if you want a different debounce time.
416
- // Default is 300. Cannot be 0. Any value below 100 is not recommended.
417
- { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
418
- {
419
- provide: EXTENSIONS_IDENTIFIER,
420
- useValue: ECmsComponent.Entries,
421
- },
422
- ], template: "<abp-page [title]=\"'Cms::Entries' | abpLocalization\" [toolbar]=\"true\">\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length < 1\" class=\"col \"></abp-page-toolbar-container>\r\n <abp-page-toolbar-container *ngIf=\"entryTypeList.length > 1\" class=\"col \">\r\n <div class=\"row justify-content-end mx-0 gap-2\" *abpPermission=\"'CmsAdmin.Entry.Create'\">\r\n <div class=\"col-auto px-0 pt-0\">\r\n <div ngbDropdown class=\"d-inline-block\">\r\n <button type=\"button\" class=\"btn btn-primary btn-sm ms-2\" id=\"dropdownBasic1\" ngbDropdownToggle>\r\n <i class=\"fa fa-plus pe-1\" aria-hidden=\"true\"></i>{{'Cms::New' | abpLocalization}}\r\n </button>\r\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\r\n <ng-container *ngFor=\"let item of entryTypeList\">\r\n <button ngbDropdownItem [routerLink]=\"['/cms/admin/entries/create']\"\r\n [queryParams]=\"{cultureName: filters.culture,sectionId:filters.sectionId,entryTypeId:item.id}\">{{item.displayName}}</button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </abp-page-toolbar-container>\r\n <div id=\"sites-page\" class=\"sites-page\">\r\n <div class=\"card\">\r\n <div class=\"card-body px-2 py-sm-2 border-bottom\" [formGroup]=\"filtersForm\">\r\n <div class=\"row align-items-end\">\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"sectionId\" (change)=\"sectionIdChange()\">\r\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\r\n <option [value]=\"item.id\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Languages' | abpLocalization}}\uFF1A</label>\r\n <select class=\"form-select col-auto\" formControlName=\"culture\" (change)=\"cultureChange()\">\r\n <ng-container *ngFor=\"let item of sectionLanguagesList\">\r\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\r\n </ng-container>\r\n </select>\r\n </div>\r\n \r\n <div class=\"mb-2 col-3\">\r\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"filter\"\r\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\r\n </div>\r\n <div class=\"mb-2 col-3\">\r\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"resetData()\">\r\n <i class=\"fa fa-search\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"card mb-0\">\r\n <div class=\"card-body p-0\">\r\n <div class=\"table-responsive table-fixed-header\">\r\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\r\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\r\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\r\n <ngx-datatable-column [name]=\"'Cms::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"] }]
423
- }], ctorParameters: () => [{ type: EntryAdminService }, { type: SectionAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1.ConfigStateService }, { type: i3$1.Router }, { type: i1.LocalizationService }] });
424
-
425
- class CreateOrUpdateEntryInputBase {
426
- constructor(data) {
427
- /**语言 */
428
- this.culture = ['', [Validators.required]];
429
- /**条目id */
430
- this.entryTypeId = [''];
431
- /**标题 */
432
- this.title = ['', [Validators.required]];
433
- /**别名 */
434
- this.slug = ['', [Validators.required]];
435
- /**是否是草稿 */
436
- this.draft = ['', []];
437
- /**发布时间 */
438
- this.publishTime = ['', [Validators.required]];
439
- /**上级目录 */
440
- this.parentId = [null];
441
- /**修订说明 */
442
- this.versionNotes = [null];
443
- /**版本 */
444
- this.initialVersionId = [null];
445
- this.extraProperties = new FormGroup({});
446
- if (data) {
447
- for (const key in data) {
448
- if (data.hasOwnProperty(key)) {
449
- this[key] = data[key];
450
- }
451
- }
452
- }
453
- }
454
- }
455
-
456
- class ValidatorsService {
457
- constructor() {
458
- this.fb = inject(FormBuilder);
459
- this.toaster = inject(ToasterService);
460
- this._LocalizationService = inject(LocalizationService);
461
- }
462
- /**检查表单- */
463
- /**检查表单- */
464
- isCheckForm(input, module = 'AbpValidation') {
465
- let keys = Object.keys(input);
466
- for (let i = 0; i < keys.length; i++) {
467
- const element = keys[i];
468
- if (input[element] == false) {
469
- let info = `"${this._LocalizationService.instant(`${module}::${element}`)}" `;
470
- if (element.includes('.') && !element.includes('].')) {
471
- let arr = element.split('.');
472
- info = `"${this._LocalizationService.instant(`CmsKit::${arr[0]}`)}.${this._LocalizationService.instant(`CmsKit::${arr[1]}`)}"`;
473
- }
474
- if (element.includes('].')) {
475
- let arr = element.split('].');
476
- let arrStart = arr[0].split('[');
477
- info = `"${this._LocalizationService.instant(`CmsKit::${arrStart[0]}`)}[${arrStart[1]}].${this._LocalizationService.instant(`CmsKit::${arr[1]}`)}"`;
478
- }
479
- info += `${this._LocalizationService.instant(`AbpValidation::ThisFieldIsNotValid`)}`;
480
- //使用abp多语言提示
481
- this.toaster.warn(info);
482
- return true;
483
- }
484
- }
485
- return false;
486
- }
487
- /**获取表单所有字段是否通过验证 */
488
- getFormValidationStatus(formEntity) {
489
- let validationStatus = {};
490
- // 递归遍历表单组和表单控件集合
491
- const traverseForm = (form, prefix = '') => {
492
- if (form instanceof FormGroup) {
493
- Object.keys(form.controls).forEach(key => {
494
- const control = form.controls[key];
495
- let displayName = key.charAt(0).toUpperCase() + key.slice(1);
496
- const fullKey = prefix ? `${prefix}.${displayName}` : displayName;
497
- if (control instanceof FormControl) {
498
- validationStatus[fullKey] = control.valid;
499
- }
500
- else if (control instanceof FormArray) {
501
- traverseForm(control, fullKey);
502
- }
503
- else if (control instanceof FormGroup) {
504
- traverseForm(control, fullKey);
505
- }
506
- });
507
- }
508
- else if (form instanceof FormArray) {
509
- form.controls.forEach((control, index) => {
510
- const fullKey = prefix ? `${prefix}[${index}]` : `[${index}]`;
511
- if (control instanceof FormControl) {
512
- validationStatus[fullKey] = control.valid;
513
- }
514
- else if (control instanceof FormArray) {
515
- traverseForm(control, fullKey);
516
- }
517
- else if (control instanceof FormGroup) {
518
- traverseForm(control, fullKey);
519
- }
520
- });
521
- }
522
- };
523
- traverseForm(formEntity);
524
- return validationStatus;
525
- }
526
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ValidatorsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
527
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ValidatorsService, providedIn: 'root' }); }
528
- }
529
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: ValidatorsService, decorators: [{
530
- type: Injectable,
531
- args: [{
532
- providedIn: 'root'
533
- }]
534
- }], ctorParameters: () => [] });
535
-
536
- class FieldGroupAdminService {
537
- constructor(restService) {
538
- this.restService = restService;
539
- this.apiName = 'CmsAdmin';
540
- this.create = (input, config) => this.restService.request({
541
- method: 'POST',
542
- url: '/api/cms-admin/field-groups',
543
- body: input,
544
- }, { apiName: this.apiName, ...config });
545
- this.delete = (id, config) => this.restService.request({
546
- method: 'DELETE',
547
- url: `/api/cms-admin/field-groups/${id}`,
548
- }, { apiName: this.apiName, ...config });
549
- this.get = (id, config) => this.restService.request({
550
- method: 'GET',
551
- url: `/api/cms-admin/field-groups/${id}`,
552
- }, { apiName: this.apiName, ...config });
553
- this.getList = (input, config) => this.restService.request({
554
- method: 'GET',
555
- url: '/api/cms-admin/field-groups',
556
- params: { input },
557
- }, { apiName: this.apiName, ...config });
558
- this.update = (id, input, config) => this.restService.request({
559
- method: 'PUT',
560
- url: `/api/cms-admin/field-groups/${id}`,
561
- body: input,
562
- }, { apiName: this.apiName, ...config });
563
- }
564
- 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 }); }
565
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupAdminService, providedIn: 'root' }); }
566
- }
567
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupAdminService, decorators: [{
568
- type: Injectable,
569
- args: [{
570
- providedIn: 'root',
571
- }]
572
- }], ctorParameters: () => [{ type: i1.RestService }] });
573
-
574
- class FormAdminService {
575
- constructor(restService) {
576
- this.restService = restService;
577
- this.apiName = 'CmsAdmin';
578
- this.getFormControls = (config) => this.restService.request({
579
- method: 'GET',
580
- url: '/api/cms-admin/dynamic-forms/forms',
581
- }, { apiName: this.apiName, ...config });
582
- }
583
- 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 }); }
584
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormAdminService, providedIn: 'root' }); }
585
- }
586
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FormAdminService, decorators: [{
587
- type: Injectable,
588
- args: [{
589
- providedIn: 'root',
590
- }]
591
- }], ctorParameters: () => [{ type: i1.RestService }] });
592
-
593
- class FieldAbstractsService {
594
- constructor(_FieldGroupAdminService, _FormAdminService) {
595
- this._FieldGroupAdminService = _FieldGroupAdminService;
596
- this._FormAdminService = _FormAdminService;
597
- /**字段分组列表 */
598
- this.fieldGroupList = [];
599
- /**表单控件类型 */
600
- this.fromControlList = [];
601
- }
602
- /**获取字段分组列表 */
603
- getfieldGroupList() {
604
- this._FieldGroupAdminService.getList({}).subscribe(res => {
605
- this.fieldGroupList = res.items;
606
- });
607
- }
608
- /**获取表单控件类型 */
609
- getFromControlList() {
610
- return new Promise((resolve, reject) => {
611
- this._FormAdminService.getFormControls({}).subscribe(res => {
612
- this.fromControlList = res.items;
613
- resolve(res.items);
614
- });
615
- });
616
- }
617
- getExcludeAssignControl(typeName) {
618
- // return this.fromControlList.filter(el => el.name !== typeName)
619
- return this.fromControlList;
620
- }
621
- 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 }); }
622
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAbstractsService, providedIn: 'root' }); }
623
- }
624
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAbstractsService, decorators: [{
625
- type: Injectable,
626
- args: [{
627
- providedIn: 'root'
628
- }]
629
- }], ctorParameters: () => [{ type: FieldGroupAdminService }, { type: FormAdminService }] });
630
-
631
- class CmsService {
632
- constructor(restService) {
633
- this.restService = restService;
634
- this.apiName = 'Cms';
635
- }
636
- sample() {
637
- return this.restService.request({ method: 'GET', url: '/api/Cms/sample' }, { apiName: this.apiName });
638
- }
639
- 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 }); }
640
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsService, providedIn: 'root' }); }
641
- }
642
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsService, decorators: [{
643
- type: Injectable,
644
- args: [{
645
- providedIn: 'root',
646
- }]
647
- }], ctorParameters: () => [{ type: i1.RestService }] });
648
-
649
- class CmsApiService {
650
- constructor(titleService) {
651
- this.titleService = titleService;
652
- }
653
- /**动态设置浏览器标题 */
654
- setBrowserTitle(title) {
655
- this.titleService.setTitle(title);
656
- }
657
- /**
658
- * 识别中文转化为拼音,固定返回类型
659
- * 汉字转拼音
660
- * 大写转小写
661
- *
662
- * */
663
- chineseToPinyin(value) {
664
- //去除字符串中所有的空格
665
- // let val = value
666
- let val = value.replaceAll(' ', "-");
667
- let array = val.split('');
668
- let newArray = [];
669
- array.forEach((el, index) => {
670
- //转化为小写
671
- let elChange = el.toLowerCase();
672
- let isChinese = (str) => {
673
- return /^[\u4e00-\u9fa5]+$/.test(str);
674
- };
675
- if (isChinese(elChange)) {
676
- const resultWithoutTone = pinyin(elChange, { toneType: 'none', type: 'array' });
677
- elChange = resultWithoutTone.toString();
678
- if (index < array.length - 1)
679
- elChange += '-';
680
- }
681
- ;
682
- newArray.push(elChange);
683
- });
684
- let pinyinstr = newArray.join('');
685
- return pinyinstr || val;
686
- }
687
- /**
688
- * 深拷贝--方法 */
689
- deepClone(obj) {
690
- if (typeof obj !== 'object' || obj === null)
691
- return obj;
692
- const result = Array.isArray(obj) ? [] : {};
693
- for (let key in obj) {
694
- if (obj.hasOwnProperty(key)) {
695
- if (typeof obj[key] === 'object' && obj[key] !== null) {
696
- if (obj[key] instanceof Date) {
697
- result[key] = new Date(obj[key].getTime());
698
- }
699
- else if (obj[key] instanceof RegExp) {
700
- result[key] = new RegExp(obj[key]);
701
- }
702
- else {
703
- result[key] = this.deepClone(obj[key]);
704
- }
705
- }
706
- else {
707
- result[key] = obj[key];
708
- }
709
- }
710
- }
711
- return result;
712
- }
713
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsApiService, deps: [{ token: i1$2.Title }], target: i0.ɵɵFactoryTarget.Injectable }); }
714
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsApiService, providedIn: 'root' }); }
715
- }
716
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsApiService, decorators: [{
717
- type: Injectable,
718
- args: [{
719
- providedIn: 'root'
720
- }]
721
- }], ctorParameters: () => [{ type: i1$2.Title }] });
722
-
723
- class SimpleReuseStrategy {
724
- static { this.cacheRouters = new Map(); }
725
- static deleteRouteCache(url) {
726
- if (SimpleReuseStrategy.cacheRouters.has(url)) {
727
- const handle = SimpleReuseStrategy.cacheRouters.get(url);
728
- try {
729
- handle.componentRef.destory();
730
- }
731
- catch (e) { }
732
- SimpleReuseStrategy.cacheRouters.delete(url);
733
- }
734
- }
735
- static deleteAllRouteCache() {
736
- SimpleReuseStrategy.cacheRouters.forEach((handle, key) => {
737
- SimpleReuseStrategy.deleteRouteCache(key);
738
- });
739
- }
740
- // one 进入路由触发,是否同一路由时复用路由
741
- shouldReuseRoute(future, curr) {
742
- return future.routeConfig === curr.routeConfig &&
743
- JSON.stringify(future.params) === JSON.stringify(curr.params);
744
- }
745
- // 获取存储路由
746
- retrieve(route) {
747
- const url = this.getFullRouteURL(route);
748
- if (route.data.keep && SimpleReuseStrategy.cacheRouters.has(url)) {
749
- return SimpleReuseStrategy.cacheRouters.get(url);
750
- }
751
- else {
752
- return null;
753
- }
754
- }
755
- // 是否允许复用路由
756
- shouldDetach(route) {
757
- return Boolean(route.data.keep);
758
- }
759
- // 当路由离开时会触发,存储路由
760
- store(route, handle) {
761
- const url = this.getFullRouteURL(route);
762
- // 先把之前缓存的删除,
763
- SimpleReuseStrategy.cacheRouters.forEach((handle, key) => {
764
- SimpleReuseStrategy.deleteRouteCache(key);
765
- });
766
- SimpleReuseStrategy.cacheRouters.set(url, handle);
767
- }
768
- // 是否允许还原路由
769
- shouldAttach(route) {
770
- const url = this.getFullRouteURL(route);
771
- return Boolean(route.data.keep) && SimpleReuseStrategy.cacheRouters.has(url);
772
- }
773
- // 获取当前路由url
774
- getFullRouteURL(route) {
775
- const { pathFromRoot } = route;
776
- let fullRouteUrlPath = [];
777
- pathFromRoot.forEach((item) => {
778
- fullRouteUrlPath = fullRouteUrlPath.concat(this.getRouteUrlPath(item));
779
- });
780
- return `/${fullRouteUrlPath.join('/')}`;
781
- }
782
- getRouteUrlPath(route) {
783
- return route.url.map(urlSegment => urlSegment.path);
784
- }
785
- }
786
-
787
- class CreateOrEditEntriesComponent {
788
- constructor(toaster, _location, configState, _SectionAdminService, _EntryAdminService, datePipe, _LocalizationService, router, _CmsApiService) {
789
- this.toaster = toaster;
790
- this._location = _location;
791
- this.configState = configState;
792
- this._SectionAdminService = _SectionAdminService;
793
- this._EntryAdminService = _EntryAdminService;
794
- this.datePipe = datePipe;
795
- this._LocalizationService = _LocalizationService;
796
- this.router = router;
797
- this._CmsApiService = _CmsApiService;
798
- /**语言 */
799
- this.cultureName = '';
800
- /**条目类型id */
801
- this.entryTypeId = '';
802
- /**新建版本的版本id,同条目id */
803
- this.RevisionEntryId = '';
804
- /**选择的条目项 */
805
- this.entryTypesItem = '';
806
- /**版块id */
807
- this.sectionId = '';
808
- /**版块详情 */
809
- this.SectionSelect = '';
810
- /**语言列表 */
811
- this.languagesList = [];
812
- /**条目类型列表-用于选择上级条目 */
813
- this.entryTypesList = [];
814
- /**版本列表 */
815
- this.AllVersionsList = [];
816
- /**是否是编辑 */
817
- this.isEdit = false;
818
- /**来自父组件的传值 */
819
- this.FromParentQueryParams = '';
820
- /**指定id的条目信息 */
821
- this.entrySelect = '';
822
- this.time = 0;
823
- this.config = inject(ConfigStateService);
824
- }
825
- set ParentQueryParams(v) {
826
- if (v) {
827
- this.FromParentQueryParams = v;
828
- }
829
- }
830
- set entity(v) {
831
- if (v) {
832
- this._entity = v;
833
- }
834
- }
835
- set parentEntrySelect(v) {
836
- if (v) {
837
- let V_extraProperties = this._CmsApiService.deepClone(this.convertExtraProperties(v.extraProperties));
838
- v.extraProperties = V_extraProperties;
839
- this.entrySelect = v;
840
- }
841
- }
842
- /**将对象中的ExtraProperties赋值到extraProperties */
843
- convertExtraProperties(obj) {
844
- for (let key in obj) {
845
- if (Array.isArray(obj[key])) {
846
- obj[key].forEach(item => {
847
- if (item.hasOwnProperty('ExtraProperties')) {
848
- item['extraProperties'] = item['ExtraProperties'];
849
- }
850
- });
851
- }
852
- }
853
- return obj;
854
- }
855
- /**别名表单实体 */
856
- get sluginput() {
857
- return this._entity.get('slug');
858
- }
859
- /**语言表单实体 */
860
- get cultureinput() {
861
- return this._entity.get('culture');
862
- }
863
- /**语言表单实体影子 */
864
- get culture_shadowInput() {
865
- return this._entity.get('culture_shadow');
866
- }
867
- /**extraProperties配置表单实体 */
868
- get extraProperties() {
869
- return this._entity.get('extraProperties');
870
- }
871
- async ngAfterContentInit() {
872
- //Called after ngOnInit when the component's or directive's content has been initialized.
873
- //Add 'implements AfterContentInit' to the class.
874
- let queryParams = this.FromParentQueryParams;
875
- if (this._entity && this.FromParentQueryParams) {
876
- this._entity.setControl('slug', new FormControl('', {
877
- validators: Validators.required,
878
- asyncValidators: this.repetitionAsyncValidator(),
879
- updateOn: 'blur'
880
- }));
881
- this._entity.setControl('culture_shadow', new FormControl('', {
882
- validators: [Validators.required],
883
- asyncValidators: this.cultureAsyncValidator_test(),
884
- }));
885
- this._entity.get('culture').disable();
886
- if (queryParams.RevisionEntryId && this.entrySelect) {
887
- this.RevisionEntryId = queryParams.RevisionEntryId;
888
- this.setEntryconfig(this.entrySelect);
889
- }
890
- else {
891
- this.setEntryconfig(queryParams);
892
- }
893
- if (this.sectionId)
894
- await this.getSectionSelect();
895
- if (this.RevisionEntryId)
896
- await this.getAllVersionsList();
897
- }
898
- }
899
- /**定义自定义异步验证 */
900
- cultureAsyncValidator_test() {
901
- return (ctrl) => {
902
- return new Promise(resolve => {
903
- let subculture = this._entity?.get('culture').value;
904
- if (subculture == this.entrySelect?.culture || this.SectionSelect.type !== 0) {
905
- resolve(null);
906
- return;
907
- }
908
- this._EntryAdminService.cultureExistWithSingleSection({
909
- culture: subculture,
910
- sectionId: this.sectionId,
911
- entryTypeId: this.entryTypeId
912
- }).subscribe(res => {
913
- if (res) {
914
- resolve({ repetition: this._LocalizationService.instant(`Cms::EntriesAlreadyExistEntryType`, this.entryTypesItem.displayName, this.languagesList.find(el => el.cultureName == subculture).displayName) });
915
- }
916
- else {
917
- resolve(null);
918
- }
919
- });
920
- });
921
- };
922
- }
923
- /**
924
- * 设置条目详情
925
- * @param {object} source - 数据源对象
926
- */
927
- setEntryconfig(source) {
928
- this.entryTypeId = source.entryTypeId;
929
- this.cultureName = source.culture || source.cultureName;
930
- this.sectionId = source.sectionId;
931
- }
932
- /**定义自定义异步验证 */
933
- repetitionAsyncValidator() {
934
- return (ctrl) => {
935
- return new Promise(resolve => {
936
- let subslug = this._entity?.get('slug').value;
937
- if (subslug == this.entrySelect?.slug) {
938
- resolve(null);
939
- return;
940
- }
941
- this._EntryAdminService.slugExists({
942
- culture: this.cultureName,
943
- sectionId: this.sectionId,
944
- slug: subslug
945
- }).subscribe(res => {
946
- if (res) {
947
- resolve({ repetition: this._LocalizationService.instant(`Cms::EntrySlug{0}AlreadyExist`, ctrl.value) });
948
- }
949
- else {
950
- resolve(null);
951
- }
952
- });
953
- });
954
- };
955
- }
956
- /**获取版块详情 */
957
- getSectionSelect() {
958
- return new Promise((resolve, rejects) => {
959
- this._SectionAdminService.get(this.sectionId).subscribe(async (res) => {
960
- let languages = this.configState.getDeep('localization.languages');
961
- this.languagesList = languages;
962
- let entryTypesItem = res.entryTypes.find(el => el.id == this.entryTypeId);
963
- this.SectionSelect = res;
964
- await this.getTypeEntryList();
965
- this.entryTypesItem = entryTypesItem;
966
- this.entryTypesList = res.entryTypes.filter(el => el.id == this.entryTypeId);
967
- this._entity.patchValue({
968
- ...this.entrySelect,
969
- initialVersionId: this.entrySelect?.initialVersionId || this.RevisionEntryId || '',
970
- culture: this.cultureName,
971
- culture_shadow: this.cultureName,
972
- entryTypeId: this.entryTypeId,
973
- publishTime: this.datePipe.transform(new Date(), 'yyyy-MM-dd HH:mm:ss'),
974
- });
975
- resolve(true);
976
- });
977
- });
978
- }
979
- /**获取条目类型下所有条目列表 */
980
- getTypeEntryList() {
981
- return new Promise((resolve, rejects) => {
982
- this._EntryAdminService.getList({
983
- sectionId: this.sectionId,
984
- maxResultCount: 1000,
985
- culture: this.cultureName
986
- }).subscribe((res) => {
987
- let entryTypesList = res.items.filter(el => el.id != this.entrySelect.id);
988
- let parentList = entryTypesList.filter(el => !el.parentId);
989
- parentList.forEach(el => {
990
- let layer = 0;
991
- el.layer = new Array(layer);
992
- el.children = this.groupByParentId(entryTypesList, el.id, (layer + 1));
993
- });
994
- this.entryTypesList = parentList;
995
- resolve(res);
996
- });
997
- });
998
- }
999
- /**对数组按照父子关系进行分组 */
1000
- groupByParentId(arr, id = '', layer) {
1001
- let result = [];
1002
- result = arr.filter(el => el.parentId == id);
1003
- result.forEach(el => {
1004
- el.layer = new Array(layer);
1005
- el.children = this.groupByParentId(arr, el.id, (layer + 1));
1006
- });
1007
- return result;
1008
- }
1009
- /**获取条目版本列表 */
1010
- getAllVersionsList() {
1011
- return new Promise((resolve, rejects) => {
1012
- this._EntryAdminService.getAllVersions(this.RevisionEntryId).subscribe(res => {
1013
- this.AllVersionsList = res.items;
1014
- resolve(res);
1015
- });
1016
- });
1017
- }
1018
- /**标题转化别名 */
1019
- setTitleToSlugBlur(event) {
1020
- let val = event.target.value;
1021
- let slug = this._entity.get('slug');
1022
- let pinyinstr = '';
1023
- if (slug.value)
1024
- return;
1025
- pinyinstr = this._CmsApiService.chineseToPinyin(val);
1026
- this._entity.patchValue({
1027
- slug: pinyinstr || val
1028
- });
1029
- }
1030
- /**使用Unicode编码范围判断是否是中文字符 */
1031
- isChinese(str) {
1032
- return /^[\u4e00-\u9fa5]+$/.test(str);
1033
- }
1034
- /**激活 */
1035
- ActivatedVersion(VersionId) {
1036
- this._EntryAdminService.activate(VersionId).subscribe((res) => {
1037
- this.AllVersionsList.forEach(el => {
1038
- el.isActivatedVersion = el.id === VersionId;
1039
- });
1040
- return;
1041
- });
1042
- }
1043
- /**编辑版本 */
1044
- toEditUrl(id) {
1045
- this.router.navigateByUrl('', { skipLocationChange: true }).then(() => {
1046
- this.router.navigate([`/cms/admin/entries/${id}/edit`]);
1047
- });
1048
- }
1049
- /**删除版本 */
1050
- delectVersion(vid) {
1051
- this._EntryAdminService.delete(vid).subscribe(res => {
1052
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1053
- this.getAllVersionsList();
1054
- });
1055
- }
1056
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditEntriesComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i1.ConfigStateService }, { token: SectionAdminService }, { token: EntryAdminService }, { token: i2.DatePipe }, { token: i1.LocalizationService }, { token: i3$1.Router }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
1057
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateOrEditEntriesComponent, selector: "cms-create-or-edit-entries", inputs: { isEdit: "isEdit", ParentQueryParams: "ParentQueryParams", entity: "entity", parentEntrySelect: "parentEntrySelect" }, viewQueries: [{ propertyName: "FormDynamicontrolRef", predicate: ["FormDynamicontrolRef"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: "<div class=\"create-or-edit-entry-page\" [formGroup]=\"_entity\">\n <div class=\"container \">\n <div class=\"row\">\n <div class=\"col-md-8 \">\n <div class=\"card p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"title\">{{'Cms::Title' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" (blur)=\"setTitleToSlugBlur($event)\"\n formControlName=\"title\">\n </div>\n <!-- <template #FormDynamicRef></template> -->\n <ng-container *ngFor=\"let item of entryTypesItem?.fieldTabs;let i =index\">\n <ng-container *ngFor=\"let el of item.fields;let i1 =index\">\n <ng-container *ngIf=\"el&&_entity\">\n <df-dynamic [entity]=\"_entity\" [fields]=\"el\"\n [selected]=\"entrySelect ? entrySelect.extraProperties[el.field.name] : ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"cultureinput.value\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-4 \">\n <div class=\"card mb-0 p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"slug\">{{'Cms::Slug' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"slug\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"sluginput.errors?.repetition\">\n {{sluginput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"culture\">{{'AbpUi::Languages' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"culture\">\n <ng-container *ngFor=\"let item of languagesList;let i =index\">\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\n </ng-container>\n </select>\n <input type=\"text\" formControlName=\"culture_shadow\"\n style=\"position: absolute;z-index: -1;opacity: 0;\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"culture_shadowInput.errors?.repetition\">\n {{culture_shadowInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\" *ngIf=\"SectionSelect.type===1\">\n <label class=\"form-label\" for=\"parentId\">{{'Cms::ParentEntry' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"parentId\">\n <option value=\"\"></option>\n <ng-container *ngFor=\"let item of entryTypesList;let i =index\">\n <option [value]=\"item.id\">{{item.title}}</option>\n <ng-container *ngFor=\"let el of item.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n <ng-template #childTemplate let-data>\n <option [value]=\"data.value.id\">\n <ng-container *ngFor=\"let item of data.value.layer\">--</ng-container>\n {{data.value.title}}</option>\n <ng-container *ngFor=\"let el of data.value.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n </ng-container>\n\n </ng-template>\n </ng-container>\n\n </ng-container>\n </select>\n\n\n\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::PublishTime' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"publishTime\">\n </div>\n <div class=\"mb-2\" *ngIf=\"isEdit\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::Version' | abpLocalization}}</label>\n <ul class=\"list-group\">\n <ng-container *ngFor=\"let item of AllVersionsList\">\n <li class=\"list-group-item flex-between\">\n <div>\n {{item.initialVersionId?(item.creationTime| date: 'YYYY/MM/dd\n HH:mm:s'):('Cms::InitialVersion' | abpLocalization)}}\n <span class=\"badge text-bg-success ms-1\"\n *ngIf=\"item.isActivatedVersion\">{{'Cms::IsActive' | abpLocalization}}</span>\n <span class=\"badge text-bg-primary ms-1\"\n *ngIf=\"item.id === RevisionEntryId\">{{'Cms::Editing' |\n abpLocalization}}</span>\n </div>\n <div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-link-primary p-2 \"\n style=\"line-height: 0;\" id=\"dropdownBasic1\" ngbDropdownToggle>\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <button ngbDropdownItem type=\"button\" *ngIf=\"!item.isActivatedVersion\"\n (click)=\"ActivatedVersion(item.id)\">\n <i class=\"fas fa-check me-1\"></i>{{'Cms::IsActive' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n routerLink=\"/cms/admin/entries/create\"\n [queryParams]=\"{RevisionEntryId:item.id}\">\n <i class=\"fas fa-plus me-1\"></i>{{'Cms::NewVersion' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\" (click.stop)=\"toEditUrl(item.id)\"\n *ngIf=\"item.id !== RevisionEntryId\">\n <i class=\"fas fa-edit me-1\"></i>{{'AbpUi::Edit' | abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n (click.stop)=\"delectVersion(item.id)\"\n *ngIf=\"item.initialVersionId&&!item.isActivatedVersion&&item.id !== RevisionEntryId\">\n <i class=\"fas fa-trash me-1\"></i>{{'AbpUi::Delete' |\n abpLocalization}}\n </button>\n </div>\n </div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"versionNotes\">{{'Cms::RevisionNotes' | abpLocalization}}</label>\n <textarea class=\"form-control\" formControlName=\"versionNotes\" rows=\"3\"></textarea>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .create-or-edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1058
- }
1059
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditEntriesComponent, decorators: [{
1060
- type: Component,
1061
- args: [{ selector: 'cms-create-or-edit-entries', template: "<div class=\"create-or-edit-entry-page\" [formGroup]=\"_entity\">\n <div class=\"container \">\n <div class=\"row\">\n <div class=\"col-md-8 \">\n <div class=\"card p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"title\">{{'Cms::Title' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" (blur)=\"setTitleToSlugBlur($event)\"\n formControlName=\"title\">\n </div>\n <!-- <template #FormDynamicRef></template> -->\n <ng-container *ngFor=\"let item of entryTypesItem?.fieldTabs;let i =index\">\n <ng-container *ngFor=\"let el of item.fields;let i1 =index\">\n <ng-container *ngIf=\"el&&_entity\">\n <df-dynamic [entity]=\"_entity\" [fields]=\"el\"\n [selected]=\"entrySelect ? entrySelect.extraProperties[el.field.name] : ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"cultureinput.value\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-4 \">\n <div class=\"card mb-0 p-2\">\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"slug\">{{'Cms::Slug' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"slug\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"sluginput.errors?.repetition\">\n {{sluginput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"culture\">{{'AbpUi::Languages' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"culture\">\n <ng-container *ngFor=\"let item of languagesList;let i =index\">\n <option [value]=\"item.cultureName\">{{item.displayName}}</option>\n </ng-container>\n </select>\n <input type=\"text\" formControlName=\"culture_shadow\"\n style=\"position: absolute;z-index: -1;opacity: 0;\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"culture_shadowInput.errors?.repetition\">\n {{culture_shadowInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\" *ngIf=\"SectionSelect.type===1\">\n <label class=\"form-label\" for=\"parentId\">{{'Cms::ParentEntry' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"parentId\">\n <option value=\"\"></option>\n <ng-container *ngFor=\"let item of entryTypesList;let i =index\">\n <option [value]=\"item.id\">{{item.title}}</option>\n <ng-container *ngFor=\"let el of item.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n <ng-template #childTemplate let-data>\n <option [value]=\"data.value.id\">\n <ng-container *ngFor=\"let item of data.value.layer\">--</ng-container>\n {{data.value.title}}</option>\n <ng-container *ngFor=\"let el of data.value.children\">\n <ng-container *ngTemplateOutlet=\"childTemplate; context: {\n $implicit: {\n value: el,\n }\n }\"></ng-container>\n </ng-container>\n\n </ng-template>\n </ng-container>\n\n </ng-container>\n </select>\n\n\n\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::PublishTime' | abpLocalization}}</label>\n <input type=\"datetime-local\" class=\"form-control\" step=\"1\" formControlName=\"publishTime\">\n </div>\n <div class=\"mb-2\" *ngIf=\"isEdit\">\n <label class=\"form-label\" for=\"publishTime\">{{'Cms::Version' | abpLocalization}}</label>\n <ul class=\"list-group\">\n <ng-container *ngFor=\"let item of AllVersionsList\">\n <li class=\"list-group-item flex-between\">\n <div>\n {{item.initialVersionId?(item.creationTime| date: 'YYYY/MM/dd\n HH:mm:s'):('Cms::InitialVersion' | abpLocalization)}}\n <span class=\"badge text-bg-success ms-1\"\n *ngIf=\"item.isActivatedVersion\">{{'Cms::IsActive' | abpLocalization}}</span>\n <span class=\"badge text-bg-primary ms-1\"\n *ngIf=\"item.id === RevisionEntryId\">{{'Cms::Editing' |\n abpLocalization}}</span>\n </div>\n <div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-link-primary p-2 \"\n style=\"line-height: 0;\" id=\"dropdownBasic1\" ngbDropdownToggle>\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <button ngbDropdownItem type=\"button\" *ngIf=\"!item.isActivatedVersion\"\n (click)=\"ActivatedVersion(item.id)\">\n <i class=\"fas fa-check me-1\"></i>{{'Cms::IsActive' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n routerLink=\"/cms/admin/entries/create\"\n [queryParams]=\"{RevisionEntryId:item.id}\">\n <i class=\"fas fa-plus me-1\"></i>{{'Cms::NewVersion' |\n abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\" (click.stop)=\"toEditUrl(item.id)\"\n *ngIf=\"item.id !== RevisionEntryId\">\n <i class=\"fas fa-edit me-1\"></i>{{'AbpUi::Edit' | abpLocalization}}\n </button>\n <button ngbDropdownItem type=\"button\"\n (click.stop)=\"delectVersion(item.id)\"\n *ngIf=\"item.initialVersionId&&!item.isActivatedVersion&&item.id !== RevisionEntryId\">\n <i class=\"fas fa-trash me-1\"></i>{{'AbpUi::Delete' |\n abpLocalization}}\n </button>\n </div>\n </div>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"versionNotes\">{{'Cms::RevisionNotes' | abpLocalization}}</label>\n <textarea class=\"form-control\" formControlName=\"versionNotes\" rows=\"3\"></textarea>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .create-or-edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"] }]
1062
- }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i1.ConfigStateService }, { type: SectionAdminService }, { type: EntryAdminService }, { type: i2.DatePipe }, { type: i1.LocalizationService }, { type: i3$1.Router }, { type: CmsApiService }], propDecorators: { isEdit: [{
1063
- type: Input
1064
- }], ParentQueryParams: [{
1065
- type: Input
1066
- }], entity: [{
1067
- type: Input
1068
- }], parentEntrySelect: [{
1069
- type: Input
1070
- }], FormDynamicontrolRef: [{
1071
- type: ViewChildren,
1072
- args: ['FormDynamicontrolRef', { read: ViewContainerRef }]
1073
- }] } });
1074
-
1075
- class CreateComponent {
1076
- constructor(toaster, _location, route, _EntryAdminService, _LocalizationService) {
1077
- this.toaster = toaster;
1078
- this._location = _location;
1079
- this.route = route;
1080
- this._EntryAdminService = _EntryAdminService;
1081
- this._LocalizationService = _LocalizationService;
1082
- this.fb = inject(FormBuilder);
1083
- this._updateListService = inject(UpdateListService);
1084
- /**是否是草稿 */
1085
- this.draftType = false;
1086
- /**页面传值用于传递到子组件 */
1087
- this.queryParams = '';
1088
- /**指定id的条目信息 */
1089
- this.entrySelect = '';
1090
- this._ValidatorsService = inject(ValidatorsService);
1091
- /**表单验证状态
1092
- * {
1093
- * title:true,
1094
- * }
1095
- */
1096
- this.formValidation = '';
1097
- this.isSubmit = false;
1098
- }
1099
- async ngOnInit() {
1100
- this.queryParams = this.route.snapshot.queryParams;
1101
- this.newEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
1102
- if (this.queryParams.RevisionEntryId)
1103
- await this.getEntrySelect();
1104
- }
1105
- /**获取条目信息 */
1106
- getEntrySelect() {
1107
- return new Promise((resolve, rejects) => {
1108
- this._EntryAdminService.get(this.queryParams.RevisionEntryId).subscribe(res => {
1109
- this.entrySelect = res;
1110
- resolve(res);
1111
- });
1112
- });
1113
- }
1114
- /**保存 */
1115
- save(draft) {
1116
- this.newEntity.patchValue({
1117
- draft: draft
1118
- });
1119
- let input = this.newEntity.value;
1120
- input.publishTime = new Date(new Date(input.publishTime).getTime() + (8 * 60 * 60 * 1000)).toISOString();
1121
- input.culture = this.newEntity.get('culture').value;
1122
- if (!this.isSubmit)
1123
- return;
1124
- this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1125
- if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1126
- return;
1127
- if (!this.newEntity.valid)
1128
- return;
1129
- this._EntryAdminService.create(input).subscribe(res => {
1130
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1131
- this._location.back();
1132
- this._updateListService.updateList();
1133
- });
1134
- }
1135
- /**触发点击按钮替身 */
1136
- clickSubmit(type) {
1137
- this.isSubmit = true;
1138
- this.draftType = type;
1139
- this.submitclick.nativeElement.click();
1140
- }
1141
- /**返回上一页 */
1142
- backTo() {
1143
- this._location.back();
1144
- }
1145
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: EntryAdminService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1146
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateComponent, selector: "cms-create", providers: [
1147
- {
1148
- provide: EXTENSIONS_IDENTIFIER,
1149
- useValue: ECmsComponent.Entries_Create,
1150
- },
1151
- ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save(draftType)\">\n <abp-page [title]=\"'Cms::New'| abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect; else elseTemplate\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" ></cms-create-or-edit-entries>\n </ng-container>\n <ng-template #elseTemplate>\n <cms-create-or-edit-entries [entity]=\"newEntity\"\n [ParentQueryParams]=\"queryParams\" ></cms-create-or-edit-entries>\n </ng-template>\n </abp-page>\n</form>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditEntriesComponent, selector: "cms-create-or-edit-entries", inputs: ["isEdit", "ParentQueryParams", "entity", "parentEntrySelect"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1152
- }
1153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateComponent, decorators: [{
1154
- type: Component,
1155
- args: [{ selector: 'cms-create', providers: [
1156
- {
1157
- provide: EXTENSIONS_IDENTIFIER,
1158
- useValue: ECmsComponent.Entries_Create,
1159
- },
1160
- ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save(draftType)\">\n <abp-page [title]=\"'Cms::New'| abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect; else elseTemplate\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" ></cms-create-or-edit-entries>\n </ng-container>\n <ng-template #elseTemplate>\n <cms-create-or-edit-entries [entity]=\"newEntity\"\n [ParentQueryParams]=\"queryParams\" ></cms-create-or-edit-entries>\n </ng-template>\n </abp-page>\n</form>", styles: ["::ng-deep .create-or-edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .create-or-edit-entry-page .form-control,::ng-deep .create-or-edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}\n"] }]
1161
- }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: EntryAdminService }, { type: i1.LocalizationService }], propDecorators: { submitclick: [{
1162
- type: ViewChild,
1163
- args: ['submitclick', { static: true }]
1164
- }] } });
1165
-
1166
- /* eslint-disable @angular-eslint/use-lifecycle-interface */
1167
- class EditComponent {
1168
- constructor(toaster, _location, route, _EntryAdminService, _LocalizationService) {
1169
- this.toaster = toaster;
1170
- this._location = _location;
1171
- this.route = route;
1172
- this._EntryAdminService = _EntryAdminService;
1173
- this._LocalizationService = _LocalizationService;
1174
- this.fb = inject(FormBuilder);
1175
- this._updateListService = inject(UpdateListService);
1176
- /**是否是草稿 */
1177
- this.draftType = false;
1178
- /**页面传值用于传递到子组件 */
1179
- this.queryParams = {};
1180
- /**指定id的条目信息 */
1181
- this.entrySelect = '';
1182
- this._ValidatorsService = inject(ValidatorsService);
1183
- /**表单验证状态
1184
- * {
1185
- * title:true,
1186
- * }
1187
- */
1188
- this.formValidation = '';
1189
- this.isSubmit = false;
1190
- }
1191
- async ngOnInit() {
1192
- this.queryParams.RevisionEntryId = this.route.snapshot.params.entrieId;
1193
- this.newEntity = this.fb.group(new CreateOrUpdateEntryInputBase());
1194
- await this.getEntrySelect();
1195
- }
1196
- /**获取条目信息 */
1197
- getEntrySelect() {
1198
- return new Promise((resolve, rejects) => {
1199
- this._EntryAdminService.get(this.queryParams.RevisionEntryId).subscribe(res => {
1200
- this.entrySelect = res;
1201
- resolve(res);
1202
- });
1203
- });
1204
- }
1205
- /**保存 */
1206
- save(draft) {
1207
- this.newEntity.patchValue({
1208
- draft: draft,
1209
- });
1210
- let input = this.newEntity.value;
1211
- input.publishTime = new Date(new Date(input.publishTime).getTime() + 8 * 60 * 60 * 1000).toISOString();
1212
- input.culture = this.newEntity.get('culture').value;
1213
- input.concurrencyStamp = this.entrySelect.concurrencyStamp;
1214
- if (!this.isSubmit)
1215
- return;
1216
- this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1217
- if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1218
- return;
1219
- if (!this.newEntity.valid)
1220
- return;
1221
- this._EntryAdminService.update(this.entrySelect.id, input).subscribe(res => {
1222
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1223
- this.backTo();
1224
- this._updateListService.updateList();
1225
- });
1226
- }
1227
- /**触发点击按钮替身 */
1228
- clickSubmit(type) {
1229
- this.draftType = type;
1230
- this.isSubmit = true;
1231
- this.submitclick.nativeElement.click();
1232
- }
1233
- /**返回上一页 */
1234
- backTo() {
1235
- this._location.back();
1236
- }
1237
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: EntryAdminService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1238
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EditComponent, selector: "cms-edit", providers: [
1239
- {
1240
- provide: EXTENSIONS_IDENTIFIER,
1241
- useValue: ECmsComponent.Entries_Edit,
1242
- },
1243
- ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save(draftType)\">\n <abp-page [title]=\"'AbpUi::Edit' | abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" [isEdit]=\"true\"></cms-create-or-edit-entries>\n </ng-container>\n </abp-page>\n</form>", styles: ["::ng-deep .edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .edit-entry-page .form-control,::ng-deep .edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .edit-entry-page .cursor-move{cursor:move}::ng-deep .edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: CreateOrEditEntriesComponent, selector: "cms-create-or-edit-entries", inputs: ["isEdit", "ParentQueryParams", "entity", "parentEntrySelect"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1244
- }
1245
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditComponent, decorators: [{
1246
- type: Component,
1247
- args: [{ selector: 'cms-edit', providers: [
1248
- {
1249
- provide: EXTENSIONS_IDENTIFIER,
1250
- useValue: ECmsComponent.Entries_Edit,
1251
- },
1252
- ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save(draftType)\">\n <abp-page [title]=\"'AbpUi::Edit' | abpLocalization\" [toolbar]=\"true\">\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n <ng-container *ngIf=\"entrySelect\">\n <cms-create-or-edit-entries [entity]=\"newEntity\" [ParentQueryParams]=\"queryParams\"\n [parentEntrySelect]=\"entrySelect\" [isEdit]=\"true\"></cms-create-or-edit-entries>\n </ng-container>\n </abp-page>\n</form>", styles: ["::ng-deep .edit-entry-page .dignite_page{height:calc(100vh - 125px);overflow:auto;background:transparent}::ng-deep .edit-entry-page .form-control,::ng-deep .edit-entry-page .form-select{padding:.475rem 1.25rem}::ng-deep .edit-entry-page .cursor-move{cursor:move}::ng-deep .edit-entry-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit}::ng-deep .edit-entry-page .flex-between{display:flex;align-items:center;justify-content:space-between}\n"] }]
1253
- }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: EntryAdminService }, { type: i1.LocalizationService }], propDecorators: { submitclick: [{
1254
- type: ViewChild,
1255
- args: ['submitclick', { static: true }]
1256
- }] } });
1257
-
1258
- class FieldAdminService {
1259
- constructor(restService) {
1260
- this.restService = restService;
1261
- this.apiName = 'CmsAdmin';
1262
- this.create = (input, config) => this.restService.request({
1263
- method: 'POST',
1264
- url: '/api/cms-admin/fields',
1265
- body: input,
1266
- }, { apiName: this.apiName, ...config });
1267
- this.delete = (id, config) => this.restService.request({
1268
- method: 'DELETE',
1269
- url: `/api/cms-admin/fields/${id}`,
1270
- }, { apiName: this.apiName, ...config });
1271
- this.get = (id, config) => this.restService.request({
1272
- method: 'GET',
1273
- url: `/api/cms-admin/fields/${id}`,
1274
- }, { apiName: this.apiName, ...config });
1275
- this.getList = (input, config) => this.restService.request({
1276
- method: 'GET',
1277
- url: '/api/cms-admin/fields',
1278
- params: { filter: input.filter, groupId: input.groupId, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount },
1279
- }, { apiName: this.apiName, ...config });
1280
- this.nameExists = (name, config) => this.restService.request({
1281
- method: 'GET',
1282
- url: `/api/cms-admin/fields/name-exists/${name}`,
1283
- }, { apiName: this.apiName, ...config });
1284
- this.update = (id, input, config) => this.restService.request({
1285
- method: 'PUT',
1286
- url: `/api/cms-admin/fields/${id}`,
1287
- body: input,
1288
- }, { apiName: this.apiName, ...config });
1289
- }
1290
- 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 }); }
1291
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAdminService, providedIn: 'root' }); }
1292
- }
1293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldAdminService, decorators: [{
1294
- type: Injectable,
1295
- args: [{
1296
- providedIn: 'root',
1297
- }]
1298
- }], ctorParameters: () => [{ type: i1.RestService }] });
1299
-
1300
- class FieldGroupComponent {
1301
- constructor(fb, _FieldGroupAdminService, toaster, confirmation, _FieldAbstractsService, _LocalizationService) {
1302
- this.fb = fb;
1303
- this._FieldGroupAdminService = _FieldGroupAdminService;
1304
- this.toaster = toaster;
1305
- this.confirmation = confirmation;
1306
- this._FieldAbstractsService = _FieldAbstractsService;
1307
- this._LocalizationService = _LocalizationService;
1308
- /**表单已存在的值 */
1309
- this.selected = {};
1310
- /**选择的字段分组id */
1311
- this.fieldGroupId = '';
1312
- /**创建分组模态框状态 */
1313
- this.createGroupOpen = false;
1314
- /**用于确定模态的繁忙状态是否为真 */
1315
- this.modalBusy = false;
1316
- /**编辑分组模态框状态 */
1317
- this.editGroupOpen = false;
1318
- /**点击分组回调 */
1319
- this.OnGroupClickBack = new EventEmitter();
1320
- this._ValidatorsService = inject(ValidatorsService);
1321
- /**表单验证状态
1322
- * {
1323
- * title:true,
1324
- * }
1325
- */
1326
- this.formValidation = '';
1327
- }
1328
- ngOnInit() {
1329
- this._FieldAbstractsService.getfieldGroupList();
1330
- }
1331
- /**创建字段分组 */
1332
- createGroupBtn() {
1333
- this.createGroupOpen = true;
1334
- this.formValidation = '';
1335
- this.createForm = this.fb.group({
1336
- name: ['', [Validators.required]],
1337
- });
1338
- }
1339
- /**创建分组模态框状态改变 */
1340
- createGroupVisibleChange(event) {
1341
- if (!event) {
1342
- return;
1343
- }
1344
- }
1345
- /**编辑字段分组 */
1346
- editGroupBtn(itemName) {
1347
- this.editGroupOpen = true;
1348
- this.formValidation = '';
1349
- this.editGroupForm = this.fb.group({
1350
- name: [itemName, [Validators.required]],
1351
- });
1352
- }
1353
- /**编辑分组模态框状态改变 */
1354
- editGroupVisibleChange(event) {
1355
- if (!event) {
1356
- return;
1357
- }
1358
- }
1359
- /**创建字段分组保存 */
1360
- createSave() {
1361
- let input = this.createForm.value;
1362
- this.modalBusy = true;
1363
- this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createForm);
1364
- if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1365
- return;
1366
- this._FieldGroupAdminService.create(input).pipe(finalize$1(() => {
1367
- this.modalBusy = false;
1368
- this.createGroupOpen = false;
1369
- this.formValidation = '';
1370
- })).subscribe(res => {
1371
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1372
- this._FieldAbstractsService.getfieldGroupList();
1373
- });
1374
- }
1375
- /**编辑字段分组保存 */
1376
- editSave() {
1377
- let input = this.editGroupForm.value;
1378
- this.modalBusy = true;
1379
- this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createForm);
1380
- if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1381
- return;
1382
- this._FieldGroupAdminService.update(this.fieldGroupId, input).pipe(finalize$1(() => {
1383
- this.modalBusy = false;
1384
- this.editGroupOpen = false;
1385
- this.formValidation = '';
1386
- })).subscribe(res => {
1387
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1388
- this._FieldAbstractsService.getfieldGroupList();
1389
- });
1390
- }
1391
- /**删除字段分组1 */
1392
- deleteGroupbtn(fieldGroupitem) {
1393
- this.confirmation.warn(fieldGroupitem.name, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
1394
- if (status == 'confirm') {
1395
- this._FieldGroupAdminService.delete(this.fieldGroupId).pipe(finalize$1(() => {
1396
- })).subscribe(res => {
1397
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1398
- this.fieldGroupId = '';
1399
- this._FieldAbstractsService.getfieldGroupList();
1400
- });
1401
- }
1402
- });
1403
- }
1404
- /**字段分组改变 */
1405
- fieldGroupChange(event) {
1406
- this.fieldGroupId = event;
1407
- this.OnGroupClickBack.emit(event);
1408
- }
1409
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldGroupAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: FieldAbstractsService }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component }); }
1410
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FieldGroupComponent, selector: "cms-field-group", outputs: { OnGroupClickBack: "OnGroupClickBack" }, ngImport: i0, template: "<div class=\"card-header px-2 py-sm-2 d-flex justify-content-between align-items-center\">\n <h6 class=\"h6 mb-0\">{{'Cms::FieldGroup' | abpLocalization}}</h6>\n <button type=\"button\" class=\"btn btn-link btn-sm ms-2\"><i class=\"fas fa-plus-circle\" aria-hidden=\"true\"\n (click)=\"createGroupBtn()\"></i></button>\n</div>\n<div class=\"card-body p-0\">\n <div class=\"container-height overflow-auto\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item list-group-item-action active\" [class.active]=\"fieldGroupId===''\"\n (click)=\"fieldGroupChange('')\">{{'Cms::AllFields' | abpLocalization}}</li>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <li class=\"list-group-item list-group-item-action d-flex justify-content-between align-items-center\"\n [class.active]=\"fieldGroupId===item.id\" (click)=\"fieldGroupChange(item.id)\">\n <div>{{item.name}}</div>\n <div *ngIf=\"fieldGroupId===item.id\">\n <i class=\"fas fa-trash px-1\" role=\"button\" (click.stop)=\"deleteGroupbtn(item)\"></i>\n <i class=\"fas fa-edit px-1\" role=\"button\" (click.stop)=\"editGroupBtn(item.name)\"></i>\n </div>\n </li>\n </ng-container>\n </ul>\n </div>\n</div>\n\n<abp-modal [(visible)]=\"createGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"createGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'Cms::New' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"createForm; else loaderRef\" [formGroup]=\"createForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"createSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"createForm?.invalid\" (click)=\"createSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n<abp-modal [(visible)]=\"editGroupOpen\" [busy]=\"modalBusy\" (visibleChange)=\"editGroupVisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <form *ngIf=\"editGroupForm; else loaderRef\" [formGroup]=\"editGroupForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"editSave()\">\n <div class=\"mb-3\">\n <label for=\"exampleFormControlInput1\" class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" id=\"exampleFormControlInput1\" formControlName=\"name\"\n placeholder=\"\">\n </div>\n </form>\n </ng-template>\n\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"editGroupForm?.invalid\" (click)=\"editSave()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1411
- }
1412
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldGroupComponent, decorators: [{
1413
- type: Component,
1414
- 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>" }]
1415
- }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: FieldGroupAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: FieldAbstractsService }, { type: i1.LocalizationService }], propDecorators: { OnGroupClickBack: [{
1416
- type: Output
1417
- }] } });
1418
-
1419
- class FieldsComponent {
1420
- constructor(list, _FieldAdminService, toaster, confirmation, _LocalizationService, router) {
1421
- this.list = list;
1422
- this._FieldAdminService = _FieldAdminService;
1423
- this.toaster = toaster;
1424
- this.confirmation = confirmation;
1425
- this._LocalizationService = _LocalizationService;
1426
- this.router = router;
1427
- this._UpdateListService = inject(UpdateListService);
1428
- /**表格单元格布局类型 */
1429
- this.ColumnMode = ColumnMode;
1430
- /**表格数据 */
1431
- this.data = {
1432
- items: [],
1433
- totalCount: 0,
1434
- };
1435
- /**过滤器 */
1436
- this.filters = {};
1437
- }
1438
- ngOnInit() {
1439
- this.hookToQuery();
1440
- this._UpdateListService.updateListEvent.subscribe(() => {
1441
- this.list.get();
1442
- });
1443
- }
1444
- getData() {
1445
- this.list.get();
1446
- }
1447
- /**字段分组选择回调 */
1448
- fieldGroupChange(event) {
1449
- this.filters.groupId = event;
1450
- this.list.page = 0;
1451
- this.list.get();
1452
- }
1453
- /**使用abp的list获取表格的字段数据列表 */
1454
- hookToQuery() {
1455
- const getData = (query) => this._FieldAdminService.getList({
1456
- ...query,
1457
- ...this.filters,
1458
- });
1459
- const setData = (list) => (this.data = list);
1460
- this.list.hookToQuery(getData).subscribe(setData);
1461
- }
1462
- /**新建字段按钮 */
1463
- toFieldsCreateBtn() {
1464
- this.router.navigate(['/cms/admin/fields/create'], {
1465
- queryParams: {}
1466
- });
1467
- }
1468
- /**删除字段 */
1469
- deletefield(row) {
1470
- this.confirmation.warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`)).subscribe((status) => {
1471
- if (status == 'confirm') {
1472
- this._FieldAdminService.delete(row.id).pipe(finalize(() => {
1473
- })).subscribe(res => {
1474
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1475
- this.list.get();
1476
- });
1477
- }
1478
- });
1479
- }
1480
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldsComponent, deps: [{ token: i1.ListService }, { token: FieldAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1.LocalizationService }, { token: i3$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
1481
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: FieldsComponent, selector: "cms-fields", providers: [
1482
- // [Required]
1483
- ListService,
1484
- // [Optional]
1485
- // Provide this token if you want a different debounce time.
1486
- // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1487
- { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1488
- {
1489
- provide: EXTENSIONS_IDENTIFIER,
1490
- useValue: ECmsComponent.Fields,
1491
- },
1492
- ], ngImport: i0, template: "<abp-page [title]=\"'Cms::Fields' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"fields-page\">\n <div class=\"row \">\n <div class=\"col-3\">\n <div class=\"card mb-0\" style=\"height: 100%;\">\n <cms-field-group (OnGroupClickBack)=\"fieldGroupChange($event)\"></cms-field-group>\n </div>\n </div>\n <div class=\"col-9\">\n <div class=\"card mb-0\">\n <div class=\"card-header px-2 py-sm-2 border-bottom\">\n <div class=\"input-group\">\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\"\n (click)=\"list.get()\"><i class=\"fa fa-search\"></i></button>\n </div>\n </div>\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\"\n [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::FormControlName' | abpLocalization\"\n prop=\"formControlName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Group' | abpLocalization\" prop=\"groupId\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{row.groupName}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [width]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value|date:'YYYY/MM/dd HH:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\n [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\"\n ngbDropdownToggle> <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}</button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n routerLink=\"/cms/admin/fields/{{row.id}}/edit\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"deletefield(row)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</abp-page>", styles: ["::ng-deep .fields-page .dignite_page{background:transparent}::ng-deep .fields-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .fields-page .container-height{height:calc(100vh - 200px)}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "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: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "component", type: FieldGroupComponent, selector: "cms-field-group", outputs: ["OnGroupClickBack"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1493
- }
1494
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: FieldsComponent, decorators: [{
1495
- type: Component,
1496
- args: [{ selector: 'cms-fields', providers: [
1497
- // [Required]
1498
- ListService,
1499
- // [Optional]
1500
- // Provide this token if you want a different debounce time.
1501
- // Default is 300. Cannot be 0. Any value below 100 is not recommended.
1502
- { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
1503
- {
1504
- provide: EXTENSIONS_IDENTIFIER,
1505
- useValue: ECmsComponent.Fields,
1506
- },
1507
- ], template: "<abp-page [title]=\"'Cms::Fields' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"fields-page\">\n <div class=\"row \">\n <div class=\"col-3\">\n <div class=\"card mb-0\" style=\"height: 100%;\">\n <cms-field-group (OnGroupClickBack)=\"fieldGroupChange($event)\"></cms-field-group>\n </div>\n </div>\n <div class=\"col-9\">\n <div class=\"card mb-0\">\n <div class=\"card-header px-2 py-sm-2 border-bottom\">\n <div class=\"input-group\">\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\"\n (click)=\"list.get()\"><i class=\"fa fa-search\"></i></button>\n </div>\n </div>\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\"\n [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::FormControlName' | abpLocalization\"\n prop=\"formControlName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Group' | abpLocalization\" prop=\"groupId\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{row.groupName}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [width]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value|date:'YYYY/MM/dd HH:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\"\n [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\"\n ngbDropdownToggle> <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}</button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem\n routerLink=\"/cms/admin/fields/{{row.id}}/edit\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"deletefield(row)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n</abp-page>", styles: ["::ng-deep .fields-page .dignite_page{background:transparent}::ng-deep .fields-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .fields-page .container-height{height:calc(100vh - 200px)}\n"] }]
1508
- }], ctorParameters: () => [{ type: i1.ListService }, { type: FieldAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1.LocalizationService }, { type: i3$1.Router }] });
1509
-
1510
- class CreateOrUpdateFieldInputBase {
1511
- constructor(data) {
1512
- /**分组id */
1513
- this.groupId = ['', []];
1514
- /**字段名称 Display name of this field */
1515
- this.displayName = ['', [Validators.required]];
1516
- /**字段唯一名称 Unique Name*/
1517
- this.name = ['', [Validators.required]];
1518
- /**描述 说明 */
1519
- this.description = ['', []];
1520
- /**FieldType字段类型 表单控件名称 */
1521
- this.formControlName = [undefined, [Validators.required]];
1522
- /**动态表单配置 */
1523
- this.formConfiguration = new FormGroup({});
1524
- if (data) {
1525
- for (const key in data) {
1526
- if (data.hasOwnProperty(key)) {
1527
- this[key] = data[key];
1528
- }
1529
- }
1530
- }
1531
- }
1532
- }
1533
-
1534
- class CreateOrEditFieldComponent {
1535
- constructor(_FieldAbstractsService, _CmsApiService, _FieldAdminService, _LocalizationService) {
1536
- this._FieldAbstractsService = _FieldAbstractsService;
1537
- this._CmsApiService = _CmsApiService;
1538
- this._FieldAdminService = _FieldAdminService;
1539
- this._LocalizationService = _LocalizationService;
1540
- if (this._FieldAbstractsService.fieldGroupList.length == 0) {
1541
- this._FieldAbstractsService.getfieldGroupList();
1542
- }
1543
- }
1544
- set Entity(v) {
1545
- if (v) {
1546
- this._Entity = v;
1547
- this.dataLoaded();
1548
- }
1549
- }
1550
- get formControlName() {
1551
- return this._Entity.get('formControlName');
1552
- }
1553
- set selected(v) {
1554
- if (v) {
1555
- this._selected = v || '';
1556
- this._selected_copy = v;
1557
- this.dataLoaded();
1558
- }
1559
- }
1560
- async dataLoaded() {
1561
- if (this._FieldAbstractsService.fromControlList.length == 0) {
1562
- await this._FieldAbstractsService.getFromControlList();
1563
- }
1564
- if (this._Entity) {
1565
- if (!this.formControlName.value) {
1566
- this._Entity.patchValue({
1567
- formControlName: this._FieldAbstractsService.fromControlList[0]?.name,
1568
- });
1569
- }
1570
- this._Entity.setControl('name', new FormControl(this.nameInput.value || '', {
1571
- validators: Validators.required,
1572
- asyncValidators: [this.repetitionAsyncValidator()],
1573
- updateOn: 'change'
1574
- }));
1575
- this.submitclick?.nativeElement?.click();
1576
- }
1577
- }
1578
- /**name表单控件 */
1579
- get nameInput() {
1580
- return this._Entity.get('name');
1581
- }
1582
- nameInputBlur(event) {
1583
- let value = event.target.value;
1584
- this.nameInput.patchValue(value);
1585
- }
1586
- /**字段标签input失去标点生成字段名字 */
1587
- disPlayNameInputBlur(event) {
1588
- let value = event.target.value;
1589
- let pinyin = this._CmsApiService.chineseToPinyin(value);
1590
- let nameInput = this.nameInput;
1591
- if (nameInput.value)
1592
- return;
1593
- nameInput.patchValue(pinyin);
1594
- }
1595
- /**定义异步验证方法 */
1596
- repetitionAsyncValidator() {
1597
- return (ctrl) => {
1598
- return new Promise(resolve => {
1599
- if (ctrl.value == this._selected?.name || !ctrl.value) {
1600
- resolve(null);
1601
- return;
1602
- }
1603
- this._FieldAdminService.nameExists(ctrl.value).subscribe(res => {
1604
- if (res) {
1605
- resolve({ repetition: this._LocalizationService.instant(`Cms::FieldName{0}AlreadyExist`, ctrl.value) });
1606
- }
1607
- else {
1608
- resolve(null);
1609
- }
1610
- });
1611
- });
1612
- };
1613
- }
1614
- formControlNameChange(event) {
1615
- // this._selected='';
1616
- }
1617
- 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 }); }
1618
- 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 \n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"groupId\">{{'Cms::FieldGroup' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"groupId\">\n <option value=\"\">{{'Cms::OptionalGrouping' | abpLocalization}}</option>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <option [value]=\"item.id\">{{item.name}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'DigniteAbpForms::FieldDisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" required (blur)=\"disPlayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" (input)=\"nameInputBlur($event)\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">{{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"formControlNameChange($event)\">\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fromControlList;let i =index\">\n <option [value]=\"item.name\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"_Entity.value.formControlName&&_Entity\"> \n <df-dynamic [type]=\"_Entity.value.formControlName\" [entity]=\"_Entity\" [selected]=\"_selected\"></df-dynamic>\n </ng-container>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
1619
- }
1620
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditFieldComponent, decorators: [{
1621
- type: Component,
1622
- args: [{ selector: 'cms-create-or-edit-field', template: "<form [formGroup]=\"_Entity\">\n \n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"groupId\">{{'Cms::FieldGroup' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"groupId\">\n <option value=\"\">{{'Cms::OptionalGrouping' | abpLocalization}}</option>\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fieldGroupList\">\n <option [value]=\"item.id\">{{item.name}}</option>\n </ng-container>\n </select>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'DigniteAbpForms::FieldDisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" required (blur)=\"disPlayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" (input)=\"nameInputBlur($event)\">\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">{{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"formControlNameChange($event)\">\n <ng-container *ngFor=\"let item of _FieldAbstractsService.fromControlList;let i =index\">\n <option [value]=\"item.name\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"_Entity.value.formControlName&&_Entity\"> \n <df-dynamic [type]=\"_Entity.value.formControlName\" [entity]=\"_Entity\" [selected]=\"_selected\"></df-dynamic>\n </ng-container>\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n</form>" }]
1623
- }], ctorParameters: () => [{ type: FieldAbstractsService }, { type: CmsApiService }, { type: FieldAdminService }, { type: i1.LocalizationService }], propDecorators: { FormDynamicRef: [{
1624
- type: ViewChild,
1625
- args: ['FormDynamicRef', { read: ViewContainerRef, static: true }]
1626
- }], submitclick: [{
1627
- type: ViewChild,
1628
- args: ['submitclick', { static: true }]
1629
- }], Entity: [{
1630
- type: Input
1631
- }], selected: [{
1632
- type: Input
1633
- }] } });
1634
-
1635
- class CreateFieldComponent {
1636
- constructor(fb, _FieldAdminService, toaster, _location, _LocalizationService, _CmsApiService) {
1637
- this.fb = fb;
1638
- this._FieldAdminService = _FieldAdminService;
1639
- this.toaster = toaster;
1640
- this._location = _location;
1641
- this._LocalizationService = _LocalizationService;
1642
- this._CmsApiService = _CmsApiService;
1643
- this._UpdateListService = inject(UpdateListService);
1644
- this.isSubmit = false;
1645
- this._ValidatorsService = inject(ValidatorsService);
1646
- /**表单验证状态
1647
- * {
1648
- * title:true,
1649
- * }
1650
- */
1651
- this.formValidation = '';
1652
- }
1653
- ngOnInit() {
1654
- //Called after the constructor, initializing input properties, and the first call to ngOnChanges.
1655
- //Add 'implements OnInit' to the class.
1656
- this.newEntity = this.fb.group(new CreateOrUpdateFieldInputBase());
1657
- }
1658
- /**触发提交按钮 */
1659
- submitclickBtn() {
1660
- this.isSubmit = true;
1661
- this.submitclick.nativeElement.click();
1662
- }
1663
- /**保存表单 */
1664
- save() {
1665
- let input = this.newEntity.value;
1666
- // if (!this.isSubmit) return;
1667
- this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1668
- if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1669
- return;
1670
- if (!this.newEntity.valid)
1671
- return;
1672
- this._FieldAdminService.create(input).subscribe(res => {
1673
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1674
- this._location.back();
1675
- this._UpdateListService.updateList();
1676
- });
1677
- }
1678
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateFieldComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldAdminService }, { token: i3.ToasterService }, { token: i2.Location }, { token: i1.LocalizationService }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
1679
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateFieldComponent, selector: "cms-create-field", providers: [
1680
- {
1681
- provide: EXTENSIONS_IDENTIFIER,
1682
- useValue: ECmsComponent.FieldsCreate,
1683
- },
1684
- ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"'Cms::CreateField' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"create-field-page\">\n <button form-type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card\">\n <div class=\"card-body\">\n <cms-create-or-edit-field [Entity]=\"newEntity\"></cms-create-or-edit-field>\n </div>\n </div>\n </div>\n </abp-page>\n</form>", styles: ["::ng-deep .create-field-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-field-page .form-control,::ng-deep .create-field-page .form-select{padding:.475rem 1.25rem}\n"], dependencies: [{ kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.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" }] }); }
1685
- }
1686
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateFieldComponent, decorators: [{
1687
- type: Component,
1688
- args: [{ selector: 'cms-create-field', providers: [
1689
- {
1690
- provide: EXTENSIONS_IDENTIFIER,
1691
- useValue: ECmsComponent.FieldsCreate,
1692
- },
1693
- ], 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"] }]
1694
- }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: FieldAdminService }, { type: i3.ToasterService }, { type: i2.Location }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { submitclick: [{
1695
- type: ViewChild,
1696
- args: ['submitclick', { static: true }]
1697
- }] } });
1698
-
1699
- class EditFieldComponent {
1700
- constructor(fb, _FieldAbstractsService, _FieldAdminService, route, toaster, _location, _LocalizationService, _CmsApiService) {
1701
- this.fb = fb;
1702
- this._FieldAbstractsService = _FieldAbstractsService;
1703
- this._FieldAdminService = _FieldAdminService;
1704
- this.route = route;
1705
- this.toaster = toaster;
1706
- this._location = _location;
1707
- this._LocalizationService = _LocalizationService;
1708
- this._CmsApiService = _CmsApiService;
1709
- /**字段id */
1710
- this.fieldId = '';
1711
- this._UpdateListService = inject(UpdateListService);
1712
- this.isSubmit = false;
1713
- this._ValidatorsService = inject(ValidatorsService);
1714
- /**表单验证状态
1715
- * {
1716
- * title:true,
1717
- * }
1718
- */
1719
- this.formValidation = '';
1720
- }
1721
- async ngOnInit() {
1722
- const _fieldId = this.route.snapshot.params.id;
1723
- if (_fieldId) {
1724
- this.fieldId = _fieldId;
1725
- this.newEntity = this.fb.group(new CreateOrUpdateFieldInputBase());
1726
- await Promise.all([this._FieldAbstractsService.getFromControlList(), this.getFieldEdit()]);
1727
- this.newEntity.patchValue({
1728
- ...this.fieldDetails,
1729
- formConfiguration: this.fieldDetails.formConfiguration,
1730
- });
1731
- }
1732
- }
1733
- /**获取字段详情 */
1734
- getFieldEdit() {
1735
- return new Promise((resolve, reject) => {
1736
- this._FieldAdminService.get(this.fieldId).subscribe(res => {
1737
- res.groupId = res.groupId ? res.groupId : '';
1738
- this.fieldDetails = res;
1739
- resolve(res);
1740
- });
1741
- });
1742
- }
1743
- /**触发提交按钮 */
1744
- submitclickBtn() {
1745
- this.isSubmit = true;
1746
- this.submitclick.nativeElement.click();
1747
- }
1748
- /**保存表单 */
1749
- save() {
1750
- let input = this.newEntity.value;
1751
- if (!this.isSubmit)
1752
- return;
1753
- this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
1754
- if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1755
- return;
1756
- if (!this.newEntity.valid)
1757
- return;
1758
- this._FieldAdminService.update(this.fieldId, input).subscribe(res => {
1759
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1760
- this._location.back();
1761
- this._UpdateListService.updateList();
1762
- });
1763
- }
1764
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditFieldComponent, deps: [{ token: i1$1.FormBuilder }, { token: FieldAbstractsService }, { token: FieldAdminService }, { token: i3$1.ActivatedRoute }, { token: i3.ToasterService }, { token: i2.Location }, { token: i1.LocalizationService }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
1765
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EditFieldComponent, selector: "cms-edit-field", providers: [
1766
- {
1767
- provide: EXTENSIONS_IDENTIFIER,
1768
- useValue: ECmsComponent.FieldsEdit,
1769
- },
1770
- ], 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()\" (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=\"p-3 bg-white rounded-1\"> -->\n <div class=\"card\">\n <div class=\"card-body\">\n <ng-container *ngIf=\"newEntity&&fieldDetails\">\n <cms-create-or-edit-field [Entity]=\"newEntity\"\n [selected]=\"fieldDetails\"></cms-create-or-edit-field>\n </ng-container>\n </div>\n </div>\n </div>\n </abp-page>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$1.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" }] }); }
1771
- }
1772
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EditFieldComponent, decorators: [{
1773
- type: Component,
1774
- args: [{ selector: 'cms-edit-field', providers: [
1775
- {
1776
- provide: EXTENSIONS_IDENTIFIER,
1777
- useValue: ECmsComponent.FieldsEdit,
1778
- },
1779
- ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" (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=\"p-3 bg-white rounded-1\"> -->\n <div class=\"card\">\n <div class=\"card-body\">\n <ng-container *ngIf=\"newEntity&&fieldDetails\">\n <cms-create-or-edit-field [Entity]=\"newEntity\"\n [selected]=\"fieldDetails\"></cms-create-or-edit-field>\n </ng-container>\n </div>\n </div>\n </div>\n </abp-page>\n</form>" }]
1780
- }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: FieldAbstractsService }, { type: FieldAdminService }, { type: i3$1.ActivatedRoute }, { type: i3.ToasterService }, { type: i2.Location }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { submitclick: [{
1781
- type: ViewChild,
1782
- args: ['submitclick', { static: true }]
1783
- }] } });
1784
-
1785
- var SectionType;
1786
- (function (SectionType) {
1787
- SectionType[SectionType["Single"] = 0] = "Single";
1788
- SectionType[SectionType["Structure"] = 1] = "Structure";
1789
- SectionType[SectionType["Channel"] = 2] = "Channel";
1790
- })(SectionType || (SectionType = {}));
1791
- const sectionTypeOptions = mapEnumToOptions(SectionType);
1792
-
1793
- class CreateOrUpdateSectionsInputBase {
1794
- constructor(data) {
1795
- /**版块类型 */
1796
- this.type = [0, [Validators.required]];
1797
- /**字段名称 Display name of this field */
1798
- this.displayName = ['', [Validators.required]];
1799
- /**字段唯一名称 Unique Name*/
1800
- this.name = ['', [Validators.required]];
1801
- /**条目路由 */
1802
- this.route = ['', [Validators.required]];
1803
- /**页面模板 */
1804
- this.template = ['', [Validators.required]];
1805
- /**是否默认 */
1806
- this.isDefault = [false, []];
1807
- /**是否激活 */
1808
- this.isActive = [true, []];
1809
- if (data) {
1810
- for (const key in data) {
1811
- if (data.hasOwnProperty(key)) {
1812
- this[key] = data[key];
1813
- }
1814
- }
1815
- }
1816
- }
1817
- }
1818
-
1819
- class SectionsComponent {
1820
- constructor(list, _SectionAdminService, toaster, confirmation, fb, _EntryTypeAdminService, _LocalizationService, _CmsApiService) {
1821
- this.list = list;
1822
- this._SectionAdminService = _SectionAdminService;
1823
- this.toaster = toaster;
1824
- this.confirmation = confirmation;
1825
- this.fb = fb;
1826
- this._EntryTypeAdminService = _EntryTypeAdminService;
1827
- this._LocalizationService = _LocalizationService;
1828
- this._CmsApiService = _CmsApiService;
1829
- this._UpdateListService = inject(UpdateListService);
1830
- this.siteList = [];
1831
- this.ColumnMode = ColumnMode;
1832
- this.data = { items: [], totalCount: 0 };
1833
- this.filters = {};
1834
- this.visibleOpen = false;
1835
- this.modalBusy = false;
1836
- this._SectionType = SectionType;
1837
- this._sectionTypeOptions = sectionTypeOptions;
1838
- this._ValidatorsService = inject(ValidatorsService);
1839
- /**表单验证状态
1840
- * {
1841
- * title:true,
1842
- * }
1843
- */
1844
- this.formValidation = '';
1845
- }
1846
- hookToQuery() {
1847
- const getData = (query) => this._SectionAdminService.getList({ ...query, ...this.filters });
1848
- const setData = (list) => (this.data = list);
1849
- this.list.hookToQuery(getData).subscribe(setData);
1850
- }
1851
- async ngOnInit() {
1852
- this.hookToQuery();
1853
- this._UpdateListService.updateListEvent.subscribe(() => {
1854
- this.list.get();
1855
- });
1856
- }
1857
- siteIdChange() {
1858
- this.list.page = 0;
1859
- this.list.get();
1860
- }
1861
- VisibleChange(event) {
1862
- if (!event) {
1863
- this.selected = '';
1864
- return;
1865
- }
1866
- }
1867
- createSectionBtn() {
1868
- this.visibleOpen = true;
1869
- this.createOrEditForm = this.fb.group(new CreateOrUpdateSectionsInputBase());
1870
- this.setAsyncValidatorsFn();
1871
- }
1872
- editSectionBtn(row) {
1873
- this.visibleOpen = true;
1874
- this.createOrEditForm = this.fb.group(new CreateOrUpdateSectionsInputBase());
1875
- this.setAsyncValidatorsFn();
1876
- this._SectionAdminService.get(row.id).subscribe(res => {
1877
- this.createOrEditForm.patchValue(res);
1878
- this.selected = res;
1879
- });
1880
- }
1881
- deleteEntryType(row) {
1882
- this.confirmation
1883
- .warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`))
1884
- .subscribe((status) => {
1885
- if (status == 'confirm') {
1886
- this._EntryTypeAdminService
1887
- .delete(row.id)
1888
- .pipe(finalize(() => { }))
1889
- .subscribe(res => {
1890
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1891
- this.list.get();
1892
- });
1893
- }
1894
- });
1895
- }
1896
- createOrEditSave() {
1897
- if (this.selected) {
1898
- return this.EditSave();
1899
- }
1900
- this.createSave();
1901
- }
1902
- createSave() {
1903
- let input = this.createOrEditForm.value;
1904
- this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createOrEditForm);
1905
- if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1906
- return;
1907
- if (!this.createOrEditForm.valid)
1908
- return;
1909
- this.modalBusy = true;
1910
- this._SectionAdminService
1911
- .create(input)
1912
- .pipe(finalize(() => {
1913
- this.modalBusy = false;
1914
- this.visibleOpen = false;
1915
- }))
1916
- .subscribe(res => {
1917
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1918
- this.list.get();
1919
- });
1920
- }
1921
- EditSave() {
1922
- setTimeout(() => {
1923
- let input = this.createOrEditForm.value;
1924
- input.concurrencyStamp = this.selected.concurrencyStamp;
1925
- this.formValidation = this._ValidatorsService.getFormValidationStatus(this.createOrEditForm);
1926
- if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
1927
- return;
1928
- if (!this.createOrEditForm.valid)
1929
- return;
1930
- this.modalBusy = true;
1931
- this._SectionAdminService
1932
- .update(this.selected.id, input)
1933
- .pipe(finalize(() => {
1934
- this.modalBusy = false;
1935
- this.visibleOpen = false;
1936
- }))
1937
- .subscribe(res => {
1938
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1939
- this.list.get();
1940
- });
1941
- }, 100);
1942
- }
1943
- deletefield(row) {
1944
- this.confirmation
1945
- .warn(row.displayName, this._LocalizationService.instant(`AbpUi::ItemWillBeDeletedMessage`))
1946
- .subscribe((status) => {
1947
- if (status == 'confirm') {
1948
- this._SectionAdminService
1949
- .delete(row.id)
1950
- .pipe(finalize(() => { }))
1951
- .subscribe(res => {
1952
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
1953
- this.list.get();
1954
- });
1955
- }
1956
- });
1957
- }
1958
- get displayNameInput() {
1959
- return this.createOrEditForm.get('displayName');
1960
- }
1961
- get nameInput() {
1962
- return this.createOrEditForm.get('name');
1963
- }
1964
- get routeInput() {
1965
- return this.createOrEditForm.get('route');
1966
- }
1967
- get templateInput() {
1968
- return this.createOrEditForm.get('template');
1969
- }
1970
- get typeInput() {
1971
- return this.createOrEditForm.get('type');
1972
- }
1973
- radiochange() {
1974
- this.routeInput.patchValue(this.routeInput.value);
1975
- }
1976
- disPlayNameInputBlur(event) {
1977
- let value = event.target.value;
1978
- let pinyin = this._CmsApiService.chineseToPinyin(value);
1979
- let nameInput = this.nameInput;
1980
- let routeInput = this.routeInput;
1981
- let templateInput = this.templateInput;
1982
- if (nameInput.value)
1983
- return;
1984
- nameInput.patchValue(pinyin);
1985
- if (routeInput.value)
1986
- return;
1987
- routeInput.patchValue(pinyin + (this.typeInput.value === 0 ? '' : '/{slug}'));
1988
- if (templateInput.value)
1989
- return;
1990
- templateInput.patchValue(pinyin + '/index');
1991
- }
1992
- setAsyncValidatorsFn() {
1993
- this.createOrEditForm.setControl('name', new FormControl(this.nameInput.value || '', {
1994
- validators: Validators.required,
1995
- asyncValidators: this.nameRepetitionAsyncValidator(),
1996
- }));
1997
- this.createOrEditForm.setControl('route', new FormControl(this.routeInput.value || '', {
1998
- validators: [Validators.required, this.forbiddenNameValidator()],
1999
- asyncValidators: [this.routeRepetitionAsyncValidator()],
2000
- }));
2001
- }
2002
- forbiddenNameValidator() {
2003
- return (control) => {
2004
- let inputValue = control.value.toLocaleLowerCase();
2005
- let forbidden = this.typeInput.value == 0 ? false : inputValue.includes('{slug}') ? false : true;
2006
- return forbidden
2007
- ? {
2008
- repetition: this._LocalizationService.instant(`Cms::RouteVerificationTips`, this._LocalizationService.instant(`Cms::Enum:SectionType:` + SectionType[this.typeInput.value]), '{slug}'),
2009
- }
2010
- : null;
2011
- };
2012
- }
2013
- nameRepetitionAsyncValidator() {
2014
- return (ctrl) => {
2015
- return new Promise(resolve => {
2016
- let subslug = this.createOrEditForm?.get('name');
2017
- if (subslug.value == this.selected?.name) {
2018
- resolve(null);
2019
- return;
2020
- }
2021
- this._SectionAdminService.nameExists({ name: subslug.value }).subscribe(res => {
2022
- if (res) {
2023
- resolve({
2024
- repetition: this._LocalizationService.instant(`Cms::SectionName{0}AlreadyExist`, ctrl.value),
2025
- });
2026
- }
2027
- else {
2028
- resolve(null);
2029
- }
2030
- });
2031
- });
2032
- };
2033
- }
2034
- routeRepetitionAsyncValidator() {
2035
- return (ctrl) => {
2036
- return new Promise(resolve => {
2037
- let subslug = this.createOrEditForm?.get('route').value;
2038
- if (subslug == this.selected?.route) {
2039
- resolve(null);
2040
- return;
2041
- }
2042
- this._SectionAdminService.routeExists({ route: subslug }).subscribe(res => {
2043
- if (res) {
2044
- resolve({
2045
- repetition: this._LocalizationService.instant(`Cms::SectionRoute{0}AlreadyExist`, ctrl.value),
2046
- });
2047
- }
2048
- else {
2049
- resolve(null);
2050
- }
2051
- });
2052
- });
2053
- };
2054
- }
2055
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionsComponent, deps: [{ token: i1.ListService }, { token: SectionAdminService }, { token: i3.ToasterService }, { token: i3.ConfirmationService }, { token: i1$1.FormBuilder }, { token: EntryTypeAdminService }, { token: i1.LocalizationService }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
2056
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: SectionsComponent, selector: "cms-sections", providers: [
2057
- // [Required]
2058
- ListService,
2059
- // [Optional]
2060
- // Provide this token if you want a different debounce time.
2061
- // Default is 300. Cannot be 0. Any value below 100 is not recommended.
2062
- { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
2063
- {
2064
- provide: EXTENSIONS_IDENTIFIER,
2065
- useValue: ECmsComponent.Sections,
2066
- },
2067
- ], viewQueries: [{ propertyName: "createOrEditModalSubmitBtn", first: true, predicate: ["createOrEditModalSubmitBtn"], descendants: true }], ngImport: i0, template: "<abp-page [title]=\"'Cms::Sections' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"sections-page\">\n <div class=\"card \" >\n <div class=\"card-body px-2 py-sm-2 border-bottom\">\n <div class=\"row align-items-end\">\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'Cms::IsActive' | abpLocalization}}\uFF1A</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"filters.isActive\" (change)=\"siteIdChange()\">\n <option [value]=\"\"></option>\n <option [value]=\"true\">\u662F</option>\n <option [value]=\"false\">\u5426</option>\n </select>\n </div>\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\n </div>\n <div class=\"mb-2 col-4\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"list.get()\">\n <i class=\"fa fa-search\"></i>\n </button>\n </div>\n </div> \n </div>\n </div>\n <div class=\"card mb-0\">\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::SectionType' | abpLocalization\" prop=\"type\" [width]=\"80\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{('Cms::Enum:SectionType:'+_SectionType[value]) | abpLocalization}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsDefault' | abpLocalization\" prop=\"isDefault\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsActive' | abpLocalization\" prop=\"isActive\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"SiteId\" [width]=\"100\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-link\" ngbDropdownToggle id=\"dropdownBasic1\">\n {{'Cms::EntryType' | abpLocalization}}\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <ng-container *ngFor=\"let item of row.entryTypes;let i =index\">\n <li ngbDropdownItem\n class=\"d-flex align-items-center justify-content-between\" [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/'+item.id+'/edit'\"\n >{{item.displayName}}\n <button class=\"btn btn-light btn-sm p-0\"\n (click.stop)=\"deleteEntryType(item)\"><i class=\"fas fa-trash p-sm-1\"\n style=\"font-size: 12px;\" role=\"button\"></i></button>\n </li>\n </ng-container>\n <li ngbDropdownItem [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/create'\"><i\n class=\"fas fa-plus-circle me-2\"></i>{{'Cms::New' |\n abpLocalization}}</li>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [minWidth]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'yyyy/MM/dd hh:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\" [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"110\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\n </button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem (click)=\"editSectionBtn(row)\">{{'AbpUi::Edit' |\n abpLocalization}}</button>\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\n abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n</abp-page>\n<abp-modal [(visible)]=\"visibleOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{selected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"createOrEditForm; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"createOrEditForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #createOrEditModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::EntryType' | abpLocalization}}</label>\n <div>\n <ng-container *ngFor=\"let item of _sectionTypeOptions;let i =index\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"item.value\"\n (change)=\"radiochange()\" formControlName=\"type\" id=\"flexRadioDefault{{i}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{i}}\">\n {{ 'Cms::Enum:SectionType:'+item.key | abpLocalization }}\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Route' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"route\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"routeInput.errors?.repetition\">\n {{routeInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">\n {{'Cms::RouteTips' | abpLocalization}}<br>\n &nbsp;&nbsp;blog<br>\n &nbsp;&nbsp;{{'blog/{slug}'}}<br>\n &nbsp;&nbsp;{{'blog/{publishTime:yyyy}/{publishTime:MM}/{slug}'}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Template' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"template\" placeholder=\"\" />\n <div class=\"form-text\">\n {{\"Cms::TemplateTips\" | abpLocalization}}\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isDefault\"\n id=\"isDefault\" />\n <label class=\"form-check-label\" for=\"isDefault\"> {{'Cms::Default' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isActive\"\n id=\"isActive\" />\n <label class=\"form-check-label\" for=\"isActive\"> {{'Cms::IsActive' | abpLocalization}}</label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"createOrEditModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' |\n abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .sections-page .dignite_page{background:transparent}::ng-deep .sections-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sections-page .card-header input{flex:2 1 auto}::ng-deep .sections-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "component", type: i8.DatatableComponent, selector: "ngx-datatable", inputs: ["targetMarkerTemplate", "rows", "groupRowsBy", "groupedRows", "columns", "selected", "scrollbarV", "scrollbarH", "rowHeight", "columnMode", "headerHeight", "footerHeight", "externalPaging", "externalSorting", "limit", "count", "offset", "loadingIndicator", "selectionType", "reorderable", "swapColumns", "sortType", "sorts", "cssClasses", "messages", "rowClass", "selectCheck", "displayCheck", "groupExpansionDefault", "trackByProp", "selectAllRowsOnPage", "virtualization", "treeFromRelation", "treeToRelation", "summaryRow", "summaryHeight", "summaryPosition", "rowIdentity"], outputs: ["scroll", "activate", "select", "sort", "page", "reorder", "resize", "tableContextmenu", "treeAction"] }, { kind: "directive", type: i8.DataTableColumnDirective, selector: "ngx-datatable-column", inputs: ["name", "prop", "frozenLeft", "frozenRight", "flexGrow", "resizeable", "comparator", "pipe", "sortable", "draggable", "canAutoResize", "minWidth", "width", "maxWidth", "checkboxable", "headerCheckboxable", "headerClass", "cellClass", "isTreeColumn", "treeLevelIndent", "summaryFunc", "summaryTemplate", "cellTemplate", "headerTemplate", "treeToggleTemplate"] }, { kind: "directive", type: i8.DataTableColumnCellDirective, selector: "[ngx-datatable-cell-template]" }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "directive", type: i3.NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: ["list"], exportAs: ["ngxDatatableList"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2068
- }
2069
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: SectionsComponent, decorators: [{
2070
- type: Component,
2071
- args: [{ selector: 'cms-sections', providers: [
2072
- // [Required]
2073
- ListService,
2074
- // [Optional]
2075
- // Provide this token if you want a different debounce time.
2076
- // Default is 300. Cannot be 0. Any value below 100 is not recommended.
2077
- { provide: LIST_QUERY_DEBOUNCE_TIME, useValue: 500 },
2078
- {
2079
- provide: EXTENSIONS_IDENTIFIER,
2080
- useValue: ECmsComponent.Sections,
2081
- },
2082
- ], template: "<abp-page [title]=\"'Cms::Sections' | abpLocalization\" [toolbar]=\"true\">\n <div class=\"sections-page\">\n <div class=\"card \" >\n <div class=\"card-body px-2 py-sm-2 border-bottom\">\n <div class=\"row align-items-end\">\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'Cms::IsActive' | abpLocalization}}\uFF1A</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"filters.isActive\" (change)=\"siteIdChange()\">\n <option [value]=\"\"></option>\n <option [value]=\"true\">\u662F</option>\n <option [value]=\"false\">\u5426</option>\n </select>\n </div>\n <div class=\"mb-2 col-3\">\n <label class=\"form-label\">{{'AbpUi::Search' | abpLocalization}}\uFF1A</label>\n <input type=\"text\" class=\"form-control\" [(ngModel)]=\"filters.filter\"\n [placeholder]=\"'AbpUi::Search' | abpLocalization\" />\n </div>\n <div class=\"mb-2 col-4\">\n <button class=\"btn btn-primary px-3\" type=\"button\" id=\"button-addon2\" (click)=\"list.get()\">\n <i class=\"fa fa-search\"></i>\n </button>\n </div>\n </div> \n </div>\n </div>\n <div class=\"card mb-0\">\n <div class=\"card-body p-0\">\n <div class=\"table-responsive table-fixed-header\">\n <ngx-datatable class=\"material \" [rows]=\"data.items\" [list]=\"list\"\n [columnMode]=\"ColumnMode.force\" [headerHeight]=\"50\" [footerHeight]=\"50\" rowHeight=\"auto\"\n [virtualization]=\"false\" [externalPaging]=\"true\" [count]=\"data.totalCount\" [scrollbarH]=\"true\">\n <ngx-datatable-column [name]=\"'Cms::DisplayName' | abpLocalization\" prop=\"displayName\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::Name' | abpLocalization\" prop=\"name\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::SectionType' | abpLocalization\" prop=\"type\" [width]=\"80\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{('Cms::Enum:SectionType:'+_SectionType[value]) | abpLocalization}}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsDefault' | abpLocalization\" prop=\"isDefault\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::IsActive' | abpLocalization\" prop=\"isActive\" [width]=\"60\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <i class=\"fas fa-check text-success\" *ngIf=\"value\"></i>\n <i class=\"fas fa-times text-danger\" *ngIf=\"!value\"></i>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::EntryType' | abpLocalization\" prop=\"SiteId\" [width]=\"100\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-link\" ngbDropdownToggle id=\"dropdownBasic1\">\n {{'Cms::EntryType' | abpLocalization}}\n </button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\">\n <ng-container *ngFor=\"let item of row.entryTypes;let i =index\">\n <li ngbDropdownItem\n class=\"d-flex align-items-center justify-content-between\" [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/'+item.id+'/edit'\"\n >{{item.displayName}}\n <button class=\"btn btn-light btn-sm p-0\"\n (click.stop)=\"deleteEntryType(item)\"><i class=\"fas fa-trash p-sm-1\"\n style=\"font-size: 12px;\" role=\"button\"></i></button>\n </li>\n </ng-container>\n <li ngbDropdownItem [routerLink]=\"'/cms/admin/sections/'+row.id+'/entry-types/create'\"><i\n class=\"fas fa-plus-circle me-2\"></i>{{'Cms::New' |\n abpLocalization}}</li>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [name]=\"'Cms::CreationTime' | abpLocalization\" prop=\"creationTime\" [minWidth]=\"190\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n {{ value | date : 'yyyy/MM/dd hh:mm:ss' }}\n </ng-template>\n </ngx-datatable-column>\n <ngx-datatable-column [sortable]=\"false\" [name]=\"'AbpUi::Actions' | abpLocalization\" [frozenLeft]=\"true\" [width]=\"110\" [maxWidth]=\"110\">\n <ng-template let-row=\"row\" let-value=\"value\" ngx-datatable-cell-template>\n <div ngbDropdown container=\"body\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" ngbDropdownToggle>\n <i class=\"me-1 fa fa-cog\"></i> {{'AbpUi::Actions' | abpLocalization}}\n </button>\n <div ngbDropdownMenu>\n <button ngbDropdownItem (click)=\"editSectionBtn(row)\">{{'AbpUi::Edit' |\n abpLocalization}}</button>\n <button ngbDropdownItem (click)=\"deletefield(row)\">{{'AbpUi::Delete' |\n abpLocalization}}</button>\n </div>\n </div>\n </ng-template>\n </ngx-datatable-column>\n </ngx-datatable>\n </div>\n </div>\n </div>\n </div>\n</abp-page>\n<abp-modal [(visible)]=\"visibleOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleChange($event)\">\n <ng-template #abpHeader>\n <h3>{{selected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"createOrEditForm; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"createOrEditForm\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #createOrEditModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::EntryType' | abpLocalization}}</label>\n <div>\n <ng-container *ngFor=\"let item of _sectionTypeOptions;let i =index\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" [value]=\"item.value\"\n (change)=\"radiochange()\" formControlName=\"type\" id=\"flexRadioDefault{{i}}\">\n <label class=\"form-check-label\" for=\"flexRadioDefault{{i}}\">\n {{ 'Cms::Enum:SectionType:'+item.key | abpLocalization }}\n </label>\n </div>\n </ng-container>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"nameInput.errors?.repetition\">\n {{nameInput.errors?.repetition}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Route' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"route\" placeholder=\"\" />\n <div class=\"text-danger invalid-feedback\" *ngIf=\"routeInput.errors?.repetition\">\n {{routeInput.errors?.repetition}}\n </div>\n <div class=\"form-text\">\n {{'Cms::RouteTips' | abpLocalization}}<br>\n &nbsp;&nbsp;blog<br>\n &nbsp;&nbsp;{{'blog/{slug}'}}<br>\n &nbsp;&nbsp;{{'blog/{publishTime:yyyy}/{publishTime:MM}/{slug}'}}\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Template' | abpLocalization}} </label>\n <input type=\"text\" class=\"form-control\" formControlName=\"template\" placeholder=\"\" />\n <div class=\"form-text\">\n {{\"Cms::TemplateTips\" | abpLocalization}}\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isDefault\"\n id=\"isDefault\" />\n <label class=\"form-check-label\" for=\"isDefault\"> {{'Cms::Default' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"isActive\"\n id=\"isActive\" />\n <label class=\"form-check-label\" for=\"isActive\"> {{'Cms::IsActive' | abpLocalization}}</label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" (click)=\"createOrEditModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' |\n abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .sections-page .dignite_page{background:transparent}::ng-deep .sections-page .list-group-flush>.list-group-item:first-child{border-top-width:var(--bs-list-group-border-width)}::ng-deep .sections-page .card-header input{flex:2 1 auto}::ng-deep .sections-page .card-header .form-select{padding:.475rem 3.75rem .475rem 1.25rem}::ng-deep .sites-modal-form .form-control{padding:.4rem 1.25rem}\n"] }]
2083
- }], ctorParameters: () => [{ type: i1.ListService }, { type: SectionAdminService }, { type: i3.ToasterService }, { type: i3.ConfirmationService }, { type: i1$1.FormBuilder }, { type: EntryTypeAdminService }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { createOrEditModalSubmitBtn: [{
2084
- type: ViewChild,
2085
- args: ['createOrEditModalSubmitBtn', { static: false }]
2086
- }] } });
2087
-
2088
- class CreateOrEditEntryTypeInputBase {
2089
- constructor(data) {
2090
- /**显示名称 Display name of this field */
2091
- this.displayName = ['', [Validators.required]];
2092
- /**名称 Unique Name*/
2093
- this.name = ['', [Validators.required]];
2094
- /**条目路由 */
2095
- this.fieldTabs = new FormArray([]);
2096
- if (data) {
2097
- for (const key in data) {
2098
- if (data.hasOwnProperty(key)) {
2099
- this[key] = data[key];
2100
- }
2101
- }
2102
- }
2103
- }
2104
- }
2105
- class fieldTabsBase {
2106
- constructor(data) {
2107
- /**名称 Unique Name*/
2108
- this.name = ['', [Validators.required]];
2109
- this.fields = [[], []];
2110
- if (data) {
2111
- for (const key in data) {
2112
- if (data.hasOwnProperty(key)) {
2113
- this[key] = data[key];
2114
- }
2115
- }
2116
- }
2117
- }
2118
- }
2119
- class fieldsBase {
2120
- constructor(data) {
2121
- /**字段id Unique Name*/
2122
- this.fieldId = ['', [Validators.required]];
2123
- /**显示名称 Unique Name*/
2124
- this.displayName = ['', [Validators.required]];
2125
- /**必填 Unique Name*/
2126
- this.required = [false, []];
2127
- /**是否在列表中显示 Unique Name*/
2128
- this.showOnList = [false, []];
2129
- if (data) {
2130
- for (const key in data) {
2131
- if (data.hasOwnProperty(key)) {
2132
- this[key] = data[key];
2133
- }
2134
- }
2135
- }
2136
- }
2137
- }
2138
- class fieldsInputBase {
2139
- constructor(data) {
2140
- /**字段id */
2141
- this.fieldId = ['', [Validators.required]];
2142
- /**显示名称 Display name of this field */
2143
- this.displayName = ['', [Validators.required]];
2144
- /**是否必填 Unique Name*/
2145
- this.required = [false, []];
2146
- /**在列表中展示 Unique Name*/
2147
- this.showOnList = [false, []];
2148
- if (data) {
2149
- for (const key in data) {
2150
- if (data.hasOwnProperty(key)) {
2151
- this[key] = data[key];
2152
- }
2153
- }
2154
- }
2155
- }
2156
- }
2157
-
2158
- class CreateOrEditComponent {
2159
- constructor(toaster, _location, route, _FieldGroupAdminService, _FieldAdminService, _EntryTypeAdminService, _LocalizationService, _CmsApiService) {
2160
- this.toaster = toaster;
2161
- this._location = _location;
2162
- this.route = route;
2163
- this._FieldGroupAdminService = _FieldGroupAdminService;
2164
- this._FieldAdminService = _FieldAdminService;
2165
- this._EntryTypeAdminService = _EntryTypeAdminService;
2166
- this._LocalizationService = _LocalizationService;
2167
- this._CmsApiService = _CmsApiService;
2168
- this.fb = inject(FormBuilder);
2169
- this._UpdateListService = inject(UpdateListService);
2170
- /**表单实体 */
2171
- this.newEntity = this.fb.group(new CreateOrEditEntryTypeInputBase());
2172
- /**版块id */
2173
- this.sectionId = '';
2174
- /**条目类型id */
2175
- this.entryTypesId = '';
2176
- /**
2177
- * 拖拽 功能*/
2178
- /**数据源 */
2179
- /**数据源-字段分组数据-包含字段数据 fields */
2180
- this.fieldGroupList = [];
2181
- /**数据源-所有字段列表 */
2182
- this.fieldList = [];
2183
- /**目标源 结果*/
2184
- this.resultSource = [];
2185
- /**来自数据源的集合,用于从目标源拖回数据源时的判断,与取值 */
2186
- this.formRightGroup = [];
2187
- this._ValidatorsService = inject(ValidatorsService);
2188
- /**表单验证状态
2189
- * {
2190
- * title:true,
2191
- * }
2192
- */
2193
- this.formValidation = '';
2194
- /**模态框状态 */
2195
- this.visibleTabsOpen = false;
2196
- /**是否是忙碌状态 */
2197
- this.modalBusy = false;
2198
- /**正在选中的nav */
2199
- this.navActive = 0;
2200
- /**编辑字段模态框状态 */
2201
- this.visibleEditFieldOpen = false;
2202
- }
2203
- get fieldTabs() {
2204
- return this.newEntity.get('fieldTabs');
2205
- }
2206
- /**触发提交按钮 */
2207
- submitclickBtn() {
2208
- this.submitclick.nativeElement.click();
2209
- }
2210
- ngOnInit() {
2211
- let sectionId = this.route.snapshot.params.sectionsId;
2212
- this.entryTypesId = this.route.snapshot.params.entryTypesId || '';
2213
- if (sectionId) {
2214
- this.sectionId = sectionId;
2215
- this.addControlToFieldTabs();
2216
- this.getFieldGroup();
2217
- }
2218
- }
2219
- /**给fieldTabs添加新控件 */
2220
- addControlToFieldTabs(nameValue = '') {
2221
- const newFormGroup = this.fb.group(new fieldTabsBase({
2222
- name: this.fieldTabs.length === 0
2223
- ? this._LocalizationService.instant(`Cms::FieldTab`)
2224
- : nameValue,
2225
- }));
2226
- this.fieldTabs.push(newFormGroup);
2227
- this.resultSource.push(newFormGroup.value);
2228
- this.navActive = this.resultSource.length - 1;
2229
- }
2230
- /**获取字段分组 */
2231
- getFieldGroup() {
2232
- this._FieldGroupAdminService.getList({}).subscribe(async (res) => {
2233
- let fieldList = await this.getFieldList();
2234
- let fieldGroupList = res.items;
2235
- fieldGroupList.unshift({
2236
- id: null,
2237
- name: 'UngroupedFields',
2238
- });
2239
- fieldGroupList.forEach((el, index) => {
2240
- el.fields = fieldList.filter(els => els.groupId === el.id);
2241
- });
2242
- this.fieldGroupList = fieldGroupList;
2243
- this.fieldList = this.deepClone(fieldList);
2244
- let entryTypesId = this.entryTypesId;
2245
- if (entryTypesId) {
2246
- this.entryTypesId = entryTypesId;
2247
- this.getEntryTypes();
2248
- }
2249
- });
2250
- }
2251
- /**获取条目类型详情 */
2252
- getEntryTypes() {
2253
- let fieldList = this.deepClone(this.fieldList);
2254
- this._EntryTypeAdminService.get(this.entryTypesId).subscribe(res => {
2255
- res.fieldTabs.forEach(el => {
2256
- el.fields.forEach((eld) => {
2257
- eld.id = eld.fieldId;
2258
- eld.groupId = fieldList.find(elfd => elfd.id == eld.fieldId).groupId;
2259
- this.formRightGroup.push(eld);
2260
- let fieldindex = fieldList.findIndex(elfl => elfl.id == eld.fieldId);
2261
- fieldList.splice(fieldindex, 1);
2262
- });
2263
- });
2264
- this.fieldGroupList.forEach((el, index) => {
2265
- el.fields = fieldList.filter(els => els.groupId === el.id);
2266
- });
2267
- this.newEntity.patchValue(res);
2268
- this.entryTypesSelect = res;
2269
- this.resultSource = res.fieldTabs;
2270
- });
2271
- }
2272
- /**
2273
- * 深拷贝--方法
2274
- * $api.deepClone() */
2275
- deepClone(obj) {
2276
- if (typeof obj !== 'object' || obj === null)
2277
- return obj;
2278
- const result = Array.isArray(obj) ? [] : {};
2279
- for (let key in obj) {
2280
- if (obj.hasOwnProperty(key)) {
2281
- if (typeof obj[key] === 'object' && obj[key] !== null) {
2282
- if (obj[key] instanceof Date) {
2283
- result[key] = new Date(obj[key].getTime());
2284
- }
2285
- else if (obj[key] instanceof RegExp) {
2286
- result[key] = new RegExp(obj[key]);
2287
- }
2288
- else {
2289
- result[key] = this.deepClone(obj[key]);
2290
- }
2291
- }
2292
- else {
2293
- result[key] = obj[key];
2294
- }
2295
- }
2296
- }
2297
- return result;
2298
- }
2299
- /**
2300
- *
2301
- * @param nameValue 获取所有字段
2302
- */
2303
- getFieldList() {
2304
- return new Promise((resolve, rejects) => {
2305
- this._FieldAdminService
2306
- .getList({
2307
- maxResultCount: 1000,
2308
- })
2309
- .subscribe((res) => {
2310
- res.items.forEach(el => {
2311
- el.required = false;
2312
- el.showOnList = false;
2313
- });
2314
- resolve(res.items);
2315
- });
2316
- });
2317
- }
2318
- /**从数据源开始拖拽 */
2319
- fromDataSourceDragStart(element, fieldIndex, groupIndex) {
2320
- this.fromDataSourceDragEl = element;
2321
- this.DataSourceFieldIndex = fieldIndex;
2322
- this.DataSourceGroupIndex = groupIndex;
2323
- this.fromResultSourceDragEl = undefined;
2324
- }
2325
- /**从目标源开始拖拽 */
2326
- fromResultSourceDragStart(element) {
2327
- this.fromResultSourceDragEl = element;
2328
- this.fromDataSourceDragEl = undefined;
2329
- this.DataSourceFieldIndex = undefined;
2330
- this.DataSourceGroupIndex = undefined;
2331
- }
2332
- /**拖拽到数据源时触发 */
2333
- dragToDataSourceDropped() {
2334
- //从数据源拖拽到数据源-排序
2335
- if (this.fromDataSourceDragEl) {
2336
- }
2337
- let _fromResultSourceDragEl = this.fromResultSourceDragEl;
2338
- let formRightGroup = this.deepClone(this.formRightGroup);
2339
- let fieldList = this.deepClone(this.fieldList);
2340
- if (_fromResultSourceDragEl) {
2341
- //移动
2342
- //从目标源拖拽到数据源
2343
- // 拖拽目标源的下标
2344
- let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(el => el.id == _fromResultSourceDragEl.id);
2345
- //删除目标源中的数据
2346
- this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
2347
- formRightGroup.splice(formRightGroup.findIndex(el => el.id == _fromResultSourceDragEl.id), 1);
2348
- this.fieldGroupList.forEach(el => {
2349
- if (el.id == _fromResultSourceDragEl.groupId) {
2350
- const elFieldsAll = fieldList.filter(els => els.groupId === el.id);
2351
- el.fields = elFieldsAll.filter(item => !formRightGroup.some(itemB => item.id === itemB.id));
2352
- }
2353
- });
2354
- this.formRightGroup = formRightGroup;
2355
- }
2356
- this.setfieldTabsFrom();
2357
- }
2358
- /**拖拽到目标源时触发
2359
- *
2360
- */
2361
- dragToResultSourceDropped(fieldTabstem, fieldTabsIndex) {
2362
- const _fromDataSourceDragEl = this.fromDataSourceDragEl;
2363
- //从数据源拖拽到目标源
2364
- if (_fromDataSourceDragEl) {
2365
- this.fieldGroupList[this.DataSourceGroupIndex].fields.splice(this.DataSourceFieldIndex, 1);
2366
- this.resultSource[fieldTabsIndex].fields.push(_fromDataSourceDragEl);
2367
- this.formRightGroup.push(_fromDataSourceDragEl);
2368
- }
2369
- this.setfieldTabsFrom();
2370
- }
2371
- /** 从目标源拖拽到目标源*/
2372
- dragToResultSourceItemDropped(fieldsIndex) {
2373
- const _fromResultSourceDragEl = this.fromResultSourceDragEl;
2374
- if (_fromResultSourceDragEl) {
2375
- // 拖拽目标源的下标
2376
- let dragResultSourceIndex = this.resultSource[this.navActive].fields.findIndex(el => el.id == _fromResultSourceDragEl.id);
2377
- //删除目标源中的数据
2378
- this.resultSource[this.navActive].fields.splice(dragResultSourceIndex, 1);
2379
- this.resultSource[this.navActive].fields.splice(fieldsIndex, 0, _fromResultSourceDragEl);
2380
- }
2381
- this.setfieldTabsFrom();
2382
- }
2383
- /**设置formA表单 */
2384
- setfieldTabsFrom() {
2385
- let setArray = [];
2386
- this.resultSource.forEach(el => {
2387
- let fieldsArray = [];
2388
- el.fields.forEach(item => {
2389
- fieldsArray.push({
2390
- fieldId: item.id || item.fieldId,
2391
- displayName: item.displayName,
2392
- required: item?.required,
2393
- showOnList: item?.showOnList,
2394
- });
2395
- });
2396
- setArray.push({
2397
- name: el.name,
2398
- fields: fieldsArray,
2399
- });
2400
- });
2401
- this.newEntity.patchValue({
2402
- fieldTabs: setArray,
2403
- });
2404
- }
2405
- /**保存表单 */
2406
- save() {
2407
- let input = this.newEntity.value;
2408
- this.formValidation = this._ValidatorsService.getFormValidationStatus(this.newEntity);
2409
- if (this._ValidatorsService.isCheckForm(this.formValidation, 'Cms'))
2410
- return;
2411
- if (this.entryTypesSelect) {
2412
- this._EntryTypeAdminService.update(this.entryTypesSelect.id, input).subscribe(res => {
2413
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
2414
- this._location.back();
2415
- this._UpdateListService.updateList();
2416
- });
2417
- return;
2418
- }
2419
- input.sectionId = this.sectionId;
2420
- this._EntryTypeAdminService.create(input).subscribe(res => {
2421
- this.toaster.success(this._LocalizationService.instant(`AbpUi::SuccessfullyDeleted`));
2422
- this._location.back();
2423
- this._UpdateListService.updateList();
2424
- });
2425
- }
2426
- /**模态框状态改变回调 */
2427
- VisibleTabsChange(event) {
2428
- if (!event) {
2429
- this.editFieldTabsSelect = '';
2430
- return;
2431
- }
2432
- }
2433
- /**新建增加FieldTabs */
2434
- addFieldTabs() {
2435
- this.editFieldTabsFrom = this.fb.group(new fieldTabsBase());
2436
- this.visibleTabsOpen = true;
2437
- }
2438
- /**编辑FieldTabs */
2439
- editFieldTabs(item, i) {
2440
- this.editFieldTabsFrom = this.fb.group(new fieldTabsBase({
2441
- name: item.name,
2442
- }));
2443
- this.editFieldTabsSelect = item;
2444
- this.visibleTabsOpen = true;
2445
- this.newEditFieldTabsIndex = i;
2446
- }
2447
- /**保存编辑tabs表单 */
2448
- editFieldTabsSave() {
2449
- //编辑
2450
- if (this.editFieldTabsSelect) {
2451
- this.resultSource[this.newEditFieldTabsIndex].name = this.editFieldTabsFrom.value.name;
2452
- this.navActive = this.newEditFieldTabsIndex;
2453
- }
2454
- else {
2455
- //新建
2456
- this.addControlToFieldTabs(this.editFieldTabsFrom.value.name);
2457
- }
2458
- this.visibleTabsOpen = false;
2459
- this.setfieldTabsFrom();
2460
- }
2461
- /**删除某个tabs表单 */
2462
- deleteFieldTabs(index) {
2463
- this.fieldTabs.removeAt(index);
2464
- this.resultSource.splice(index, 1);
2465
- }
2466
- /**编辑字段模态框状态状态改变回调 */
2467
- VisibleEditFieldChange(event) {
2468
- if (!event) {
2469
- this.EditFieldIndex = undefined;
2470
- return;
2471
- }
2472
- }
2473
- /**打开编辑字段模态框 */
2474
- EditFieldModalOpen(items, elIndex) {
2475
- this.visibleEditFieldOpen = true;
2476
- this.EditFieldIndex = elIndex;
2477
- this.editFieldFrom = this.fb.group(new fieldsBase(this.fieldTabs.value[this.navActive].fields[elIndex]));
2478
- }
2479
- /**保存编辑字段 */
2480
- editFieldSave() {
2481
- let input = this.editFieldFrom.value;
2482
- this.resultSource[this.navActive].fields[this.EditFieldIndex].displayName = input.displayName;
2483
- this.resultSource[this.navActive].fields[this.EditFieldIndex].required = input.required;
2484
- this.resultSource[this.navActive].fields[this.EditFieldIndex].showOnList = input.showOnList;
2485
- this.visibleEditFieldOpen = false;
2486
- this.setfieldTabsFrom();
2487
- }
2488
- /**name表单控件 */
2489
- get nameInput() {
2490
- return this.newEntity.get('name');
2491
- }
2492
- /**字段标签input失去标点生成字段名字 */
2493
- disPlayNameInputBlur(event) {
2494
- let value = event.target.value;
2495
- let pinyin = this._CmsApiService.chineseToPinyin(value);
2496
- let nameInput = this.nameInput;
2497
- if (nameInput.value)
2498
- return;
2499
- nameInput.patchValue(pinyin);
2500
- }
2501
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditComponent, deps: [{ token: i3.ToasterService }, { token: i2.Location }, { token: i3$1.ActivatedRoute }, { token: FieldGroupAdminService }, { token: FieldAdminService }, { token: EntryTypeAdminService }, { token: i1.LocalizationService }, { token: CmsApiService }], target: i0.ɵɵFactoryTarget.Component }); }
2502
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: CreateOrEditComponent, selector: "cms-create-or-edit", providers: [
2503
- {
2504
- provide: EXTENSIONS_IDENTIFIER,
2505
- useValue: ECmsComponent.SectionsCreateOrEdit,
2506
- },
2507
- ], viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }, { propertyName: "editFieldTabsModalSubmitBtn", first: true, predicate: ["editFieldTabsModalSubmitBtn"], descendants: true }, { propertyName: "editFieldModalSubmitBtn", first: true, predicate: ["editFieldModalSubmitBtn"], descendants: true }], ngImport: i0, template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"entryTypesId ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)\"\n [toolbar]=\"true\">\n <div class=\"create-or-edit-entry-type-page\">\n <div class=\"card\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card-body\">\n <div class=\"\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n <div formArrayName=\"fieldTabs\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::FieldLayout' | abpLocalization}}</label>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"navActive\" class=\"nav nav-tabs\">\n <ng-container *ngFor=\"let item of resultSource; let i = index\">\n <li [ngbNavItem]=\"i\">\n <button type=\"button\" ngbDropdown ngbNavLink>\n {{ item.name }}\n <span class=\"ms-1\" (click.stop)=\"$event.stopPropagation()\"\n ngbDropdownToggle></span>\n <div ngbDropdownMenu style=\"z-index: 999;\">\n <li ngbDropdownItem type=\"button\"\n (click.stop)=\"editFieldTabs(item,i)\">\n <i class=\"fas fa-edit\"></i>\n {{'AbpUi::Edit' | abpLocalization}}\n </li>\n <li ngbDropdownItem *ngIf=\"resultSource.length !== 1\" type=\"button\"\n (click.stop)=\"deleteFieldTabs(i)\">\n <i class=\"fas fa-trash\"></i>\n {{'AbpUi::Delete' | abpLocalization}}\n </li>\n </div>\n </button>\n <ng-template ngbNavContent>\n <div class=\"p-2\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToResultSourceDropped(item,i)\" style=\"height: 100%;\">\n <p class=\"form-text\" *ngIf=\"item.fields.length === 0\">\n {{'Cms::DragAndDropFieldTips' | abpLocalization}}\n </p>\n <ul class=\"list-group\" style=\"height: 100%;\">\n <ng-container *ngFor=\"let el of item.fields; let iel = index\">\n <li draggable=\"true\" (dragstart)=\"fromResultSourceDragStart(el)\"\n (drop)=\"dragToResultSourceItemDropped(iel)\"\n class=\"list-group-item d-flex align-items-center justify-content-between py-1\"\n style=\"position: unset;\">\n {{ el.displayName }}\n <button class=\"p-0 btn btn-sm btn-light\"\n (click.stop)=\"EditFieldModalOpen(el,iel)\"\n type=\"button\"><i class=\"fas fa-wrench p-sm-1\"\n role=\"button\"></i></button>\n </li>\n </ng-container>\n </ul>\n\n </div>\n </ng-template>\n </li>\n </ng-container>\n <li class=\"nav-item\" role=\"presentation\">\n <button type=\"button\" class=\"nav-link\" (click.stop)=\"addFieldTabs()\">\n <i class=\"fas fa-plus-circle\"></i>\n {{'Cms::NewTab' | abpLocalization}}\n </button>\n </li>\n </ul>\n <div [ngbNavOutlet]=\"nav\" class=\"mt-2 bordernNavs p-0\"></div>\n </div>\n <div class=\"col-sm-4\">\n <div ngbAccordion #accordion=\"ngbAccordion\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToDataSourceDropped()\" style=\"min-height: 80px;\">\n <ng-container *ngFor=\"let item of fieldGroupList; let i = index\">\n <div [ngbAccordionItem]=\"item.name\" *ngIf=\"item.fields.length > 0\">\n <h2 ngbAccordionHeader>\n <button ngbAccordionButton>{{\n ('Cms::'+item.name) | abpLocalization }}</button>\n </h2>\n <div ngbAccordionCollapse>\n <div ngbAccordionBody>\n <ng-template>\n <ul class=\"list-group\">\n <ng-container\n *ngFor=\"let el of item.fields; let ii = index\">\n <li draggable=\"true\"\n (dragstart)=\"fromDataSourceDragStart(el,ii,i)\"\n class=\"list-group-item\">\n {{ el.displayName }}\n </li>\n </ng-container>\n </ul>\n </ng-template>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n\n\n </div>\n </abp-page>\n\n</form>\n\n<abp-modal [(visible)]=\"visibleTabsOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleTabsChange($event)\">\n <ng-template #abpHeader>\n <h3>{{ editFieldTabsSelect ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldTabsFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldTabsFrom\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"editFieldTabsSave()\">\n <button type=\"submit\" #editFieldTabsModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldTabsFrom.valid\"\n (click)=\"editFieldTabsModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n\n<abp-modal [(visible)]=\"visibleEditFieldOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleEditFieldChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldFrom\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"editFieldSave()\">\n <button type=\"submit\" #editFieldModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"required\"\n id=\"required\" />\n <label class=\"form-check-label\" for=\"required\"> {{'Cms::Required' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"showOnList\"\n id=\"showOnList\" />\n <label class=\"form-check-label\" for=\"showOnList\"> {{'Cms::ShowOnList' | abpLocalization}}\n </label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldFrom.valid\"\n (click)=\"editFieldModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .create-or-edit-entry-type-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-or-edit-entry-type-page .form-control,::ng-deep .create-or-edit-entry-type-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-type-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-type-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit;height:calc(100% - 60px)}::ng-deep .create-or-edit-entry-type-page .tab-pane{height:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i10.NgbNavContent, selector: "ng-template[ngbNavContent]" }, { kind: "directive", type: i10.NgbNav, selector: "[ngbNav]", inputs: ["activeId", "animation", "destroyOnHide", "orientation", "roles", "keyboard"], outputs: ["activeIdChange", "shown", "hidden", "navChange"], exportAs: ["ngbNav"] }, { kind: "directive", type: i10.NgbNavItem, selector: "[ngbNavItem]", inputs: ["destroyOnHide", "disabled", "domId", "ngbNavItem"], outputs: ["shown", "hidden"], exportAs: ["ngbNavItem"] }, { kind: "directive", type: i10.NgbNavItemRole, selector: "[ngbNavItem]:not(ng-container)" }, { kind: "directive", type: i10.NgbNavLinkButton, selector: "button[ngbNavLink]" }, { kind: "directive", type: i10.NgbNavLinkBase, selector: "[ngbNavLink]" }, { kind: "component", type: i10.NgbNavOutlet, selector: "[ngbNavOutlet]", inputs: ["paneRole", "ngbNavOutlet"] }, { kind: "directive", type: i10.NgbAccordionButton, selector: "button[ngbAccordionButton]" }, { kind: "directive", type: i10.NgbAccordionDirective, selector: "[ngbAccordion]", inputs: ["animation", "closeOthers", "destroyOnHide"], outputs: ["show", "shown", "hide", "hidden"], exportAs: ["ngbAccordion"] }, { kind: "directive", type: i10.NgbAccordionItem, selector: "[ngbAccordionItem]", inputs: ["ngbAccordionItem", "destroyOnHide", "disabled", "collapsed"], outputs: ["show", "shown", "hide", "hidden"], exportAs: ["ngbAccordionItem"] }, { kind: "directive", type: i10.NgbAccordionHeader, selector: "[ngbAccordionHeader]" }, { kind: "directive", type: i10.NgbAccordionBody, selector: "[ngbAccordionBody]" }, { kind: "directive", type: i10.NgbAccordionCollapse, selector: "[ngbAccordionCollapse]", exportAs: ["ngbAccordionCollapse"] }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "component", type: i8$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2508
- }
2509
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CreateOrEditComponent, decorators: [{
2510
- type: Component,
2511
- args: [{ selector: 'cms-create-or-edit', providers: [
2512
- {
2513
- provide: EXTENSIONS_IDENTIFIER,
2514
- useValue: ECmsComponent.SectionsCreateOrEdit,
2515
- },
2516
- ], template: "<form class=\"row g-3 needs-validation\" [formGroup]=\"newEntity\" (keydown.enter)=\"$event.preventDefault()\" [class]=\"{'was-validated':formValidation}\" (submit)=\"save()\">\n <abp-page [title]=\"entryTypesId ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)\"\n [toolbar]=\"true\">\n <div class=\"create-or-edit-entry-type-page\">\n <div class=\"card\">\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\n <div class=\"card-body\">\n <div class=\"\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"disPlayNameInputBlur($event)\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n <div formArrayName=\"fieldTabs\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::FieldLayout' | abpLocalization}}</label>\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-sm-8\">\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"navActive\" class=\"nav nav-tabs\">\n <ng-container *ngFor=\"let item of resultSource; let i = index\">\n <li [ngbNavItem]=\"i\">\n <button type=\"button\" ngbDropdown ngbNavLink>\n {{ item.name }}\n <span class=\"ms-1\" (click.stop)=\"$event.stopPropagation()\"\n ngbDropdownToggle></span>\n <div ngbDropdownMenu style=\"z-index: 999;\">\n <li ngbDropdownItem type=\"button\"\n (click.stop)=\"editFieldTabs(item,i)\">\n <i class=\"fas fa-edit\"></i>\n {{'AbpUi::Edit' | abpLocalization}}\n </li>\n <li ngbDropdownItem *ngIf=\"resultSource.length !== 1\" type=\"button\"\n (click.stop)=\"deleteFieldTabs(i)\">\n <i class=\"fas fa-trash\"></i>\n {{'AbpUi::Delete' | abpLocalization}}\n </li>\n </div>\n </button>\n <ng-template ngbNavContent>\n <div class=\"p-2\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToResultSourceDropped(item,i)\" style=\"height: 100%;\">\n <p class=\"form-text\" *ngIf=\"item.fields.length === 0\">\n {{'Cms::DragAndDropFieldTips' | abpLocalization}}\n </p>\n <ul class=\"list-group\" style=\"height: 100%;\">\n <ng-container *ngFor=\"let el of item.fields; let iel = index\">\n <li draggable=\"true\" (dragstart)=\"fromResultSourceDragStart(el)\"\n (drop)=\"dragToResultSourceItemDropped(iel)\"\n class=\"list-group-item d-flex align-items-center justify-content-between py-1\"\n style=\"position: unset;\">\n {{ el.displayName }}\n <button class=\"p-0 btn btn-sm btn-light\"\n (click.stop)=\"EditFieldModalOpen(el,iel)\"\n type=\"button\"><i class=\"fas fa-wrench p-sm-1\"\n role=\"button\"></i></button>\n </li>\n </ng-container>\n </ul>\n\n </div>\n </ng-template>\n </li>\n </ng-container>\n <li class=\"nav-item\" role=\"presentation\">\n <button type=\"button\" class=\"nav-link\" (click.stop)=\"addFieldTabs()\">\n <i class=\"fas fa-plus-circle\"></i>\n {{'Cms::NewTab' | abpLocalization}}\n </button>\n </li>\n </ul>\n <div [ngbNavOutlet]=\"nav\" class=\"mt-2 bordernNavs p-0\"></div>\n </div>\n <div class=\"col-sm-4\">\n <div ngbAccordion #accordion=\"ngbAccordion\" ondragover=\"event.preventDefault();\"\n (drop)=\"dragToDataSourceDropped()\" style=\"min-height: 80px;\">\n <ng-container *ngFor=\"let item of fieldGroupList; let i = index\">\n <div [ngbAccordionItem]=\"item.name\" *ngIf=\"item.fields.length > 0\">\n <h2 ngbAccordionHeader>\n <button ngbAccordionButton>{{\n ('Cms::'+item.name) | abpLocalization }}</button>\n </h2>\n <div ngbAccordionCollapse>\n <div ngbAccordionBody>\n <ng-template>\n <ul class=\"list-group\">\n <ng-container\n *ngFor=\"let el of item.fields; let ii = index\">\n <li draggable=\"true\"\n (dragstart)=\"fromDataSourceDragStart(el,ii,i)\"\n class=\"list-group-item\">\n {{ el.displayName }}\n </li>\n </ng-container>\n </ul>\n </ng-template>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n\n\n </div>\n </abp-page>\n\n</form>\n\n<abp-modal [(visible)]=\"visibleTabsOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleTabsChange($event)\">\n <ng-template #abpHeader>\n <h3>{{ editFieldTabsSelect ? ('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldTabsFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldTabsFrom\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"editFieldTabsSave()\">\n <button type=\"submit\" #editFieldTabsModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\" placeholder=\"\" />\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldTabsFrom.valid\"\n (click)=\"editFieldTabsModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>\n\n\n<abp-modal [(visible)]=\"visibleEditFieldOpen\" [busy]=\"modalBusy\" (visibleChange)=\"VisibleEditFieldChange($event)\">\n <ng-template #abpHeader>\n <h3>{{'AbpUi::Edit' | abpLocalization}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"editFieldFrom; else loaderRef\">\n <form class=\"sites-modal-form\" [formGroup]=\"editFieldFrom\" (keydown.enter)=\"$event.preventDefault()\" (submit)=\"editFieldSave()\">\n <button type=\"submit\" #editFieldModalSubmitBtn style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\" placeholder=\"\" />\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"required\"\n id=\"required\" />\n <label class=\"form-check-label\" for=\"required\"> {{'Cms::Required' | abpLocalization}} </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"true\" formControlName=\"showOnList\"\n id=\"showOnList\" />\n <label class=\"form-check-label\" for=\"showOnList\"> {{'Cms::ShowOnList' | abpLocalization}}\n </label>\n </div>\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\" [disabled]=\"!editFieldFrom.valid\"\n (click)=\"editFieldModalSubmitBtn.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: ["::ng-deep .create-or-edit-entry-type-page .dignite_page{height:calc(100vh - 125px);overflow:auto}::ng-deep .create-or-edit-entry-type-page .form-control,::ng-deep .create-or-edit-entry-type-page .form-select{padding:.475rem 1.25rem}::ng-deep .create-or-edit-entry-type-page .cursor-move{cursor:move}::ng-deep .create-or-edit-entry-type-page .bordernNavs{border:var(--bs-border-width) solid var(--lpx-border-color);padding-left:inherit;padding-right:inherit;height:calc(100% - 60px)}::ng-deep .create-or-edit-entry-type-page .tab-pane{height:100%}\n"] }]
2517
- }], ctorParameters: () => [{ type: i3.ToasterService }, { type: i2.Location }, { type: i3$1.ActivatedRoute }, { type: FieldGroupAdminService }, { type: FieldAdminService }, { type: EntryTypeAdminService }, { type: i1.LocalizationService }, { type: CmsApiService }], propDecorators: { submitclick: [{
2518
- type: ViewChild,
2519
- args: ['submitclick', { static: true }]
2520
- }], editFieldTabsModalSubmitBtn: [{
2521
- type: ViewChild,
2522
- args: ['editFieldTabsModalSubmitBtn', { static: false }]
2523
- }], editFieldModalSubmitBtn: [{
2524
- type: ViewChild,
2525
- args: ['editFieldModalSubmitBtn', { static: false }]
2526
- }] } });
2527
-
2528
- class EntryConfig {
2529
- constructor(data) {
2530
- /**多选 */
2531
- this['Entry.Multiple'] = [false, []];
2532
- /**占位符 */
2533
- this['Entry.Placeholder'] = ['', []];
2534
- /**版块id */
2535
- this['Entry.SectionId'] = ['', []];
2536
- if (data) {
2537
- for (const key in data) {
2538
- if (data.hasOwnProperty(key)) {
2539
- this[key] = data[key];
2540
- }
2541
- }
2542
- }
2543
- }
2544
- }
2545
-
2546
- class EntryConfigComponent {
2547
- constructor(fb,
2548
- // private _SiteAdminService: SiteAdminService,
2549
- _SectionAdminService) {
2550
- this.fb = fb;
2551
- this._SectionAdminService = _SectionAdminService;
2552
- /**站点列表 */
2553
- this.siteList = [];
2554
- /**选择的站点id */
2555
- // siteId: string = ''
2556
- this.siteId = new FormControl('');
2557
- /**站点下的版块 */
2558
- this.SiteOfSectionList = [];
2559
- }
2560
- set type(v) {
2561
- if (v == this._type)
2562
- return;
2563
- this._type = v;
2564
- }
2565
- set Entity(v) {
2566
- this._Entity = v;
2567
- }
2568
- set selected(v) {
2569
- this._selected = v;
2570
- }
2571
- set culture(v) {
2572
- this._culture = v;
2573
- }
2574
- get formConfiguration() {
2575
- return this._Entity.get('formConfiguration');
2576
- }
2577
- ngAfterContentInit() {
2578
- //Called after ngOnInit when the component's or directive's content has been initialized.
2579
- //Add 'implements AfterContentInit' to the class.
2580
- this.dataLoaded(2);
2581
- }
2582
- async dataLoaded(val) {
2583
- if (this._Entity && this._type) {
2584
- await this.AfterInit();
2585
- this.submitclick.nativeElement.click();
2586
- }
2587
- }
2588
- AfterInit() {
2589
- return new Promise(async (resolve, rejects) => {
2590
- this._Entity.setControl('formConfiguration', this.fb.group(new EntryConfig()));
2591
- // await this.getsiteList()
2592
- await this.getSiteOfSectionList();
2593
- if (this._selected) {
2594
- this.formConfiguration.patchValue({
2595
- ...this._selected.formConfiguration
2596
- });
2597
- }
2598
- resolve(true);
2599
- });
2600
- }
2601
- /**获取站点列表 */
2602
- // getsiteList() {
2603
- // return new Promise((resolve, rejects) => {
2604
- // this._SiteAdminService.getList({}).subscribe(res => {
2605
- // this.siteList = res.items
2606
- // this.siteId = res.items[0]?.id || ''
2607
- // resolve(res.items)
2608
- // })
2609
- // })
2610
- // }
2611
- /**获取站点下的版块 */
2612
- getSiteOfSectionList() {
2613
- return new Promise((resolve, rejects) => {
2614
- this._SectionAdminService.getList({
2615
- maxResultCount: 1000,
2616
- // siteId: this.siteId
2617
- }).subscribe(res => {
2618
- this.SiteOfSectionList = res.items;
2619
- this.formConfiguration.patchValue({
2620
- 'Entry.SectionId': res.items[0]?.id || ''
2621
- });
2622
- resolve(res.items);
2623
- });
2624
- });
2625
- }
2626
- /**切换站点 */
2627
- async siteIdChange() {
2628
- await this.getSiteOfSectionList();
2629
- }
2630
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: SectionAdminService }], target: i0.ɵɵFactoryTarget.Component }); }
2631
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EntryConfigComponent, selector: "cms-entry-config", inputs: { type: "type", Entity: "Entity", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<!-- <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sites' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"siteId\" (change)=\"siteIdChange()\">\n <ng-container *ngFor=\"let item of siteList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n</div> -->\n<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n \n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" formControlName=\"Entry.SectionId\">\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Entry.Multiple\" id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'Cms::Multiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Entry.Placeholder\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [":ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background-color:transparent!important;border:none!important}:ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent!important;box-shadow:none!important}.selectclassliveview{overflow:hidden}::ng-deep .ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:transparent}::ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent;box-shadow:none}::ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background:transparent;border:1px solid transparent}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2632
- }
2633
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryConfigComponent, decorators: [{
2634
- type: Component,
2635
- args: [{ selector: 'cms-entry-config', template: "<!-- <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sites' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" [(ngModel)]=\"siteId\" (change)=\"siteIdChange()\">\n <ng-container *ngFor=\"let item of siteList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n</div> -->\n<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n \n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Sections' | abpLocalization}}</label>\n <select class=\"form-select col-auto\" formControlName=\"Entry.SectionId\">\n <ng-container *ngFor=\"let item of SiteOfSectionList\">\n <option [value]=\"item.id\">{{item.displayName}}</option>\n </ng-container>\n </select>\n </div>\n\n <div class=\"mb-2\">\n <div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"checkbox\" formControlName=\"Entry.Multiple\" id=\"Multiple\">\n <label class=\"form-check-label\" for=\"Multiple\">\n {{'Cms::Multiple' | abpLocalization}}\n </label>\n </div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::Placeholder' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"Entry.Placeholder\">\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>", styles: [":ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background-color:transparent!important;border:none!important}:ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent!important;box-shadow:none!important}.selectclassliveview{overflow:hidden}::ng-deep .ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:transparent}::ng-deep .ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:transparent;box-shadow:none}::ng-deep .ant-select:not(.ant-select-customize-input) .ant-select-selector{background:transparent;border:1px solid transparent}\n"] }]
2636
- }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: SectionAdminService }], propDecorators: { type: [{
2637
- type: Input
2638
- }], Entity: [{
2639
- type: Input
2640
- }], selected: [{
2641
- type: Input
2642
- }], culture: [{
2643
- type: Input
2644
- }], submitclick: [{
2645
- type: ViewChild,
2646
- args: ['submitclick', { static: true }]
2647
- }] } });
2648
-
2649
- /* eslint-disable @angular-eslint/component-selector */
2650
- class EntryControlComponent {
2651
- constructor() {
2652
- this.fb = inject(FormBuilder);
2653
- this._EntryAdminService = inject(EntryAdminService);
2654
- /**字段配置列表 */
2655
- this._fields = '';
2656
- /** */
2657
- this.listOfOption = [];
2658
- }
2659
- set entity(v) {
2660
- this._entity = v;
2661
- if (v)
2662
- this.dataLoaded();
2663
- }
2664
- set fields(v) {
2665
- this._fields = v;
2666
- if (v)
2667
- this.dataLoaded();
2668
- }
2669
- set parentFiledName(v) {
2670
- this._parentFiledName = v;
2671
- if (v)
2672
- this.dataLoaded();
2673
- }
2674
- set selected(v) {
2675
- this._selected = v || [];
2676
- if (v)
2677
- this.dataLoaded();
2678
- }
2679
- set culture(v) {
2680
- if (v) {
2681
- this._culture = v;
2682
- this.dataLoaded();
2683
- }
2684
- }
2685
- async dataLoaded() {
2686
- if (this._fields && this._entity && this._parentFiledName && this._culture) {
2687
- await this.AfterInit();
2688
- await this.getEntryAssignList();
2689
- this.submitclick.nativeElement.click();
2690
- }
2691
- }
2692
- AfterInit() {
2693
- return new Promise((resolve, rejects) => {
2694
- let ValidatorsArray = [];
2695
- if (this._fields.required) {
2696
- ValidatorsArray.push(Validators.required);
2697
- }
2698
- let newControl = this.fb.control(this._selected, ValidatorsArray);
2699
- let extraProperties = this._entity.get(this._parentFiledName);
2700
- extraProperties.setControl(this._fields.field.name, newControl);
2701
- resolve(true);
2702
- });
2703
- }
2704
- /**获取对应的条目 */
2705
- getEntryAssignList(filter = '') {
2706
- return new Promise((resolve, rejects) => {
2707
- this._EntryAdminService.getList({
2708
- culture: this._culture,
2709
- sectionId: this._fields.field.formConfiguration['Entry.SectionId'],
2710
- skipCount: 0,
2711
- maxResultCount: 30,
2712
- status: EntryStatus.Published,
2713
- filter: filter
2714
- }).subscribe(res => {
2715
- this.listOfOption = res.items;
2716
- resolve(true);
2717
- });
2718
- });
2719
- }
2720
- /** */
2721
- async SelectChange(event) {
2722
- await this.getEntryAssignList(event);
2723
- }
2724
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2725
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: EntryControlComponent, selector: "cms-entry-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\r\n <div [formGroupName]=\"_parentFiledName\" class=\"entry-control-page\">\r\n <div class=\"mb-2\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <ng-container *ngIf=\"_fields.field.formConfiguration['Entry.Multiple']; else elseTemplate\">\r\n <div class=\"form-select\">\r\n <nz-select [nzMaxTagCount]=\"5\" (nzOnSearch)=\"SelectChange($event)\" nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <div class=\"form-select\">\r\n <nz-select nzShowSearch (nzOnSearch)=\"SelectChange($event)\" [nzMaxMultipleCount]=\"1\" nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>", styles: ["::ng-deep .entry-control-page .form-select{padding:0}::ng-deep .entry-control-page nz-select{width:100%}::ng-deep .entry-control-page nz-select .ant-select-selector{background:transparent!important;border:none!important;padding:.275rem 1.25rem!important;box-shadow:none!important;height:auto!important}::ng-deep .entry-control-page nz-select .anticon-search,::ng-deep .entry-control-page nz-select .anticon-down{display:none}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i4.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i4.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus"], exportAs: ["nzSelect"] }] }); }
2726
- }
2727
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: EntryControlComponent, decorators: [{
2728
- type: Component,
2729
- args: [{ selector: 'cms-entry-control', template: "<form [formGroup]=\"_entity\">\r\n <div [formGroupName]=\"_parentFiledName\" class=\"entry-control-page\">\r\n <div class=\"mb-2\">\r\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\r\n <ng-container *ngIf=\"_fields.field.formConfiguration['Entry.Multiple']; else elseTemplate\">\r\n <div class=\"form-select\">\r\n <nz-select [nzMaxTagCount]=\"5\" (nzOnSearch)=\"SelectChange($event)\" nzShowSearch nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-container>\r\n <ng-template #elseTemplate>\r\n <div class=\"form-select\">\r\n <nz-select nzShowSearch (nzOnSearch)=\"SelectChange($event)\" [nzMaxMultipleCount]=\"1\" nzMode=\"multiple\" [nzPlaceHolder]=\"_fields.field.formConfiguration['Entry.Placeholder']\"\r\n formControlName=\"{{_fields.field.name}}\">\r\n <nz-option *ngFor=\"let item of listOfOption\" [nzLabel]=\"item.title\" [nzValue]=\"item.id\"></nz-option>\r\n </nz-select>\r\n </div>\r\n </ng-template>\r\n\r\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\r\n </div>\r\n </div>\r\n <button type=\"submit\" style=\"display: none;\" #submitclick></button>\r\n</form>", styles: ["::ng-deep .entry-control-page .form-select{padding:0}::ng-deep .entry-control-page nz-select{width:100%}::ng-deep .entry-control-page nz-select .ant-select-selector{background:transparent!important;border:none!important;padding:.275rem 1.25rem!important;box-shadow:none!important;height:auto!important}::ng-deep .entry-control-page nz-select .anticon-search,::ng-deep .entry-control-page nz-select .anticon-down{display:none}\n"] }]
2730
- }], ctorParameters: () => [], propDecorators: { entity: [{
2731
- type: Input
2732
- }], fields: [{
2733
- type: Input
2734
- }], parentFiledName: [{
2735
- type: Input
2736
- }], selected: [{
2737
- type: Input
2738
- }], culture: [{
2739
- type: Input
2740
- }], submitclick: [{
2741
- type: ViewChild,
2742
- args: ['submitclick', { static: true }]
2743
- }] } });
2744
-
2745
- class MatrixConfig {
2746
- constructor(data) {
2747
- // 矩阵类型
2748
- this['MatrixBlockTypes'] = new FormArray([]);
2749
- if (data) {
2750
- for (const key in data) {
2751
- if (data.hasOwnProperty(key)) {
2752
- this[key] = data[key];
2753
- }
2754
- }
2755
- }
2756
- }
2757
- }
2758
- class MatrixItemConfig {
2759
- constructor(data) {
2760
- this.displayName = ['', [Validators.required]];
2761
- /**字段名字 */
2762
- this.name = ['', [Validators.required]];
2763
- if (data) {
2764
- for (const key in data) {
2765
- if (data.hasOwnProperty(key)) {
2766
- this[key] = data[key];
2767
- }
2768
- }
2769
- }
2770
- }
2771
- }
2772
- class matrixFieldInputBase {
2773
- constructor(data) {
2774
- /**字段名称 Display name of this field */
2775
- this.displayName = ['', [Validators.required]];
2776
- /**字段唯一名称 Unique Name*/
2777
- this.name = ['', [Validators.required]];
2778
- /**描述 说明 */
2779
- this.description = ['', []];
2780
- /**FieldType字段类型 表单控件名称 */
2781
- this.formControlName = ['TextEdit', [Validators.required]];
2782
- /**动态表单配置 */
2783
- this.formConfiguration = new FormGroup({});
2784
- if (data) {
2785
- for (const key in data) {
2786
- if (data.hasOwnProperty(key)) {
2787
- this[key] = data[key];
2788
- }
2789
- }
2790
- }
2791
- }
2792
- }
2793
-
2794
- /* eslint-disable @angular-eslint/component-selector */
2795
- class MatrixConfigComponent {
2796
- constructor(fb, _CmsApiService, _FieldAbstractsService) {
2797
- this.fb = fb;
2798
- this._CmsApiService = _CmsApiService;
2799
- this._FieldAbstractsService = _FieldAbstractsService;
2800
- /**模态框-状态 */
2801
- this.matrixModalOpen = false;
2802
- /**模态框-是否正在编辑 */
2803
- this.isMatrixModalEdit = false;
2804
- /**模态框-用于确定模态的繁忙状态是否为真 */
2805
- this.modalBusy = false;
2806
- /**矩阵块-选择的下标 */
2807
- this.selectMatrixBlockIndex = 0;
2808
- /**矩阵块-选择的矩阵下字段的下标 */
2809
- this.selectMatrixFieldIndex = 0;
2810
- }
2811
- set type(v) {
2812
- this._type = v;
2813
- this.dataLoaded();
2814
- }
2815
- set Entity(v) {
2816
- this._Entity = v;
2817
- this.dataLoaded();
2818
- }
2819
- set selected(v) {
2820
- if (v) {
2821
- this._selected = v;
2822
- this.dataLoaded();
2823
- }
2824
- }
2825
- async dataLoaded() {
2826
- if (this._Entity && this._type) {
2827
- await this.AfterInit();
2828
- this.submitclick.nativeElement.click();
2829
- }
2830
- }
2831
- AfterInit() {
2832
- return new Promise(async (resolve, rejects) => {
2833
- this._FieldControlGroup = this._FieldAbstractsService.getExcludeAssignControl(this._type);
2834
- this._Entity.setControl('formConfiguration', this.fb.group(new MatrixConfig()));
2835
- await this.setSelectValue();
2836
- this.formConfiguration.patchValue(this._selected.formConfiguration);
2837
- resolve(true);
2838
- });
2839
- }
2840
- setSelectValue() {
2841
- return new Promise((resolve, rejects) => {
2842
- if (this._selected && this._selected.formControlName == this._type) {
2843
- this._selected.formConfiguration['MatrixBlockTypes'].forEach(((el, index) => {
2844
- this.addMatrixBlockTypeItem(el);
2845
- el.fields.forEach((elf, indexf) => {
2846
- this.addMatrixFieldItem(elf, index);
2847
- });
2848
- }));
2849
- resolve(true);
2850
- }
2851
- });
2852
- }
2853
- /**获取表单配置 */
2854
- get formConfiguration() {
2855
- return this._Entity.get('formConfiguration');
2856
- }
2857
- /**获取表单配置下的矩阵块表单数组 */
2858
- get MatrixBlockTypes() {
2859
- return this.formConfiguration.controls['MatrixBlockTypes'];
2860
- }
2861
- /**模态框-状态改变 */
2862
- matrixModalVisibleChange(event) {
2863
- if (!event) {
2864
- this.isMatrixModalEdit = false;
2865
- this.matrixModalForm = undefined;
2866
- return;
2867
- }
2868
- }
2869
- /**矩阵块--新增-打开模态框 */
2870
- addMatrixBlockType() {
2871
- this.matrixModalForm = this.fb.group(new MatrixItemConfig());
2872
- this.matrixModalOpen = true;
2873
- }
2874
- /**模态框--矩阵表单保存提交 */
2875
- createOrEditSave() {
2876
- let input = this.matrixModalForm.value;
2877
- if (!this.matrixModalForm.valid)
2878
- return;
2879
- if (this.isMatrixModalEdit) {
2880
- let MatrixBlockTypesItem = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
2881
- MatrixBlockTypesItem.patchValue({
2882
- ...input
2883
- });
2884
- }
2885
- else {
2886
- this.addMatrixBlockTypeItem(input);
2887
- }
2888
- this.matrixModalOpen = false;
2889
- }
2890
- /**新增矩阵块-向数组表单中增加项 */
2891
- addMatrixBlockTypeItem(input) {
2892
- this.MatrixBlockTypes.push(new FormGroup({
2893
- displayName: new FormControl(input.displayName, Validators.required),
2894
- name: new FormControl(input.name, Validators.required),
2895
- fields: new FormArray([])
2896
- }));
2897
- }
2898
- /**编辑矩阵块 */
2899
- EditMatrixBlock(input) {
2900
- this.matrixModalForm = this.fb.group(new MatrixItemConfig());
2901
- this.matrixModalForm.patchValue({
2902
- ...input
2903
- });
2904
- this.matrixModalOpen = true;
2905
- this.isMatrixModalEdit = true;
2906
- }
2907
- /**删除矩阵块 */
2908
- DeleteMatrixBlock(index) {
2909
- this.MatrixBlockTypes.removeAt(index);
2910
- }
2911
- /**矩阵块-选择 */
2912
- selectMatrixBlockChange(index) {
2913
- this.selectMatrixBlockIndex = index;
2914
- }
2915
- /**矩阵字段-新增 */
2916
- addMatrixField() {
2917
- this.addMatrixFieldItem('', this.selectMatrixBlockIndex);
2918
- let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
2919
- let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
2920
- this.selectMatrixFieldChange(0, MatrixFieldItemForm.length - 1);
2921
- }
2922
- /**矩阵字段-新增矩阵字段项 */
2923
- addMatrixFieldItem(input = '', selectMatrixBlockIndex) {
2924
- /**矩阵下标的矩阵项Form */
2925
- let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(selectMatrixBlockIndex);
2926
- let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
2927
- MatrixFieldItemForm.push(this.fb.group({
2928
- /**字段名称 Display name of this field */
2929
- displayName: [input.displayName, [Validators.required]],
2930
- /**字段唯一名称 Unique Name*/
2931
- name: [input.name, [Validators.required]],
2932
- /**描述 说明 */
2933
- description: [input.description, []],
2934
- /**FieldType字段类型 表单控件名称 */
2935
- formControlName: [input.formControlName || 'TextEdit', [Validators.required]],
2936
- //动态表单配置
2937
- formConfiguration: new FormGroup({}),
2938
- }));
2939
- //
2940
- }
2941
- /**删除矩阵字段项 */
2942
- deleteMatrixField(MatrixFieldForm, index) {
2943
- MatrixFieldForm.removeAt(index);
2944
- this.selectMatrixFieldIndex = 0;
2945
- }
2946
- /**矩阵字段-选择 */
2947
- selectMatrixFieldChange(MatrixBlockIndex, MatrixFieldIndex) {
2948
- this.selectMatrixFieldIndex = MatrixFieldIndex;
2949
- }
2950
- get nameInput() {
2951
- return this.matrixModalForm?.get('name');
2952
- }
2953
- get FieldnameInput() {
2954
- let MatrixBlockTypesItemForm = this.MatrixBlockTypes.at(this.selectMatrixBlockIndex);
2955
- let MatrixFieldItemForm = MatrixBlockTypesItemForm.get('fields');
2956
- return MatrixFieldItemForm.at(this.selectMatrixFieldIndex).get('name');
2957
- }
2958
- /**矩阵displayNameInput字段失去焦点 */
2959
- displayNameInputBlur(event) {
2960
- let value = event.target.value;
2961
- let pinyin = this._CmsApiService.chineseToPinyin(value);
2962
- let nameInput = this.nameInput;
2963
- if (nameInput.value)
2964
- return;
2965
- nameInput.patchValue(pinyin);
2966
- }
2967
- /**矩阵displayNameInput字段失去焦点 */
2968
- MatrixFieldDisplayNameInputBlur(event) {
2969
- let value = event.target.value;
2970
- let pinyin = this._CmsApiService.chineseToPinyin(value);
2971
- let FieldnameInput = this.FieldnameInput;
2972
- if (FieldnameInput.value)
2973
- return;
2974
- FieldnameInput.patchValue(pinyin);
2975
- }
2976
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: CmsApiService }, { token: FieldAbstractsService }], target: i0.ɵɵFactoryTarget.Component }); }
2977
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: MatrixConfigComponent, selector: "df-matrix-config", inputs: { type: "type", Entity: "Entity", selected: "selected" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }, { propertyName: "matrixModalModalSubmit", first: true, predicate: ["matrixModalModalSubmit"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::::FormControl:Matrix' | abpLocalization}}</label>\n <div class=\"row\">\n <div class=\"col-md-3\">\n <div class=\"list-group\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::MatrixBlockType' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixBlockType()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixBlockChange(i)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"i===selectMatrixBlockIndex\">\n <div>\n <div>{{item.value.displayName}}</div>\n <div>{{item.value.name}}</div>\n </div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-light btn-sm\" id=\"dropdownBasic1\"\n style=\"z-index: 8;\" ngbDropdownToggle></button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\" style=\"z-index: 9;\">\n <button ngbDropdownItem\n (click.stop)=\"EditMatrixBlock(item.value)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"DeleteMatrixBlock(i)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"list-group\" *ngIf=\"MatrixBlockTypes?.controls.length>0\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::Fields' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixField()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <ng-container *ngIf=\"i === selectMatrixBlockIndex\">\n <ng-container *ngFor=\"let el of item.controls['fields'].controls;let fi =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixFieldChange(i,fi)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"fi===selectMatrixFieldIndex\">\n <div>\n <div>{{el.value.displayName}}</div>\n <div>{{el.value.name}}</div>\n </div>\n <button type=\"button\"\n (click.stop)=\"deleteMatrixField(item.controls['fields'],fi)\"\n class=\"btn btn-sm btn-li\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-6\" formArrayName=\"MatrixBlockTypes\">\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <div [formGroupName]=\"i\" [hidden]=\"i !== selectMatrixBlockIndex\">\n <div formArrayName=\"fields\">\n <ng-container *ngFor=\"let itemf of item.controls['fields'].controls;let fi =index\">\n <div [formGroupName]=\"fi\" [hidden]=\"fi !== selectMatrixFieldIndex\">\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"MatrixFieldDisplayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n <div class=\"form-text\">\n {{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"setConfigComponent()\">\n <ng-container *ngFor=\"let itemC of _FieldControlGroup;let i =index\">\n <option [value]=\"itemC.name\">{{itemC.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"itemf.value.formControlName&&itemf\">\n <df-dynamic [type]=\"itemf.value.formControlName\" [entity]=\"itemf\"\n [selected]=\"_selected?_selected.formConfiguration?.MatrixBlockTypes[i]?.fields[fi]:''\"></df-dynamic>\n \n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n\n<abp-modal [(visible)]=\"matrixModalOpen\" [busy]=\"modalBusy\" (visibleChange)=\"matrixModalVisibleChange($event)\" >\n <ng-template #abpHeader>\n <h3>{{isMatrixEdit?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"matrixModalForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"matrixModalForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #matrixModalModalSubmit style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"displayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"matrixModalModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "directive", type: i10.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i10.NgbDropdownToggle, selector: "[ngbDropdownToggle]" }, { kind: "directive", type: i10.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }, { kind: "directive", type: i10.NgbDropdownItem, selector: "[ngbDropdownItem]", inputs: ["tabindex", "disabled"] }, { kind: "directive", type: i10.NgbDropdownButtonItem, selector: "button[ngbDropdownItem]" }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
2978
- }
2979
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixConfigComponent, decorators: [{
2980
- type: Component,
2981
- args: [{ selector: 'df-matrix-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'Cms::::FormControl:Matrix' | abpLocalization}}</label>\n <div class=\"row\">\n <div class=\"col-md-3\">\n <div class=\"list-group\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::MatrixBlockType' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixBlockType()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixBlockChange(i)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"i===selectMatrixBlockIndex\">\n <div>\n <div>{{item.value.displayName}}</div>\n <div>{{item.value.name}}</div>\n </div>\n <div ngbDropdown class=\"d-inline-block\">\n <button type=\"button\" class=\"btn btn-light btn-sm\" id=\"dropdownBasic1\"\n style=\"z-index: 8;\" ngbDropdownToggle></button>\n <div ngbDropdownMenu aria-labelledby=\"dropdownBasic1\" style=\"z-index: 9;\">\n <button ngbDropdownItem\n (click.stop)=\"EditMatrixBlock(item.value)\">{{'AbpUi::Edit' | abpLocalization}}</button>\n <button ngbDropdownItem\n (click.stop)=\"DeleteMatrixBlock(i)\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </div>\n </div>\n </button>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-3\">\n <div class=\"list-group\" *ngIf=\"MatrixBlockTypes?.controls.length>0\">\n <li class=\"list-group-item d-flex align-items-center justify-content-between\"\n aria-current=\"true\">\n {{'Cms::Fields' | abpLocalization}}\n <button class=\"btn btn-light btn-sm p-0\" (click.stop)=\"addMatrixField()\">\n <i class=\"fas fa-plus-circle p-1\"></i>\n </button>\n </li>\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <ng-container *ngIf=\"i === selectMatrixBlockIndex\">\n <ng-container *ngFor=\"let el of item.controls['fields'].controls;let fi =index\">\n <button type=\"button\" (click.stop)=\"selectMatrixFieldChange(i,fi)\"\n class=\"list-group-item d-flex align-items-center justify-content-between list-group-item-action \"\n [class.active]=\"fi===selectMatrixFieldIndex\">\n <div>\n <div>{{el.value.displayName}}</div>\n <div>{{el.value.name}}</div>\n </div>\n <button type=\"button\"\n (click.stop)=\"deleteMatrixField(item.controls['fields'],fi)\"\n class=\"btn btn-sm btn-li\">{{'AbpUi::Delete' | abpLocalization}}</button>\n </button>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n <div class=\"col-md-6\" formArrayName=\"MatrixBlockTypes\">\n <ng-container *ngFor=\"let item of MatrixBlockTypes.controls;let i =index\">\n <div [formGroupName]=\"i\" [hidden]=\"i !== selectMatrixBlockIndex\">\n <div formArrayName=\"fields\">\n <ng-container *ngFor=\"let itemf of item.controls['fields'].controls;let fi =index\">\n <div [formGroupName]=\"fi\" [hidden]=\"fi !== selectMatrixFieldIndex\">\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"MatrixFieldDisplayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"name\">{{'DigniteAbpForms::FieldName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n <div class=\"form-text\">\n {{'DigniteAbpForms::FieldNameHelpText' | abpLocalization}}</div>\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"description\">{{'Cms::Description' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"description\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\"\n for=\"formControlName\">{{'Cms::FieldType' | abpLocalization}}</label>\n <select class=\"form-select\" formControlName=\"formControlName\" (change)=\"setConfigComponent()\">\n <ng-container *ngFor=\"let itemC of _FieldControlGroup;let i =index\">\n <option [value]=\"itemC.name\">{{itemC.displayName}}</option>\n </ng-container>\n </select>\n </div>\n <ng-container *ngIf=\"itemf.value.formControlName&&itemf\">\n <df-dynamic [type]=\"itemf.value.formControlName\" [entity]=\"itemf\"\n [selected]=\"_selected?_selected.formConfiguration?.MatrixBlockTypes[i]?.fields[fi]:''\"></df-dynamic>\n \n </ng-container>\n </div>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n\n </div>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n\n<abp-modal [(visible)]=\"matrixModalOpen\" [busy]=\"modalBusy\" (visibleChange)=\"matrixModalVisibleChange($event)\" >\n <ng-template #abpHeader>\n <h3>{{isMatrixEdit?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"matrixModalForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"matrixModalForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #matrixModalModalSubmit style=\"display: none\"></button>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"displayName\">{{'Cms::DisplayName' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"displayName\"\n (blur)=\"displayNameInputBlur($event)\">\n </div>\n <div class=\"mb-2\">\n <label class=\"form-label\" for=\"name\">{{'Cms::Name' | abpLocalization}}</label>\n <input type=\"text\" class=\"form-control\" formControlName=\"name\">\n </div>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"matrixModalModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>" }]
2982
- }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: CmsApiService }, { type: FieldAbstractsService }], propDecorators: { type: [{
2983
- type: Input
2984
- }], Entity: [{
2985
- type: Input
2986
- }], selected: [{
2987
- type: Input
2988
- }], submitclick: [{
2989
- type: ViewChild,
2990
- args: ['submitclick', { static: true }]
2991
- }], matrixModalModalSubmit: [{
2992
- type: ViewChild,
2993
- args: ['matrixModalModalSubmit', { static: false }]
2994
- }] } });
2995
-
2996
- /* eslint-disable @angular-eslint/component-selector */
2997
- class MatrixControlComponent {
2998
- constructor(fb) {
2999
- this.fb = fb;
3000
- /**字段配置列表 */
3001
- this._fields = '';
3002
- /**矩阵列表 */
3003
- this.MatrixBlockTypesList = [];
3004
- }
3005
- set entity(v) {
3006
- this._entity = v;
3007
- this.dataLoaded();
3008
- }
3009
- set fields(v) {
3010
- this._fields = v;
3011
- this.dataLoaded();
3012
- }
3013
- set parentFiledName(v) {
3014
- this._parentFiledName = v;
3015
- this.dataLoaded();
3016
- }
3017
- set selected(v) {
3018
- this._selected = v;
3019
- if (v) {
3020
- this.dataLoaded();
3021
- }
3022
- }
3023
- set culture(v) {
3024
- this._culture = v;
3025
- }
3026
- /**数据加载完成 */
3027
- async dataLoaded() {
3028
- if (this._fields && this._entity && this._parentFiledName) {
3029
- this.extraProperties = this._entity.get(this._parentFiledName);
3030
- await this.AfterInit();
3031
- this.submitclick.nativeElement.click();
3032
- if (this._selected)
3033
- this.fieldNameControl.patchValue(this._selected);
3034
- }
3035
- }
3036
- AfterInit() {
3037
- return new Promise((resolve, rejects) => {
3038
- let formConfiguration = this._fields.field.formConfiguration;
3039
- let newArrayGroup = this.fb.array([]);
3040
- this.extraProperties.setControl(this._fields.field.name, newArrayGroup);
3041
- this.fieldNameControl = this.extraProperties.get(this._fields.field.name);
3042
- if (this._selected) {
3043
- this._selected.forEach(el => {
3044
- this.addMatrixControl(formConfiguration.MatrixBlockTypes.find(item => item.name == el.matrixBlockTypeName));
3045
- });
3046
- }
3047
- this.MatrixBlockTypesList = formConfiguration.MatrixBlockTypes;
3048
- resolve(true);
3049
- });
3050
- }
3051
- /**增加指定矩阵控件项 */
3052
- addMatrixControl(item) {
3053
- this.fieldNameControl.push(this.fb.group({
3054
- extraProperties: new FormGroup({
3055
- name: new FormControl('')
3056
- }),
3057
- matrixBlockTypeName: [item.name],
3058
- displayName: [item.displayName]
3059
- }));
3060
- }
3061
- /**删除矩阵控件 */
3062
- deleteMatrixControl(index) {
3063
- this.fieldNameControl.removeAt(index);
3064
- }
3065
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixControlComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
3066
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: MatrixControlComponent, selector: "df-matrix-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <div [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls;let i=index\">\n <div class=\"card mb-3 border \" [formGroupName]=\"i\">\n <div class=\"card-header d-flex align-items-center justify-content-between border-bottom pt-1\">\n <div>{{item.value.displayName}}</div>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteMatrixControl(i)\"><i\n class=\"fas fa-trash p-2\"></i></button>\n </div>\n <div class=\"card-body\">\n <ng-container *ngFor=\"let el of MatrixBlockTypesList;let il =index\">\n <ng-container *ngIf=\"el.name===item.value.matrixBlockTypeName\">\n <ng-container *ngFor=\"let elf of el.fields; let fi=index\">\n <ng-container *ngIf=\"item&&elf&&_culture\">\n <df-dynamic [entity]=\"item\"\n [fields]=\"{ field: elf,displayName:elf.displayName }\"\n [selected]=\"_selected ? _selected[i]?_selected[i][_parentFiledName][elf.name]:'': ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n <div>\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">\n <ng-container *ngFor=\"let item of MatrixBlockTypesList;let i =index\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" (click.stop)=\"addMatrixControl(item)\"><i\n class=\"fas fa-plus me-1\"></i>{{item.displayName}}</button>\n </ng-container>\n </div>\n </div>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }] }); }
3067
- }
3068
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: MatrixControlComponent, decorators: [{
3069
- type: Component,
3070
- args: [{ selector: 'df-matrix-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <div [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls;let i=index\">\n <div class=\"card mb-3 border \" [formGroupName]=\"i\">\n <div class=\"card-header d-flex align-items-center justify-content-between border-bottom pt-1\">\n <div>{{item.value.displayName}}</div>\n <button class=\"btn btn-sm btn-light p-0\" (click.stop)=\"deleteMatrixControl(i)\"><i\n class=\"fas fa-trash p-2\"></i></button>\n </div>\n <div class=\"card-body\">\n <ng-container *ngFor=\"let el of MatrixBlockTypesList;let il =index\">\n <ng-container *ngIf=\"el.name===item.value.matrixBlockTypeName\">\n <ng-container *ngFor=\"let elf of el.fields; let fi=index\">\n <ng-container *ngIf=\"item&&elf&&_culture\">\n <df-dynamic [entity]=\"item\"\n [fields]=\"{ field: elf,displayName:elf.displayName }\"\n [selected]=\"_selected ? _selected[i]?_selected[i][_parentFiledName][elf.name]:'': ''\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </div>\n </ng-container>\n </div>\n <div>\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">\n <ng-container *ngFor=\"let item of MatrixBlockTypesList;let i =index\">\n <button type=\"button\" class=\"btn btn-primary btn-sm\" (click.stop)=\"addMatrixControl(item)\"><i\n class=\"fas fa-plus me-1\"></i>{{item.displayName}}</button>\n </ng-container>\n </div>\n </div>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>" }]
3071
- }], ctorParameters: () => [{ type: i1$1.FormBuilder }], propDecorators: { entity: [{
3072
- type: Input
3073
- }], fields: [{
3074
- type: Input
3075
- }], parentFiledName: [{
3076
- type: Input
3077
- }], selected: [{
3078
- type: Input
3079
- }], culture: [{
3080
- type: Input
3081
- }], submitclick: [{
3082
- type: ViewChild,
3083
- args: ['submitclick', { static: true }]
3084
- }] } });
3085
-
3086
- class TableConfig {
3087
- constructor(data) {
3088
- // 选项
3089
- this.TableColumns = new FormArray([]);
3090
- if (data) {
3091
- for (const key in data) {
3092
- if (data.hasOwnProperty(key)) {
3093
- this[key] = data[key];
3094
- }
3095
- }
3096
- }
3097
- }
3098
- }
3099
- class TableFormControl {
3100
- constructor(data) {
3101
- /**列标题 */
3102
- this.displayName = ['', [Validators.required]];
3103
- /**空间配置 */
3104
- this.formConfiguration = new FormGroup({});
3105
- /**列名 */
3106
- this.name = ['', [Validators.required]];
3107
- //控件标识
3108
- this.formControlName = ['', [Validators.required]];
3109
- /**是否必填 */
3110
- this.required = [false];
3111
- /**描述 */
3112
- this.description = [''];
3113
- if (data) {
3114
- for (const key in data) {
3115
- if (data.hasOwnProperty(key)) {
3116
- this[key] = data[key];
3117
- }
3118
- }
3119
- }
3120
- }
3121
- }
3122
-
3123
- /* eslint-disable @angular-eslint/component-selector */
3124
- class TableConfigComponent {
3125
- constructor(fb, _CmsApiService, _FieldAbstractsService) {
3126
- this.fb = fb;
3127
- this._CmsApiService = _CmsApiService;
3128
- this._FieldAbstractsService = _FieldAbstractsService;
3129
- /**创建站点模态框状态 */
3130
- this.tableSelectOpen = false;
3131
- /**用于确定模态的繁忙状态是否为真 */
3132
- this.modalBusy = false;
3133
- }
3134
- set Entity(v) {
3135
- this._Entity = v;
3136
- this.dataLoaded();
3137
- }
3138
- set selected(v) {
3139
- if (v) {
3140
- this._selected = v;
3141
- this.dataLoaded();
3142
- }
3143
- }
3144
- set type(v) {
3145
- this._type = v;
3146
- this.dataLoaded();
3147
- }
3148
- get formConfiguration() {
3149
- return this._Entity.get('formConfiguration');
3150
- }
3151
- get TableColumns() {
3152
- return this.formConfiguration.controls['TableColumns'];
3153
- }
3154
- async dataLoaded() {
3155
- if (this._Entity && this._type) {
3156
- await this.AfterInit();
3157
- this.submitclick.nativeElement.click();
3158
- }
3159
- }
3160
- /**增加选项 */
3161
- addTableColumns() {
3162
- this.TableColumns.push(this.fb.group({
3163
- ...new TableFormControl(),
3164
- formConfiguration: [{}]
3165
- }));
3166
- }
3167
- /**删除某个选项 */
3168
- deleteTableColumns(index) {
3169
- this.TableColumns.removeAt(index);
3170
- }
3171
- AfterInit() {
3172
- return new Promise((resolve, rejects) => {
3173
- this._Entity.setControl('formConfiguration', this.fb.group(new TableConfig()));
3174
- this._fieldControlGroup = this._FieldAbstractsService.getExcludeAssignControl(this._type);
3175
- if (this._selected && this._selected.formControlName == this._type) {
3176
- this._selected.formConfiguration['TableColumns'].forEach(el => {
3177
- this.addTableColumns();
3178
- });
3179
- this.formConfiguration.patchValue(this._selected.formConfiguration);
3180
- }
3181
- else {
3182
- this.addTableColumns();
3183
- }
3184
- resolve(true);
3185
- });
3186
- }
3187
- /**选择表格的表单控件 */
3188
- selectTableControl(event, i, item) {
3189
- this.CurrentSelectionTableControlName = event.target.value;
3190
- this.tableSelectOpen = true;
3191
- this.tableSelectForm = this.fb.group(new TableFormControl());
3192
- this.TableColumnsIndex = i;
3193
- this.itemForm = item;
3194
- }
3195
- /**创建站点模态框状态改变 */
3196
- tableSelectVisibleChange(event) {
3197
- if (!event) {
3198
- this._tableSelected = undefined;
3199
- this.tableSelectForm = undefined;
3200
- this.CurrentSelectionTableControlName = undefined;
3201
- this.TableColumnsIndex = undefined;
3202
- return;
3203
- }
3204
- }
3205
- /**表单保存提交 */
3206
- createOrEditSave() {
3207
- const formGroup = this.TableColumns.at(this.TableColumnsIndex);
3208
- let formConfigurationgroup = formGroup.get('formConfiguration');
3209
- formConfigurationgroup.setValue({
3210
- ...this.tableSelectForm.value['formConfiguration'],
3211
- });
3212
- this.tableSelectOpen = false;
3213
- }
3214
- /**编辑站点按钮 */
3215
- EditSitesBtn(rows, i) {
3216
- this.CurrentSelectionTableControlName = rows.get('formControlName').value;
3217
- this.tableSelectForm = this.fb.group(new TableFormControl());
3218
- this.tableSelectForm.patchValue({
3219
- ...rows.value
3220
- });
3221
- this.tableSelectForm.get('formConfiguration').patchValue({
3222
- ...rows.value['formConfiguration']
3223
- });
3224
- this._tableSelected = rows.value;
3225
- this.TableColumnsIndex = i;
3226
- this.tableSelectOpen = true;
3227
- }
3228
- /**调整表格位置 */
3229
- TableArrowUpOrDown(type, index) {
3230
- let controlAt = this.TableColumns.at(index);
3231
- this.TableColumns.removeAt(index);
3232
- let lastindex = type == 'up' ? index - 1 : index + 1;
3233
- this.TableColumns.insert(lastindex, controlAt);
3234
- }
3235
- /**字段标签input失去标点生成字段名字 */
3236
- disPlayNameInputBlur(event, item) {
3237
- let value = event.target.value;
3238
- let pinyin = this._CmsApiService.chineseToPinyin(value);
3239
- let nameInput = item.get('name');
3240
- if (nameInput.value)
3241
- return;
3242
- nameInput.patchValue(pinyin);
3243
- }
3244
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableConfigComponent, deps: [{ token: i1$1.FormBuilder }, { token: CmsApiService }, { token: FieldAbstractsService }], target: i0.ɵɵFactoryTarget.Component }); }
3245
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: TableConfigComponent, selector: "df-table-config", inputs: { Entity: "Entity", selected: "selected", type: "type" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }, { propertyName: "tableSelectModalSubmit", first: true, predicate: ["tableSelectModalSubmit"], descendants: true }], ngImport: i0, template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'Cms::TableColumnDisplayName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnForm' | abpLocalization}}</th>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableColumns()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"TableColumns\">\n <ng-container *ngFor=\"let item of TableColumns.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"displayName\" (blur)=\"disPlayNameInputBlur($event,item)\" ></td>\n <td><input type=\"text\" class=\"form-control\" formControlName=\"name\"></td>\n <td>\n <select class=\"form-select\" formControlName=\"formControlName\"\n (change)=\"selectTableControl($event,i,item)\">\n <option value=\"\">SelectFrom</option>\n <ng-container *ngFor=\"let item_f of _fieldControlGroup;let i_f =index\">\n <option [value]=\"item_f.name\">{{item_f.displayName}}</option>\n </ng-container>\n </select>\n </td>\n <td scope=\"row\">\n <div class=\"flex-start\">\n <button class=\"btn btn-light btn-sm \" (click.stop)=\"EditSitesBtn(item,i)\">\n <i class=\"fas fa-edit\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"deleteTableColumns(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==0\"\n (click.stop)=\"TableArrowUpOrDown('up',i)\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==TableColumns.controls.length-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n<abp-modal [(visible)]=\"tableSelectOpen\" [busy]=\"modalBusy\" (visibleChange)=\"tableSelectVisibleChange($event)\" [options]=\"{ size: CurrentSelectionTableControlName=='Matrix'?'xl':'' ,scrollable:false }\">\n <ng-template #abpHeader>\n <h3>{{_tableSelected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"tableSelectForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"tableSelectForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #tableSelectModalSubmit style=\"display: none\"></button>\n <ng-container *ngIf=\"CurrentSelectionTableControlName&&tableSelectForm\">\n <df-dynamic [type]=\"CurrentSelectionTableControlName\" [entity]=\"tableSelectForm\"\n [selected]=\"_tableSelected\" [formGroup]=\"tableSelectForm\"></df-dynamic>\n </ng-container>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"tableSelectModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.InitDirective, selector: "[abpInit]", outputs: ["abpInit"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "directive", type: i9.ValidationDirective, selector: "[formControl],[formControlName]", exportAs: ["validationDirective"] }, { kind: "component", type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }, { kind: "component", type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { kind: "directive", type: i3.ModalCloseDirective, selector: "[abpClose]" }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }, { kind: "pipe", type: i1.LocalizationPipe, name: "abpLocalization" }] }); }
3246
- }
3247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableConfigComponent, decorators: [{
3248
- type: Component,
3249
- args: [{ selector: 'df-table-config', template: "<form [formGroup]=\"_Entity\">\n <div formGroupName=\"formConfiguration\">\n <div class=\"mb-2\">\n <label class=\"form-label\">{{'DigniteAbpForms::SelectListItem' | abpLocalization}}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <th scope=\"col\">{{'Cms::TableColumnDisplayName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnName' | abpLocalization}}</th>\n <th scope=\"col\">{{'Cms::TableColumnForm' | abpLocalization}}</th>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableColumns()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody formArrayName=\"TableColumns\">\n <ng-container *ngFor=\"let item of TableColumns.controls;let i=index\">\n <tr [formGroupName]=\"i\">\n <td><input type=\"text\" class=\"form-control\" formControlName=\"displayName\" (blur)=\"disPlayNameInputBlur($event,item)\" ></td>\n <td><input type=\"text\" class=\"form-control\" formControlName=\"name\"></td>\n <td>\n <select class=\"form-select\" formControlName=\"formControlName\"\n (change)=\"selectTableControl($event,i,item)\">\n <option value=\"\">SelectFrom</option>\n <ng-container *ngFor=\"let item_f of _fieldControlGroup;let i_f =index\">\n <option [value]=\"item_f.name\">{{item_f.displayName}}</option>\n </ng-container>\n </select>\n </td>\n <td scope=\"row\">\n <div class=\"flex-start\">\n <button class=\"btn btn-light btn-sm \" (click.stop)=\"EditSitesBtn(item,i)\">\n <i class=\"fas fa-edit\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"deleteTableColumns(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==0\"\n (click.stop)=\"TableArrowUpOrDown('up',i)\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" *ngIf=\"i!==TableColumns.controls.length-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n </div>\n <button type=\"submit\" (abpInit)=\"submitclick?.nativeElement?.click()\" style=\"display: none;\"\n #submitclick></button>\n </div>\n</form>\n\n\n<abp-modal [(visible)]=\"tableSelectOpen\" [busy]=\"modalBusy\" (visibleChange)=\"tableSelectVisibleChange($event)\" [options]=\"{ size: CurrentSelectionTableControlName=='Matrix'?'xl':'' ,scrollable:false }\">\n <ng-template #abpHeader>\n <h3>{{_tableSelected?('AbpUi::Edit' | abpLocalization):('Cms::New' | abpLocalization)}}</h3>\n </ng-template>\n <ng-template #abpBody>\n <ng-template #loaderRef>\n <div class=\"text-center\"><i class=\"fa fa-pulse fa-spinner\" aria-hidden=\"true\"></i></div>\n </ng-template>\n <ng-container *ngIf=\"tableSelectForm; else loaderRef\">\n <form class=\"sites-modal-form\" #myForm=\"ngForm\" [formGroup]=\"tableSelectForm\"\n (keydown.enter)=\"$event.preventDefault()\" (submit)=\"createOrEditSave()\">\n <button type=\"submit\" #tableSelectModalSubmit style=\"display: none\"></button>\n <ng-container *ngIf=\"CurrentSelectionTableControlName&&tableSelectForm\">\n <df-dynamic [type]=\"CurrentSelectionTableControlName\" [entity]=\"tableSelectForm\"\n [selected]=\"_tableSelected\" [formGroup]=\"tableSelectForm\"></df-dynamic>\n </ng-container>\n </form>\n </ng-container>\n </ng-template>\n <ng-template #abpFooter>\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>{{'AbpUi::Close' | abpLocalization}}</button>\n <abp-button iconClass=\"fa fa-check\"\n (click)=\"tableSelectModalSubmit.nativeElement.click()\">{{'AbpUi::Save' | abpLocalization}}</abp-button>\n </ng-template>\n</abp-modal>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"] }]
3250
- }], ctorParameters: () => [{ type: i1$1.FormBuilder }, { type: CmsApiService }, { type: FieldAbstractsService }], propDecorators: { Entity: [{
3251
- type: Input
3252
- }], selected: [{
3253
- type: Input
3254
- }], type: [{
3255
- type: Input
3256
- }], submitclick: [{
3257
- type: ViewChild,
3258
- args: ['submitclick', { static: true }]
3259
- }], tableSelectModalSubmit: [{
3260
- type: ViewChild,
3261
- args: ['tableSelectModalSubmit', { static: false }]
3262
- }] } });
3263
-
3264
- class TableControlComponent {
3265
- constructor() {
3266
- this.fb = inject(FormBuilder);
3267
- /**字段配置列表 */
3268
- this._fields = '';
3269
- }
3270
- set entity(v) {
3271
- this._entity = v;
3272
- this.dataLoaded();
3273
- }
3274
- set fields(v) {
3275
- this._fields = v;
3276
- this.dataLoaded();
3277
- }
3278
- set parentFiledName(v) {
3279
- this._parentFiledName = v;
3280
- this.dataLoaded();
3281
- }
3282
- set selected(v) {
3283
- this._selected = v;
3284
- if (v) {
3285
- this.dataLoaded();
3286
- }
3287
- }
3288
- set culture(v) {
3289
- this._culture = v;
3290
- }
3291
- /**数据加载完成 */
3292
- async dataLoaded() {
3293
- if (this._fields && this._entity && this._parentFiledName) {
3294
- this.extraProperties = this._entity.get(this._parentFiledName);
3295
- await this.AfterInit();
3296
- this.submitclick.nativeElement.click();
3297
- }
3298
- }
3299
- AfterInit() {
3300
- return new Promise((resolve, rejects) => {
3301
- let ValidatorsArray = [];
3302
- if (this._fields.required) {
3303
- ValidatorsArray.push(Validators.required);
3304
- }
3305
- let formConfiguration = this._fields.field.formConfiguration;
3306
- this.formConfiguration = formConfiguration;
3307
- let newArrayGroup = this.fb.array([]);
3308
- this.extraProperties.setControl(this._fields.field.name, newArrayGroup);
3309
- this.fieldNameControl = this.extraProperties.get(this._fields.field.name);
3310
- if (this._selected) {
3311
- this._selected.forEach(el => {
3312
- this.addTableControlItem();
3313
- });
3314
- this.fieldNameControl.patchValue(this._selected);
3315
- }
3316
- else {
3317
- this.addTableControlItem();
3318
- }
3319
- resolve(true);
3320
- });
3321
- }
3322
- /**增加表格项 */
3323
- addTableControlItem() {
3324
- this.fieldNameControl.push(this.fb.group({
3325
- 'extraProperties': this.fb.group({})
3326
- }));
3327
- }
3328
- /**删除表格项 */
3329
- minusTableControlItem(index) {
3330
- this.fieldNameControl.removeAt(index);
3331
- }
3332
- /**调整表格位置 */
3333
- TableArrowUpOrDown(type, index) {
3334
- let controlAt = this.fieldNameControl.at(index);
3335
- this.fieldNameControl.removeAt(index);
3336
- let lastindex = type == 'up' ? index - 1 : index + 1;
3337
- this.fieldNameControl.insert(lastindex, controlAt);
3338
- this._selected = this.fieldNameControl.value;
3339
- }
3340
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3341
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.5", type: TableControlComponent, selector: "df-table-control", inputs: { entity: "entity", fields: "fields", parentFiledName: "parentFiledName", selected: "selected", culture: "culture" }, viewQueries: [{ propertyName: "submitclick", first: true, predicate: ["submitclick"], descendants: true, static: true }], ngImport: i0, template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let item of formConfiguration.TableColumns\">\n <th scope=\"col\">{{ item.displayName }}</th>\n </ng-container>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableControlItem()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls; let i = index\">\n <tr>\n <ng-container *ngFor=\"let el of formConfiguration.TableColumns\">\n <td>\n <ng-container *ngIf=\"item&&el\">\n <df-dynamic [entity]=\"item\" [fields]=\"{ field: el }\"\n [selected]=\"_selected[i]?.extraProperties[''+el.name+'']\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </td>\n </ng-container>\n <td scope=\"row\" class=\"\">\n <div class=\"flex-end mb-2\">\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"minusTableControlItem(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"TableArrowUpOrDown('up',i)\"\n *ngIf=\"i!==0\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\"\n *ngIf=\"i!==fieldNameControl.controls.length-1\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "directive", type: i1.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }, { kind: "directive", type: i9.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { kind: "component", type: i8$2.DynamicComponent, selector: "df-dynamic", inputs: ["selected", "type", "entity", "culture", "parentFiledName", "fields"] }] }); }
3342
- }
3343
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: TableControlComponent, decorators: [{
3344
- type: Component,
3345
- args: [{ selector: 'df-table-control', template: "<form [formGroup]=\"_entity\">\n <div formGroupName=\"extraProperties\">\n <div class=\"mb-2\">\n <label class=\"form-label\" *ngIf=\"_fields.displayName\">{{ _fields.displayName }}</label>\n <table class=\"table\">\n <thead>\n <tr>\n <ng-container *ngFor=\"let item of formConfiguration.TableColumns\">\n <th scope=\"col\">{{ item.displayName }}</th>\n </ng-container>\n <th scope=\"col\" class=\"flex-end\">\n <button class=\"btn btn-light btn-sm\" (click.stop)=\"addTableControlItem()\">\n <i class=\"fas fa-plus-circle\"></i>\n </button>\n </th>\n </tr>\n </thead>\n <tbody [formArrayName]=\"_fields.field.name\">\n <ng-container *ngFor=\"let item of fieldNameControl.controls; let i = index\">\n <tr>\n <ng-container *ngFor=\"let el of formConfiguration.TableColumns\">\n <td>\n <ng-container *ngIf=\"item&&el\">\n <df-dynamic [entity]=\"item\" [fields]=\"{ field: el }\"\n [selected]=\"_selected[i]?.extraProperties[''+el.name+'']\"\n [parentFiledName]=\"'extraProperties'\" [culture]=\"_culture\"></df-dynamic>\n </ng-container>\n </td>\n </ng-container>\n <td scope=\"row\" class=\"\">\n <div class=\"flex-end mb-2\">\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"minusTableControlItem(i)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\" (click.stop)=\"TableArrowUpOrDown('up',i)\"\n *ngIf=\"i!==0\">\n <i class=\"fas fa-arrow-up\"></i>\n </button>\n <button class=\"btn btn-light btn-sm ms-1\"\n (click.stop)=\"TableArrowUpOrDown('down',i)\"\n *ngIf=\"i!==fieldNameControl.controls.length-1\">\n <i class=\"fas fa-arrow-down\"></i>\n </button>\n </div>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n <div class=\"form-text\" *ngIf=\"_fields.field.description\">{{_fields.field.description}}</div>\n </div>\n </div>\n <button type=\"submit\" style=\"display: none\" #submitclick></button>\n</form>", styles: [".flex-end{display:flex;align-items:center;justify-content:flex-end}.flex-start{display:flex;align-items:center;justify-content:flex-start}\n"] }]
3346
- }], ctorParameters: () => [], propDecorators: { entity: [{
3347
- type: Input
3348
- }], fields: [{
3349
- type: Input
3350
- }], parentFiledName: [{
3351
- type: Input
3352
- }], selected: [{
3353
- type: Input
3354
- }], culture: [{
3355
- type: Input
3356
- }], submitclick: [{
3357
- type: ViewChild,
3358
- args: ['submitclick', { static: true }]
3359
- }] } });
3360
-
3361
- /**
3362
- * 表单控件分组-包含配置,控件,显示的数组
3363
- */
3364
- const FieldControlGroup = [
3365
- {
3366
- displayName: '表格',
3367
- name: 'Table',
3368
- fieldConfigComponent: TableConfigComponent,
3369
- fieldComponent: TableControlComponent,
3370
- },
3371
- {
3372
- displayName: '矩阵',
3373
- name: 'Matrix',
3374
- fieldConfigComponent: MatrixConfigComponent,
3375
- fieldComponent: MatrixControlComponent,
3376
- },
3377
- {
3378
- displayName: '条目',
3379
- name: 'Entry',
3380
- fieldConfigComponent: EntryConfigComponent,
3381
- fieldComponent: EntryControlComponent,
3382
- },
3383
- ];
3384
-
3385
- var styles = `
3386
- .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}
3387
- a {
3388
- text-decoration: unset;
3389
- }
3390
-
3391
- .form-label{
3392
- font-size: 12px;
3393
- }
3394
- :root select{
3395
- cursor: pointer; /* this will show the pointer when hovering */
3396
- }
3397
- .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 }
3398
-
3399
- /*** 表单验证样式 start */
3400
- .was-validated .form-control:invalid, .form-control.is-invalid{
3401
- border-color: #c00d49 !important;
3402
- }
3403
- /*** 表单验证样式 end */
3404
- `;
3405
-
3406
- let isAppentStyle = false;
3407
- function appentStyle() {
3408
- /**确保该路由守卫只会执行一次 */
3409
- if (isAppentStyle)
3410
- return;
3411
- isAppentStyle = true;
3412
- const rendererFactory = inject(RendererFactory2);
3413
- let renderer = rendererFactory.createRenderer(null, null);
3414
- const style = renderer.createElement('style');
3415
- renderer.setProperty(style, 'innerHTML', styles);
3416
- renderer.appendChild(document.head, style);
3417
- }
3418
-
3419
- /**版块 */
3420
- const Sections_Defaults_Toolbar_Action = ToolbarAction.createMany([
3421
- {
3422
- text: 'Cms::New',
3423
- action: data => {
3424
- const component = data.getInjected(SectionsComponent);
3425
- component.createSectionBtn();
3426
- },
3427
- btnClass: '',
3428
- permission: 'CmsAdmin.Entry.Create',
3429
- icon: 'fa fa-plus',
3430
- },
3431
- ]);
3432
- /**版块-创建-编辑 */
3433
- const Sections_Create_Or_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
3434
- {
3435
- text: 'AbpUi::Save',
3436
- action: data => {
3437
- const component = data.getInjected(CreateOrEditComponent);
3438
- component.submitclickBtn();
3439
- },
3440
- btnClass: '',
3441
- permission: 'CmsAdmin.Entry.Create',
3442
- icon: 'fas fa-save',
3443
- },
3444
- ]);
3445
- /**站点 */
3446
- // export const Sites_Defaults_Toolbar_Action = ToolbarAction.createMany<any[]>([
3447
- // {
3448
- // text: 'Cms::New',
3449
- // action: data => {
3450
- // const component = data.getInjected(SitesComponent);
3451
- // // component.createSitesBtn();
3452
- // },
3453
- // btnClass: '',
3454
- // permission: 'CmsAdmin.Entry.Create',
3455
- // icon: 'fa fa-plus',
3456
- // },
3457
- // ]);
3458
- /**字段 */
3459
- const Fields_Defaults_Toolbar_Action = ToolbarAction.createMany([
3460
- {
3461
- text: 'Cms::New',
3462
- action: data => {
3463
- const component = data.getInjected(FieldsComponent);
3464
- component.toFieldsCreateBtn();
3465
- },
3466
- btnClass: '',
3467
- permission: 'CmsAdmin.Entry.Create',
3468
- icon: 'fa fa-plus',
3469
- },
3470
- ]);
3471
- /**字段-创建 */
3472
- const Fields_Create_Defaults_Toolbar_Action = ToolbarAction.createMany([
3473
- {
3474
- text: 'AbpUi::Save',
3475
- action: data => {
3476
- const component = data.getInjected(CreateFieldComponent);
3477
- component.submitclickBtn();
3478
- },
3479
- btnClass: '',
3480
- permission: 'CmsAdmin.Entry.Create',
3481
- icon: 'fas fa-save',
3482
- },
3483
- ]);
3484
- /**字段-创建 */
3485
- const Fields_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
3486
- {
3487
- text: 'AbpUi::Save',
3488
- action: data => {
3489
- const component = data.getInjected(EditFieldComponent);
3490
- component.submitclickBtn();
3491
- },
3492
- btnClass: '',
3493
- permission: 'CmsAdmin.Entry.Create',
3494
- icon: 'fas fa-save',
3495
- },
3496
- ]);
3497
- /**条目 */
3498
- const Entries_Defaults_Toolbar_Action = ToolbarAction.createMany([
3499
- {
3500
- text: 'Cms::New',
3501
- action: data => {
3502
- const component = data.getInjected(EntriesComponent);
3503
- component.createEntriesBtn();
3504
- },
3505
- btnClass: '',
3506
- permission: 'CmsAdmin.Entry.Create',
3507
- icon: 'fa fa-plus',
3508
- },
3509
- ]);
3510
- /**条目-创建 */
3511
- const Entries_Create_Defaults_Toolbar_Action = ToolbarAction.createMany([
3512
- {
3513
- text: 'AbpUi::Cancel',
3514
- action: data => {
3515
- const component = data.getInjected(CreateComponent);
3516
- component.backTo();
3517
- },
3518
- btnClass: 'btn btn-light btn-sm',
3519
- permission: 'CmsAdmin.Entry.Create',
3520
- icon: '',
3521
- },
3522
- {
3523
- text: 'AbpUi::Save',
3524
- action: data => {
3525
- const component = data.getInjected(CreateComponent);
3526
- component.clickSubmit(true);
3527
- },
3528
- btnClass: 'btn btn-info btn-sm',
3529
- permission: 'CmsAdmin.Entry.Create',
3530
- icon: 'fas fa-save',
3531
- },
3532
- {
3533
- text: 'Cms::Publish',
3534
- action: data => {
3535
- const component = data.getInjected(CreateComponent);
3536
- component.clickSubmit(false);
3537
- },
3538
- btnClass: '',
3539
- permission: 'CmsAdmin.Entry.Create',
3540
- icon: 'fa fa-paper-plane',
3541
- },
3542
- ]);
3543
- /**条目编辑 */
3544
- const Entries_Edit_Defaults_Toolbar_Action = ToolbarAction.createMany([
3545
- {
3546
- text: 'AbpUi::Cancel',
3547
- action: data => {
3548
- const component = data.getInjected(EditComponent);
3549
- component.backTo();
3550
- },
3551
- btnClass: 'btn btn-light btn-sm',
3552
- permission: 'CmsAdmin.Entry.Create',
3553
- icon: '',
3554
- },
3555
- {
3556
- text: 'AbpUi::Save',
3557
- action: data => {
3558
- const component = data.getInjected(EditComponent);
3559
- component.clickSubmit(true);
3560
- },
3561
- btnClass: 'btn btn-info btn-sm',
3562
- permission: 'CmsAdmin.Entry.Create',
3563
- icon: 'fas fa-save',
3564
- },
3565
- {
3566
- text: 'Cms::Publish',
3567
- action: data => {
3568
- const component = data.getInjected(EditComponent);
3569
- component.clickSubmit(false);
3570
- },
3571
- btnClass: '',
3572
- permission: 'CmsAdmin.Entry.Create',
3573
- icon: 'fa fa-paper-plane',
3574
- },
3575
- ]);
3576
-
3577
- /**默认-实体-操作 */
3578
- const Default_Entity_Actions = {
3579
- // [ModuleComponent.AbpTable]: Abp_Table_Entity_Action,
3580
- };
3581
- /**默认实体属性-表格列名 */
3582
- const Default_Entity_Props = {
3583
- // [PageName.Guides]: Guides_Entity_Props,
3584
- };
3585
- /**默认-工具栏-操作 */
3586
- const Default_Toolbar_Actions = {
3587
- // [ModuleComponent.Page]: Page_Toolbar_Action,
3588
- // [eCmsKitPageName.FaqQuestion]:FaqQuestion_Toolbar_Action
3589
- [ECmsComponent.Entries]: Entries_Defaults_Toolbar_Action,
3590
- [ECmsComponent.Entries_Create]: Entries_Create_Defaults_Toolbar_Action,
3591
- [ECmsComponent.Entries_Edit]: Entries_Edit_Defaults_Toolbar_Action,
3592
- [ECmsComponent.Fields]: Fields_Defaults_Toolbar_Action,
3593
- [ECmsComponent.FieldsCreate]: Fields_Create_Defaults_Toolbar_Action,
3594
- [ECmsComponent.FieldsEdit]: Fields_Edit_Defaults_Toolbar_Action,
3595
- [ECmsComponent.Sections]: Sections_Defaults_Toolbar_Action,
3596
- [ECmsComponent.SectionsCreateOrEdit]: Sections_Create_Or_Edit_Defaults_Toolbar_Action,
3597
- };
3598
- /**
3599
- *
3600
- * @param 在Extensions_Props_Action_Token_Resolver方法中使用
3601
- * @param 在.module.ts中使用,
3602
- export class CmsModule {
3603
- static forChild(options: any = {}): ModuleWithProviders<CmsModule> {
3604
- return {
3605
- ngModule: CmsModule,
3606
- providers: [
3607
- {
3608
- provide: Toolbar_Action_Contributors,
3609
- useValue: options.toolbarActionContributors,
3610
- },
3611
- {
3612
- provide: Entity_Action_Contributors,
3613
- useValue: options.entityActionContributors,
3614
- },
3615
- {
3616
- provide: Entity_Props_Contributors,
3617
- useValue: options.entityPropContributors,
3618
- },
3619
- ]
3620
- };
3621
- }
3622
- static forLazy(options: any = {}): NgModuleFactory<CmsModule> {
3623
- return new LazyModuleFactory(CmsModule.forChild(options));
3624
- }
3625
- }
3626
- *
3627
- *
3628
- */
3629
- /**实体-操作-贡献者 */
3630
- const Entity_Action_Contributors = new InjectionToken('Entity_Action_Contributors');
3631
- /**实体-属性-贡献者 */
3632
- const Entity_Props_Contributors = new InjectionToken('Entity_Props_Contributors');
3633
- const Toolbar_Action_Contributors = new InjectionToken('Toolbar_Action_Contributors');
3634
- /**
3635
- * 属性-操作-贡献者-解析器
3636
- *
3637
- * 用于放在-routing.module.ts路由守卫中
3638
- *
3639
- *
3640
- const routes: Routes = [
3641
- {
3642
- path: 'demo',
3643
- canActivate: [AuthGuard, PermissionGuard],
3644
- resolve: [Extensions_Props_Action_Token_Resolver],
3645
- children: []
3646
- },
3647
- ]
3648
- *
3649
- *
3650
- */
3651
- const Extensions_Props_Action_Token_Resolver = () => {
3652
- const configState = inject(ConfigStateService);
3653
- const extensions = inject(ExtensionsService);
3654
- const config = { optional: true };
3655
- const actionContributors = inject(Entity_Action_Contributors, config) || {};
3656
- const propContributors = inject(Entity_Props_Contributors, config) || {};
3657
- const toolbarContributors = inject(Toolbar_Action_Contributors, config) || {};
3658
- return getObjectExtensionEntitiesFromStore(configState, 'TenantManagement').pipe(map(entities => ({
3659
- // [ModuleComponent.AbpTable]: entities.Tenant,
3660
- })), mapEntitiesToContributors(configState, 'TenantManagement'), tap(objectExtensionContributors => {
3661
- //actions
3662
- mergeWithDefaultActions(extensions.entityActions, Default_Entity_Actions, actionContributors);
3663
- //props
3664
- mergeWithDefaultProps(extensions.entityProps, Default_Entity_Props, objectExtensionContributors.prop, propContributors);
3665
- //Toolbar
3666
- mergeWithDefaultActions(extensions.toolbarActions, Default_Toolbar_Actions, toolbarContributors);
3667
- }));
3668
- };
3669
- // /**
3670
- // * @deprecated Use `tenantManagementExtensions_Props_Action_Token_Resolver` *function* instead.
3671
- // */
3672
- // @Injectable()
3673
- // export class TenantManagementExtensionsGuard implements IAbpGuard {
3674
- // protected readonly configState = inject(ConfigStateService);
3675
- // protected readonly extensions = inject(ExtensionsService);
3676
- // canActivate(): Observable<boolean> {
3677
- // const config = { optional: true };
3678
- // const actionContributors = inject(TENANT_MANAGEMENT_Entity_Action_Contributors, config) || {};
3679
- // const propContributors = inject(TENANT_MANAGEMENT_Entity_Props_Contributors, config) || {};
3680
- // return getObjectExtensionEntitiesFromStore(this.configState, 'TenantManagement').pipe(
3681
- // map(entities => ({
3682
- // // [eTenantManagementComponents.Tenants]: entities.Tenant,
3683
- // })),
3684
- // mapEntitiesToContributors(this.configState, 'TenantManagement'),
3685
- // tap(objectExtensionContributors => {
3686
- // mergeWithDefaultActions(
3687
- // this.extensions.entityActions,
3688
- // DEFAULT_TENANT_MANAGEMENT_ENTITY_ACTIONS,
3689
- // actionContributors,
3690
- // );
3691
- // mergeWithDefaultProps(
3692
- // this.extensions.entityProps,
3693
- // DEFAULT_TENANT_MANAGEMENT_ENTITY_PROPS,
3694
- // objectExtensionContributors.prop,
3695
- // propContributors,
3696
- // );
3697
- // }),
3698
- // map(() => true),
3699
- // );
3700
- // }
3701
- // }
3702
-
3703
- const routes = [
3704
- {
3705
- path: 'admin',
3706
- canActivate: [AuthGuard, PermissionGuard],
3707
- resolve: [Extensions_Props_Action_Token_Resolver, appentStyle],
3708
- children: [
3709
- {
3710
- path: 'entries',
3711
- children: [
3712
- {
3713
- path: '',
3714
- component: EntriesComponent,
3715
- data: { keep: true }
3716
- },
3717
- {
3718
- path: 'create',
3719
- component: CreateComponent,
3720
- },
3721
- {
3722
- path: ':entrieId/edit',
3723
- component: EditComponent,
3724
- },
3725
- ],
3726
- },
3727
- {
3728
- path: '',
3729
- children: [
3730
- {
3731
- path: 'fields',
3732
- children: [
3733
- {
3734
- path: '',
3735
- component: FieldsComponent,
3736
- data: { keep: true }
3737
- },
3738
- {
3739
- path: 'create',
3740
- component: CreateFieldComponent,
3741
- },
3742
- {
3743
- path: ':id/edit',
3744
- component: EditFieldComponent,
3745
- },
3746
- ],
3747
- },
3748
- {
3749
- path: 'sections',
3750
- children: [
3751
- {
3752
- path: '',
3753
- data: { keep: true },
3754
- component: SectionsComponent,
3755
- },
3756
- {
3757
- path: ':sectionsId/entry-types',
3758
- children: [
3759
- {
3760
- path: 'create',
3761
- component: CreateOrEditComponent,
3762
- },
3763
- {
3764
- path: ':entryTypesId/edit',
3765
- component: CreateOrEditComponent,
3766
- },
3767
- ],
3768
- },
3769
- ],
3770
- },
3771
- ],
3772
- },
3773
- ],
3774
- },
3775
- ];
3776
- class CmsRoutingModule {
3777
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3778
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, imports: [i3$1.RouterModule], exports: [RouterModule] }); }
3779
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
3780
- }
3781
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsRoutingModule, decorators: [{
3782
- type: NgModule,
3783
- args: [{
3784
- imports: [RouterModule.forChild(routes)],
3785
- exports: [RouterModule],
3786
- }]
3787
- }] });
3788
-
3789
- class CmsModule {
3790
- static forChild(options = {}) {
3791
- return {
3792
- ngModule: CmsModule,
3793
- providers: [
3794
- {
3795
- provide: Toolbar_Action_Contributors,
3796
- useValue: options.toolbarActionContributors,
3797
- },
3798
- {
3799
- provide: Entity_Action_Contributors,
3800
- useValue: options.entityActionContributors,
3801
- },
3802
- {
3803
- provide: Entity_Props_Contributors,
3804
- useValue: options.entityPropContributors,
3805
- },
3806
- ],
3807
- };
3808
- }
3809
- static forLazy(options = {}) {
3810
- return new LazyModuleFactory(CmsModule.forChild(options));
3811
- }
3812
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3813
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, declarations: [EntriesComponent,
3814
- FieldsComponent,
3815
- SectionsComponent,
3816
- FieldGroupComponent,
3817
- CreateFieldComponent,
3818
- EditFieldComponent,
3819
- CreateOrEditFieldComponent,
3820
- CreateOrEditComponent,
3821
- CreateComponent,
3822
- EditComponent,
3823
- CreateOrEditEntriesComponent,
3824
- TableConfigComponent,
3825
- TableControlComponent,
3826
- MatrixConfigComponent,
3827
- MatrixControlComponent,
3828
- EntryConfigComponent,
3829
- EntryControlComponent], imports: [CoreModule,
3830
- ThemeSharedModule,
3831
- FormsModule,
3832
- CmsRoutingModule,
3833
- NgbNavModule,
3834
- NgbAccordionModule,
3835
- NgbDropdownModule,
3836
- PageModule,
3837
- NzSelectModule, i8$2.DynamicFormModule], exports: [TableConfigComponent,
3838
- TableControlComponent,
3839
- MatrixConfigComponent,
3840
- MatrixControlComponent,
3841
- EntryConfigComponent,
3842
- EntryControlComponent] }); }
3843
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, imports: [CoreModule,
3844
- ThemeSharedModule,
3845
- FormsModule,
3846
- CmsRoutingModule,
3847
- NgbNavModule,
3848
- NgbAccordionModule,
3849
- NgbDropdownModule,
3850
- PageModule,
3851
- NzSelectModule,
3852
- DynamicFormModule.forRoot({
3853
- cmsFieldControlGroup: [...FieldControlGroup, ...fielFieldControlGroup, ...ckEditorFieldControlGroup]
3854
- })] }); }
3855
- }
3856
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: CmsModule, decorators: [{
3857
- type: NgModule,
3858
- args: [{
3859
- declarations: [
3860
- EntriesComponent,
3861
- FieldsComponent,
3862
- SectionsComponent,
3863
- FieldGroupComponent,
3864
- CreateFieldComponent,
3865
- EditFieldComponent,
3866
- CreateOrEditFieldComponent,
3867
- CreateOrEditComponent,
3868
- CreateComponent,
3869
- EditComponent,
3870
- CreateOrEditEntriesComponent,
3871
- TableConfigComponent,
3872
- TableControlComponent,
3873
- MatrixConfigComponent,
3874
- MatrixControlComponent,
3875
- EntryConfigComponent,
3876
- EntryControlComponent,
3877
- ],
3878
- imports: [
3879
- CoreModule,
3880
- ThemeSharedModule,
3881
- FormsModule,
3882
- CmsRoutingModule,
3883
- NgbNavModule,
3884
- NgbAccordionModule,
3885
- NgbDropdownModule,
3886
- PageModule,
3887
- NzSelectModule,
3888
- DynamicFormModule.forRoot({
3889
- cmsFieldControlGroup: [...FieldControlGroup, ...fielFieldControlGroup, ...ckEditorFieldControlGroup]
3890
- }),
3891
- ],
3892
- exports: [
3893
- TableConfigComponent,
3894
- TableControlComponent,
3895
- MatrixConfigComponent,
3896
- MatrixControlComponent,
3897
- EntryConfigComponent,
3898
- EntryControlComponent,
3899
- ],
3900
- providers: [],
3901
- }]
3902
- }] });
3903
-
3904
- /*
3905
- * Public API Surface of cms
3906
- */
3907
-
3908
- /**
3909
- * Generated bundle index. Do not edit.
3910
- */
3911
-
3912
- export { CmsModule, EntryConfig, EntryConfigComponent, EntryControlComponent, FieldControlGroup, MatrixConfig, MatrixConfigComponent, MatrixControlComponent, MatrixItemConfig, TableConfig, TableConfigComponent, TableControlComponent, TableFormControl, matrixFieldInputBase };
3913
- //# sourceMappingURL=dignite-ng-expand.cms.mjs.map