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,2145 @@
1
+ <template>
2
+ <div class="inputs" :style="{ display: 'inline-block', float: 'right' }">
3
+ <el-button
4
+ v-if="isShow || initFillData == 'true'"
5
+ type="text"
6
+ size="mini"
7
+ class="custom-dialog-btn"
8
+ @click="showDialog"
9
+ >
10
+ <i
11
+ style="line-height: 10px"
12
+ :class="
13
+ custdialog.icon
14
+ ? 'el-input__icon ' + custdialog.icon
15
+ : 'el-input__icon icon-department'
16
+ "
17
+ class="custom-dialog-icon"
18
+ ></i>
19
+ {{ custdialog.name }}
20
+ </el-button>
21
+
22
+ <el-dialog
23
+ :visible.sync="customDialogShowList"
24
+ :title="customDialog.name"
25
+ :close-on-click-modal="false"
26
+ :before-close="dialogCancel"
27
+ append-to-body
28
+ top="6vh"
29
+ width="60%"
30
+ @opened="afterOpen"
31
+ >
32
+ <el-container :style="style" style="overflow: auto">
33
+ <!-- 组合对话框树 -->
34
+ <el-aside
35
+ v-if="customDialog.style == 2"
36
+ v-show="treeShow"
37
+ style="width: 23%"
38
+ >
39
+ <el-card>
40
+ <div slot="header" class="clearfix">
41
+ <span style="font-size: 16px">{{ leftTreeTitle }}</span>
42
+ </div>
43
+ <el-tree
44
+ ref="combinationTree"
45
+ :data="combinationTreeData"
46
+ :props="defaultProps"
47
+ :node-key="nodeKey"
48
+ highlight-current
49
+ :check-on-click-node="true"
50
+ lazy
51
+ :load="loadTree"
52
+ @node-click="combiTreeClick"
53
+ ></el-tree>
54
+ </el-card>
55
+ </el-aside>
56
+ <el-divider
57
+ v-if="customDialog.style == 2"
58
+ direction="vertical"
59
+ ></el-divider>
60
+ <el-container>
61
+ <el-header v-if="querysShow" class="middle-header">
62
+ <div
63
+ v-for="(condition, index) in conditionBind"
64
+ :key="index"
65
+ class="search-item"
66
+ >
67
+ <p style="font-size: 14px">{{ condition.comment }}:</p>
68
+ <div v-if="condition.controllerType == '1'">
69
+ <el-input
70
+ v-model="queryParams[index][condition.field]"
71
+ size="small"
72
+ style="width: 180px; padding: 10px 0; margin: 0 5px 0 5px"
73
+ clearable
74
+ :placeholder="placeholders[index]"
75
+ prefix-icon="el-icon-search"
76
+ @keyup.enter.native="searchEnterFun"
77
+ ></el-input>
78
+ </div>
79
+ <div
80
+ v-if="condition.controllerType == '2'"
81
+ style="margin-right: 10px"
82
+ >
83
+ <el-radio
84
+ v-for="(itemR, $index1) in condition.config.options"
85
+ :key="$index1"
86
+ v-model="queryParams[index][condition.field]"
87
+ :label="itemR.key"
88
+ >
89
+ {{ itemR.value }}
90
+ </el-radio>
91
+ </div>
92
+ <div
93
+ v-if="condition.controllerType == '3'"
94
+ style="margin-right: 10px"
95
+ >
96
+ <ht-select
97
+ v-if="condition.config.choiceType == 'static'"
98
+ v-model="queryParams[index][condition.field]"
99
+ :placeholder="quickSearch"
100
+ :options="condition.config.options"
101
+ ></ht-select>
102
+ <ht-select
103
+ v-else
104
+ v-model="queryParams[condition.field]"
105
+ :placeholder="quickSearch"
106
+ :ganged="{
107
+ alias: condition.config.customQuery.alias,
108
+ valueBind: condition.config.customQuery.valueBind,
109
+ noInit: '',
110
+ labelBind: condition.config.customQuery.labelBind,
111
+ gangedBind: '{}',
112
+ bind: condition.config.bind,
113
+ }"
114
+ :multiple="false"
115
+ :filterable="false"
116
+ :allow-create="false"
117
+ :selectlist="[]"
118
+ :query-params="queryParams"
119
+ />
120
+ </div>
121
+ <div
122
+ v-if="condition.controllerType == '4'"
123
+ style="margin-right: 10px"
124
+ >
125
+ <ht-tag
126
+ v-model="queryParams[index][condition.field]"
127
+ :tag-key="condition.config.tag"
128
+ :placeholder="quickSearch"
129
+ :filterable="condition.config.filterable"
130
+ :expand="condition.config.expand"
131
+ />
132
+ </div>
133
+ </div>
134
+ <div
135
+ v-if="conditionBind && conditionBind.length > 0"
136
+ class="btn-wrap"
137
+ >
138
+ <el-button
139
+ style="margin-left: 20px"
140
+ size="small"
141
+ type="primary"
142
+ icon="el-icon-search"
143
+ @click="search(true)"
144
+ >
145
+ 查询
146
+ </el-button>
147
+ <el-button size="small" icon="el-icon-refresh" @click="reset">
148
+ 重置
149
+ </el-button>
150
+ </div>
151
+ </el-header>
152
+ <el-main style="padding: 0 20 0 20">
153
+ <el-table
154
+ ref="orgTable"
155
+ :data="dialogData"
156
+ stripe
157
+ border
158
+ class="org-table"
159
+ size="medium"
160
+ style="width: 100%"
161
+ max-height="600px"
162
+ @row-click="orgRowClick"
163
+ @selection-change="orgTableSelection"
164
+ @select="onTableSelect"
165
+ @select-all="selectAll"
166
+ >
167
+ <el-table-column
168
+ v-if="customDialog.selectNum != 1"
169
+ type="selection"
170
+ align="center"
171
+ width="45"
172
+ ></el-table-column>
173
+ <el-table-column
174
+ v-if="customDialog.selectNum === 1"
175
+ align="center"
176
+ width="50"
177
+ >
178
+ <template slot-scope="scope">
179
+ <el-radio
180
+ v-model="undefineda"
181
+ :label="scope.$index"
182
+ class="textRadio"
183
+ @selection-change="orgTableSelection"
184
+ ></el-radio>
185
+ </template>
186
+ </el-table-column>
187
+ <el-table-column
188
+ type="index"
189
+ width="50"
190
+ align="center"
191
+ label="序号"
192
+ ></el-table-column>
193
+ <el-table-column
194
+ v-for="field in displayfield"
195
+ :key="field.field"
196
+ :show-overflow-tooltip="true"
197
+ :prop="field.field"
198
+ :label="field.comment"
199
+ style="width: 100%"
200
+ ></el-table-column>
201
+ </el-table>
202
+ </el-main>
203
+ <el-footer>
204
+ <el-row
205
+ v-if="customDialog.needPage"
206
+ type="flex"
207
+ justify="end"
208
+ style="padding-top: 15px; justify-content: space-between"
209
+ >
210
+ <el-button
211
+ v-if="customDialog.style == 2"
212
+ :icon="toggleBtn"
213
+ size="mini"
214
+ type="default"
215
+ @click="toggleTree"
216
+ ></el-button>
217
+ <el-pagination
218
+ small
219
+ :current-page="pagination.page"
220
+ :page-sizes="[10, 20, 50, 100]"
221
+ :page-size="pagination.pageSize"
222
+ layout="total, sizes, prev, pager, next, jumper"
223
+ :total="total"
224
+ @size-change="handleSizeChange"
225
+ @current-change="handleCurrentChange"
226
+ ></el-pagination>
227
+ </el-row>
228
+ </el-footer>
229
+ </el-container>
230
+ </el-container>
231
+ <span slot="footer" class="dialog-footer" style="text-align: center">
232
+ <el-button size="small" type="primary" @click="dialogConfirm">
233
+ 确认
234
+ </el-button>
235
+ <el-button size="small" @click="dialogCancel">取 消</el-button>
236
+ </span>
237
+ </el-dialog>
238
+
239
+ <el-dialog
240
+ :visible.sync="customDialogShowTree"
241
+ :title="customDialog.name"
242
+ :close-on-click-modal="false"
243
+ :before-close="dialogCancelTree"
244
+ append-to-body
245
+ top="6vh"
246
+ width="40%"
247
+ >
248
+ <el-container :style="style" style="overflow: auto; min-height: 300px">
249
+ <el-tree
250
+ ref="tree"
251
+ :data="props1"
252
+ :props="defaultProps"
253
+ :node-key="nodeKey"
254
+ highlight-current
255
+ :show-checkbox="customDialog.selectNum === -1"
256
+ :check-on-click-node="true"
257
+ :check-strictly="false"
258
+ lazy
259
+ :load="loadTree"
260
+ style="width: 100%"
261
+ @node-click="treeClick"
262
+ @check-change="getChecked"
263
+ ></el-tree>
264
+ </el-container>
265
+ <span slot="footer" class="dialog-footer" style="text-align: center">
266
+ <el-button size="small" type="primary" @click="dialogTreeConfirm">
267
+ 确认
268
+ </el-button>
269
+ <el-button size="small" @click="dialogCancelTree">取 消</el-button>
270
+ </span>
271
+ </el-dialog>
272
+ </div>
273
+ </template>
274
+ <script>
275
+ import { Message } from 'element-ui'
276
+ import utils from '@/utils.js'
277
+ import dialog from './dialog.js'
278
+ import _ from 'lodash'
279
+
280
+ export default {
281
+ name: 'HtSubDialog',
282
+ mixins: [dialog],
283
+ props: {
284
+ custdialog: {
285
+ type: Object,
286
+ default: () => {
287
+ return {}
288
+ },
289
+ },
290
+ initFillData: String,
291
+ initFillDataType: String,
292
+ relation: String,
293
+ maxRow: Number,
294
+ newInitVersion: String,
295
+ },
296
+ data() {
297
+ return {
298
+ quickSearch: '', //填写提示
299
+ conditionBind: [], //参数查询字段
300
+ nodeKey: 'ID_', //树形数据父Id
301
+ customDialogShowList: false,
302
+ customDialogShowTree: false,
303
+ style: '', //对话框宽高
304
+ selectOrgs: null,
305
+ config: null,
306
+ displayfield: [], //显示字段
307
+ customDialog: {},
308
+ queryParam: '', //查询条件输入的值
309
+ props1: [],
310
+ showData: [],
311
+ checkBoxDataAll: [], //选中对象的集合
312
+ defaultProps: {
313
+ children: 'children',
314
+ label: 'label',
315
+ },
316
+ propsData: [],
317
+ querysShow: false, //是否显示搜索框
318
+ undefineda: '',
319
+ isCurrentChange: false, //是否不执行 orgTableSelection方法
320
+ pagination: {
321
+ page: 1,
322
+ pageSize: 10,
323
+ total: 0,
324
+ },
325
+ param: [], //绑定的表单字段
326
+ treeList: [],
327
+ displayField: {},
328
+ queryParams: [],
329
+ placeholders: [],
330
+ oldselectOrgs: [],
331
+ combinationTreeData: [],
332
+ combiTreeDisplayField: [],
333
+ combinationTreeQuerys: [],
334
+ combinationRule: {},
335
+ toggleBtn: 'el-icon-arrow-left',
336
+ treeShow: true,
337
+ transtionWidth: '25%',
338
+ leftTreeTitle: '',
339
+ isShow: true,
340
+ fixedParams: {}, // 传过来的固定值
341
+ }
342
+ },
343
+ watch: {
344
+ props1: function() {
345
+ //树形
346
+ if (this.showData != undefined && this.showData.length > 0) {
347
+ const this_ = this
348
+ let data = []
349
+ for (let i = 0; i < this.showData.length; i++) {
350
+ data.push(this.showData[i])
351
+ }
352
+ setTimeout(() => {
353
+ for (let i = 0; i < data.length; i++) {
354
+ this_.$refs.tree.setChecked(data[i], true)
355
+ this_.checkNode(data[i], this_)
356
+ }
357
+ }, 200)
358
+ }
359
+ },
360
+ },
361
+ mounted() {
362
+ let requestType = window.location.href.split('?')[0].split('/')
363
+ let isDoneList = window.location.href.split('/')
364
+ if (
365
+ requestType[requestType.length - 1] == 'get' ||
366
+ requestType[requestType.length - 2] == 'get' ||
367
+ isDoneList[isDoneList.length - 1] == 'doneList'
368
+ ) {
369
+ this.isShow = false
370
+ }
371
+ // 此处加一个标识,新版本子表初始化时不走此逻辑
372
+ if (this.initFillData == 'true' && this.newInitVersion !== 'true') {
373
+ this.initTemplateData()
374
+ }
375
+ },
376
+ methods: {
377
+ selectAll(selection) {
378
+ if (this.oldselectOrgs != null && selection.length > 0) {
379
+ for (let x = 0; x < selection.length; x++) {
380
+ if (this.indexArray(this.oldselectOrgs, selection[x]) === -1) {
381
+ this.oldselectOrgs.push(selection[x])
382
+ }
383
+ }
384
+ this.selectOrgs = _.cloneDeep(this.oldselectOrgs)
385
+ } else {
386
+ this.selectOrgs = _.cloneDeep(selection)
387
+ }
388
+ },
389
+ checkNode(data, this_, pnode) {
390
+ if (data.Pid) {
391
+ let node = this_.$refs.tree.getNode(data.Pid)
392
+ node.indeterminate = true
393
+ if (node.data.Pid) {
394
+ this_.$refs.tree.getNode(node.data.Pid).indeterminate = true
395
+ this.checkNode(
396
+ this_.$refs.tree.getNode(node.data.Pid).data,
397
+ this_,
398
+ this_.$refs.tree.getNode(node.data.Pid)
399
+ )
400
+ }
401
+ if (!node.indeterminate) {
402
+ node.indeterminate = true
403
+ }
404
+ } else if (pnode && !pnode.indeterminate) {
405
+ pnode.indeterminate = true
406
+ }
407
+ },
408
+ //回车查询
409
+ searchEnterFun: function(e) {
410
+ var keyCode = window.event ? e.keyCode : e.which
411
+ if (keyCode == 13) {
412
+ this.search()
413
+ }
414
+ },
415
+ handleSizeChange: function(size) {
416
+ this.isCurrentChange = true
417
+ //每页下拉显示数据
418
+ this.pagination.pageSize = size
419
+ this.search()
420
+ },
421
+ handleCurrentChange: function(currentPage) {
422
+ const this_ = this
423
+ if (this.selectOrgs != undefined && this.selectOrgs.length > 0) {
424
+ this.selectOrgs.forEach((row) => {
425
+ let res = this_.indexArray(this_.checkBoxDataAll, row)
426
+ if (res == -1) {
427
+ this_.checkBoxDataAll.push(row)
428
+ }
429
+ })
430
+ }
431
+ this.isCurrentChange = true
432
+ //点击第几页
433
+ this.pagination.page = currentPage
434
+ this.search()
435
+ },
436
+ checkList() {
437
+ const this_ = this
438
+ setTimeout(() => {
439
+ //列表
440
+ if (
441
+ this_.checkBoxDataAll != undefined &&
442
+ this_.checkBoxDataAll.length > 0
443
+ ) {
444
+ this_.checkBoxDataAll.forEach((row) => {
445
+ let res = this_.indexArray(this_.dialogData, row)
446
+ this_.undefineda = res
447
+ if (res != -1) {
448
+ this_.isCurrentChange = true
449
+ this_.toggleRowSelection(res, true)
450
+ }
451
+ })
452
+ }
453
+ }, 300)
454
+ },
455
+ toggleRowSelection(res, val) {
456
+ this.$refs.orgTable.toggleRowSelection(this.dialogData[res], val)
457
+ },
458
+ showDialog() {
459
+ const this_ = this
460
+ this.undefineda = ''
461
+ //第二次点击子表回填对话框 第一次选中的数据不是选中状态
462
+ if (this_.selectOrgs) {
463
+ this_.selectOrgs.splice(0, this_.selectOrgs.length)
464
+ this_.checkBoxDataAll.splice(0, this_.checkBoxDataAll.length)
465
+ }
466
+ var alias = this.custdialog.custDialog.alias
467
+ this.getDialogByAlias(alias).then((customDialog) => {
468
+ if (!customDialog || !customDialog.alias) {
469
+ Message.error('对话框别名【' + alias + '】不存在!')
470
+ return
471
+ }
472
+ if (customDialog.style == 1) {
473
+ var displaylist = JSON.parse(customDialog.displayfield)
474
+ this_.nodeKey = displaylist.id
475
+ }
476
+ if (customDialog.needPage && customDialog.requestType === 'POST') {
477
+ let obj = {}
478
+ this.getLastKeyByPath(obj, customDialog.pageKey, 1)
479
+ this.getLastKeyByPath(obj, customDialog.pageSizeKey, 10)
480
+ this.getLastKeyByPath(obj, customDialog.totalKey, true)
481
+ const exp = utils.parseExp(customDialog.dataParam, obj, true)
482
+ if (exp) {
483
+ const params = JSON.parse(exp)
484
+ if (params.pageBean) {
485
+ this.pagination = {
486
+ ...params.pageBean,
487
+ }
488
+ }
489
+ }
490
+ }
491
+ //对话框按表单字段查询(参数传入的)
492
+ let bindList = this_.custdialog.custDialog.conditions
493
+ this_.param = [] //绑定的表单字段
494
+ if (bindList.length > 0) {
495
+ bindList.forEach((ele) => {
496
+ //绑定表单字段
497
+ if (ele.defaultType == '3' && ele.bind) {
498
+ let obj = {}
499
+ obj.field = ele.field
500
+ obj.bind = ele.bind
501
+ obj.bindType = ele.bindType
502
+ this_.param.push(obj)
503
+ }
504
+ })
505
+ }
506
+ //判断对话框查询是否有条件
507
+ let userInputList = JSON.parse(customDialog.conditionfield)
508
+ this_.quickSearch = '' //填写提示 placeholder
509
+ this_.conditionBind = []
510
+ let queryParams = []
511
+ let placeholders = []
512
+ if (userInputList.length > 0) {
513
+ userInputList.forEach((ele) => {
514
+ var obj = {}
515
+ //条件查询参数(用户输入的) 文本框输入
516
+ if (ele.defaultType == '1') {
517
+ obj[ele.field] = ''
518
+ queryParams.push(obj)
519
+ this_.conditionBind.push(ele)
520
+ placeholders.push('请输入' + ele.comment)
521
+ }
522
+ if (ele.defaultType == '2' && ele.defaultValue) {
523
+ this_.fixedParams[ele.field] = ele.defaultValue
524
+ }
525
+ })
526
+ this.$set(this, 'queryParams', queryParams)
527
+ this.$set(this, 'placeholders', placeholders)
528
+ }
529
+ //判断是否显示条件查询输入框
530
+ if (this_.quickSearch != '') {
531
+ this_.querysShow = true
532
+ } else {
533
+ this_.querysShow = true
534
+ }
535
+ this_.quickSearch = '请输入' + this.quickSearch + '查询'
536
+ this_.style = 'height:' + customDialog.height + 'px'
537
+ if (window.screen.height && window.screen.height <= 900) {
538
+ this.style = 'height:440px'
539
+ }
540
+ if (customDialog.style == 0 || customDialog.style == 2) {
541
+ //列表
542
+ this_.customDialogShow({ alias: alias, customDialog: customDialog })
543
+ } else if (customDialog.style == 1) {
544
+ //树形
545
+ this_.pageParam = { alias: alias, customDialog: customDialog }
546
+ this_.customDialog = customDialog
547
+ let param = {}
548
+ this_.conditionfieldTree = []
549
+ //判断是否存在条件
550
+ if (customDialog.conditionfield) {
551
+ this_.conditionfieldTree = JSON.parse(customDialog.conditionfield)
552
+ if (this_.conditionfieldTree.length > 0) {
553
+ for (let i = this_.conditionfieldTree.length - 1; i >= 0; i--) {
554
+ //判断条件字段是否是动态传入(defaultType:4:动态传入,2:固定值 )
555
+ if (this_.conditionfieldTree[i].defaultType == '4') {
556
+ param[this_.conditionfieldTree[i].field] =
557
+ this_.conditionfieldTree[i].comment
558
+ }
559
+ }
560
+ }
561
+ }
562
+ //有动态传入的字段
563
+ if (JSON.stringify(param) != '{}') {
564
+ this_.dialogVisible = true
565
+ } else {
566
+ //无动态传入的字段
567
+ this_.customDialogTreeShow(this_.pageParam)
568
+ }
569
+ }
570
+ })
571
+ },
572
+ getLastKeyByPath(obj, path, value) {
573
+ if (!obj || !path || path.constructor != String) {
574
+ return
575
+ }
576
+ if (!/^\w?.*[\w|\]]$/.test(path)) {
577
+ return
578
+ }
579
+ let pathAry = path.split('.')
580
+ if (pathAry.length == 1) {
581
+ obj[path] = value
582
+ } else {
583
+ let length = pathAry.length
584
+ obj[pathAry[length - 1]] = value
585
+ }
586
+ },
587
+ //判断数据是否包含某个对象,并返回数据包含对象的下标
588
+ indexArray(array, item) {
589
+ if (array.length == 0) {
590
+ return -1
591
+ }
592
+ for (let i = 0; i < array.length; i++) {
593
+ if (JSON.stringify(array[i]) == JSON.stringify(item)) {
594
+ return i
595
+ }
596
+ }
597
+ return -1
598
+ },
599
+ //点击列表某一个复选框时触发
600
+ onTableSelect(rows, row) {
601
+ this.isCurrentChange = false
602
+ //判断点击列表数据时复选框是否勾选 selected:true不勾选,false勾选
603
+ let selected =
604
+ this.selectOrgs &&
605
+ this.selectOrgs.length > 0 &&
606
+ this.indexArray(this.selectOrgs, row) !== -1
607
+ if (selected) {
608
+ this.isCurrentChange = true
609
+ let res = this.indexArray(this.selectOrgs, row)
610
+ this.selectOrgs.splice(res, 1)
611
+ }
612
+ },
613
+ //点击列表某一条数据时触发
614
+ orgRowClick(row, column, event) {
615
+ if (this.customDialog.selectNum === 1) {
616
+ event.currentTarget &&
617
+ event.currentTarget.children[0] &&
618
+ event.currentTarget.children[0].children[0] &&
619
+ event.currentTarget.children[0].children[0].children[0] &&
620
+ event.currentTarget.children[0].children[0].children[0].dispatchEvent(
621
+ new Event('click')
622
+ )
623
+ this.selectOrgs = []
624
+ this.selectOrgs.push(row)
625
+ let curIndex = this.indexArray(this.dialogData, row)
626
+ this.undefineda = curIndex
627
+ } else if (this.customDialog.selectNum != 1) {
628
+ this.isCurrentChange = false
629
+ //判断点击列表数据时复选框是否勾选 selected:true不勾选,false勾选
630
+ let selected =
631
+ this.selectOrgs &&
632
+ this.selectOrgs.length > 0 &&
633
+ this.indexArray(this.selectOrgs, row) !== -1
634
+ if (selected) {
635
+ this.isCurrentChange = true
636
+ let res = this.indexArray(this.selectOrgs, row)
637
+ this.selectOrgs.splice(res, 1)
638
+ }
639
+ this.$refs.orgTable.toggleRowSelection(row)
640
+ }
641
+ },
642
+ //列表复选框有改变时触发
643
+ orgTableSelection(selection) {
644
+ //全选的情况特殊处理(为了与原本功能逻辑不冲突,先复制一份旧的选中数据.然后拿到全选事件中去计算)
645
+ this.oldselectOrgs = _.cloneDeep(this.selectOrgs)
646
+ //多选
647
+ if (this.customDialog.selectNum != 1 && !this.isCurrentChange) {
648
+ if (selection && selection.length > 0) {
649
+ if (
650
+ selection.length == 1 &&
651
+ (!this.selectOrgs || this.selectOrgs.length == 0)
652
+ ) {
653
+ this.selectOrgs = selection
654
+ } else if (
655
+ (!this.selectOrgs || this.selectOrgs.length == 0) &&
656
+ selection.length > 1
657
+ ) {
658
+ if (!this.selectOrgs) {
659
+ this.selectOrgs = []
660
+ }
661
+ for (let i = selection.length - 1; i >= 0; i--) {
662
+ this.selectOrgs.push(selection[i])
663
+ }
664
+ } else if (this.isCurrentChange && selection.length >= 10) {
665
+ if (!this.selectOrgs) {
666
+ this.selectOrgs = []
667
+ } else {
668
+ for (let u = this.selectOrgs.length - 1; u >= 0; u--) {
669
+ let res = this.indexArray(selection, this.selectOrgs[u])
670
+ if (res != -1) {
671
+ this.selectOrgs.splice(res, 1)
672
+ }
673
+ }
674
+ }
675
+ for (let i = 0; i < selection.length; i++) {
676
+ this.selectOrgs.push(selection[i])
677
+ }
678
+ } else {
679
+ for (let i = selection.length - 1; i >= 0; i--) {
680
+ this.selectOrgs.push(selection[i])
681
+ break
682
+ }
683
+ }
684
+ }
685
+ }
686
+ },
687
+ dialogConfirm() {
688
+ if (!this.selectOrgs || this.selectOrgs.length == 0) {
689
+ this.$message.error('请选择数据回填')
690
+ return
691
+ }
692
+ this.queryParam = ''
693
+ this.customDialogShowList = false
694
+ this.syncInputValue()
695
+ },
696
+ //重置
697
+ reset() {
698
+ this.queryParams.forEach((paramObj) => {
699
+ for (let key in paramObj) {
700
+ this.queryParams[key] = ''
701
+ }
702
+ })
703
+ //组合树重置
704
+ if (this.$refs.combinationTree) {
705
+ let nodes = this.$refs.combinationTree.store.nodesMap
706
+ for (let key in nodes) {
707
+ nodes[key].expanded = false
708
+ }
709
+ }
710
+ this.combinationTreeQuerys.splice(0)
711
+ this.search(true)
712
+ },
713
+ //查询
714
+ search(resetPagintion) {
715
+ let querys = [] //查询条件
716
+ let queryFilter = {}
717
+ if (JSON.stringify(this.pagination) == '{}') {
718
+ this.pagination = { page: 1, pageSize: 10, showTotal: 'true' }
719
+ }
720
+ let pageBean = { pageBean: this.pagination }
721
+ if (resetPagintion) {
722
+ pageBean.pageBean = { page: 1, pageSize: 10, showTotal: 'true' }
723
+ }
724
+ //用户输入的
725
+ if (this.queryParams.length != 0 && this.queryParams[0] != '') {
726
+ this.conditionBind.forEach((item, index) => {
727
+ if (this.queryParams[index][item.field]) {
728
+ querys.push({
729
+ property: item.field,
730
+ value: this.queryParams[index][item.field],
731
+ group: 'main',
732
+ operation: 'LIKE',
733
+ relation: 'AND',
734
+ })
735
+ }
736
+ })
737
+ }
738
+ //参数传入的查询拼接
739
+ if (this.param) {
740
+ const pInst = utils.getOnlineFormInstance(this)
741
+ this.param.forEach((item) => {
742
+ querys.push({
743
+ property: item.field,
744
+ // value: utils.getValueByPath(pInst, item.bind),
745
+ value:
746
+ item.bindType === 2
747
+ ? item.bind
748
+ : utils.getValueByPath(pInst, item.bind),
749
+ group: 'main',
750
+ operation: 'LIKE',
751
+ relation: 'AND',
752
+ })
753
+ })
754
+ }
755
+ //来自组合对话框的
756
+ if (
757
+ this.combinationTreeQuerys &&
758
+ this.combinationTreeQuerys.length != 0
759
+ ) {
760
+ for (let i = 0; i < this.combinationTreeQuerys.length; i++) {
761
+ querys.push(this.combinationTreeQuerys[i])
762
+ }
763
+ }
764
+ // post restful接口,并且配置了post参数。则以post参数作为请求参数
765
+ if (
766
+ this.customDialog.dsType != 'dataSource' &&
767
+ this.customDialog.requestType == 'POST' &&
768
+ this.customDialog.dataParam &&
769
+ this.customDialog.dataParam.constructor == String
770
+ ) {
771
+ let param = this.param
772
+ // 构建上下文数据对象
773
+ let ctx = {}
774
+ //根据路径构建想要的分页属性
775
+ let obj = {}
776
+ this.getLastKeyByPath(
777
+ obj,
778
+ this.customDialog.pageKey,
779
+ pageBean.pageBean.page
780
+ )
781
+ this.getLastKeyByPath(
782
+ obj,
783
+ this.customDialog.pageSizeKey,
784
+ pageBean.pageBean.pageSize
785
+ )
786
+ this.getLastKeyByPath(
787
+ obj,
788
+ this.customDialog.totalKey,
789
+ pageBean.pageBean.total
790
+ )
791
+ querys &&
792
+ querys.length &&
793
+ querys.forEach((element) => {
794
+ ctx[element.property] = element.value
795
+ })
796
+ const queryParamMap = this.getSearchValueByKey()
797
+ queryParamMap.pageSize = pageBean.pageBean.pageSize
798
+ queryParamMap.page = pageBean.pageBean.page
799
+ queryParamMap.total = pageBean.pageBean.total
800
+ // 添加用户id 岗位id 组织id
801
+ try {
802
+ if (this.$requestConfig.getUserId()) {
803
+ ctx.userId = this.$requestConfig.getUserId()
804
+ }
805
+ if (this.$requestConfig.getOrgId()) {
806
+ ctx.orgId = this.$requestConfig.getOrgId()
807
+ }
808
+ if (this.$requestConfig.getPostId()) {
809
+ ctx.postId = this.$requestConfig.getPostId()
810
+ }
811
+ } catch (e) {
812
+ console.log('获取岗位id、用户id、组织id异常', e)
813
+ }
814
+ const exp = utils.parseExp(this.customDialog.dataParam, {
815
+ ...ctx,
816
+ ...queryParamMap,
817
+ ...this.fixedParams,
818
+ })
819
+ try {
820
+ param = JSON.parse(exp)
821
+ const dataParam = JSON.parse(this.customDialog.dataParam)
822
+ const queryList =
823
+ dataParam &&
824
+ dataParam.querys &&
825
+ dataParam.querys.map((item) => {
826
+ const bindKey =
827
+ item.value && item.value.replace('${', '').replace('}', '')
828
+ return {
829
+ ...item,
830
+ value: queryParamMap[bindKey] || ctx[bindKey] || '',
831
+ }
832
+ })
833
+ param.querys = queryList
834
+ if (this.customDialog.needPage) {
835
+ param.pageBean = obj
836
+ } else {
837
+ param.pageBean.pageSize = -1
838
+ }
839
+
840
+ //构造请求的参数
841
+ let requestParam = {
842
+ pageBean: param,
843
+ queryUrl: this.customDialog.queryUrl,
844
+ requestType: this.customDialog.requestType,
845
+ dsType: this.customDialog.dsType,
846
+ listKey: this.customDialog.listKey,
847
+ pageKey: this.customDialog.pageKey,
848
+ pageSizeKey: this.customDialog.pageSizeKey,
849
+ totalKey: this.customDialog.totalKey,
850
+ }
851
+ this.getListJson(requestParam).then(() => {
852
+ this.checkList()
853
+ })
854
+ } catch (e) {
855
+ this.$message.error(`POST参数不是有效的JSON格式${param}`)
856
+ }
857
+ } else {
858
+ if (querys.length > 0) {
859
+ queryFilter = { pageBean: pageBean.pageBean, querys }
860
+ this.customDialog.pageBean = queryFilter
861
+ this.getListJson(this.customDialog).then(() => {
862
+ this.checkList()
863
+ })
864
+ } else {
865
+ this.customDialog.pageBean = pageBean
866
+ this.getListJson(this.customDialog).then(() => {
867
+ this.checkList()
868
+ })
869
+ }
870
+ }
871
+ },
872
+ getSearchValueByKey() {
873
+ let queryParamsObj = {}
874
+ if (this.queryParams.length > 0) {
875
+ queryParamsObj = this.conditionBind.reduce((pre, cur, index) => {
876
+ pre[cur.field] = this.queryParams[index][cur.field]
877
+ return pre
878
+ }, {})
879
+ }
880
+ return queryParamsObj
881
+ },
882
+ async doQuery(param) {
883
+ let paramLoadData = []
884
+ const pInst = utils.getOnlineFormInstance(this)
885
+ //获取关联查询绑定的表单参数
886
+ for (let i = 0; i < param.conditionfield.length; i++) {
887
+ if (param.conditionfield[i].fieldPath != '') {
888
+ let bindVal = utils.getValueByPath(
889
+ pInst,
890
+ param.conditionfield[i].fieldPath,
891
+ null
892
+ )
893
+ let obj = { key: param.conditionfield[i].field, value: bindVal }
894
+ paramLoadData.push(obj)
895
+ }
896
+ }
897
+
898
+ let queryUrl =
899
+ param.dsType == 'dataSource'
900
+ ? '${form}/form/customQuery/v1/doQuery?alias=' +
901
+ param.alias +
902
+ '&page=1'
903
+ : param.url
904
+ let requestMethod = 'POST'
905
+ //如果关联数据列表查询数据不是数据源则请求方法为restful配置的请求方式
906
+ if (param.dsType != 'dataSource') {
907
+ requestMethod = param.requestType
908
+ }
909
+ //查询数据
910
+ this.$requestConfig
911
+ .request({
912
+ url: queryUrl,
913
+ method: requestMethod,
914
+ data: paramLoadData,
915
+ })
916
+ .then((res) => {
917
+ //判断是否有关联查询数据返回
918
+ if (res.data.rows.length > 0) {
919
+ //获取关联查询返回的表单参数
920
+ for (let io = 0; io < param.resultfield.length; io++) {
921
+ if (param.resultfield[io].fieldPath != '') {
922
+ let val = ''
923
+ for (let j = 0; j < res.data.rows.length; j++) {
924
+ if (res.data.rows[j][param.resultfield[io].field]) {
925
+ val =
926
+ val +
927
+ res.data.rows[j][param.resultfield[io].field] +
928
+ ','
929
+ }
930
+ }
931
+ val = val.substring(0, val.length - 1)
932
+ let pathArr = param.resultfield[io].fieldPath.split('.')
933
+ if (pathArr.length == 3) {
934
+ //主表
935
+ utils.setValueByPath(
936
+ pInst,
937
+ param.resultfield[io].fieldPath,
938
+ val,
939
+ null
940
+ )
941
+ } else if (pathArr.length == 4) {
942
+ //子表
943
+ let subData = pInst.data[pathArr[1]][pathArr[2]]
944
+ if (subData.length == 0) {
945
+ //子表没数据的情况
946
+ let subTabName = pathArr[2].replace('sub_', '')
947
+ //得到子表的所有字段
948
+ let subInitData =
949
+ pInst.data[pathArr[1]].initData[subTabName] || {}
950
+ //把数组里面的值为 null 转换为空字符串
951
+ let str = JSON.stringify(subInitData).replace(
952
+ /null/g,
953
+ '""'
954
+ )
955
+ let subData = JSON.parse(str)
956
+ for (var key in subData) {
957
+ //点添加时判断要新增子表记录中的孙表是否有值
958
+ if (
959
+ key.indexOf('sub_') == 0 &&
960
+ subData[key].length > 0
961
+ ) {
962
+ subData[key] = [] //有则清空
963
+ }
964
+ //点添加时判断要新增子表记录中的字段是否有值
965
+ if (subData[key]) {
966
+ subData[key] = '' //有则清空
967
+ }
968
+ }
969
+ //新增一条数据
970
+ pInst.data[pathArr[1]][pathArr[2]].push(subData)
971
+ //对话框关联查询返回的值赋值给绑定的字段
972
+ utils.setValueByPath(
973
+ pInst,
974
+ param.resultfield[io].fieldPath,
975
+ val,
976
+ 0
977
+ )
978
+ } else {
979
+ //子表有数据的情况
980
+ for (let p = 0; p < subData.length; p++) {
981
+ //对话框关联查询返回的值赋值给绑定的字段
982
+ utils.setValueByPath(
983
+ pInst,
984
+ param.resultfield[io].fieldPath,
985
+ val,
986
+ p
987
+ )
988
+ }
989
+ }
990
+ }
991
+ }
992
+ }
993
+ } else {
994
+ //没有返回的值则清空
995
+ //获取关联查询返回的表单参数
996
+ for (let iop = 0; iop < param.resultfield.length; iop++) {
997
+ if (param.resultfield[iop].fieldPath != '') {
998
+ let pathArr = param.resultfield[iop].fieldPath.split('.')
999
+ if (pathArr.length == 3) {
1000
+ //主表
1001
+ //赋值给绑定的字段
1002
+ utils.setValueByPath(
1003
+ pInst,
1004
+ param.resultfield[iop].fieldPath,
1005
+ '',
1006
+ null
1007
+ )
1008
+ } else if (pathArr.length == 4) {
1009
+ //子表
1010
+ let subData = pInst.data[pathArr[1]][pathArr[2]]
1011
+ for (let p = 0; p < subData.length; p++) {
1012
+ //对话框关联查询返回的值赋值给绑定的字段
1013
+ utils.setValueByPath(
1014
+ pInst,
1015
+ param.resultfield[iop].fieldPath,
1016
+ '',
1017
+ p
1018
+ )
1019
+ }
1020
+ }
1021
+ }
1022
+ }
1023
+ }
1024
+ })
1025
+ },
1026
+ // 同步选择结果
1027
+ syncInputValue() {
1028
+ var returnStr = JSON.parse(this.customDialog.resultfield)
1029
+ //拿到返回的字段
1030
+ var field = new Array([returnStr.length])
1031
+ var comment = new Array([returnStr.length])
1032
+ var str = []
1033
+ var ids = []
1034
+ for (var i = 0; i < returnStr.length; i++) {
1035
+ field[i] =
1036
+ this.customDialog.dsType == 'dataSource'
1037
+ ? returnStr[i].field.toLowerCase()
1038
+ : returnStr[i].field
1039
+ comment[i] =
1040
+ this.customDialog.dsType == 'dataSource'
1041
+ ? returnStr[i].comment.toLowerCase()
1042
+ : returnStr[i].comment
1043
+ }
1044
+ const this_ = this
1045
+ this.selectOrgs.forEach((row) => {
1046
+ if (this_.checkBoxDataAll || this_.checkBoxDataAll.length < 1) {
1047
+ this_.checkBoxDataAll.push(row)
1048
+ } else if (
1049
+ JSON.stringify(this_.indexArray).indexOf(JSON.stringify(row)) == -1
1050
+ ) {
1051
+ this_.checkBoxDataAll.push(row)
1052
+ }
1053
+ })
1054
+ var s = this.selectOrgs
1055
+
1056
+ if (this.customDialog.selectNum === 1) {
1057
+ var temp = ''
1058
+ for (var ij = 0; ij < comment.length; ij++) {
1059
+ let encodeStr = encodeURIComponent(s[0][field[ij]])
1060
+ temp += '"' + comment[ij] + '":"' + encodeStr + '",'
1061
+ }
1062
+ if (temp != '') {
1063
+ temp = '{' + temp.substring(0, temp.length - 1) + '}'
1064
+ }
1065
+ str.push(utils.parseToJson(temp))
1066
+ ids.push(s[0].id)
1067
+ } else {
1068
+ for (var ii = 0; ii < s.length; ii++) {
1069
+ var tempp = ''
1070
+ for (var j = 0; j < comment.length; j++) {
1071
+ let encodeStr = encodeURIComponent(s[ii][field[j]])
1072
+ tempp += '"' + comment[j] + '":"' + encodeStr + '",'
1073
+ }
1074
+ if (tempp != '') {
1075
+ tempp = '{' + tempp.substring(0, tempp.length - 1) + '}'
1076
+ }
1077
+ str.push(utils.parseToJson(tempp))
1078
+ ids.push(s[ii].id)
1079
+ }
1080
+ }
1081
+ const returnData = str
1082
+ const _this = this
1083
+ const formInst = utils.getOnlineFormInstance(this)
1084
+ //处理自动回填配置
1085
+ this.instId = formInst.$parent.instId
1086
+ let custDialog = this.custdialog
1087
+ let fillOrg = {}
1088
+ if (
1089
+ custDialog.orgConfig &&
1090
+ custDialog.orgConfig.name &&
1091
+ this.fillOrg &&
1092
+ this.fillOrg.id
1093
+ ) {
1094
+ const namePath = custDialog.orgConfig.name.split('.')
1095
+ const orgNameField = namePath[namePath.length - 1]
1096
+ fillOrg[orgNameField] = this.fillOrg.name
1097
+ if (custDialog.orgConfig.id) {
1098
+ const idPath = custDialog.orgConfig.id.split('.')
1099
+ const orgIdField = idPath[idPath.length - 1]
1100
+ fillOrg[orgIdField] = this.fillOrg.id
1101
+ }
1102
+ if (custDialog.orgConfig.code) {
1103
+ const codePath = custDialog.orgConfig.code.split('.')
1104
+ const orgCodeField = codePath[codePath.length - 1]
1105
+ fillOrg[orgCodeField] = this.fillOrg.code
1106
+ }
1107
+ }
1108
+ if (custDialog.orgConfig && custDialog.orgConfig.instId) {
1109
+ const instIdPath = custDialog.orgConfig.instId.split('.')
1110
+ const instIdField = instIdPath[instIdPath.length - 1]
1111
+ fillOrg[instIdField] = this.instId
1112
+ }
1113
+ try {
1114
+ let returnSize = returnData.length
1115
+ //判断是否是一对一子表
1116
+ if (_this.relation && _this.relation == 'onetoone') {
1117
+ if (returnSize > 1) {
1118
+ this_.$message.error('一对一子表只能选择一条数据')
1119
+ this_.customDialogShowList = true
1120
+ return
1121
+ }
1122
+ }
1123
+ returnData.forEach((row) => {
1124
+ var targetArray = null
1125
+ var subLineData = {}
1126
+ this.custdialog.custDialog.mappingConf.forEach((con) => {
1127
+ if (con.target[0]) {
1128
+ targetArray = con.target[0].split('.')
1129
+ var from = ''
1130
+ if (_this.customDialog.dsType == 'restful') {
1131
+ from = con.from
1132
+ } else {
1133
+ from = con.from.toLowerCase()
1134
+ }
1135
+ if (row[from] == undefined) {
1136
+ from = from.toUpperCase()
1137
+ }
1138
+ const value =
1139
+ decodeURIComponent(row[from]) == 'undefined'
1140
+ ? ''
1141
+ : decodeURIComponent(row[from])
1142
+ subLineData[targetArray[targetArray.length - 1]] = value
1143
+ }
1144
+ })
1145
+ if (targetArray) {
1146
+ let subBo = null
1147
+ let sunBo = null
1148
+ // 如果目标路径有4段,则说明是孙表回填
1149
+ if (targetArray.length == 4) {
1150
+ // 获取子表数据的索引
1151
+ const { index } = utils.getSubScopeElAndIndex(_this.$el)
1152
+ if (index == null) {
1153
+ throw '未获取到子表的当前行索引,无法进行孙表回填.'
1154
+ }
1155
+ const _subBo = formInst['data'][targetArray[0]][targetArray[1]]
1156
+ // 获取孙表数据对象
1157
+ sunBo = _subBo[index][targetArray[2]]
1158
+ if (!sunBo) {
1159
+ sunBo = _subBo[index][targetArray[2]] = []
1160
+ }
1161
+ }
1162
+ // 否则 是子表回填
1163
+ else {
1164
+ subBo = formInst['data'][targetArray[0]][targetArray[1]]
1165
+ }
1166
+ //判断是否大于子表数据最大行数
1167
+ if (this_.maxRow != 0) {
1168
+ if (subBo && subBo.length + returnSize > this_.maxRow) {
1169
+ this_.$message.error(
1170
+ '子表数据已超过最大行数【' + this_.maxRow + '】'
1171
+ )
1172
+ this_.customDialogShowList = true
1173
+ throw new Error('EndIterative')
1174
+ } else if (sunBo && sunBo.length + returnSize > this_.maxRow) {
1175
+ this_.$message.error(
1176
+ '孙表数据已超过最大行数【' + this_.maxRow + '】'
1177
+ )
1178
+ this_.customDialogShowList = true
1179
+ throw new Error('EndIterative')
1180
+ }
1181
+ }
1182
+ if (subBo) {
1183
+ //子表中的孙表实体(可能存在多个)
1184
+ let sunBos = utils.getSomeAttributeFromParentElement(
1185
+ _this.$el,
1186
+ 'sunBos'
1187
+ )
1188
+ //如果存在孙表实体则手动添加空孙表数组对象
1189
+ if (sunBos) {
1190
+ let arrayBo = sunBos.split(',')
1191
+ for (let i = 0; i < arrayBo.length; i++) {
1192
+ let key = 'sub_' + arrayBo[i]
1193
+ let value = new Array()
1194
+ subLineData[key] = value
1195
+ }
1196
+ }
1197
+ }
1198
+
1199
+ //判断是否是一对一子表
1200
+ if (_this.relation && _this.relation == 'onetoone') {
1201
+ subBo && subBo.splice(0, subBo.length)
1202
+ sunBo && sunBo.splice(0, sunBo.length)
1203
+ }
1204
+ if (fillOrg && JSON.stringify(fillOrg) != '{}') {
1205
+ subLineData = { ...subLineData, ...fillOrg }
1206
+ }
1207
+ // 回填时默认展开逻辑添加
1208
+ subLineData.sub_guid = this.guid()
1209
+ _this.$root.$emit('add-new-collapse-item', subLineData.sub_guid)
1210
+ subBo && subBo.push(subLineData)
1211
+ if (sunBo) {
1212
+ sunBo.push(subLineData)
1213
+ formInst.data = Object.assign({}, formInst.data)
1214
+ }
1215
+ returnSize--
1216
+ }
1217
+ })
1218
+ } catch (e) {
1219
+ if (e.message != 'EndIterative') throw e
1220
+ }
1221
+ },
1222
+ //取消按钮
1223
+ dialogCancel() {
1224
+ const this_ = this
1225
+ this_.queryParam = ''
1226
+ this_.setListJson([]).then(() => {
1227
+ this_.customDialogShowList = false
1228
+ //判断是否是点击了确认再点击取消的 inputVal没有值则表示直接点击的取消
1229
+ if (!this_.inputVal) {
1230
+ this_.selectOrgs = []
1231
+ } else {
1232
+ this_.selectOrgs = [...this_.showData]
1233
+ this.checkBoxDataAll = [...this_.selectOrgs]
1234
+ }
1235
+ })
1236
+ },
1237
+ dialogTreeConfirm() {
1238
+ const this_ = this
1239
+ if (this_.propsData.length == 0) {
1240
+ this_.$message.error('请选择数据回填')
1241
+ return
1242
+ }
1243
+ this.setListJson([])
1244
+ var returnStr = JSON.parse(this.customDialog.resultfield)
1245
+ var field = new Array([returnStr.length])
1246
+ var comment = new Array([returnStr.length])
1247
+ var str = []
1248
+ for (var i = 0; i < returnStr.length; i++) {
1249
+ field[i] = returnStr[i].field
1250
+ comment[i] = returnStr[i].comment
1251
+ }
1252
+ if (this.customDialog.selectNum === 1) {
1253
+ var nodes = this.propsData[0]
1254
+ var temp = ''
1255
+ for (var ii = 0; ii < comment.length; ii++) {
1256
+ temp += '"' + comment[ii] + '":"' + nodes[field[ii]] + '",'
1257
+ }
1258
+ if (temp != '') {
1259
+ temp = '{' + temp.substring(0, temp.length - 1) + '}'
1260
+ }
1261
+ str.push(utils.parseToJson(temp))
1262
+ } else {
1263
+ var curNodes = this.propsData
1264
+ curNodes.forEach((item, k) => {
1265
+ var temp = ''
1266
+ for (var i = 0; i < comment.length; i++) {
1267
+ temp += '"' + comment[i] + '":"' + curNodes[field[i]] + '",'
1268
+ temp += '"' + comment[i] + '":"' + curNodes[k][field[i]] + '",'
1269
+ }
1270
+ if (temp != '') {
1271
+ temp = '{' + temp.substring(0, temp.length - 1) + '}'
1272
+ }
1273
+ str.push(utils.parseToJson(temp))
1274
+ })
1275
+ }
1276
+ const returnData = str
1277
+ const formInst = utils.getOnlineFormInstance(this)
1278
+ try {
1279
+ let returnSize = returnData.length
1280
+ //判断是否是一对一子表
1281
+ if (this_.relation && this_.relation == 'onetoone') {
1282
+ if (returnSize > 1) {
1283
+ this_.$message.error('一对一子表只能选择一条数据')
1284
+ this_.customDialogShowTree = true
1285
+ return
1286
+ }
1287
+ }
1288
+ returnData.forEach((row) => {
1289
+ var targetArray = null
1290
+ var subLineData = {}
1291
+ this.custdialog.custDialog.mappingConf.forEach((con) => {
1292
+ if (con.target[0]) {
1293
+ targetArray = con.target[0].split('.')
1294
+ var from = ''
1295
+ if (this_.customDialog.dsType == 'restful') {
1296
+ from = con.from
1297
+ } else {
1298
+ from = con.from.toLowerCase()
1299
+ }
1300
+ if (row[from] == undefined) {
1301
+ from = from.toUpperCase()
1302
+ }
1303
+ subLineData[
1304
+ targetArray[targetArray.length - 1]
1305
+ ] = decodeURIComponent(row[from])
1306
+ }
1307
+ })
1308
+ if (targetArray) {
1309
+ var subBo = formInst['data'][targetArray[0]][targetArray[1]]
1310
+ //判断是否大于子表数据最大行数
1311
+ if (
1312
+ this_.maxRow != 0 &&
1313
+ subBo.length + returnSize > this_.maxRow
1314
+ ) {
1315
+ this_.$message.error(
1316
+ '子表数据已超过最大行数【' + this_.maxRow + '】'
1317
+ )
1318
+ this_.customDialogShowTree = true
1319
+ throw new Error('EndIterative')
1320
+ }
1321
+
1322
+ //子表中的孙表实体(可能存在多个)
1323
+ let sunBos = utils.getSomeAttributeFromParentElement(
1324
+ this_.$el,
1325
+ 'sunBos'
1326
+ )
1327
+ //如果存在孙表实体则手动添加空孙表数组对象
1328
+ if (sunBos) {
1329
+ let arrayBo = sunBos.split(',')
1330
+ for (let i = 0; i < arrayBo.length; i++) {
1331
+ let key = 'sub_' + arrayBo[i]
1332
+ let value = new Array()
1333
+ subLineData[key] = value
1334
+ }
1335
+ }
1336
+ //判断是否是一对一子表
1337
+ if (this_.relation && this_.relation == 'onetoone') {
1338
+ subBo.splice(0, subBo.length)
1339
+ }
1340
+ subBo.push(subLineData)
1341
+ returnSize--
1342
+ }
1343
+ })
1344
+ this.customDialogShowTree = false
1345
+ } catch (e) {
1346
+ if (e.message != 'EndIterative') throw e
1347
+ }
1348
+ },
1349
+ dialogCancelTree() {
1350
+ this.setListJson([])
1351
+ this.customDialogShowTree = false
1352
+ },
1353
+ getChecked(data) {
1354
+ if (this.customDialog.selectNum === 1) {
1355
+ this.propsData = []
1356
+ this.propsData.push(data)
1357
+ } else {
1358
+ this.propsData = this.$refs.tree.getCheckedNodes()
1359
+ }
1360
+ },
1361
+ treeClick(data) {
1362
+ if (this.customDialog.selectNum === 1) {
1363
+ this.propsData = []
1364
+ this.propsData.push(data)
1365
+ }
1366
+ },
1367
+ clearAllSelectOrgs() {
1368
+ this.selectOrgs = null
1369
+ this.$refs.orgTable.clearSelection()
1370
+ },
1371
+ customDialogShow(pageParam) {
1372
+ this.customDialogShowList = true
1373
+ this.customDialog = pageParam.customDialog
1374
+ this.customDialog.queryUrl =
1375
+ this.customDialog.dsType == 'dataSource'
1376
+ ? '${form}/form/customDialog/v1/getListData?alias=' +
1377
+ this.customDialog.alias +
1378
+ '&mapParam=' +
1379
+ (this.customDialog.mapParam ? this.customDialog.mapParam : '')
1380
+ : this.customDialog.url
1381
+ if (this.dialogData.length < 1) {
1382
+ /* this.pagination = { page: 1, pageSize: 10, showTotal: 'true' } */
1383
+ this.search()
1384
+ this.displayfield = JSON.parse(pageParam.customDialog.displayfield)
1385
+ if (this.customDialog.dsType == 'dataSource') {
1386
+ for (var i = 0; i < this.displayfield.length; i++) {
1387
+ this.displayfield[i].field = this.displayfield[
1388
+ i
1389
+ ].field.toLowerCase()
1390
+ }
1391
+ }
1392
+ } else if (this.dialogData.length > 1) {
1393
+ this.search()
1394
+ }
1395
+ if (this.dialogData.length > 0 && this.displayfield.length == 0) {
1396
+ this.search()
1397
+ this.displayfield = JSON.parse(pageParam.customDialog.displayfield)
1398
+ if (this.customDialog.dsType == 'dataSource') {
1399
+ for (var j = 0; j < this.displayfield.length; j++) {
1400
+ this.displayfield[j].field = this.displayfield[
1401
+ j
1402
+ ].field.toLowerCase()
1403
+ }
1404
+ }
1405
+ }
1406
+ },
1407
+ customDialogTreeShow(pageParam) {
1408
+ this.customDialog = pageParam.customDialog
1409
+ var customDialog = this.customDialog
1410
+ var mapParam = ''
1411
+ if (pageParam.param != undefined) {
1412
+ mapParam = JSON.stringify(pageParam.param)
1413
+ mapParam = mapParam.substring(1, mapParam.length - 1)
1414
+ }
1415
+ var requestType =
1416
+ customDialog.dsType == 'dataSource'
1417
+ ? 'GET'
1418
+ : customDialog.requestType
1419
+ ? customDialog.requestType
1420
+ : 'POST'
1421
+ var url =
1422
+ '${form}/form/customDialog/v1/getTreeData?alias=' +
1423
+ pageParam.alias +
1424
+ '&mapParam=' +
1425
+ mapParam
1426
+ var paramsObj = {}
1427
+ if (customDialog.dsType != 'dataSource') {
1428
+ url = customDialog.url
1429
+ var templatePa = customDialog.dataParam
1430
+ let ctx = {}
1431
+ if (customDialog.conditionfield) {
1432
+ var conditions = JSON.parse(customDialog.conditionfield)
1433
+ for (var i = 0; i < conditions.length; i++) {
1434
+ var con = conditions[i]
1435
+ if (requestType == 'POST') {
1436
+ if (templatePa) {
1437
+ // templatePa = templatePa.replace(
1438
+ // new RegExp('\\{' + con.field + '\\}', 'g'),
1439
+ // con.defaultValue
1440
+ // )
1441
+ ctx[con.field] = con.defaultValue
1442
+ } else {
1443
+ paramsObj[con.field] = con.defaultValue
1444
+ }
1445
+ } else {
1446
+ var ljChar = url.indexOf('?') == -1 ? '?' : '&'
1447
+ url = url + ljChar + con.field + '=' + con.defaultValue
1448
+ }
1449
+ }
1450
+ // 添加用户id 岗位id 组织id
1451
+ try {
1452
+ if (this.$requestConfig.getUserId()) {
1453
+ ctx.userId = this.$requestConfig.getUserId()
1454
+ }
1455
+ if (this.$requestConfig.getOrgId()) {
1456
+ ctx.orgId = this.$requestConfig.getOrgId()
1457
+ }
1458
+ if (this.$requestConfig.getPostId()) {
1459
+ ctx.postId = this.$requestConfig.getPostId()
1460
+ }
1461
+ } catch (e) {
1462
+ console.log('获取岗位id、用户id、组织id异常', e)
1463
+ }
1464
+ if (templatePa) {
1465
+ templatePa = utils.parseExp(templatePa, ctx)
1466
+ paramsObj = JSON.parse(templatePa)
1467
+ }
1468
+ }
1469
+ }
1470
+ var requestParams = {}
1471
+ requestParams.requestType = requestType
1472
+ requestParams.url = url
1473
+ requestParams.paramsObj = paramsObj
1474
+ this.searchTree(requestParams)
1475
+ this.customDialogShowTree = true
1476
+ },
1477
+ //树形查询
1478
+ searchTree(requestParams) {
1479
+ const this_ = this
1480
+ this.getTreeListJson(requestParams).then(function(response) {
1481
+ //显示字段配置
1482
+ let displayfield = JSON.parse(this_.customDialog.displayfield)
1483
+ this_.displayField = displayfield
1484
+ //把对话框配置的显示字段显示名称赋值给树形的显示值
1485
+ this_.defaultProps.label = displayfield.displayName
1486
+ this_.treeList = response
1487
+ //得到要加载树的信息
1488
+ this_.props1 = this_.toTreeData(
1489
+ response,
1490
+ displayfield.id,
1491
+ displayfield.pid,
1492
+ displayfield.displayName,
1493
+ displayfield.pvalue ? displayfield.pvalue : 0
1494
+ )
1495
+ })
1496
+ },
1497
+ //加载树的信息
1498
+ toTreeData(data, id, pid, name, pvalue) {
1499
+ // 建立个树形结构,需要定义个最顶层的父节点,pvalue是0
1500
+ return this.translateDataToTree(data, pid, id, name, pvalue)
1501
+ },
1502
+ translateDataToTree(data, pid, id, name, pvalue) {
1503
+ //把树数据有子节点的数据全部过滤掉(只留父节点的数据)
1504
+ let parents = data.filter(
1505
+ (value) =>
1506
+ value[id] == value[pid] ||
1507
+ value[pid] == null ||
1508
+ value[pid] == pvalue
1509
+ )
1510
+ if (!parents) {
1511
+ parents = data.filter(
1512
+ (value) =>
1513
+ value[pid] !== 'undefined' &&
1514
+ value[pid] != null &&
1515
+ value[id] != value[pid]
1516
+ )
1517
+ }
1518
+ return parents
1519
+ },
1520
+ loadTree(node, resolve) {
1521
+ if (node) {
1522
+ let this_ = this
1523
+ let displayField =
1524
+ this_.customDialog.style == 2
1525
+ ? this_.combiTreeDisplayField
1526
+ : this_.displayField
1527
+ resolve(
1528
+ this.treeList.filter(
1529
+ (value) => value[displayField.pid] === node.data[displayField.id]
1530
+ )
1531
+ )
1532
+ if (this.showData && this.showData.length > 0) {
1533
+ setTimeout(() => {
1534
+ this.showData.forEach((v) => {
1535
+ if (v.Pid == node.key) {
1536
+ this_.$refs.tree.setChecked(v, true)
1537
+ } else {
1538
+ this_.checkNode(v, this_)
1539
+ }
1540
+ })
1541
+ }, 400)
1542
+ }
1543
+ }
1544
+ },
1545
+
1546
+ afterOpen() {
1547
+ //打开对话框之后加载树
1548
+ this.loadCombinationTree()
1549
+ },
1550
+ loadCombinationTree() {
1551
+ if (this.customDialog.style != 2) {
1552
+ return
1553
+ }
1554
+ let combinationRule = JSON.parse(this.customDialog.combinationRule)
1555
+ this.combinationRule = combinationRule
1556
+ let treeAlias = combinationRule.leftTree
1557
+ //获取对话框数据
1558
+ this.$requestConfig
1559
+ .request({
1560
+ url: '${form}/form/customDialog/v2/getByAlias?alias=' + treeAlias,
1561
+ method: 'get',
1562
+ })
1563
+ .then((resp) => {
1564
+ if (resp && resp.value) {
1565
+ let treeDialog = resp.value
1566
+ this.leftTreeTitle = treeDialog.name
1567
+ let requestType =
1568
+ treeDialog.dsType == 'dataSource'
1569
+ ? 'GET'
1570
+ : treeDialog.requestType
1571
+ ? treeDialog.requestType
1572
+ : 'POST'
1573
+ let url =
1574
+ '${form}/form/customDialog/v1/getTreeData?alias=' +
1575
+ treeAlias +
1576
+ '&mapParam='
1577
+ let paramsObj = {}
1578
+ if (treeDialog.dsType != 'dataSource') {
1579
+ url = treeDialog.url
1580
+ let templatePa = treeDialog.dataParam
1581
+ if (treeDialog.conditionfield) {
1582
+ let conditions = JSON.parse(treeDialog.conditionfield)
1583
+ for (let i = 0; i < conditions.length; i++) {
1584
+ let con = conditions[i]
1585
+ if (requestType == 'POST') {
1586
+ if (templatePa) {
1587
+ templatePa = templatePa.replace(
1588
+ new RegExp('\\{' + con.field + '\\}', 'g'),
1589
+ con.defaultValue
1590
+ )
1591
+ } else {
1592
+ paramsObj[con.field] = con.defaultValue
1593
+ }
1594
+ } else {
1595
+ let ljChar = url.indexOf('?') == -1 ? '?' : '&'
1596
+ url = url + ljChar + con.field + '=' + con.defaultValue
1597
+ }
1598
+ }
1599
+ if (templatePa) {
1600
+ paramsObj = JSON.parse(templatePa)
1601
+ }
1602
+ }
1603
+ }
1604
+ let requestParams = {}
1605
+ requestParams.requestType = requestType
1606
+ requestParams.url = url
1607
+ requestParams.paramsObj = paramsObj
1608
+ this.getTreeListJson(requestParams).then((resp) => {
1609
+ if (treeDialog.displayfield && treeDialog.resultfield) {
1610
+ let displayField = JSON.parse(treeDialog.displayfield)
1611
+ let resultfield = JSON.parse(treeDialog.resultfield)
1612
+ this.defaultProps.label = displayField.displayName
1613
+ this.treeList = resp
1614
+ this.combiTreeDisplayField = displayField
1615
+ this.combinationTreeData = this.toTreeData(
1616
+ resp,
1617
+ displayField.id,
1618
+ displayField.pid,
1619
+ displayField.displayName,
1620
+ displayField.pvalue ? displayField.pvalue : '0',
1621
+ resultfield
1622
+ )
1623
+ }
1624
+ })
1625
+ }
1626
+ })
1627
+ },
1628
+ combiTreeClick(paramObj) {
1629
+ //组合对话框点击左树
1630
+ //清空旧的
1631
+ this.combinationTreeQuerys.splice(0)
1632
+ let combinationRule = JSON.parse(this.customDialog.combinationRule)
1633
+ if (!combinationRule.rules || combinationRule.rules.length == 0) {
1634
+ return
1635
+ }
1636
+ let rules = combinationRule.rules
1637
+ for (let i = 0; i < rules.length; i++) {
1638
+ let value = paramObj[rules[i].treeField]
1639
+ let property = rules[i].listField
1640
+ this.combinationTreeQuerys.push({
1641
+ property: property,
1642
+ value: value,
1643
+ group: 'treeGroup',
1644
+ operation: this.getOperation(rules[i].condition),
1645
+ relation: 'AND',
1646
+ })
1647
+ }
1648
+ this.search(true)
1649
+ },
1650
+ //获取运算符号
1651
+ getOperation(old) {
1652
+ if (!old) {
1653
+ return ''
1654
+ }
1655
+ if (old == 'EQ') {
1656
+ return 'EQUAL'
1657
+ }
1658
+ if (old == 'LK') {
1659
+ return 'LIKE'
1660
+ }
1661
+ if (old == 'LFK') {
1662
+ return 'LIKE'
1663
+ }
1664
+ if (old == 'IN') {
1665
+ return 'IN'
1666
+ }
1667
+ },
1668
+ toggleTree() {
1669
+ if (this.treeShow) {
1670
+ this.treeShow = false
1671
+ this.transtionWidth = '0%'
1672
+ this.toggleBtn = 'el-icon-arrow-right'
1673
+ } else {
1674
+ this.treeShow = true
1675
+ this.transtionWidth = '25%'
1676
+ this.toggleBtn = 'el-icon-arrow-left'
1677
+ }
1678
+ },
1679
+ initTemplateData() {
1680
+ let _this = this
1681
+ const custdialog = this.custdialog.custDialog
1682
+ if (
1683
+ !custdialog ||
1684
+ !custdialog.mappingConf ||
1685
+ custdialog.mappingConf.length < 1
1686
+ ) {
1687
+ return
1688
+ }
1689
+ const targetPath = this.getTargetPath(custdialog.mappingConf)
1690
+ const paths = targetPath.split('.')
1691
+ const formInst = utils.getOnlineFormInstance(this)
1692
+ //如果已有数据则不需要再次初始化
1693
+ const curData = formInst['data'][paths[0]][paths[1]]
1694
+ let initType = this.initFillDataType
1695
+ if (
1696
+ (!initType || initType == 'empty') &&
1697
+ curData.length > 0 &&
1698
+ !(curData.length == 1 && JSON.stringify(curData[0]) == '[]')
1699
+ ) {
1700
+ return
1701
+ } else if (initType == 'cover') {
1702
+ formInst['data'][paths[0]][paths[1]] = []
1703
+ }
1704
+ const loading = this.$loading({
1705
+ lock: true,
1706
+ text: '正在初始化填报模板...',
1707
+ spinner: 'el-icon-loading',
1708
+ background: 'rgba(0, 0, 0, 0.7)',
1709
+ })
1710
+ let myCustomDialog = null
1711
+
1712
+ this.$requestConfig
1713
+ .request({
1714
+ url:
1715
+ '${form}/form/customDialog/v1/getByAlias?alias=' +
1716
+ custdialog.alias,
1717
+ method: 'get',
1718
+ })
1719
+ .then(
1720
+ (data) => {
1721
+ myCustomDialog = data
1722
+ _this.customDialog = data
1723
+ },
1724
+ () => {
1725
+ _this.closeLoading(loading)
1726
+ _this.$message({
1727
+ message: '获取自定义对话框失败!',
1728
+ type: 'error',
1729
+ })
1730
+ }
1731
+ )
1732
+ .then(function() {
1733
+ const currentUser = JSON.parse(
1734
+ sessionStorage.getItem('currentUser')
1735
+ )
1736
+ if (
1737
+ !_this.custdialog.orgConfig.code &&
1738
+ !_this.custdialog.orgConfig.name &&
1739
+ !_this.custdialog.orgConfig.id
1740
+ ) {
1741
+ _this.closeLoading(loading)
1742
+ _this.toFillInitData(
1743
+ _this,
1744
+ myCustomDialog.dsType,
1745
+ formInst['data']
1746
+ )
1747
+ } else if (
1748
+ currentUser &&
1749
+ localStorage.getItem('curFillOrg_' + currentUser.account)
1750
+ ) {
1751
+ _this.closeLoading(loading)
1752
+ _this.fillOrg = JSON.parse(
1753
+ localStorage.getItem('curFillOrg_' + currentUser.account)
1754
+ )
1755
+ _this.toFillInitData(
1756
+ _this,
1757
+ myCustomDialog.dsType,
1758
+ formInst['data']
1759
+ )
1760
+ } else {
1761
+ _this.$requestConfig
1762
+ .request({
1763
+ url: '${uc}/api/org/v1/org/getFillOrg',
1764
+ method: 'get',
1765
+ })
1766
+ .then(
1767
+ (respdata) => {
1768
+ _this.closeLoading(loading)
1769
+ const rep = respdata
1770
+ if (rep.state) {
1771
+ _this.fillOrg = rep.value
1772
+ localStorage.setItem(
1773
+ 'curFillOrg_' + currentUser.account,
1774
+ JSON.stringify(rep.value)
1775
+ )
1776
+ _this.toFillInitData(
1777
+ _this,
1778
+ myCustomDialog.dsType,
1779
+ formInst['data']
1780
+ )
1781
+ } else {
1782
+ _this.$message({
1783
+ message: rep.message,
1784
+ type: 'warning',
1785
+ })
1786
+ }
1787
+ },
1788
+ () => {
1789
+ _this.closeLoading(loading)
1790
+ _this.$message({
1791
+ message: '获取当前用户填制单位失败!',
1792
+ type: 'warning',
1793
+ })
1794
+ }
1795
+ )
1796
+ }
1797
+ })
1798
+ },
1799
+ closeLoading(loading) {
1800
+ setTimeout(function() {
1801
+ loading.close()
1802
+ }, 2000)
1803
+ },
1804
+ getTargetPath(mappingConf) {
1805
+ let target = ''
1806
+ if (mappingConf && mappingConf.length > 0) {
1807
+ mappingConf.forEach((map) => {
1808
+ if (
1809
+ map['target'] &&
1810
+ map['target'].length == 1 &&
1811
+ map['target'][0]
1812
+ ) {
1813
+ target = map['target'][0]
1814
+ return target
1815
+ }
1816
+ })
1817
+ }
1818
+ return target
1819
+ },
1820
+ toFillInitData(_this, dsType, curData) {
1821
+ const custdialog = this.custdialog.custDialog
1822
+ let params = [] //绑定的表单字段
1823
+ if (custdialog.conditions) {
1824
+ //对话框按表单字段查询(参数传入的)
1825
+ let bindList = custdialog.conditions
1826
+ if (bindList.length > 0) {
1827
+ bindList.forEach((ele) => {
1828
+ //绑定表单字段
1829
+ if (ele.defaultType == '3' && ele.bind) {
1830
+ let obj = {}
1831
+ obj.field = ele.field
1832
+ const bindArray = ele.bind.split('.')
1833
+ if (bindArray.length == 3) {
1834
+ obj.bind = curData[bindArray[1]][bindArray[2]]
1835
+ params.push(obj)
1836
+ }
1837
+ }
1838
+ })
1839
+ }
1840
+ }
1841
+ let url =
1842
+ '${form}/form/customDialog/v1/getListData?alias=' + custdialog.alias
1843
+ if (params.length > 0) {
1844
+ let paStr = ''
1845
+ params.forEach((pa) => {
1846
+ if (paStr) {
1847
+ paStr += ','
1848
+ }
1849
+ paStr = paStr + '"' + pa.field + '":"' + pa.bind + '"'
1850
+ })
1851
+ url = url + '&mapParam=' + paStr
1852
+ } else {
1853
+ url = url + '&mapParam='
1854
+ }
1855
+ const param = { pageBean: { page: 1, pageSize: 1000, showTotal: true } }
1856
+ _this.$requestConfig
1857
+ .request({
1858
+ url: url,
1859
+ method: 'post',
1860
+ data: param,
1861
+ })
1862
+ .then(
1863
+ (respdata) => {
1864
+ const response = respdata
1865
+ if (response.rows) {
1866
+ _this.syncInitTableValue(
1867
+ _this.maxRow > 0 && response.rows.length > _this.maxRow
1868
+ ? response.rows.splice(0, _this.maxRow)
1869
+ : response.rows,
1870
+ dsType
1871
+ )
1872
+ }
1873
+ },
1874
+ () => {
1875
+ _this.$message({
1876
+ message: '获取初始化数据失败!',
1877
+ type: 'error',
1878
+ })
1879
+ }
1880
+ )
1881
+ },
1882
+ syncInitTableValue(s, dsType) {
1883
+ let custDialog = this.custdialog
1884
+ var returnStr = JSON.parse(this.customDialog.resultfield)
1885
+ //拿到返回的字段
1886
+ var field = new Array([returnStr.length])
1887
+ var comment = new Array([returnStr.length])
1888
+ var str = []
1889
+ var ids = []
1890
+ for (var i = 0; i < returnStr.length; i++) {
1891
+ field[i] =
1892
+ dsType == 'dataSource'
1893
+ ? returnStr[i].field.toLowerCase()
1894
+ : returnStr[i].field
1895
+ comment[i] =
1896
+ dsType == 'dataSource'
1897
+ ? returnStr[i].comment.toLowerCase()
1898
+ : returnStr[i].comment
1899
+ }
1900
+ if (this.customDialog.selectNum === 1) {
1901
+ var temp = ''
1902
+ for (var j = 0; j < comment.length; j++) {
1903
+ let va = s[0][field[j]]
1904
+ va = typeof va == 'undefined' ? '' : va
1905
+ temp += '"' + comment[j] + '":"' + va + '",'
1906
+ }
1907
+ if (temp != '') {
1908
+ temp = '{' + temp.substring(0, temp.length - 1) + '}'
1909
+ }
1910
+ str.push(utils.parseToJson(temp))
1911
+ ids.push(s[0].id)
1912
+ } else {
1913
+ for (var l = 0; l < s.length; l++) {
1914
+ var tempL = ''
1915
+ for (var m = 0; m < comment.length; m++) {
1916
+ let va = s[l][field[m]]
1917
+ va = typeof va == 'undefined' ? '' : va
1918
+ tempL += '"' + comment[m] + '":"' + va + '",'
1919
+ }
1920
+ if (tempL != '') {
1921
+ tempL = '{' + tempL.substring(0, tempL.length - 1) + '}'
1922
+ }
1923
+ str.push(utils.parseToJson(tempL))
1924
+ ids.push(s[l].id)
1925
+ }
1926
+ }
1927
+ const formInst = utils.getOnlineFormInstance(this)
1928
+ this.instId = formInst.$parent.instId
1929
+ //处理填制部门
1930
+ let fillOrg = {}
1931
+ if (
1932
+ custDialog.orgConfig &&
1933
+ custDialog.orgConfig.name &&
1934
+ this.fillOrg.id
1935
+ ) {
1936
+ const namePath = custDialog.orgConfig.name.split('.')
1937
+ const orgNameField = namePath[namePath.length - 1]
1938
+ fillOrg[orgNameField] = this.fillOrg.name
1939
+ if (custDialog.orgConfig.id) {
1940
+ const idPath = custDialog.orgConfig.id.split('.')
1941
+ const orgIdField = idPath[idPath.length - 1]
1942
+ fillOrg[orgIdField] = this.fillOrg.id
1943
+ }
1944
+ if (custDialog.orgConfig.code) {
1945
+ const codePath = custDialog.orgConfig.code.split('.')
1946
+ const orgCodeField = codePath[codePath.length - 1]
1947
+ fillOrg[orgCodeField] = this.fillOrg.code
1948
+ }
1949
+ }
1950
+ if (custDialog.orgConfig.instId) {
1951
+ const instIdPath = custDialog.orgConfig.instId.split('.')
1952
+ const instIdField = instIdPath[instIdPath.length - 1]
1953
+ fillOrg[instIdField] = this.instId
1954
+ }
1955
+ const returnData = str
1956
+ const _this = this
1957
+
1958
+ returnData.forEach((row) => {
1959
+ var subLineData = {}
1960
+ var targetArray = null
1961
+ custDialog.custDialog.mappingConf.forEach((con) => {
1962
+ if (con.target[0]) {
1963
+ targetArray = con.target[0].split('.')
1964
+ var from = ''
1965
+ if (_this.customDialog.dsType == 'restful') {
1966
+ from = con.from
1967
+ } else {
1968
+ from = con.from.toLowerCase()
1969
+ }
1970
+ subLineData[targetArray[targetArray.length - 1]] = row[from]
1971
+ }
1972
+ })
1973
+ if (fillOrg && JSON.stringify(fillOrg) != '{}') {
1974
+ subLineData = { ...subLineData, ...fillOrg }
1975
+ }
1976
+ formInst['data'][targetArray[0]][targetArray[1]].push(subLineData)
1977
+ })
1978
+ },
1979
+ guid() {
1980
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(
1981
+ c
1982
+ ) {
1983
+ var r = (Math.random() * 16) | 0,
1984
+ v = c == 'x' ? r : (r & 0x3) | 0x8
1985
+ return v.toString(16)
1986
+ })
1987
+ },
1988
+ },
1989
+ }
1990
+ </script>
1991
+ <style lang="scss" scoped>
1992
+ ::v-deep .el-button--mini {
1993
+ padding: 0px 15px;
1994
+ font-size: 12px;
1995
+ border-radius: 3px;
1996
+ height: 100%;
1997
+ border-top-left-radius: 0;
1998
+ border-bottom-left-radius: 0;
1999
+ }
2000
+ ::v-deep .el-button--info {
2001
+ background-color: #f5f7fa;
2002
+ border-color: #e4e7ed;
2003
+ color: #c0c4cc;
2004
+ }
2005
+ ::v-deep .el-input__suffix {
2006
+ position: absolute;
2007
+ height: 100%;
2008
+ right: 0px !important;
2009
+ top: 0;
2010
+ text-align: center;
2011
+ color: #c0c4cc;
2012
+ -webkit-transition: all 0.3s;
2013
+ transition: all 0.3s;
2014
+ pointer-events: none;
2015
+ }
2016
+ .el-input__inner[aria-invalid='true'] {
2017
+ border-color: #f56c6c;
2018
+ }
2019
+
2020
+ .el-select__tags {
2021
+ background: #fff;
2022
+ margin-left: 1px;
2023
+ }
2024
+
2025
+ .left-aside {
2026
+ border-right: 1px solid #eee;
2027
+ padding: 10px;
2028
+ }
2029
+
2030
+ .org-tree {
2031
+ height: 440px;
2032
+ margin-top: 10px;
2033
+ }
2034
+
2035
+ .middle-header {
2036
+ height: unset !important;
2037
+ display: flex;
2038
+ flex-direction: row;
2039
+ flex-wrap: wrap;
2040
+ .search-item {
2041
+ display: flex;
2042
+ // width: 33.33%;
2043
+ margin-right: 12px;
2044
+ align-items: center;
2045
+ }
2046
+ .btn-wrap {
2047
+ line-height: 50px;
2048
+ }
2049
+ }
2050
+
2051
+ .org-table {
2052
+ width: 100%;
2053
+ }
2054
+
2055
+ .right-aside {
2056
+ border-left: 1px solid #eee;
2057
+ }
2058
+
2059
+ .select-aside {
2060
+ border-left: 1px solid #eee;
2061
+ }
2062
+
2063
+ .select-header {
2064
+ border-bottom: 1px solid #eee;
2065
+ height: 52px !important;
2066
+ }
2067
+
2068
+ .select-header > span {
2069
+ padding: 10px 0;
2070
+ line-height: 53px;
2071
+ }
2072
+ .select-tree-div {
2073
+ height: calc(100% - 60px);
2074
+ overflow-y: auto;
2075
+ min-height: unset;
2076
+ }
2077
+ ::v-deep .el-dialog__body {
2078
+ padding: 0;
2079
+ overflow-y: auto;
2080
+ }
2081
+
2082
+ ::v-deep .el-card__header {
2083
+ padding: 10px;
2084
+ }
2085
+
2086
+ ::v-deep .el-card__body {
2087
+ padding: 10px;
2088
+ }
2089
+
2090
+ .org-find-card ::v-deep .el-card__header {
2091
+ background: #f5f7fa;
2092
+ }
2093
+
2094
+ ::v-deep .el-main {
2095
+ padding: 0 20px !important;
2096
+ }
2097
+
2098
+ .button-group {
2099
+ width: 70px;
2100
+ height: 170px;
2101
+ margin: 0px auto;
2102
+ position: relative;
2103
+ top: 50%;
2104
+ -webkit-transform: translateY(-50%);
2105
+ -moz-transform: translateY(-50%);
2106
+ -ms-transform: translateY(-50%);
2107
+ -o-transform: translateY(-50%);
2108
+ transform: translateY(-50%);
2109
+ }
2110
+
2111
+ .button-group > button {
2112
+ display: block;
2113
+ margin: 8px 0;
2114
+ }
2115
+ @media (max-width: 1280px) {
2116
+ ::v-deep .el-dialog {
2117
+ width: 96% !important;
2118
+ margin-top: 2vh !important;
2119
+ }
2120
+ }
2121
+ ::v-deep.el-dialog__wrapper {
2122
+ overflow: unset !important;
2123
+ &::-webkit-scrollbar {
2124
+ width: 0;
2125
+ background-color: transparent;
2126
+ }
2127
+ }
2128
+
2129
+ ::v-deep .el-dialog {
2130
+ min-height: 400px;
2131
+ }
2132
+ @media (max-height: 960px) {
2133
+ ::v-deep .el-dialog__body .el-container {
2134
+ height: 100% !important;
2135
+ }
2136
+ }
2137
+ ::v-deep .el-divider--vertical {
2138
+ height: 100%;
2139
+ }
2140
+ .textRadio {
2141
+ ::v-deep .el-radio__label {
2142
+ display: none;
2143
+ }
2144
+ }
2145
+ </style>