vue2-client 1.10.6 → 1.10.8

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 (424) hide show
  1. package/.env +19 -19
  2. package/.env.gaslink +19 -19
  3. package/.env.his +19 -19
  4. package/.env.liuli +19 -19
  5. package/.env.revenue +19 -19
  6. package/.env.scada +19 -19
  7. package/.eslintrc.js +90 -90
  8. package/CHANGELOG.md +824 -824
  9. package/Components.md +60 -60
  10. package/babel.config.js +21 -21
  11. package/docs/Logic/345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +45 -45
  12. package/docs/LowCode/lowcode.md +155 -155
  13. package/docs/LowCode/lowcodeForDeveloper.md +230 -230
  14. package/docs/index.md +30 -30
  15. package/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +174 -174
  16. package/index.js +31 -31
  17. package/jest-transform-stub.js +8 -8
  18. package/jest.config.js +21 -21
  19. package/jest.setup.js +7 -7
  20. package/jsconfig.json +19 -19
  21. package/package.json +107 -107
  22. package/public/his/editor/editor.html +51 -51
  23. package/public/his/editor/mock/bind_data.html +779 -779
  24. package/public/his/editor/mock/data_table.html +40 -40
  25. package/public/his/editor/mock/sign.html +75 -75
  26. package/public/his/editor/vender/JsBarcode.all.js +3669 -3669
  27. package/public/his/editor/vender/date97/My97DatePicker.htm +65 -65
  28. package/public/his/editor/vender/date97/WdatePicker.js +677 -677
  29. package/public/his/editor/vender/date97/calendar.js +4 -4
  30. package/public/his/editor/vender/date97/lang/en.js +13 -13
  31. package/public/his/editor/vender/date97/lang/zh-cn.js +13 -13
  32. package/public/his/editor/vender/date97/lang/zh-tw.js +13 -13
  33. package/public/his/editor/vender/date97/skin/WdatePicker.css +10 -10
  34. package/public/his/editor/vender/date97/skin/default/datepicker.css +328 -328
  35. package/public/his/editor/vender/date97/skin/ext/datepicker.css +308 -308
  36. package/public/his/editor/vender/date97/skin/whyGreen/datepicker.css +255 -255
  37. package/public/his/editor/vender/diff.js +1627 -1627
  38. package/public/his/editor/vender/editor.js +1 -1
  39. package/public/his/editor/vender/fabric.js +31187 -31187
  40. package/public/his/editor/vender/jquery/jquery.base64.js +190 -190
  41. package/public/his/editor/vender/jquery/jquery.js +10872 -10872
  42. package/public/his/editor/vender/jquery/jquery.print.js +255 -255
  43. package/public/his/editor/vender/jquery/zTreeStyle/zTreeStyle.css +96 -96
  44. package/public/his/editor/vender/mui/mui.min.css +4 -4
  45. package/public/his/editor/vender/mui/mui.min.js +5 -5
  46. package/public/his/editor/vender/mui/mui.picker.min.css +6 -6
  47. package/public/his/editor/vender/mui/mui.picker.min.js +6 -6
  48. package/public/his/editor/vender/qrcode.js +7 -7
  49. package/public/his/editor/vender/requirejs/require.js +2145 -2145
  50. package/public/his/editor/vender/signature/jSignature.CompressorSVG.js +518 -518
  51. package/public/his/editor/vender/signature/jSignature.UndoButton.js +164 -164
  52. package/public/his/editor/vender/signature/jSignature.js +1486 -1486
  53. package/public/his/editor/vender/validator.js +5094 -5094
  54. package/public/his/editor/vender/weui/weui.css +5659 -5659
  55. package/public/his/editor/vender/weui/weui.min.css +4 -4
  56. package/public/his/editor/vender/weui/weui.min.js +11 -11
  57. package/src/App.vue +196 -196
  58. package/src/ReportView.js +19 -19
  59. package/src/assets/img/querySlotDemo.svg +15 -15
  60. package/src/assets/svg/badtwo.svg +1 -1
  61. package/src/assets/svg/goodtwo.svg +1 -1
  62. package/src/base-client/components/AI/AskAiBtn.vue +136 -136
  63. package/src/base-client/components/AI/demo.vue +31 -31
  64. package/src/base-client/components/common/AMisRender/index.js +3 -3
  65. package/src/base-client/components/common/AMisRender/index.vue +263 -263
  66. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +470 -470
  67. package/src/base-client/components/common/AddressSearchCombobox/IcMapIcon.vue +16 -16
  68. package/src/base-client/components/common/AddressSearchCombobox/demo.vue +36 -36
  69. package/src/base-client/components/common/AddressSearchCombobox/ic_map.svg +6 -6
  70. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
  71. package/src/base-client/components/common/CitySelect/CitySelect.vue +342 -342
  72. package/src/base-client/components/common/CitySelect/index.js +3 -3
  73. package/src/base-client/components/common/CitySelect/index.md +109 -109
  74. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
  75. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1014 -1014
  76. package/src/base-client/components/common/CreateQuery/index.js +3 -3
  77. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  78. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +452 -452
  79. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +511 -511
  80. package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
  81. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  82. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
  83. package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
  84. package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
  85. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
  86. package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
  87. package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
  88. package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
  89. package/src/base-client/components/common/LowCodeComponent/LowCodeEditorModal.vue +108 -108
  90. package/src/base-client/components/common/LowCodeComponent/LowCodeEditorPanel.vue +413 -413
  91. package/src/base-client/components/common/LowCodeComponent/LowCodePageOrganization.vue +502 -502
  92. package/src/base-client/components/common/LowCodeComponent/LowCodeRender.vue +728 -728
  93. package/src/base-client/components/common/LowCodeComponent/LowCodeRenderEnter.vue +29 -29
  94. package/src/base-client/components/common/LowCodeComponent/LowCodeUIStore.vue +219 -219
  95. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeAddPageModal.vue +117 -117
  96. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeCustomJSModal.vue +80 -80
  97. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeEventEditorModal.vue +398 -398
  98. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLifeCycleModal.vue +65 -65
  99. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicCallbackModal.vue +64 -64
  100. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicParamModal.vue +73 -73
  101. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeRunFunctionParamModal.vue +76 -76
  102. package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
  103. package/src/base-client/components/common/PersonSetting/index.js +3 -3
  104. package/src/base-client/components/common/Recording/Recording.vue +243 -243
  105. package/src/base-client/components/common/Recording/index.js +3 -3
  106. package/src/base-client/components/common/Tree/Tree.vue +149 -149
  107. package/src/base-client/components/common/Tree/index.js +2 -2
  108. package/src/base-client/components/common/Upload/Upload.vue +239 -239
  109. package/src/base-client/components/common/Upload/index.js +3 -3
  110. package/src/base-client/components/common/XAddForm/XAddForm.vue +113 -113
  111. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +1069 -1066
  112. package/src/base-client/components/common/XAddNativeForm/demo.vue +36 -35
  113. package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
  114. package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +303 -303
  115. package/src/base-client/components/common/XAddNativeFormOA/index.js +3 -3
  116. package/src/base-client/components/common/XAddNativeFormOA/index.md +146 -146
  117. package/src/base-client/components/common/XAddReport/XAddReport.vue +207 -207
  118. package/src/base-client/components/common/XAddReport/index.js +3 -3
  119. package/src/base-client/components/common/XAddReport/index.md +56 -56
  120. package/src/base-client/components/common/XBadge/XBadge.vue +94 -94
  121. package/src/base-client/components/common/XButtons/XButtonDemo.vue +28 -28
  122. package/src/base-client/components/common/XButtons/XButtons.vue +71 -71
  123. package/src/base-client/components/common/XButtons/index.js +3 -3
  124. package/src/base-client/components/common/XButtons/index.md +61 -61
  125. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  126. package/src/base-client/components/common/XCheckList/XCheckList.vue +106 -106
  127. package/src/base-client/components/common/XCheckList/XCheckListDemo.vue +41 -41
  128. package/src/base-client/components/common/XConversation/XConversation.vue +263 -263
  129. package/src/base-client/components/common/XConversation/XConversationDemo.vue +28 -28
  130. package/src/base-client/components/common/XDataCard/XDataCard.vue +411 -411
  131. package/src/base-client/components/common/XDataCard/index.js +3 -3
  132. package/src/base-client/components/common/XDataCard/index.md +1 -1
  133. package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
  134. package/src/base-client/components/common/XDataDrawer/index.js +3 -3
  135. package/src/base-client/components/common/XDataDrawer/index.md +41 -41
  136. package/src/base-client/components/common/XDatePicker/demo.vue +153 -153
  137. package/src/base-client/components/common/XDatePicker/index.vue +259 -259
  138. package/src/base-client/components/common/XDescriptions/XDescriptions.vue +169 -169
  139. package/src/base-client/components/common/XDescriptions/XDescriptionsGroup.vue +304 -304
  140. package/src/base-client/components/common/XDescriptions/demo.vue +50 -50
  141. package/src/base-client/components/common/XDescriptions/index.js +3 -3
  142. package/src/base-client/components/common/XDescriptions/index.md +83 -83
  143. package/src/base-client/components/common/XDetailsView/XDetailsView.vue +238 -238
  144. package/src/base-client/components/common/XDetailsView/index.js +3 -3
  145. package/src/base-client/components/common/XForm/XForm.vue +393 -393
  146. package/src/base-client/components/common/XForm/XFormItem.vue +1286 -1263
  147. package/src/base-client/components/common/XForm/XStatusButton.vue +54 -54
  148. package/src/base-client/components/common/XForm/XTreeSelect.vue +250 -250
  149. package/src/base-client/components/common/XForm/index.md +178 -178
  150. package/src/base-client/components/common/XForm/itemComponent/XClickChangeBtn/index.vue +49 -49
  151. package/src/base-client/components/common/XFormCol/XFormCol.vue +157 -146
  152. package/src/base-client/components/common/XFormGroup/XFormGroup.vue +295 -295
  153. package/src/base-client/components/common/XFormGroup/demo.vue +45 -45
  154. package/src/base-client/components/common/XFormGroup/index.js +3 -3
  155. package/src/base-client/components/common/XFormGroup/index.md +38 -38
  156. package/src/base-client/components/common/XFormGroupDetails/XFormGroupDetails.vue +72 -72
  157. package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
  158. package/src/base-client/components/common/XFormTable/XFormTable.vue +854 -854
  159. package/src/base-client/components/common/XFormTable/demo.vue +60 -60
  160. package/src/base-client/components/common/XFormTable/index.md +92 -92
  161. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +167 -167
  162. package/src/base-client/components/common/XLabelSelect/XLabelSelect.vue +110 -110
  163. package/src/base-client/components/common/XLabelSelect/XLabelSelectDemo.vue +35 -35
  164. package/src/base-client/components/common/XLicensePlate/XLicensePlate.vue +193 -193
  165. package/src/base-client/components/common/XLicensePlate/XLicensePlateDemo.vue +48 -48
  166. package/src/base-client/components/common/XPrint/Demo.vue +41 -41
  167. package/src/base-client/components/common/XPrint/OpenInvoice.vue +21 -21
  168. package/src/base-client/components/common/XPrint/PrintBill.vue +302 -302
  169. package/src/base-client/components/common/XPrint/PrintHtml.js +98 -98
  170. package/src/base-client/components/common/XPrint/css/hiPrintCss.js +359 -359
  171. package/src/base-client/components/common/XPrint/css/lodopCss.js +26 -26
  172. package/src/base-client/components/common/XPrint/css/print-lock.css +351 -351
  173. package/src/base-client/components/common/XPrint/index.vue +97 -97
  174. package/src/base-client/components/common/XReport/XReport.vue +892 -892
  175. package/src/base-client/components/common/XReport/XReportDemo.vue +304 -304
  176. package/src/base-client/components/common/XReport/XReportDesign.vue +463 -463
  177. package/src/base-client/components/common/XReport/XReportJsonRender.vue +381 -381
  178. package/src/base-client/components/common/XReport/XReportTrGroup.vue +808 -808
  179. package/src/base-client/components/common/XReport/index.js +3 -3
  180. package/src/base-client/components/common/XReport/index.md +44 -44
  181. package/src/base-client/components/common/XReport/print.js +186 -186
  182. package/src/base-client/components/common/XReportDrawer/XReportDrawer.vue +201 -201
  183. package/src/base-client/components/common/XReportDrawer/index.js +3 -3
  184. package/src/base-client/components/common/XReportGrid/XReport.vue +1070 -1070
  185. package/src/base-client/components/common/XReportGrid/XReportDemo.vue +47 -47
  186. package/src/base-client/components/common/XReportGrid/XReportDesign.vue +628 -628
  187. package/src/base-client/components/common/XReportGrid/XReportJsonRender.vue +380 -380
  188. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +1104 -1104
  189. package/src/base-client/components/common/XReportGrid/index.js +3 -3
  190. package/src/base-client/components/common/XReportGrid/index.md +44 -44
  191. package/src/base-client/components/common/XReportGrid/print.js +184 -184
  192. package/src/base-client/components/common/XReportSlot/XReportSlot.vue +110 -110
  193. package/src/base-client/components/common/XReportSlot/index.js +3 -3
  194. package/src/base-client/components/common/XReportSlot/index.md +48 -48
  195. package/src/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue +166 -166
  196. package/src/base-client/components/common/XSimpleDescriptions/index.js +3 -3
  197. package/src/base-client/components/common/XSimpleDescriptions/index.md +7 -7
  198. package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
  199. package/src/base-client/components/common/XStepView/index.js +3 -3
  200. package/src/base-client/components/common/XStepView/index.md +31 -31
  201. package/src/base-client/components/common/XTab/XTab.vue +201 -201
  202. package/src/base-client/components/common/XTab/XTabDemo.vue +22 -22
  203. package/src/base-client/components/common/XTab/index.js +3 -3
  204. package/src/base-client/components/common/XTable/CustomFuncCel.vue +51 -51
  205. package/src/base-client/components/common/XTable/ExportExcel.vue +284 -284
  206. package/src/base-client/components/common/XTable/TableCellRenderer.vue +161 -161
  207. package/src/base-client/components/common/XTable/XTable.vue +1415 -1415
  208. package/src/base-client/components/common/XTable/index.md +255 -255
  209. package/src/base-client/components/common/XTagGroup/index.vue +52 -52
  210. package/src/base-client/components/common/XTree/XTree.vue +423 -423
  211. package/src/base-client/components/common/XTree/XTreePro.vue +451 -451
  212. package/src/base-client/components/common/XTree/index.js +3 -3
  213. package/src/base-client/components/common/XTree/index.md +36 -36
  214. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +113 -113
  215. package/src/base-client/components/common/XTreeOne/XTreeOnePro.vue +128 -128
  216. package/src/base-client/components/common/richTextModal/index.vue +56 -56
  217. package/src/base-client/components/common/richTextModal/richDemo.vue +48 -48
  218. package/src/base-client/components/his/XHisEditor/XHisEditor.vue +359 -359
  219. package/src/base-client/components/his/XHisEditor/index.js +3 -3
  220. package/src/base-client/components/index.js +51 -51
  221. package/src/base-client/components/layout/XPageView/RenderRow.vue +63 -63
  222. package/src/base-client/components/layout/XPageView/XErrorView.vue +11 -11
  223. package/src/base-client/components/layout/XPageView/XPageView.vue +155 -155
  224. package/src/base-client/components/layout/XPageView/index.js +3 -3
  225. package/src/base-client/components/layout/XPageView/index.md +38 -38
  226. package/src/base-client/components/layout/XTreeView/XTreeView.vue +130 -130
  227. package/src/base-client/components/layout/XTreeView/index.js +3 -3
  228. package/src/base-client/components/layout/XTreeView/index.md +46 -46
  229. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  230. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  231. package/src/base-client/plugins/AppData.js +121 -121
  232. package/src/base-client/plugins/Config.js +19 -19
  233. package/src/base-client/plugins/GetLoginInfoService.js +183 -183
  234. package/src/base-client/plugins/Recording.js +258 -258
  235. package/src/base-client/plugins/index.js +23 -23
  236. package/src/base-client/plugins/tabs-page-plugin.js +39 -39
  237. package/src/bootstrap.js +42 -42
  238. package/src/components/Charts/Bar.vue +62 -62
  239. package/src/components/Charts/ChartCard.vue +134 -134
  240. package/src/components/Charts/Liquid.vue +67 -67
  241. package/src/components/Charts/MiniArea.vue +39 -39
  242. package/src/components/Charts/MiniBar.vue +39 -39
  243. package/src/components/Charts/MiniProgress.vue +75 -75
  244. package/src/components/Charts/MiniSmoothArea.vue +40 -40
  245. package/src/components/Charts/Radar.vue +68 -68
  246. package/src/components/Charts/RankList.vue +77 -77
  247. package/src/components/Charts/TagCloud.vue +113 -113
  248. package/src/components/Charts/TransferBar.vue +64 -64
  249. package/src/components/Charts/Trend.vue +82 -82
  250. package/src/components/Charts/chart.less +12 -12
  251. package/src/components/Charts/smooth.area.less +13 -13
  252. package/src/components/CodeMirror/inedx.vue +118 -118
  253. package/src/components/CodeMirror/setting.js +40 -40
  254. package/src/components/FilePreview/FilePreview.vue +166 -166
  255. package/src/components/NumberInfo/NumberInfo.vue +54 -54
  256. package/src/components/NumberInfo/index.js +3 -3
  257. package/src/components/NumberInfo/index.less +54 -54
  258. package/src/components/NumberInfo/index.md +43 -43
  259. package/src/components/STable/index.js +390 -390
  260. package/src/components/card/ChartCard.vue +79 -79
  261. package/src/components/chart/Bar.vue +60 -60
  262. package/src/components/chart/MiniArea.vue +67 -67
  263. package/src/components/chart/MiniBar.vue +59 -59
  264. package/src/components/chart/MiniProgress.vue +57 -57
  265. package/src/components/chart/Radar.vue +80 -80
  266. package/src/components/chart/RankingList.vue +60 -60
  267. package/src/components/chart/Trend.vue +79 -79
  268. package/src/components/chart/index.less +9 -9
  269. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  270. package/src/components/checkbox/ImgCheckbox.vue +117 -117
  271. package/src/components/checkbox/ImgCheckboxGroup.vue +76 -76
  272. package/src/components/checkbox/index.js +9 -9
  273. package/src/components/exception/ExceptionPage.vue +70 -70
  274. package/src/components/g2Charts/constants.js +202 -202
  275. package/src/components/g2Charts/demo.vue +808 -808
  276. package/src/components/g2Charts/designer.vue +228 -228
  277. package/src/components/g2Charts/designerBaseConfig.vue +61 -61
  278. package/src/components/g2Charts/designerDataConfig.vue +259 -259
  279. package/src/components/g2Charts/designerStyleConfig.vue +16 -16
  280. package/src/components/g2Charts/index.vue +397 -397
  281. package/src/components/index.js +36 -36
  282. package/src/components/input/IInput.vue +66 -66
  283. package/src/components/menu/SideMenu.vue +75 -75
  284. package/src/components/menu/menu.js +273 -273
  285. package/src/components/setting/Setting.vue +234 -234
  286. package/src/components/tool/AStepItem.vue +60 -60
  287. package/src/config/CreateQueryConfig.js +325 -325
  288. package/src/config/default/antd.config.js +89 -89
  289. package/src/config/default/setting.config.js +55 -55
  290. package/src/font-style/font.css +4 -4
  291. package/src/layouts/CommonLayout.vue +56 -56
  292. package/src/layouts/GridView.vue +45 -45
  293. package/src/layouts/PageLayout.vue +151 -151
  294. package/src/layouts/SinglePageView.vue +136 -136
  295. package/src/layouts/header/AdminHeader.vue +132 -132
  296. package/src/layouts/header/HeaderNotice.vue +177 -177
  297. package/src/layouts/header/InstitutionDetail.vue +181 -181
  298. package/src/layouts/tabs/TabsHead.vue +189 -189
  299. package/src/layouts/tabs/TabsView.vue +390 -390
  300. package/src/lib.js +1 -1
  301. package/src/main.js +34 -34
  302. package/src/mock/extend/index.js +84 -84
  303. package/src/mock/goods/index.js +108 -108
  304. package/src/pages/AMisDemo/AMisDemo.vue +325 -325
  305. package/src/pages/AMisDemo/AMisDemo2.vue +74 -74
  306. package/src/pages/DefaultExample/index.vue +77 -77
  307. package/src/pages/DynamicStatistics/ChartSelector.vue +331 -331
  308. package/src/pages/DynamicStatistics/DataTabs.vue +83 -83
  309. package/src/pages/DynamicStatistics/DynamicTable.vue +128 -128
  310. package/src/pages/DynamicStatistics/EvaluationArea.vue +69 -69
  311. package/src/pages/DynamicStatistics/FavoriteList.vue +50 -50
  312. package/src/pages/DynamicStatistics/QuestionHistoryAndFavorites.vue +591 -591
  313. package/src/pages/DynamicStatistics/SearchBar.vue +192 -192
  314. package/src/pages/DynamicStatistics/index.vue +282 -282
  315. package/src/pages/Example/childIndex.vue +15 -15
  316. package/src/pages/Example/index.vue +30 -30
  317. package/src/pages/NewDynamicStatistics/ChartSelector.vue +331 -331
  318. package/src/pages/NewDynamicStatistics/DataTabs.vue +122 -122
  319. package/src/pages/NewDynamicStatistics/DynamicTable.vue +128 -128
  320. package/src/pages/NewDynamicStatistics/EvaluationArea.vue +69 -69
  321. package/src/pages/NewDynamicStatistics/FavoriteList.vue +50 -50
  322. package/src/pages/NewDynamicStatistics/QuestionHistoryAndFavorites.vue +289 -289
  323. package/src/pages/NewDynamicStatistics/SearchBar.vue +193 -193
  324. package/src/pages/NewDynamicStatistics/index.vue +258 -258
  325. package/src/pages/Recording/index.vue +77 -77
  326. package/src/pages/ReportGrid/index.vue +76 -76
  327. package/src/pages/ServiceReview/index.vue +284 -284
  328. package/src/pages/SubExample/index.vue +26 -26
  329. package/src/pages/WorkflowDetail/WorkFlowDemo.vue +32 -32
  330. package/src/pages/WorkflowDetail/WorkflowDetail.vue +230 -230
  331. package/src/pages/WorkflowDetail/WorkflowPageDetail/LeaveMessage.vue +131 -131
  332. package/src/pages/WorkflowDetail/WorkflowPageDetail/TrimTextTail.vue +23 -23
  333. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformation.vue +302 -302
  334. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformationDetails.vue +276 -276
  335. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +864 -864
  336. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandleReso.vue +997 -997
  337. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +222 -222
  338. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkOrderParentDetails.vue +233 -233
  339. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowDetailResso.vue +261 -261
  340. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowListResolution.vue +248 -248
  341. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowLog.vue +73 -73
  342. package/src/pages/XPageViewExample/index.vue +38 -38
  343. package/src/pages/XReportView/index.vue +64 -64
  344. package/src/pages/XTreeOneProExample/index.vue +67 -67
  345. package/src/pages/dashboard/workplace/WorkPlace.vue +141 -141
  346. package/src/pages/login/Login.vue +378 -378
  347. package/src/pages/login/LoginV3.vue +389 -389
  348. package/src/pages/lowCode/lowCodeEditor.vue +1219 -1219
  349. package/src/pages/lowCode/lowCodeRenderPage.vue +43 -43
  350. package/src/pages/report/ReportTable.js +124 -124
  351. package/src/pages/resourceManage/orgListManage.vue +98 -98
  352. package/src/pages/system/dictionary/index.vue +44 -44
  353. package/src/pages/system/monitor/loginInfor/index.vue +37 -37
  354. package/src/pages/system/monitor/operLog/index.vue +37 -37
  355. package/src/pages/system/settings/modifyPassword.vue +117 -117
  356. package/src/pages/system/ticket/index.vue +480 -480
  357. package/src/pages/system/ticket/submitTicketSuccess.vue +484 -484
  358. package/src/pages/userInfoDetailManage/ChangeMeterRecordQuery/index.vue +64 -64
  359. package/src/pages/userInfoDetailManage/FillCardRecordQuery/index.vue +76 -76
  360. package/src/pages/userInfoDetailManage/FillGasRecordQuery/index.vue +74 -74
  361. package/src/pages/userInfoDetailManage/InfoChangeRecordQuery/index.vue +64 -64
  362. package/src/pages/userInfoDetailManage/InstructRecordQuery/index.vue +64 -64
  363. package/src/pages/userInfoDetailManage/MachineRecordQuery/index.vue +74 -74
  364. package/src/pages/userInfoDetailManage/MeterParamRecordQuery/index.vue +64 -64
  365. package/src/pages/userInfoDetailManage/OtherChargeRecordQuery/index.vue +74 -74
  366. package/src/pages/userInfoDetailManage/TransferRecordQuery/index.vue +66 -66
  367. package/src/pages/userInfoDetailManage/UserChargeRecordQuery/index.vue +92 -92
  368. package/src/pages/userInfoDetailManage/UserHandRecordQuery/index.vue +86 -86
  369. package/src/pages/userInfoDetailManage/UserRecordQuery/index.vue +73 -73
  370. package/src/pages/userInfoDetailManage/WatchCollectionRecordQuery/index.vue +64 -64
  371. package/src/pages/userInfoDetailManage/index.vue +82 -82
  372. package/src/pages/userInfoDetailManage/userInfoDetailQueryTabs.vue +132 -132
  373. package/src/plugins/EventLogPlugin.js +33 -33
  374. package/src/plugins/FindParentsData.js +17 -17
  375. package/src/plugins/HiPrintPlugin.js +124 -124
  376. package/src/router/async/config.async.js +35 -35
  377. package/src/router/async/router.map.js +188 -188
  378. package/src/router/guards.js +263 -263
  379. package/src/router/index.js +27 -27
  380. package/src/router.js +19 -19
  381. package/src/services/DataModel.js +30 -30
  382. package/src/services/LodopFuncs.js +137 -137
  383. package/src/services/api/TicketDetailsViewApi.js +46 -46
  384. package/src/services/api/cas.js +79 -79
  385. package/src/services/api/common.js +346 -346
  386. package/src/services/api/entity.js +18 -18
  387. package/src/services/api/index.js +17 -17
  388. package/src/services/api/restTools.js +145 -145
  389. package/src/services/apiService.js +15 -15
  390. package/src/services/user.js +90 -90
  391. package/src/services/v3Api.js +116 -116
  392. package/src/store/modules/account.js +115 -115
  393. package/src/store/modules/index.js +5 -5
  394. package/src/store/modules/lowCode.js +33 -33
  395. package/src/store/modules/setting.js +119 -119
  396. package/src/theme/default/style.less +58 -58
  397. package/src/theme/global.less +159 -159
  398. package/src/utils/authority-utils.js +85 -85
  399. package/src/utils/errorCode.js +6 -6
  400. package/src/utils/formatter.js +74 -74
  401. package/src/utils/htmlToPDF.js +108 -108
  402. package/src/utils/htmlToPDFApi.js +5 -5
  403. package/src/utils/indexedDB.js +263 -263
  404. package/src/utils/login.js +188 -188
  405. package/src/utils/lowcode/lowcodeComponentMixin.js +120 -120
  406. package/src/utils/lowcode/lowcodeLog.js +29 -29
  407. package/src/utils/lowcode/lowcodeUtils.js +373 -373
  408. package/src/utils/lowcode/registerComponentForEditor.js +1 -1
  409. package/src/utils/lowcode/registerComponentForRender.js +11 -11
  410. package/src/utils/map-utils.js +47 -47
  411. package/src/utils/microAppUtils.js +40 -40
  412. package/src/utils/reg.js +95 -95
  413. package/src/utils/request.js +362 -362
  414. package/src/utils/routerUtil.js +450 -450
  415. package/src/utils/runEvalFunction.js +14 -14
  416. package/src/utils/util.js +310 -310
  417. package/src/utils/waterMark.js +31 -31
  418. package/test/Amis.spec.js +163 -163
  419. package/test/Tree.spec.js +167 -167
  420. package/test/myDialog.spec.js +46 -46
  421. package/test/util.test.js +52 -52
  422. package/test/v3Api.test.js +1983 -1983
  423. package/vue.config.js +213 -213
  424. package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
@@ -1,1263 +1,1286 @@
1
- <template>
2
- <!-- 输入框 -->
3
- <x-form-col
4
- v-if="attr.type === 'input' && show"
5
- :occupyCol="attr.occupyCol"
6
- :flex="attr.flex">
7
- <a-form-model-item
8
- :ref="attr.model"
9
- :label="showLabel?attr.name:undefined"
10
- :prop="attr.prop ? attr.prop : attr.model">
11
- <!-- 如果配置了后置按钮插槽 -->
12
- <a-input-group
13
- v-if="((attr.inputOnAfterName && attr.inputOnAfterFunc) || (attr.inputOnAfterIcon && attr.inputOnAfterIconFunc)) && mode !== '查询'"
14
- style="display: flex; width: 100%; padding: 4px 0"
15
- compact>
16
- <a-input
17
- v-model="form[attr.model]"
18
- :read-only="readOnly"
19
- :disabled="disabled && !readOnly"
20
- :whitespace="true"
21
- @input="attr.dataChangeFunc && debouncedDataChangeFunc()"
22
- :suffix="attr.inputSuffix && mode !== '新增' ? attr.inputSuffix : ''"
23
- @blur="mode !== '查询' && attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
24
- @keyup.enter="mode !== '查询' && attr.inputOnEnterFunc && emitFunc(attr.inputOnEnterFunc, attr)"
25
- :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
26
- :ref="`${attr.model}input`"/>
27
- <a-button
28
- v-if="attr.inputOnAfterName && attr.inputOnAfterFunc && !attr.inputOnAfterName.includes('|')"
29
- style="width: auto; min-width: 4rem;max-width: 6rem"
30
- type="primary"
31
- @click="emitFunc(attr.inputOnAfterFunc,attr)">
32
- {{ attr.inputOnAfterName }}
33
- </a-button>
34
- <!-- 仅可以配置 一个按钮 以及 一个图标插槽 -->
35
- <a-button
36
- style="width: 2rem; flex-shrink: 0;"
37
- v-else-if="attr.inputOnAfterIcon"
38
- :type="attr.inputOnAfterIcon && attr.inputOnAfterName ? 'primary' :''"
39
- :icon="attr.inputOnAfterIcon || 'question'"
40
- @click="emitFunc(attr.inputOnAfterIconFunc,attr)">
41
- </a-button>
42
- <!-- 状态按钮 -->
43
- <x-status-button
44
- v-else
45
- :states="parseStates(attr.inputOnAfterName, attr.inputOnAfterFunc)"
46
- v-on="generateDynamicEvents(attr.inputOnAfterFunc, attr)"
47
- style="width: auto; min-width: 4rem; max-width: 6rem"
48
- />
49
- </a-input-group>
50
- <a-input-number
51
- v-else-if="attr.numberInput && !readOnly"
52
- v-model="form[attr.model]"
53
- :whitespace="true"
54
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
55
- :disabled="disabled && !readOnly"
56
- style="width:100%"
57
- @blur="mode !== '查询' && attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
58
- @keyup.enter="mode !== '查询' && attr.inputOnEnterFunc && emitFunc(attr.inputOnEnterFunc, attr)"
59
- :suffix="attr.inputSuffix && mode !== '新增' ? attr.inputSuffix : ''"
60
- :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
61
- :ref="`${attr.model}input`"/>
62
- <a-input
63
- v-else
64
- v-model="form[attr.model]"
65
- :whitespace="true"
66
- :read-only="readOnly"
67
- :disabled="disabled && !readOnly"
68
- @input="attr.dataChangeFunc && debouncedDataChangeFunc()"
69
- :suffix="attr.inputSuffix && mode !== '新增' ? attr.inputSuffix : ''"
70
- style="width:100%"
71
- @blur="mode !== '查询' && attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
72
- @keyup.enter="mode !== '查询' && attr.inputOnEnterFunc && emitFunc(attr.inputOnEnterFunc, attr)"
73
- :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
74
- :ref="`${attr.model}input`"/>
75
- </a-form-model-item>
76
- </x-form-col>
77
- <!-- 下拉框 -->
78
- <x-form-col
79
- v-else-if="(attr.type === 'select' || (attr.type === 'rate' && mode==='查询')) && show"
80
- :flex="attr.flex">
81
- <a-form-model-item
82
- v-if="!attr.showMode || mode === '查询' || attr.showMode === 'select' "
83
- :ref="attr.model"
84
- :label="showLabel?attr.name:undefined"
85
- :prop="attr.prop ? attr.prop : attr.model">
86
- <!-- <span slot="label" class="label-box">{{ showLabel?attr.name:undefined }}</span>-->
87
- <a-select
88
- v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
89
- v-model="form[attr.model]"
90
- :disabled="disabled"
91
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
92
- :filter-option="filterOption"
93
- :getPopupContainer="getPopupContainer"
94
- dropdownClassName="custom-dropdown"
95
- :dropdownMatchSelectWidth="false"
96
- :dropdownStyle="{ position: 'absolute'}"
97
- :placeholder="attr.placeholder ? attr.placeholder : '请选择'"
98
- show-search
99
- >
100
- <a-select-option
101
- v-if="mode === '查询'"
102
- key="999999"
103
- value="">全部
104
- </a-select-option>
105
- <template v-if="attr.keys">
106
- <a-select-option
107
- v-for="(item,index) in attr.keys"
108
- :key="index.value"
109
- :value="item.value + ''">
110
- {{ item.label }}
111
- </a-select-option>
112
- </template>
113
- <template v-else>
114
- <template
115
- v-if="attr.keyName.indexOf('logic@') !== -1 || attr.keyName.indexOf('config@') !== -1
116
- ||attr.keyName.indexOf('search@') !== -1 || attr.keyName.indexOf('search@') !== -1">
117
- <a-select-option
118
- v-for="(item,index) in option"
119
- :key="index.value"
120
- :value="item.value + ''">
121
- <template v-if="attr.keyName.indexOf('config@') !== -1 && item.status">
122
- <!-- 徽标(badge) -->
123
- <a-badge v-if="item.status !== 'gary'" :color="item.status" :text="item.label"/>
124
- <a-badge v-else color="#D9D9D9" :text="item.label"/>
125
- </template>
126
- <template v-else>
127
- {{ item.label }}
128
- </template>
129
- </a-select-option>
130
- </template>
131
- <template
132
- v-else-if="attr.keyName.indexOf('async ') !== -1 || attr.keyName.indexOf('function ') !== -1">
133
- <a-select-option
134
- v-for="(item,index) in optionForFunc"
135
- :key="index.value"
136
- :value="item.value + ''">
137
- <template>
138
- {{ item.label }}
139
- </template>
140
- </a-select-option>
141
- </template>
142
- <template v-else>
143
- <a-select-option
144
- v-for="item in $appdata.getDictionaryList(attr.keyName)"
145
- :key="item.value"
146
- :value="item.value + ''">
147
- <!-- 徽标(badge) -->
148
- <x-badge
149
- :badge-key="attr.keyName"
150
- :replaceText="item.text"
151
- :value="item.value"
152
- :service-name="serviceName"
153
- :env="env"/>
154
- </a-select-option>
155
- </template>
156
- </template>
157
- </a-select>
158
- <a-select
159
- v-else
160
- v-model="form[attr.model]"
161
- :disabled="disabled"
162
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
163
- :filter-option="filterOption"
164
- :getPopupContainer="getPopupContainer"
165
- dropdownClassName="custom-dropdown"
166
- :dropdownMatchSelectWidth="false"
167
- :dropdownStyle="{ position: 'absolute'}"
168
- :placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
169
- show-search
170
- @search="fetchFunction"
171
- >
172
- <template #notFoundContent>
173
- <a-spin v-if="searching" size="small"/>
174
- </template>
175
- <a-select-option
176
- v-if="mode === '查询'"
177
- key="999999"
178
- value="">全部
179
- </a-select-option>
180
- <a-select-option
181
- v-for="(item,index) in option"
182
- :key="index"
183
- :value="item.value + ''">{{ item.label }}
184
- </a-select-option>
185
- </a-select>
186
- </a-form-model-item>
187
- <a-form-model-item
188
- v-else-if="attr.showMode === 'radioGroup'"
189
- :ref="attr.model"
190
- :label="showLabel?attr.name:undefined"
191
- :prop="attr.prop ? attr.prop : attr.model">
192
- <a-radio-group v-model="form[attr.model]">
193
- <a-radio-button v-for="modeItem in option" :key="modeItem.value" :value="modeItem.value">
194
- {{ modeItem.label }}
195
- </a-radio-button>
196
- </a-radio-group>
197
- </a-form-model-item>
198
- <a-form-model-item
199
- v-else-if="attr.showMode === 'clickChange' && option.length > 0"
200
- :ref="attr.model"
201
- :label="showLabel?attr.name:undefined"
202
- :prop="attr.prop ? attr.prop : attr.model">
203
- <XClickChangeBtn></XClickChangeBtn>
204
- </a-form-model-item>
205
- </x-form-col>
206
- <!-- 多选框 -->
207
- <x-form-col
208
- v-else-if="attr.type === 'checkbox' && show"
209
- :flex="attr.flex">
210
- <a-form-model-item
211
- v-if="!attr.showMode || mode === '查询' || attr.showMode === 'select' "
212
- :ref="attr.model"
213
- :label="showLabel?attr.name:undefined"
214
- :prop="attr.prop ? attr.prop : attr.model">
215
- <a-select
216
- style="width:100%"
217
- v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
218
- v-model="form[attr.model]"
219
- :disabled="disabled"
220
- :filter-option="filterOption"
221
- :getPopupContainer="getPopupContainer"
222
- :placeholder="attr.placeholder ? attr.placeholder : '请选择'"
223
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
224
- mode="multiple"
225
- show-search
226
- allowClear
227
- >
228
- <template v-if="attr.keys">
229
- <a-select-option
230
- v-for="(item,index) in attr.keys"
231
- :key="index"
232
- :value="item.value + ''">
233
- {{ item.label }}
234
- </a-select-option>
235
- </template>
236
- <template v-else>
237
- <template
238
- v-if="attr.keyName.indexOf('logic@') !== -1 || attr.keyName.indexOf('config@') !== -1
239
- ||attr.keyName.indexOf('search@') !== -1 || attr.keyName.indexOf('search@') !== -1">
240
- <a-select-option
241
- v-for="(item,index) in option"
242
- :key="index"
243
- :value="item.value">{{ item.label }}
244
- </a-select-option>
245
- </template>
246
- <template v-else>
247
- <a-select-option
248
- v-for="item in $appdata.getDictionaryList(attr.keyName)"
249
- :key="item.value"
250
- :value="item.value + ''">{{ item.text }}
251
- </a-select-option>
252
- </template>
253
- </template>
254
- </a-select>
255
- <a-select
256
- v-else
257
- v-model="form[attr.model]"
258
- :disabled="disabled"
259
- :filter-option="filterOption"
260
- :getPopupContainer="getPopupContainer"
261
- :placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
262
- mode="multiple"
263
- style="width:100%"
264
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
265
- show-search
266
- allowClear
267
- @search="fetchFunction"
268
- >
269
- <template #notFoundContent>
270
- <a-spin v-if="searching" size="small"/>
271
- </template>
272
- <a-select-option
273
- v-for="(item,index) in option"
274
- :key="index"
275
- :value="item.value + ''">{{ item.label }}
276
- </a-select-option>
277
- </a-select>
278
- </a-form-model-item>
279
- <a-form-model-item
280
- v-else
281
- :ref="attr.model"
282
- :label="showLabel?attr.name:undefined"
283
- :prop="attr.prop ? attr.prop : attr.model">
284
- <a-checkbox-group
285
- v-model="form[attr.model]"
286
- :options="option"
287
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
288
- />
289
- </a-form-model-item>
290
- </x-form-col>
291
- <!-- 单选框 -->
292
- <x-form-col
293
- v-else-if="attr.type === 'radio' && show"
294
- :flex="attr.flex">
295
- <a-form-model-item
296
- v-if="!attr.showMode || attr.type === 'radio' "
297
- :ref="attr.model"
298
- :label="showLabel?attr.name:undefined"
299
- :prop="attr.prop ? attr.prop : attr.model">
300
- <a-radio-group
301
- v-model="form[attr.model]"
302
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
303
- >
304
- <template v-if="attr.keys">
305
- <a-radio v-for="(item,index) in attr.keys" :key="index" :value="item.value">
306
- {{ item.label }}
307
- </a-radio>
308
- </template>
309
- <template v-else>
310
- <template
311
- v-if="attr.keyName.indexOf('logic@') !== -1 || attr.keyName.indexOf('config@') !== -1
312
- ||attr.keyName.indexOf('search@') !== -1 || attr.keyName.indexOf('search@') !== -1">
313
- <a-radio v-for="(item,index) in option" :key="index" :value="item.value">
314
- {{ item.label }}
315
- </a-radio>
316
- </template>
317
- <template v-else>
318
- <a-radio v-for="(item,index) in $appdata.getDictionaryList(attr.keyName)" :key="index" :value="item.value">
319
- {{ item.text }}
320
- </a-radio>
321
- </template>
322
- </template>
323
- </a-radio-group>
324
- </a-form-model-item>
325
- <a-form-model-item
326
- v-else-if="attr.showMode === 'radioGroup'"
327
- :ref="attr.model"
328
- :label="showLabel?attr.name:undefined"
329
- :prop="attr.prop ? attr.prop : attr.model">
330
- <a-radio-group v-model="form[attr.model]">
331
- <a-radio-button v-for="modeItem in option" :key="modeItem.value" :value="modeItem.value">
332
- {{ modeItem.label }}
333
- </a-radio-button>
334
- </a-radio-group>
335
- </a-form-model-item>
336
- <a-form-model-item
337
- v-else-if="attr.showMode === 'clickChange' && option.length > 0"
338
- :ref="attr.model"
339
- :label="showLabel?attr.name:undefined"
340
- :prop="attr.prop ? attr.prop : attr.model">
341
- <XClickChangeBtn></XClickChangeBtn>
342
- </a-form-model-item>
343
- </x-form-col>
344
- <!-- 时间 日期 框整合 -->
345
- <x-form-col
346
- v-else-if="['datePicker', 'rangePicker', 'yearPicker', 'monthPicker', 'yearRangePicker', 'monthRangePicker'].includes(attr.type) && show"
347
- :flex="attr.flex">
348
- <a-form-model-item
349
- :ref="attr.model"
350
- :label="showLabel?attr.name:undefined"
351
- :prop="attr.prop ? attr.prop : attr.model">
352
- <XFormDatePicker
353
- :attr="attr"
354
- :mode="mode"
355
- :disabled="disabled"
356
- :readOnly="readOnly"
357
- :showLabel="showLabel"
358
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
359
- v-model="form[attr.model]"/>
360
- </a-form-model-item>
361
- </x-form-col>
362
- <!-- 文本域 -->
363
- <x-form-col v-else-if="attr.type === 'textarea' && show" :flex="attr.flex">
364
- <!-- :style="layout === 'inline'?{width:'calc(100% - 60px)'}:{}"-->
365
- <a-form-model-item
366
- :ref="attr.model"
367
- :label="showLabel?attr.name:undefined"
368
- :prop="attr.prop ? attr.prop : attr.model">
369
- <a-textarea
370
- v-model="form[attr.model]"
371
- style="width: 100%;"
372
- :disabled="disabled"
373
- :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
374
- :rows="4"/>
375
- </a-form-model-item>
376
- </x-form-col>
377
- <!-- 文件上传 -->
378
- <x-form-col
379
- v-else-if="(attr.type === 'file' || attr.type === 'image') && show"
380
- :flex="attr.flex">
381
- <a-form-model-item
382
- :ref="attr.model"
383
- :label="showLabel?attr.name:undefined"
384
- :prop="attr.prop ? attr.prop : attr.model">
385
- <upload
386
- :files="files"
387
- :images="images"
388
- :model="attr"
389
- :uploadStyle="attr.uploadStyle"
390
- :service-name="serviceName"
391
- @setFiles="setFiles"></upload>
392
- </a-form-model-item>
393
- </x-form-col>
394
- <!-- 省市区选择框 -->
395
- <x-form-col
396
- v-else-if="attr.type === 'citySelect' && show"
397
- :flex="attr.flex">
398
- <a-form-model-item
399
- :ref="attr.model"
400
- :label="showLabel?attr.name:undefined"
401
- :prop="attr.prop ? attr.prop : attr.model">
402
- <citySelect
403
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
404
- ref="citySelect"
405
- v-model="form[attr.model]"
406
- :contexts="attr.contexts"
407
- :value-type="attr.valueType"
408
- :default-value="form[attr.model]"></citySelect>
409
- </a-form-model-item>
410
- </x-form-col>
411
- <!-- 地点搜索框 -->
412
- <x-form-col
413
- v-else-if="attr.type === 'addressSearch' && show"
414
- :occupyCol="attr.occupyCol"
415
- :flex="attr.flex">
416
- <a-form-model-item
417
- :ref="attr.model"
418
- :label="showLabel?attr.name:undefined"
419
- :prop="attr.prop ? attr.prop : attr.model">
420
- <address-search-combobox
421
- :emitFunc="emitFunc"
422
- :attr="attr"
423
- :read-only="readOnly"
424
- v-model="searchResult"
425
- :resultKeys="{ address: attr.model, coords: `${attr.model}_lng_lat` }"
426
- ref="addressSearchCombobox"
427
- searchResultType="Object"
428
- @onSelect="addressSearchComboboxSelect"
429
- @onDivisionsChange="onDivisionsChange"
430
- ></address-search-combobox>
431
- </a-form-model-item>
432
- </x-form-col>
433
- <!-- 人员选择框 -->
434
- <x-form-col
435
- v-else-if="attr.type === 'personSetting' && show"
436
- :flex="attr.flex">
437
- <a-form-model-item
438
- :ref="attr.model"
439
- :label="showLabel?attr.name:undefined"
440
- :prop="attr.prop ? attr.prop : attr.model">
441
- <PersonSetting v-model="form[attr.model]"></PersonSetting>
442
- </a-form-model-item>
443
- </x-form-col>
444
- <!-- 树形选择框 -->
445
- <x-form-col
446
- v-else-if="attr.type === 'treeSelect' && show"
447
- :flex="attr.flex">
448
- <x-tree-select
449
- @onChange="attr.dataChangeFunc && debouncedDataChangeFunc()"
450
- v-model="form[attr.model]"
451
- :attr="attr"
452
- @mounted="itemMounted"
453
- ref="xTreeSelect">
454
- </x-tree-select>
455
- </x-form-col>
456
- <!-- 列表选择框 -->
457
- <x-form-col
458
- v-else-if="attr.type === 'listSelect' && show"
459
- :flex="attr.flex">
460
- <a-form-model-item
461
- :ref="attr.model"
462
- :label="showLabel?attr.name:undefined"
463
- :style="layout === 'inline'&& attr.occupyCol && attr.occupyCol > 1? {width:`calc(100% - ${attr.occupyCol * 1.533}rem)`}:{}"
464
- :prop="attr.prop ? attr.prop : attr.model">
465
- <a-popover
466
- ref="rowChoosePopover"
467
- :visible="rowChoosePopoverVisible"
468
- title="选择数据"
469
- placement="bottom"
470
- trigger="focus"
471
- :arrowPointAtCenter="true"
472
- :overlayStyle="{ width: '1000px', height: '30vh' }">
473
- <template #content>
474
- <x-report
475
- v-if="isCover"
476
- :use-oss-for-img="false"
477
- :config-name="queryParamsName"
478
- :service-name="serviceName"
479
- :show-img-in-cell="true"
480
- :display-only="true"
481
- :edit-mode="false"
482
- :show-save-button="true"
483
- :no-padding="true"
484
- :dont-format="true"
485
- @rowChoose="rowChoose"
486
- @cancel="closeRowChooseInput"
487
- >
488
- </x-report>
489
- <x-form-table
490
- v-else
491
- title="请选择数据"
492
- :queryParamsName="queryParamsName"
493
- :rowSelectMode="true"
494
- :allowSelectRowNum="1"
495
- :service-name="serviceName"
496
- :fixed-query-form="rowChooseFixedQueryValue"
497
- @rowChoose="rowChoose"
498
- @afterQuery="rowChooseSearchAfterQuery"
499
- ref="rowChooseTable">
500
- <template #button>
501
- <a-button @click="closeRowChooseInput">
502
- 关闭
503
- </a-button>
504
- </template>
505
- </x-form-table>
506
- </template>
507
- <a-input
508
- v-model="form[attr.model]"
509
- :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
510
- @change="searchRowChooseData"
511
- @focus="showCloseRowChooseInput"/>
512
- </a-popover>
513
- </a-form-model-item>
514
- </x-form-col>
515
- <!-- 评分框 -->
516
- <x-form-col
517
- v-else-if="attr.type === 'rate' && show"
518
- :flex="attr.flex">
519
- <a-form-model-item
520
- :ref="attr.model"
521
- :label="showLabel?attr.name:undefined"
522
- :prop="attr.prop ? attr.prop : attr.model">
523
- <a-rate
524
- v-model="form[attr.model]"
525
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
526
- />
527
- </a-form-model-item>
528
- </x-form-col>
529
- <!-- 区间选择器 -->
530
- <x-form-col
531
- v-else-if="attr.type === 'intervalPicker' && show"
532
- :flex="attr.flex">
533
- <a-form-model-item
534
- :ref="attr.model"
535
- :label="showLabel?attr.name:undefined"
536
- :prop="attr.prop ? attr.prop : attr.model">
537
- <a-input
538
- v-if="mode === '新增/修改'"
539
- v-model="form[attr.model]"
540
- :whitespace="true"
541
- :read-only="readOnly"
542
- :disabled="disabled && !readOnly"
543
- style="width:100%"
544
- @blur="attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
545
- :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
546
- :ref="`${attr.model}input`"/>
547
- <a-input-group v-else compact>
548
- <a-input
549
- v-model="form[attr.model][0]"
550
- class="intervalPicker-begin"
551
- placeholder="起始值"/>
552
- <a-input
553
- class="intervalPicker-center"
554
- style="backgroundColor: #fff"
555
- placeholder="~"
556
- disabled
557
- />
558
- <a-input
559
- v-model="form[attr.model][1]"
560
- class="intervalPicker-end"
561
- placeholder="结束值"/>
562
- </a-input-group>
563
- </a-form-model-item>
564
- </x-form-col>
565
- <!-- 车牌号选择 -->
566
- <x-form-col
567
- v-else-if="attr.type === 'licensePlate' && show"
568
- :flex="attr.flex">
569
- <a-form-model-item
570
- :ref="attr.model"
571
- :label="showLabel?attr.name:undefined"
572
- :style="layout === 'inline'&& attr.occupyCol && attr.occupyCol > 1? {width:`calc(100% - ${attr.occupyCol * 1.533}rem)`}:{}"
573
- :prop="attr.prop ? attr.prop : attr.model">
574
- <!-- 如果配置了后置按钮插槽 -->
575
- <a-input
576
- v-if="mode ==='查询'"
577
- v-model="form[attr.model]"
578
- :whitespace="true"
579
- :read-only="readOnly"
580
- :disabled="disabled && !readOnly"
581
- style="width:100%"
582
- @blur="attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
583
- :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
584
- :ref="`${attr.model}input`"/>
585
- <x-license-plate
586
- v-else
587
- v-model="form[attr.model]"
588
- @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
589
- ></x-license-plate>
590
- </a-form-model-item>
591
- </x-form-col>
592
- <!-- 录音 -->
593
- <x-form-col
594
- v-else-if="attr.type === 'recording' && show"
595
- :flex="attr.flex">
596
- <recording
597
- ref="recording"
598
- @recordingData="recordingData"
599
- >
600
- </recording>
601
- </x-form-col>
602
- <!-- 表格录入 -->
603
- <x-form-col
604
- v-else-if="attr.type === 'rowEdit' && show"
605
- :flex="attr.flex">
606
- <a-form-model-item
607
- :ref="attr.model"
608
- :label="showLabel?attr.name:undefined"
609
- :prop="attr.prop ? attr.prop : attr.model">
610
- <x-form-table
611
- :key="'childTable_' + attr.model"
612
- :title="attr.name"
613
- :queryParamsName="attr.crud"
614
- :localEditMode="true"
615
- :fixed-query-form="childTableFixedQueryForm(attr)"
616
- :service-name="serviceName"
617
- @hook:mounted="(h)=>onComponentMounted(h, attr)"
618
- :ref="'childXFormTable_' + attr.model">
619
- </x-form-table>
620
- </a-form-model-item>
621
- </x-form-col>
622
- </template>
623
- <script>
624
- import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
625
- import XFormCol from '@vue2-client/base-client/components/common/XFormCol'
626
- import XBadge from '@vue2-client/base-client/components/common/XBadge'
627
- import CitySelect from '@vue2-client/base-client/components/common/CitySelect'
628
- import PersonSetting from '@vue2-client/base-client/components/common/PersonSetting'
629
- import AddressSearchCombobox from '@vue2-client/base-client/components/common/AddressSearchCombobox'
630
- import Upload from '@vue2-client/base-client/components/common/Upload'
631
- import moment from 'moment'
632
- import { getConfigByName, runLogic, getConfigByNameAsync } from '@vue2-client/services/api/common'
633
- import * as util from '@vue2-client/utils/util'
634
- import XTreeSelect from '@vue2-client/base-client/components/common/XForm/XTreeSelect'
635
- import { searchToListOption, searchToOption } from '@vue2-client/services/v3Api'
636
- import { mapState } from 'vuex'
637
- import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
638
- import XLicensePlate from '@vue2-client/base-client/components/common/XLicensePlate/XLicensePlate.vue'
639
- import XStatusButton from './XStatusButton.vue'
640
- import XClickChangeBtn from './itemComponent/XClickChangeBtn'
641
- import 'moment/locale/zh-cn'
642
- import XFormDatePicker from '@vue2-client/base-client/components/common/XDatePicker/index.vue'
643
-
644
- export default {
645
- name: 'XFormItem',
646
- components: {
647
- XFormDatePicker,
648
- XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'),
649
- Recording: () => import('@vue2-client/base-client/components/common/Recording/Recording.vue'),
650
- XReport: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue'),
651
- XLicensePlate,
652
- XTreeSelect,
653
- XFormCol,
654
- XBadge,
655
- CitySelect,
656
- PersonSetting,
657
- AddressSearchCombobox,
658
- Upload,
659
- XStatusButton,
660
- XClickChangeBtn
661
- },
662
- data () {
663
- // 检索去抖
664
- this.fetchFunction = debounce(this.fetchFunction, 800)
665
- return {
666
- option: [],
667
- // 最后检索版本
668
- lastFetchId: 0,
669
- // 检索中
670
- searching: false,
671
- searchResult: '',
672
- optionForFunc: [],
673
- // 控制当前表单项是否展示
674
- show: true,
675
- // moment
676
- moment,
677
- // 行选择器浮层是否显示
678
- rowChoosePopoverVisible: false,
679
- // 行选择器CRUD固定查询值
680
- rowChooseFixedQueryValue: undefined
681
- }
682
- },
683
- props: {
684
- attr: {
685
- type: Object,
686
- default:
687
- () => {
688
- return {}
689
- }
690
- },
691
- form: {
692
- type: Object,
693
- required:
694
- true
695
- },
696
- disabled: {
697
- type: Boolean,
698
- default:
699
- () => {
700
- return false
701
- }
702
- },
703
- readOnly: {
704
- type: Boolean,
705
- default:
706
- () => {
707
- return false
708
- }
709
- },
710
- mode: {
711
- type: String,
712
- default:
713
- () => {
714
- return '查询'
715
- }
716
- },
717
- files: {
718
- type: Array,
719
- default:
720
- () => {
721
- return []
722
- }
723
- },
724
- images: {
725
- type: Array,
726
- default:
727
- () => {
728
- return []
729
- }
730
- },
731
- serviceName: {
732
- type: String,
733
- default:
734
- undefined
735
- },
736
- // 调用logic获取数据源的追加参数
737
- getDataParams: {
738
- type: Object,
739
- default:
740
- undefined
741
- },
742
- // 布局
743
- layout: {
744
- type: String,
745
- default:
746
- 'horizontal'
747
- },
748
- // 环境
749
- env: {
750
- type: String,
751
- default:
752
- () => {
753
- return 'prod'
754
- }
755
- },
756
- // 设置表单值
757
- setForm: {
758
- type: Function,
759
- default: (val) => {
760
- console.log(val)
761
- }
762
- },
763
- showLabel: {
764
- type: Boolean,
765
- default:
766
- () => {
767
- return true
768
- }
769
- }
770
- },
771
- provide () {
772
- return {
773
- FormItemContext: this
774
- }
775
- },
776
- created () {
777
- this.init()
778
- if (this.attr.keyName && (this.attr?.keyName?.toString().indexOf('async ') !== -1 || this.attr?.keyName?.toString()?.indexOf('function') !== -1)) {
779
- this.debouncedUpdateOptions = debounce(this.updateOptions, 200)
780
- }
781
- if (this.attr.dataChangeFunc) {
782
- this.debouncedDataChangeFunc = debounce(this.dataChangeFunc, 200)
783
- // 执行一次
784
- this.dataChangeFunc()
785
- }
786
- if (this.attr.showFormItemFunc) {
787
- this.debouncedShowFormItemFunc = debounce(this.showFormItemFunc, 100)
788
- // 执行一次
789
- this.showFormItemFunc()
790
- }
791
- if (this.attr.showQueryFormItemFunc) {
792
- this.debouncedShowQueryFormItemFunc = debounce(this.showQueryFormItemFunc, 100)
793
- // 执行一次
794
- this.showFormItemFunc()
795
- }
796
- // 人员联动框增加监听
797
- if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString().endsWith(']联动人员')) {
798
- this.debouncedUserLinkFunc = debounce(() => this.updateResOptions('人员'), 200)
799
- }
800
- if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString().endsWith(']联动部门')) {
801
- this.debouncedDepLinkFunc = debounce(() => this.updateResOptions('部门'), 200)
802
- }
803
- // xTreeSelect 自己调用 mounted
804
- if (this.attr.type !== 'treeSelect') {
805
- this.$emit('mounted')
806
- }
807
- },
808
- computed: {
809
- ...mapState('account', { currUser: 'user' }),
810
- queryParamsName () {
811
- if (this.attr.keyName.startsWith('function')) {
812
- // 调用异步函数获取内容
813
- return executeStrFunctionByContext(this, this.attr.keyName, [this.form, runLogic, this.mode, getConfigByNameAsync])
814
- } else {
815
- // 按现有方式处理
816
- return this.attr.keyName.split('@')[this.attr.keyName.split('@').length - 1]
817
- }
818
- },
819
- // 判断弹出时是否Cover,弹出只支持Cover以及CRUD
820
- isCover () {
821
- // 如果 queryParamsName 为空,返回空
822
- if (!this.queryParamsName) {
823
- return false
824
- }
825
- const result = this.queryParamsName.endsWith('Cover')
826
- return result
827
- },
828
- },
829
- watch: {
830
- attr: {
831
- handler () {
832
- this.init()
833
- },
834
- deep: true
835
- },
836
- form: {
837
- handler (newVal, oldVal) {
838
- // 如果是从函数获取 options
839
- if (this.attr.keyName && (this.attr.keyName.toString().indexOf('async ') !== -1 || this.attr.keyName.toString().indexOf('function') !== -1)) {
840
- this.debouncedUpdateOptions()
841
- }
842
- // 如果有自定义是否展示表单项函数
843
- if (this.attr.showFormItemFunc) {
844
- this.debouncedShowFormItemFunc()
845
- }
846
- // 如果有自定义是否展示查询表单项函数
847
- if (this.attr.showQueryFormItemFunc) {
848
- this.debouncedShowQueryFormItemFunc()
849
- }
850
- // 地址搜索框赋值
851
- if (this.attr.type === 'addressSearch') {
852
- this.$refs.addressSearchCombobox.addressInput = this.form[this.attr.model]
853
- }
854
- // 数据源来自人员联动时更新数据
855
- if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString().endsWith(']联动人员')) {
856
- this.debouncedUserLinkFunc()
857
- }
858
- // 数据源来自人员联动时更新数据
859
- if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString().endsWith(']联动部门')) {
860
- this.debouncedDepLinkFunc()
861
- }
862
- },
863
- deep: true
864
- }
865
- },
866
- inject: {
867
- getComponentByName: {
868
- default: () => () => {
869
- console.warn('getComponentByName is not provided')
870
- return null // 或者返回一个默认的函数
871
- },
872
- },
873
- registerComponent: {
874
- default: () => () => {
875
- console.warn('registerComponent is not provided')
876
- return null // 或者返回一个默认的函数
877
- },
878
- },
879
- getSelf: {
880
- default: () => () => {
881
- console.warn('getSelf is not provided')
882
- return null // 或者返回一个默认的函数
883
- },
884
- },
885
- },
886
- methods: {
887
- // 把内部的crud表单录入放到表单中,以便外部可以调用
888
- onComponentMounted (h, attr) {
889
- console.log('crud表单', h)
890
- if (attr.crud) {
891
- this.registerComponent(attr.model, this.$refs['childXFormTable_' + attr.model])
892
- }
893
- },
894
- childTableFixedQueryForm (item) {
895
- console.log('传递的form', this.form)
896
- if (this.modifyModelData?.primaryKeyData) {
897
- const fixedForm = {}
898
- fixedForm[item.childTableForeignKeyName] = Object.values(this.modifyModelData.primaryKeyData)[0]
899
- return fixedForm
900
- }
901
- return null
902
- },
903
- // 动态生成事件绑定对象
904
- generateDynamicEvents (inputOnAfterFunc, attr) {
905
- const events = {}
906
- const states = this.parseStates(attr.inputOnAfterName, inputOnAfterFunc)
907
-
908
- states.forEach((state) => {
909
- // 动态绑定事件名到 emitFunc
910
- events[state.event] = () => {
911
- console.info('事件名', state.event)
912
- this.emitFunc(state.event, attr)
913
- }
914
- })
915
-
916
- return events // 返回 { state1Event: handler, state2Event: handler, ... }
917
- },
918
- parseStates (input, events) {
919
- const eventNames = events.split('|')
920
- return input.split('|').map((label, index) => ({
921
- label,
922
- event: eventNames[index] // 如果没有提供事件名称,则使用默认值
923
- }))
924
- },
925
- focusInput () {
926
- if (this.attr.defaultFocus) {
927
- this.$nextTick(h => {
928
- const el = this.$refs[`${this.attr.model}input`]?.$el
929
- let inputEl
930
- if (el) {
931
- if (el.tagName.toLowerCase() === 'input') {
932
- inputEl = el
933
- } else {
934
- inputEl = el.querySelector('input')
935
- }
936
- }
937
- if (inputEl) {
938
- inputEl.focus()
939
- if (inputEl.type === 'number') {
940
- if (inputEl.valueAsNumber) {
941
- inputEl.setSelectionRange(0, inputEl.valueAsNumber.toString().length)
942
- }
943
- } else {
944
- if (inputEl.value) {
945
- inputEl.setSelectionRange(0, inputEl.value.length)
946
- }
947
- }
948
- }
949
- })
950
- }
951
- },
952
- // 更新人员下拉框数据
953
- async updateResOptions (type) {
954
- if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString()?.endsWith(`]联动${type}`)) {
955
- const searchData = { source: `获取${type}`, userid: this.currUser.id }
956
- const startIndex = this.attr.keyName.indexOf('[') + 1
957
- const endIndex = this.attr.keyName.indexOf(']', startIndex)
958
- const fromModel = this.attr.keyName.substring(startIndex, endIndex).replace('.', '_')
959
- const formModelData = this.form[fromModel]
960
- if (fromModel?.length && formModelData?.length) {
961
- await searchToListOption(searchData, res => {
962
- this.getDataCallback(
963
- res.filter(h => {
964
- if (fromModel.indexOf('org') > -1) {
965
- return formModelData?.includes(h.orgid || h.f_organization_id || h.parentid)
966
- } else {
967
- return formModelData?.includes(h?.parentid)
968
- }
969
- }
970
- )
971
- )
972
- })
973
- }
974
- }
975
- },
976
- // js 函数作为数据源
977
- async updateOptions () {
978
- if (this.attr.keyName && (this.attr.keyName.indexOf('async ') !== -1 || this.attr.keyName.indexOf('function ') !== -1)) {
979
- this.optionForFunc = await executeStrFunctionByContext(this, this.attr.keyName, [this.form, runLogic, this.mode, getConfigByNameAsync])
980
- }
981
- },
982
- async dataChangeFunc () {
983
- if (this.attr.dataChangeFunc) {
984
- await executeStrFunctionByContext(this, this.attr.dataChangeFunc, [this.form, this.setForm, this.attr, util, this.mode, runLogic, getConfigByNameAsync])
985
- }
986
- },
987
- async showFormItemFunc () {
988
- if (this.attr.showFormItemFunc) {
989
- const obj = executeStrFunctionByContext(this, this.attr.showFormItemFunc, [this.form, this.setForm, this.attr, util, this.mode])
990
- // 判断是 bool 还是 obj 兼容
991
- if (typeof obj === 'boolean') {
992
- this.show = obj
993
- } else if (obj && typeof obj === 'object') {
994
- // obj 是一个对象,并且不是数组
995
- this.show = obj?.show
996
- this.readOnly = obj?.readOnly
997
- }
998
- } else {
999
- this.show = true
1000
- }
1001
- },
1002
- async showQueryFormItemFunc () {
1003
- if (this.attr.showQueryFormItemFunc) {
1004
- const obj = executeStrFunctionByContext(this, this.attr.showQueryFormItemFunc, [this.form, this.setForm, this.attr, util, this.mode])
1005
- // 判断是 bool 还是 obj 兼容
1006
- if (typeof obj === 'boolean') {
1007
- this.show = obj
1008
- } else if (obj && typeof obj === 'object') {
1009
- // obj 是一个对象,并且不是数组
1010
- this.show = obj?.show
1011
- this.readOnly = obj?.readOnly
1012
- }
1013
- } else {
1014
- this.show = true
1015
- }
1016
- },
1017
- init () {
1018
- if (!this.attr.flex) {
1019
- if (this.mode === '新增/修改') {
1020
- if (['horizontal', 'vertical'].includes(this.layout) || ['textarea', 'file', 'image'].includes(this.attr.type)) {
1021
- // 新增修改表单 horizontal 模式下默认为一行
1022
- this.attr.flex = {
1023
- xs: 24,
1024
- sm: 24,
1025
- md: 24,
1026
- lg: 24,
1027
- xl: 24,
1028
- xxl: 24,
1029
- fullWidth: true
1030
- }
1031
- } else {
1032
- // 新增修改表单 vertical 模式下默认为1列
1033
- this.attr.flex = {
1034
- xs: 24,
1035
- sm: 12,
1036
- md: 8,
1037
- lg: 8,
1038
- xl: 6,
1039
- xxl: 6
1040
- }
1041
- }
1042
- } else {
1043
- this.attr.flex = {
1044
- xs: 24,
1045
- sm: 24,
1046
- md: 8,
1047
- lg: 6,
1048
- xl: 6,
1049
- xxl: 6
1050
- }
1051
- }
1052
- }
1053
- if (this.attr.keyName && typeof this.attr.keyName === 'string') {
1054
- if (this.attr.keyName.indexOf('logic@') !== -1) {
1055
- this.getData({}, res => this.getDataCallback(res))
1056
- } else if (this.attr.keyName.indexOf('search@') !== -1) {
1057
- // `tool.getFullTree(this.getRights().where(row.getType()==$organization$))`
1058
- // 判断是否根据角色查询
1059
- let source = this.attr.keyName.substring(7)
1060
- const userid = this.currUser.id
1061
- let roleName = 'roleName'
1062
- if (source.startsWith('根据角色[') && source.endsWith(']获取人员')) {
1063
- const startIndex = source.indexOf('[') + 1
1064
- const endIndex = source.indexOf(']', startIndex)
1065
- roleName = source.substring(startIndex, endIndex)
1066
- source = '根据角色获取人员'
1067
- }
1068
- const searchData = { source, userid, roleName }
1069
- // 判断是否根据某个表单项联动 仅返回列表结构并筛选
1070
- if (source.startsWith('根据表单项[') && source.endsWith(']联动人员')) {
1071
- this.updateResOptions('人员')
1072
- } else if (source.startsWith('根据表单项[') && source.endsWith(']联动部门')) {
1073
- this.updateResOptions('部门')
1074
- } else if (this.attr.type === 'select' || this.attr.type === 'checkbox') {
1075
- // 仅获取最内层数据
1076
- searchToListOption(searchData, res => this.getDataCallback(res))
1077
- } else {
1078
- // 其他资源通用逻辑
1079
- searchToOption(searchData, res => this.getDataCallback(res))
1080
- }
1081
- } else if (this.attr.keyName.indexOf('config@') !== -1) {
1082
- const configName = this.attr.keyName.substring(7)
1083
- getConfigByName(configName, this.serviceName, res => {
1084
- this.getDataCallback(res.value)
1085
- }, this.env === 'dev')
1086
- } else if (this.attr.keyName.indexOf('async ') !== -1 || this.attr.keyName.indexOf('function ') !== -1) {
1087
- this.updateOptions()
1088
- }
1089
- }
1090
- this.focusInput()
1091
- },
1092
- addressSearchComboboxSelect (data) {
1093
- this.form = Object.assign(this.form, JSON.parse(data))
1094
- },
1095
- onDivisionsChange (data) {
1096
- this.emitFunc('addressSearchComboboxSelect', {
1097
- key: this.attr.model,
1098
- value: data
1099
- })
1100
- },
1101
- getDataCallback (res) {
1102
- this.option = res
1103
- if (this.attr.type === 'treeSelect') {
1104
- this.$refs.xTreeSelect.init({
1105
- option: this.option,
1106
- form: this.form,
1107
- queryType: this.attr.queryType,
1108
- name: this.attr.name,
1109
- model: this.attr.model,
1110
- mode: this.mode,
1111
- disabled: this.disabled
1112
- })
1113
- } else if (this.attr.type === 'radio' || ['radioGroup', 'clickChange'].includes(this.attr.showMode)) {
1114
- this.initRadioValue()
1115
- }
1116
- },
1117
- initRadioValue () {
1118
- const model = this.attr.model
1119
- if (this.mode === '新增/修改' && (this.form[model] === undefined || this.form[model] === null) && !this.attr.prop) {
1120
- if (this.attr.keys && this.attr.keys.length > 1) {
1121
- this.form[model] = this.attr.keys[0].value
1122
- } else if (this.option.length > 1) {
1123
- this.form[model] = this.option[0].value
1124
- }
1125
- }
1126
- },
1127
- // 文件框时设置上传组件的值
1128
- setFiles (fileIds) {
1129
- if (!this.form[this.attr.model]) {
1130
- this.form[this.attr.model] = []
1131
- }
1132
- this.form[this.attr.model] = [...fileIds]
1133
- },
1134
- // 懒加载检索方法
1135
- fetchFunction (value) {
1136
- this.lastFetchId += 1
1137
- const fetchId = this.lastFetchId
1138
- this.option = []
1139
- this.searching = true
1140
- this.getData({
1141
- word: value
1142
- }, res => {
1143
- if (fetchId !== this.lastFetchId) {
1144
- return
1145
- }
1146
- this.option = res
1147
- this.searching = false
1148
- })
1149
- },
1150
- // 获取数据
1151
- getData (value, callbackFun) {
1152
- if (value !== '') {
1153
- const logicName = this.attr.keyName
1154
- const logic = logicName.substring(6)
1155
- // 调用logic前设置参数
1156
- if (this.getDataParams && this.getDataParams[this.attr.model]) {
1157
- Object.assign(value, this.getDataParams[this.attr.model])
1158
- }
1159
- runLogic(logic, Object.assign(value, {
1160
- orgId: this.currUser.orgid,
1161
- userId: this.currUser.id
1162
- }), this.serviceName, this.env === 'dev').then(res => {
1163
- callbackFun(res)
1164
- }).catch(e => {
1165
- callbackFun([])
1166
- console.error('获取数据失败:' + e)
1167
- })
1168
- }
1169
- },
1170
- filterOption (input, option) {
1171
- const child = option.componentOptions.children[0]
1172
- if (child.text) {
1173
- return child.text.toLowerCase().indexOf(input.toLowerCase()) >= 0
1174
- } else if (child.elm.innerText) {
1175
- return child.elm.innerText.toLowerCase().indexOf(input.toLowerCase()) >= 0
1176
- } else {
1177
- return child.child.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
1178
- }
1179
- },
1180
- // 表单项变更函数中调用 控制表单组中表单项组名为 groupName 的表单是否展示
1181
- // func:x-form-show(显示)/x-form-no-show(不显示)
1182
- emitShowFormFunc (func, groupName) {
1183
- this.emitFunc(func, groupName)
1184
- },
1185
- emitFunc (func, data) {
1186
- this.$emit('x-form-item-emit-func', func, data, data?.model ? this.form[data.model] : this.form)
1187
- },
1188
- itemMounted (h) {
1189
- this.$emit('mounted', h)
1190
- },
1191
- rowChoose (rows) {
1192
- this.$emit('rowChoose', rows, this.attr, this.closeRowChooseInput)
1193
- },
1194
- searchRowChooseData () {
1195
- if (this.searching) {
1196
- return
1197
- }
1198
- this.lastFetchId += 1
1199
- const fetchId = this.lastFetchId
1200
- this.searching = true
1201
- if (fetchId !== this.lastFetchId) {
1202
- return
1203
- }
1204
- this.rowChooseFixedQueryValue = []
1205
- this.rowChooseFixedQueryValue[this.attr.model] = this.form[this.attr.model]
1206
- this.$nextTick(() => {
1207
- this.$refs.rowChooseTable.refresh(true)
1208
- })
1209
- },
1210
- showCloseRowChooseInput () {
1211
- this.rowChoosePopoverVisible = true
1212
- },
1213
- closeRowChooseInput () {
1214
- this.rowChoosePopoverVisible = false
1215
- },
1216
- rowChooseSearchAfterQuery () {
1217
- this.searching = false
1218
- },
1219
- // 获取 recording 转换后的数据
1220
- getRecodingData () {
1221
- return this.$refs.recording.getRecordingData()
1222
- },
1223
- recordingData (data) {
1224
- this.emitFunc('recordingData', data)
1225
- },
1226
- getPopupContainer (triggerNode) {
1227
- return document.body
1228
- // return triggerNode.parentNode
1229
- }
1230
- }
1231
- }
1232
- </script>
1233
-
1234
- <style lang="less" scoped>
1235
- .custom-dropdown {
1236
- position: absolute;
1237
- z-index: 1050;
1238
- }
1239
-
1240
- .intervalPicker-begin {
1241
- width: calc(50% - 14px);
1242
- }
1243
-
1244
- .intervalPicker-center {
1245
- width: 30px;
1246
- border-left: 0;
1247
- pointer-events: none;
1248
- }
1249
-
1250
- .intervalPicker-end {
1251
- width: calc(50% - 14px);
1252
- border-left: 0;
1253
- }
1254
-
1255
- //.label-box{
1256
- // width: 80%;
1257
- // display: inline-block;
1258
- // height: auto;
1259
- // white-space: break-spaces;
1260
- // line-height: 18px;
1261
- // text-align: left;
1262
- //}
1263
- </style>
1
+ <template>
2
+ <!-- 输入框 -->
3
+ <x-form-col
4
+ v-if="attr.type === 'input' && show"
5
+ :occupyCol="attr.occupyCol"
6
+ :labelCol="labelCol"
7
+ :flex="attr.flex">
8
+ <a-form-model-item
9
+ :ref="attr.model"
10
+ :label="showLabel?attr.name:undefined"
11
+ :prop="attr.prop ? attr.prop : attr.model">
12
+ <!-- 如果配置了后置按钮插槽 -->
13
+ <a-input-group
14
+ v-if="((attr.inputOnAfterName && attr.inputOnAfterFunc) || (attr.inputOnAfterIcon && attr.inputOnAfterIconFunc)) && mode !== '查询'"
15
+ style="display: flex; width: 100%; padding: 4px 0"
16
+ compact>
17
+ <a-input
18
+ v-model="form[attr.model]"
19
+ :read-only="readOnly"
20
+ :disabled="disabled && !readOnly"
21
+ :whitespace="true"
22
+ @input="attr.dataChangeFunc && debouncedDataChangeFunc()"
23
+ :suffix="attr.inputSuffix && mode !== '新增' ? attr.inputSuffix : ''"
24
+ @blur="mode !== '查询' && attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
25
+ @keyup.enter="mode !== '查询' && attr.inputOnEnterFunc && emitFunc(attr.inputOnEnterFunc, attr)"
26
+ :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
27
+ :ref="`${attr.model}input`"/>
28
+ <a-button
29
+ v-if="attr.inputOnAfterName && attr.inputOnAfterFunc && !attr.inputOnAfterName.includes('|')"
30
+ style="width: auto; min-width: 4rem;max-width: 6rem"
31
+ type="primary"
32
+ @click="emitFunc(attr.inputOnAfterFunc,attr)">
33
+ {{ attr.inputOnAfterName }}
34
+ </a-button>
35
+ <!-- 仅可以配置 一个按钮 以及 一个图标插槽 -->
36
+ <a-button
37
+ style="width: 2rem; flex-shrink: 0;"
38
+ v-else-if="attr.inputOnAfterIcon"
39
+ :type="attr.inputOnAfterIcon && attr.inputOnAfterName ? 'primary' :''"
40
+ :icon="attr.inputOnAfterIcon || 'question'"
41
+ @click="emitFunc(attr.inputOnAfterIconFunc,attr)">
42
+ </a-button>
43
+ <!-- 状态按钮 -->
44
+ <x-status-button
45
+ v-else
46
+ :states="parseStates(attr.inputOnAfterName, attr.inputOnAfterFunc)"
47
+ v-on="generateDynamicEvents(attr.inputOnAfterFunc, attr)"
48
+ style="width: auto; min-width: 4rem; max-width: 6rem"
49
+ />
50
+ </a-input-group>
51
+ <a-input-number
52
+ v-else-if="attr.numberInput && !readOnly"
53
+ v-model="form[attr.model]"
54
+ :whitespace="true"
55
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
56
+ :disabled="disabled && !readOnly"
57
+ style="width:100%"
58
+ @blur="mode !== '查询' && attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
59
+ @keyup.enter="mode !== '查询' && attr.inputOnEnterFunc && emitFunc(attr.inputOnEnterFunc, attr)"
60
+ :suffix="attr.inputSuffix && mode !== '新增' ? attr.inputSuffix : ''"
61
+ :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
62
+ :ref="`${attr.model}input`"/>
63
+ <a-input
64
+ v-else
65
+ v-model="form[attr.model]"
66
+ :whitespace="true"
67
+ :read-only="readOnly"
68
+ :disabled="disabled && !readOnly"
69
+ @input="attr.dataChangeFunc && debouncedDataChangeFunc()"
70
+ :suffix="attr.inputSuffix && mode !== '新增' ? attr.inputSuffix : ''"
71
+ style="width:100%"
72
+ @blur="mode !== '查询' && attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
73
+ @keyup.enter="mode !== '查询' && attr.inputOnEnterFunc && emitFunc(attr.inputOnEnterFunc, attr)"
74
+ :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
75
+ :ref="`${attr.model}input`"/>
76
+ </a-form-model-item>
77
+ </x-form-col>
78
+ <!-- 下拉框 -->
79
+ <x-form-col
80
+ v-else-if="(attr.type === 'select' || (attr.type === 'rate' && mode==='查询')) && show"
81
+ :labelCol="labelCol"
82
+ :flex="attr.flex">
83
+ <a-form-model-item
84
+ v-if="!attr.showMode || mode === '查询' || attr.showMode === 'select' "
85
+ :ref="attr.model"
86
+ :label="showLabel?attr.name:undefined"
87
+ :prop="attr.prop ? attr.prop : attr.model">
88
+ <!-- <span slot="label" class="label-box">{{ showLabel?attr.name:undefined }}</span>-->
89
+ <a-select
90
+ v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
91
+ v-model="form[attr.model]"
92
+ :disabled="disabled"
93
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
94
+ :filter-option="filterOption"
95
+ :getPopupContainer="getPopupContainer"
96
+ dropdownClassName="custom-dropdown"
97
+ :dropdownMatchSelectWidth="false"
98
+ :dropdownStyle="{ position: 'absolute'}"
99
+ :placeholder="attr.placeholder ? attr.placeholder : '请选择'"
100
+ show-search
101
+ >
102
+ <a-select-option
103
+ v-if="mode === '查询'"
104
+ key="999999"
105
+ value="">全部
106
+ </a-select-option>
107
+ <template v-if="attr.keys">
108
+ <a-select-option
109
+ v-for="(item,index) in attr.keys"
110
+ :key="index.value"
111
+ :value="item.value + ''">
112
+ {{ item.label }}
113
+ </a-select-option>
114
+ </template>
115
+ <template v-else>
116
+ <template
117
+ v-if="attr.keyName.indexOf('logic@') !== -1 || attr.keyName.indexOf('config@') !== -1
118
+ ||attr.keyName.indexOf('search@') !== -1 || attr.keyName.indexOf('search@') !== -1">
119
+ <a-select-option
120
+ v-for="(item,index) in option"
121
+ :key="index.value"
122
+ :value="item.value + ''">
123
+ <template v-if="attr.keyName.indexOf('config@') !== -1 && item.status">
124
+ <!-- 徽标(badge) -->
125
+ <a-badge v-if="item.status !== 'gary'" :color="item.status" :text="item.label"/>
126
+ <a-badge v-else color="#D9D9D9" :text="item.label"/>
127
+ </template>
128
+ <template v-else>
129
+ {{ item.label }}
130
+ </template>
131
+ </a-select-option>
132
+ </template>
133
+ <template
134
+ v-else-if="attr.keyName.indexOf('async ') !== -1 || attr.keyName.indexOf('function ') !== -1">
135
+ <a-select-option
136
+ v-for="(item,index) in optionForFunc"
137
+ :key="index.value"
138
+ :value="item.value + ''">
139
+ <template>
140
+ {{ item.label }}
141
+ </template>
142
+ </a-select-option>
143
+ </template>
144
+ <template v-else>
145
+ <a-select-option
146
+ v-for="item in $appdata.getDictionaryList(attr.keyName)"
147
+ :key="item.value"
148
+ :value="item.value + ''">
149
+ <!-- 徽标(badge) -->
150
+ <x-badge
151
+ :badge-key="attr.keyName"
152
+ :replaceText="item.text"
153
+ :value="item.value"
154
+ :service-name="serviceName"
155
+ :env="env"/>
156
+ </a-select-option>
157
+ </template>
158
+ </template>
159
+ </a-select>
160
+ <a-select
161
+ v-else
162
+ v-model="form[attr.model]"
163
+ :disabled="disabled"
164
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
165
+ :filter-option="filterOption"
166
+ :getPopupContainer="getPopupContainer"
167
+ dropdownClassName="custom-dropdown"
168
+ :dropdownMatchSelectWidth="false"
169
+ :dropdownStyle="{ position: 'absolute'}"
170
+ :placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
171
+ show-search
172
+ @search="fetchFunction"
173
+ >
174
+ <template #notFoundContent>
175
+ <a-spin v-if="searching" size="small"/>
176
+ </template>
177
+ <a-select-option
178
+ v-if="mode === '查询'"
179
+ key="999999"
180
+ value="">全部
181
+ </a-select-option>
182
+ <a-select-option
183
+ v-for="(item,index) in option"
184
+ :key="index"
185
+ :value="item.value + ''">{{ item.label }}
186
+ </a-select-option>
187
+ </a-select>
188
+ </a-form-model-item>
189
+ <a-form-model-item
190
+ v-else-if="attr.showMode === 'radioGroup'"
191
+ :ref="attr.model"
192
+ :label="showLabel?attr.name:undefined"
193
+ :prop="attr.prop ? attr.prop : attr.model">
194
+ <a-radio-group v-model="form[attr.model]">
195
+ <a-radio-button v-for="modeItem in option" :key="modeItem.value" :value="modeItem.value">
196
+ {{ modeItem.label }}
197
+ </a-radio-button>
198
+ </a-radio-group>
199
+ </a-form-model-item>
200
+ <a-form-model-item
201
+ v-else-if="attr.showMode === 'clickChange' && option.length > 0"
202
+ :ref="attr.model"
203
+ :label="showLabel?attr.name:undefined"
204
+ :prop="attr.prop ? attr.prop : attr.model">
205
+ <XClickChangeBtn></XClickChangeBtn>
206
+ </a-form-model-item>
207
+ </x-form-col>
208
+ <!-- 多选框 -->
209
+ <x-form-col
210
+ v-else-if="attr.type === 'checkbox' && show"
211
+ :labelCol="labelCol"
212
+ :flex="attr.flex">
213
+ <a-form-model-item
214
+ v-if="!attr.showMode || mode === '查询' || attr.showMode === 'select' "
215
+ :ref="attr.model"
216
+ :label="showLabel?attr.name:undefined"
217
+ :prop="attr.prop ? attr.prop : attr.model">
218
+ <a-select
219
+ style="width:100%"
220
+ v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
221
+ v-model="form[attr.model]"
222
+ :disabled="disabled"
223
+ :filter-option="filterOption"
224
+ :getPopupContainer="getPopupContainer"
225
+ :placeholder="attr.placeholder ? attr.placeholder : '请选择'"
226
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
227
+ mode="multiple"
228
+ show-search
229
+ allowClear
230
+ >
231
+ <template v-if="attr.keys">
232
+ <a-select-option
233
+ v-for="(item,index) in attr.keys"
234
+ :key="index"
235
+ :value="item.value + ''">
236
+ {{ item.label }}
237
+ </a-select-option>
238
+ </template>
239
+ <template v-else>
240
+ <template
241
+ v-if="attr.keyName.indexOf('logic@') !== -1 || attr.keyName.indexOf('config@') !== -1
242
+ ||attr.keyName.indexOf('search@') !== -1 || attr.keyName.indexOf('search@') !== -1">
243
+ <a-select-option
244
+ v-for="(item,index) in option"
245
+ :key="index"
246
+ :value="item.value">{{ item.label }}
247
+ </a-select-option>
248
+ </template>
249
+ <template v-else>
250
+ <a-select-option
251
+ v-for="item in $appdata.getDictionaryList(attr.keyName)"
252
+ :key="item.value"
253
+ :value="item.value + ''">{{ item.text }}
254
+ </a-select-option>
255
+ </template>
256
+ </template>
257
+ </a-select>
258
+ <a-select
259
+ v-else
260
+ v-model="form[attr.model]"
261
+ :disabled="disabled"
262
+ :filter-option="filterOption"
263
+ :getPopupContainer="getPopupContainer"
264
+ :placeholder="attr.placeholder ? attr.placeholder : '搜索' + attr.name"
265
+ mode="multiple"
266
+ style="width:100%"
267
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
268
+ show-search
269
+ allowClear
270
+ @search="fetchFunction"
271
+ >
272
+ <template #notFoundContent>
273
+ <a-spin v-if="searching" size="small"/>
274
+ </template>
275
+ <a-select-option
276
+ v-for="(item,index) in option"
277
+ :key="index"
278
+ :value="item.value + ''">{{ item.label }}
279
+ </a-select-option>
280
+ </a-select>
281
+ </a-form-model-item>
282
+ <a-form-model-item
283
+ v-else
284
+ :ref="attr.model"
285
+ :label="showLabel?attr.name:undefined"
286
+ :prop="attr.prop ? attr.prop : attr.model">
287
+ <a-checkbox-group
288
+ v-model="form[attr.model]"
289
+ :options="option"
290
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
291
+ />
292
+ </a-form-model-item>
293
+ </x-form-col>
294
+ <!-- 单选框 -->
295
+ <x-form-col
296
+ v-else-if="attr.type === 'radio' && show"
297
+ :labelCol="labelCol"
298
+ :flex="attr.flex">
299
+ <a-form-model-item
300
+ v-if="!attr.showMode || attr.type === 'radio' "
301
+ :ref="attr.model"
302
+ :label="showLabel?attr.name:undefined"
303
+ :prop="attr.prop ? attr.prop : attr.model">
304
+ <a-radio-group
305
+ v-model="form[attr.model]"
306
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
307
+ >
308
+ <template v-if="attr.keys">
309
+ <a-radio v-for="(item,index) in attr.keys" :key="index" :value="item.value">
310
+ {{ item.label }}
311
+ </a-radio>
312
+ </template>
313
+ <template v-else>
314
+ <template
315
+ v-if="attr.keyName.indexOf('logic@') !== -1 || attr.keyName.indexOf('config@') !== -1
316
+ ||attr.keyName.indexOf('search@') !== -1 || attr.keyName.indexOf('search@') !== -1">
317
+ <a-radio v-for="(item,index) in option" :key="index" :value="item.value">
318
+ {{ item.label }}
319
+ </a-radio>
320
+ </template>
321
+ <template v-else>
322
+ <a-radio v-for="(item,index) in $appdata.getDictionaryList(attr.keyName)" :key="index" :value="item.value">
323
+ {{ item.text }}
324
+ </a-radio>
325
+ </template>
326
+ </template>
327
+ </a-radio-group>
328
+ </a-form-model-item>
329
+ <a-form-model-item
330
+ v-else-if="attr.showMode === 'radioGroup'"
331
+ :ref="attr.model"
332
+ :label="showLabel?attr.name:undefined"
333
+ :prop="attr.prop ? attr.prop : attr.model">
334
+ <a-radio-group v-model="form[attr.model]">
335
+ <a-radio-button v-for="modeItem in option" :key="modeItem.value" :value="modeItem.value">
336
+ {{ modeItem.label }}
337
+ </a-radio-button>
338
+ </a-radio-group>
339
+ </a-form-model-item>
340
+ <a-form-model-item
341
+ v-else-if="attr.showMode === 'clickChange' && option.length > 0"
342
+ :ref="attr.model"
343
+ :label="showLabel?attr.name:undefined"
344
+ :prop="attr.prop ? attr.prop : attr.model">
345
+ <XClickChangeBtn></XClickChangeBtn>
346
+ </a-form-model-item>
347
+ </x-form-col>
348
+ <!-- 时间 日期 框整合 -->
349
+ <x-form-col
350
+ v-else-if="['datePicker', 'rangePicker', 'yearPicker', 'monthPicker', 'yearRangePicker', 'monthRangePicker'].includes(attr.type) && show"
351
+ :labelCol="labelCol"
352
+ :flex="attr.flex">
353
+ <a-form-model-item
354
+ :ref="attr.model"
355
+ :label="showLabel?attr.name:undefined"
356
+ :prop="attr.prop ? attr.prop : attr.model">
357
+ <XFormDatePicker
358
+ :attr="attr"
359
+ :mode="mode"
360
+ :disabled="disabled"
361
+ :readOnly="readOnly"
362
+ :showLabel="showLabel"
363
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
364
+ v-model="form[attr.model]"/>
365
+ </a-form-model-item>
366
+ </x-form-col>
367
+ <!-- 文本域 -->
368
+ <x-form-col
369
+ v-else-if="attr.type === 'textarea' && show"
370
+ :labelCol="labelCol"
371
+ :flex="attr.flex">
372
+ <!-- :style="layout === 'inline'?{width:'calc(100% - 60px)'}:{}"-->
373
+ <a-form-model-item
374
+ :ref="attr.model"
375
+ :label="showLabel?attr.name:undefined"
376
+ :prop="attr.prop ? attr.prop : attr.model">
377
+ <a-textarea
378
+ v-model="form[attr.model]"
379
+ style="width: 100%;"
380
+ :disabled="disabled"
381
+ :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
382
+ :rows="4"/>
383
+ </a-form-model-item>
384
+ </x-form-col>
385
+ <!-- 文件上传 -->
386
+ <x-form-col
387
+ v-else-if="(attr.type === 'file' || attr.type === 'image') && show"
388
+ :labelCol="labelCol"
389
+ :flex="attr.flex">
390
+ <a-form-model-item
391
+ :ref="attr.model"
392
+ :label="showLabel?attr.name:undefined"
393
+ :prop="attr.prop ? attr.prop : attr.model">
394
+ <upload
395
+ :files="files"
396
+ :images="images"
397
+ :model="attr"
398
+ :uploadStyle="attr.uploadStyle"
399
+ :service-name="serviceName"
400
+ @setFiles="setFiles"></upload>
401
+ </a-form-model-item>
402
+ </x-form-col>
403
+ <!-- 省市区选择框 -->
404
+ <x-form-col
405
+ v-else-if="attr.type === 'citySelect' && show"
406
+ :labelCol="labelCol"
407
+ :flex="attr.flex">
408
+ <a-form-model-item
409
+ :ref="attr.model"
410
+ :label="showLabel?attr.name:undefined"
411
+ :prop="attr.prop ? attr.prop : attr.model">
412
+ <citySelect
413
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
414
+ ref="citySelect"
415
+ v-model="form[attr.model]"
416
+ :contexts="attr.contexts"
417
+ :value-type="attr.valueType"
418
+ :default-value="form[attr.model]"></citySelect>
419
+ </a-form-model-item>
420
+ </x-form-col>
421
+ <!-- 地点搜索框 -->
422
+ <x-form-col
423
+ v-else-if="attr.type === 'addressSearch' && show"
424
+ :labelCol="labelCol"
425
+ :occupyCol="attr.occupyCol"
426
+ :flex="attr.flex">
427
+ <a-form-model-item
428
+ :ref="attr.model"
429
+ :label="showLabel?attr.name:undefined"
430
+ :prop="attr.prop ? attr.prop : attr.model">
431
+ <address-search-combobox
432
+ :emitFunc="emitFunc"
433
+ :attr="attr"
434
+ :read-only="readOnly"
435
+ v-model="searchResult"
436
+ :resultKeys="{ address: attr.model, coords: `${attr.model}_lng_lat` }"
437
+ ref="addressSearchCombobox"
438
+ searchResultType="Object"
439
+ @onSelect="addressSearchComboboxSelect"
440
+ @onDivisionsChange="onDivisionsChange"
441
+ ></address-search-combobox>
442
+ </a-form-model-item>
443
+ </x-form-col>
444
+ <!-- 人员选择框 -->
445
+ <x-form-col
446
+ v-else-if="attr.type === 'personSetting' && show"
447
+ :labelCol="labelCol"
448
+ :flex="attr.flex">
449
+ <a-form-model-item
450
+ :ref="attr.model"
451
+ :label="showLabel?attr.name:undefined"
452
+ :prop="attr.prop ? attr.prop : attr.model">
453
+ <PersonSetting v-model="form[attr.model]"></PersonSetting>
454
+ </a-form-model-item>
455
+ </x-form-col>
456
+ <!-- 树形选择框 -->
457
+ <x-form-col
458
+ v-else-if="attr.type === 'treeSelect' && show"
459
+ :labelCol="labelCol"
460
+ :flex="attr.flex">
461
+ <x-tree-select
462
+ @onChange="attr.dataChangeFunc && debouncedDataChangeFunc()"
463
+ v-model="form[attr.model]"
464
+ :attr="attr"
465
+ @mounted="itemMounted"
466
+ ref="xTreeSelect">
467
+ </x-tree-select>
468
+ </x-form-col>
469
+ <!-- 列表选择框 -->
470
+ <x-form-col
471
+ v-else-if="attr.type === 'listSelect' && show"
472
+ :labelCol="labelCol"
473
+ :flex="attr.flex">
474
+ <a-form-model-item
475
+ :ref="attr.model"
476
+ :label="showLabel?attr.name:undefined"
477
+ :style="layout === 'inline'&& attr.occupyCol && attr.occupyCol > 1? {width:`calc(100% - ${attr.occupyCol * 1.533}rem)`}:{}"
478
+ :prop="attr.prop ? attr.prop : attr.model">
479
+ <a-popover
480
+ ref="rowChoosePopover"
481
+ :visible="rowChoosePopoverVisible"
482
+ title="选择数据"
483
+ placement="bottom"
484
+ trigger="focus"
485
+ :arrowPointAtCenter="true"
486
+ :overlayStyle="{ width: '1000px', height: '30vh' }">
487
+ <template #content>
488
+ <x-report
489
+ v-if="isCover"
490
+ :use-oss-for-img="false"
491
+ :config-name="queryParamsName"
492
+ :service-name="serviceName"
493
+ :show-img-in-cell="true"
494
+ :display-only="true"
495
+ :edit-mode="false"
496
+ :show-save-button="true"
497
+ :no-padding="true"
498
+ :dont-format="true"
499
+ @rowChoose="rowChoose"
500
+ @cancel="closeRowChooseInput"
501
+ >
502
+ </x-report>
503
+ <x-form-table
504
+ v-else
505
+ title="请选择数据"
506
+ :queryParamsName="queryParamsName"
507
+ :rowSelectMode="true"
508
+ :allowSelectRowNum="1"
509
+ :service-name="serviceName"
510
+ :fixed-query-form="rowChooseFixedQueryValue"
511
+ @rowChoose="rowChoose"
512
+ @afterQuery="rowChooseSearchAfterQuery"
513
+ ref="rowChooseTable">
514
+ <template #button>
515
+ <a-button @click="closeRowChooseInput">
516
+ 关闭
517
+ </a-button>
518
+ </template>
519
+ </x-form-table>
520
+ </template>
521
+ <a-input
522
+ v-model="form[attr.model]"
523
+ :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
524
+ @change="searchRowChooseData"
525
+ @focus="showCloseRowChooseInput"/>
526
+ </a-popover>
527
+ </a-form-model-item>
528
+ </x-form-col>
529
+ <!-- 评分框 -->
530
+ <x-form-col
531
+ v-else-if="attr.type === 'rate' && show"
532
+ :labelCol="labelCol"
533
+ :flex="attr.flex">
534
+ <a-form-model-item
535
+ :ref="attr.model"
536
+ :label="showLabel?attr.name:undefined"
537
+ :prop="attr.prop ? attr.prop : attr.model">
538
+ <a-rate
539
+ v-model="form[attr.model]"
540
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
541
+ />
542
+ </a-form-model-item>
543
+ </x-form-col>
544
+ <!-- 区间选择器 -->
545
+ <x-form-col
546
+ v-else-if="attr.type === 'intervalPicker' && show"
547
+ :labelCol="labelCol"
548
+ :flex="attr.flex">
549
+ <a-form-model-item
550
+ :ref="attr.model"
551
+ :label="showLabel?attr.name:undefined"
552
+ :prop="attr.prop ? attr.prop : attr.model">
553
+ <a-input
554
+ v-if="mode === '新增/修改'"
555
+ v-model="form[attr.model]"
556
+ :whitespace="true"
557
+ :read-only="readOnly"
558
+ :disabled="disabled && !readOnly"
559
+ style="width:100%"
560
+ @blur="attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
561
+ :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
562
+ :ref="`${attr.model}input`"/>
563
+ <a-input-group v-else compact>
564
+ <a-input
565
+ v-model="form[attr.model][0]"
566
+ class="intervalPicker-begin"
567
+ placeholder="起始值"/>
568
+ <a-input
569
+ class="intervalPicker-center"
570
+ style="backgroundColor: #fff"
571
+ placeholder="~"
572
+ disabled
573
+ />
574
+ <a-input
575
+ v-model="form[attr.model][1]"
576
+ class="intervalPicker-end"
577
+ placeholder="结束值"/>
578
+ </a-input-group>
579
+ </a-form-model-item>
580
+ </x-form-col>
581
+ <!-- 车牌号选择 -->
582
+ <x-form-col
583
+ v-else-if="attr.type === 'licensePlate' && show"
584
+ :labelCol="labelCol"
585
+ :flex="attr.flex">
586
+ <a-form-model-item
587
+ :ref="attr.model"
588
+ :label="showLabel?attr.name:undefined"
589
+ :style="layout === 'inline'&& attr.occupyCol && attr.occupyCol > 1? {width:`calc(100% - ${attr.occupyCol * 1.533}rem)`}:{}"
590
+ :prop="attr.prop ? attr.prop : attr.model">
591
+ <!-- 如果配置了后置按钮插槽 -->
592
+ <a-input
593
+ v-if="mode ==='查询'"
594
+ v-model="form[attr.model]"
595
+ :whitespace="true"
596
+ :read-only="readOnly"
597
+ :disabled="disabled && !readOnly"
598
+ style="width:100%"
599
+ @blur="attr.inputOnBlurFunc && emitFunc(attr.inputOnBlurFunc,attr)"
600
+ :placeholder="attr.placeholder ? attr.placeholder : '请输入'+attr.name.replace(/\s*/g, '')"
601
+ :ref="`${attr.model}input`"/>
602
+ <x-license-plate
603
+ v-else
604
+ v-model="form[attr.model]"
605
+ @change="attr.dataChangeFunc && debouncedDataChangeFunc()"
606
+ ></x-license-plate>
607
+ </a-form-model-item>
608
+ </x-form-col>
609
+ <!-- 录音 -->
610
+ <x-form-col
611
+ v-else-if="attr.type === 'recording' && show"
612
+ :labelCol="labelCol"
613
+ :flex="attr.flex">
614
+ <recording
615
+ ref="recording"
616
+ @recordingData="recordingData"
617
+ >
618
+ </recording>
619
+ </x-form-col>
620
+ <!-- 表格录入 -->
621
+ <x-form-col
622
+ v-else-if="attr.type === 'rowEdit' && show"
623
+ :labelCol="labelCol"
624
+ :flex="attr.flex">
625
+ <a-form-model-item
626
+ :ref="attr.model"
627
+ :label="showLabel?attr.name:undefined"
628
+ :prop="attr.prop ? attr.prop : attr.model">
629
+ <x-form-table
630
+ :key="'childTable_' + attr.model"
631
+ :title="attr.name"
632
+ :queryParamsName="attr.crud"
633
+ :localEditMode="true"
634
+ :fixed-query-form="childTableFixedQueryForm(attr)"
635
+ :service-name="serviceName"
636
+ @hook:mounted="(h)=>onComponentMounted(h, attr)"
637
+ :ref="'childXFormTable_' + attr.model">
638
+ </x-form-table>
639
+ </a-form-model-item>
640
+ </x-form-col>
641
+ </template>
642
+ <script>
643
+ import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
644
+ import XFormCol from '@vue2-client/base-client/components/common/XFormCol'
645
+ import XBadge from '@vue2-client/base-client/components/common/XBadge'
646
+ import CitySelect from '@vue2-client/base-client/components/common/CitySelect'
647
+ import PersonSetting from '@vue2-client/base-client/components/common/PersonSetting'
648
+ import AddressSearchCombobox from '@vue2-client/base-client/components/common/AddressSearchCombobox'
649
+ import Upload from '@vue2-client/base-client/components/common/Upload'
650
+ import moment from 'moment'
651
+ import { getConfigByName, runLogic, getConfigByNameAsync } from '@vue2-client/services/api/common'
652
+ import * as util from '@vue2-client/utils/util'
653
+ import XTreeSelect from '@vue2-client/base-client/components/common/XForm/XTreeSelect'
654
+ import { searchToListOption, searchToOption } from '@vue2-client/services/v3Api'
655
+ import { mapState } from 'vuex'
656
+ import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
657
+ import XLicensePlate from '@vue2-client/base-client/components/common/XLicensePlate/XLicensePlate.vue'
658
+ import XStatusButton from './XStatusButton.vue'
659
+ import XClickChangeBtn from './itemComponent/XClickChangeBtn'
660
+ import 'moment/locale/zh-cn'
661
+ import XFormDatePicker from '@vue2-client/base-client/components/common/XDatePicker/index.vue'
662
+
663
+ export default {
664
+ name: 'XFormItem',
665
+ components: {
666
+ XFormDatePicker,
667
+ XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'),
668
+ Recording: () => import('@vue2-client/base-client/components/common/Recording/Recording.vue'),
669
+ XReport: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue'),
670
+ XLicensePlate,
671
+ XTreeSelect,
672
+ XFormCol,
673
+ XBadge,
674
+ CitySelect,
675
+ PersonSetting,
676
+ AddressSearchCombobox,
677
+ Upload,
678
+ XStatusButton,
679
+ XClickChangeBtn
680
+ },
681
+ data () {
682
+ // 检索去抖
683
+ this.fetchFunction = debounce(this.fetchFunction, 800)
684
+ return {
685
+ option: [],
686
+ // 最后检索版本
687
+ lastFetchId: 0,
688
+ // 检索中
689
+ searching: false,
690
+ searchResult: '',
691
+ optionForFunc: [],
692
+ // 控制当前表单项是否展示
693
+ show: true,
694
+ // moment
695
+ moment,
696
+ // 行选择器浮层是否显示
697
+ rowChoosePopoverVisible: false,
698
+ // 行选择器CRUD固定查询值
699
+ rowChooseFixedQueryValue: undefined
700
+ }
701
+ },
702
+ props: {
703
+ attr: {
704
+ type: Object,
705
+ default:
706
+ () => {
707
+ return {}
708
+ }
709
+ },
710
+ form: {
711
+ type: Object,
712
+ required:
713
+ true
714
+ },
715
+ disabled: {
716
+ type: Boolean,
717
+ default:
718
+ () => {
719
+ return false
720
+ }
721
+ },
722
+ readOnly: {
723
+ type: Boolean,
724
+ default:
725
+ () => {
726
+ return false
727
+ }
728
+ },
729
+ mode: {
730
+ type: String,
731
+ default:
732
+ () => {
733
+ return '查询'
734
+ }
735
+ },
736
+ files: {
737
+ type: Array,
738
+ default:
739
+ () => {
740
+ return []
741
+ }
742
+ },
743
+ images: {
744
+ type: Array,
745
+ default:
746
+ () => {
747
+ return []
748
+ }
749
+ },
750
+ serviceName: {
751
+ type: String,
752
+ default:
753
+ undefined
754
+ },
755
+ // 调用logic获取数据源的追加参数
756
+ getDataParams: {
757
+ type: Object,
758
+ default:
759
+ undefined
760
+ },
761
+ // 布局
762
+ layout: {
763
+ type: String,
764
+ default:
765
+ 'horizontal'
766
+ },
767
+ // 环境
768
+ env: {
769
+ type: String,
770
+ default:
771
+ () => {
772
+ return 'prod'
773
+ }
774
+ },
775
+ // 设置表单值
776
+ setForm: {
777
+ type: Function,
778
+ default: (val) => {
779
+ console.log(val)
780
+ }
781
+ },
782
+ showLabel: {
783
+ type: Boolean,
784
+ default:
785
+ () => {
786
+ return true
787
+ }
788
+ },
789
+ labelCol: {
790
+ type: Object,
791
+ default: () => { return { span: 8 } }
792
+ }
793
+ },
794
+ provide () {
795
+ return {
796
+ FormItemContext: this
797
+ }
798
+ },
799
+ created () {
800
+ this.init()
801
+ if (this.attr.keyName && (this.attr?.keyName?.toString().indexOf('async ') !== -1 || this.attr?.keyName?.toString()?.indexOf('function') !== -1)) {
802
+ this.debouncedUpdateOptions = debounce(this.updateOptions, 200)
803
+ }
804
+ if (this.attr.dataChangeFunc) {
805
+ this.debouncedDataChangeFunc = debounce(this.dataChangeFunc, 200)
806
+ // 执行一次
807
+ this.dataChangeFunc()
808
+ }
809
+ if (this.attr.showFormItemFunc) {
810
+ this.debouncedShowFormItemFunc = debounce(this.showFormItemFunc, 100)
811
+ // 执行一次
812
+ this.showFormItemFunc()
813
+ }
814
+ if (this.attr.showQueryFormItemFunc) {
815
+ this.debouncedShowQueryFormItemFunc = debounce(this.showQueryFormItemFunc, 100)
816
+ // 执行一次
817
+ this.showFormItemFunc()
818
+ }
819
+ // 人员联动框增加监听
820
+ if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString().endsWith(']联动人员')) {
821
+ this.debouncedUserLinkFunc = debounce(() => this.updateResOptions('人员'), 200)
822
+ }
823
+ if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString().endsWith(']联动部门')) {
824
+ this.debouncedDepLinkFunc = debounce(() => this.updateResOptions('部门'), 200)
825
+ }
826
+ // xTreeSelect 自己调用 mounted
827
+ if (this.attr.type !== 'treeSelect') {
828
+ this.$emit('mounted')
829
+ }
830
+ },
831
+ computed: {
832
+ ...mapState('account', { currUser: 'user' }),
833
+ queryParamsName () {
834
+ if (this.attr.keyName.startsWith('function')) {
835
+ // 调用异步函数获取内容
836
+ return executeStrFunctionByContext(this, this.attr.keyName, [this.form, runLogic, this.mode, getConfigByNameAsync])
837
+ } else {
838
+ // 按现有方式处理
839
+ return this.attr.keyName.split('@')[this.attr.keyName.split('@').length - 1]
840
+ }
841
+ },
842
+ // 判断弹出时是否Cover,弹出只支持Cover以及CRUD
843
+ isCover () {
844
+ // 如果 queryParamsName 为空,返回空
845
+ if (!this.queryParamsName) {
846
+ return false
847
+ }
848
+ const result = this.queryParamsName.endsWith('Cover')
849
+ return result
850
+ },
851
+ },
852
+ watch: {
853
+ attr: {
854
+ handler () {
855
+ this.init()
856
+ },
857
+ deep: true
858
+ },
859
+ form: {
860
+ handler (newVal, oldVal) {
861
+ // 如果是从函数获取 options
862
+ if (this.attr.keyName && (this.attr.keyName.toString().indexOf('async ') !== -1 || this.attr.keyName.toString().indexOf('function') !== -1)) {
863
+ this.debouncedUpdateOptions()
864
+ }
865
+ // 如果有自定义是否展示表单项函数
866
+ if (this.attr.showFormItemFunc) {
867
+ this.debouncedShowFormItemFunc()
868
+ }
869
+ // 如果有自定义是否展示查询表单项函数
870
+ if (this.attr.showQueryFormItemFunc) {
871
+ this.debouncedShowQueryFormItemFunc()
872
+ }
873
+ // 地址搜索框赋值
874
+ if (this.attr.type === 'addressSearch') {
875
+ this.$refs.addressSearchCombobox.addressInput = this.form[this.attr.model]
876
+ }
877
+ // 数据源来自人员联动时更新数据
878
+ if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString().endsWith(']联动人员')) {
879
+ this.debouncedUserLinkFunc()
880
+ }
881
+ // 数据源来自人员联动时更新数据
882
+ if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString().endsWith(']联动部门')) {
883
+ this.debouncedDepLinkFunc()
884
+ }
885
+ },
886
+ deep: true
887
+ }
888
+ },
889
+ inject: {
890
+ getComponentByName: {
891
+ default: () => () => {
892
+ console.warn('getComponentByName is not provided')
893
+ return null // 或者返回一个默认的函数
894
+ },
895
+ },
896
+ registerComponent: {
897
+ default: () => () => {
898
+ console.warn('registerComponent is not provided')
899
+ return null // 或者返回一个默认的函数
900
+ },
901
+ },
902
+ getSelf: {
903
+ default: () => () => {
904
+ console.warn('getSelf is not provided')
905
+ return null // 或者返回一个默认的函数
906
+ },
907
+ },
908
+ },
909
+ methods: {
910
+ // 把内部的crud表单录入放到表单中,以便外部可以调用
911
+ onComponentMounted (h, attr) {
912
+ console.log('crud表单', h)
913
+ if (attr.crud) {
914
+ this.registerComponent(attr.model, this.$refs['childXFormTable_' + attr.model])
915
+ }
916
+ },
917
+ childTableFixedQueryForm (item) {
918
+ console.log('传递的form', this.form)
919
+ if (this.modifyModelData?.primaryKeyData) {
920
+ const fixedForm = {}
921
+ fixedForm[item.childTableForeignKeyName] = Object.values(this.modifyModelData.primaryKeyData)[0]
922
+ return fixedForm
923
+ }
924
+ return null
925
+ },
926
+ // 动态生成事件绑定对象
927
+ generateDynamicEvents (inputOnAfterFunc, attr) {
928
+ const events = {}
929
+ const states = this.parseStates(attr.inputOnAfterName, inputOnAfterFunc)
930
+
931
+ states.forEach((state) => {
932
+ // 动态绑定事件名到 emitFunc
933
+ events[state.event] = () => {
934
+ console.info('事件名', state.event)
935
+ this.emitFunc(state.event, attr)
936
+ }
937
+ })
938
+
939
+ return events // 返回 { state1Event: handler, state2Event: handler, ... }
940
+ },
941
+ parseStates (input, events) {
942
+ const eventNames = events.split('|')
943
+ return input.split('|').map((label, index) => ({
944
+ label,
945
+ event: eventNames[index] // 如果没有提供事件名称,则使用默认值
946
+ }))
947
+ },
948
+ focusInput () {
949
+ if (this.attr.defaultFocus) {
950
+ this.$nextTick(h => {
951
+ const el = this.$refs[`${this.attr.model}input`]?.$el
952
+ let inputEl
953
+ if (el) {
954
+ if (el.tagName.toLowerCase() === 'input') {
955
+ inputEl = el
956
+ } else {
957
+ inputEl = el.querySelector('input')
958
+ }
959
+ }
960
+ if (inputEl) {
961
+ inputEl.focus()
962
+ if (inputEl.type === 'number') {
963
+ if (inputEl.valueAsNumber) {
964
+ inputEl.setSelectionRange(0, inputEl.valueAsNumber.toString().length)
965
+ }
966
+ } else {
967
+ if (inputEl.value) {
968
+ inputEl.setSelectionRange(0, inputEl.value.length)
969
+ }
970
+ }
971
+ }
972
+ })
973
+ }
974
+ },
975
+ // 更新人员下拉框数据
976
+ async updateResOptions (type) {
977
+ if (this?.attr?.keyName?.toString()?.startsWith('search@根据表单项[') && this?.attr?.keyName?.toString()?.endsWith(`]联动${type}`)) {
978
+ const searchData = { source: `获取${type}`, userid: this.currUser.id }
979
+ const startIndex = this.attr.keyName.indexOf('[') + 1
980
+ const endIndex = this.attr.keyName.indexOf(']', startIndex)
981
+ const fromModel = this.attr.keyName.substring(startIndex, endIndex).replace('.', '_')
982
+ const formModelData = this.form[fromModel]
983
+ if (fromModel?.length && formModelData?.length) {
984
+ await searchToListOption(searchData, res => {
985
+ this.getDataCallback(
986
+ res.filter(h => {
987
+ if (fromModel.indexOf('org') > -1) {
988
+ return formModelData?.includes(h.orgid || h.f_organization_id || h.parentid)
989
+ } else {
990
+ return formModelData?.includes(h?.parentid)
991
+ }
992
+ }
993
+ )
994
+ )
995
+ })
996
+ }
997
+ }
998
+ },
999
+ // js 函数作为数据源
1000
+ async updateOptions () {
1001
+ if (this.attr.keyName && (this.attr.keyName.indexOf('async ') !== -1 || this.attr.keyName.indexOf('function ') !== -1)) {
1002
+ this.optionForFunc = await executeStrFunctionByContext(this, this.attr.keyName, [this.form, runLogic, this.mode, getConfigByNameAsync])
1003
+ }
1004
+ },
1005
+ async dataChangeFunc () {
1006
+ if (this.attr.dataChangeFunc) {
1007
+ await executeStrFunctionByContext(this, this.attr.dataChangeFunc, [this.form, this.setForm, this.attr, util, this.mode, runLogic, getConfigByNameAsync])
1008
+ }
1009
+ },
1010
+ async showFormItemFunc () {
1011
+ if (this.attr.showFormItemFunc) {
1012
+ const obj = executeStrFunctionByContext(this, this.attr.showFormItemFunc, [this.form, this.setForm, this.attr, util, this.mode])
1013
+ // 判断是 bool 还是 obj 兼容
1014
+ if (typeof obj === 'boolean') {
1015
+ this.show = obj
1016
+ } else if (obj && typeof obj === 'object') {
1017
+ // obj 是一个对象,并且不是数组
1018
+ this.show = obj?.show
1019
+ this.readOnly = obj?.readOnly
1020
+ }
1021
+ } else {
1022
+ this.show = true
1023
+ }
1024
+ },
1025
+ async showQueryFormItemFunc () {
1026
+ if (this.attr.showQueryFormItemFunc) {
1027
+ const obj = executeStrFunctionByContext(this, this.attr.showQueryFormItemFunc, [this.form, this.setForm, this.attr, util, this.mode])
1028
+ // 判断是 bool 还是 obj 兼容
1029
+ if (typeof obj === 'boolean') {
1030
+ this.show = obj
1031
+ } else if (obj && typeof obj === 'object') {
1032
+ // obj 是一个对象,并且不是数组
1033
+ this.show = obj?.show
1034
+ this.readOnly = obj?.readOnly
1035
+ }
1036
+ } else {
1037
+ this.show = true
1038
+ }
1039
+ },
1040
+ init () {
1041
+ if (!this.attr.flex) {
1042
+ if (this.mode === '新增/修改') {
1043
+ if (['horizontal', 'vertical'].includes(this.layout) || ['textarea', 'file', 'image'].includes(this.attr.type)) {
1044
+ // 新增修改表单 horizontal 模式下默认为一行
1045
+ this.attr.flex = {
1046
+ xs: 24,
1047
+ sm: 24,
1048
+ md: 24,
1049
+ lg: 24,
1050
+ xl: 24,
1051
+ xxl: 24,
1052
+ fullWidth: true
1053
+ }
1054
+ } else {
1055
+ // 新增修改表单 vertical 模式下默认为1列
1056
+ this.attr.flex = {
1057
+ xs: 24,
1058
+ sm: 12,
1059
+ md: 8,
1060
+ lg: 8,
1061
+ xl: 6,
1062
+ xxl: 6
1063
+ }
1064
+ }
1065
+ } else {
1066
+ this.attr.flex = {
1067
+ xs: 24,
1068
+ sm: 24,
1069
+ md: 8,
1070
+ lg: 6,
1071
+ xl: 6,
1072
+ xxl: 6
1073
+ }
1074
+ }
1075
+ }
1076
+ if (this.attr.keyName && typeof this.attr.keyName === 'string') {
1077
+ if (this.attr.keyName.indexOf('logic@') !== -1) {
1078
+ this.getData({}, res => this.getDataCallback(res))
1079
+ } else if (this.attr.keyName.indexOf('search@') !== -1) {
1080
+ // `tool.getFullTree(this.getRights().where(row.getType()==$organization$))`
1081
+ // 判断是否根据角色查询
1082
+ let source = this.attr.keyName.substring(7)
1083
+ const userid = this.currUser.id
1084
+ let roleName = 'roleName'
1085
+ if (source.startsWith('根据角色[') && source.endsWith(']获取人员')) {
1086
+ const startIndex = source.indexOf('[') + 1
1087
+ const endIndex = source.indexOf(']', startIndex)
1088
+ roleName = source.substring(startIndex, endIndex)
1089
+ source = '根据角色获取人员'
1090
+ }
1091
+ const searchData = { source, userid, roleName }
1092
+ // 判断是否根据某个表单项联动 仅返回列表结构并筛选
1093
+ if (source.startsWith('根据表单项[') && source.endsWith(']联动人员')) {
1094
+ this.updateResOptions('人员')
1095
+ } else if (source.startsWith('根据表单项[') && source.endsWith(']联动部门')) {
1096
+ this.updateResOptions('部门')
1097
+ } else if (this.attr.type === 'select' || this.attr.type === 'checkbox') {
1098
+ // 仅获取最内层数据
1099
+ searchToListOption(searchData, res => this.getDataCallback(res))
1100
+ } else {
1101
+ // 其他资源通用逻辑
1102
+ searchToOption(searchData, res => this.getDataCallback(res))
1103
+ }
1104
+ } else if (this.attr.keyName.indexOf('config@') !== -1) {
1105
+ const configName = this.attr.keyName.substring(7)
1106
+ getConfigByName(configName, this.serviceName, res => {
1107
+ this.getDataCallback(res.value)
1108
+ }, this.env === 'dev')
1109
+ } else if (this.attr.keyName.indexOf('async ') !== -1 || this.attr.keyName.indexOf('function ') !== -1) {
1110
+ this.updateOptions()
1111
+ }
1112
+ }
1113
+ this.focusInput()
1114
+ },
1115
+ addressSearchComboboxSelect (data) {
1116
+ this.form = Object.assign(this.form, JSON.parse(data))
1117
+ },
1118
+ onDivisionsChange (data) {
1119
+ this.emitFunc('addressSearchComboboxSelect', {
1120
+ key: this.attr.model,
1121
+ value: data
1122
+ })
1123
+ },
1124
+ getDataCallback (res) {
1125
+ this.option = res
1126
+ if (this.attr.type === 'treeSelect') {
1127
+ this.$refs.xTreeSelect.init({
1128
+ option: this.option,
1129
+ form: this.form,
1130
+ queryType: this.attr.queryType,
1131
+ name: this.attr.name,
1132
+ model: this.attr.model,
1133
+ mode: this.mode,
1134
+ disabled: this.disabled
1135
+ })
1136
+ } else if (this.attr.type === 'radio' || ['radioGroup', 'clickChange'].includes(this.attr.showMode)) {
1137
+ this.initRadioValue()
1138
+ }
1139
+ },
1140
+ initRadioValue () {
1141
+ const model = this.attr.model
1142
+ if (this.mode === '新增/修改' && (this.form[model] === undefined || this.form[model] === null) && !this.attr.prop) {
1143
+ if (this.attr.keys && this.attr.keys.length > 1) {
1144
+ this.form[model] = this.attr.keys[0].value
1145
+ } else if (this.option.length > 1) {
1146
+ this.form[model] = this.option[0].value
1147
+ }
1148
+ }
1149
+ },
1150
+ // 文件框时设置上传组件的值
1151
+ setFiles (fileIds) {
1152
+ if (!this.form[this.attr.model]) {
1153
+ this.form[this.attr.model] = []
1154
+ }
1155
+ this.form[this.attr.model] = [...fileIds]
1156
+ },
1157
+ // 懒加载检索方法
1158
+ fetchFunction (value) {
1159
+ this.lastFetchId += 1
1160
+ const fetchId = this.lastFetchId
1161
+ this.option = []
1162
+ this.searching = true
1163
+ this.getData({
1164
+ word: value
1165
+ }, res => {
1166
+ if (fetchId !== this.lastFetchId) {
1167
+ return
1168
+ }
1169
+ this.option = res
1170
+ this.searching = false
1171
+ })
1172
+ },
1173
+ // 获取数据
1174
+ getData (value, callbackFun) {
1175
+ if (value !== '') {
1176
+ const logicName = this.attr.keyName
1177
+ const logic = logicName.substring(6)
1178
+ // 调用logic前设置参数
1179
+ if (this.getDataParams && this.getDataParams[this.attr.model]) {
1180
+ Object.assign(value, this.getDataParams[this.attr.model])
1181
+ }
1182
+ runLogic(logic, Object.assign(value, {
1183
+ orgId: this.currUser.orgid,
1184
+ userId: this.currUser.id
1185
+ }), this.serviceName, this.env === 'dev').then(res => {
1186
+ callbackFun(res)
1187
+ }).catch(e => {
1188
+ callbackFun([])
1189
+ console.error('获取数据失败:' + e)
1190
+ })
1191
+ }
1192
+ },
1193
+ filterOption (input, option) {
1194
+ const child = option.componentOptions.children[0]
1195
+ if (child.text) {
1196
+ return child.text.toLowerCase().indexOf(input.toLowerCase()) >= 0
1197
+ } else if (child.elm.innerText) {
1198
+ return child.elm.innerText.toLowerCase().indexOf(input.toLowerCase()) >= 0
1199
+ } else {
1200
+ return child.child.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
1201
+ }
1202
+ },
1203
+ // 表单项变更函数中调用 控制表单组中表单项组名为 groupName 的表单是否展示
1204
+ // func:x-form-show(显示)/x-form-no-show(不显示)
1205
+ emitShowFormFunc (func, groupName) {
1206
+ this.emitFunc(func, groupName)
1207
+ },
1208
+ emitFunc (func, data) {
1209
+ this.$emit('x-form-item-emit-func', func, data, data?.model ? this.form[data.model] : this.form)
1210
+ },
1211
+ itemMounted (h) {
1212
+ this.$emit('mounted', h)
1213
+ },
1214
+ rowChoose (rows) {
1215
+ this.$emit('rowChoose', rows, this.attr, this.closeRowChooseInput)
1216
+ },
1217
+ searchRowChooseData () {
1218
+ if (this.searching) {
1219
+ return
1220
+ }
1221
+ this.lastFetchId += 1
1222
+ const fetchId = this.lastFetchId
1223
+ this.searching = true
1224
+ if (fetchId !== this.lastFetchId) {
1225
+ return
1226
+ }
1227
+ this.rowChooseFixedQueryValue = []
1228
+ this.rowChooseFixedQueryValue[this.attr.model] = this.form[this.attr.model]
1229
+ this.$nextTick(() => {
1230
+ this.$refs.rowChooseTable.refresh(true)
1231
+ })
1232
+ },
1233
+ showCloseRowChooseInput () {
1234
+ this.rowChoosePopoverVisible = true
1235
+ },
1236
+ closeRowChooseInput () {
1237
+ this.rowChoosePopoverVisible = false
1238
+ },
1239
+ rowChooseSearchAfterQuery () {
1240
+ this.searching = false
1241
+ },
1242
+ // 获取 recording 转换后的数据
1243
+ getRecodingData () {
1244
+ return this.$refs.recording.getRecordingData()
1245
+ },
1246
+ recordingData (data) {
1247
+ this.emitFunc('recordingData', data)
1248
+ },
1249
+ getPopupContainer (triggerNode) {
1250
+ return document.body
1251
+ // return triggerNode.parentNode
1252
+ }
1253
+ }
1254
+ }
1255
+ </script>
1256
+
1257
+ <style lang="less" scoped>
1258
+ .custom-dropdown {
1259
+ position: absolute;
1260
+ z-index: 1050;
1261
+ }
1262
+
1263
+ .intervalPicker-begin {
1264
+ width: calc(50% - 14px);
1265
+ }
1266
+
1267
+ .intervalPicker-center {
1268
+ width: 30px;
1269
+ border-left: 0;
1270
+ pointer-events: none;
1271
+ }
1272
+
1273
+ .intervalPicker-end {
1274
+ width: calc(50% - 14px);
1275
+ border-left: 0;
1276
+ }
1277
+
1278
+ //.label-box{
1279
+ // width: 80%;
1280
+ // display: inline-block;
1281
+ // height: auto;
1282
+ // white-space: break-spaces;
1283
+ // line-height: 18px;
1284
+ // text-align: left;
1285
+ //}
1286
+ </style>