@ebuilding/base 2.0.0

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 (411) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/components/drawer/index.d.ts +1 -0
  4. package/components/drawer/src/drawer-content.directive.d.ts +9 -0
  5. package/components/drawer/src/drawer-options.d.ts +41 -0
  6. package/components/drawer/src/drawer-ref.d.ts +27 -0
  7. package/components/drawer/src/drawer.component.d.ts +120 -0
  8. package/components/drawer/src/drawer.module.d.ts +8 -0
  9. package/components/drawer/src/drawer.service.d.ts +22 -0
  10. package/components/drawer/src/public_api.d.ts +6 -0
  11. package/components/empty/index.d.ts +1 -0
  12. package/components/empty/src/default/index.d.ts +13 -0
  13. package/components/empty/src/index.module.d.ts +7 -0
  14. package/components/empty/src/public_api.d.ts +2 -0
  15. package/components/index.d.ts +2 -0
  16. package/fesm2022/components.drawer.mjs +706 -0
  17. package/fesm2022/components.drawer.mjs.map +1 -0
  18. package/fesm2022/components.empty.mjs +54 -0
  19. package/fesm2022/components.empty.mjs.map +1 -0
  20. package/fesm2022/components.mjs +750 -0
  21. package/fesm2022/components.mjs.map +1 -0
  22. package/fesm2022/config.content.mjs +4464 -0
  23. package/fesm2022/config.content.mjs.map +1 -0
  24. package/fesm2022/config.form.mjs +2190 -0
  25. package/fesm2022/config.form.mjs.map +1 -0
  26. package/fesm2022/config.header.mjs +2736 -0
  27. package/fesm2022/config.header.mjs.map +1 -0
  28. package/fesm2022/config.list.mjs +7192 -0
  29. package/fesm2022/config.list.mjs.map +1 -0
  30. package/fesm2022/config.page-dialog.mjs +639 -0
  31. package/fesm2022/config.page-dialog.mjs.map +1 -0
  32. package/fesm2022/config.page.mjs +53 -0
  33. package/fesm2022/config.page.mjs.map +1 -0
  34. package/fesm2022/ebuilding-base.mjs +11 -0
  35. package/fesm2022/ebuilding-base.mjs.map +1 -0
  36. package/fesm2022/pipe.builtin.mjs +36 -0
  37. package/fesm2022/pipe.builtin.mjs.map +1 -0
  38. package/fesm2022/pipe.category.mjs +43 -0
  39. package/fesm2022/pipe.category.mjs.map +1 -0
  40. package/fesm2022/pipe.datatype.mjs +38 -0
  41. package/fesm2022/pipe.datatype.mjs.map +1 -0
  42. package/fesm2022/pipe.date.format.mjs +46 -0
  43. package/fesm2022/pipe.date.format.mjs.map +1 -0
  44. package/fesm2022/pipe.disabled.mjs +38 -0
  45. package/fesm2022/pipe.disabled.mjs.map +1 -0
  46. package/fesm2022/pipe.email.state.mjs +36 -0
  47. package/fesm2022/pipe.email.state.mjs.map +1 -0
  48. package/fesm2022/pipe.empty.mjs +35 -0
  49. package/fesm2022/pipe.empty.mjs.map +1 -0
  50. package/fesm2022/pipe.eval.mjs +43 -0
  51. package/fesm2022/pipe.eval.mjs.map +1 -0
  52. package/fesm2022/pipe.flow.eval.mjs +36 -0
  53. package/fesm2022/pipe.flow.eval.mjs.map +1 -0
  54. package/fesm2022/pipe.flow.mjs +45 -0
  55. package/fesm2022/pipe.flow.mjs.map +1 -0
  56. package/fesm2022/pipe.flow.node.mjs +28 -0
  57. package/fesm2022/pipe.flow.node.mjs.map +1 -0
  58. package/fesm2022/pipe.flow.operation.mjs +52 -0
  59. package/fesm2022/pipe.flow.operation.mjs.map +1 -0
  60. package/fesm2022/pipe.flow.state.mjs +36 -0
  61. package/fesm2022/pipe.flow.state.mjs.map +1 -0
  62. package/fesm2022/pipe.flow.type.mjs +36 -0
  63. package/fesm2022/pipe.flow.type.mjs.map +1 -0
  64. package/fesm2022/pipe.formType.mjs +35 -0
  65. package/fesm2022/pipe.formType.mjs.map +1 -0
  66. package/fesm2022/pipe.grade.type.mjs +38 -0
  67. package/fesm2022/pipe.grade.type.mjs.map +1 -0
  68. package/fesm2022/pipe.indicator.mjs +43 -0
  69. package/fesm2022/pipe.indicator.mjs.map +1 -0
  70. package/fesm2022/pipe.item.mjs +38 -0
  71. package/fesm2022/pipe.item.mjs.map +1 -0
  72. package/fesm2022/pipe.moment.mjs +37 -0
  73. package/fesm2022/pipe.moment.mjs.map +1 -0
  74. package/fesm2022/pipe.msg.type.mjs +55 -0
  75. package/fesm2022/pipe.msg.type.mjs.map +1 -0
  76. package/fesm2022/pipe.number.mjs +34 -0
  77. package/fesm2022/pipe.number.mjs.map +1 -0
  78. package/fesm2022/pipe.objtype.mjs +37 -0
  79. package/fesm2022/pipe.objtype.mjs.map +1 -0
  80. package/fesm2022/pipe.okr.plan.mjs +46 -0
  81. package/fesm2022/pipe.okr.plan.mjs.map +1 -0
  82. package/fesm2022/pipe.okr.unit.mjs +38 -0
  83. package/fesm2022/pipe.okr.unit.mjs.map +1 -0
  84. package/fesm2022/pipe.operation.mjs +41 -0
  85. package/fesm2022/pipe.operation.mjs.map +1 -0
  86. package/fesm2022/pipe.period.emp.mjs +43 -0
  87. package/fesm2022/pipe.period.emp.mjs.map +1 -0
  88. package/fesm2022/pipe.period.state.mjs +43 -0
  89. package/fesm2022/pipe.period.state.mjs.map +1 -0
  90. package/fesm2022/pipe.plan.state.mjs +46 -0
  91. package/fesm2022/pipe.plan.state.mjs.map +1 -0
  92. package/fesm2022/pipe.range.mjs +25 -0
  93. package/fesm2022/pipe.range.mjs.map +1 -0
  94. package/fesm2022/pipe.removehtml.mjs +26 -0
  95. package/fesm2022/pipe.removehtml.mjs.map +1 -0
  96. package/fesm2022/pipe.result.mjs +56 -0
  97. package/fesm2022/pipe.result.mjs.map +1 -0
  98. package/fesm2022/pipe.safehtml.mjs +34 -0
  99. package/fesm2022/pipe.safehtml.mjs.map +1 -0
  100. package/fesm2022/pipe.state.mjs +55 -0
  101. package/fesm2022/pipe.state.mjs.map +1 -0
  102. package/fesm2022/pipe.table.type.mjs +38 -0
  103. package/fesm2022/pipe.table.type.mjs.map +1 -0
  104. package/fesm2022/pipe.task.state.mjs +43 -0
  105. package/fesm2022/pipe.task.state.mjs.map +1 -0
  106. package/fesm2022/pipe.templatetype.mjs +35 -0
  107. package/fesm2022/pipe.templatetype.mjs.map +1 -0
  108. package/fesm2022/pipe.valid.mjs +36 -0
  109. package/fesm2022/pipe.valid.mjs.map +1 -0
  110. package/fesm2022/pipe.value.method.mjs +46 -0
  111. package/fesm2022/pipe.value.method.mjs.map +1 -0
  112. package/fesm2022/pipe.write.state.mjs +45 -0
  113. package/fesm2022/pipe.write.state.mjs.map +1 -0
  114. package/fesm2022/pipe.yesNo.mjs +52 -0
  115. package/fesm2022/pipe.yesNo.mjs.map +1 -0
  116. package/fesm2022/shared.config.mjs +2190 -0
  117. package/fesm2022/shared.config.mjs.map +1 -0
  118. package/fesm2022/shared.srv.mjs +2853 -0
  119. package/fesm2022/shared.srv.mjs.map +1 -0
  120. package/fesm2022/shared.util.mjs +4676 -0
  121. package/fesm2022/shared.util.mjs.map +1 -0
  122. package/fesm2022/shared.var.mjs +597 -0
  123. package/fesm2022/shared.var.mjs.map +1 -0
  124. package/fesm2022/sharedPipe.mjs +1387 -0
  125. package/fesm2022/sharedPipe.mjs.map +1 -0
  126. package/fesm2022/srv.base-dialog.service.mjs +272 -0
  127. package/fesm2022/srv.base-dialog.service.mjs.map +1 -0
  128. package/fesm2022/srv.base-list.service.mjs +124 -0
  129. package/fesm2022/srv.base-list.service.mjs.map +1 -0
  130. package/fesm2022/srv.base-table.service.mjs +271 -0
  131. package/fesm2022/srv.base-table.service.mjs.map +1 -0
  132. package/fesm2022/srv.base-title.service.mjs +52 -0
  133. package/fesm2022/srv.base-title.service.mjs.map +1 -0
  134. package/fesm2022/srv.base-tree.service.mjs +53 -0
  135. package/fesm2022/srv.base-tree.service.mjs.map +1 -0
  136. package/fesm2022/srv.basePage.mjs +71 -0
  137. package/fesm2022/srv.basePage.mjs.map +1 -0
  138. package/fesm2022/srv.commApi.service.mjs +626 -0
  139. package/fesm2022/srv.commApi.service.mjs.map +1 -0
  140. package/fesm2022/srv.deon.util.mjs +272 -0
  141. package/fesm2022/srv.deon.util.mjs.map +1 -0
  142. package/fesm2022/srv.deon2.util.mjs +190 -0
  143. package/fesm2022/srv.deon2.util.mjs.map +1 -0
  144. package/fesm2022/srv.dialog.token.mjs +10 -0
  145. package/fesm2022/srv.dialog.token.mjs.map +1 -0
  146. package/fesm2022/srv.field-source.service.mjs +454 -0
  147. package/fesm2022/srv.field-source.service.mjs.map +1 -0
  148. package/fesm2022/srv.field.init.mjs +697 -0
  149. package/fesm2022/srv.field.init.mjs.map +1 -0
  150. package/fesm2022/srv.global.event.mjs +50 -0
  151. package/fesm2022/srv.global.event.mjs.map +1 -0
  152. package/fesm2022/srv.layout-detail.service.mjs +60 -0
  153. package/fesm2022/srv.layout-detail.service.mjs.map +1 -0
  154. package/fesm2022/srv.layout.service.mjs +65 -0
  155. package/fesm2022/srv.layout.service.mjs.map +1 -0
  156. package/fesm2022/srv.listService.mjs +319 -0
  157. package/fesm2022/srv.listService.mjs.map +1 -0
  158. package/fesm2022/srv.window.service.mjs +34 -0
  159. package/fesm2022/srv.window.service.mjs.map +1 -0
  160. package/fesm2022/util.base64.mjs +85 -0
  161. package/fesm2022/util.base64.mjs.map +1 -0
  162. package/fesm2022/util.comm.attendance.mjs +207 -0
  163. package/fesm2022/util.comm.attendance.mjs.map +1 -0
  164. package/fesm2022/util.comm.ckeditor.mjs +32 -0
  165. package/fesm2022/util.comm.ckeditor.mjs.map +1 -0
  166. package/fesm2022/util.comm.colors.mjs +21 -0
  167. package/fesm2022/util.comm.colors.mjs.map +1 -0
  168. package/fesm2022/util.comm.eca.mjs +89 -0
  169. package/fesm2022/util.comm.eca.mjs.map +1 -0
  170. package/fesm2022/util.comm.fly.mjs +210 -0
  171. package/fesm2022/util.comm.fly.mjs.map +1 -0
  172. package/fesm2022/util.comm.kpi.mjs +118 -0
  173. package/fesm2022/util.comm.kpi.mjs.map +1 -0
  174. package/fesm2022/util.comm.leave.mjs +271 -0
  175. package/fesm2022/util.comm.leave.mjs.map +1 -0
  176. package/fesm2022/util.comm.menu.mjs +132 -0
  177. package/fesm2022/util.comm.menu.mjs.map +1 -0
  178. package/fesm2022/util.comm.okr.mjs +204 -0
  179. package/fesm2022/util.comm.okr.mjs.map +1 -0
  180. package/fesm2022/util.comm.overtime.mjs +69 -0
  181. package/fesm2022/util.comm.overtime.mjs.map +1 -0
  182. package/fesm2022/util.comm.setting.mjs +211 -0
  183. package/fesm2022/util.comm.setting.mjs.map +1 -0
  184. package/fesm2022/util.comm.shebao.mjs +57 -0
  185. package/fesm2022/util.comm.shebao.mjs.map +1 -0
  186. package/fesm2022/util.comm.workflow.mjs +178 -0
  187. package/fesm2022/util.comm.workflow.mjs.map +1 -0
  188. package/fesm2022/util.common.mjs +637 -0
  189. package/fesm2022/util.common.mjs.map +1 -0
  190. package/fesm2022/util.encryption.mjs +49 -0
  191. package/fesm2022/util.encryption.mjs.map +1 -0
  192. package/fesm2022/util.guid.mjs +57 -0
  193. package/fesm2022/util.guid.mjs.map +1 -0
  194. package/fesm2022/util.guid.number.mjs +68 -0
  195. package/fesm2022/util.guid.number.mjs.map +1 -0
  196. package/fesm2022/util.menus.mjs +33 -0
  197. package/fesm2022/util.menus.mjs.map +1 -0
  198. package/fesm2022/util.operation.mjs +193 -0
  199. package/fesm2022/util.operation.mjs.map +1 -0
  200. package/fesm2022/util.static.mjs +1542 -0
  201. package/fesm2022/util.static.mjs.map +1 -0
  202. package/fesm2022/util.tool.mjs +46 -0
  203. package/fesm2022/util.tool.mjs.map +1 -0
  204. package/fesm2022/util.validation.mjs +67 -0
  205. package/fesm2022/util.validation.mjs.map +1 -0
  206. package/fesm2022/util.workflow.mjs +128 -0
  207. package/fesm2022/util.workflow.mjs.map +1 -0
  208. package/fesm2022/util.yuan.mjs +18 -0
  209. package/fesm2022/util.yuan.mjs.map +1 -0
  210. package/fesm2022/var.comm.constant.mjs +37 -0
  211. package/fesm2022/var.comm.constant.mjs.map +1 -0
  212. package/fesm2022/var.shared.constant.mjs +237 -0
  213. package/fesm2022/var.shared.constant.mjs.map +1 -0
  214. package/fesm2022/var.shared.interface.mjs +51 -0
  215. package/fesm2022/var.shared.interface.mjs.map +1 -0
  216. package/fesm2022/var.shared.variable.mjs +168 -0
  217. package/fesm2022/var.shared.variable.mjs.map +1 -0
  218. package/index.d.ts +6 -0
  219. package/package.json +420 -0
  220. package/shared.config/form/admin/attendance.d.ts +1 -0
  221. package/shared.config/form/admin/personnel.d.ts +1 -0
  222. package/shared.config/form/admin/system.d.ts +1 -0
  223. package/shared.config/form/gram/kpi.d.ts +1 -0
  224. package/shared.config/form/index.d.ts +2 -0
  225. package/shared.config/form/paas/module.d.ts +1 -0
  226. package/shared.config/form/payroll/shebao.d.ts +1 -0
  227. package/shared.config/index.d.ts +1 -0
  228. package/shared.config/list/content/admin/system.code.d.ts +1 -0
  229. package/shared.config/list/content/admin/system.log.d.ts +1 -0
  230. package/shared.config/list/content/admin/system.role.d.ts +1 -0
  231. package/shared.config/list/content/admin/system.source.d.ts +1 -0
  232. package/shared.config/list/content/admin/system.tenant.d.ts +1 -0
  233. package/shared.config/list/content/admin/system.user.d.ts +1 -0
  234. package/shared.config/list/content/fly/admin/device.d.ts +1 -0
  235. package/shared.config/list/content/fly/admin/dock.d.ts +1 -0
  236. package/shared.config/list/content/fly/admin/healthy.d.ts +1 -0
  237. package/shared.config/list/content/fly/admin/system.d.ts +1 -0
  238. package/shared.config/list/content/fly/admin/user.d.ts +1 -0
  239. package/shared.config/list/content/fly/work/ai.d.ts +1 -0
  240. package/shared.config/list/content/fly/work/history.d.ts +1 -0
  241. package/shared.config/list/content/fly/work/order.d.ts +1 -0
  242. package/shared.config/list/content/fly/work/product.d.ts +1 -0
  243. package/shared.config/list/content/fly/work/task.d.ts +1 -0
  244. package/shared.config/list/content/index.d.ts +38 -0
  245. package/shared.config/list/content/paas/card.d.ts +1 -0
  246. package/shared.config/list/content/paas/module.d.ts +1 -0
  247. package/shared.config/list/content/paas/permission.d.ts +1 -0
  248. package/shared.config/list/content/paas/rule.d.ts +1 -0
  249. package/shared.config/list/content/paas/setting.d.ts +1 -0
  250. package/shared.config/list/content/personnel/position.d.ts +1 -0
  251. package/shared.config/list/content/workflow/workflow.d.ts +1 -0
  252. package/shared.config/list/header/admin/system.d.ts +1 -0
  253. package/shared.config/list/header/dialog/default.d.ts +1 -0
  254. package/shared.config/list/header/fly/admin/device.d.ts +1 -0
  255. package/shared.config/list/header/fly/admin/dock.d.ts +1 -0
  256. package/shared.config/list/header/fly/admin/healthy.d.ts +1 -0
  257. package/shared.config/list/header/fly/admin/system.d.ts +1 -0
  258. package/shared.config/list/header/fly/admin/user.d.ts +1 -0
  259. package/shared.config/list/header/fly/work/ai.d.ts +1 -0
  260. package/shared.config/list/header/fly/work/history.d.ts +1 -0
  261. package/shared.config/list/header/fly/work/order.d.ts +1 -0
  262. package/shared.config/list/header/fly/work/product.d.ts +1 -0
  263. package/shared.config/list/header/fly/work/task.d.ts +1 -0
  264. package/shared.config/list/header/index.d.ts +1 -0
  265. package/shared.config/list/header/paas.d.ts +1 -0
  266. package/shared.config/list/header/personnel/position.d.ts +1 -0
  267. package/shared.config/list/header/wk/workflow.d.ts +1 -0
  268. package/shared.config/list/index.d.ts +2 -0
  269. package/shared.config/page/README.md +3 -0
  270. package/shared.config/page/admin/index.d.ts +1 -0
  271. package/shared.config/page/admin/system.source.d.ts +1 -0
  272. package/shared.config/page/index.d.ts +1 -0
  273. package/shared.config/page-dialog/admin/index.d.ts +1 -0
  274. package/shared.config/page-dialog/admin/system.d.ts +1 -0
  275. package/shared.config/page-dialog/index.d.ts +3 -0
  276. package/shared.config/page-dialog/paas/index.d.ts +1 -0
  277. package/shared.config/page-dialog/paas/module.d.ts +1 -0
  278. package/shared.config/page-dialog/payroll/index.d.ts +1 -0
  279. package/shared.config/page-dialog/payroll/main.d.ts +1 -0
  280. package/shared.pipe/builtin/builtin.pipe.d.ts +8 -0
  281. package/shared.pipe/builtin/index.d.ts +1 -0
  282. package/shared.pipe/category/category.pipe.d.ts +8 -0
  283. package/shared.pipe/category/index.d.ts +1 -0
  284. package/shared.pipe/datatype/datatype.pipe.d.ts +8 -0
  285. package/shared.pipe/datatype/index.d.ts +1 -0
  286. package/shared.pipe/date.format/date.pipe.d.ts +8 -0
  287. package/shared.pipe/date.format/index.d.ts +1 -0
  288. package/shared.pipe/disabled/disabled.pipe.d.ts +8 -0
  289. package/shared.pipe/disabled/index.d.ts +1 -0
  290. package/shared.pipe/email.state/email.pipe.d.ts +8 -0
  291. package/shared.pipe/email.state/index.d.ts +1 -0
  292. package/shared.pipe/empty/empty.pipe.d.ts +8 -0
  293. package/shared.pipe/empty/index.d.ts +1 -0
  294. package/shared.pipe/eval/eval.pipe.d.ts +8 -0
  295. package/shared.pipe/eval/index.d.ts +1 -0
  296. package/shared.pipe/flow/flow.pipe.d.ts +8 -0
  297. package/shared.pipe/flow/index.d.ts +1 -0
  298. package/shared.pipe/flow.eval/flow.pipe.d.ts +8 -0
  299. package/shared.pipe/flow.eval/index.d.ts +1 -0
  300. package/shared.pipe/flow.node/flow.pipe.d.ts +8 -0
  301. package/shared.pipe/flow.node/index.d.ts +1 -0
  302. package/shared.pipe/flow.operation/flow.pipe.d.ts +8 -0
  303. package/shared.pipe/flow.operation/index.d.ts +1 -0
  304. package/shared.pipe/flow.state/flow.pipe.d.ts +8 -0
  305. package/shared.pipe/flow.state/index.d.ts +1 -0
  306. package/shared.pipe/flow.type/flow.pipe.d.ts +8 -0
  307. package/shared.pipe/flow.type/index.d.ts +1 -0
  308. package/shared.pipe/formType/form.pipe.d.ts +8 -0
  309. package/shared.pipe/formType/index.d.ts +1 -0
  310. package/shared.pipe/grade.type/grade.pipe.d.ts +8 -0
  311. package/shared.pipe/grade.type/index.d.ts +1 -0
  312. package/shared.pipe/index.d.ts +41 -0
  313. package/shared.pipe/index.module.d.ts +47 -0
  314. package/shared.pipe/indicator/index.d.ts +1 -0
  315. package/shared.pipe/indicator/indicator.pipe.d.ts +8 -0
  316. package/shared.pipe/item/index.d.ts +1 -0
  317. package/shared.pipe/item/item.pipe.d.ts +8 -0
  318. package/shared.pipe/moment/index.d.ts +1 -0
  319. package/shared.pipe/moment/moment.pipe.d.ts +16 -0
  320. package/shared.pipe/msg.type/index.d.ts +1 -0
  321. package/shared.pipe/msg.type/msg.pipe.d.ts +8 -0
  322. package/shared.pipe/number/index.d.ts +1 -0
  323. package/shared.pipe/number/number.pipe.d.ts +8 -0
  324. package/shared.pipe/objtype/index.d.ts +1 -0
  325. package/shared.pipe/objtype/obj.pipe.d.ts +8 -0
  326. package/shared.pipe/okr.plan/index.d.ts +1 -0
  327. package/shared.pipe/okr.plan/okr.pipe.d.ts +8 -0
  328. package/shared.pipe/okr.unit/index.d.ts +1 -0
  329. package/shared.pipe/okr.unit/okr.pipe.d.ts +8 -0
  330. package/shared.pipe/operation/index.d.ts +1 -0
  331. package/shared.pipe/operation/operation.pipe.d.ts +8 -0
  332. package/shared.pipe/period.emp/index.d.ts +1 -0
  333. package/shared.pipe/period.emp/period.pipe.d.ts +8 -0
  334. package/shared.pipe/period.state/index.d.ts +1 -0
  335. package/shared.pipe/period.state/period.pipe.d.ts +8 -0
  336. package/shared.pipe/plan.state/index.d.ts +1 -0
  337. package/shared.pipe/plan.state/plan.pipe.d.ts +8 -0
  338. package/shared.pipe/range/index.d.ts +1 -0
  339. package/shared.pipe/range/range.pipe.d.ts +8 -0
  340. package/shared.pipe/removehtml/index.d.ts +1 -0
  341. package/shared.pipe/removehtml/removehtml.pipe.d.ts +8 -0
  342. package/shared.pipe/result/index.d.ts +1 -0
  343. package/shared.pipe/result/result.pipe.d.ts +8 -0
  344. package/shared.pipe/safehtml/index.d.ts +1 -0
  345. package/shared.pipe/safehtml/safehtml.pipe.d.ts +10 -0
  346. package/shared.pipe/state/index.d.ts +1 -0
  347. package/shared.pipe/state/state.pipe.d.ts +8 -0
  348. package/shared.pipe/table.type/index.d.ts +1 -0
  349. package/shared.pipe/table.type/table.pipe.d.ts +8 -0
  350. package/shared.pipe/task.state/index.d.ts +1 -0
  351. package/shared.pipe/task.state/task.pipe.d.ts +8 -0
  352. package/shared.pipe/templatetype/index.d.ts +1 -0
  353. package/shared.pipe/templatetype/template.pipe.d.ts +8 -0
  354. package/shared.pipe/valid/index.d.ts +1 -0
  355. package/shared.pipe/valid/valid.pipe.d.ts +8 -0
  356. package/shared.pipe/value.method/index.d.ts +1 -0
  357. package/shared.pipe/value.method/value.pipe.d.ts +8 -0
  358. package/shared.pipe/write.state/index.d.ts +1 -0
  359. package/shared.pipe/write.state/write.pipe.d.ts +9 -0
  360. package/shared.pipe/yesNo/index.d.ts +1 -0
  361. package/shared.pipe/yesNo/yesNo.pipe.d.ts +8 -0
  362. package/shared.srv/base-dialog.service/index.d.ts +39 -0
  363. package/shared.srv/base-list.service/index.d.ts +49 -0
  364. package/shared.srv/base-table.service/index.d.ts +77 -0
  365. package/shared.srv/base-title.service/index.d.ts +16 -0
  366. package/shared.srv/base-tree.service/index.d.ts +30 -0
  367. package/shared.srv/basePage/index.d.ts +33 -0
  368. package/shared.srv/commApi.service/index.d.ts +124 -0
  369. package/shared.srv/deon.util/index.d.ts +25 -0
  370. package/shared.srv/deon2.util/index.d.ts +14 -0
  371. package/shared.srv/dialog.token/index.d.ts +5 -0
  372. package/shared.srv/field-source.service/index.d.ts +67 -0
  373. package/shared.srv/field.init/index.d.ts +36 -0
  374. package/shared.srv/global.event/index.d.ts +13 -0
  375. package/shared.srv/index.d.ts +16 -0
  376. package/shared.srv/layout-detail.service/index.d.ts +23 -0
  377. package/shared.srv/layout.service/index.d.ts +28 -0
  378. package/shared.srv/listService/index.d.ts +38 -0
  379. package/shared.srv/window.service/index.d.ts +8 -0
  380. package/shared.util/base64/index.d.ts +6 -0
  381. package/shared.util/comm.attendance/index.d.ts +74 -0
  382. package/shared.util/comm.ckeditor/index.d.ts +9 -0
  383. package/shared.util/comm.colors/index.d.ts +1 -0
  384. package/shared.util/comm.eca/index.d.ts +16 -0
  385. package/shared.util/comm.fly/index.d.ts +60 -0
  386. package/shared.util/comm.kpi/index.d.ts +21 -0
  387. package/shared.util/comm.leave/index.d.ts +79 -0
  388. package/shared.util/comm.menu/index.d.ts +4 -0
  389. package/shared.util/comm.okr/index.d.ts +61 -0
  390. package/shared.util/comm.overtime/index.d.ts +25 -0
  391. package/shared.util/comm.setting/index.d.ts +54 -0
  392. package/shared.util/comm.shebao/index.d.ts +16 -0
  393. package/shared.util/comm.workflow/index.d.ts +24 -0
  394. package/shared.util/common/index.d.ts +60 -0
  395. package/shared.util/encryption/index.d.ts +12 -0
  396. package/shared.util/guid/index.d.ts +16 -0
  397. package/shared.util/guid.number/index.d.ts +16 -0
  398. package/shared.util/index.d.ts +25 -0
  399. package/shared.util/menus/index.d.ts +1 -0
  400. package/shared.util/operation/index.d.ts +13 -0
  401. package/shared.util/static/index.d.ts +284 -0
  402. package/shared.util/tool/index.d.ts +6 -0
  403. package/shared.util/validation/index.d.ts +40 -0
  404. package/shared.util/workflow/index.d.ts +12 -0
  405. package/shared.util/yuan/index.d.ts +6 -0
  406. package/shared.var/comm.constant/index.d.ts +24 -0
  407. package/shared.var/index.d.ts +4 -0
  408. package/shared.var/shared.constant/index.d.ts +151 -0
  409. package/shared.var/shared.interface/index.d.ts +58 -0
  410. package/shared.var/shared.variable/index.d.ts +116 -0
  411. package/style/variable.less +238 -0
@@ -0,0 +1,2853 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, EventEmitter, Output, Input, Directive, ElementRef, HostListener, ViewChild, InjectionToken, PLATFORM_ID, Inject } from '@angular/core';
3
+ import * as i1 from 'ng-zorro-antd/modal';
4
+ import * as i2 from '@ebuilding/base/components/drawer';
5
+ import { getOperationType } from '@ebuilding/base/shared.util/operation';
6
+ import { WorkFlowState } from '@ebuilding/base/shared.util/workflow';
7
+ import * as i1$1 from '@delon/theme';
8
+ import * as i3 from 'ng-zorro-antd/message';
9
+ import * as i2$1 from '@angular/router';
10
+ import * as i3$1 from '@ebuilding/base/shared.srv/commApi.service';
11
+ import { distinctUntilChanged, tap } from 'rxjs/operators';
12
+ import _ from 'lodash';
13
+ import { Guid } from '@ebuilding/base/shared.util/guid';
14
+ import moment from 'moment';
15
+ import { Subject } from 'rxjs';
16
+ import { isPlatformBrowser } from '@angular/common';
17
+ import { IndicatorType, EvalType } from '@ebuilding/base/shared.util/comm.kpi';
18
+
19
+ class GramBaseDialogService {
20
+ modalService;
21
+ drawerService;
22
+ drawerRefs = new Set();
23
+ constructor(modalService, drawerService) {
24
+ this.modalService = modalService;
25
+ this.drawerService = drawerService;
26
+ }
27
+ switchSize(size) {
28
+ const obj = {
29
+ width: 700,
30
+ height: 500,
31
+ };
32
+ switch (size) {
33
+ case 'small':
34
+ obj.width = 530;
35
+ obj.height = 400;
36
+ break;
37
+ case 'small2':
38
+ obj.width = 200;
39
+ obj.height = 300;
40
+ break;
41
+ case 'medium':
42
+ obj.width = 700;
43
+ obj.height = 500;
44
+ break;
45
+ case 'large':
46
+ obj.width = 1100;
47
+ obj.height = 700;
48
+ break;
49
+ case 'upload':
50
+ obj.width = 700;
51
+ obj.height = 400;
52
+ break;
53
+ default:
54
+ obj.width = 700;
55
+ obj.height = 500;
56
+ break;
57
+ }
58
+ return obj;
59
+ }
60
+ CreateModelDialog(modalOptions, params, callback) {
61
+ let width = this.switchSize(modalOptions.size).width;
62
+ let height = this.switchSize(modalOptions.size).height;
63
+ let style = null;
64
+ if (modalOptions.size && modalOptions.size === 'custom') {
65
+ if (modalOptions.width) {
66
+ width = modalOptions.width;
67
+ }
68
+ if (modalOptions.height) {
69
+ height = modalOptions.height;
70
+ }
71
+ if (modalOptions.style) {
72
+ style = modalOptions.style;
73
+ }
74
+ }
75
+ if (modalOptions.nzContent == undefined || modalOptions.nzContent == null) {
76
+ }
77
+ let title = '';
78
+ switch (params.type) {
79
+ case 'add':
80
+ title = '新增 - ';
81
+ break;
82
+ case 'edit':
83
+ case 'edit_state':
84
+ title = '编辑 - ';
85
+ break;
86
+ case 'view':
87
+ case 'primary_key':
88
+ title = '查看 - ';
89
+ break;
90
+ default:
91
+ break;
92
+ }
93
+ if (modalOptions.nzTitle) {
94
+ title = title + modalOptions.nzTitle;
95
+ }
96
+ const modal = this.modalService.create({
97
+ nzStyle: style,
98
+ nzTitle: title,
99
+ nzWidth: width + 'px',
100
+ nzClosable: modalOptions.nzClosable != undefined ? modalOptions.nzClosable : true,
101
+ nzMaskClosable: false,
102
+ nzWrapClassName: modalOptions.vertical ? 'vertical-center-modal' : '',
103
+ nzBodyStyle: {
104
+ padding: '0',
105
+ height: !modalOptions.hideBtn ? height - 107 + 'px' : height - 54 + 'px',
106
+ },
107
+ nzContent: modalOptions.nzContent,
108
+ nzFooter: params.type !== 'view' && params.type !== 'upload'
109
+ ? [
110
+ {
111
+ show: true,
112
+ label: '取消',
113
+ type: 'default',
114
+ onClick: (e) => {
115
+ modal.destroy();
116
+ },
117
+ },
118
+ {
119
+ show: true,
120
+ label: modalOptions.primaryLabel ? modalOptions.primaryLabel : '确定',
121
+ type: 'primary',
122
+ onClick: (e) => callback('save', e, modal),
123
+ },
124
+ // {
125
+ // show: params.type === 'add',
126
+ // label: modalOptions.primaryLabel ? modalOptions.primaryLabel : '确定继续录入',
127
+ // type: 'primary',
128
+ // onClick: (e: any) => callback('save-next', e, modal),
129
+ // },
130
+ ]
131
+ : null,
132
+ nzOnOk: (e) => { },
133
+ nzOnCancel: (e) => { },
134
+ //nzComponentParams: params,
135
+ });
136
+ if (modal.getContentComponent()) {
137
+ Object.assign(modal.getContentComponent(), params);
138
+ }
139
+ modal.afterClose.subscribe((result) => {
140
+ if (result) {
141
+ callback(result);
142
+ }
143
+ });
144
+ }
145
+ CreateModelDialogSelect(modalOptions, params, callback) {
146
+ const width = this.switchSize(modalOptions.size).width;
147
+ const height = this.switchSize(modalOptions.size).height;
148
+ const modal = this.modalService.create({
149
+ nzTitle: modalOptions.nzTitle ? modalOptions.nzTitle : '提示',
150
+ nzWidth: width + 'px',
151
+ nzClosable: true,
152
+ nzMaskClosable: false,
153
+ nzWrapClassName: modalOptions.vertical ? 'vertical-center-modal' : '',
154
+ nzBodyStyle: {
155
+ padding: '0',
156
+ height: !modalOptions.hideBtn ? height - 107 + 'px' : height - 54 + 'px',
157
+ },
158
+ nzContent: modalOptions.nzContent,
159
+ nzFooter: [
160
+ {
161
+ show: true,
162
+ label: '取消',
163
+ type: 'default',
164
+ onClick: (e) => {
165
+ modal.destroy();
166
+ },
167
+ },
168
+ {
169
+ show: true,
170
+ label: modalOptions.primaryLabel ? modalOptions.primaryLabel : '确定',
171
+ type: 'primary',
172
+ loading: false,
173
+ onClick(e) {
174
+ this.loading = true;
175
+ callback('save', e, modal);
176
+ },
177
+ },
178
+ ],
179
+ nzOnOk: (e) => { },
180
+ nzOnCancel: (e) => { },
181
+ //nzComponentParams: params,
182
+ });
183
+ if (modal.getContentComponent()) {
184
+ Object.assign(modal.getContentComponent(), params);
185
+ }
186
+ modal.afterClose.subscribe((result) => {
187
+ if (result) {
188
+ callback(result);
189
+ }
190
+ });
191
+ }
192
+ CreateDrawerDialog(modalOptions, params, callback) {
193
+ let width = this.switchSize(modalOptions.size).width;
194
+ let height = window.innerHeight;
195
+ if (modalOptions.size === 'full') {
196
+ width = window.innerWidth;
197
+ }
198
+ else {
199
+ if (modalOptions.size && modalOptions.size === 'custom') {
200
+ if (modalOptions.width) {
201
+ width = modalOptions.width;
202
+ }
203
+ else {
204
+ width = 800;
205
+ modalOptions.innerWidth = false;
206
+ }
207
+ }
208
+ else {
209
+ if (modalOptions.innerWidth != false) {
210
+ width = window.innerWidth - 300;
211
+ }
212
+ }
213
+ }
214
+ let title = '';
215
+ if (params?.config && params?.config.type) {
216
+ switch (params?.config.type) {
217
+ case 'ADD':
218
+ title = '新增';
219
+ break;
220
+ case 'EDIT':
221
+ title = '编辑';
222
+ break;
223
+ case 'VIEW':
224
+ title = '查看';
225
+ break;
226
+ default:
227
+ break;
228
+ }
229
+ }
230
+ if (modalOptions.nzTitle) {
231
+ if (title) {
232
+ title = `${title} - ${modalOptions.nzTitle}`;
233
+ }
234
+ else {
235
+ title = `${modalOptions.nzTitle}`;
236
+ }
237
+ }
238
+ const drawerRef = this.drawerService.create({
239
+ nzTitle: title,
240
+ nzWidth: width + 'px',
241
+ nzHeight: height + 'px',
242
+ nzClosable: modalOptions?.nzClosable == false ? false : true,
243
+ nzMask: modalOptions?.nzMask == false ? false : true,
244
+ nzMaskClosable: false,
245
+ nzKeyboard: false,
246
+ nzWrapClassName: modalOptions.vertical ? 'vertical-center-modal' : '',
247
+ nzBodyStyle: {
248
+ padding: '0',
249
+ },
250
+ nzPlacement: modalOptions?.placement ? modalOptions?.placement : 'right',
251
+ nzContent: modalOptions.nzContent,
252
+ nzContentParams: {
253
+ ...params,
254
+ },
255
+ });
256
+ // 记录 DrawerRef
257
+ this.drawerRefs.add(drawerRef);
258
+ drawerRef.afterClose.subscribe((result) => {
259
+ this.drawerRefs.delete(drawerRef); // 移除已关闭的 Drawer
260
+ if (result?.destroy)
261
+ result.destroy();
262
+ callback(result);
263
+ });
264
+ }
265
+ // **关闭所有 Drawer**
266
+ closeAllDrawers() {
267
+ this.drawerRefs.forEach((drawer) => drawer.close());
268
+ this.drawerRefs.clear();
269
+ }
270
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseDialogService, deps: [{ token: i1.NzModalService }, { token: i2.NzDrawerService }], target: i0.ɵɵFactoryTarget.Injectable });
271
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseDialogService, providedIn: 'root' });
272
+ }
273
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseDialogService, decorators: [{
274
+ type: Injectable,
275
+ args: [{
276
+ providedIn: 'root',
277
+ }]
278
+ }], ctorParameters: () => [{ type: i1.NzModalService }, { type: i2.NzDrawerService }] });
279
+
280
+ class GramBaseListService {
281
+ pageService;
282
+ constructor(pageService) {
283
+ this.pageService = pageService;
284
+ }
285
+ /*
286
+ 列表ID
287
+ */
288
+ id = '';
289
+ /*
290
+ 列表加载中
291
+ */
292
+ loading = false;
293
+ selectData = [];
294
+ /*
295
+ 列表头集合
296
+ */
297
+ listHeader = [];
298
+ /*
299
+ 列表内集合
300
+ */
301
+ listBody = [];
302
+ /*
303
+ 列表总数
304
+ */
305
+ listTotal = 0;
306
+ operationClick = new EventEmitter();
307
+ rowChange = new EventEmitter();
308
+ selectChange = new EventEmitter();
309
+ queryChange = new EventEmitter();
310
+ buttonClick = new EventEmitter();
311
+ componentClick = new EventEmitter();
312
+ sortChange = new EventEmitter();
313
+ reloadChange = new EventEmitter();
314
+ /**
315
+ * 行排序事件
316
+ * @param e
317
+ */
318
+ rowDataChange(e) {
319
+ this.rowChange.emit(e);
320
+ }
321
+ /**
322
+ * 选中事件
323
+ * @param e
324
+ */
325
+ selectDataChange(e) {
326
+ this.selectChange.emit(e);
327
+ }
328
+ /**
329
+ * 分页、模糊搜索事件
330
+ * @param e
331
+ */
332
+ queryParamsChange(e) {
333
+ this.queryChange.emit(e);
334
+ }
335
+ sortOrderChange(e) {
336
+ this.sortChange.emit(e);
337
+ }
338
+ /**
339
+ * 列操作事件
340
+ * @param e
341
+ */
342
+ buttonEvent(type, e) {
343
+ this.operationClick.emit({
344
+ rowCode: e[this.pageService.pageConfig?.primary?.key],
345
+ rowData: e,
346
+ columnKey: type,
347
+ });
348
+ }
349
+ /**
350
+ * 组件行事件
351
+ * @param e
352
+ */
353
+ componentEvent(e) {
354
+ this.componentClick.emit(e);
355
+ }
356
+ operationType(button) {
357
+ return getOperationType(button, this.pageService.pageConfig.pageId);
358
+ }
359
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseListService, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
360
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: GramBaseListService, isStandalone: true, inputs: { id: "id", loading: "loading", selectData: "selectData", listHeader: "listHeader", listBody: "listBody", listTotal: "listTotal" }, outputs: { operationClick: "operationClick", rowChange: "rowChange", selectChange: "selectChange", queryChange: "queryChange", buttonClick: "buttonClick", componentClick: "componentClick", sortChange: "sortChange", reloadChange: "reloadChange" }, ngImport: i0 });
361
+ }
362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseListService, decorators: [{
363
+ type: Directive
364
+ }], ctorParameters: () => [{ type: undefined }], propDecorators: { id: [{
365
+ type: Input
366
+ }], loading: [{
367
+ type: Input
368
+ }], selectData: [{
369
+ type: Input
370
+ }], listHeader: [{
371
+ type: Input
372
+ }], listBody: [{
373
+ type: Input
374
+ }], listTotal: [{
375
+ type: Input
376
+ }], operationClick: [{
377
+ type: Output
378
+ }], rowChange: [{
379
+ type: Output
380
+ }], selectChange: [{
381
+ type: Output
382
+ }], queryChange: [{
383
+ type: Output
384
+ }], buttonClick: [{
385
+ type: Output
386
+ }], componentClick: [{
387
+ type: Output
388
+ }], sortChange: [{
389
+ type: Output
390
+ }], reloadChange: [{
391
+ type: Output
392
+ }] } });
393
+
394
+ class GramBaseTableService {
395
+ http;
396
+ elementRef;
397
+ modal;
398
+ msg;
399
+ /**
400
+ * 加载
401
+ */
402
+ loading = true;
403
+ dataId = null;
404
+ dataInfo = null;
405
+ type = 'ALL';
406
+ keyWord = '';
407
+ pageIndex = 1;
408
+ pageSize = 20;
409
+ listTotal = 0;
410
+ listBody = [];
411
+ listHeader = [];
412
+ orderData = [];
413
+ parameter = null;
414
+ listUrl = null;
415
+ listWidth = [];
416
+ tableWidth = null;
417
+ tdAutoWidth = 120;
418
+ heightMinus = 0;
419
+ WorkFlowState = WorkFlowState();
420
+ sortDirections = ['ascend', 'descend'];
421
+ basicTable;
422
+ constructor(http, elementRef, modal, msg) {
423
+ this.http = http;
424
+ this.elementRef = elementRef;
425
+ this.modal = modal;
426
+ this.msg = msg;
427
+ }
428
+ /**
429
+ * 模糊搜索
430
+ */
431
+ pageQueryClick() {
432
+ this.getPageDataList();
433
+ }
434
+ typeChange(e) {
435
+ this.getPageDataList();
436
+ }
437
+ sortOrderClick(e, type) {
438
+ this.orderData = [];
439
+ switch (e) {
440
+ case 'ascend':
441
+ this.orderData = [{ column: type, asc: true }];
442
+ break;
443
+ case 'descend':
444
+ this.orderData = [{ column: type, asc: false }];
445
+ break;
446
+ }
447
+ this.getPageDataList();
448
+ }
449
+ /**
450
+ * 列表 - 翻页事件
451
+ * @param e
452
+ */
453
+ listPageIndexChange(e) {
454
+ if (e > 0) {
455
+ this.pageIndex = e;
456
+ }
457
+ if (this.pageIndex === undefined) {
458
+ this.pageIndex = 1;
459
+ }
460
+ this.getPageDataList();
461
+ }
462
+ /**
463
+ * 列表 - 页条数发生变化事件
464
+ * @param e
465
+ */
466
+ listPageSizeChange(e) {
467
+ if (e > 0) {
468
+ this.pageSize = e;
469
+ }
470
+ this.getPageDataList();
471
+ }
472
+ /**
473
+ * 列表 - 排序
474
+ * @param e
475
+ */
476
+ listSortChange(e) {
477
+ this.orderData = [];
478
+ if (e) {
479
+ if (e.sortOrder == 'ascend') {
480
+ this.orderData = [{ column: e.field, asc: true }];
481
+ }
482
+ else if (e.sortOrder == 'descend') {
483
+ this.orderData = [{ column: e.field, asc: false }];
484
+ }
485
+ }
486
+ this.getPageDataList();
487
+ }
488
+ /**
489
+ * 查询参数
490
+ * @returns
491
+ */
492
+ getQueryParameter() {
493
+ let postParameter = {
494
+ pageIndex: this.pageIndex,
495
+ pageSize: this.pageSize,
496
+ orders: this.orderData,
497
+ parameter: {
498
+ keyWord: null,
499
+ type: null,
500
+ },
501
+ };
502
+ if (this.parameter) {
503
+ postParameter.parameter = Object.assign(postParameter.parameter, this.parameter);
504
+ }
505
+ if (this.type) {
506
+ postParameter.parameter.type = this.type;
507
+ }
508
+ /**
509
+ * 关键字
510
+ */
511
+ postParameter.parameter.keyWord = this.keyWord;
512
+ return postParameter;
513
+ }
514
+ /**
515
+ * 查询数据
516
+ * @param caller
517
+ * @param callback
518
+ */
519
+ getPageDataList(caller = null, callback = null) {
520
+ /**
521
+ * 查询参数
522
+ */
523
+ let postParameter = this.getQueryParameter();
524
+ /**
525
+ * 进行查询
526
+ */
527
+ this.loading = true;
528
+ this.getPageDataBefore();
529
+ this.http.post(`${this.listUrl}`, postParameter).subscribe((res) => {
530
+ if (res && res.success && res.result) {
531
+ this.listTotal = res?.result?.total;
532
+ this.listBody = res?.result?.list;
533
+ }
534
+ this.resizeTable();
535
+ this.getPageDataAfter();
536
+ this.loading = false;
537
+ if (callback != undefined && callback != null && callback != '') {
538
+ callback.call(caller);
539
+ }
540
+ }, (res) => {
541
+ this.loading = false;
542
+ this.getPageDataAfter();
543
+ if (callback != undefined && callback != null && callback != '') {
544
+ callback.call(caller);
545
+ }
546
+ });
547
+ }
548
+ getPageDataBefore() { }
549
+ getPageDataAfter() { }
550
+ getWorkflowStatus(type) {
551
+ let result = null;
552
+ this.WorkFlowState.forEach((item) => {
553
+ if (item.value == type.toUpperCase()) {
554
+ result = item;
555
+ }
556
+ });
557
+ return result;
558
+ }
559
+ deonTableContentHG = null;
560
+ resize() {
561
+ this.resizeTable();
562
+ }
563
+ resizeTable() {
564
+ setTimeout(() => {
565
+ this.calcAutoWidth();
566
+ this.deonTableContentHG = '50px';
567
+ /**
568
+ * 页面高度
569
+ */
570
+ let pageTable = 200;
571
+ if (this.elementRef.nativeElement.querySelector('.page-table')) {
572
+ pageTable = this.elementRef.nativeElement.querySelector('.page-table').clientHeight;
573
+ }
574
+ /**
575
+ * header 高度
576
+ */
577
+ let headerHeight = 0;
578
+ if (this.elementRef.nativeElement.querySelector('.page-info-header')) {
579
+ headerHeight = this.elementRef.nativeElement.querySelector('.page-info-header').clientHeight;
580
+ headerHeight = headerHeight;
581
+ }
582
+ /**
583
+ * footer 高度
584
+ */
585
+ let footerHeight = 0;
586
+ if (this.elementRef.nativeElement.querySelector('.page-info-footer')) {
587
+ footerHeight = this.elementRef.nativeElement.querySelector('.page-info-footer').clientHeight;
588
+ }
589
+ /**
590
+ * table header 高度
591
+ */
592
+ let tableHeight = 0;
593
+ if (this.elementRef.nativeElement.querySelector('.ant-table-thead')) {
594
+ tableHeight = this.elementRef.nativeElement.querySelector('.ant-table-thead').clientHeight;
595
+ }
596
+ if (this.heightMinus) {
597
+ pageTable = pageTable - this.heightMinus;
598
+ }
599
+ this.deonTableContentHG = {
600
+ y: pageTable - headerHeight - tableHeight - footerHeight + 'px',
601
+ };
602
+ }, 0);
603
+ setTimeout(() => {
604
+ this.checkTableScroll();
605
+ }, 50);
606
+ }
607
+ calcAutoWidth() {
608
+ if (this.elementRef.nativeElement.querySelector('.page-table')) {
609
+ let contentWidth = this.elementRef.nativeElement.querySelector('.page-table').clientWidth;
610
+ if (this.tableWidth && this.tableWidth > 200) {
611
+ if (contentWidth < this.tableWidth) {
612
+ this.tdAutoWidth = 120;
613
+ }
614
+ else {
615
+ if (contentWidth - this.tableWidth < 120) {
616
+ this.tdAutoWidth = 120;
617
+ }
618
+ else {
619
+ this.tdAutoWidth = contentWidth - this.tableWidth;
620
+ }
621
+ }
622
+ }
623
+ }
624
+ }
625
+ checkTableScroll() {
626
+ if (this.basicTable) {
627
+ const tableHeader = this.basicTable.nativeElement.querySelector('.ant-table-header');
628
+ const tableBody = this.basicTable.nativeElement.querySelector('.ant-table-body');
629
+ if (tableHeader && tableBody && tableBody.scrollWidth > tableBody.clientWidth && tableBody.scrollHeight > tableBody.clientHeight) {
630
+ tableHeader.classList.add('eb-header-scroll');
631
+ }
632
+ else {
633
+ tableHeader.classList.remove('eb-header-scroll');
634
+ }
635
+ }
636
+ else {
637
+ }
638
+ }
639
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseTableService, deps: [{ token: i1$1._HttpClient }, { token: i0.ElementRef }, { token: i1.NzModalService }, { token: i3.NzMessageService }], target: i0.ɵɵFactoryTarget.Directive });
640
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: GramBaseTableService, isStandalone: true, host: { listeners: { "window:resize": "resize($event)" } }, viewQueries: [{ propertyName: "basicTable", first: true, predicate: ["basicTable"], descendants: true, read: ElementRef }], ngImport: i0 });
641
+ }
642
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseTableService, decorators: [{
643
+ type: Directive
644
+ }], ctorParameters: () => [{ type: i1$1._HttpClient }, { type: i0.ElementRef }, { type: i1.NzModalService }, { type: i3.NzMessageService }], propDecorators: { basicTable: [{
645
+ type: ViewChild,
646
+ args: ['basicTable', { read: ElementRef }]
647
+ }], resize: [{
648
+ type: HostListener,
649
+ args: ['window:resize', ['$event']]
650
+ }] } });
651
+
652
+ class GramBaseTitleService {
653
+ router;
654
+ http;
655
+ /*
656
+ 页面加载状态
657
+ */
658
+ loading = false;
659
+ objectInfo;
660
+ formName = '';
661
+ formCode = '';
662
+ showName = '';
663
+ constructor(router, http) {
664
+ this.router = router;
665
+ this.http = http;
666
+ }
667
+ /*
668
+ 获取树形数据集合
669
+ */
670
+ getObjectInfoByKey(para, showKey) {
671
+ this.loading = true;
672
+ let params = {};
673
+ params.formType = 'view';
674
+ params = Object.assign(params, para);
675
+ if (this.formCode && this.formCode) {
676
+ params.formKey = this.formCode;
677
+ }
678
+ if (this.formName == undefined || this.formName == null || this.formName == '') {
679
+ this.formName = 'SystemDefault';
680
+ }
681
+ this.http.post(`/get${this.formName}Model`, params).subscribe((res) => {
682
+ this.objectInfo = res;
683
+ this.showName = this.objectInfo[showKey];
684
+ });
685
+ }
686
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseTitleService, deps: [{ token: i2$1.Router }, { token: i1$1._HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
687
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseTitleService });
688
+ }
689
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramBaseTitleService, decorators: [{
690
+ type: Injectable
691
+ }], ctorParameters: () => [{ type: i2$1.Router }, { type: i1$1._HttpClient }] });
692
+
693
+ // @Injectable()
694
+ class GramBaseTreeService {
695
+ http;
696
+ /*
697
+ 页面加载状态
698
+ */
699
+ loading = false;
700
+ showCheckbox = false;
701
+ queryParams = {};
702
+ listBody = [];
703
+ pageConfig = {};
704
+ constructor(http) {
705
+ this.http = http;
706
+ }
707
+ getPageData() {
708
+ this.getPageDataList();
709
+ }
710
+ rowChange(e) { }
711
+ selectChange(e) { }
712
+ operationClick(e) { }
713
+ buttonClick(e) { }
714
+ /*
715
+ 获取树形数据集合
716
+ */
717
+ getPageDataList(caller = null, callback = null) {
718
+ this.loading = true;
719
+ let params = {
720
+ listKey: this.pageConfig?.tree?.code,
721
+ };
722
+ if (this.queryParams) {
723
+ params = Object.assign(params, this.queryParams);
724
+ }
725
+ if (params && params.listKey) {
726
+ this.http.post(`/${this.pageConfig.listAPI ? this.pageConfig.listAPI : 'getSystemDefaultTree'}`, params).subscribe((res) => {
727
+ this.listBody = res;
728
+ this.loading = false;
729
+ if (callback != undefined && callback != null && callback != '') {
730
+ callback.call(caller);
731
+ }
732
+ });
733
+ }
734
+ else {
735
+ this.loading = false;
736
+ }
737
+ }
738
+ }
739
+
740
+ class BasePageService {
741
+ http;
742
+ activatedRoute;
743
+ commAPISrv;
744
+ moduleCode;
745
+ /**
746
+ * 加载
747
+ */
748
+ loading = true;
749
+ /**
750
+ * 布局ID
751
+ */
752
+ layoutId = null;
753
+ /**
754
+ * 布局对象
755
+ */
756
+ layoutData = null;
757
+ constructor(http, activatedRoute, commAPISrv, moduleCode) {
758
+ this.http = http;
759
+ this.activatedRoute = activatedRoute;
760
+ this.commAPISrv = commAPISrv;
761
+ this.moduleCode = moduleCode;
762
+ this.activatedRoute.params.subscribe((item) => {
763
+ if (item && item?.id) {
764
+ this.layoutId = item.id;
765
+ this.getPageData();
766
+ }
767
+ });
768
+ }
769
+ /**
770
+ * 加载数据
771
+ */
772
+ getPageData() {
773
+ if (this.layoutId) {
774
+ this.loading = true;
775
+ let address = this.commAPISrv.getLayoutAddress(this.moduleCode, this.layoutId);
776
+ this.http.post(address).subscribe((res) => {
777
+ if (res.success) {
778
+ if (res.result) {
779
+ this.layoutData = res.result;
780
+ }
781
+ }
782
+ this.loadDataAfter();
783
+ });
784
+ }
785
+ }
786
+ /**
787
+ * 页面加载数据结束
788
+ */
789
+ loadDataAfter() {
790
+ this.loading = false;
791
+ }
792
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BasePageService, deps: [{ token: i1$1._HttpClient }, { token: i2$1.ActivatedRoute }, { token: i3$1.CommAPIService }, { token: String }], target: i0.ɵɵFactoryTarget.Directive });
793
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: BasePageService, isStandalone: true, ngImport: i0 });
794
+ }
795
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: BasePageService, decorators: [{
796
+ type: Directive
797
+ }], ctorParameters: () => [{ type: i1$1._HttpClient }, { type: i2$1.ActivatedRoute }, { type: i3$1.CommAPIService }, { type: String }] });
798
+
799
+ class DeonFormUtilService {
800
+ getFieldKeysData(json) {
801
+ let result = {};
802
+ if (json) {
803
+ let fieldConfigs = JSON.parse(json);
804
+ if (fieldConfigs && Array.isArray(fieldConfigs)) {
805
+ this.getFieldKeysDataChild(result, fieldConfigs);
806
+ }
807
+ }
808
+ return result;
809
+ }
810
+ getFieldKeysDataChild(result, arr) {
811
+ if (arr && Array.isArray(arr)) {
812
+ arr.forEach((item) => {
813
+ if (item?.key) {
814
+ result[item?.key] = {};
815
+ }
816
+ else {
817
+ if (item?.fieldGroup && Array.isArray(item?.fieldGroup)) {
818
+ this.getFieldKeysDataChild(result, item.fieldGroup);
819
+ }
820
+ }
821
+ });
822
+ }
823
+ }
824
+ initConfig(fields, roles, options, models, rules, fieldParameter, caller, callback) {
825
+ if (models === undefined || models === null) {
826
+ models = {};
827
+ }
828
+ fields.forEach((field) => {
829
+ /**
830
+ * 递归附加字段属性
831
+ */
832
+ this.depthFieldProperty(field, roles, options, models, rules, null, fieldParameter, caller, callback);
833
+ });
834
+ }
835
+ /**
836
+ * 初始化携带的隐藏JSON 条件
837
+ * @param field
838
+ */
839
+ initHidJson(field) {
840
+ if (_.get(field, 'props.hideJson')) {
841
+ field.hideExpression = field?.props?.hideJson;
842
+ }
843
+ }
844
+ /**
845
+ * 初始化Template
846
+ * @param field
847
+ */
848
+ initTemplate(field) {
849
+ if (field?.props == undefined || field?.props == null) {
850
+ if (field?.templateOptions) {
851
+ field.props = field?.templateOptions;
852
+ }
853
+ }
854
+ }
855
+ initParameter(field, fieldParameter) {
856
+ if (field?.key && fieldParameter && fieldParameter[field.key]) {
857
+ let item = fieldParameter[field.key];
858
+ if (item && item?.defaultParameter) {
859
+ if (field?.props?.["defaultParameter"] == undefined || field.props["defaultParameter"] == null) {
860
+ _.set(field, "props.defaultParameter", item?.defaultParameter);
861
+ }
862
+ else {
863
+ field.props["defaultParameter"] = Object.assign(field.props["defaultParameter"], item?.defaultParameter);
864
+ }
865
+ }
866
+ }
867
+ }
868
+ depthFieldProperty(field, roles, options, model, rules, arrKey, fieldParameter, caller, callback) {
869
+ this.initTemplate(field);
870
+ this.initHidJson(field);
871
+ this.initParameter(field, fieldParameter);
872
+ if (arrKey != undefined && arrKey != null) {
873
+ _.set(field, "props.arrKey", arrKey);
874
+ }
875
+ /**
876
+ * 判断是否加载字段选项
877
+ */
878
+ if (field.key && options) {
879
+ let option = options[field.key];
880
+ if (option && Array.isArray(option)) {
881
+ _.set(field, "props.options", option);
882
+ }
883
+ }
884
+ /**
885
+ * 判断是否加载字段触发回调
886
+ */
887
+ if (field.key && rules) {
888
+ let rule = rules[field.key];
889
+ if (rule) {
890
+ _.set(field, "props.callBack", true);
891
+ _.set(field, "props.callBackRule", rule.ruleId);
892
+ _.set(field, "props.callBackFields", rule.modalField);
893
+ }
894
+ }
895
+ if (field.key && field.props && (field.props["callCard"] == true || field.props["callBack"] == true)) {
896
+ field.props['callBack'] = true;
897
+ }
898
+ /**
899
+ * 判断是否加载字段权限-编辑|隐藏
900
+ */
901
+ if (field.key && roles) {
902
+ let role = roles[field.key];
903
+ if (role) {
904
+ field.show = role?.hide == true ? false : true;
905
+ field.hide = role?.hide == true ? true : false;
906
+ field.editor = role?.read == true ? false : true;
907
+ if (field?.props == undefined || field?.props == null) {
908
+ field['props'] = {};
909
+ }
910
+ if (role?.hide2 == true) {
911
+ field.props['show'] = false;
912
+ }
913
+ else {
914
+ field.props['show'] = true;
915
+ }
916
+ }
917
+ }
918
+ /**
919
+ * 设置属性
920
+ */
921
+ this.setFiledEvent(field, caller, callback);
922
+ /**
923
+ * 默认值
924
+ */
925
+ this.setFiledModel(field, model);
926
+ if (field.fieldArray) {
927
+ if (field.fieldArray["fieldGroup"]) {
928
+ field.fieldArray["fieldGroup"].forEach((f) => {
929
+ this.initTemplate(f);
930
+ this.initHidJson(f);
931
+ /**
932
+ * 递归附加字段属性
933
+ */
934
+ this.depthFieldProperty(f, roles, options, model, rules, field?.key, fieldParameter, caller, callback);
935
+ });
936
+ }
937
+ }
938
+ if (field.fieldGroup) {
939
+ field.fieldGroup.forEach((f) => {
940
+ this.initTemplate(f);
941
+ this.initHidJson(f);
942
+ /**
943
+ * 递归附加字段属性
944
+ */
945
+ this.depthFieldProperty(f, roles, options, model, rules, null, fieldParameter, caller, callback);
946
+ });
947
+ }
948
+ }
949
+ /*
950
+ 设置字段默认值的属性
951
+ */
952
+ setFiledModel(field, model) {
953
+ if (field && field.type === 'datetime') {
954
+ if (field.props && field.props?.type && field.props?.type === 'time') {
955
+ if (model[field.key] === undefined || model[field.key] === null) {
956
+ model[field.key] = null;
957
+ }
958
+ else {
959
+ model[field.key] = new Date(`${model[field.key]}`);
960
+ }
961
+ }
962
+ if (this.checkFieldDefaultValue(field)) {
963
+ if (model[field.key] === undefined) {
964
+ model[field.key] = field.defaultValue;
965
+ }
966
+ }
967
+ }
968
+ if (field.hasOwnProperty('editor')) {
969
+ if (this.checkFieldDefaultValue(field)) {
970
+ if (model[field.key] === undefined) {
971
+ model[field.key] = field.defaultValue;
972
+ }
973
+ }
974
+ }
975
+ if (field.type == 'repeat' && field.hasOwnProperty('fieldArray')) {
976
+ if (field.fieldArray.hasOwnProperty('fieldGroup')) {
977
+ if (model[field.key] === undefined || model[field.key] === null || model[field.key].length == 0) {
978
+ model[field.key] = [];
979
+ }
980
+ }
981
+ }
982
+ }
983
+ checkFieldDefaultValue(field) {
984
+ let result = false;
985
+ if (field !== undefined && field != null && field.defaultValue !== undefined && field.defaultValue != null) {
986
+ return true;
987
+ }
988
+ return result;
989
+ }
990
+ setFiledEvent(field, caller, callback) {
991
+ if (field.key !== undefined && field.key !== null) {
992
+ if (_.get(field, 'props.callBack') == true) {
993
+ switch (field.type) {
994
+ case 'text':
995
+ case 'textarea':
996
+ case 'password':
997
+ case 'textBtn':
998
+ field.props.blur = (e) => {
999
+ this.setCallBackFun(caller, callback, e.formControl.value, field);
1000
+ };
1001
+ // field.hooks = {
1002
+ // onInit: (field: any) => {
1003
+ // return field.formControl.valueChanges.pipe(
1004
+ // distinctUntilChanged(),
1005
+ // debounceTime(800),
1006
+ // tap((e) => {
1007
+ // this.setCallBackFun(caller, callback, e, field);
1008
+ // }),
1009
+ // );
1010
+ // },
1011
+ // };
1012
+ break;
1013
+ case 'number':
1014
+ case 'eval_number':
1015
+ field.props.change = (e) => {
1016
+ this.setCallBackFun(caller, callback, e.formControl.value, field);
1017
+ };
1018
+ break;
1019
+ // case 'checkbox':
1020
+ // field.props.change = (e: any) => {
1021
+ // debugger;
1022
+ // setTimeout(() => {
1023
+ // this.setCallBackFun(caller, callback, e.formControl.value, field);
1024
+ // }, 0);
1025
+ // };
1026
+ // break;
1027
+ default:
1028
+ field.hooks = {
1029
+ onInit: (field) => {
1030
+ return field.formControl.valueChanges.pipe(distinctUntilChanged(), tap((e) => {
1031
+ this.setCallBackFun(caller, callback, e, field);
1032
+ }));
1033
+ },
1034
+ };
1035
+ break;
1036
+ }
1037
+ }
1038
+ }
1039
+ }
1040
+ setCallBackFun(caller, callback, e, field) {
1041
+ if (typeof e == 'boolean' || typeof e == 'number' || typeof e == 'string') {
1042
+ if (callback != undefined && callback != null && callback != '') {
1043
+ callback.call(caller, e, field);
1044
+ }
1045
+ }
1046
+ else {
1047
+ if (callback != undefined && callback != null && callback != '') {
1048
+ callback.call(caller, e, field);
1049
+ }
1050
+ }
1051
+ }
1052
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonFormUtilService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1053
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonFormUtilService, providedIn: 'root' });
1054
+ }
1055
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonFormUtilService, decorators: [{
1056
+ type: Injectable,
1057
+ args: [{ providedIn: 'root' }]
1058
+ }] });
1059
+
1060
+ class DeonFormResetService {
1061
+ resetConfig(fields, models, datas) {
1062
+ fields.forEach((field) => {
1063
+ if (field.key && datas[field.key]) {
1064
+ let data = datas[field.key];
1065
+ this.initTemplate(field);
1066
+ field.props ??= {};
1067
+ if (data?.value != undefined && data?.value != null) {
1068
+ models[field.key] = data.value;
1069
+ }
1070
+ if (data?.editor != undefined && data?.editor != null) {
1071
+ field.editor = data.editor;
1072
+ }
1073
+ if (data?.show != undefined && data?.show != null) {
1074
+ field.show = data.show;
1075
+ if (data.show) {
1076
+ field.hide = false;
1077
+ }
1078
+ else {
1079
+ field.hide = true;
1080
+ }
1081
+ }
1082
+ if (data?.required != undefined && data?.required != null) {
1083
+ field.props["required"] = data.required;
1084
+ }
1085
+ if (data?.min != undefined && data?.min != null) {
1086
+ field.props["min"] = data.min;
1087
+ }
1088
+ if (data?.max != undefined && data?.max != null) {
1089
+ field.props["max"] = data.max;
1090
+ }
1091
+ if (data?.minLength != undefined && data?.minLength != null) {
1092
+ field.props["minLength"] = data.minLength;
1093
+ }
1094
+ if (data?.maxLength != undefined && data?.maxLength != null) {
1095
+ field.props["maxLength"] = data.maxLength;
1096
+ }
1097
+ if (data?.options != undefined && data?.options != null && Array.isArray(data?.options)) {
1098
+ field.props["options"] = data.options;
1099
+ }
1100
+ }
1101
+ if (field.fieldArray) {
1102
+ let fieldKey = field.key;
1103
+ if (field.fieldGroup && field.fieldGroup.length > 0) {
1104
+ let arrData = datas[fieldKey];
1105
+ let arrModule = models[fieldKey];
1106
+ if (arrData && arrData.length == field.fieldGroup.length) {
1107
+ field.fieldGroup.forEach((f, index) => {
1108
+ this.resetConfig(f.fieldGroup, arrModule[index], arrData[index]);
1109
+ });
1110
+ }
1111
+ }
1112
+ }
1113
+ if (field.fieldGroup) {
1114
+ this.resetConfig(field.fieldGroup, models, datas);
1115
+ }
1116
+ });
1117
+ }
1118
+ resetOverTime(fields, models, datas, key, index) {
1119
+ if (models && datas) {
1120
+ fields.forEach((field) => {
1121
+ if (field.key && field.key == key && field.fieldArray) {
1122
+ if (field.fieldGroup && field.fieldGroup.length > index) {
1123
+ if (field.fieldGroup[index]) {
1124
+ let rowField = field?.fieldGroup[index]?.fieldGroup?.[0];
1125
+ let itemValue = {};
1126
+ let itemConfig = {};
1127
+ /**
1128
+ * 主表
1129
+ */
1130
+ this.initOverTime(datas, itemValue, itemConfig);
1131
+ /**
1132
+ * 子表:零点拆分列表
1133
+ */
1134
+ if (datas?.listChild != undefined) {
1135
+ if (datas?.listChild != null && Array.isArray(datas.listChild) && datas.listChild.length > 0) {
1136
+ itemValue["listChild"] = [];
1137
+ itemConfig["listChild"] = [];
1138
+ datas.listChild.forEach((child) => {
1139
+ let childValue = {};
1140
+ let childConfig = {};
1141
+ this.initOverTime(child, childValue, childConfig);
1142
+ itemValue["listChild"].push(childValue);
1143
+ itemConfig["listChild"].push(childConfig);
1144
+ });
1145
+ }
1146
+ else {
1147
+ itemValue["listChild"] = null;
1148
+ itemConfig["listChild"] = null;
1149
+ }
1150
+ }
1151
+ /**
1152
+ * 赋值+处理对象扩展
1153
+ */
1154
+ if (Object.keys(itemValue).length == 0) {
1155
+ itemValue = null;
1156
+ }
1157
+ models[key][index] = {
1158
+ overtime: itemValue
1159
+ };
1160
+ rowField.props["overtime"] = _.cloneDeep(itemConfig);
1161
+ }
1162
+ }
1163
+ }
1164
+ });
1165
+ }
1166
+ }
1167
+ initOverTime(model, itemValue, itemConfig) {
1168
+ /**
1169
+ * 加班项目
1170
+ */
1171
+ if (model?.itemId != undefined) {
1172
+ itemValue["itemId"] = model.itemId.value;
1173
+ itemConfig["itemId"] = model.itemId.options;
1174
+ }
1175
+ ;
1176
+ /**
1177
+ * 加班日期
1178
+ */
1179
+ if (model?.happenDate != undefined) {
1180
+ itemValue["happenDate"] = model.happenDate.value;
1181
+ }
1182
+ ;
1183
+ /**
1184
+ * 加班开始时间
1185
+ */
1186
+ if (model?.beginDate != undefined) {
1187
+ itemValue["beginDate"] = model.beginDate.value;
1188
+ }
1189
+ ;
1190
+ /**
1191
+ * 加班结束时间
1192
+ */
1193
+ if (model?.endDate != undefined) {
1194
+ itemValue["endDate"] = model.endDate.value;
1195
+ }
1196
+ ;
1197
+ /**
1198
+ * 加班时长
1199
+ */
1200
+ if (model?.numValue != undefined) {
1201
+ itemValue["numValue"] = model.numValue.value;
1202
+ }
1203
+ ;
1204
+ /**
1205
+ * 班次
1206
+ */
1207
+ if (model?.shiftId != undefined) {
1208
+ itemValue["shiftId"] = model.shiftId.value;
1209
+ itemConfig["shiftId"] = model.shiftId.options;
1210
+ }
1211
+ ;
1212
+ /**
1213
+ * 班次可申请时间段
1214
+ */
1215
+ if (model?.shiftPeriod != undefined) {
1216
+ itemValue["shiftPeriod"] = model.shiftPeriod.value;
1217
+ itemConfig["shiftPeriod"] = model.shiftPeriod.options;
1218
+ }
1219
+ ;
1220
+ }
1221
+ /**
1222
+ * 初始化Template
1223
+ * @param field
1224
+ */
1225
+ initTemplate(field) {
1226
+ if (field?.props == undefined || field?.props == null) {
1227
+ if (field?.templateOptions) {
1228
+ field.props = field?.templateOptions;
1229
+ }
1230
+ }
1231
+ }
1232
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonFormResetService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1233
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonFormResetService, providedIn: 'root' });
1234
+ }
1235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonFormResetService, decorators: [{
1236
+ type: Injectable,
1237
+ args: [{ providedIn: 'root' }]
1238
+ }] });
1239
+
1240
+ const PRE_DIALOG_HANDLER = new InjectionToken('PRE_DIALOG_HANDLER');
1241
+
1242
+ class DeonDesignFieldInitService {
1243
+ itemDataConvert(list) {
1244
+ let result = [];
1245
+ if (list && list.length > 0) {
1246
+ list.forEach((e) => {
1247
+ let item = {};
1248
+ item.key = e.id;
1249
+ item.label = e.name;
1250
+ switch (e.dataType.toLocaleLowerCase()) {
1251
+ case 'int': //int -> number
1252
+ item.type = 'number';
1253
+ break;
1254
+ case 'float': //float -> number
1255
+ item.precision = 2;
1256
+ item.type = 'number';
1257
+ break;
1258
+ case 'time': //time -> datetime
1259
+ item.type = 'datetime';
1260
+ item.showType = 'time';
1261
+ break;
1262
+ case 'year': //year -> datetime
1263
+ item.type = 'datetime';
1264
+ item.showType = 'year';
1265
+ break;
1266
+ case 'yearmonth': //yearmonth -> datetime
1267
+ item.type = 'datetime';
1268
+ item.showType = 'month';
1269
+ break;
1270
+ case 'yearmonthday': //yearmonthday -> datetime
1271
+ item.type = 'datetime';
1272
+ item.showType = 'date';
1273
+ break;
1274
+ default:
1275
+ item.type = e.dataType.toLocaleLowerCase();
1276
+ break;
1277
+ }
1278
+ result.push(item);
1279
+ });
1280
+ }
1281
+ return result;
1282
+ }
1283
+ itemListConvertField(sources, special = true, indicator = false) {
1284
+ let list = [];
1285
+ if (sources && Array.isArray(sources)) {
1286
+ sources.forEach((item) => {
1287
+ let data = {};
1288
+ if (indicator == true) {
1289
+ data = {
1290
+ key: special == true ? '$' + item.id : item.id,
1291
+ type: item.itemType.toLowerCase(),
1292
+ label: item.itemName,
1293
+ allowNull: item.required,
1294
+ cols: 24,
1295
+ rows: item.itemType.toLowerCase() == 'textarea' ? 4 : 1,
1296
+ };
1297
+ }
1298
+ else {
1299
+ data = {
1300
+ key: special == true ? '$' + item.id : item.id,
1301
+ type: item.dataType.toLowerCase(),
1302
+ label: item.itemName ? item.itemName : item.name,
1303
+ allowNull: item.required,
1304
+ cols: item.dataType.toLowerCase() == 'textarea' ? 24 : 12,
1305
+ rows: item.dataType.toLowerCase() == 'textarea' ? 3 : 1,
1306
+ };
1307
+ }
1308
+ list.push(this.getFiledInfoFunction(data));
1309
+ });
1310
+ }
1311
+ return list;
1312
+ }
1313
+ okrItemListConvertField(sources) {
1314
+ let list = [];
1315
+ if (sources && Array.isArray(sources)) {
1316
+ sources.forEach((item) => {
1317
+ let data = {
1318
+ key: '$' + item.id,
1319
+ type: item.dataType.toLowerCase(),
1320
+ label: item.itemName ? item.itemName : item.name,
1321
+ allowNull: item.required,
1322
+ cols: item.dataType.toLowerCase() == 'textarea' ? 24 : 12,
1323
+ rows: item.dataType.toLowerCase() == 'textarea' ? 3 : 1,
1324
+ className: 'cols',
1325
+ };
1326
+ list.push(this.getFiledInfoFunction(data));
1327
+ });
1328
+ }
1329
+ return list;
1330
+ }
1331
+ kpiItemListConvertField(sources, className = true) {
1332
+ let list = [];
1333
+ if (sources && Array.isArray(sources)) {
1334
+ sources.forEach((item) => {
1335
+ let data = {};
1336
+ data = {
1337
+ key: this.datetimeString(item.itemType.toLowerCase()),
1338
+ type: item.itemType.toLowerCase(),
1339
+ label: item.itemName,
1340
+ allowNull: item?.required,
1341
+ cols: 24,
1342
+ className: className == true ? 'row' : null,
1343
+ rows: item.itemType.toLowerCase() == 'textarea' ? 4 : 1,
1344
+ };
1345
+ let newField = this.getFiledInfoFunction(data);
1346
+ if (newField.type == 'number') {
1347
+ newField.props['precision'] = 2;
1348
+ }
1349
+ if (className == false) {
1350
+ newField.props.className = null;
1351
+ }
1352
+ if (item?.defaultValue) {
1353
+ newField.defaultValue = item?.defaultValue;
1354
+ }
1355
+ newField.props['source'] = {
1356
+ sourceId: item.id,
1357
+ sourceType: 'indicator_item',
1358
+ };
1359
+ list.push(newField);
1360
+ });
1361
+ }
1362
+ return list;
1363
+ }
1364
+ /**
1365
+ * 跟进类型创建字段对象
1366
+ * @param sourceField
1367
+ */
1368
+ getFiledInfoFunction(sourceField) {
1369
+ let field = {};
1370
+ switch (sourceField.type) {
1371
+ case 'text': //1
1372
+ field = this.text(sourceField);
1373
+ break;
1374
+ case 'textarea': //2
1375
+ field = this.textArea(sourceField);
1376
+ break;
1377
+ case 'number': //3
1378
+ field = this.number(sourceField);
1379
+ break;
1380
+ case 'password': //4
1381
+ field = this.passWord(sourceField);
1382
+ break;
1383
+ case 'texti18n': //5
1384
+ field = this.textI18N(sourceField);
1385
+ break;
1386
+ case 'radio': //6
1387
+ field = this.radio(sourceField);
1388
+ break;
1389
+ case 'radiogroup': //7
1390
+ field = this.radioGroup(sourceField);
1391
+ break;
1392
+ case 'checkbox': //8
1393
+ field = this.checkbox(sourceField);
1394
+ break;
1395
+ case 'checkboxgroup': //9
1396
+ field = this.checkboxGroup(sourceField);
1397
+ break;
1398
+ case 'select': //10
1399
+ field = this.select(sourceField);
1400
+ break;
1401
+ case 'datetime': //11
1402
+ field = this.datetime(sourceField);
1403
+ break;
1404
+ case 'image': //12
1405
+ field = this.image(sourceField);
1406
+ break;
1407
+ case 'line': //13
1408
+ field = this.line(sourceField);
1409
+ break;
1410
+ case 'html': //14
1411
+ field = this.line(sourceField);
1412
+ break;
1413
+ case 'repeat': //15
1414
+ field = this.repeat(sourceField);
1415
+ break;
1416
+ case 'panel': //16
1417
+ field = this.panel(sourceField);
1418
+ break;
1419
+ case 'label': //17
1420
+ field = this.label(sourceField);
1421
+ break;
1422
+ case 'richtext': //18
1423
+ field = this.richtext(sourceField);
1424
+ break;
1425
+ case 'employee':
1426
+ case 'position':
1427
+ case 'organizational':
1428
+ case 'area':
1429
+ field = this.lookup(sourceField);
1430
+ break;
1431
+ case 'int': //int -> number
1432
+ sourceField.precision = 0;
1433
+ field = this.number(sourceField);
1434
+ break;
1435
+ case 'float': //float -> number
1436
+ sourceField.precision = 0;
1437
+ field = this.number(sourceField);
1438
+ break;
1439
+ case 'time': //time -> datetime
1440
+ sourceField.showType = 'time';
1441
+ field = this.datetime(sourceField);
1442
+ break;
1443
+ case 'year': //year -> datetime
1444
+ sourceField.showType = 'year';
1445
+ field = this.datetime(sourceField);
1446
+ break;
1447
+ case 'yearmonth': //yearmonth -> datetime
1448
+ sourceField.showType = 'month';
1449
+ field = this.datetime(sourceField);
1450
+ break;
1451
+ case 'yearmonthday': //yearmonthday -> datetime
1452
+ sourceField.showType = 'date';
1453
+ field = this.datetime(sourceField);
1454
+ break;
1455
+ default:
1456
+ break;
1457
+ }
1458
+ if (field.defaultValue != undefined && field.defaultValue != null) {
1459
+ field.defaultValue = field.defaultValue;
1460
+ }
1461
+ if (field.props) {
1462
+ field.props.className = sourceField.className ? sourceField.className : 'row';
1463
+ }
1464
+ field.editor = true;
1465
+ return field;
1466
+ }
1467
+ deleteFieldProperty(list) {
1468
+ if (list && list.length > 0) {
1469
+ list.forEach((field) => {
1470
+ if (field.hasOwnProperty('status')) {
1471
+ delete field.status;
1472
+ }
1473
+ if (field.hasOwnProperty('active')) {
1474
+ delete field.active;
1475
+ }
1476
+ if (field.hasOwnProperty('guid')) {
1477
+ delete field.guid;
1478
+ }
1479
+ if (field.hasOwnProperty('id')) {
1480
+ delete field.id;
1481
+ }
1482
+ if (field.hasOwnProperty('wrappers')) {
1483
+ delete field['wrappers'];
1484
+ }
1485
+ if (field.hasOwnProperty('_keyPath')) {
1486
+ delete field['_keyPath'];
1487
+ }
1488
+ if (field.hasOwnProperty('modelOptions')) {
1489
+ delete field['modelOptions'];
1490
+ }
1491
+ if (field.hasOwnProperty('checked')) {
1492
+ delete field['checked'];
1493
+ }
1494
+ if (field.hasOwnProperty('resetOnHide')) {
1495
+ delete field['resetOnHide'];
1496
+ }
1497
+ if (field.hasOwnProperty('props')) {
1498
+ if (field.props.hasOwnProperty('focus')) {
1499
+ delete field.props.focus;
1500
+ }
1501
+ if (field.props.hasOwnProperty('disabled')) {
1502
+ delete field.props.disabled;
1503
+ }
1504
+ if (field.props.hasOwnProperty('readonly')) {
1505
+ delete field.props.readonly;
1506
+ }
1507
+ }
1508
+ if (field.fieldGroup != undefined && field.fieldGroup != null && field.fieldGroup.length == 0) {
1509
+ delete field.fieldGroup;
1510
+ }
1511
+ if (field.fieldArray) {
1512
+ if (field.fieldArray.fieldGroup) {
1513
+ if (field.fieldGroup) {
1514
+ delete field.fieldGroup;
1515
+ }
1516
+ if (field.fieldArray.fieldGroup) {
1517
+ this.deleteFieldProperty(field.fieldArray.fieldGroup);
1518
+ }
1519
+ }
1520
+ }
1521
+ if (field.fieldGroup) {
1522
+ this.deleteFieldProperty(field.fieldGroup);
1523
+ }
1524
+ });
1525
+ }
1526
+ }
1527
+ deleteFieldActive(list) {
1528
+ if (list && list.length > 0) {
1529
+ list.forEach((field) => {
1530
+ if (field.hasOwnProperty('active')) {
1531
+ delete field.active;
1532
+ }
1533
+ if (field.fieldArray) {
1534
+ if (field.fieldArray.fieldGroup) {
1535
+ if (field.fieldArray.fieldGroup) {
1536
+ this.deleteFieldActive(field.fieldArray.fieldGroup);
1537
+ }
1538
+ }
1539
+ }
1540
+ if (field.fieldGroup) {
1541
+ this.deleteFieldActive(field.fieldGroup);
1542
+ }
1543
+ });
1544
+ }
1545
+ }
1546
+ datetimeString(type) {
1547
+ // if (type !== undefined && type !== null) {
1548
+ // return `${moment().format('YYYYMMDDHHmmssSSS')}_${type}`;
1549
+ // } else {
1550
+ // return `${moment().format('YYYYMMDDHHmmssSSS')}`;
1551
+ // }
1552
+ let rd = `${moment().format('YYYYMMDDHHmmss')}` + Math.round((Math.random() * 9 + 1) * 100000);
1553
+ return type ? type + '_' + rd : rd;
1554
+ }
1555
+ //1、字符串
1556
+ text(field) {
1557
+ let config = {
1558
+ type: 'text',
1559
+ key: field.key ? field.key : this.datetimeString('text'),
1560
+ props: {
1561
+ label: field?.label,
1562
+ required: field?.allowNull,
1563
+ maxLength: field?.maxLength,
1564
+ minLength: field?.minLength,
1565
+ placeholder: field?.placeholder ? field?.placeholder : `请输入${field?.label}`,
1566
+ isButintin: field?.isButintin,
1567
+ tips: field?.tips,
1568
+ pattern: field?.pattern,
1569
+ cols: field.cols ? field.cols : 24,
1570
+ },
1571
+ };
1572
+ return config;
1573
+ }
1574
+ //2、多行文本
1575
+ textArea(field) {
1576
+ let config = {
1577
+ type: 'textarea',
1578
+ key: field.key ? field.key : this.datetimeString('textarea'),
1579
+ props: {
1580
+ label: field?.label,
1581
+ required: field?.allowNull,
1582
+ maxLength: field?.maxLength,
1583
+ minLength: field?.minLength,
1584
+ placeholder: field?.placeholder ? field?.placeholder : `请输入${field?.label}`,
1585
+ isButintin: field?.isButintin,
1586
+ tips: field?.tips,
1587
+ pattern: field?.pattern,
1588
+ cols: field.cols ? field.cols : 24,
1589
+ rows: field.rows ? field.rows : 1,
1590
+ },
1591
+ };
1592
+ return config;
1593
+ }
1594
+ //3、数字
1595
+ number(field) {
1596
+ let config = {
1597
+ type: 'number',
1598
+ key: field.key ? field.key : this.datetimeString('number'),
1599
+ props: {
1600
+ label: field?.label,
1601
+ required: field?.allowNull,
1602
+ max: field.max,
1603
+ min: field.min,
1604
+ placeholder: field?.placeholder ? field?.placeholder : `请输入${field?.label}`,
1605
+ isButintin: field?.isButintin,
1606
+ tips: field?.tips,
1607
+ pattern: field?.pattern,
1608
+ precision: field.precision,
1609
+ cols: field.cols ? field.cols : 24,
1610
+ },
1611
+ };
1612
+ return config;
1613
+ }
1614
+ //4、密码
1615
+ passWord(field) {
1616
+ let config = {
1617
+ type: 'password',
1618
+ key: field.key ? field.key : this.datetimeString('password'),
1619
+ props: {
1620
+ label: field?.label,
1621
+ required: field?.allowNull,
1622
+ maxLength: field?.maxLength,
1623
+ minLength: field?.minLength,
1624
+ placeholder: field?.placeholder ? field?.placeholder : `请输入${field?.label}`,
1625
+ isButintin: field?.isButintin,
1626
+ tips: field?.tips,
1627
+ pattern: field?.pattern,
1628
+ cols: field.cols ? field.cols : 24,
1629
+ },
1630
+ };
1631
+ return config;
1632
+ }
1633
+ //5、多语言
1634
+ textI18N(field) {
1635
+ let config = {
1636
+ type: 'texti18n',
1637
+ key: field.key ? field.key : this.datetimeString('texti18n'),
1638
+ props: {
1639
+ label: field?.label,
1640
+ required: field?.allowNull,
1641
+ maxLength: field?.maxLength,
1642
+ minLength: field?.minLength,
1643
+ placeholder: field?.placeholder ? field?.placeholder : `请输入${field?.label}`,
1644
+ isButintin: field?.isButintin,
1645
+ tips: field?.tips,
1646
+ pattern: field?.pattern,
1647
+ cols: field.cols ? field.cols : 24,
1648
+ },
1649
+ };
1650
+ return config;
1651
+ }
1652
+ //6、单选
1653
+ radio(field) {
1654
+ let config = {
1655
+ type: 'radio',
1656
+ key: field.key ? field.key : this.datetimeString('radio'),
1657
+ props: {
1658
+ type: field.showType,
1659
+ label: field?.label,
1660
+ required: field?.allowNull,
1661
+ isButintin: field?.isButintin,
1662
+ tips: field?.tips,
1663
+ pattern: field?.pattern,
1664
+ cols: field.cols ? field.cols : 24,
1665
+ },
1666
+ };
1667
+ return config;
1668
+ }
1669
+ //7、单选组
1670
+ radioGroup(field) {
1671
+ let config = {
1672
+ type: 'radiogroup',
1673
+ key: field.fieldCode ? field.fieldCode : this.datetimeString('radiogroup'),
1674
+ props: {
1675
+ type: field.showType,
1676
+ label: field?.label,
1677
+ options: [
1678
+ { label: '选项一', value: this.datetimeString() },
1679
+ { label: '选项二', value: this.datetimeString() },
1680
+ { label: '选项三', value: this.datetimeString() },
1681
+ ],
1682
+ required: field?.allowNull,
1683
+ isButintin: field?.isButintin,
1684
+ tips: field?.tips,
1685
+ pattern: field?.pattern,
1686
+ cols: field.cols ? field.cols : 24,
1687
+ },
1688
+ };
1689
+ return config;
1690
+ }
1691
+ //8、复选
1692
+ checkbox(field) {
1693
+ let config = {
1694
+ type: 'checkbox',
1695
+ key: field.key ? field.key : this.datetimeString('checkbox'),
1696
+ props: {
1697
+ type: field.showType,
1698
+ label: field?.label,
1699
+ required: field?.allowNull,
1700
+ isButintin: field?.isButintin,
1701
+ tips: field?.tips,
1702
+ pattern: field?.pattern,
1703
+ cols: field.cols ? field.cols : 24,
1704
+ },
1705
+ };
1706
+ return config;
1707
+ }
1708
+ //9、复选组
1709
+ checkboxGroup(field) {
1710
+ let config = {
1711
+ type: 'checkboxgroup',
1712
+ key: field.fieldCode ? field.fieldCode : this.datetimeString('checkboxgroup'),
1713
+ props: {
1714
+ type: field.showType,
1715
+ label: field?.label,
1716
+ options: [
1717
+ { label: '选项一', value: this.datetimeString() },
1718
+ { label: '选项二', value: this.datetimeString() },
1719
+ { label: '选项三', value: this.datetimeString() },
1720
+ ],
1721
+ required: field?.allowNull,
1722
+ isButintin: field?.isButintin,
1723
+ tips: field?.tips,
1724
+ pattern: field?.pattern,
1725
+ cols: field.cols ? field.cols : 24,
1726
+ },
1727
+ status: 1,
1728
+ };
1729
+ return config;
1730
+ }
1731
+ //10、下拉
1732
+ select(field) {
1733
+ let config = {
1734
+ type: 'select',
1735
+ key: field.key ? field.key : this.datetimeString('select'),
1736
+ props: {
1737
+ type: field.showType,
1738
+ label: field?.label,
1739
+ required: field?.allowNull,
1740
+ selectType: field.selectType,
1741
+ parameterId: field.parameterId,
1742
+ options: field.parameterData,
1743
+ placeholder: field?.placeholder ? field?.placeholder : `请输入${field?.label}`,
1744
+ isButintin: field?.isButintin,
1745
+ tips: field?.tips,
1746
+ pattern: field?.pattern,
1747
+ cols: field.cols ? field.cols : 24,
1748
+ },
1749
+ };
1750
+ return config;
1751
+ }
1752
+ //11、日期
1753
+ datetime(field) {
1754
+ let config = {
1755
+ type: 'datetime',
1756
+ key: field.key ? field.key : this.datetimeString('datetime'),
1757
+ props: {
1758
+ type: field.showType,
1759
+ label: field?.label,
1760
+ required: field?.allowNull,
1761
+ placeholder: field?.placeholder ? field?.placeholder : `请输入${field?.label}`,
1762
+ isButintin: field?.isButintin,
1763
+ tips: field?.tips,
1764
+ pattern: field?.pattern,
1765
+ format: field.format,
1766
+ cols: field.cols ? field.cols : 24,
1767
+ },
1768
+ status: 1,
1769
+ };
1770
+ return config;
1771
+ }
1772
+ //12、图片
1773
+ image(field) {
1774
+ let config = {
1775
+ type: 'image',
1776
+ key: field.key ? field.key : this.datetimeString('image'),
1777
+ props: {
1778
+ label: field?.label,
1779
+ required: field?.allowNull,
1780
+ placeholder: field?.placeholder,
1781
+ isButintin: field?.isButintin,
1782
+ tips: field?.tips,
1783
+ pattern: field?.pattern,
1784
+ cols: field.cols ? field.cols : 24,
1785
+ },
1786
+ status: 1,
1787
+ };
1788
+ return config;
1789
+ }
1790
+ //13、分割线
1791
+ line(field) {
1792
+ let config = {
1793
+ type: 'line',
1794
+ key: field.key ? field.key : this.datetimeString('line'),
1795
+ props: {
1796
+ label: '分割线',
1797
+ type: 'horizontal',
1798
+ hideLabel: false,
1799
+ line: 'dotted',
1800
+ orientation: 'left',
1801
+ cols: field.cols ? field.cols : 24,
1802
+ },
1803
+ };
1804
+ return config;
1805
+ }
1806
+ //14、文本描述
1807
+ html(field) {
1808
+ let config = {
1809
+ type: 'html',
1810
+ key: field.key ? field.key : this.datetimeString('html'),
1811
+ props: {
1812
+ label: '文本描述',
1813
+ hideLabel: true,
1814
+ cols: field.cols ? field.cols : 24,
1815
+ },
1816
+ };
1817
+ return config;
1818
+ }
1819
+ //15、repeat
1820
+ repeat(field) {
1821
+ let config = {
1822
+ type: 'repeat',
1823
+ key: field.key ? field.key : this.datetimeString('repeat'),
1824
+ defaultText: field.defaultText,
1825
+ props: {
1826
+ type: field.showType ? field.showType : 'card',
1827
+ label: field?.label,
1828
+ required: field?.allowNull,
1829
+ placeholder: field?.placeholder,
1830
+ isButintin: field?.isButintin,
1831
+ tips: field?.tips,
1832
+ pattern: field?.pattern,
1833
+ minLength: field?.minLength,
1834
+ maxLength: field?.maxLength,
1835
+ cols: field.cols ? field.cols : 24,
1836
+ },
1837
+ fieldArray: {
1838
+ fieldGroup: [],
1839
+ },
1840
+ };
1841
+ if (field.fields && field.fields.length > 0) {
1842
+ field.fields.forEach((item) => {
1843
+ config.fieldArray.fieldGroup.push(this.getFiledInfoFunction(item));
1844
+ });
1845
+ }
1846
+ return config;
1847
+ }
1848
+ //16、panel
1849
+ panel(field) {
1850
+ let config = {
1851
+ type: 'panel',
1852
+ key: field.key ? field.key : this.datetimeString('panel'),
1853
+ defaultText: field.defaultText,
1854
+ props: {
1855
+ label: field?.label,
1856
+ required: field?.allowNull,
1857
+ placeholder: field?.placeholder,
1858
+ isButintin: field?.isButintin,
1859
+ tips: field?.tips,
1860
+ pattern: field?.pattern,
1861
+ minLength: field?.minLength,
1862
+ maxLength: field?.maxLength,
1863
+ cols: field.cols ? field.cols : 24,
1864
+ },
1865
+ fieldGroup: [],
1866
+ };
1867
+ return config;
1868
+ }
1869
+ //17、label
1870
+ label(field) {
1871
+ let config = {
1872
+ type: 'label',
1873
+ key: field.key ? field.key : this.datetimeString('label'),
1874
+ props: {
1875
+ label: field?.label,
1876
+ isButintin: field?.isButintin,
1877
+ tips: field?.tips,
1878
+ cols: field.cols ? field.cols : 24,
1879
+ },
1880
+ };
1881
+ return config;
1882
+ }
1883
+ //18、richtext
1884
+ richtext(field) {
1885
+ let config = {
1886
+ type: 'richtext',
1887
+ key: field.key ? field.key : this.datetimeString('label'),
1888
+ props: {
1889
+ label: field?.label,
1890
+ isButintin: field?.isButintin,
1891
+ placeholder: field?.placeholder,
1892
+ tips: field?.tips,
1893
+ cols: field.cols ? field.cols : 24,
1894
+ },
1895
+ };
1896
+ return config;
1897
+ }
1898
+ // 、人员employee | 职位position | 组织organizational | 地区area
1899
+ lookup(field) {
1900
+ let config = {
1901
+ type: field.dataType,
1902
+ key: field.key ? field.key : Guid.createId()['value'],
1903
+ defaultText: field.defaultText,
1904
+ props: {
1905
+ type: field.showType,
1906
+ label: field?.label,
1907
+ required: field?.allowNull,
1908
+ placeholder: field?.placeholder,
1909
+ isButintin: field?.isButintin,
1910
+ tips: field?.tips,
1911
+ pattern: field?.pattern,
1912
+ minLength: field?.minLength,
1913
+ maxLength: field?.maxLength,
1914
+ },
1915
+ };
1916
+ return config;
1917
+ }
1918
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonDesignFieldInitService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1919
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonDesignFieldInitService, providedIn: 'root' });
1920
+ }
1921
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: DeonDesignFieldInitService, decorators: [{
1922
+ type: Injectable,
1923
+ args: [{
1924
+ providedIn: 'root',
1925
+ }]
1926
+ }] });
1927
+
1928
+ class GramGlobalService {
1929
+ data = new Subject();
1930
+ dataStream$ = this.data.asObservable();
1931
+ subscriptions = new Map();
1932
+ constructor() {
1933
+ this.dataStream$.subscribe((data) => this._onEvent(data));
1934
+ }
1935
+ notifyDataChanged(event, value) {
1936
+ const current = this.data[event];
1937
+ if (current !== value) {
1938
+ this.data[event] = value;
1939
+ this.data.next({
1940
+ event,
1941
+ data: this.data[event],
1942
+ });
1943
+ }
1944
+ }
1945
+ removeSubscribe(event) {
1946
+ if (this.subscriptions.has(event)) {
1947
+ this.subscriptions.delete(event);
1948
+ }
1949
+ }
1950
+ subscribe(event, callback) {
1951
+ const subscribers = this.subscriptions.get(event) || [];
1952
+ subscribers.push(callback);
1953
+ this.subscriptions.set(event, subscribers);
1954
+ }
1955
+ _onEvent(data) {
1956
+ const subscribers = this.subscriptions.get(data.event) || [];
1957
+ subscribers.forEach((callback) => {
1958
+ callback.call(null, data.data);
1959
+ });
1960
+ }
1961
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramGlobalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1962
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramGlobalService });
1963
+ }
1964
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramGlobalService, decorators: [{
1965
+ type: Injectable
1966
+ }], ctorParameters: () => [] });
1967
+
1968
+ class LayoutDetailPageService {
1969
+ http;
1970
+ activatedRoute;
1971
+ commAPISrv;
1972
+ loading = true;
1973
+ moduleCode = 'user';
1974
+ layoutDetailId;
1975
+ layoutDetailData;
1976
+ pageConfig;
1977
+ constructor(http, activatedRoute, commAPISrv) {
1978
+ this.http = http;
1979
+ this.activatedRoute = activatedRoute;
1980
+ this.commAPISrv = commAPISrv;
1981
+ this.activatedRoute.params.subscribe((item) => {
1982
+ this.layoutDetailId = item.id;
1983
+ this.getLayoutDetailData();
1984
+ });
1985
+ }
1986
+ ngOnDestroy() { }
1987
+ initPageData() { }
1988
+ /**
1989
+ * 获取布局数据
1990
+ */
1991
+ getLayoutDetailData() {
1992
+ if (this.layoutDetailId) {
1993
+ this.loading = true;
1994
+ let address = this.commAPISrv.getLayoutDetailAddress(this.moduleCode, this.layoutDetailId);
1995
+ this.http.post(address).subscribe((res) => {
1996
+ let result = res.result;
1997
+ if (res.success && result) {
1998
+ result.module = this.moduleCode;
1999
+ this.layoutDetailData = result;
2000
+ }
2001
+ this.loading = false;
2002
+ this.initPageData();
2003
+ });
2004
+ }
2005
+ else {
2006
+ this.loading = false;
2007
+ }
2008
+ }
2009
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutDetailPageService, deps: [{ token: i1$1._HttpClient }, { token: i2$1.ActivatedRoute }, { token: i3$1.CommAPIService }], target: i0.ɵɵFactoryTarget.Directive });
2010
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: LayoutDetailPageService, isStandalone: true, ngImport: i0 });
2011
+ }
2012
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutDetailPageService, decorators: [{
2013
+ type: Directive
2014
+ }], ctorParameters: () => [{ type: i1$1._HttpClient }, { type: i2$1.ActivatedRoute }, { type: i3$1.CommAPIService }] });
2015
+
2016
+ class LayoutPageService {
2017
+ http;
2018
+ activatedRoute;
2019
+ commAPISrv;
2020
+ loading = true;
2021
+ moduleCode = 'user';
2022
+ /**
2023
+ * 布局ID
2024
+ */
2025
+ layoutId = null;
2026
+ /**
2027
+ * 布局数据
2028
+ */
2029
+ layoutData = null;
2030
+ constructor(http, activatedRoute, commAPISrv) {
2031
+ this.http = http;
2032
+ this.activatedRoute = activatedRoute;
2033
+ this.commAPISrv = commAPISrv;
2034
+ this.activatedRoute.params.subscribe((item) => {
2035
+ this.layoutId = item.id;
2036
+ this.getLayoutData();
2037
+ });
2038
+ }
2039
+ ngOnDestroy() { }
2040
+ initPageData() { }
2041
+ /**
2042
+ * 获取布局数据
2043
+ */
2044
+ getLayoutData() {
2045
+ if (this.layoutId) {
2046
+ this.loading = true;
2047
+ let address = this.commAPISrv.getLayoutAddress(this.moduleCode, this.layoutId);
2048
+ this.http.post(address).subscribe((res) => {
2049
+ let result = res.result;
2050
+ if (res.success && result) {
2051
+ result.module = this.moduleCode;
2052
+ this.layoutData = result;
2053
+ }
2054
+ this.loading = false;
2055
+ this.initPageData();
2056
+ });
2057
+ }
2058
+ else {
2059
+ this.loading = false;
2060
+ }
2061
+ }
2062
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutPageService, deps: [{ token: i1$1._HttpClient }, { token: i2$1.ActivatedRoute }, { token: i3$1.CommAPIService }], target: i0.ɵɵFactoryTarget.Directive });
2063
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: LayoutPageService, isStandalone: true, ngImport: i0 });
2064
+ }
2065
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: LayoutPageService, decorators: [{
2066
+ type: Directive
2067
+ }], ctorParameters: () => [{ type: i1$1._HttpClient }, { type: i2$1.ActivatedRoute }, { type: i3$1.CommAPIService }] });
2068
+
2069
+ class ListService {
2070
+ commAPISrv;
2071
+ constructor(commAPISrv) {
2072
+ this.commAPISrv = commAPISrv;
2073
+ }
2074
+ /**
2075
+ * 获取 表格 Header
2076
+ * @param e
2077
+ * @returns
2078
+ */
2079
+ getHeaderData(e) {
2080
+ let result = [];
2081
+ result = e.listHeader.map((element) => {
2082
+ let item = {
2083
+ key: element.key,
2084
+ label: element.label,
2085
+ type: element.type,
2086
+ auto: element.widthAuto,
2087
+ width: element.width,
2088
+ hide: element.hide,
2089
+ layoutId: element.layoutId,
2090
+ layoutType: element.layoutType,
2091
+ izFieldDesc: element.izFieldDesc,
2092
+ explain: element.explain,
2093
+ fieldClick: element.fieldClick,
2094
+ fieldArg: element.fieldArg,
2095
+ styles: element.styles,
2096
+ stylesName: element.stylesName,
2097
+ unit: element.unit,
2098
+ unitExplain: element.unitExplain,
2099
+ };
2100
+ if (element.sortShow == true) {
2101
+ item['sort'] = {
2102
+ show: true,
2103
+ field: element.sortField,
2104
+ };
2105
+ }
2106
+ return item;
2107
+ });
2108
+ return result;
2109
+ }
2110
+ /**
2111
+ * 获取 快捷搜索
2112
+ * @param e
2113
+ * @returns
2114
+ */
2115
+ getQuickData(e) {
2116
+ let result = null;
2117
+ if (e.listQuick && e.listQuick.length > 0) {
2118
+ result = {};
2119
+ e.listQuick.forEach((element) => {
2120
+ result[element.key] = {
2121
+ label: element.label,
2122
+ type: element.type,
2123
+ selectType: element.selectType,
2124
+ selected: element.selected,
2125
+ options: element.options,
2126
+ format: element?.format,
2127
+ izBetween: element?.izBetween,
2128
+ };
2129
+ });
2130
+ }
2131
+ return result;
2132
+ }
2133
+ /**
2134
+ * 获取 列表外部 按钮
2135
+ * @param e
2136
+ * @returns
2137
+ */
2138
+ getOuterButtonData(e) {
2139
+ let result = [];
2140
+ if (e.listButton && e.listButton.length > 0) {
2141
+ let listButton = e.listButton.filter((v) => {
2142
+ return v.buttonPosition == 'OUTER';
2143
+ });
2144
+ if (listButton && listButton.length > 0) {
2145
+ result = listButton.map((item) => {
2146
+ let api = {};
2147
+ switch (item?.buttonType) {
2148
+ case 'ADD':
2149
+ if (item.saveApiAddress) {
2150
+ api['addAPI'] = item.saveApiAddress;
2151
+ }
2152
+ else {
2153
+ api['addAPI'] = this.commAPISrv.getFormAdd(e.basic.moduleCode);
2154
+ }
2155
+ break;
2156
+ case 'DELETES':
2157
+ api['deletesAPI'] = this.commAPISrv.getPageDeletes(e.basic.moduleCode);
2158
+ break;
2159
+ case 'DISABLED':
2160
+ api['disablesAPI'] = this.commAPISrv.getPageDisables(e.basic.moduleCode);
2161
+ break;
2162
+ case 'ENABLE':
2163
+ api['disablesAPI'] = this.commAPISrv.getPageDisables(e.basic.moduleCode);
2164
+ break;
2165
+ default:
2166
+ break;
2167
+ }
2168
+ return {
2169
+ custom: true,
2170
+ id: item?.id,
2171
+ code: item.code,
2172
+ roleCode: item.roleCode,
2173
+ moduleCode: e.basic.moduleCode,
2174
+ isPreEventRule: item?.isPreEventRule,
2175
+ name: item.name,
2176
+ throw: item.izThrow,
2177
+ fixed: item.izFixed,
2178
+ fixedUrl: item.fixedUrl,
2179
+ izEmp: item.izEmp,
2180
+ izRole: item?.izRole == false ? false : true,
2181
+ tips: item?.tips,
2182
+ buttonType: item.buttonType,
2183
+ responseType: item.responseType,
2184
+ responseMode: item.responseMode,
2185
+ responseId: item.responseId,
2186
+ responseName: item.responseName,
2187
+ responseArgType: item?.responseArgType,
2188
+ arg: item.listArg,
2189
+ api: api,
2190
+ };
2191
+ });
2192
+ }
2193
+ }
2194
+ return result;
2195
+ }
2196
+ /**
2197
+ * 获取 列表内部 按钮
2198
+ * @param e
2199
+ * @returns
2200
+ */
2201
+ getInnerButtonData(e) {
2202
+ let result = null;
2203
+ if (e.listButton && e.listButton.length > 0) {
2204
+ let listButton = e.listButton.filter((v) => {
2205
+ return v.buttonPosition == 'INNER';
2206
+ });
2207
+ if (listButton && listButton.length > 0) {
2208
+ result = {};
2209
+ listButton.forEach((item) => {
2210
+ let api = {};
2211
+ switch (item?.buttonType) {
2212
+ case 'VIEW':
2213
+ if (item.getApiAddress) {
2214
+ api['modelAPI'] = item.getApiAddress;
2215
+ }
2216
+ else {
2217
+ api['modelAPI'] = this.commAPISrv.getFormModel(e.basic.moduleCode);
2218
+ }
2219
+ break;
2220
+ case 'EDIT':
2221
+ /**
2222
+ * 查看
2223
+ */
2224
+ if (item.getApiAddress) {
2225
+ api['modelAPI'] = item.getApiAddress;
2226
+ }
2227
+ else {
2228
+ api['modelAPI'] = this.commAPISrv.getFormModel(e.basic.moduleCode);
2229
+ }
2230
+ /**
2231
+ * 保存
2232
+ */
2233
+ if (item.saveApiAddress) {
2234
+ api['editAPI'] = item.saveApiAddress;
2235
+ }
2236
+ else {
2237
+ api['editAPI'] = this.commAPISrv.getFormUpdate(e.basic.moduleCode);
2238
+ }
2239
+ break;
2240
+ case 'CANCEL':
2241
+ if (item.saveApiAddress) {
2242
+ api['cancelAPI'] = item.saveApiAddress;
2243
+ }
2244
+ else {
2245
+ api['cancelAPI'] = this.commAPISrv.getPageCancel(e.basic.moduleCode);
2246
+ }
2247
+ break;
2248
+ case 'DELETE':
2249
+ if (item.saveApiAddress) {
2250
+ api['deleteAPI'] = item.saveApiAddress;
2251
+ }
2252
+ else {
2253
+ api['deleteAPI'] = this.commAPISrv.getPageDelete(e.basic.moduleCode);
2254
+ }
2255
+ break;
2256
+ case 'DISABLED':
2257
+ if (item.saveApiAddress) {
2258
+ api['disableAPI'] = item.saveApiAddress;
2259
+ }
2260
+ else {
2261
+ api['disableAPI'] = this.commAPISrv.getPageDisable(e.basic.moduleCode);
2262
+ }
2263
+ break;
2264
+ case 'ENABLE':
2265
+ if (item.saveApiAddress) {
2266
+ api['disableAPI'] = item.saveApiAddress;
2267
+ }
2268
+ else {
2269
+ api['disableAPI'] = this.commAPISrv.getPageDisable(e.basic.moduleCode);
2270
+ }
2271
+ break;
2272
+ case 'HISTORY':
2273
+ if (item.historyApiAddress) {
2274
+ api['historyAPI'] = item.historyApiAddress;
2275
+ }
2276
+ else {
2277
+ api['historyAPI'] = this.commAPISrv.getPageHistory(e.basic.moduleCode);
2278
+ }
2279
+ break;
2280
+ case 'COPY':
2281
+ if (item.copyApiAddress) {
2282
+ api['copyAPI'] = item.copyApiAddress;
2283
+ }
2284
+ else {
2285
+ if (item.saveApiAddress) {
2286
+ api['copyAPI'] = item.saveApiAddress;
2287
+ }
2288
+ else {
2289
+ api['copyAPI'] = this.commAPISrv.getPageCopy(e.basic.moduleCode);
2290
+ }
2291
+ }
2292
+ break;
2293
+ default:
2294
+ if (item.getApiAddress) {
2295
+ api['modelAPI'] = item.getApiAddress;
2296
+ }
2297
+ if (item.saveApiAddress) {
2298
+ api['editAPI'] = item.saveApiAddress;
2299
+ }
2300
+ break;
2301
+ }
2302
+ result[item.code] = {
2303
+ custom: true,
2304
+ id: item?.id,
2305
+ code: item.code,
2306
+ roleCode: item.roleCode,
2307
+ moduleCode: e.basic.moduleCode,
2308
+ isPreEventRule: item?.isPreEventRule,
2309
+ name: item.name,
2310
+ throw: item.izThrow,
2311
+ fixed: item.izFixed,
2312
+ fixedUrl: item.fixedUrl,
2313
+ izEmp: item.izEmp,
2314
+ tips: item?.tips,
2315
+ izRole: item?.izRole == false ? false : true,
2316
+ buttonType: item.buttonType,
2317
+ responseType: item.responseType,
2318
+ responseMode: item.responseMode,
2319
+ responseId: item.responseId,
2320
+ responseName: item.responseName,
2321
+ responseArgType: item?.responseArgType,
2322
+ arg: item.listArg,
2323
+ api: api,
2324
+ };
2325
+ });
2326
+ }
2327
+ }
2328
+ return result;
2329
+ }
2330
+ /**
2331
+ * 获取 列表内部 点击
2332
+ * @param e
2333
+ * @returns
2334
+ */
2335
+ getFieldButtonData(e) {
2336
+ let result = null;
2337
+ if (e.listHeader && e.listHeader.length > 0) {
2338
+ let listButton = e.listHeader.filter((v) => {
2339
+ return v.fieldClick == true && v.fieldArg;
2340
+ });
2341
+ if (listButton && listButton.length > 0) {
2342
+ result = {};
2343
+ listButton.forEach((item) => {
2344
+ let fieldArg = item.fieldArg;
2345
+ result[item.key] = {
2346
+ custom: true,
2347
+ id: item?.id,
2348
+ code: item.key,
2349
+ roleCode: null,
2350
+ moduleCode: e.basic.moduleCode,
2351
+ name: item.label,
2352
+ throw: fieldArg.izThrow,
2353
+ fixed: fieldArg?.izFixed,
2354
+ fixedUrl: fieldArg?.fixedUrl,
2355
+ izEmp: item.izEmp,
2356
+ tips: null,
2357
+ buttonType: fieldArg.buttonType,
2358
+ responseType: fieldArg.responseType,
2359
+ responseMode: fieldArg.responseMode,
2360
+ responseId: fieldArg.responseId,
2361
+ responseName: fieldArg.responseName,
2362
+ responseArgType: fieldArg?.responseArgType,
2363
+ arg: fieldArg.listArg,
2364
+ api: null,
2365
+ };
2366
+ });
2367
+ }
2368
+ }
2369
+ return result;
2370
+ }
2371
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ListService, deps: [{ token: i3$1.CommAPIService }], target: i0.ɵɵFactoryTarget.Injectable });
2372
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ListService });
2373
+ }
2374
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ListService, decorators: [{
2375
+ type: Injectable
2376
+ }], ctorParameters: () => [{ type: i3$1.CommAPIService }] });
2377
+
2378
+ function _window() {
2379
+ return window;
2380
+ }
2381
+ class GramWindowService {
2382
+ platformId;
2383
+ constructor(platformId) {
2384
+ this.platformId = platformId;
2385
+ }
2386
+ get nativeWindow() {
2387
+ if (isPlatformBrowser(this.platformId)) {
2388
+ return _window();
2389
+ }
2390
+ }
2391
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramWindowService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
2392
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramWindowService, providedIn: 'root' });
2393
+ }
2394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: GramWindowService, decorators: [{
2395
+ type: Injectable,
2396
+ args: [{ providedIn: 'root' }]
2397
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
2398
+ type: Inject,
2399
+ args: [PLATFORM_ID]
2400
+ }] }] });
2401
+
2402
+ class FieldSourceService {
2403
+ /**
2404
+ * 获取默认字段
2405
+ * @param type
2406
+ * @returns
2407
+ */
2408
+ fieldSourceType(source, layout) {
2409
+ let field = {};
2410
+ switch (source.type) {
2411
+ case 'TEXT':
2412
+ field = this.text(source, layout);
2413
+ break;
2414
+ case 'COLOR':
2415
+ field = this.color(source, layout);
2416
+ break;
2417
+ case 'ICON':
2418
+ field = this.icon(source, layout);
2419
+ break;
2420
+ case 'TEXTAREA':
2421
+ field = this.textArea(source, layout);
2422
+ break;
2423
+ case 'INT':
2424
+ field = this.number(source, 0, layout);
2425
+ break;
2426
+ case 'FLOAT':
2427
+ field = this.number(source, source.precision, layout);
2428
+ break;
2429
+ case 'DATETIME':
2430
+ field = this.datetime(source, layout);
2431
+ break;
2432
+ case 'BOOLEAN':
2433
+ field = this.fieldBoolean(source, layout);
2434
+ break;
2435
+ case 'ITEM':
2436
+ field = this.select(source, layout);
2437
+ break;
2438
+ case 'MULTIPLE':
2439
+ field = this.repeat(source, layout);
2440
+ break;
2441
+ case 'TREE':
2442
+ field = this.tree(source, layout);
2443
+ break;
2444
+ case 'REF':
2445
+ field = this.lookup(source, layout);
2446
+ break;
2447
+ case 'ONETOMANY':
2448
+ field = this.lookupMany(source, layout);
2449
+ break;
2450
+ case 'ATTACHMENT':
2451
+ field = this.upload(source, layout);
2452
+ break;
2453
+ case 'INDICATOR':
2454
+ field = this.indicator(source, layout);
2455
+ break;
2456
+ default:
2457
+ break;
2458
+ }
2459
+ return field;
2460
+ }
2461
+ /**
2462
+ * 单行文本
2463
+ * @param field
2464
+ * @returns
2465
+ */
2466
+ text(field, layout) {
2467
+ let sysType = null;
2468
+ if (field.code == 'create_user' || field.code == 'modify_user') {
2469
+ sysType = field.code.toUpperCase();
2470
+ }
2471
+ let config = {
2472
+ type: 'text',
2473
+ key: field.id,
2474
+ defaultValue: null,
2475
+ props: {
2476
+ type: null,
2477
+ sysType: sysType,
2478
+ izSysName: false,
2479
+ label: field.name,
2480
+ required: field?.required == true ? true : false,
2481
+ maxLength: field.maxLength,
2482
+ minLength: null,
2483
+ placeholder: `请输入${field.name}`,
2484
+ layout: layout ? layout : 'default',
2485
+ },
2486
+ };
2487
+ if (field.izCodeRule && field.codeRuleId) {
2488
+ config = {
2489
+ type: 'textcode',
2490
+ key: field.id,
2491
+ defaultValue: null,
2492
+ props: {
2493
+ label: field.name,
2494
+ required: field?.required == true ? true : false,
2495
+ maxLength: field.maxLength,
2496
+ minLength: null,
2497
+ placeholder: `请输入${field.name}`,
2498
+ layout: layout ? layout : 'default',
2499
+ },
2500
+ };
2501
+ }
2502
+ return config;
2503
+ }
2504
+ color(field, layout) {
2505
+ let config = {
2506
+ type: 'color',
2507
+ key: field.id,
2508
+ defaultValue: null,
2509
+ props: {
2510
+ label: field.name,
2511
+ required: field?.required == true ? true : false,
2512
+ layout: layout ? layout : 'default',
2513
+ },
2514
+ };
2515
+ return config;
2516
+ }
2517
+ icon(field, layout) {
2518
+ let config = {
2519
+ type: 'icon',
2520
+ key: field.id,
2521
+ defaultValue: null,
2522
+ props: {
2523
+ label: field.name,
2524
+ required: field?.required == true ? true : false,
2525
+ layout: layout ? layout : 'default',
2526
+ },
2527
+ };
2528
+ return config;
2529
+ }
2530
+ /**
2531
+ * 多行文本
2532
+ * @param field
2533
+ * @returns
2534
+ */
2535
+ textArea(field, layout) {
2536
+ let config = {
2537
+ type: 'textarea',
2538
+ key: field.id,
2539
+ defaultValue: null,
2540
+ props: {
2541
+ label: field.name,
2542
+ required: field?.required == true ? true : false,
2543
+ maxLength: field.maxLength,
2544
+ minLength: field.minLength,
2545
+ placeholder: `请输入${field.name}`,
2546
+ rows: 3,
2547
+ layout: layout ? layout : 'default',
2548
+ },
2549
+ };
2550
+ return config;
2551
+ }
2552
+ /**
2553
+ * 整数、小数 类型
2554
+ * @param field
2555
+ * @param precision
2556
+ * @returns
2557
+ */
2558
+ number(field, precision, layout) {
2559
+ let config = {
2560
+ type: 'number',
2561
+ key: field.id,
2562
+ defaultValue: null,
2563
+ props: {
2564
+ label: field.name,
2565
+ required: field?.required == true ? true : false,
2566
+ max: field.max,
2567
+ min: field.min,
2568
+ placeholder: `请输入${field.name}`,
2569
+ precision: precision,
2570
+ layout: layout ? layout : 'default',
2571
+ },
2572
+ };
2573
+ return config;
2574
+ }
2575
+ /**
2576
+ * 日期型
2577
+ * @param field
2578
+ * @returns
2579
+ */
2580
+ datetime(field, layout) {
2581
+ let config = {
2582
+ type: 'datetime',
2583
+ key: field.id,
2584
+ defaultValue: null,
2585
+ props: {
2586
+ type: 'datetime',
2587
+ label: field.name,
2588
+ required: field?.required == true ? true : false,
2589
+ layout: layout ? layout : 'default',
2590
+ },
2591
+ };
2592
+ return config;
2593
+ }
2594
+ /**
2595
+ * 布尔值
2596
+ * @param field
2597
+ * @returns
2598
+ */
2599
+ fieldBoolean(field, layout) {
2600
+ let config = {
2601
+ type: 'radiogroup',
2602
+ key: field.id,
2603
+ defaultValue: true,
2604
+ props: {
2605
+ type: 'default',
2606
+ label: field.name,
2607
+ options: [
2608
+ { label: '是', value: true },
2609
+ { label: '否', value: false },
2610
+ ],
2611
+ required: field?.required == true ? true : false,
2612
+ sourceType: 'boolean',
2613
+ layout: layout ? layout : 'default',
2614
+ },
2615
+ };
2616
+ return config;
2617
+ }
2618
+ /**
2619
+ * 选择
2620
+ * @param field
2621
+ * @returns
2622
+ */
2623
+ select(field, layout) {
2624
+ let config = {
2625
+ type: 'select',
2626
+ key: field.id,
2627
+ defaultValue: null,
2628
+ props: {
2629
+ label: field.name,
2630
+ required: field?.required == true ? true : false,
2631
+ options: [],
2632
+ placeholder: `请选择${field.name}`,
2633
+ selectType: field?.multiple == true ? 'multiple' : 'single',
2634
+ layout: layout ? layout : 'default',
2635
+ },
2636
+ };
2637
+ return config;
2638
+ }
2639
+ /**
2640
+ * 子表单
2641
+ * @param field
2642
+ * @returns
2643
+ */
2644
+ repeat(field, layout) {
2645
+ let config = {
2646
+ type: 'repeat',
2647
+ key: field.id,
2648
+ props: {
2649
+ type: 'default',
2650
+ label: field.name,
2651
+ },
2652
+ fieldArray: {
2653
+ fieldGroup: [],
2654
+ },
2655
+ };
2656
+ return config;
2657
+ }
2658
+ tree(field, layout) {
2659
+ let config = {
2660
+ type: 'tree',
2661
+ key: field.id,
2662
+ defaultValue: null,
2663
+ props: {
2664
+ label: field.name,
2665
+ treeId: field.refId,
2666
+ required: field?.required == true ? true : false,
2667
+ placeholder: `请选择${field.name}`,
2668
+ selectType: field?.multiple == true ? 'multiple' : 'single',
2669
+ layout: layout ? layout : 'default',
2670
+ },
2671
+ };
2672
+ return config;
2673
+ }
2674
+ lookup(field, layout) {
2675
+ let config = {
2676
+ type: 'lookup',
2677
+ key: field.id,
2678
+ defaultValue: null,
2679
+ props: {
2680
+ label: field.name,
2681
+ required: field?.required == true ? true : false,
2682
+ placeholder: `请选择${field.name}`,
2683
+ selectType: field?.multiple == true ? 'multiple' : 'single',
2684
+ layout: layout ? layout : 'default',
2685
+ },
2686
+ };
2687
+ return config;
2688
+ }
2689
+ lookupMany(field, layout) {
2690
+ let config = {
2691
+ type: 'one2many',
2692
+ key: field.id,
2693
+ defaultValue: null,
2694
+ props: {
2695
+ label: field.name,
2696
+ required: field?.required == true ? true : false,
2697
+ placeholder: `请选择${field.name}`,
2698
+ selectType: 'multiple',
2699
+ layout: layout ? layout : 'default',
2700
+ },
2701
+ };
2702
+ return config;
2703
+ }
2704
+ /**
2705
+ * 附件 类型
2706
+ * @param field
2707
+ * @param precision
2708
+ * @returns
2709
+ */
2710
+ upload(field, layout) {
2711
+ let config = {
2712
+ type: 'upload',
2713
+ key: field.id,
2714
+ defaultValue: null,
2715
+ props: {
2716
+ label: field.name,
2717
+ required: field?.required == true ? true : false,
2718
+ placeholder: `请上传${field.name}`,
2719
+ layout: layout ? layout : 'default',
2720
+ },
2721
+ };
2722
+ if (field?.max != undefined && field?.max != null && field?.max > 0) {
2723
+ config.props['max'] = field.max;
2724
+ }
2725
+ return config;
2726
+ }
2727
+ indicator(field, layout) {
2728
+ let indTypeValue = 'KPI';
2729
+ let evalTypeValue = 'SCORE';
2730
+ if (field?.indType) {
2731
+ indTypeValue = field.indType;
2732
+ }
2733
+ if (field?.evalType) {
2734
+ evalTypeValue = field.evalType;
2735
+ }
2736
+ let group = [
2737
+ {
2738
+ key: `name`,
2739
+ type: 'text',
2740
+ props: {
2741
+ label: '指标名称',
2742
+ placeholder: `请输入指标名称`,
2743
+ required: true,
2744
+ minLength: 0,
2745
+ maxLength: 500,
2746
+ layout: 'default',
2747
+ },
2748
+ className: 'full-row',
2749
+ defaultValue: field?.name,
2750
+ },
2751
+ {
2752
+ key: `desc`,
2753
+ type: 'textarea',
2754
+ props: {
2755
+ label: '指标描述',
2756
+ placeholder: `请输入指标描述`,
2757
+ required: false,
2758
+ minLength: 0,
2759
+ maxLength: 800,
2760
+ rows: 3,
2761
+ layout: 'default',
2762
+ },
2763
+ defaultValue: field?.description,
2764
+ },
2765
+ {
2766
+ key: `indType`,
2767
+ type: 'select',
2768
+ props: {
2769
+ label: '指标类型',
2770
+ placeholder: `请选择指标类型`,
2771
+ required: false,
2772
+ layout: 'default',
2773
+ options: IndicatorType(),
2774
+ },
2775
+ editor: false,
2776
+ defaultValue: indTypeValue,
2777
+ },
2778
+ {
2779
+ key: `evalType`,
2780
+ type: 'select',
2781
+ props: {
2782
+ label: '评估方式',
2783
+ placeholder: `请选择评估方式`,
2784
+ required: false,
2785
+ layout: 'default',
2786
+ options: EvalType(),
2787
+ },
2788
+ editor: false,
2789
+ defaultValue: evalTypeValue,
2790
+ },
2791
+ ];
2792
+ if (field?.indType) {
2793
+ switch (field.indType) {
2794
+ case 'KPI':
2795
+ group.push({
2796
+ key: `weight`,
2797
+ type: 'number',
2798
+ props: {
2799
+ label: '指标权重',
2800
+ placeholder: `请输入指标权重`,
2801
+ required: true,
2802
+ min: -100,
2803
+ max: 300,
2804
+ layout: 'default',
2805
+ unit: '%',
2806
+ },
2807
+ defaultValue: 10,
2808
+ });
2809
+ break;
2810
+ }
2811
+ }
2812
+ if (field?.listItem && Array.isArray(field?.listItem)) {
2813
+ field.listItem.forEach((item) => {
2814
+ item.id = `item_${item.id}`;
2815
+ let newItem = this.fieldSourceType(item);
2816
+ if (newItem) {
2817
+ group.push(newItem);
2818
+ }
2819
+ });
2820
+ }
2821
+ let config = {
2822
+ type: 'indicator',
2823
+ key: `ind_${field.id}`,
2824
+ defaultValue: null,
2825
+ props: {
2826
+ indConfig: {
2827
+ sourceId: field.id,
2828
+ sourceType: 'LIBRARY',
2829
+ izAllowDel: true,
2830
+ izEditName: true,
2831
+ izEditDesc: true,
2832
+ izEditWeight: true,
2833
+ },
2834
+ },
2835
+ fieldGroup: group,
2836
+ };
2837
+ return config;
2838
+ }
2839
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldSourceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2840
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldSourceService });
2841
+ }
2842
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: FieldSourceService, decorators: [{
2843
+ type: Injectable
2844
+ }] });
2845
+
2846
+ //export * from "./commApi.service";
2847
+
2848
+ /**
2849
+ * Generated bundle index. Do not edit.
2850
+ */
2851
+
2852
+ export { BasePageService, DeonDesignFieldInitService, DeonFormResetService, DeonFormUtilService, FieldSourceService, GramBaseDialogService, GramBaseListService, GramBaseTableService, GramBaseTitleService, GramBaseTreeService, GramGlobalService, GramWindowService, LayoutDetailPageService, LayoutPageService, ListService, PRE_DIALOG_HANDLER };
2853
+ //# sourceMappingURL=shared.srv.mjs.map