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