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