three-trees-ui 1.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 (384) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -0
  3. package/lib/demo.html +10 -0
  4. package/lib/three-trees-ui.common.js +49136 -0
  5. package/lib/three-trees-ui.css +1 -0
  6. package/lib/three-trees-ui.umd.js +49146 -0
  7. package/lib/three-trees-ui.umd.min.js +1 -0
  8. package/package.json +137 -0
  9. package/packages/AddQueryStrategy/index.js +7 -0
  10. package/packages/AddQueryStrategy/src/main.vue +236 -0
  11. package/packages/Autocomplete/index.js +7 -0
  12. package/packages/Autocomplete/src/main.vue +201 -0
  13. package/packages/Avatar/index.js +7 -0
  14. package/packages/Avatar/src/AvatarImage.vue +218 -0
  15. package/packages/Button/index.js +7 -0
  16. package/packages/Button/src/main.vue +90 -0
  17. package/packages/Cascader/index.js +7 -0
  18. package/packages/Cascader/src/main.vue +210 -0
  19. package/packages/Chart/index.js +7 -0
  20. package/packages/Chart/src/Chart.vue +856 -0
  21. package/packages/Checkbox/index.js +7 -0
  22. package/packages/Checkbox/src/main.vue +205 -0
  23. package/packages/Collapse/index.js +7 -0
  24. package/packages/Collapse/src/HtCollapse.vue +85 -0
  25. package/packages/Collapse/src/HtCollapseItem.vue +21 -0
  26. package/packages/CollapseItem/index.js +7 -0
  27. package/packages/CustomComponent/index.js +6 -0
  28. package/packages/CustomComponent/src/main.vue +87 -0
  29. package/packages/CustomDialog/index.js +7 -0
  30. package/packages/CustomDialog/src/customDialog.js +126 -0
  31. package/packages/CustomDialog/src/customDialog.vue +1864 -0
  32. package/packages/CustomDialog/src/customMobileDialog.vue +1619 -0
  33. package/packages/CustomDialog/src/main.vue +485 -0
  34. package/packages/DataView/index.js +7 -0
  35. package/packages/DataView/src/DataView.vue +45 -0
  36. package/packages/Date/index.js +7 -0
  37. package/packages/Date/src/main.vue +182 -0
  38. package/packages/DatePicker/index.js +7 -0
  39. package/packages/DatePicker/src/main.vue +155 -0
  40. package/packages/Demension/index.js +7 -0
  41. package/packages/Demension/src/main.vue +382 -0
  42. package/packages/Dialog/index.js +7 -0
  43. package/packages/Dialog/src/main.vue +169 -0
  44. package/packages/Dictionary/index.js +7 -0
  45. package/packages/Dictionary/src/main.vue +211 -0
  46. package/packages/DimensionSelector/index.js +7 -0
  47. package/packages/DimensionSelector/src/main.vue +526 -0
  48. package/packages/DimensionSelectorInput/index.js +7 -0
  49. package/packages/DimensionSelectorInput/src/main.vue +161 -0
  50. package/packages/Divider/index.js +7 -0
  51. package/packages/Divider/src/main.vue +38 -0
  52. package/packages/Duration/index.js +7 -0
  53. package/packages/Duration/src/main.vue +180 -0
  54. package/packages/Editor/index.js +7 -0
  55. package/packages/Editor/src/main.vue +320 -0
  56. package/packages/Explain/index.js +7 -0
  57. package/packages/Explain/src/main.vue +126 -0
  58. package/packages/FieldTail/index.js +7 -0
  59. package/packages/FieldTail/src/main.vue +188 -0
  60. package/packages/File/index.js +7 -0
  61. package/packages/File/src/FileCard.vue +169 -0
  62. package/packages/File/src/FileList.vue +180 -0
  63. package/packages/File/src/FileTable.vue +223 -0
  64. package/packages/File/src/main.vue +499 -0
  65. package/packages/FileUpload/index.js +7 -0
  66. package/packages/FileUpload/src/main.vue +242 -0
  67. package/packages/FlowChart/index.js +7 -0
  68. package/packages/FlowChart/src/main.vue +386 -0
  69. package/packages/FormItem/index.js +7 -0
  70. package/packages/FormItem/src/main.vue +175 -0
  71. package/packages/Global/index.js +12 -0
  72. package/packages/Global/src/GlobalQuery.vue +225 -0
  73. package/packages/Global/src/GlobalValidate.vue +132 -0
  74. package/packages/HistoricalApproval/index.js +7 -0
  75. package/packages/HistoricalApproval/src/main.vue +427 -0
  76. package/packages/Icon/index.js +7 -0
  77. package/packages/Icon/src/icons/ad.js +14 -0
  78. package/packages/Icon/src/icons/address-book.js +14 -0
  79. package/packages/Icon/src/icons/arrow.js +14 -0
  80. package/packages/Icon/src/icons/attachment.js +18 -0
  81. package/packages/Icon/src/icons/balance.js +14 -0
  82. package/packages/Icon/src/icons/ban.js +14 -0
  83. package/packages/Icon/src/icons/bell.js +14 -0
  84. package/packages/Icon/src/icons/block.js +26 -0
  85. package/packages/Icon/src/icons/book.js +14 -0
  86. package/packages/Icon/src/icons/bookmark.js +14 -0
  87. package/packages/Icon/src/icons/bug.js +22 -0
  88. package/packages/Icon/src/icons/bullhorn.js +14 -0
  89. package/packages/Icon/src/icons/calc.js +14 -0
  90. package/packages/Icon/src/icons/checkbox.js +14 -0
  91. package/packages/Icon/src/icons/circle.js +14 -0
  92. package/packages/Icon/src/icons/close.js +14 -0
  93. package/packages/Icon/src/icons/cloud-sun.js +14 -0
  94. package/packages/Icon/src/icons/coffee.js +14 -0
  95. package/packages/Icon/src/icons/component.js +14 -0
  96. package/packages/Icon/src/icons/compress.js +14 -0
  97. package/packages/Icon/src/icons/copyright.js +14 -0
  98. package/packages/Icon/src/icons/demension.js +18 -0
  99. package/packages/Icon/src/icons/dialog.js +14 -0
  100. package/packages/Icon/src/icons/down-unfold.js +18 -0
  101. package/packages/Icon/src/icons/download.js +14 -0
  102. package/packages/Icon/src/icons/duration.js +14 -0
  103. package/packages/Icon/src/icons/excel.js +18 -0
  104. package/packages/Icon/src/icons/expand.js +14 -0
  105. package/packages/Icon/src/icons/export.js +21 -0
  106. package/packages/Icon/src/icons/eye-slash.js +14 -0
  107. package/packages/Icon/src/icons/eye.js +14 -0
  108. package/packages/Icon/src/icons/file.js +18 -0
  109. package/packages/Icon/src/icons/form.js +14 -0
  110. package/packages/Icon/src/icons/ganged.js +14 -0
  111. package/packages/Icon/src/icons/gaode.js +27 -0
  112. package/packages/Icon/src/icons/gift.js +14 -0
  113. package/packages/Icon/src/icons/home.js +14 -0
  114. package/packages/Icon/src/icons/hotent.js +26 -0
  115. package/packages/Icon/src/icons/image.js +14 -0
  116. package/packages/Icon/src/icons/import.js +18 -0
  117. package/packages/Icon/src/icons/index.js +75 -0
  118. package/packages/Icon/src/icons/info.js +21 -0
  119. package/packages/Icon/src/icons/job.js +18 -0
  120. package/packages/Icon/src/icons/laptop.js +14 -0
  121. package/packages/Icon/src/icons/line.js +34 -0
  122. package/packages/Icon/src/icons/lock.js +14 -0
  123. package/packages/Icon/src/icons/map.js +18 -0
  124. package/packages/Icon/src/icons/more.js +19 -0
  125. package/packages/Icon/src/icons/move.js +14 -0
  126. package/packages/Icon/src/icons/org-tree.js +33 -0
  127. package/packages/Icon/src/icons/org-tree2.js +42 -0
  128. package/packages/Icon/src/icons/org.js +18 -0
  129. package/packages/Icon/src/icons/palette.js +14 -0
  130. package/packages/Icon/src/icons/plan.js +17 -0
  131. package/packages/Icon/src/icons/post.js +23 -0
  132. package/packages/Icon/src/icons/ppt.js +18 -0
  133. package/packages/Icon/src/icons/question.js +18 -0
  134. package/packages/Icon/src/icons/radio.js +14 -0
  135. package/packages/Icon/src/icons/refresh.js +14 -0
  136. package/packages/Icon/src/icons/role.js +38 -0
  137. package/packages/Icon/src/icons/search.js +14 -0
  138. package/packages/Icon/src/icons/select.js +14 -0
  139. package/packages/Icon/src/icons/setting.js +18 -0
  140. package/packages/Icon/src/icons/simple-collapse.js +18 -0
  141. package/packages/Icon/src/icons/simple-expand.js +14 -0
  142. package/packages/Icon/src/icons/sort.js +22 -0
  143. package/packages/Icon/src/icons/table.js +14 -0
  144. package/packages/Icon/src/icons/time.js +14 -0
  145. package/packages/Icon/src/icons/tree.js +14 -0
  146. package/packages/Icon/src/icons/typography.js +18 -0
  147. package/packages/Icon/src/icons/up-fold.js +18 -0
  148. package/packages/Icon/src/icons/upload.js +18 -0
  149. package/packages/Icon/src/icons/user.js +14 -0
  150. package/packages/Icon/src/icons/users.js +30 -0
  151. package/packages/Icon/src/icons/video.js +14 -0
  152. package/packages/Icon/src/icons/word.js +19 -0
  153. package/packages/Icon/src/main.vue +432 -0
  154. package/packages/Iframe/index.js +6 -0
  155. package/packages/Iframe/src/main.vue +208 -0
  156. package/packages/Image/index.js +7 -0
  157. package/packages/Image/src/main.vue +70 -0
  158. package/packages/Input/index.js +7 -0
  159. package/packages/Input/src/main.vue +659 -0
  160. package/packages/JobDialog/index.js +7 -0
  161. package/packages/JobDialog/src/main.vue +197 -0
  162. package/packages/JobSelector/index.js +7 -0
  163. package/packages/JobSelector/src/JobSelectorDialog.vue +305 -0
  164. package/packages/JobSelector/src/JobSelectorMobileDialog.vue +293 -0
  165. package/packages/JobSelector/src/main.vue +346 -0
  166. package/packages/JobSelectorInput/index.js +7 -0
  167. package/packages/JobSelectorInput/src/main.vue +166 -0
  168. package/packages/ListSelector/index.js +7 -0
  169. package/packages/ListSelector/src/ListSelector.vue +499 -0
  170. package/packages/Map/index.js +7 -0
  171. package/packages/Map/src/Map.vue +434 -0
  172. package/packages/Milepost/index.js +7 -0
  173. package/packages/Milepost/src/main.vue +45 -0
  174. package/packages/OnlineForm/index.js +7 -0
  175. package/packages/OnlineForm/src/Form.vue +659 -0
  176. package/packages/OrgPostDialog/index.js +7 -0
  177. package/packages/OrgPostDialog/src/main.vue +331 -0
  178. package/packages/OrgSelector/index.js +7 -0
  179. package/packages/OrgSelector/src/OrgSelectorDialog.vue +334 -0
  180. package/packages/OrgSelector/src/OrgSelectorMobileDialog.vue +307 -0
  181. package/packages/OrgSelector/src/Organization.vue +131 -0
  182. package/packages/OrgSelector/src/PolicyUser.vue +141 -0
  183. package/packages/OrgSelector/src/main.vue +409 -0
  184. package/packages/OrgSelectorInput/index.js +7 -0
  185. package/packages/OrgSelectorInput/src/OrgSelectorInput.vue +324 -0
  186. package/packages/PostDialog/index.js +7 -0
  187. package/packages/PostDialog/src/main.vue +309 -0
  188. package/packages/PostSelector/index.js +7 -0
  189. package/packages/PostSelector/src/Organization.vue +131 -0
  190. package/packages/PostSelector/src/PolicyUser.vue +141 -0
  191. package/packages/PostSelector/src/PostSelectorDialog.vue +342 -0
  192. package/packages/PostSelector/src/PostSelectorMobileDialog.vue +307 -0
  193. package/packages/PostSelector/src/main.vue +374 -0
  194. package/packages/PostSelectorInput/index.js +7 -0
  195. package/packages/PostSelectorInput/src/PostSelectorInput.vue +317 -0
  196. package/packages/Preview/index.js +7 -0
  197. package/packages/Preview/src/FillPage.vue +311 -0
  198. package/packages/Preview/src/FrameViewer.vue +157 -0
  199. package/packages/Preview/src/Loading.vue +126 -0
  200. package/packages/Preview/src/PdfViewer.vue +125 -0
  201. package/packages/Preview/src/TextViewer.vue +99 -0
  202. package/packages/Preview/src/main.vue +242 -0
  203. package/packages/Preview/src/watermark.js +124 -0
  204. package/packages/ProcessRecord/index.js +7 -0
  205. package/packages/ProcessRecord/src/main.vue +396 -0
  206. package/packages/Qrcode/index.js +7 -0
  207. package/packages/Qrcode/src/Qrcode.vue +110 -0
  208. package/packages/QuerySqlPreview/index.js +7 -0
  209. package/packages/QuerySqlPreview/src/QuerySqlPreview.vue +163 -0
  210. package/packages/Radio/index.js +7 -0
  211. package/packages/Radio/src/main.vue +174 -0
  212. package/packages/Rate/index.js +7 -0
  213. package/packages/Rate/src/main.vue +141 -0
  214. package/packages/ReadonlyInput/index.js +7 -0
  215. package/packages/ReadonlyInput/src/main.vue +92 -0
  216. package/packages/RelevantFlow/index.js +7 -0
  217. package/packages/RelevantFlow/src/main.vue +579 -0
  218. package/packages/RelevantFlow/src/relevantFlow.js +35 -0
  219. package/packages/RoleDialog/index.js +7 -0
  220. package/packages/RoleDialog/src/main.vue +198 -0
  221. package/packages/RoleSelector/index.js +7 -0
  222. package/packages/RoleSelector/src/RoleSelectorDialog.vue +307 -0
  223. package/packages/RoleSelector/src/RoleSelectorMobileDialog.vue +293 -0
  224. package/packages/RoleSelector/src/main.vue +367 -0
  225. package/packages/RoleSelectorInput/index.js +7 -0
  226. package/packages/RoleSelectorInput/src/main.vue +166 -0
  227. package/packages/SaveButton/index.js +7 -0
  228. package/packages/SaveButton/src/main.vue +73 -0
  229. package/packages/Select/index.js +7 -0
  230. package/packages/Select/src/main.vue +376 -0
  231. package/packages/SelectTree/index.js +7 -0
  232. package/packages/SelectTree/src/SelectTree.vue +360 -0
  233. package/packages/Selector/index.js +7 -0
  234. package/packages/Selector/src/main.vue +623 -0
  235. package/packages/SidebarDialog/index.js +7 -0
  236. package/packages/SidebarDialog/src/main.vue +156 -0
  237. package/packages/Slider/index.js +7 -0
  238. package/packages/Slider/src/main.vue +141 -0
  239. package/packages/Step/index.js +7 -0
  240. package/packages/StepLayout/index.js +7 -0
  241. package/packages/Steps/index.js +7 -0
  242. package/packages/Steps/src/Step.vue +139 -0
  243. package/packages/Steps/src/StepLayout.vue +35 -0
  244. package/packages/Steps/src/Steps.vue +65 -0
  245. package/packages/Subtable/index.js +33 -0
  246. package/packages/Subtable/src/SubDialog.vue +2145 -0
  247. package/packages/Subtable/src/SubExportDialog.vue +115 -0
  248. package/packages/Subtable/src/SubImportDialog.vue +340 -0
  249. package/packages/Subtable/src/SubPagination.vue +128 -0
  250. package/packages/Subtable/src/SubtableBackfill.vue +150 -0
  251. package/packages/Subtable/src/dialog.js +42 -0
  252. package/packages/Switch/index.js +7 -0
  253. package/packages/Switch/src/main.vue +92 -0
  254. package/packages/Table/index.js +7 -0
  255. package/packages/Table/src/CustomColumn.vue +353 -0
  256. package/packages/Table/src/Table.vue +1031 -0
  257. package/packages/TableColumn/index.js +7 -0
  258. package/packages/TableColumn/src/main.vue +189 -0
  259. package/packages/TableSearchField/index.js +7 -0
  260. package/packages/TableSearchField/src/main.vue +334 -0
  261. package/packages/TableSearchPanel/index.js +7 -0
  262. package/packages/TableSearchPanel/src/main.vue +182 -0
  263. package/packages/Tabs/index.js +7 -0
  264. package/packages/Tabs/src/Tabs.vue +140 -0
  265. package/packages/Tag/index.js +7 -0
  266. package/packages/Tag/src/main.vue +266 -0
  267. package/packages/TemplateBatchUpdate/index.js +7 -0
  268. package/packages/TemplateBatchUpdate/src/TemplateBatchUpdateDialog.vue +175 -0
  269. package/packages/TemplateForm/index.js +7 -0
  270. package/packages/TemplateForm/src/main.vue +661 -0
  271. package/packages/TemplateFormDialog/index.js +7 -0
  272. package/packages/TemplateFormDialog/src/main.vue +97 -0
  273. package/packages/TemplateIframeDialog/index.js +7 -0
  274. package/packages/TemplateIframeDialog/src/main.vue +72 -0
  275. package/packages/TemplateImportResult/index.js +7 -0
  276. package/packages/TemplateImportResult/src/main.vue +206 -0
  277. package/packages/TemplatePreview/index.js +19 -0
  278. package/packages/TemplatePreview/src/TemplatePreview.vue +239 -0
  279. package/packages/TemplatePreview/src/TemplatePreviewFile.vue +179 -0
  280. package/packages/TemplatePreview/src/TemplatePreviewImage.vue +83 -0
  281. package/packages/TemplateTaskCirculate/index.js +7 -0
  282. package/packages/TemplateTaskCirculate/src/main.vue +258 -0
  283. package/packages/Text/index.js +7 -0
  284. package/packages/Text/src/main.vue +58 -0
  285. package/packages/TimePicker/index.js +7 -0
  286. package/packages/TimePicker/src/main.vue +149 -0
  287. package/packages/TimeSelect/index.js +7 -0
  288. package/packages/TimeSelect/src/main.vue +106 -0
  289. package/packages/Tree/index.js +7 -0
  290. package/packages/Tree/src/main.vue +443 -0
  291. package/packages/TreeDialog/index.js +7 -0
  292. package/packages/TreeDialog/src/main.vue +322 -0
  293. package/packages/TreeListDialog/index.js +7 -0
  294. package/packages/TreeListDialog/src/main.vue +219 -0
  295. package/packages/Typography/index.js +8 -0
  296. package/packages/Typography/src/create-header.js +72 -0
  297. package/packages/UserDialog/index.js +7 -0
  298. package/packages/UserDialog/src/main.vue +393 -0
  299. package/packages/UserSelector/index.js +7 -0
  300. package/packages/UserSelector/src/Organization.vue +131 -0
  301. package/packages/UserSelector/src/PolicyUser.vue +141 -0
  302. package/packages/UserSelector/src/RoleUser.vue +139 -0
  303. package/packages/UserSelector/src/TopContactUser.vue +109 -0
  304. package/packages/UserSelector/src/UserSelectorDialog.vue +370 -0
  305. package/packages/UserSelector/src/UserSelectorMobileDialog.vue +332 -0
  306. package/packages/UserSelector/src/main.vue +519 -0
  307. package/packages/UserSelectorInput/index.js +7 -0
  308. package/packages/UserSelectorInput/src/main.vue +374 -0
  309. package/packages/picture/index.js +7 -0
  310. package/packages/picture/src/main.vue +736 -0
  311. package/packages/plugins/Echarts.js +30 -0
  312. package/packages/plugins/Map.js +29 -0
  313. package/packages/plugins/Preview.js +49 -0
  314. package/packages/plugins/Qrcode.js +7 -0
  315. package/packages/plugins/XLSX.js +7 -0
  316. package/packages/plugins/wangeditor.js +19 -0
  317. package/src/assets/icon_found_img.png +0 -0
  318. package/src/assets/no-data.png +0 -0
  319. package/src/assets/table-no-data.png +0 -0
  320. package/src/directive/badge.js +53 -0
  321. package/src/directive/copy.js +47 -0
  322. package/src/directive/ellipsis.js +6 -0
  323. package/src/directive/expandClick.js +23 -0
  324. package/src/directive/express.js +86 -0
  325. package/src/directive/form.js +122 -0
  326. package/src/directive/format.js +24 -0
  327. package/src/directive/formulas.js +710 -0
  328. package/src/directive/index.js +42 -0
  329. package/src/directive/permissionLine.js +59 -0
  330. package/src/directive/permissionLineLable.js +56 -0
  331. package/src/directive/permit.js +23 -0
  332. package/src/directive/popconfirm.js +86 -0
  333. package/src/directive/relatedQuery.js +61 -0
  334. package/src/directive/resize.js +18 -0
  335. package/src/directive/subSort.js +18 -0
  336. package/src/directive/tableDrag.js +25 -0
  337. package/src/directive/tooltip.js +37 -0
  338. package/src/filter/computerSize.js +23 -0
  339. package/src/filter/dateFormat.js +10 -0
  340. package/src/filter/index.js +10 -0
  341. package/src/index.js +295 -0
  342. package/src/locale/format.js +44 -0
  343. package/src/locale/index.js +48 -0
  344. package/src/locale/lang/en.js +59 -0
  345. package/src/locale/lang/zh-CN.js +59 -0
  346. package/src/locale/lang/zh-TW.js +57 -0
  347. package/src/locale/validate/dict.js +278 -0
  348. package/src/math.js +270 -0
  349. package/src/mixins/dialog.js +16 -0
  350. package/src/mixins/emitter.js +33 -0
  351. package/src/mixins/form.js +33 -0
  352. package/src/mixins/formDataUpdate.js +32 -0
  353. package/src/mixins/ganged.js +131 -0
  354. package/src/mixins/inputName.js +30 -0
  355. package/src/mixins/linkage.js +414 -0
  356. package/src/mixins/locale.js +9 -0
  357. package/src/mixins/mobileMode.js +27 -0
  358. package/src/mixins/onlineHottable.js +128 -0
  359. package/src/mixins/onlineSubtable.js +538 -0
  360. package/src/mixins/permission.js +94 -0
  361. package/src/mixins/querySqlPreview.js +852 -0
  362. package/src/mixins/regionValidator.js +70 -0
  363. package/src/mixins/script.js +37 -0
  364. package/src/mixins/templatePreview.js +4527 -0
  365. package/src/plugins/loading/index.js +37 -0
  366. package/src/plugins/loading/index.vue +18 -0
  367. package/src/service.js +336 -0
  368. package/src/services/CustomQuery.js +197 -0
  369. package/src/services/SubPagination.js +132 -0
  370. package/src/services/commonScripts.js +45 -0
  371. package/src/styles/index.scss +7 -0
  372. package/src/styles/selector.css +140 -0
  373. package/src/styles/selector.min.css +1 -0
  374. package/src/styles/selector.scss +130 -0
  375. package/src/styles/variables.css +67 -0
  376. package/src/styles/variables.min.css +1 -0
  377. package/src/styles/variables.scss +109 -0
  378. package/src/util/base64.js +46 -0
  379. package/src/util/brower.js +15 -0
  380. package/src/util/clone.js +61 -0
  381. package/src/util/path.js +4 -0
  382. package/src/util/request.js +14 -0
  383. package/src/utils.js +1242 -0
  384. package/src/validate.js +256 -0
@@ -0,0 +1,128 @@
1
+ export default {
2
+ watch: {
3
+ hotTableFillback: function(newVal) {
4
+ if (newVal) {
5
+ let newValArray = newVal.split('_timestamp_')
6
+ let boPathArray = newValArray[0].split('.')
7
+ let hotTableRef = 'hottable.' + boPathArray[0] + '.' + boPathArray[1]
8
+ let subBo = this.data[boPathArray[0]][boPathArray[1]]
9
+ this.$refs.onlineForm.$refs[hotTableRef].fillbackHotTableData(subBo)
10
+ }
11
+ },
12
+ },
13
+ mounted() {
14
+ this.isFormItemBorder()
15
+ //初始化handsontable数据
16
+ if (this.data) {
17
+ const formId = this.formId
18
+ let _this = this
19
+ if (!formId) {
20
+ this.toInitTemolateData(this.initFillData)
21
+ } else {
22
+ const loading = this.$loading({
23
+ lock: true,
24
+ text: '正在获取初始化信息...',
25
+ spinner: 'el-icon-loading',
26
+ background: 'rgba(0, 0, 0, 0.7)',
27
+ })
28
+ this.$requestConfig.getFormById(formId).then(
29
+ (resp) => {
30
+ if (resp.data) {
31
+ const formData = resp.data.data
32
+ for (const key in formData) {
33
+ if (formData.hasOwnProperty(key)) {
34
+ if (!_this.data[key]) {
35
+ _this.data[key] = formData[key]
36
+ }
37
+ }
38
+ }
39
+ loading.close()
40
+ _this.toInitTemolateData(this.initFillData)
41
+ } else {
42
+ loading.close()
43
+ _this.toInitTemolateData(this.initFillData)
44
+ }
45
+ },
46
+ () => {
47
+ loading.close()
48
+ _this.toInitTemolateData(this.initFillData)
49
+ }
50
+ )
51
+ }
52
+ }
53
+ },
54
+ methods: {
55
+ // 有边框时
56
+ isFormItemBorder() {
57
+ const cols = document.querySelectorAll('.el-row--flex .el-col-12')
58
+ const colItems = Array.from(cols)
59
+ if (colItems.length) {
60
+ for (let i = 0; i < colItems.length; i++) {
61
+ let item = colItems[i]
62
+ if (
63
+ item.style.borderStyle &&
64
+ item.children &&
65
+ item.children.length > 0
66
+ ) {
67
+ item.parentNode.style.marginBottom = '20px'
68
+ Array.from(item.children).forEach((child) => {
69
+ child.style.margin = '24px 24px 22px 24px'
70
+ })
71
+ } else {
72
+ item.style.marginRight = '24px'
73
+ }
74
+ }
75
+ }
76
+ },
77
+ toInitTemolateData(initFillData) {
78
+ if (!this.data) {
79
+ return
80
+ }
81
+ const formData = this.data
82
+ let refs = this.$refs
83
+ for (const def in formData) {
84
+ if (formData.hasOwnProperty(def)) {
85
+ const boDef = formData[def]
86
+ for (const bo in boDef) {
87
+ if (boDef.hasOwnProperty(bo) && bo.indexOf('sub_') == 0) {
88
+ const ref = 'hottable.' + def + '.' + bo
89
+ if (refs[ref]) {
90
+ try {
91
+ refs[ref].fillbackHotTableData(
92
+ formData[def][bo],
93
+ this.permission
94
+ )
95
+ if (initFillData) {
96
+ refs[ref].initTemplateData()
97
+ }
98
+ } catch (error) {
99
+ error
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ },
107
+ addInitTemplateData(subTablePath) {
108
+ const hotTableRef = 'hottable.' + subTablePath
109
+ this.$refs[hotTableRef].toAddInitTemplateData()
110
+ },
111
+ mergeCellRefresh(subTablePath) {
112
+ const hotTableRef = 'hottable.' + subTablePath
113
+ this.$refs[hotTableRef].mergeCellRefresh()
114
+ },
115
+ execCellMathExp(subTablePath) {
116
+ const hotTableRef = 'hottable.' + subTablePath
117
+ this.$refs[hotTableRef].execCellMathExp()
118
+ },
119
+ execCrossMapping(subTablePath) {
120
+ const hotTableRef = 'hottable.' + subTablePath
121
+ this.$refs[hotTableRef].execCrossMapping()
122
+ },
123
+ getHotTableData(subTablePath) {
124
+ const hotTableRef = 'hottable.' + subTablePath
125
+ this.$refs[hotTableRef].getHotTableData()
126
+ },
127
+ },
128
+ }
@@ -0,0 +1,538 @@
1
+ import SubPagination from '../services/SubPagination.js'
2
+
3
+ export default {
4
+ data() {
5
+ return {
6
+ fillOrg: {},
7
+ fillOrgConfMap: {},
8
+ transitionIndex: -1,
9
+ left_image: '',
10
+ right_image: '',
11
+ }
12
+ },
13
+ computed: {
14
+ // 子表前端分页过滤器
15
+ pagingSubData() {
16
+ const me = this
17
+ return function(datapath) {
18
+ // 通过子表数据路径获取分页数据
19
+ return SubPagination.pagingByPath(datapath, me)
20
+ }
21
+ },
22
+ // 获取子表分页 offset
23
+ getPageOffset() {
24
+ return (datapath) => {
25
+ return SubPagination.getPageOffset(datapath, this)
26
+ }
27
+ },
28
+ },
29
+ mounted() {
30
+ // 如果当前表单的element为Comment说明表单加载失败了。
31
+ if (this.$el && this.$el.constructor == Comment) {
32
+ this.$emit('load-fail')
33
+ return
34
+ }
35
+ this.$validator = this.$root.$validator
36
+ if (this.permission.table) {
37
+ for (let subTableName in this.permission.table) {
38
+ if (this.permission.table[subTableName].required) {
39
+ this.addSubTableByName(subTableName)
40
+ }
41
+ }
42
+ }
43
+ this.$emit('load-success', true)
44
+ if (this.isPrint) {
45
+ this.printDetail()
46
+ }
47
+ },
48
+ methods: {
49
+ getExpandArr(data, type) {
50
+ if (type === 'expand' && data) {
51
+ let arr = []
52
+ data.forEach((item) => {
53
+ arr.push(item.sub_guid)
54
+ })
55
+ return arr
56
+ }
57
+ return data && data.length ? [data[0].sub_guid] : []
58
+ },
59
+ printDetail() {
60
+ window.print()
61
+ if (this.isPrint) {
62
+ this.$router.go(-1)
63
+ }
64
+ setTimeout(function() {
65
+ location.reload()
66
+ }, 200)
67
+ },
68
+ //子表上移
69
+ up(index, data) {
70
+ if (index === 0) {
71
+ this.$message({
72
+ message: '已经是列表中第一位',
73
+ type: 'warning',
74
+ })
75
+ } else {
76
+ let temp = data[index - 1]
77
+ this.$set(data, index - 1, data[index])
78
+ this.$set(data, index, temp)
79
+ }
80
+ },
81
+ //子表下移
82
+ down(index, data) {
83
+ if (index === data.length - 1) {
84
+ this.$message({
85
+ message: '已经是列表中最后一位',
86
+ type: 'warning',
87
+ })
88
+ } else {
89
+ this.isTransition = true
90
+ let i = data[index + 1]
91
+ this.$set(data, index + 1, data[index])
92
+ this.$set(data, index, i)
93
+ }
94
+ },
95
+ //子表复制数据
96
+ copy(obj, item, subPath) {
97
+ let newOne = JSON.parse(JSON.stringify(item))
98
+ //把id置空以免走的修改方法
99
+ if (newOne.id_) {
100
+ delete newOne.id_
101
+ }
102
+ if (newOne.sub_row_readonly) {
103
+ delete newOne.sub_row_readonly
104
+ }
105
+ //有孙表时,删除孙表id_
106
+ for (let key in newOne) {
107
+ if (key.startsWith('sub_') && Array.isArray(newOne[key])) {
108
+ if (newOne[key].length) {
109
+ newOne[key].forEach((it) => {
110
+ it.id_ && delete it.id_
111
+ })
112
+ }
113
+ }
114
+ }
115
+ if (subPath) {
116
+ const watchMap = this.watchMap
117
+ // 判断当前是否有绑定流水号的字段
118
+ if (watchMap) {
119
+ const bindIdentityModelNameList = watchMap.get(
120
+ 'bindIdentityModelNameList'
121
+ )
122
+ if (
123
+ bindIdentityModelNameList &&
124
+ bindIdentityModelNameList.length > 0
125
+ ) {
126
+ bindIdentityModelNameList.forEach((bim) => {
127
+ if (bim.startsWith(subPath)) {
128
+ // 如果有则删除复制数据中原来的流水号值
129
+ delete newOne[bim.replace(`${subPath}.`, '')]
130
+ }
131
+ })
132
+ }
133
+ }
134
+ }
135
+ newOne.sub_guid = this.guid()
136
+ this.$root.$emit('add-new-collapse-item', newOne.sub_guid)
137
+ obj.push(newOne)
138
+ this.$forceUpdate()
139
+ },
140
+ //子表默认值回填
141
+ addSubTab(subTabPath) {
142
+ let pathArr = subTabPath.split('.')
143
+ if (pathArr.length < 3) {
144
+ this.$message({
145
+ message: '子表路径有误',
146
+ type: 'warning',
147
+ })
148
+ } else {
149
+ let subTabName = pathArr[2].replace('sub_', '')
150
+ let subInitData = this.data[pathArr[1]].initData[subTabName] || {}
151
+ //判断当前子表是否存有回显值
152
+ if (
153
+ this.$parent.subBackfill &&
154
+ this.$parent.subBackfill.has(subTabPath)
155
+ ) {
156
+ subInitData = this.$parent.subBackfill.get(subTabPath)
157
+ }
158
+ //把数组里面的值为 null 转换为空字符串
159
+ let str = JSON.stringify(subInitData).replace(/null/g, '""')
160
+ let subData = JSON.parse(str)
161
+ const subDataArr = this.data[pathArr[1]][pathArr[2]]
162
+ //子表添加后的长度,因为在nextTick中,子表已经添加完毕。
163
+ const nextIndex = subDataArr.length
164
+ for (var key in subData) {
165
+ //点添加时判断要新增子表记录中的孙表是否有值
166
+ if (key.indexOf('sub_') == 0) {
167
+ if (subData[key].length > 0) {
168
+ subData[key] = [] //有则清空
169
+ }
170
+ const sunTabName = key.replace('sub_', '')
171
+ if (
172
+ this.permission.table[sunTabName] &&
173
+ (this.permission.table[sunTabName].required == true ||
174
+ this.permission.table[sunTabName].required == 'true')
175
+ ) {
176
+ this.$nextTick(() => {
177
+ this.addSunTab(`${subTabPath}.${key}`, nextIndex)
178
+ })
179
+ }
180
+ }
181
+ }
182
+ let fillObj = this.toFillOrg(pathArr[1] + '.' + pathArr[2], subData)
183
+ fillObj.sub_guid = this.guid()
184
+ this.$root.$emit('add-new-collapse-item', fillObj.sub_guid)
185
+ subDataArr.push(fillObj)
186
+ }
187
+ },
188
+ //子表添加头部样式
189
+ handleCellStyle({ column }) {
190
+ let ColBgColor
191
+ if (column.className) {
192
+ ColBgColor = column.className.split('__')[1]
193
+ }
194
+ return ColBgColor ? { background: ColBgColor } : {}
195
+ },
196
+ //子表表头颜色
197
+ handleRowStyle(color) {
198
+ return { '--headerBgColor': color ? color : '#f4f4f4' }
199
+ },
200
+ guid() {
201
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(
202
+ c
203
+ ) {
204
+ var r = (Math.random() * 16) | 0,
205
+ v = c == 'x' ? r : (r & 0x3) | 0x8
206
+ return v.toString(16)
207
+ })
208
+ },
209
+ //孙表默认值回填
210
+ addSunTab(subTabPath, index) {
211
+ let pathArr = subTabPath.split('.')
212
+ if (pathArr.length < 4) {
213
+ this.$message({
214
+ message: '孙表路径有误',
215
+ type: 'warning',
216
+ })
217
+ } else {
218
+ const subTablePath = pathArr.filter((item, index) => index !== 3)
219
+ const subIndex = this.getPageOffset(subTablePath.join('.')) + index
220
+ let subTabName = pathArr[2].replace('sub_', '')
221
+ let sunTabName = pathArr[3].replace('sub_', '')
222
+ let subTable = this.data[pathArr[1]][pathArr[2]][subIndex]
223
+ if (!subTable.hasOwnProperty(pathArr[3])) {
224
+ this.$set(subTable, pathArr[3], new Array())
225
+ }
226
+ let subInitData =
227
+ this.data[pathArr[1]].initData[subTabName].initData[sunTabName] || {}
228
+ //判断当前孙表是否存有回显值
229
+ if (
230
+ this.$parent.subBackfill &&
231
+ this.$parent.subBackfill.has(subTabPath)
232
+ ) {
233
+ //this.data[pathArr[1]][pathArr[2]].push(this.$parent.subBackfill.get(subTabPath));
234
+ subInitData = this.$parent.subBackfill.get(subTabPath)
235
+ }
236
+ //把数组里面的值为 null 转换为空字符串
237
+ let str = JSON.stringify(subInitData).replace(/null/g, '""')
238
+ if (!this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]]) {
239
+ let key = [pathArr[3]]
240
+ let value = new Array()
241
+ this.data[pathArr[1]][pathArr[2]][subIndex][key] = value
242
+ }
243
+ let sunBodata = JSON.parse(str)
244
+ sunBodata.sub_guid = this.guid()
245
+ this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]].push(sunBodata)
246
+ this.$root.$emit('add-new-collapse-item', sunBodata.sub_guid)
247
+ this.$forceUpdate() //迫使 Vue 实例重新渲染
248
+ }
249
+ },
250
+
251
+ addSubTableByName(subTableName) {
252
+ for (let boAlias in this.data) {
253
+ let subInitData = JSON.parse(
254
+ JSON.stringify(this.data[boAlias].initData[subTableName] || {})
255
+ )
256
+ if (
257
+ this.data[boAlias]['sub_' + subTableName] &&
258
+ this.data[boAlias]['sub_' + subTableName].length < 1
259
+ ) {
260
+ this.data[boAlias]['sub_' + subTableName].push(
261
+ JSON.parse(JSON.stringify(subInitData))
262
+ )
263
+ // 孙表必填 默认添加一条
264
+ if (this.permission.table) {
265
+ for (let tableName in this.permission.table) {
266
+ if (this.permission.table[tableName].required) {
267
+ if (
268
+ this.data[boAlias]['sub_' + subTableName][0].hasOwnProperty(
269
+ 'sub_' + tableName
270
+ ) &&
271
+ this.data[boAlias]['sub_' + subTableName][0][
272
+ 'sub_' + tableName
273
+ ] &&
274
+ this.data[boAlias]['sub_' + subTableName][0][
275
+ 'sub_' + tableName
276
+ ].length < 1
277
+ ) {
278
+ this.data[boAlias]['sub_' + subTableName][0][
279
+ 'sub_' + tableName
280
+ ].push(
281
+ JSON.parse(JSON.stringify(subInitData.initData[tableName]))
282
+ )
283
+ } else if (
284
+ this.data[boAlias]['sub_' + subTableName][0].hasOwnProperty(
285
+ 'sub_' + tableName
286
+ ) &&
287
+ !this.data[boAlias]['sub_' + subTableName][0][
288
+ 'sub_' + tableName
289
+ ]
290
+ ) {
291
+ this.data[boAlias]['sub_' + subTableName][0][
292
+ 'sub_' + tableName
293
+ ] = []
294
+ this.data[boAlias]['sub_' + subTableName][0][
295
+ 'sub_' + tableName
296
+ ].push(subInitData.initData[tableName])
297
+ }
298
+ }
299
+ }
300
+ }
301
+ }
302
+ }
303
+ },
304
+ deleteRow(subTablePath, item) {
305
+ let pathArr = subTablePath.split('.')
306
+ if (pathArr.length < 2) {
307
+ this.$message({
308
+ message: '子表路径有误',
309
+ type: 'warning',
310
+ })
311
+ } else {
312
+ let subTabName = pathArr[1].replace('sub_', '')
313
+ if (
314
+ this.data[pathArr[0]][pathArr[1]].length == 1 &&
315
+ (this.permission.table[subTabName].required == true ||
316
+ this.permission.table[subTabName].required == 'true')
317
+ ) {
318
+ this.$message({
319
+ message: '子表必填一条记录',
320
+ type: 'warning',
321
+ })
322
+ return
323
+ }
324
+ this.data[pathArr[0]][pathArr[1]].remove(item)
325
+ }
326
+ },
327
+ deleteSunRow(subTablePath, item, subIndex) {
328
+ let pathArr = subTablePath.split('.')
329
+ if (pathArr.length < 3) {
330
+ this.$message({
331
+ message: '孙表路径有误',
332
+ type: 'warning',
333
+ })
334
+ } else {
335
+ let subTabName = pathArr[1].replace('sub_', '')
336
+ let sunTabName = pathArr[2].replace('sub_', '')
337
+ if (
338
+ this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].length == 1 &&
339
+ (this.permission.table[sunTabName].required == true ||
340
+ this.permission.table[subTabName].required == 'true')
341
+ ) {
342
+ this.$message({
343
+ message: '孙表必填一条记录',
344
+ type: 'warning',
345
+ })
346
+ return
347
+ }
348
+ this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]].remove(item)
349
+ this.data = Object.assign({}, this.data)
350
+ }
351
+ },
352
+ clearAllMessageBox(data) {
353
+ this.$confirm('确认执行该操作?', '提示', {
354
+ confirmButtonText: '确定',
355
+ cancelButtonText: '取消',
356
+ type: 'warning',
357
+ })
358
+ .then(() => {
359
+ this.clearAll(data)
360
+ })
361
+ .catch(() => {
362
+ this.$message({
363
+ type: 'info',
364
+ message: '已取消操作',
365
+ })
366
+ })
367
+ },
368
+ clearAll(args) {
369
+ const { subTablePath, isHot, index } = args
370
+ let pathArr
371
+ if (!subTablePath) {
372
+ pathArr = args.split('.')
373
+ } else {
374
+ pathArr = subTablePath.split('.')
375
+ }
376
+
377
+ if (pathArr.length < 2) {
378
+ this.$message({
379
+ message: '子表路径有误',
380
+ type: 'warning',
381
+ })
382
+ //孙表
383
+ } else if ((index || index === 0) && pathArr.length == 3) {
384
+ const sunTabName = pathArr[2].replace('sub_', '')
385
+ if (
386
+ this.permission.table[sunTabName].required == true ||
387
+ this.permission.table[sunTabName] == 'true'
388
+ ) {
389
+ this.$message.warning('孙表必填,至少保留一条记录')
390
+ return
391
+ }
392
+ const _subPath = `data.${pathArr[0]}.${pathArr[1]}`
393
+ const subIndex = this.getPageOffset(_subPath) + index
394
+ const ary = this.data[pathArr[0]][pathArr[1]][subIndex][pathArr[2]]
395
+ if (ary instanceof Array) {
396
+ ary.splice(0, ary.length)
397
+ }
398
+ } else {
399
+ const subTabName = pathArr[1].replace('sub_', '')
400
+ if (
401
+ this.data[pathArr[0]][pathArr[1]].length == 1 &&
402
+ (this.permission.table[subTabName].required == true ||
403
+ this.permission.table[subTabName].required == 'true')
404
+ ) {
405
+ this.$message({
406
+ message: '子表必填,至少保留一条记录。',
407
+ type: 'warning',
408
+ })
409
+ return
410
+ }
411
+ const ary = this.data[pathArr[0]][pathArr[1]]
412
+ if (ary instanceof Array) {
413
+ ary.splice(0, ary.length)
414
+ }
415
+ if (isHot) {
416
+ const hotTableRef = 'hottable.' + subTablePath
417
+ this.$refs[hotTableRef].fillbackHotTableData(null)
418
+ }
419
+ }
420
+ },
421
+ toFillOrg(path, row) {
422
+ const fillOrgConf = this.fillOrgConfMap[path]
423
+ let fillObj = {}
424
+ if (fillOrgConf && this.fillOrg) {
425
+ if (fillOrgConf.name) {
426
+ const namePath = fillOrgConf.name.split('.')
427
+ fillObj[namePath[namePath.length - 1]] = this.fillOrg.name
428
+ }
429
+ if (fillOrgConf.id) {
430
+ const idPath = fillOrgConf.id.split('.')
431
+ fillObj[idPath[idPath.length - 1]] = this.fillOrg.id
432
+ }
433
+ if (fillOrgConf.code) {
434
+ const codePath = fillOrgConf.code.split('.')
435
+ fillObj[codePath[codePath.length - 1]] = this.fillOrg.code
436
+ }
437
+ if (fillOrgConf.instId) {
438
+ const instIdPath = fillOrgConf.instId.split('.')
439
+ fillObj[instIdPath[instIdPath.length - 1]] = this.$parent.$parent
440
+ .instId
441
+ ? this.$parent.$parent.instId
442
+ : ''
443
+ }
444
+ return { ...row, ...fillObj }
445
+ }
446
+ return row
447
+ },
448
+ initFill(path, conf) {
449
+ //收集自动回填信息
450
+ if (path && conf) {
451
+ try {
452
+ const confJson = this.fillOrgConfMap[path]
453
+ ? this.fillOrgConfMap[path]
454
+ : JSON.parse(conf)
455
+ if (
456
+ confJson.id ||
457
+ confJson.code ||
458
+ confJson.name ||
459
+ confJson.instId
460
+ ) {
461
+ this.fillOrgConfMap[path] = confJson
462
+ this.initFirstFill(path, confJson)
463
+ }
464
+ } catch (error) {
465
+ error
466
+ }
467
+ }
468
+ },
469
+ initFirstFill(path, conf) {
470
+ //处理第一行的回填
471
+ const paths = path.split('.')
472
+ if (
473
+ this.data[paths[0]][paths[1]] &&
474
+ this.data[paths[0]][paths[1]].length == 1 &&
475
+ this.fillOrg.id
476
+ ) {
477
+ if (conf.id) {
478
+ const idPath = conf.id.split('.')
479
+ if (!this.data[paths[0]][paths[1]][0][idPath[2]]) {
480
+ this.data[paths[0]][paths[1]][0][idPath[2]] = this.fillOrg.id
481
+ if (conf.code) {
482
+ const codePath = conf.code.split('.')
483
+ if (!this.data[paths[0]][paths[1]][0][codePath[2]]) {
484
+ this.data[paths[0]][paths[1]][0][
485
+ codePath[2]
486
+ ] = this.fillOrg.code
487
+ }
488
+ }
489
+ if (conf.name) {
490
+ const namePath = conf.name.split('.')
491
+ if (!this.data[paths[0]][paths[1]][0][namePath[2]]) {
492
+ this.data[paths[0]][paths[1]][0][
493
+ namePath[2]
494
+ ] = this.fillOrg.name
495
+ }
496
+ }
497
+ }
498
+ }
499
+ if (conf.instId) {
500
+ const instIdPath = conf.instId.split('.')
501
+ if (!this.data[paths[0]][paths[1]][0][instIdPath[2]]) {
502
+ this.data[paths[0]][paths[1]][0][instIdPath[2]] = this.$parent
503
+ .$parent.instId
504
+ ? this.$parent.$parent.instId
505
+ : ''
506
+ }
507
+ }
508
+ }
509
+ },
510
+ isShowAddButton(path, maxRow, subIndex) {
511
+ if (maxRow === 0) return false
512
+ let pathArr = path.split('.')
513
+ if (subIndex >= 0) {
514
+ if (pathArr.length < 4) {
515
+ this.$message({
516
+ message: '子表路径有误',
517
+ type: 'warning',
518
+ })
519
+ } else {
520
+ let data =
521
+ this.data[pathArr[1]][pathArr[2]][subIndex][pathArr[3]] || []
522
+ return data.length >= maxRow
523
+ }
524
+ } else {
525
+ if (pathArr.length < 3) {
526
+ this.$message({
527
+ message: '子表路径有误',
528
+ type: 'warning',
529
+ })
530
+ } else {
531
+ let data = this.data[pathArr[1]][pathArr[2]] || []
532
+ return data.length >= maxRow
533
+ }
534
+ }
535
+ return false
536
+ },
537
+ },
538
+ }