@arkxos/arkos-system 0.1.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 (494) hide show
  1. package/README.md +36 -0
  2. package/ark_dist/664d11f069eab128.css +2 -0
  3. package/ark_dist/ArkOsConfig.js +136 -0
  4. package/ark_dist/ark-meta.json +92 -0
  5. package/ark_dist/ark_userChunk_1.js +3 -0
  6. package/ark_dist/ark_userChunk_2.js +5 -0
  7. package/ark_dist/ark_userChunk_3.js +49 -0
  8. package/ark_dist/config.js +75 -0
  9. package/ark_dist/css/views/views-flow-flow.ca26b106.css +5784 -0
  10. package/ark_dist/favicon.ico +0 -0
  11. package/ark_dist/fonts/bpmn.5d33bee4.eot +0 -0
  12. package/ark_dist/fonts/bpmn.67058807.woff2 +0 -0
  13. package/ark_dist/fonts/bpmn.b5c9250d.ttf +0 -0
  14. package/ark_dist/fonts/bpmn.e9e7d076.woff +0 -0
  15. package/ark_dist/img/404.png +0 -0
  16. package/ark_dist/img/auth_banner.jpg +0 -0
  17. package/ark_dist/img/avatar.jpg +0 -0
  18. package/ark_dist/img/avatar2.gif +0 -0
  19. package/ark_dist/img/avatar3.gif +0 -0
  20. package/ark_dist/img/bpmn.74eea12b.svg +224 -0
  21. package/ark_dist/img/loginbg.svg +1 -0
  22. package/ark_dist/img/logo-r.png +0 -0
  23. package/ark_dist/img/logo.png +0 -0
  24. package/ark_dist/img/mobile-bg.d055fadc.png +0 -0
  25. package/ark_dist/img/no-widgets.svg +57 -0
  26. package/ark_dist/img/tasks-example.png +0 -0
  27. package/ark_dist/img/ver.svg +236 -0
  28. package/ark_dist/index.html +118 -0
  29. package/ark_dist/js/app.e39a548a.js +1 -0
  30. package/ark_dist/js/views/views-flow-flow.84dc5300.js +3 -0
  31. package/ark_dist/js/views/views-flow-flow.84dc5300.js.LICENSE.txt +182 -0
  32. package/ark_dist/js/views/views-flow-flow.84dc5300.js.map +1 -0
  33. package/ark_proxy/entry.js +28 -0
  34. package/ark_proxy_es/entry.js +16 -0
  35. package/package.json +173 -0
  36. package/scripts/check.js +13 -0
  37. package/scripts/meta.js +21 -0
  38. package/scripts/prepublishOnly.js +28 -0
  39. package/src/admin/App.vue +13 -0
  40. package/src/admin/bpmn/custom/context-pad.js +405 -0
  41. package/src/admin/bpmn/custom/index.js +8 -0
  42. package/src/admin/bpmn/custom/palette.js +159 -0
  43. package/src/admin/bpmn/properties-panel/PropertiesView.vue +620 -0
  44. package/src/admin/bpmn/translate.js +23 -0
  45. package/src/admin/bpmn/translations.js +211 -0
  46. package/src/admin/components/affix/index.vue +385 -0
  47. package/src/admin/components/area-select/index.vue +52 -0
  48. package/src/admin/components/buttons/index.vue +47 -0
  49. package/src/admin/components/checkbox/index.vue +83 -0
  50. package/src/admin/components/code/code.js +149 -0
  51. package/src/admin/components/code/index.vue +450 -0
  52. package/src/admin/components/color/index.vue +30 -0
  53. package/src/admin/components/color-picker/index.vue +57 -0
  54. package/src/admin/components/color-scheme/index.vue +234 -0
  55. package/src/admin/components/condition-list/index.vue +170 -0
  56. package/src/admin/components/date/index.vue +29 -0
  57. package/src/admin/components/datetime/index.vue +45 -0
  58. package/src/admin/components/default-value-tips/index.vue +44 -0
  59. package/src/admin/components/dict-buttons/index.vue +53 -0
  60. package/src/admin/components/dict-checkbox/index.vue +45 -0
  61. package/src/admin/components/dict-radio/index.vue +68 -0
  62. package/src/admin/components/dict-select/index.vue +93 -0
  63. package/src/admin/components/dict-selects/index.vue +105 -0
  64. package/src/admin/components/dict-switch/index.vue +64 -0
  65. package/src/admin/components/dict-tree/index.vue +17 -0
  66. package/src/admin/components/dm-tree/index.vue +224 -0
  67. package/src/admin/components/edit-table/index.vue +171 -0
  68. package/src/admin/components/employee-tree/index.vue +247 -0
  69. package/src/admin/components/employees-tree/index.vue +80 -0
  70. package/src/admin/components/entp-tree/index.vue +266 -0
  71. package/src/admin/components/file/index.vue +310 -0
  72. package/src/admin/components/form/index.vue +141 -0
  73. package/src/admin/components/icon/index.vue +77 -0
  74. package/src/admin/components/icon-buttons/index.vue +52 -0
  75. package/src/admin/components/icon-select/index.vue +140 -0
  76. package/src/admin/components/image/index.vue +207 -0
  77. package/src/admin/components/index.js +16 -0
  78. package/src/admin/components/input/index.vue +41 -0
  79. package/src/admin/components/local-img/index.vue +49 -0
  80. package/src/admin/components/multiple-input/index.vue +64 -0
  81. package/src/admin/components/multiple-number/index.vue +70 -0
  82. package/src/admin/components/number/index.vue +134 -0
  83. package/src/admin/components/organization/index.vue +303 -0
  84. package/src/admin/components/organization-tree/index.vue +269 -0
  85. package/src/admin/components/page/index.vue +149 -0
  86. package/src/admin/components/password/index.vue +21 -0
  87. package/src/admin/components/radio/index.vue +46 -0
  88. package/src/admin/components/region-tree/index.vue +269 -0
  89. package/src/admin/components/remote-select/index.vue +315 -0
  90. package/src/admin/components/rich-editor/index.vue +152 -0
  91. package/src/admin/components/role-select/index.vue +58 -0
  92. package/src/admin/components/script-input/index.vue +97 -0
  93. package/src/admin/components/select/index.vue +105 -0
  94. package/src/admin/components/selects/index.vue +100 -0
  95. package/src/admin/components/style-list/index.vue +500 -0
  96. package/src/admin/components/switch/index.vue +54 -0
  97. package/src/admin/components/table/index.vue +920 -0
  98. package/src/admin/components/textarea/index.vue +28 -0
  99. package/src/admin/components/tree/index.vue +247 -0
  100. package/src/admin/components/tree-selects/index.vue +66 -0
  101. package/src/admin/components/unit-tree/index.vue +269 -0
  102. package/src/admin/console/index.vue +122 -0
  103. package/src/admin/layout/console/index.vue +15 -0
  104. package/src/admin/layout/fullscreen/index.vue +32 -0
  105. package/src/admin/layout/home/index.vue +11 -0
  106. package/src/admin/layout/index.vue +139 -0
  107. package/src/admin/layout/menu/index.vue +102 -0
  108. package/src/admin/layout/personnel/index.vue +166 -0
  109. package/src/admin/layout/search/index.vue +78 -0
  110. package/src/admin/main.js +30 -0
  111. package/src/admin/pinia/router.js +179 -0
  112. package/src/admin/router.js +91 -0
  113. package/src/admin/visual/comp-data.vue +1107 -0
  114. package/src/admin/visual/comp-event.vue +1677 -0
  115. package/src/admin/visual/components/app/list/goods/double.vue +184 -0
  116. package/src/admin/visual/components/app/list/nav/image.vue +114 -0
  117. package/src/admin/visual/components/app/list/nav/text.vue +130 -0
  118. package/src/admin/visual/components/button/index.vue +58 -0
  119. package/src/admin/visual/components/container/index.vue +37 -0
  120. package/src/admin/visual/components/custom-list/index.vue +127 -0
  121. package/src/admin/visual/components/data/index.vue +46 -0
  122. package/src/admin/visual/components/data-table/index.vue +203 -0
  123. package/src/admin/visual/components/echarts/annular.vue +140 -0
  124. package/src/admin/visual/components/echarts/bar.vue +115 -0
  125. package/src/admin/visual/components/echarts/funnel.vue +115 -0
  126. package/src/admin/visual/components/echarts/gauge.vue +158 -0
  127. package/src/admin/visual/components/echarts/line.vue +110 -0
  128. package/src/admin/visual/components/echarts/map.vue +150 -0
  129. package/src/admin/visual/components/echarts/pie.vue +114 -0
  130. package/src/admin/visual/components/echarts/radar.vue +145 -0
  131. package/src/admin/visual/components/echarts/scatter.vue +106 -0
  132. package/src/admin/visual/components/edit-table/index.vue +71 -0
  133. package/src/admin/visual/components/form/affix.vue +107 -0
  134. package/src/admin/visual/components/form/area.vue +76 -0
  135. package/src/admin/visual/components/form/buttons.vue +90 -0
  136. package/src/admin/visual/components/form/checkbox.vue +85 -0
  137. package/src/admin/visual/components/form/date-range.vue +61 -0
  138. package/src/admin/visual/components/form/date.vue +59 -0
  139. package/src/admin/visual/components/form/datetime.vue +59 -0
  140. package/src/admin/visual/components/form/employee-tree.vue +88 -0
  141. package/src/admin/visual/components/form/employees-tree.vue +6 -0
  142. package/src/admin/visual/components/form/image.vue +103 -0
  143. package/src/admin/visual/components/form/index.vue +59 -0
  144. package/src/admin/visual/components/form/input.vue +84 -0
  145. package/src/admin/visual/components/form/item.vue +68 -0
  146. package/src/admin/visual/components/form/number.vue +130 -0
  147. package/src/admin/visual/components/form/organization-tree.vue +88 -0
  148. package/src/admin/visual/components/form/password.vue +74 -0
  149. package/src/admin/visual/components/form/radio.vue +87 -0
  150. package/src/admin/visual/components/form/rate.vue +66 -0
  151. package/src/admin/visual/components/form/region-tree.vue +88 -0
  152. package/src/admin/visual/components/form/rich-editor.vue +94 -0
  153. package/src/admin/visual/components/form/select.vue +156 -0
  154. package/src/admin/visual/components/form/switch.vue +85 -0
  155. package/src/admin/visual/components/form/textarea.vue +62 -0
  156. package/src/admin/visual/components/form/unit-tree.vue +88 -0
  157. package/src/admin/visual/components/icon/index.vue +65 -0
  158. package/src/admin/visual/components/image/index.vue +170 -0
  159. package/src/admin/visual/components/index.js +44 -0
  160. package/src/admin/visual/components/list/block.vue +160 -0
  161. package/src/admin/visual/components/list/button.vue +80 -0
  162. package/src/admin/visual/components/list/card.vue +101 -0
  163. package/src/admin/visual/components/list/custom.vue +150 -0
  164. package/src/admin/visual/components/list/image.vue +116 -0
  165. package/src/admin/visual/components/list/news.vue +138 -0
  166. package/src/admin/visual/components/page/index.vue +88 -0
  167. package/src/admin/visual/components/page-comp/index.vue +110 -0
  168. package/src/admin/visual/components/portal-menu/index.vue +92 -0
  169. package/src/admin/visual/components/qrcode/index.vue +77 -0
  170. package/src/admin/visual/components/router-view/index.vue +12 -0
  171. package/src/admin/visual/components/row/index.vue +139 -0
  172. package/src/admin/visual/components/search/index.vue +40 -0
  173. package/src/admin/visual/components/tabs/index.vue +125 -0
  174. package/src/admin/visual/components/text/index.vue +64 -0
  175. package/src/admin/visual/components/video/index.vue +41 -0
  176. package/src/admin/visual/draggable.vue +49 -0
  177. package/src/admin/visual/editor.vue +602 -0
  178. package/src/admin/visual/js/app-form.config.js +1301 -0
  179. package/src/admin/visual/js/app.config.js +86 -0
  180. package/src/admin/visual/js/common.config.js +687 -0
  181. package/src/admin/visual/js/component.config.js +741 -0
  182. package/src/admin/visual/js/echarts.config.js +2440 -0
  183. package/src/admin/visual/js/form.config.js +2837 -0
  184. package/src/admin/visual/js/list.config.js +578 -0
  185. package/src/admin/visual/js/menu.config.js +62 -0
  186. package/src/admin/visual/js/visual-comp.js +48 -0
  187. package/src/admin/visual/tool.vue +1223 -0
  188. package/src/assets/images/background.jpg +0 -0
  189. package/src/assets/images/login-bg.jpg +0 -0
  190. package/src/assets/images/mobile-bg.png +0 -0
  191. package/src/assets/images/no-data.png +0 -0
  192. package/src/assets/style/base.css +48 -0
  193. package/src/assets/style/business.css +5 -0
  194. package/src/assets/style/code.css +36 -0
  195. package/src/assets/style/codeless.css +195 -0
  196. package/src/assets/style/flow.css +12 -0
  197. package/src/assets/style/global/blue.css +83 -0
  198. package/src/assets/style/global/default.css +71 -0
  199. package/src/assets/style/global/green.css +83 -0
  200. package/src/assets/style/global/purple.css +83 -0
  201. package/src/assets/style/global/red.css +83 -0
  202. package/src/assets/style/main.css +608 -0
  203. package/src/assets/style/menu/black.css +9 -0
  204. package/src/assets/style/menu/default.css +9 -0
  205. package/src/assets/style/menu/grey.css +9 -0
  206. package/src/assets/style/visual.css +204 -0
  207. package/src/auto-imports.d.ts +307 -0
  208. package/src/business/App.vue +131 -0
  209. package/src/business/components/dict-select/index.vue +88 -0
  210. package/src/business/components/index.js +13 -0
  211. package/src/business/components/input/index.vue +38 -0
  212. package/src/business/components/table/index.vue +928 -0
  213. package/src/business/home/index.vue +45 -0
  214. package/src/business/iframe/index.vue +63 -0
  215. package/src/business/layout/aside/history/history.vue +518 -0
  216. package/src/business/layout/aside/index.vue +116 -0
  217. package/src/business/layout/aside/menu/index.vue +47 -0
  218. package/src/business/layout/aside/menu/menuItem.vue +83 -0
  219. package/src/business/layout/aside/menu/submenu.vue +88 -0
  220. package/src/business/layout/fullscreen/index.vue +41 -0
  221. package/src/business/layout/header/index.vue +81 -0
  222. package/src/business/layout/header/menu/index.vue +47 -0
  223. package/src/business/layout/header/menu/menuItem.vue +43 -0
  224. package/src/business/layout/header/menu/submenu.vue +34 -0
  225. package/src/business/layout/home/index.vue +20 -0
  226. package/src/business/layout/index.vue +330 -0
  227. package/src/business/layout/message/index.vue +250 -0
  228. package/src/business/layout/personnel/index.vue +549 -0
  229. package/src/business/layout/search/index.vue +75 -0
  230. package/src/business/layout/subsystem/index.vue +124 -0
  231. package/src/business/main.js +36 -0
  232. package/src/business/pinia/menuBadge.js +58 -0
  233. package/src/business/pinia/router.js +190 -0
  234. package/src/business/router.js +98 -0
  235. package/src/choose/App.vue +203 -0
  236. package/src/choose/main.js +22 -0
  237. package/src/choose/router.js +33 -0
  238. package/src/codeless/components/affix/index.vue +393 -0
  239. package/src/codeless/components/affix-view/index.vue +244 -0
  240. package/src/codeless/components/buttons/index.vue +59 -0
  241. package/src/codeless/components/checkbox/index.vue +107 -0
  242. package/src/codeless/components/date/index.vue +105 -0
  243. package/src/codeless/components/datetime/index.vue +65 -0
  244. package/src/codeless/components/dialog-select/index.vue +170 -0
  245. package/src/codeless/components/dict-buttons/index.vue +97 -0
  246. package/src/codeless/components/dict-radio/index.vue +94 -0
  247. package/src/codeless/components/dict-select/index.vue +181 -0
  248. package/src/codeless/components/dict-selects/index.vue +145 -0
  249. package/src/codeless/components/dict-switch/index.vue +94 -0
  250. package/src/codeless/components/dict-tree/index.vue +116 -0
  251. package/src/codeless/components/edit-table/index.vue +160 -0
  252. package/src/codeless/components/employee-tree/index.vue +254 -0
  253. package/src/codeless/components/employees-tree/index.vue +87 -0
  254. package/src/codeless/components/entp-tree/index.vue +261 -0
  255. package/src/codeless/components/entps-tree/index.vue +93 -0
  256. package/src/codeless/components/icon/index.vue +65 -0
  257. package/src/codeless/components/image/index.vue +298 -0
  258. package/src/codeless/components/index.js +16 -0
  259. package/src/codeless/components/input/index.vue +63 -0
  260. package/src/codeless/components/number/index.vue +150 -0
  261. package/src/codeless/components/organization-tree/index.vue +262 -0
  262. package/src/codeless/components/organizations-tree/index.vue +79 -0
  263. package/src/codeless/components/password/index.vue +42 -0
  264. package/src/codeless/components/radio/index.vue +57 -0
  265. package/src/codeless/components/region-tree/index.vue +262 -0
  266. package/src/codeless/components/remote-distinct/index.vue +354 -0
  267. package/src/codeless/components/remote-select/index.vue +363 -0
  268. package/src/codeless/components/rich-editor/index.vue +159 -0
  269. package/src/codeless/components/roles/index.vue +68 -0
  270. package/src/codeless/components/select/index.vue +95 -0
  271. package/src/codeless/components/selects/index.vue +116 -0
  272. package/src/codeless/components/show-dict/index.vue +52 -0
  273. package/src/codeless/components/show-employees/index.vue +29 -0
  274. package/src/codeless/components/show-organizations/index.vue +29 -0
  275. package/src/codeless/components/show-roles/index.vue +45 -0
  276. package/src/codeless/components/signature-pad/index.vue +224 -0
  277. package/src/codeless/components/switch/index.vue +56 -0
  278. package/src/codeless/components/textarea/index.vue +37 -0
  279. package/src/codeless/components/tree/index.vue +244 -0
  280. package/src/codeless/components/unit-tree/index.vue +262 -0
  281. package/src/codeless/components/units-tree/index.vue +93 -0
  282. package/src/codeless/components/video/index.vue +255 -0
  283. package/src/codeless/components/video-view/index.vue +130 -0
  284. package/src/codeless/js/codeless.js +47 -0
  285. package/src/codeless/view/form-auto.vue +192 -0
  286. package/src/codeless/view/form-custom.vue +10 -0
  287. package/src/codeless/view/form-model.vue +421 -0
  288. package/src/codeless/view/form-query.vue +171 -0
  289. package/src/codeless/view/form.vue +575 -0
  290. package/src/codeless/view/page-comp.vue +1318 -0
  291. package/src/codeless/view/page.vue +280 -0
  292. package/src/codeless/view/table-edit-item.vue +184 -0
  293. package/src/codeless/view/table-edit.vue +490 -0
  294. package/src/codeless/view/table.vue +1606 -0
  295. package/src/codeless/view/tree.vue +431 -0
  296. package/src/configs/subApp.ts +9 -0
  297. package/src/directives/collapse/index.js +123 -0
  298. package/src/directives/drag/index.js +43 -0
  299. package/src/directives/index.js +9 -0
  300. package/src/directives/resize/index.js +23 -0
  301. package/src/entrance/libProperties.ts +24 -0
  302. package/src/entrance/libTypes.ts +26 -0
  303. package/src/error/404.vue +23 -0
  304. package/src/flow/chart.vue +130 -0
  305. package/src/flow/deal.vue +776 -0
  306. package/src/flow/signature.vue +216 -0
  307. package/src/flow/start.vue +18 -0
  308. package/src/http/api.js +192 -0
  309. package/src/http/request.js +81 -0
  310. package/src/login/App.vue +421 -0
  311. package/src/login/main.js +30 -0
  312. package/src/login/router.js +33 -0
  313. package/src/main.ts +20 -0
  314. package/src/mobile/App.vue +51 -0
  315. package/src/mobile/home/index.vue +34 -0
  316. package/src/mobile/main.js +26 -0
  317. package/src/mobile/router.js +101 -0
  318. package/src/mobile/view/page.vue +99 -0
  319. package/src/pinia/index.js +5 -0
  320. package/src/pinia/modules/dataField.js +77 -0
  321. package/src/pinia/modules/dataForm.js +46 -0
  322. package/src/pinia/modules/dataTable.js +46 -0
  323. package/src/pinia/modules/dictionary.js +66 -0
  324. package/src/pinia/modules/employee.js +46 -0
  325. package/src/pinia/modules/icon.js +46 -0
  326. package/src/pinia/modules/keepAlive.js +35 -0
  327. package/src/pinia/modules/organization.js +189 -0
  328. package/src/pinia/modules/page.js +46 -0
  329. package/src/pinia/modules/pageButton.js +44 -0
  330. package/src/pinia/modules/pageComp.js +46 -0
  331. package/src/pinia/modules/role.js +46 -0
  332. package/src/pinia/modules/setting.js +56 -0
  333. package/src/pinia/modules/subsystem.js +64 -0
  334. package/src/pinia/modules/user.js +177 -0
  335. package/src/plugins/index.ts +24 -0
  336. package/src/portal/App.vue +27 -0
  337. package/src/portal/home/index.vue +52 -0
  338. package/src/portal/main.js +31 -0
  339. package/src/portal/page/index.vue +39 -0
  340. package/src/portal/pinia/router.js +176 -0
  341. package/src/portal/router.js +86 -0
  342. package/src/router/constantRoutes.ts +13 -0
  343. package/src/router/loadComponent.ts +29 -0
  344. package/src/router/readme.txt +21 -0
  345. package/src/sso/sso.js +19 -0
  346. package/src/sso/sso.vue +138 -0
  347. package/src/types/axios.d.ts +13 -0
  348. package/src/types/func.ts +14 -0
  349. package/src/types/global.d.ts +108 -0
  350. package/src/types/layout.d.ts +59 -0
  351. package/src/types/mitt.d.ts +40 -0
  352. package/src/types/pinia.d.ts +93 -0
  353. package/src/types/views.d.ts +27 -0
  354. package/src/types/window.d.ts +8 -0
  355. package/src/utils/aes.js +75 -0
  356. package/src/utils/browser.js +13 -0
  357. package/src/utils/bus.js +4 -0
  358. package/src/utils/cache.js +6 -0
  359. package/src/utils/codeless.js +92 -0
  360. package/src/utils/color.js +274 -0
  361. package/src/utils/date.js +180 -0
  362. package/src/utils/loading.js +22 -0
  363. package/src/utils/page.js +36 -0
  364. package/src/utils/progress.js +19 -0
  365. package/src/utils/system.js +92 -0
  366. package/src/utils/theme.js +79 -0
  367. package/src/utils/tool.js +431 -0
  368. package/src/utils/websocket.js +124 -0
  369. package/src/views/codeless/appVersion.vue +593 -0
  370. package/src/views/codeless/dataFormEdit.vue +1463 -0
  371. package/src/views/codeless/dataModel.vue +2584 -0
  372. package/src/views/codeless/dataModelPage.vue +535 -0
  373. package/src/views/codeless/dataTableEdit.vue +1678 -0
  374. package/src/views/codeless/datasource.vue +308 -0
  375. package/src/views/codeless/interface.vue +833 -0
  376. package/src/views/codeless/interfaceToken.vue +255 -0
  377. package/src/views/codeless/page.vue +752 -0
  378. package/src/views/codeless/pageButton.vue +255 -0
  379. package/src/views/codeless/pageCompEdit.vue +2330 -0
  380. package/src/views/codeless/pageEdit.vue +661 -0
  381. package/src/views/codeless/relationPage.vue +349 -0
  382. package/src/views/codeless/scriptGroovy.vue +736 -0
  383. package/src/views/codeless/scriptGroovyEdit.vue +248 -0
  384. package/src/views/codeless/scriptGroovyExecute.vue +212 -0
  385. package/src/views/codeless/scriptGroovySimple.vue +1057 -0
  386. package/src/views/codeless/scriptTool.vue +563 -0
  387. package/src/views/codeless/subsystem.vue +309 -0
  388. package/src/views/codeless/template.vue +739 -0
  389. package/src/views/codeless/variable.vue +727 -0
  390. package/src/views/codeless/view.vue +738 -0
  391. package/src/views/codeless/viewEdit.vue +244 -0
  392. package/src/views/codeless/viewSimple.vue +1034 -0
  393. package/src/views/collect/task.vue +898 -0
  394. package/src/views/collect/taskLog.vue +238 -0
  395. package/src/views/dictionary/dictionary.vue +866 -0
  396. package/src/views/employee/employee.vue +355 -0
  397. package/src/views/flow/flow.vue +369 -0
  398. package/src/views/flow/flowInst.vue +73 -0
  399. package/src/views/flow/flowLineBranch.vue +406 -0
  400. package/src/views/flow/flowNodeMan.vue +426 -0
  401. package/src/views/flow/flowOpinion.vue +188 -0
  402. package/src/views/icon/icon.vue +242 -0
  403. package/src/views/log/loginLog.vue +41 -0
  404. package/src/views/log/operatorLog.vue +176 -0
  405. package/src/views/menu/menu.vue +883 -0
  406. package/src/views/menu/menuList.vue +858 -0
  407. package/src/views/message/message.vue +299 -0
  408. package/src/views/mobile/editor.vue +1100 -0
  409. package/src/views/mobile/mobile.vue +568 -0
  410. package/src/views/mobile/tool.vue +1258 -0
  411. package/src/views/monitor/database.vue +11 -0
  412. package/src/views/monitor/details-diskspace.vue +56 -0
  413. package/src/views/monitor/details-gc.vue +93 -0
  414. package/src/views/monitor/details-memory.vue +143 -0
  415. package/src/views/monitor/details-process.vue +132 -0
  416. package/src/views/monitor/details-threads.vue +106 -0
  417. package/src/views/monitor/line-chart.vue +93 -0
  418. package/src/views/monitor/mem-chart.vue +22 -0
  419. package/src/views/monitor/panel.vue +90 -0
  420. package/src/views/monitor/performance.vue +36 -0
  421. package/src/views/monitor/threads-chart.vue +16 -0
  422. package/src/views/operation/backup.vue +593 -0
  423. package/src/views/operation/center.vue +420 -0
  424. package/src/views/operation/restore.vue +94 -0
  425. package/src/views/organization/organization.vue +366 -0
  426. package/src/views/role/role.vue +502 -0
  427. package/src/views/schedule/schedule.vue +338 -0
  428. package/src/views/schedule/scheduleLog.vue +40 -0
  429. package/src/views/sequence/sequence.vue +283 -0
  430. package/src/views/setting/setting.vue +371 -0
  431. package/src/visual/components/app/list/goods/double.vue +241 -0
  432. package/src/visual/components/app/list/nav/image.vue +135 -0
  433. package/src/visual/components/app/list/nav/text.vue +159 -0
  434. package/src/visual/components/button/index.vue +95 -0
  435. package/src/visual/components/container/index.vue +128 -0
  436. package/src/visual/components/data/index.vue +60 -0
  437. package/src/visual/components/data-table/index.vue +260 -0
  438. package/src/visual/components/echarts/annular.vue +173 -0
  439. package/src/visual/components/echarts/bar.vue +172 -0
  440. package/src/visual/components/echarts/funnel.vue +167 -0
  441. package/src/visual/components/echarts/gauge.vue +186 -0
  442. package/src/visual/components/echarts/line.vue +172 -0
  443. package/src/visual/components/echarts/map.vue +206 -0
  444. package/src/visual/components/echarts/pie.vue +158 -0
  445. package/src/visual/components/echarts/radar.vue +196 -0
  446. package/src/visual/components/echarts/scatter.vue +153 -0
  447. package/src/visual/components/edit-table/index.vue +71 -0
  448. package/src/visual/components/form/affix.vue +440 -0
  449. package/src/visual/components/form/area.vue +134 -0
  450. package/src/visual/components/form/buttons.vue +120 -0
  451. package/src/visual/components/form/checkbox.vue +126 -0
  452. package/src/visual/components/form/date-range.vue +97 -0
  453. package/src/visual/components/form/date.vue +88 -0
  454. package/src/visual/components/form/datetime.vue +87 -0
  455. package/src/visual/components/form/employee-tree.vue +300 -0
  456. package/src/visual/components/form/employees-tree.vue +91 -0
  457. package/src/visual/components/form/image.vue +440 -0
  458. package/src/visual/components/form/index.vue +85 -0
  459. package/src/visual/components/form/input.vue +116 -0
  460. package/src/visual/components/form/item.vue +68 -0
  461. package/src/visual/components/form/number.vue +157 -0
  462. package/src/visual/components/form/organization-tree.vue +300 -0
  463. package/src/visual/components/form/password.vue +103 -0
  464. package/src/visual/components/form/radio.vue +122 -0
  465. package/src/visual/components/form/rate.vue +93 -0
  466. package/src/visual/components/form/region-tree.vue +300 -0
  467. package/src/visual/components/form/rich-editor.vue +114 -0
  468. package/src/visual/components/form/select.vue +172 -0
  469. package/src/visual/components/form/switch.vue +105 -0
  470. package/src/visual/components/form/textarea.vue +91 -0
  471. package/src/visual/components/form/unit-tree.vue +300 -0
  472. package/src/visual/components/icon/index.vue +73 -0
  473. package/src/visual/components/image/index.vue +445 -0
  474. package/src/visual/components/index.js +26 -0
  475. package/src/visual/components/list/block.vue +234 -0
  476. package/src/visual/components/list/button.vue +123 -0
  477. package/src/visual/components/list/card.vue +129 -0
  478. package/src/visual/components/list/custom.vue +214 -0
  479. package/src/visual/components/list/image.vue +182 -0
  480. package/src/visual/components/list/news.vue +174 -0
  481. package/src/visual/components/page-comp/index.vue +67 -0
  482. package/src/visual/components/portal-menu/index.vue +191 -0
  483. package/src/visual/components/qrcode/index.vue +98 -0
  484. package/src/visual/components/router-view/index.vue +51 -0
  485. package/src/visual/components/row/index.vue +175 -0
  486. package/src/visual/components/search/index.vue +96 -0
  487. package/src/visual/components/tabs/index.vue +103 -0
  488. package/src/visual/components/text/index.vue +111 -0
  489. package/src/visual/components/video/index.vue +93 -0
  490. package/src/visual/js/echarts.js +220 -0
  491. package/src/visual/js/event.js +476 -0
  492. package/src/visual/js/visual-comp.js +48 -0
  493. package/src/visual/js/visual.js +508 -0
  494. package/src/visual/view/page.vue +357 -0
@@ -0,0 +1,1318 @@
1
+ <template>
2
+ <div
3
+ v-if="!initializing && compInfo.type"
4
+ style="min-height: 100px"
5
+ :class="['cc-page-comp cc-flex-row cc-grow-height', props.class, getClassName(compInfo.type)]"
6
+ >
7
+ <Tree
8
+ v-if="compInfo.showTree === '1'"
9
+ :options="compInfo"
10
+ @change="treeChange"
11
+ />
12
+ <div class="cc-page-comp-container cc-flex-column cc-grow-width">
13
+ <div class="cc-page-comp-bar" v-if="compInfo.type === '表格'">
14
+ <FormQuery
15
+ ref="formQuery"
16
+ v-bind="queryOptions"
17
+ @change="changeQueryData"
18
+ @buttonClick="formQueryButtonClick"
19
+ />
20
+ </div>
21
+ <component
22
+ ref="compRef"
23
+ :is="getComponent(compInfo.type)"
24
+ :operate="operate"
25
+ :disabled="disabled"
26
+ v-bind="compInfo"
27
+ v-bind:initData="initData"
28
+ v-bind:pkFieldName="pkFieldName"
29
+ v-bind:options="getOptions(compInfo.type)"
30
+ v-bind:defaultQuery="queryOptions.defaultQuery"
31
+ v-bind:dataFieldList="dataFieldList"
32
+ v-bind:inputParam="getInputParam(compInfo.type)"
33
+ v-bind:inputParamList="getInputParamList(compInfo.type)"
34
+ @editChange="editChange"
35
+ @buttonClick="compButtonClick"
36
+ @showDetail="showDetail"
37
+ @selectionChange="selectionChange"
38
+ />
39
+ <slot />
40
+ </div>
41
+ </div>
42
+ <div
43
+ v-else
44
+ v-loading="true"
45
+ element-loading-text="数据加载中..."
46
+ style="min-height: 100px"
47
+ ></div>
48
+
49
+ <el-dialog
50
+ v-model="dialogVisible"
51
+ :width="dialogWidth"
52
+ append-to-body
53
+ destroy-on-close
54
+ draggable
55
+ :before-close="closeDialog"
56
+ :close-on-click-modal="false"
57
+ :fullscreen="dialogFullscreen"
58
+ :class="['cc-page-comp-dialog', dialogComponent?.__name === 'page' ? 'no-padding' : '']"
59
+ >
60
+ <template #header>
61
+ <div class="header" @dblclick="dialogFullscreen=!dialogFullscreen">
62
+ <div class="title">{{dialogTitle}}</div>
63
+ <div class="button">
64
+ <cc-icon
65
+ v-if="!dialogFullscreen"
66
+ iconId="018dca8cad1b28075ecd"
67
+ @click="dialogFullscreen=true"
68
+ title="最大化"
69
+ />
70
+ <cc-icon
71
+ v-if="dialogFullscreen"
72
+ iconId="018dca8cad1b9b03c47f"
73
+ @click="dialogFullscreen=false"
74
+ title="缩小"
75
+ />
76
+ </div>
77
+ </div>
78
+ </template>
79
+ <component
80
+ ref="dialogCompRef"
81
+ :is="dialogComponent"
82
+ :disabled="!dialogEdit"
83
+ :operate="operate"
84
+ :dialogMode="true"
85
+ v-bind="dialogOptions"
86
+ />
87
+ <template #footer v-if="dialogFooter">
88
+ <el-button
89
+ v-if="dialogEdit"
90
+ size="default"
91
+ type="info"
92
+ @click="dialogVisible = false"
93
+ >取消</el-button>
94
+ <el-button
95
+ v-if="!dialogEdit"
96
+ size="default"
97
+ type="info"
98
+ @click="dialogVisible = false"
99
+ >关闭</el-button>
100
+ <el-button
101
+ v-for="(button, index) in dialogButtons || []"
102
+ :key="index"
103
+ class="cc-dialog-form-button"
104
+ size="default"
105
+ :style="{
106
+ 'color': button.fontColor,
107
+ 'background-color': button.backgroundColor,
108
+ 'border': '1px solid ' + button.borderColor
109
+ }"
110
+ :loading="button.loading === true"
111
+ @click="dialogButtonClick(button)"
112
+ >{{button.name}}
113
+ </el-button>
114
+ <el-button
115
+ v-if="dialogEdit && dialogButtons.filter(item => item.type !== '打印').length === 0"
116
+ size="default"
117
+ type="primary"
118
+ @click="() => submitDialogForm(null)"
119
+ :loading="dialogLoading"
120
+ >提交</el-button>
121
+ </template>
122
+ </el-dialog>
123
+
124
+ <el-dialog
125
+ title="导入"
126
+ v-model="importVisible"
127
+ width="800px"
128
+ :close-on-click-modal="false"
129
+ :fullscreen="importFullscreen"
130
+ class="cc-page-comp-dialog"
131
+ draggable
132
+ >
133
+ <template #header>
134
+ <div class="header" @dblclick="importFullscreen=!importFullscreen">
135
+ <div class="title">导入</div>
136
+ <div class="button">
137
+ <cc-icon
138
+ v-if="!importFullscreen"
139
+ iconId="018dca8cad1b28075ecd"
140
+ @click="importFullscreen=true"
141
+ title="最大化"
142
+ />
143
+ <cc-icon
144
+ v-if="importFullscreen"
145
+ iconId="018dca8cad1b9b03c47f"
146
+ @click="importFullscreen=false"
147
+ title="缩小"
148
+ />
149
+ </div>
150
+ </div>
151
+ </template>
152
+ <el-form
153
+ ref="dataForm"
154
+ label-width="120px"
155
+ label-position="right"
156
+ >
157
+ <el-row style="margin-top: 10px;">
158
+ <el-col :span="12">
159
+ <el-form-item label="文件选择" prop="file">
160
+ <el-upload
161
+ ref="importUpload"
162
+ action=""
163
+ accept=".xls, .xlsx"
164
+ :multiple="true"
165
+ :http-request="handleImportUpload"
166
+ :show-file-list=false
167
+ :before-upload="handleBeforeImportUpload"
168
+ >
169
+ <el-button :loading="importLoading" type="success">Excel数据导入</el-button>
170
+ <el-button v-if="importButton.buttonId" type="primary" @click.stop="downloadTpl">模板下载</el-button>
171
+ <el-button
172
+ v-if="importButton.tplType === '自定义'"
173
+ type="primary"
174
+ @click.stop="customButtonEvent({id: importButton.id, type: '下载模板'})"
175
+ >模板下载</el-button>
176
+ <template #tip><div class="el-upload__tip">只能上传xls/xlsx文件</div></template>
177
+ </el-upload>
178
+ </el-form-item>
179
+ </el-col>
180
+ <el-col class="error-text" v-if="importErrorMsg !== ''" :span="24">
181
+ <div v-html="importErrorMsg"></div>
182
+ </el-col>
183
+ </el-row>
184
+ </el-form>
185
+ <template #footer>
186
+ <el-button
187
+ size="default"
188
+ type="info"
189
+ @click="importVisible = false"
190
+ >关闭</el-button>
191
+ </template>
192
+ </el-dialog>
193
+ </template>
194
+
195
+ <script setup>
196
+ import { ref, onMounted, markRaw, inject, nextTick, computed } from 'vue';
197
+ import Page from '@/codeless/view/page.vue';
198
+ import FlowPage from '@/flow/deal.vue';
199
+ import FormQuery from '@/codeless/view/form-query.vue';
200
+ import Form from '@/codeless/view/form.vue';
201
+ import Table from '@/codeless/view/table.vue';
202
+ import TableEdit from '@/codeless/view/table-edit.vue';
203
+ import Tree from '@/codeless/view/tree.vue';
204
+ import api from '@/http/api';
205
+ import { ElMessage, ElMessageBox } from 'element-plus';
206
+ import tool from '@/utils/tool';
207
+ import loading from '@/utils/loading';
208
+ import { getPageComp, getPageButton, getDataFieldList } from '@/utils/codeless';
209
+ import printJS from 'print-js';
210
+ import html2canvas from 'html2canvas';
211
+
212
+ const props = defineProps({
213
+ pageCompId: String,
214
+ operate: {
215
+ type: String,
216
+ default: '',
217
+ },
218
+ initData: {
219
+ type: Object,
220
+ default: () => {}
221
+ },
222
+ inputParam: {
223
+ type: Object,
224
+ default: () => {}
225
+ },
226
+ class: String,
227
+ disabled: {
228
+ type: Boolean,
229
+ default: false
230
+ }
231
+ });
232
+
233
+ const initializing = ref(true);
234
+ const compRef = ref({});
235
+ const compInfo = ref({});
236
+ const pageButtonList = ref([]);
237
+ const pkFieldName = ref('');
238
+ const dataFieldList = ref([]);
239
+ const treeInputParams = ref({});
240
+
241
+ const formQuery = ref();
242
+ const queryOptions = ref({
243
+ defaultQuery: {},
244
+ fieldList: [],
245
+ dataTableId: '',
246
+ advanceQuery: '0',
247
+ buttonWrap: '0',
248
+ buttonList: [],
249
+ });
250
+ const dialogTitle = ref('');
251
+ const dialogWidth = ref('');
252
+ const dialogFullscreen = ref(false);
253
+ const dialogEdit = ref(false);
254
+ const dialogVisible = ref(false);
255
+ const dialogLoading = ref(false);
256
+ const dialogFooter = ref(true);
257
+ const dialogComponent = ref();
258
+ const dialogOptions = ref({});
259
+ const dialogCompRef = ref();
260
+ const dialogButton = ref();
261
+ const dialogButtonList = ref();
262
+
263
+ const importVisible = ref(false);
264
+ const importFullscreen = ref(false);
265
+ const importLoading = ref(false);
266
+ const importButton = ref({});
267
+ const importErrorMsg = ref('');
268
+ const importUpload = ref();
269
+ const importDataList = ref([]);
270
+ const currMenuId = inject('menuId', '');
271
+ const permitMenuId = inject('permitMenuId', '');
272
+
273
+ const treeChange = (data) => {
274
+ if (!compInfo.value.filterFieldId) return;
275
+
276
+ if (compInfo.value.treeMappingType === '一对多') {
277
+ const dataField = dataFieldList.value.find(item => item.id === compInfo.value.filterFieldId);
278
+ if (!dataField) return;
279
+
280
+ const params = {};
281
+ params[compInfo.value.filterFieldId] = data && data.data && data.data[compInfo.value.treeOutputFieldName] || '';
282
+ compRef.value && compRef.value.reloadData(params);
283
+
284
+ treeInputParams.value[dataField.fieldName] = data && data.data && data.data[compInfo.value.treeOutputFieldName] || '';
285
+ } else if (compInfo.value.treeMappingType === '多对多') {
286
+ const params = {};
287
+ params[compInfo.value.middleInputFieldId] = data && data.data && data.data[compInfo.value.treeOutputFieldName] || '';
288
+ compRef.value && compRef.value.reloadData(params);
289
+
290
+ treeInputParams.value[compInfo.value.middleInputFieldName] = data && data.data && data.data[compInfo.value.treeOutputFieldName] || '';
291
+ }
292
+ };
293
+
294
+ const changeQueryData = (data) => {
295
+ compRef.value && compRef.value.reloadData(data);
296
+ };
297
+
298
+ const formQueryButtonClick = (button) => {
299
+ const dataList = compRef.value.getSelectedData && compRef.value.getSelectedData() || [];
300
+ buttonClick(button, dataList);
301
+ };
302
+
303
+ const dialogButtonClick = (button) => {
304
+ dialogFooter.value = true;
305
+ button.dialogPageId = dialogButton.value.dialogPageId || '';
306
+ customButtonEvent(button, dialogCompRef.value.getData && dialogCompRef.value.getData() || {});
307
+ };
308
+
309
+ const compButtonClick = (button, data) => {
310
+ buttonClick(button, data);
311
+ };
312
+
313
+ const buttonClick = (button, data) => {
314
+ dialogFooter.value = true;
315
+ if (button.buttonId) {
316
+ systemButtonEvent(button, data);
317
+ } else {
318
+ customButtonEvent(button, data);
319
+ }
320
+ };
321
+
322
+ const systemButtonEvent = (button, data) => {
323
+ if (button.name === '新增') {
324
+ dialogTitle.value = '新增';
325
+ dialogEdit.value = true;
326
+ dialogWidth.value = button.dialogWidth ? button.dialogWidth : '600px';
327
+ dialogFullscreen.value = button.dialogFullscreen === '1';
328
+ dialogOptions.value = {
329
+ operate: button.name,
330
+ dataFormId: compInfo.value.dataFormId,
331
+ initData: Object.assign({}, tool.deepClone(data || {})),
332
+ inputParam: Object.assign({}, getInputParam('表单'), treeInputParams.value, props.inputParam || {})
333
+ };
334
+ dialogComponent.value = markRaw(Form);
335
+ dialogLoading.value = false;
336
+ dialogVisible.value = true;
337
+ dialogButton.value = button;
338
+ } else if (button.name === '批量编辑') {
339
+ if (data && Array.isArray(data) && data.length > 0) {
340
+ dialogTitle.value = '批量编辑';
341
+ } else {
342
+ dialogTitle.value = '批量新增';
343
+ }
344
+ dialogEdit.value = true;
345
+ dialogWidth.value = button.dialogWidth ? button.dialogWidth : '600px';
346
+ dialogFullscreen.value = button.dialogFullscreen === '1';
347
+ dialogOptions.value = {
348
+ operate: button.name,
349
+ dataTableId: compInfo.value.dataTableId,
350
+ fieldList: dataFieldList.value,
351
+ dataList: data || [],
352
+ inputParam: Object.assign({}, props.inputParam || {})
353
+ };
354
+ dialogComponent.value = markRaw(TableEdit);
355
+ dialogLoading.value = false;
356
+ dialogVisible.value = true;
357
+ dialogButton.value = button;
358
+ } else if (button.name === '编辑' || button.name === '复制' || button.name === '明细') {
359
+ const pkField = dataFieldList.value.find(item => item.primaryKey === '1');
360
+ if ((!compInfo.value.dataFormId || !pkField) && button.name === '明细') {
361
+ return;
362
+ }
363
+ if (!pkField) {
364
+ ElMessage.error('数据模型未配置主键字段!');
365
+ return;
366
+ }
367
+ if (!data) {
368
+ ElMessage.error('请先选择要' + button.name + '的数据!');
369
+ return;
370
+ }
371
+
372
+ if (Array.isArray(data)) {
373
+ if (data.length === 1) {
374
+ data = data[0];
375
+ } else {
376
+ ElMessage.error('只允许一次' + button.name + '一条数据!');
377
+ return;
378
+ }
379
+ } else if (!data[pkField.fieldName]) {
380
+ ElMessage.error('请先选择要' + button.name + '的数据!');
381
+ return;
382
+ }
383
+
384
+ dialogEdit.value = true;
385
+ const initData = tool.deepClone(data);
386
+ if (button.name === '复制') {
387
+ initData[pkField.fieldName] = null;
388
+ const find = dataFieldList.value.find(item => (item.fieldType === '字符' && item.autoCreate === '1') || item.fieldType === '附件');
389
+ if (find) {
390
+ initData[find.fieldName] = null;
391
+ }
392
+ } else if (button.name === '明细') {
393
+ initData[pkField.fieldName] = null;
394
+ dialogEdit.value = false;
395
+
396
+ if (!button.dialogWidth) {
397
+ const find = compInfo.value.buttonList.find(item => item.name === '新增' || item.name === '编辑');
398
+ if (find) {
399
+ button.dialogWidth = find.dialogWidth;
400
+ } else {
401
+ button.dialogWidth = '800px';
402
+ }
403
+ }
404
+ }
405
+ dialogTitle.value = button.name;
406
+ dialogWidth.value = button.dialogWidth ? button.dialogWidth : '600px';
407
+ dialogFullscreen.value = button.dialogFullscreen === '1';
408
+ dialogOptions.value = {
409
+ operate: button.name,
410
+ dataFormId: compInfo.value.dataFormId,
411
+ initData: initData || {},
412
+ };
413
+ dialogComponent.value = markRaw(Form);
414
+ dialogLoading.value = false;
415
+ dialogVisible.value = true;
416
+ dialogButton.value = button;
417
+ } else if (button.name === '删除') {
418
+ const pkField = dataFieldList.value.find(item => item.primaryKey === '1');
419
+ if (!pkField) {
420
+ ElMessage.error('数据模型未配置主键字段!');
421
+ return;
422
+ }
423
+
424
+ if (!data) {
425
+ ElMessage.error('请先选择要' + button.name + '的数据!');
426
+ return;
427
+ }
428
+
429
+ const dataList = [];
430
+ if (Array.isArray(data)) {
431
+ data.forEach(item => {
432
+ const dataItem = {};
433
+ dataItem[pkField.fieldName] = item[pkField.fieldName];
434
+ dataList.push(dataItem);
435
+ });
436
+ } else if (data[pkField.fieldName]) {
437
+ const dataItem = {};
438
+ dataItem[pkField.fieldName] = data[pkField.fieldName];
439
+ dataList.push(dataItem);
440
+ }
441
+ if (dataList.length === 0) {
442
+ ElMessage.error('请先选择要' + button.name + '的数据!');
443
+ return;
444
+ }
445
+ const prompt = compInfo.value.submitPrompt || '请确认是否' + button.name + '?'
446
+ ElMessageBox.confirm(prompt, '提示', { type: 'warning' }).then(() => {
447
+ loading.showLoading();
448
+ const url = '/codeless/' +
449
+ currMenuId.value + '/' +
450
+ button.id + '/' +
451
+ compInfo.value.dataModelId + '/delete';
452
+ api.post(url, { dataList: dataList }).then(res => {
453
+ ElMessage.success(res.message);
454
+ loading.hideLoading();
455
+ refreshCompData();
456
+ }).catch(e => {
457
+ loading.hideLoading();
458
+ console.log('操作失败!', button, e);
459
+ });
460
+ }).catch(() => {});
461
+ } else if (button.name === '导入') {
462
+ importErrorMsg.value = '';
463
+ importLoading.value = false;
464
+ importVisible.value = true;
465
+ importButton.value = button;
466
+ } else if (button.name === '导出') {
467
+ const data = compRef.value.getQueryData && compRef.value.getQueryData() || [];
468
+ const url = '/codeless/' +
469
+ currMenuId.value + '/' +
470
+ button.id + '/exportXls';
471
+ button.loading = true;
472
+ api.downloadFile(url, data).then((res) => {
473
+ try {
474
+ api.saveFileLocal(res);
475
+ } catch (err) {
476
+ const enc = new TextDecoder('utf-8');
477
+ const error = JSON.parse(enc.decode(new Uint8Array(res)));
478
+ ElMessage.error(error.message);
479
+ } finally {
480
+ button.loading = false;
481
+ }
482
+ }).catch(e => {
483
+ button.loading = false;
484
+ console.log('操作失败!', button, e);
485
+ });
486
+ }
487
+ };
488
+
489
+ const closeDialog = (done) => {
490
+ const viewer = document.getElementsByClassName('el-image-viewer__wrapper')[0];
491
+ if (!viewer) {
492
+ done();
493
+ }
494
+
495
+ if (dialogButton.value.endRefresh === '1') {
496
+ refreshCompData();
497
+ }
498
+ };
499
+
500
+ const downloadTpl = () => {
501
+ const url = '/codeless/' +
502
+ currMenuId.value + '/' +
503
+ importButton.value.id + '/' +
504
+ compInfo.value.dataTableId + '/downloadTpl';
505
+ api.downloadFile(url).then((res) => {
506
+ try {
507
+ api.saveFileLocal(res);
508
+ } catch (err) {
509
+ const enc = new TextDecoder('utf-8');
510
+ const error = JSON.parse(enc.decode(new Uint8Array(res)));
511
+ ElMessage.error(error.message);
512
+ }
513
+ }).catch(e => {
514
+ console.log('操作失败!', e);
515
+ });
516
+ };
517
+
518
+ const fileCount = ref(0);
519
+ const handleImportUpload = (option) => {
520
+ if (fileCount.value === 0) {
521
+ importErrorMsg.value = '';
522
+ }
523
+
524
+ fileCount.value++;
525
+ return new Promise((resolve, reject) => {
526
+ importErrorMsg.value = '';
527
+ importLoading.value = true;
528
+ const url = '/codeless/' +
529
+ currMenuId.value + '/' +
530
+ importButton.value.id + '/' +
531
+ compInfo.value.dataTableId + '/importXls';
532
+ api.uploadFile(url, { file: option.file, dataList: JSON.stringify(importDataList.value) }).then(res => {
533
+ fileCount.value--;
534
+ importLoading.value = false;
535
+ if (res.code === '1') {
536
+ if (fileCount.value === 0 && !importErrorMsg.value) {
537
+ ElMessage.success('导入成功!');
538
+ importVisible.value = false;
539
+ refreshCompData();
540
+ }
541
+ } else {
542
+ importErrorMsg.value += option.file.name + ':<br/>' + res.message.replace(/@@@/g, '<br/>') + '<br/><br/>';
543
+ }
544
+
545
+ resolve();
546
+ }).catch(e => {
547
+ fileCount.value--;
548
+ importLoading.value = false;
549
+ importErrorMsg.value += option.file.name + ':' + e.message + '<br/><br/>';
550
+ reject();
551
+ });
552
+
553
+ importUpload.value && importUpload.value.clearFiles();
554
+ resolve();
555
+ });
556
+ };
557
+
558
+ const handleBeforeImportUpload = (file) => {
559
+ const isLt10M = file.size / 1024 / 1024 < 10;
560
+ if (!isLt10M) {
561
+ ElMessage.error('上传文件大小不能超过 10MB!');
562
+ }
563
+
564
+ return isLt10M;
565
+ };
566
+
567
+ const getButtonDefault = (button) => {
568
+ if (!button.updateList || button.updateList.length <= 0) return {};
569
+
570
+ const defaultParam = {};
571
+ button.updateList.forEach(param => {
572
+ const field = dataFieldList.value.find(item => item.id === param.fieldId);
573
+ if (field) {
574
+ defaultParam[field.fieldName] = param.fieldValue;
575
+ }
576
+ });
577
+ return defaultParam;
578
+ }
579
+
580
+ const getButtonParam = (button, data) => {
581
+ const buttonParam = {};
582
+ const pageField = JSON.parse(button.pageFieldJson || '[]');
583
+
584
+ if (props.inputParam) {
585
+ pageField.forEach(param => {
586
+ if (param.fieldName && props.inputParam[param.fieldName]) {
587
+ buttonParam[param.pageParamId] = props.inputParam[param.fieldName];
588
+ }
589
+ });
590
+ }
591
+
592
+ if (!data || (Array.isArray(data) && data.length === 0)) return buttonParam;
593
+
594
+ let dataList;
595
+ if (Array.isArray(data)) {
596
+ dataList = data;
597
+ } else {
598
+ dataList = [data];
599
+ }
600
+
601
+ pageField.forEach(param => {
602
+ dataList.forEach(item => {
603
+ if (param.fieldName && item[param.fieldName]) {
604
+ buttonParam[param.pageParamId] = (buttonParam[param.pageParamId] ? (buttonParam[param.pageParamId] + ',') : '') + item[param.fieldName];
605
+ buttonParam[param.pageParamName] = (buttonParam[param.pageParamName] ? (buttonParam[param.pageParamName] + ',') : '') + item[param.fieldName];
606
+ } else if (!param.fieldName && param.fieldId) {
607
+ buttonParam[param.pageParamId] = (buttonParam[param.pageParamId] ? (buttonParam[param.pageParamId] + ',') : '') + param.fieldId;
608
+ buttonParam[param.pageParamName] = (buttonParam[param.pageParamName] ? (buttonParam[param.pageParamName] + ',') : '') + param.fieldId;
609
+ }
610
+ });
611
+ });
612
+
613
+ return buttonParam;
614
+ }
615
+
616
+ const customButtonEvent = async(button, data) => {
617
+ if (button.dataVolume === '单条') {
618
+ if (Array.isArray(data)) {
619
+ if (data.length !== 1) {
620
+ ElMessage.error('请选择一条记录!');
621
+ return;
622
+ }
623
+ data = data[0];
624
+ }
625
+ } else if (button.dataVolume === '多条' &&
626
+ ((Array.isArray(data) && data.length === 0) ||
627
+ (!Array.isArray(data) && Object.keys(data).length === 0))) {
628
+ ElMessage.error('请选择操作记录!');
629
+ return;
630
+ }
631
+ if (button.dataVolume === '多条' && !Array.isArray(data)) {
632
+ data = [data];
633
+ }
634
+ if (button.type === '新增' || button.type === '编辑') {
635
+ dialogTitle.value = button.name;
636
+ dialogEdit.value = true;
637
+ dialogWidth.value = button.dialogWidth ? button.dialogWidth : '600px';
638
+ dialogFullscreen.value = button.dialogFullscreen === '1';
639
+ if (button.dialogFormId) {
640
+ dialogOptions.value = {
641
+ operate: button.type,
642
+ dataFormId: button.dialogFormId,
643
+ initData: Object.assign({}, tool.deepClone(data || {})),
644
+ inputParam: Object.assign({},
645
+ button.type === '新增' ? getInputParam('表单') : {},
646
+ button.type === '新增' ? getButtonDefault(button) : {},
647
+ getButtonParam(button, data),
648
+ treeInputParams.value,
649
+ props.inputParam || {}
650
+ )
651
+ };
652
+ dialogComponent.value = markRaw(Form);
653
+ } else if (button.dialogPageId) {
654
+ dialogOptions.value = {
655
+ operate: button.type,
656
+ dataPageId: button.dialogPageId,
657
+ initData: Object.assign({}, tool.deepClone(data || {})),
658
+ inputParam: Object.assign({},
659
+ button.type === '新增' ? getInputParam('表单') : {},
660
+ button.type === '新增' ? getButtonDefault(button) : {},
661
+ getButtonParam(button, data),
662
+ treeInputParams.value,
663
+ props.inputParam || {}
664
+ )
665
+ };
666
+ dialogComponent.value = markRaw(Page);
667
+ }
668
+ dialogLoading.value = false;
669
+ dialogVisible.value = true;
670
+ dialogButton.value = button;
671
+ } else if (button.type === '删除') {
672
+ if (button.submitPrompt) {
673
+ const result = await ElMessageBox.confirm(button.submitPrompt, { type: 'warning' }).catch(() => {});
674
+ if (!result) return;
675
+ }
676
+
677
+ if (!button.executeScriptId) {
678
+ const pkField = dataFieldList.value.find(item => item.primaryKey === '1');
679
+ if (!pkField) {
680
+ ElMessage.error('数据模型未配置主键字段!');
681
+ return;
682
+ }
683
+
684
+ const dataList = [];
685
+ if (Array.isArray(data)) {
686
+ data.forEach(item => {
687
+ const dataItem = {};
688
+ dataItem[pkField.fieldName] = item[pkField.fieldName];
689
+ dataList.push(dataItem);
690
+ });
691
+ } else if (data[pkField.fieldName]) {
692
+ const dataItem = {};
693
+ dataItem[pkField.fieldName] = data[pkField.fieldName];
694
+ dataList.push(dataItem);
695
+ }
696
+ if (dataList.length === 0) {
697
+ ElMessage.error('请先选择要' + button.name + '的数据!');
698
+ return;
699
+ }
700
+ loading.showLoading();
701
+ const url = '/codeless/' +
702
+ currMenuId.value + '/' +
703
+ button.id + '/' +
704
+ compInfo.value.dataModelId + '/delete';
705
+ api.post(url, { dataList: dataList }).then(res => {
706
+ ElMessage.success(res.message);
707
+ loading.hideLoading();
708
+ refreshCompData();
709
+ });
710
+ } else {
711
+ let dataList;
712
+ if (Array.isArray(data)) {
713
+ dataList = data;
714
+ } else if (Object.keys(data).length > 0) {
715
+ dataList = [data];
716
+ } else {
717
+ dataList = [];
718
+ }
719
+ api.runScript(button.executeScriptId, { dataList: dataList }).then(res => {
720
+ refreshCompData();
721
+ if (button.showExecuteResult === '1' && (res.data || res.message)) {
722
+ ElMessage.success(res.data || res.message);
723
+ } else {
724
+ ElMessage.success(button.name + '成功!');
725
+ }
726
+ });
727
+ }
728
+ } else if (button.type === '提交数据') {
729
+ dialogButton.value = button;
730
+ submitDialogForm(data);
731
+ } else if (button.type === '批量编辑') {
732
+ dialogTitle.value = button.name;
733
+ dialogEdit.value = true;
734
+ dialogWidth.value = button.dialogWidth ? button.dialogWidth : '600px';
735
+ dialogFullscreen.value = button.dialogFullscreen === '1';
736
+
737
+ if (button.dialogFormId) {
738
+ dialogOptions.value = {
739
+ operate: button.type,
740
+ batchEdit: '1',
741
+ dataFormId: button.dialogFormId,
742
+ dataList: tool.deepClone(data || []),
743
+ defaultValue: Object.assign({},
744
+ getButtonDefault(button),
745
+ getButtonParam(button, data),
746
+ treeInputParams.value
747
+ ),
748
+ inputParam: props.inputParam || {}
749
+ };
750
+ dialogComponent.value = markRaw(Form);
751
+ } else if (button.dialogPageId) {
752
+ dialogOptions.value = {
753
+ operate: button.type,
754
+ dataPageId: button.dialogPageId,
755
+ initData: Object.assign({}, tool.deepClone(data || {})),
756
+ defaultValue: getButtonDefault(button),
757
+ inputParam: Object.assign({},
758
+ getButtonParam(button, data),
759
+ treeInputParams.value,
760
+ props.inputParam || {}
761
+ )
762
+ };
763
+ dialogComponent.value = markRaw(Page);
764
+ }
765
+
766
+ dialogLoading.value = false;
767
+ dialogVisible.value = true;
768
+ dialogButton.value = button;
769
+ } else if (button.type === '弹出页面') {
770
+ if (!button.dialogPageId) {
771
+ ElMessage.error('按钮【' + button.name + '】未配置弹窗页面!');
772
+ return;
773
+ }
774
+
775
+ dialogFooter.value = button.showCloseButton === '1';
776
+ dialogTitle.value = button.name;
777
+ dialogEdit.value = false;
778
+ dialogWidth.value = button.dialogWidth ? button.dialogWidth : '600px';
779
+ dialogFullscreen.value = button.dialogFullscreen === '1';
780
+ dialogOptions.value = {
781
+ dataPageId: button.dialogPageId,
782
+ initData: Object.assign({}, tool.deepClone(data || {})),
783
+ inputParam: Object.assign(getButtonParam(button, data), treeInputParams.value),
784
+ disabled: true,
785
+ };
786
+ dialogComponent.value = markRaw(Page);
787
+ dialogLoading.value = false;
788
+ dialogVisible.value = true;
789
+ dialogButton.value = button;
790
+ } else if (button.type === '调用脚本') {
791
+ if (!button.executeScriptId) {
792
+ ElMessage.error('按钮【' + button.name + '】未配置提交执行脚本!');
793
+ return;
794
+ }
795
+
796
+ if (button.buttonId || button.submitValidate === '1') {
797
+ dialogCompRef.value.validate(valid => {
798
+ if (valid) {
799
+ doRunScript(button, data);
800
+ }
801
+ }).catch(() => {
802
+ ElMessage.error('数据录入不正确,请重新检查!');
803
+ });
804
+ } else {
805
+ await doRunScript(button, data);
806
+ }
807
+ } else if (button.type === '上传') {
808
+ importErrorMsg.value = '';
809
+ importLoading.value = false;
810
+ importVisible.value = true;
811
+
812
+ if (Array.isArray(data)) {
813
+ importDataList.value = data;
814
+ } else if (Object.keys(data).length > 0) {
815
+ importDataList.value = [data];
816
+ } else {
817
+ importDataList.value = [];
818
+ }
819
+
820
+ importButton.value = button;
821
+ } else if (button.type === '下载') {
822
+ const data = tool.deepClone(compRef.value.getQueryData && compRef.value.getQueryData() || {});
823
+ const url = '/codeless/' +
824
+ currMenuId.value + '/' +
825
+ button.id + '/exportXls';
826
+ button.loading = true;
827
+ api.downloadFile(url, data).then((res) => {
828
+ try {
829
+ api.saveFileLocal(res);
830
+ } catch (err) {
831
+ const enc = new TextDecoder('utf-8');
832
+ const error = JSON.parse(enc.decode(new Uint8Array(res)));
833
+ ElMessage.error(error.message);
834
+ } finally {
835
+ button.loading = false;
836
+ }
837
+ }).catch(e => {
838
+ button.loading = false;
839
+ console.log('操作失败!', button, e);
840
+ });
841
+ } else if (button.type === '下载模板') {
842
+ const url = '/codeless/' +
843
+ currMenuId.value + '/' +
844
+ button.id + '/downloadTpl';
845
+ button.loading = true;
846
+ api.downloadFile(url).then((res) => {
847
+ try {
848
+ api.saveFileLocal(res);
849
+ } catch (err) {
850
+ const enc = new TextDecoder('utf-8');
851
+ const error = JSON.parse(enc.decode(new Uint8Array(res)));
852
+ ElMessage.error(error.message);
853
+ } finally {
854
+ button.loading = false;
855
+ }
856
+ }).catch(e => {
857
+ console.log('操作失败!', e);
858
+ button.loading = false;
859
+ });
860
+ } else if (button.type === '打印') {
861
+ buttonPrint();
862
+ }
863
+ };
864
+
865
+ const buttonPrint = () => {
866
+ if (!dialogCompRef.value) {
867
+ ElMessage.error('未知错误!');
868
+ }
869
+
870
+ let printNode = dialogCompRef.value.$el.querySelector('.vc-print-node');
871
+ if (!printNode) {
872
+ printNode = dialogCompRef.value.$el;
873
+ }
874
+ printNode.id = tool.uuid();
875
+ printNode.style.transform = 'scale(2)';
876
+ html2canvas(printNode, {
877
+ imageSmoothingEnabled: false
878
+ }).then(canvas => {
879
+ const url = canvas.toDataURL();
880
+ printJS({
881
+ printable: url,
882
+ type: 'image'
883
+ });
884
+ });
885
+ printNode.id = '';
886
+ printNode.style.transform = '';
887
+ }
888
+
889
+ const showDetail = (data) => {
890
+ const button = compInfo.value.buttonList.find(item => item.name === '明细');
891
+ systemButtonEvent(button || { name: '明细' }, data)
892
+ };
893
+
894
+ const selectionChange = (dataList) => {
895
+ formQuery.value.validateButtons(dataList, dataFieldList.value);
896
+ };
897
+
898
+ const loadCompInfo = async(id) => {
899
+ const pageComp = await getPageComp(id, permitMenuId.value);
900
+ const data = pageComp || {};
901
+ data.pageCompId = data.id || '';
902
+ compInfo.value = data;
903
+ };
904
+
905
+ const loadDataField = async() => {
906
+ dataFieldList.value = await getDataFieldList(compInfo.value.dataModelId);
907
+ const pkField = dataFieldList.value.find(item => item.primaryKey === '1');
908
+ if (pkField) {
909
+ pkFieldName.value = pkField.fieldName;
910
+ }
911
+ };
912
+
913
+ const loadPageButton = async() => {
914
+ pageButtonList.value = await getPageButton();
915
+ };
916
+
917
+ const className = ref({ 表格: 'cc-page-table', 表单: 'cc-page-form', 页面: 'cc-page-page' });
918
+ const getClassName = (key) => {
919
+ return className.value[key] || '';
920
+ };
921
+
922
+ const getComponent = (type) => {
923
+ switch (type) {
924
+ case '表格':
925
+ return Table;
926
+ case '表单':
927
+ return Form;
928
+ case '页面':
929
+ return Page;
930
+ case '流程页面':
931
+ return FlowPage;
932
+ default:
933
+ return '';
934
+ }
935
+ };
936
+
937
+ const getOptions = (type) => {
938
+ switch (type) {
939
+ case '表格':
940
+ return {};
941
+ case '表单':
942
+ return {
943
+ pageCompId: compInfo.value.id || '',
944
+ dataModelId: compInfo.value.dataModelId || '',
945
+ loading: true,
946
+ disabled: props.edit || false
947
+ };
948
+ case '页面':
949
+ return {};
950
+ case '流程页面':
951
+ return getInputParam('页面');
952
+ default:
953
+ return {};
954
+ }
955
+ };
956
+
957
+ const getInputParam = (type) => {
958
+ const inputParam = {};
959
+ (compInfo.value.paramList || [])
960
+ .filter(param => !param.useType || param.useType === '全部' || param.useType === type)
961
+ .forEach(param => {
962
+ if ((props.inputParam || {})[param.pageParamId]) {
963
+ inputParam[param.pageCompParamId] = props.inputParam[param.pageParamId];
964
+ }
965
+ });
966
+ return inputParam;
967
+ };
968
+
969
+ const getInputParamList = (type) => {
970
+ const inputParamList = [];
971
+ (compInfo.value.paramList || [])
972
+ .filter(param => !param.useType || param.useType === '全部' || param.useType === type)
973
+ .forEach(param => {
974
+ if ((props.inputParam || {})[param.pageParamId]) {
975
+ inputParamList.push([param.pageCompParamId, param.matchMode, props.inputParam[param.pageParamId]]);
976
+ }
977
+ });
978
+ return inputParamList;
979
+ };
980
+
981
+ const typeCompNameMap = ref({
982
+ 输入框: 'cc-input',
983
+ 下拉框: 'cc-select',
984
+ 单选框: 'cc-radio',
985
+ 按钮组: 'cc-buttons',
986
+ 日期控件: 'cc-date',
987
+ 树形控件: 'cc-tree'
988
+ });
989
+ const initQueryOptions = async() => {
990
+ const fieldList = [];
991
+ (compInfo.value.filterList || []).forEach(filter => {
992
+ const result = {
993
+ id: filter.id,
994
+ type: typeCompNameMap.value[filter.type] || '',
995
+ placeholder: filter.placeholder,
996
+ defaultValue: filter.defaultValue || '',
997
+ };
998
+ if (filter.type === '输入框') {
999
+ const field = dataFieldList.value.find(field => field.id === filter.fieldIds);
1000
+
1001
+ if (field && field.fieldType === '整数') {
1002
+ result.type = 'cc-number';
1003
+ result.point = 0;
1004
+ result.defaultValue = filter.defaultValue ? parseInt(filter.defaultValue) : null;
1005
+ } else if (field && field.fieldType === '小数') {
1006
+ result.type = 'cc-number';
1007
+ result.point = field.fieldPrecision || 2;
1008
+ result.defaultValue = filter.defaultValue ? parseFloat(filter.defaultValue) : null;
1009
+ }
1010
+ } else if ('下拉框,单选框,按钮组'.indexOf(filter.type) >= 0) {
1011
+ const field = dataFieldList.value.find(field => field.id === filter.fieldIds);
1012
+ if (!field) return;
1013
+
1014
+ if ((field.fieldType === '联动' || field.fieldType === '派生') && field.relevanceType.startsWith('字典')) {
1015
+ if (filter.type === '下拉框') {
1016
+ result.type = 'cc-dict-select';
1017
+ if (filter.queryType === '包含') {
1018
+ result.multiple = true;
1019
+ }
1020
+ } else if (filter.type === '单选框') {
1021
+ result.type = 'cc-dict-radio';
1022
+ } else {
1023
+ result.type = 'cc-dict-buttons';
1024
+ }
1025
+ result.dictCode = field.relevanceDict;
1026
+ } else if (field.fieldType === '联动') {
1027
+ const dataField = dataFieldList.value.find(field => field.id === filter.fieldIds);
1028
+ if (!dataField) return;
1029
+
1030
+ const relevanceList = dataField.relevanceList || [];
1031
+ result.relevanceList = relevanceList || [];
1032
+ result.type = relevanceList.length === 1 ? 'cc-remote-select' : '';
1033
+ result.dataModelId = relevanceList[0].dataModelId;
1034
+ result.idProp = relevanceList[0].nodeFieldId;
1035
+ result.nameProp = relevanceList[0].showFieldId;
1036
+ result.filterName = relevanceList[0].showFieldName;
1037
+ result.sortField = relevanceList[0].ordinalFieldId;
1038
+ } else {
1039
+ result.options = field.enumerateValue || '';
1040
+ result.type = field.enumerateValue ? result.type : '';
1041
+ }
1042
+ if (!result.type && filter.type === '下拉框' && (field.fieldType === '字符' || field.fieldType === '整数')) {
1043
+ result.dataModelId = compInfo.value.dataModelId || '';
1044
+ result.distinctName = field.fieldName;
1045
+ result.filterName = field.fieldName;
1046
+ result.type = 'cc-remote-distinct';
1047
+ if (filter.queryType === '包含') {
1048
+ result.multiple = true;
1049
+ }
1050
+ }
1051
+ } else if (filter.type === '树形控件') {
1052
+ const dataField = dataFieldList.value.find(field => field.id === filter.fieldIds);
1053
+ if (!dataField) return;
1054
+
1055
+ if (dataField.relevanceType === '区划树') {
1056
+ result.type = 'cc-region-tree';
1057
+ } else if (dataField.relevanceType === '单位树') {
1058
+ result.type = 'cc-unit-tree';
1059
+ } else if (dataField.relevanceType === '企业树') {
1060
+ result.type = 'cc-entp-tree';
1061
+ } else if (dataField.relevanceType === '部门树') {
1062
+ result.type = 'cc-organization-tree';
1063
+ } else if (dataField.relevanceType === '人员树') {
1064
+ result.type = 'cc-employee-tree';
1065
+ } else {
1066
+ const relevanceList = dataField.relevanceList || [];
1067
+ result.relevanceList = relevanceList || [];
1068
+ result.type = relevanceList.length > 0 ? result.type : '';
1069
+ result.dataFieldId = dataField.id;
1070
+ }
1071
+ }
1072
+
1073
+ if (result.type) {
1074
+ fieldList.push(result);
1075
+ }
1076
+ });
1077
+
1078
+ (compInfo.value.buttonList || []).forEach(button => {
1079
+ if (button.buttonId) {
1080
+ const find = pageButtonList.value.find(item => item.id === button.buttonId);
1081
+ if (find) {
1082
+ button.name = find.showName;
1083
+ button.dataVolume = find.dataVolume;
1084
+ button.showPosition = button.showPosition || find.showPosition;
1085
+ button.iconId = find.iconId;
1086
+ button.fontColor = find.fontColor;
1087
+ button.backgroundColor = find.backgroundColor;
1088
+ button.borderColor = find.borderColor;
1089
+ button.submitPrompt = find.submitPrompt;
1090
+ }
1091
+ }
1092
+ });
1093
+
1094
+ queryOptions.value = {
1095
+ dataTableId: compInfo.value.dataTableId || '',
1096
+ advanceQuery: compInfo.value.advanceQuery || '0',
1097
+ buttonWrap: compInfo.value.buttonWrap || '0',
1098
+ fieldList: fieldList,
1099
+ defaultQuery: fieldList.reduce((obj, item) => ({ ...obj, [item.id]: item.defaultValue }), {}),
1100
+ buttonList: (compInfo.value.buttonList || []).filter(item => item.showPosition.indexOf('顶部') >= 0)
1101
+ };
1102
+ };
1103
+
1104
+ const submitDialogForm = (data) => {
1105
+ if (dialogButton.value.buttonId || dialogButton.value.submitValidate === '1') {
1106
+ dialogCompRef.value.validate(valid => {
1107
+ if (valid) {
1108
+ doSubmitDialogForm(data);
1109
+ }
1110
+ }).catch(() => {
1111
+ ElMessage.error('数据录入不正确,请重新检查!');
1112
+ });
1113
+ } else {
1114
+ doSubmitDialogForm(data);
1115
+ }
1116
+ };
1117
+
1118
+ const doSubmitDialogForm = (data) => {
1119
+ const prompt = dialogButton.value.submitPrompt || '请确认是否提交数据?';
1120
+ ElMessageBox.confirm(prompt, '提示', { type: 'info' }).then(() => {
1121
+ let url = '';
1122
+ if (dialogButton.value.buttonId) {
1123
+ if (dialogButton.value.name === '批量编辑') {
1124
+ url = '/codeless/' +
1125
+ currMenuId.value + '/' +
1126
+ dialogButton.value.id + '/' +
1127
+ compInfo.value.dataTableId + '/saveTableList';
1128
+ } else {
1129
+ url = '/codeless/' +
1130
+ currMenuId.value + '/' +
1131
+ dialogButton.value.id + '/' +
1132
+ compInfo.value.dataModelId + '/saveModel';
1133
+ }
1134
+ } else if (dialogButton.value.type === '提交数据') {
1135
+ if (Array.isArray(data)) {
1136
+ url = '/codeless/' +
1137
+ currMenuId.value + '/' +
1138
+ dialogButton.value.id + '/' +
1139
+ compInfo.value.dataModelId + '/saveModelList';
1140
+ } else {
1141
+ if (dialogButton.value.dialogPageId) {
1142
+ url = '/codeless/' +
1143
+ currMenuId.value + '/' +
1144
+ dialogButton.value.id + '/' +
1145
+ dialogButton.value.dialogPageId + '/savePage';
1146
+ } else {
1147
+ url = '/codeless/' +
1148
+ currMenuId.value + '/' +
1149
+ dialogButton.value.id + '/' +
1150
+ compInfo.value.dataModelId + '/saveModel';
1151
+ }
1152
+ }
1153
+ } else {
1154
+ if (dialogButton.value.type === '新增' ||
1155
+ dialogButton.value.type === '编辑' ||
1156
+ dialogButton.value.type === '批量编辑') {
1157
+ if (dialogButton.value.saveAndRun === '1') {
1158
+ url = '/codeless/' + currMenuId.value + '/' + dialogButton.value.id + '/';
1159
+ if (dialogButton.value.type === '批量编辑') {
1160
+ url += dialogButton.value.dialogFormId + '/saveFormList';
1161
+ } else if (dialogButton.value.dialogFormId) {
1162
+ url += dialogButton.value.dialogFormId + '/saveForm';
1163
+ } else if (dialogButton.value.dialogPageId) {
1164
+ url += dialogButton.value.dialogPageId + '/savePage';
1165
+ }
1166
+ } else if (dialogButton.value.executeScriptId) {
1167
+ url = '/codeless/script/' +
1168
+ currMenuId.value + '/' +
1169
+ dialogButton.value.id + '/' +
1170
+ dialogButton.value.executeScriptId + '/run';
1171
+ } else if (dialogButton.value.dialogFormId) {
1172
+ url = '/codeless/' + currMenuId.value + '/' + dialogButton.value.id + '/';
1173
+ if (dialogButton.value.type === '批量编辑') {
1174
+ url += dialogButton.value.dialogFormId + '/saveFormList';
1175
+ } else if (dialogButton.value.dialogFormId) {
1176
+ url += dialogButton.value.dialogFormId + '/saveForm';
1177
+ }
1178
+ } else if (dialogButton.value.dialogPageId) {
1179
+ url = '/codeless/' +
1180
+ currMenuId.value + '/' +
1181
+ dialogButton.value.id + '/' +
1182
+ dialogButton.value.dialogPageId + '/savePage';
1183
+ } else {
1184
+ ElMessage.error('按钮【' + dialogButton.value.name + '】未配置弹窗表单!');
1185
+ return;
1186
+ }
1187
+ }
1188
+ }
1189
+
1190
+ dialogLoading.value = true;
1191
+ api.post(url, data || dialogCompRef.value.getData()).then(res => {
1192
+ ElMessage.success(res.message);
1193
+ dialogLoading.value = false;
1194
+ dialogVisible.value = false;
1195
+ refreshCompData();
1196
+ }).catch(e => {
1197
+ dialogLoading.value = false;
1198
+ console.log('操作失败!', e);
1199
+ });
1200
+ }).catch(() => {});
1201
+ };
1202
+
1203
+ const doRunScript = async(button, data) => {
1204
+ if (button.submitPrompt) {
1205
+ const result = await ElMessageBox.confirm(button.submitPrompt, { type: 'warning' }).catch(() => {});
1206
+ if (!result) return;
1207
+ }
1208
+
1209
+ let param;
1210
+ if (Array.isArray(data)) {
1211
+ param = { dataList: data };
1212
+ } else if (Object.keys(data).length > 0) {
1213
+ param = data;
1214
+ } else {
1215
+ param = [];
1216
+ }
1217
+ button.loading = true;
1218
+ api.runScript(button.executeScriptId, param).then(res => {
1219
+ if (button.endRefresh === '1') {
1220
+ refreshCompData();
1221
+ }
1222
+ if (button.showExecuteResult === '1' && (res.data || res.message)) {
1223
+ ElMessage.success(res.data || res.message);
1224
+ } else {
1225
+ ElMessage.success(button.name + '成功!');
1226
+ }
1227
+ dialogLoading.value = false;
1228
+ dialogVisible.value = false;
1229
+ button.loading = false;
1230
+ }).catch(e => {
1231
+ console.log(e)
1232
+ button.loading = false;
1233
+ dialogLoading.value = false;
1234
+ });
1235
+ };
1236
+
1237
+ const refreshCompData = () => {
1238
+ compRef.value && compRef.value.refreshData && compRef.value.refreshData();
1239
+ };
1240
+
1241
+ const editChange = (data) => {
1242
+ const url = '/codeless/' +
1243
+ currMenuId.value + '/' +
1244
+ compInfo.value.dataModelId + '/saveModel';
1245
+ api.post(url, data).then(res => {
1246
+ ElMessage.success(res.message);
1247
+ dialogLoading.value = false;
1248
+ dialogVisible.value = false;
1249
+ // refreshCompData();
1250
+ }).catch(e => {
1251
+ dialogLoading.value = false;
1252
+ console.log('操作失败!', e);
1253
+ });
1254
+ };
1255
+
1256
+ const initDialogButton = async() => {
1257
+ dialogButtonList.value = (compInfo.value.buttonList || []).filter(item => item.showPosition.indexOf('表单') >= 0)
1258
+ };
1259
+
1260
+ const init = async() => {
1261
+ if (!props.pageCompId) {
1262
+ return;
1263
+ }
1264
+
1265
+ initializing.value = true;
1266
+ await loadCompInfo(props.pageCompId);
1267
+ await loadDataField();
1268
+ await loadPageButton();
1269
+ await initQueryOptions();
1270
+ await initDialogButton();
1271
+ await nextTick(() => initializing.value = false);
1272
+ };
1273
+
1274
+ const validate = (callback) => {
1275
+ const promise = new Promise((resolve, reject) => {
1276
+ compRef.value && compRef.value
1277
+ .validate(valid => resolve(valid))
1278
+ .catch(e => {
1279
+ console.log('组件校验异常!', e);
1280
+ reject(e);
1281
+ });
1282
+ });
1283
+ promise
1284
+ .then(valid => callback(valid))
1285
+ .catch(e => {
1286
+ console.log('组件校验异常!', e);
1287
+ callback(false);
1288
+ });
1289
+ return promise;
1290
+ };
1291
+
1292
+ const getData = () => {
1293
+ return compRef.value && compRef.value.getData && compRef.value.getData() || {};
1294
+ };
1295
+
1296
+ const dialogButtons = computed(() => {
1297
+ if (dialogButton.value.name === '批量编辑' || dialogButtonList.value.length === 0) return [];
1298
+ return dialogButtonList.value.filter(item => !item.bindButton || item.bindButton === dialogButton.value.name);
1299
+ });
1300
+
1301
+ onMounted(() => {
1302
+ init();
1303
+ });
1304
+
1305
+ defineExpose({ validate, getData, refreshCompData });
1306
+ </script>
1307
+
1308
+ <style scoped>
1309
+ .cc-dialog-form-button:hover {
1310
+ filter: opacity(0.7);
1311
+ }
1312
+ .cc-dialog-form-button:focus-visible {
1313
+ outline: unset;
1314
+ }
1315
+ .cc-dialog-form-button:active {
1316
+ filter: brightness(90%);
1317
+ }
1318
+ </style>