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