vue2-client 1.10.7 → 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 -1069
  112. package/src/base-client/components/common/XAddNativeForm/demo.vue +36 -36
  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 -1286
  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 -157
  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,854 +1,854 @@
1
- <template>
2
- <a-row type="flex" :gutter="{ xs: 8, sm: 10, md: 12, lg: 16 }">
3
- <a-col
4
- :xs="14"
5
- :sm="14"
6
- :md="12"
7
- :lg="9"
8
- :xl="6"
9
- :xxl="5"
10
- v-if="xTreeConfigName"
11
- :style="{ maxWidth: '400px'}">
12
- <x-tree-pro
13
- :config-name="xTreeConfigName"
14
- :env="env"
15
- @action="action"
16
- @btnFuncClick="treeBtnFuncClick"
17
- @treeOnChecked="treeOnChecked"
18
- ref="xtree"
19
- ></x-tree-pro>
20
- </a-col>
21
- <a-col
22
- :xs="xTreeConfigName ? 10 : 24"
23
- :sm="xTreeConfigName ? 10 : 24"
24
- :md="xTreeConfigName ? 12 : 24"
25
- :lg="xTreeConfigName ? 15 : 24"
26
- :xl="xTreeConfigName ? 18 : 24"
27
- :xxl="xTreeConfigName ? 19 : 24">
28
- <a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
29
- <a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
30
- <div v-show="!loading">
31
- <template v-if="!loadError">
32
- <x-add-form
33
- ref="xAddForm"
34
- @onLocalSubmit="onLocalSubmit"
35
- @x-form-item-emit-func="emitFunc"
36
- @afterSubmit="onAddOrEditSubmitAfterSubmit"
37
- >
38
- <template slot="groupFormItems" slot-scope="{form, model, rules, modifyModelData}">
39
- <slot
40
- name="groupFormItems"
41
- :form="form"
42
- :model="model"
43
- :rules="rules"
44
- :modifyModelData="modifyModelData"></slot>
45
- </template>
46
- </x-add-form>
47
- <x-add-report
48
- v-if="moveType"
49
- ref="xAddReport"
50
- >
51
- </x-add-report>
52
- <div v-if="crudTitle" class="crud_title">
53
- {{ crudTitle }}
54
- </div>
55
- <x-form
56
- ref="xForm"
57
- @toggleAdvanced="toggleAdvanced"
58
- @onSubmit="onSearchSubmit">
59
- <slot name="formBtnExpand"></slot>
60
- </x-form>
61
- <x-table
62
- ref="xTable"
63
- :fixedQueryForm="fixedQueryForm"
64
- :queryParamsName="queryParamsName"
65
- :query-params-json="queryParamsJson"
66
- :show-pagination="showPagination"
67
- :customDelete="customDelete"
68
- :extraHeight="extraHeight"
69
- :serviceName="serviceName"
70
- @add="add"
71
- @move="move"
72
- @edit="edit"
73
- @del="del"
74
- @rowChoose="rowChoose"
75
- @customEvent="customEvent"
76
- @afterDelete="afterDelete"
77
- @action="action"
78
- @selectRow="selectRow"
79
- @afterQuery="afterQuery"
80
- @columnClick="columnClick"
81
- @gotoUserDetail="gotoUserDetail"
82
- @editButtonStateDataClick="editButtonStateDataClick"
83
- @importExcelOk="importExcelOk">
84
- <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
85
- <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
86
- </template>
87
- <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
88
- <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
89
- </template>
90
- <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
91
- <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
92
- <a-tooltip title="收起查询条件" placement="bottom">
93
- <a-button @click="toggleIsFormShow">
94
- <a-icon :style="iconStyle" :type="toggleIsFormIcon"/>
95
- </a-button>
96
- </a-tooltip>
97
- </template>
98
- <!-- 底部插槽 -->
99
- <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
100
- <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
101
- </template>
102
- <!-- excel导入说明插槽 -->
103
- <template #importExcelSlot>
104
- <slot name="importExcelSlot"></slot>
105
- </template>
106
- </x-table>
107
- </template>
108
- <template v-else>
109
- <a-empty>
110
- <span slot="description"> 页面配置不存在,请联系系统管理员</span>
111
- </a-empty>
112
- </template>
113
- </div>
114
- </a-col>
115
- <UserInfoDetailManage ref="userInfo" @close="refresh(false)"/>
116
- </a-row>
117
- </template>
118
- <script>
119
- import XForm from '@vue2-client/base-client/components/common/XForm'
120
- import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
121
- import XAddReport from '@vue2-client/base-client/components/common/XAddReport'
122
- import XTable from '@vue2-client/base-client/components/common/XTable'
123
- import XTree from '@vue2-client/base-client/components/common/XTree'
124
- import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
125
- import {
126
- getConfigByName,
127
- getConfigByLogic,
128
- parseConfig, runLogic, getConfigByNameAsync,
129
- } from '@vue2-client/services/api/common'
130
- import { mapState } from 'vuex'
131
- import XTreePro from '@vue2-client/base-client/components/common/XTree/XTreePro.vue'
132
- import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
133
- import { getRealKeyData } from '@vue2-client/utils/util'
134
- import * as util from '@vue2-client/utils/util'
135
- import UserInfoDetailManage from '@vue2-client/pages/userInfoDetailManage/index.vue'
136
-
137
- export default {
138
- name: 'XFormTable',
139
- components: {
140
- UserInfoDetailManage,
141
- XTreePro,
142
- XTable,
143
- XForm,
144
- XTree,
145
- XAddForm,
146
- XAddReport,
147
- XImportExcel
148
- },
149
- provide () {
150
- return {
151
- getSelf: () => this,
152
- emitEvent: this.emitEvent.bind(this)
153
- }
154
- },
155
- inject: {
156
- getSelectedId: {
157
- default: () => () => {
158
- console.warn('getSelectedId is not provided.')
159
- return null
160
- },
161
- },
162
- getSelectedData: {
163
- default: () => () => {
164
- console.warn('getSelectedData is not provided.')
165
- return null
166
- },
167
- },
168
- getMixinData: {
169
- default: () => () => {
170
- console.warn('getMixinData is not provided.')
171
- return {}
172
- },
173
- },
174
- getOutEnv: {
175
- default: () => () => {
176
- console.warn('getOutEnv is not provided.')
177
- return {}
178
- },
179
- },
180
- currUser: {
181
- default: () => {
182
- console.warn('currUser is not provided.')
183
- return { id: null, name: 'Guest' }
184
- },
185
- },
186
- },
187
- data () {
188
- return {
189
- // 加载状态
190
- loading: false,
191
- // 图标样式
192
- iconStyle: {
193
- position: 'relative',
194
- top: '1px'
195
- },
196
- loadError: false,
197
- moveType: false,
198
- // 添加按钮对应的配置名
199
- moveconfig: '',
200
- // 实际查询配置内容
201
- realQueryConfig: {},
202
- toggleIsFormIcon: 'vertical-align-top',
203
- table_selectedRowKeys: [],
204
- table_selectedRows: [],
205
- // 数据只有一页时是否展示分页,true:展示,auto:隐藏
206
- showPagination: true,
207
- }
208
- },
209
- computed: {
210
- ...mapState('setting', ['isMobile'])
211
- },
212
- props: {
213
- // 业务名称
214
- title: {
215
- type: String,
216
- default: ''
217
- },
218
- // 卡片标题
219
- crudTitle: {
220
- type: String,
221
- default: null
222
- },
223
- // 查询配置文件名
224
- queryParamsName: {
225
- type: String,
226
- default: null
227
- },
228
- // 配置所属命名空间
229
- serviceName: {
230
- type: String,
231
- default: process.env.VUE_APP_SYSTEM_NAME
232
- },
233
- // 查询配置文件Json,用于查询配置生成器的预览
234
- queryParamsJson: {
235
- type: Object,
236
- default: null
237
- },
238
- // xTree 配置
239
- xTreeConfigName: {
240
- type: String,
241
- default: null
242
- },
243
- // 业务逻辑名称, 通过logic获取表单表格配置
244
- logicName: {
245
- type: String,
246
- default: null
247
- },
248
- // 执行logic传递的参数
249
- logicParam: {
250
- type: Object,
251
- default: () => {
252
- }
253
- },
254
- // 固定新增表单
255
- fixedAddForm: {
256
- type: Object,
257
- default: () => {
258
- return {}
259
- }
260
- },
261
- // 固定查询表单
262
- fixedQueryForm: {
263
- type: Object,
264
- default: () => {
265
- return {}
266
- }
267
- },
268
- // 预览模式
269
- viewMode: {
270
- type: Boolean,
271
- default: () => {
272
- return false
273
- }
274
- },
275
- // 本地编辑模式
276
- localEditMode: {
277
- type: Boolean,
278
- default: () => {
279
- return false
280
- }
281
- },
282
- // 行选择模式
283
- rowSelectMode: {
284
- type: Boolean,
285
- default: () => {
286
- return false
287
- }
288
- },
289
- // 行选择模式-允许选中行数量,0:任意数量行,大于0:指定值数量的行
290
- allowSelectRowNum: {
291
- type: Number,
292
- default: () => {
293
- return 0
294
- }
295
- },
296
- // 环境
297
- env: {
298
- type: String,
299
- default: () => {
300
- return 'prod'
301
- }
302
- },
303
- // 调用logic获取数据源的追加参数
304
- getDataParams: {
305
- type: Object,
306
- default: undefined
307
- },
308
- // 可以控制组件中导出等按钮的隐藏
309
- buttonState: {
310
- type: Object,
311
- default: undefined
312
- },
313
- // 是否自定义新增按钮的功能
314
- customAdd: {
315
- type: Boolean,
316
- default: false
317
- },
318
- reportQueryName: {
319
- type: String,
320
- default: undefined,
321
- },
322
- // 是否自定义删除按钮的功能
323
- customDelete: {
324
- type: Boolean,
325
- default: false
326
- },
327
- // 是否自定义修改按钮的功能
328
- customEdit: {
329
- type: Boolean,
330
- default: false
331
- },
332
- // 是否自定义增加按钮
333
- customMove: {
334
- type: Boolean,
335
- default: false
336
- },
337
- // 自适应底部边距
338
- extraHeight: {
339
- type: Number,
340
- default: 80
341
- }
342
- },
343
- watch: {
344
- logicParam: {
345
- handler () {
346
- this.initConfig()
347
- },
348
- deep: true
349
- },
350
- queryParamsJson: {
351
- handler () {
352
- this.initConfig()
353
- },
354
- deep: true
355
- },
356
- queryParamsName: {
357
- handler () {
358
- this.initConfig()
359
- }
360
- },
361
- serviceName: {
362
- handler () {
363
- this.initConfig()
364
- }
365
- }
366
- },
367
- methods: {
368
- runLogic,
369
- getRealKeyData,
370
- getConfigByNameAsync,
371
- getConfigByName,
372
- customEvent (func, data) {
373
- this.$emit(func, data)
374
- },
375
- columnClick (key, value, record) {
376
- this.$emit('columnClick', key, value, record)
377
- },
378
- gotoUserDetail (key, value, record) {
379
- this.$refs.userInfo.init(getRealKeyData(record))
380
- },
381
- // 获取主表的数据内容,去掉主表别名
382
- getPrimaryData (rows) {
383
- const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
384
- const prefix = `${alias}_` // 构建前缀
385
- const result = []
386
-
387
- // 遍历 rows 的每一项,提取符合条件的数据
388
- rows.forEach(row => {
389
- const itemResult = {}
390
- Object.keys(row).forEach(key => {
391
- if (key.startsWith(prefix)) {
392
- const newKey = key.slice(prefix.length) // 去掉前缀
393
- itemResult[newKey] = row[key] // 添加到结果对象中
394
- }
395
- })
396
- result.push(itemResult) // 将处理后的项添加到结果数组中
397
- })
398
-
399
- return result // 返回去掉前缀后的对象数组
400
- },
401
-
402
- // 给数据区域添加主表数据,给的数据没有主表别名,放着时添加主表别名
403
- pushPrimaryData (rows) {
404
- const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
405
- const prefix = `${alias}_` // 构建前缀
406
- const result = rows.map(row => {
407
- const itemResult = {}
408
- Object.keys(row).forEach(key => {
409
- itemResult[prefix + key] = row[key] // 复制原始数据
410
- })
411
- return itemResult // 返回添加了主表别名的数据
412
- })
413
- // 把结果添加到数据区
414
- this.getTableData().push(...result)
415
- },
416
-
417
- // 设置固定查询条件,主表别名自动带
418
- setFixedQueryForm (data) {
419
- const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
420
- const prefixedData = {}
421
-
422
- // 为每个键添加主表别名
423
- Object.keys(data).forEach(key => {
424
- prefixedData[`${alias}_${key}`] = data[key]
425
- })
426
-
427
- Object.assign(this.fixedQueryForm, prefixedData)
428
- },
429
-
430
- importExcelOk (data) {
431
- this.$emit('importExcelOk', data)
432
- },
433
- initConfig () {
434
- this.loading = true
435
- this.loadError = false
436
- if (this.queryParamsName) {
437
- this.getConfig()
438
- } else if (this.queryParamsJson) {
439
- this.getConfigBySource()
440
- } else if (this.logicName && this.logicParam) {
441
- this.getColumnJsonByLogic()
442
- } else {
443
- this.loading = false
444
- this.loadError = true
445
- }
446
- },
447
-
448
- getConfig () {
449
- getConfigByName(this.queryParamsName, this.serviceName, (res) => {
450
- if (!res) {
451
- this.loading = false
452
- this.loadError = true
453
- return
454
- }
455
- this.updateComponents(res)
456
- }, this.env === 'dev')
457
- },
458
- getConfigBySource () {
459
- parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
460
- if (!res) {
461
- this.loading = false
462
- this.loadError = true
463
- return
464
- }
465
- this.updateComponents(res, true)
466
- })
467
- },
468
- getColumnJsonByLogic () {
469
- getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
470
- if (!res) {
471
- this.loading = false
472
- this.loadError = true
473
- return
474
- }
475
- this.updateComponents(res, true)
476
- }, this.env === 'dev')
477
- },
478
-
479
- /**
480
- * 更新子组件
481
- * @param res 参数
482
- * @param setQueryParams 是否设置queryParams参数
483
- */
484
- updateComponents (res, setQueryParams) {
485
- this.realQueryConfig = res
486
- if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
487
- // 设置添加按钮对应的配置名
488
- this.moveconfig = res.moveconfig
489
- this.showPagination = res.showPagination === null ? true : res.showPagination
490
- // 是否展示排序按钮控制
491
- if (res.showSortIcon !== null && !res.showSortIcon) {
492
- res.columnJson.forEach(item => {
493
- item.sorter = false
494
- })
495
- }
496
- const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
497
- const initTable = () => {
498
- // 初始化 xTable 子组件
499
- this.$refs.xTable.init({
500
- formItems: res.formJson,
501
- queryParams: setQueryParams ? res : null,
502
- tableColumns: res.columnJson,
503
- buttonState: Object.assign(res.buttonState, this.buttonState),
504
- title: this.title || res.title,
505
- viewMode: this.viewMode,
506
- localEditMode: localEditMode,
507
- rowSelectMode: this.rowSelectMode,
508
- allowSelectRowNum: this.allowSelectRowNum,
509
- tableSummaryMap: res.tableSummaryMap,
510
- serviceName: this.serviceName,
511
- env: this.env,
512
- form: this.$refs.xForm.form,
513
- summaryUpdate: true,
514
- ...res
515
- })
516
- if (this.realQueryConfig?.funcData?.pageMounted) {
517
- executeStrFunctionByContext(this, this.realQueryConfig.funcData.pageMounted, [util, runLogic, getConfigByNameAsync])
518
- }
519
- }
520
- // 初始化 xForm 子组件
521
- if (!localEditMode && !this.rowSelectMode) {
522
- this.$refs.xForm.init({
523
- queryParamsName: this.queryParamsName || 'localConfig',
524
- formItems: res.formJson,
525
- serviceName: this.serviceName,
526
- getDataParams: this.getDataParams,
527
- simpleMode: res.simpleMode,
528
- funcData: res.funcData,
529
- env: this.env
530
- })
531
- } else {
532
- // TODO 此处应删除
533
- initTable()
534
- }
535
- // 初始化 xTable 子组件
536
- // 等待 x-from-item 的 mounted 完成
537
- this.$refs.xForm.$on('itemsMounted', initTable)
538
- }
539
- this.loading = false
540
- },
541
- // 自定义按钮
542
- editButtonStateDataClick (functionName, rows) {
543
- console.log('functionName', functionName)
544
- console.log('rows', rows)
545
- this.$emit(functionName, rows)
546
- },
547
-
548
- /**
549
- * 提交查询表单事件
550
- * @param res 参数
551
- */
552
- onSearchSubmit (res) {
553
- if (res.valid) {
554
- // 表单赋值
555
- this.$refs.xTable.setQueryForm(res.form)
556
- this.$refs.xTable.summaryUpdate = true
557
- // commit
558
- this.$emit('afterSearchSubmit', res)
559
- } else {
560
- return false
561
- }
562
- },
563
- active (props) {
564
- let num = false
565
- for (const key in props) {
566
- // eslint-disable-next-line no-prototype-builtins
567
- if (this.$props.hasOwnProperty(key)) {
568
- if (this.$props[key] instanceof Object) {
569
- this.$props[key] = JSON.parse(props[key])
570
- } else {
571
- this.$props[key] = props[key]
572
- }
573
- num = true
574
- }
575
- }
576
- if (num) {
577
- this.initConfig()
578
- }
579
- },
580
- /**
581
- * 提交新增/修改表单后事件
582
- */
583
- onAddOrEditSubmitAfterSubmit (res) {
584
- this.refreshTable(res.businessType === '新增')
585
- // commit
586
- this.$emit('afterSubmit', res)
587
- },
588
- /**
589
- * 表格查询后事件
590
- * @param res 参数
591
- * @param conditionParams 查询条件
592
- */
593
- afterQuery (res, conditionParams) {
594
- this.$emit('afterQuery', res, conditionParams)
595
- },
596
- /**
597
- * 详情按钮事件
598
- * @param record 本条数据
599
- * @param id 数据标识
600
- * @param actionType 操作类型
601
- * @param fun 向上级传递的事件
602
- */
603
- action (record, id, actionType, fun = 'action', index) {
604
- this.$emit(fun, record, id, actionType, index)
605
- },
606
- treeOnChecked (checkedKeys, deepNodes, deepKeys) {
607
- this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
608
- },
609
- treeBtnFuncClick (index, func) {
610
- this.$emit('treeBtnFuncClick', index, func)
611
- },
612
- /**
613
- * 新增按钮事件
614
- */
615
- add () {
616
- if (this.customAdd) {
617
- this.$emit('add')
618
- } else {
619
- if (this.$listeners.curdAddBefore) {
620
- this.$emit('curdAddBefore', this.addFormInit)
621
- } else {
622
- this.addFormInit()
623
- }
624
- }
625
- },
626
- addFormInit () {
627
- const res = this.realQueryConfig
628
- const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
629
- this.$refs.xAddForm.init({
630
- businessType: '新增',
631
- title: this.title || res.title,
632
- isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
633
- configName: this.queryParamsName,
634
- configContent: this.queryParamsJson,
635
- formItems: res.formJson,
636
- viewMode: this.viewMode,
637
- localEditMode: localEditMode,
638
- isKeyHandle: !Boolean(localEditMode),
639
- serviceName: this.serviceName,
640
- fixedAddForm: this.fixedAddForm,
641
- getDataParams: this.getDataParams,
642
- layout: res.xAddFormLayout || 'horizontal',
643
- xAddFormLayoutWidth: res.xAddFormLayoutWidth,
644
- formItemLayout: res.formItemLayout || {},
645
- env: this.env
646
- })
647
- },
648
- /**
649
- * 添加按钮事件
650
- */
651
- move () {
652
- this.moveType = true
653
- this.$nextTick(
654
- () => {
655
- this.$refs.xAddReport.init({
656
- configName: this.moveconfig,
657
- selectedId: this.fixedAddForm.selected_id
658
- })
659
- }
660
- )
661
- },
662
- /**
663
- * 修改按钮事件
664
- * @param modifyModelData 修改表单数据
665
- */
666
- edit (modifyModelData) {
667
- if (this.customEdit) {
668
- this.$emit('edit')
669
- } else {
670
- const res = this.realQueryConfig
671
- const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
672
- this.$refs.xAddForm.init({
673
- businessType: '修改',
674
- title: this.title || res.title,
675
- isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
676
- configName: this.queryParamsName,
677
- configContent: this.queryParamsJson,
678
- formItems: res.formJson,
679
- viewMode: this.viewMode,
680
- localEditMode: localEditMode,
681
- isKeyHandle: !Boolean(localEditMode),
682
- serviceName: this.serviceName,
683
- fixedAddForm: this.fixedAddForm,
684
- getDataParams: this.getDataParams,
685
- modifyModelData: modifyModelData,
686
- layout: res.xAddFormLayout || 'horizontal',
687
- env: this.env
688
- })
689
- }
690
- },
691
- /**
692
- * 删除按钮事件
693
- */
694
- del (keys, callback) {
695
- if (this.customDelete) {
696
- this.$emit('del', keys, callback)
697
- }
698
- },
699
- /**
700
- * 删除后事件
701
- * @param res
702
- */
703
- afterDelete (res) {
704
- this.$emit('afterDelete', res)
705
- },
706
- /**
707
- * 行选择事件
708
- * @param row 选中行
709
- */
710
- rowChoose (row) {
711
- this.$emit('rowChoose', row)
712
- },
713
- /**
714
- * 本地编辑模式下校验表格并同步本地数据
715
- * @param currRow 当前行
716
- * @param defaultAppendRowData 默认追加的行数据
717
- */
718
- validateTableAndSyncData (currRow, defaultAppendRowData) {
719
- this.$refs.xTable.validateTableAndSyncData(currRow, defaultAppendRowData)
720
- },
721
- /**
722
- * 更多条件是否展示
723
- */
724
- toggleAdvanced () {
725
- this.$refs.xTable.setScrollYHeight({})
726
- },
727
- /**
728
- * 查询表单部分显示/隐藏切换
729
- */
730
- toggleIsFormShow () {
731
- this.toggleIsFormIcon = this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
732
- this.$refs.xForm.toggleVisible()
733
- this.$refs.xTable.setScrollYHeight({})
734
- },
735
- /**
736
- * 选择列事件
737
- * @param selectedRowKeys 选中列Key集合
738
- * @param selectedRows 选中列
739
- */
740
- selectRow (selectedRowKeys, selectedRows) {
741
- this.table_selectedRowKeys = selectedRowKeys
742
- this.table_selectedRows = selectedRows
743
- this.$emit('selectRow', selectedRowKeys, selectedRows)
744
- },
745
- /**
746
- * 清除勾选数据
747
- */
748
- clearRowKeys () {
749
- this.$refs.xTable.clearRowKeys()
750
- },
751
- /**
752
- * 刷新表格
753
- * @param toFirstPage 是否到第一页
754
- */
755
- refreshTable (toFirstPage = true) {
756
- this.$refs.xTable.refresh(toFirstPage)
757
- },
758
- /**
759
- * 刷新表格
760
- * @param toFirstPage 是否到第一页
761
- */
762
- refresh (toFirstPage = true) {
763
- this.$refs.xTable.refresh(toFirstPage)
764
- },
765
- /**
766
- * 获取表格数据
767
- */
768
- getTableData () {
769
- return this.$refs.xTable.getTableData()
770
- },
771
- // 在行编辑等情况下,让界面生效
772
- update () {
773
- this.getTableData().push(...[])
774
- },
775
-
776
- /**
777
- * 设置表格数据
778
- */
779
- setTableData (data) {
780
- this.$refs.xTable.setTableData(data)
781
- },
782
- /**
783
- * 表单本地提交
784
- */
785
- onLocalSubmit (res, callback) {
786
- const form = res.realForm
787
- if (res.businessType === '新增') {
788
- this.$refs.xTable.appendLocalData(form)
789
- } else {
790
- this.$refs.xTable.modifyLocalData(form['序号'], form)
791
- }
792
- this.$message.success(res.businessType + '成功!')
793
- this.onAddOrEditSubmitAfterSubmit(res, callback)
794
- if (callback) {
795
- callback()
796
- }
797
- },
798
- emitFunc (func, data, value) {
799
- this.$emit(func, data, value)
800
- },
801
- // 直接转发事件的函数
802
- emitEvent (event, ...args) {
803
- this.$emit(event, ...args)
804
- }
805
- },
806
- action: {
807
- /**
808
- * 实现doAction方法
809
- */
810
- doAction (actionType, args, data) {
811
- switch (actionType) {
812
- case 'refreshTable':
813
- for (const item in args) {
814
- console.log('item', item)
815
- }
816
- break
817
- default:
818
- break
819
- }
820
- }
821
- },
822
- mounted () {
823
- this.initConfig()
824
- if (this.getSelectedData && typeof this.getSelectedData === 'function') {
825
- const selectedId = this.getSelectedData()
826
- if (!selectedId) {
827
- return
828
- }
829
- if (typeof selectedId === 'object') {
830
- const data = JSON.parse(JSON.stringify(selectedId))
831
- if (data.selectedId) {
832
- data.selected_id = data.selectedId
833
- delete data.selectedId
834
- }
835
- Object.assign(this.fixedAddForm, data)
836
- Object.assign(this.fixedQueryForm, data)
837
- } else {
838
- Object.assign(this.fixedAddForm, { selected_id: selectedId })
839
- Object.assign(this.fixedQueryForm, { selected_id: selectedId })
840
- }
841
- }
842
- }
843
- }
844
- </script>
845
- <style lang="less" scoped>
846
- .crud_title {
847
- height: 32px;
848
- font-size: 16px;
849
- font-weight: 500;
850
- color: #000000d9;
851
- line-height: 32px;
852
- margin-bottom: 12px;
853
- }
854
- </style>
1
+ <template>
2
+ <a-row type="flex" :gutter="{ xs: 8, sm: 10, md: 12, lg: 16 }">
3
+ <a-col
4
+ :xs="14"
5
+ :sm="14"
6
+ :md="12"
7
+ :lg="9"
8
+ :xl="6"
9
+ :xxl="5"
10
+ v-if="xTreeConfigName"
11
+ :style="{ maxWidth: '400px'}">
12
+ <x-tree-pro
13
+ :config-name="xTreeConfigName"
14
+ :env="env"
15
+ @action="action"
16
+ @btnFuncClick="treeBtnFuncClick"
17
+ @treeOnChecked="treeOnChecked"
18
+ ref="xtree"
19
+ ></x-tree-pro>
20
+ </a-col>
21
+ <a-col
22
+ :xs="xTreeConfigName ? 10 : 24"
23
+ :sm="xTreeConfigName ? 10 : 24"
24
+ :md="xTreeConfigName ? 12 : 24"
25
+ :lg="xTreeConfigName ? 15 : 24"
26
+ :xl="xTreeConfigName ? 18 : 24"
27
+ :xxl="xTreeConfigName ? 19 : 24">
28
+ <a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
29
+ <a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
30
+ <div v-show="!loading">
31
+ <template v-if="!loadError">
32
+ <x-add-form
33
+ ref="xAddForm"
34
+ @onLocalSubmit="onLocalSubmit"
35
+ @x-form-item-emit-func="emitFunc"
36
+ @afterSubmit="onAddOrEditSubmitAfterSubmit"
37
+ >
38
+ <template slot="groupFormItems" slot-scope="{form, model, rules, modifyModelData}">
39
+ <slot
40
+ name="groupFormItems"
41
+ :form="form"
42
+ :model="model"
43
+ :rules="rules"
44
+ :modifyModelData="modifyModelData"></slot>
45
+ </template>
46
+ </x-add-form>
47
+ <x-add-report
48
+ v-if="moveType"
49
+ ref="xAddReport"
50
+ >
51
+ </x-add-report>
52
+ <div v-if="crudTitle" class="crud_title">
53
+ {{ crudTitle }}
54
+ </div>
55
+ <x-form
56
+ ref="xForm"
57
+ @toggleAdvanced="toggleAdvanced"
58
+ @onSubmit="onSearchSubmit">
59
+ <slot name="formBtnExpand"></slot>
60
+ </x-form>
61
+ <x-table
62
+ ref="xTable"
63
+ :fixedQueryForm="fixedQueryForm"
64
+ :queryParamsName="queryParamsName"
65
+ :query-params-json="queryParamsJson"
66
+ :show-pagination="showPagination"
67
+ :customDelete="customDelete"
68
+ :extraHeight="extraHeight"
69
+ :serviceName="serviceName"
70
+ @add="add"
71
+ @move="move"
72
+ @edit="edit"
73
+ @del="del"
74
+ @rowChoose="rowChoose"
75
+ @customEvent="customEvent"
76
+ @afterDelete="afterDelete"
77
+ @action="action"
78
+ @selectRow="selectRow"
79
+ @afterQuery="afterQuery"
80
+ @columnClick="columnClick"
81
+ @gotoUserDetail="gotoUserDetail"
82
+ @editButtonStateDataClick="editButtonStateDataClick"
83
+ @importExcelOk="importExcelOk">
84
+ <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
85
+ <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
86
+ </template>
87
+ <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
88
+ <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
89
+ </template>
90
+ <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
91
+ <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
92
+ <a-tooltip title="收起查询条件" placement="bottom">
93
+ <a-button @click="toggleIsFormShow">
94
+ <a-icon :style="iconStyle" :type="toggleIsFormIcon"/>
95
+ </a-button>
96
+ </a-tooltip>
97
+ </template>
98
+ <!-- 底部插槽 -->
99
+ <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
100
+ <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
101
+ </template>
102
+ <!-- excel导入说明插槽 -->
103
+ <template #importExcelSlot>
104
+ <slot name="importExcelSlot"></slot>
105
+ </template>
106
+ </x-table>
107
+ </template>
108
+ <template v-else>
109
+ <a-empty>
110
+ <span slot="description"> 页面配置不存在,请联系系统管理员</span>
111
+ </a-empty>
112
+ </template>
113
+ </div>
114
+ </a-col>
115
+ <UserInfoDetailManage ref="userInfo" @close="refresh(false)"/>
116
+ </a-row>
117
+ </template>
118
+ <script>
119
+ import XForm from '@vue2-client/base-client/components/common/XForm'
120
+ import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
121
+ import XAddReport from '@vue2-client/base-client/components/common/XAddReport'
122
+ import XTable from '@vue2-client/base-client/components/common/XTable'
123
+ import XTree from '@vue2-client/base-client/components/common/XTree'
124
+ import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
125
+ import {
126
+ getConfigByName,
127
+ getConfigByLogic,
128
+ parseConfig, runLogic, getConfigByNameAsync,
129
+ } from '@vue2-client/services/api/common'
130
+ import { mapState } from 'vuex'
131
+ import XTreePro from '@vue2-client/base-client/components/common/XTree/XTreePro.vue'
132
+ import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
133
+ import { getRealKeyData } from '@vue2-client/utils/util'
134
+ import * as util from '@vue2-client/utils/util'
135
+ import UserInfoDetailManage from '@vue2-client/pages/userInfoDetailManage/index.vue'
136
+
137
+ export default {
138
+ name: 'XFormTable',
139
+ components: {
140
+ UserInfoDetailManage,
141
+ XTreePro,
142
+ XTable,
143
+ XForm,
144
+ XTree,
145
+ XAddForm,
146
+ XAddReport,
147
+ XImportExcel
148
+ },
149
+ provide () {
150
+ return {
151
+ getSelf: () => this,
152
+ emitEvent: this.emitEvent.bind(this)
153
+ }
154
+ },
155
+ inject: {
156
+ getSelectedId: {
157
+ default: () => () => {
158
+ console.warn('getSelectedId is not provided.')
159
+ return null
160
+ },
161
+ },
162
+ getSelectedData: {
163
+ default: () => () => {
164
+ console.warn('getSelectedData is not provided.')
165
+ return null
166
+ },
167
+ },
168
+ getMixinData: {
169
+ default: () => () => {
170
+ console.warn('getMixinData is not provided.')
171
+ return {}
172
+ },
173
+ },
174
+ getOutEnv: {
175
+ default: () => () => {
176
+ console.warn('getOutEnv is not provided.')
177
+ return {}
178
+ },
179
+ },
180
+ currUser: {
181
+ default: () => {
182
+ console.warn('currUser is not provided.')
183
+ return { id: null, name: 'Guest' }
184
+ },
185
+ },
186
+ },
187
+ data () {
188
+ return {
189
+ // 加载状态
190
+ loading: false,
191
+ // 图标样式
192
+ iconStyle: {
193
+ position: 'relative',
194
+ top: '1px'
195
+ },
196
+ loadError: false,
197
+ moveType: false,
198
+ // 添加按钮对应的配置名
199
+ moveconfig: '',
200
+ // 实际查询配置内容
201
+ realQueryConfig: {},
202
+ toggleIsFormIcon: 'vertical-align-top',
203
+ table_selectedRowKeys: [],
204
+ table_selectedRows: [],
205
+ // 数据只有一页时是否展示分页,true:展示,auto:隐藏
206
+ showPagination: true,
207
+ }
208
+ },
209
+ computed: {
210
+ ...mapState('setting', ['isMobile'])
211
+ },
212
+ props: {
213
+ // 业务名称
214
+ title: {
215
+ type: String,
216
+ default: ''
217
+ },
218
+ // 卡片标题
219
+ crudTitle: {
220
+ type: String,
221
+ default: null
222
+ },
223
+ // 查询配置文件名
224
+ queryParamsName: {
225
+ type: String,
226
+ default: null
227
+ },
228
+ // 配置所属命名空间
229
+ serviceName: {
230
+ type: String,
231
+ default: process.env.VUE_APP_SYSTEM_NAME
232
+ },
233
+ // 查询配置文件Json,用于查询配置生成器的预览
234
+ queryParamsJson: {
235
+ type: Object,
236
+ default: null
237
+ },
238
+ // xTree 配置
239
+ xTreeConfigName: {
240
+ type: String,
241
+ default: null
242
+ },
243
+ // 业务逻辑名称, 通过logic获取表单表格配置
244
+ logicName: {
245
+ type: String,
246
+ default: null
247
+ },
248
+ // 执行logic传递的参数
249
+ logicParam: {
250
+ type: Object,
251
+ default: () => {
252
+ }
253
+ },
254
+ // 固定新增表单
255
+ fixedAddForm: {
256
+ type: Object,
257
+ default: () => {
258
+ return {}
259
+ }
260
+ },
261
+ // 固定查询表单
262
+ fixedQueryForm: {
263
+ type: Object,
264
+ default: () => {
265
+ return {}
266
+ }
267
+ },
268
+ // 预览模式
269
+ viewMode: {
270
+ type: Boolean,
271
+ default: () => {
272
+ return false
273
+ }
274
+ },
275
+ // 本地编辑模式
276
+ localEditMode: {
277
+ type: Boolean,
278
+ default: () => {
279
+ return false
280
+ }
281
+ },
282
+ // 行选择模式
283
+ rowSelectMode: {
284
+ type: Boolean,
285
+ default: () => {
286
+ return false
287
+ }
288
+ },
289
+ // 行选择模式-允许选中行数量,0:任意数量行,大于0:指定值数量的行
290
+ allowSelectRowNum: {
291
+ type: Number,
292
+ default: () => {
293
+ return 0
294
+ }
295
+ },
296
+ // 环境
297
+ env: {
298
+ type: String,
299
+ default: () => {
300
+ return 'prod'
301
+ }
302
+ },
303
+ // 调用logic获取数据源的追加参数
304
+ getDataParams: {
305
+ type: Object,
306
+ default: undefined
307
+ },
308
+ // 可以控制组件中导出等按钮的隐藏
309
+ buttonState: {
310
+ type: Object,
311
+ default: undefined
312
+ },
313
+ // 是否自定义新增按钮的功能
314
+ customAdd: {
315
+ type: Boolean,
316
+ default: false
317
+ },
318
+ reportQueryName: {
319
+ type: String,
320
+ default: undefined,
321
+ },
322
+ // 是否自定义删除按钮的功能
323
+ customDelete: {
324
+ type: Boolean,
325
+ default: false
326
+ },
327
+ // 是否自定义修改按钮的功能
328
+ customEdit: {
329
+ type: Boolean,
330
+ default: false
331
+ },
332
+ // 是否自定义增加按钮
333
+ customMove: {
334
+ type: Boolean,
335
+ default: false
336
+ },
337
+ // 自适应底部边距
338
+ extraHeight: {
339
+ type: Number,
340
+ default: 80
341
+ }
342
+ },
343
+ watch: {
344
+ logicParam: {
345
+ handler () {
346
+ this.initConfig()
347
+ },
348
+ deep: true
349
+ },
350
+ queryParamsJson: {
351
+ handler () {
352
+ this.initConfig()
353
+ },
354
+ deep: true
355
+ },
356
+ queryParamsName: {
357
+ handler () {
358
+ this.initConfig()
359
+ }
360
+ },
361
+ serviceName: {
362
+ handler () {
363
+ this.initConfig()
364
+ }
365
+ }
366
+ },
367
+ methods: {
368
+ runLogic,
369
+ getRealKeyData,
370
+ getConfigByNameAsync,
371
+ getConfigByName,
372
+ customEvent (func, data) {
373
+ this.$emit(func, data)
374
+ },
375
+ columnClick (key, value, record) {
376
+ this.$emit('columnClick', key, value, record)
377
+ },
378
+ gotoUserDetail (key, value, record) {
379
+ this.$refs.userInfo.init(getRealKeyData(record))
380
+ },
381
+ // 获取主表的数据内容,去掉主表别名
382
+ getPrimaryData (rows) {
383
+ const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
384
+ const prefix = `${alias}_` // 构建前缀
385
+ const result = []
386
+
387
+ // 遍历 rows 的每一项,提取符合条件的数据
388
+ rows.forEach(row => {
389
+ const itemResult = {}
390
+ Object.keys(row).forEach(key => {
391
+ if (key.startsWith(prefix)) {
392
+ const newKey = key.slice(prefix.length) // 去掉前缀
393
+ itemResult[newKey] = row[key] // 添加到结果对象中
394
+ }
395
+ })
396
+ result.push(itemResult) // 将处理后的项添加到结果数组中
397
+ })
398
+
399
+ return result // 返回去掉前缀后的对象数组
400
+ },
401
+
402
+ // 给数据区域添加主表数据,给的数据没有主表别名,放着时添加主表别名
403
+ pushPrimaryData (rows) {
404
+ const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
405
+ const prefix = `${alias}_` // 构建前缀
406
+ const result = rows.map(row => {
407
+ const itemResult = {}
408
+ Object.keys(row).forEach(key => {
409
+ itemResult[prefix + key] = row[key] // 复制原始数据
410
+ })
411
+ return itemResult // 返回添加了主表别名的数据
412
+ })
413
+ // 把结果添加到数据区
414
+ this.getTableData().push(...result)
415
+ },
416
+
417
+ // 设置固定查询条件,主表别名自动带
418
+ setFixedQueryForm (data) {
419
+ const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
420
+ const prefixedData = {}
421
+
422
+ // 为每个键添加主表别名
423
+ Object.keys(data).forEach(key => {
424
+ prefixedData[`${alias}_${key}`] = data[key]
425
+ })
426
+
427
+ Object.assign(this.fixedQueryForm, prefixedData)
428
+ },
429
+
430
+ importExcelOk (data) {
431
+ this.$emit('importExcelOk', data)
432
+ },
433
+ initConfig () {
434
+ this.loading = true
435
+ this.loadError = false
436
+ if (this.queryParamsName) {
437
+ this.getConfig()
438
+ } else if (this.queryParamsJson) {
439
+ this.getConfigBySource()
440
+ } else if (this.logicName && this.logicParam) {
441
+ this.getColumnJsonByLogic()
442
+ } else {
443
+ this.loading = false
444
+ this.loadError = true
445
+ }
446
+ },
447
+
448
+ getConfig () {
449
+ getConfigByName(this.queryParamsName, this.serviceName, (res) => {
450
+ if (!res) {
451
+ this.loading = false
452
+ this.loadError = true
453
+ return
454
+ }
455
+ this.updateComponents(res)
456
+ }, this.env === 'dev')
457
+ },
458
+ getConfigBySource () {
459
+ parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
460
+ if (!res) {
461
+ this.loading = false
462
+ this.loadError = true
463
+ return
464
+ }
465
+ this.updateComponents(res, true)
466
+ })
467
+ },
468
+ getColumnJsonByLogic () {
469
+ getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
470
+ if (!res) {
471
+ this.loading = false
472
+ this.loadError = true
473
+ return
474
+ }
475
+ this.updateComponents(res, true)
476
+ }, this.env === 'dev')
477
+ },
478
+
479
+ /**
480
+ * 更新子组件
481
+ * @param res 参数
482
+ * @param setQueryParams 是否设置queryParams参数
483
+ */
484
+ updateComponents (res, setQueryParams) {
485
+ this.realQueryConfig = res
486
+ if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
487
+ // 设置添加按钮对应的配置名
488
+ this.moveconfig = res.moveconfig
489
+ this.showPagination = res.showPagination === null ? true : res.showPagination
490
+ // 是否展示排序按钮控制
491
+ if (res.showSortIcon !== null && !res.showSortIcon) {
492
+ res.columnJson.forEach(item => {
493
+ item.sorter = false
494
+ })
495
+ }
496
+ const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
497
+ const initTable = () => {
498
+ // 初始化 xTable 子组件
499
+ this.$refs.xTable.init({
500
+ formItems: res.formJson,
501
+ queryParams: setQueryParams ? res : null,
502
+ tableColumns: res.columnJson,
503
+ buttonState: Object.assign(res.buttonState, this.buttonState),
504
+ title: this.title || res.title,
505
+ viewMode: this.viewMode,
506
+ localEditMode: localEditMode,
507
+ rowSelectMode: this.rowSelectMode,
508
+ allowSelectRowNum: this.allowSelectRowNum,
509
+ tableSummaryMap: res.tableSummaryMap,
510
+ serviceName: this.serviceName,
511
+ env: this.env,
512
+ form: this.$refs.xForm.form,
513
+ summaryUpdate: true,
514
+ ...res
515
+ })
516
+ if (this.realQueryConfig?.funcData?.pageMounted) {
517
+ executeStrFunctionByContext(this, this.realQueryConfig.funcData.pageMounted, [util, runLogic, getConfigByNameAsync])
518
+ }
519
+ }
520
+ // 初始化 xForm 子组件
521
+ if (!localEditMode && !this.rowSelectMode) {
522
+ this.$refs.xForm.init({
523
+ queryParamsName: this.queryParamsName || 'localConfig',
524
+ formItems: res.formJson,
525
+ serviceName: this.serviceName,
526
+ getDataParams: this.getDataParams,
527
+ simpleMode: res.simpleMode,
528
+ funcData: res.funcData,
529
+ env: this.env
530
+ })
531
+ } else {
532
+ // TODO 此处应删除
533
+ initTable()
534
+ }
535
+ // 初始化 xTable 子组件
536
+ // 等待 x-from-item 的 mounted 完成
537
+ this.$refs.xForm.$on('itemsMounted', initTable)
538
+ }
539
+ this.loading = false
540
+ },
541
+ // 自定义按钮
542
+ editButtonStateDataClick (functionName, rows) {
543
+ console.log('functionName', functionName)
544
+ console.log('rows', rows)
545
+ this.$emit(functionName, rows)
546
+ },
547
+
548
+ /**
549
+ * 提交查询表单事件
550
+ * @param res 参数
551
+ */
552
+ onSearchSubmit (res) {
553
+ if (res.valid) {
554
+ // 表单赋值
555
+ this.$refs.xTable.setQueryForm(res.form)
556
+ this.$refs.xTable.summaryUpdate = true
557
+ // commit
558
+ this.$emit('afterSearchSubmit', res)
559
+ } else {
560
+ return false
561
+ }
562
+ },
563
+ active (props) {
564
+ let num = false
565
+ for (const key in props) {
566
+ // eslint-disable-next-line no-prototype-builtins
567
+ if (this.$props.hasOwnProperty(key)) {
568
+ if (this.$props[key] instanceof Object) {
569
+ this.$props[key] = JSON.parse(props[key])
570
+ } else {
571
+ this.$props[key] = props[key]
572
+ }
573
+ num = true
574
+ }
575
+ }
576
+ if (num) {
577
+ this.initConfig()
578
+ }
579
+ },
580
+ /**
581
+ * 提交新增/修改表单后事件
582
+ */
583
+ onAddOrEditSubmitAfterSubmit (res) {
584
+ this.refreshTable(res.businessType === '新增')
585
+ // commit
586
+ this.$emit('afterSubmit', res)
587
+ },
588
+ /**
589
+ * 表格查询后事件
590
+ * @param res 参数
591
+ * @param conditionParams 查询条件
592
+ */
593
+ afterQuery (res, conditionParams) {
594
+ this.$emit('afterQuery', res, conditionParams)
595
+ },
596
+ /**
597
+ * 详情按钮事件
598
+ * @param record 本条数据
599
+ * @param id 数据标识
600
+ * @param actionType 操作类型
601
+ * @param fun 向上级传递的事件
602
+ */
603
+ action (record, id, actionType, fun = 'action', index) {
604
+ this.$emit(fun, record, id, actionType, index)
605
+ },
606
+ treeOnChecked (checkedKeys, deepNodes, deepKeys) {
607
+ this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
608
+ },
609
+ treeBtnFuncClick (index, func) {
610
+ this.$emit('treeBtnFuncClick', index, func)
611
+ },
612
+ /**
613
+ * 新增按钮事件
614
+ */
615
+ add () {
616
+ if (this.customAdd) {
617
+ this.$emit('add')
618
+ } else {
619
+ if (this.$listeners.curdAddBefore) {
620
+ this.$emit('curdAddBefore', this.addFormInit)
621
+ } else {
622
+ this.addFormInit()
623
+ }
624
+ }
625
+ },
626
+ addFormInit () {
627
+ const res = this.realQueryConfig
628
+ const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
629
+ this.$refs.xAddForm.init({
630
+ businessType: '新增',
631
+ title: this.title || res.title,
632
+ isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
633
+ configName: this.queryParamsName,
634
+ configContent: this.queryParamsJson,
635
+ formItems: res.formJson,
636
+ viewMode: this.viewMode,
637
+ localEditMode: localEditMode,
638
+ isKeyHandle: !Boolean(localEditMode),
639
+ serviceName: this.serviceName,
640
+ fixedAddForm: this.fixedAddForm,
641
+ getDataParams: this.getDataParams,
642
+ layout: res.xAddFormLayout || 'horizontal',
643
+ xAddFormLayoutWidth: res.xAddFormLayoutWidth,
644
+ formItemLayout: res.formItemLayout || {},
645
+ env: this.env
646
+ })
647
+ },
648
+ /**
649
+ * 添加按钮事件
650
+ */
651
+ move () {
652
+ this.moveType = true
653
+ this.$nextTick(
654
+ () => {
655
+ this.$refs.xAddReport.init({
656
+ configName: this.moveconfig,
657
+ selectedId: this.fixedAddForm.selected_id
658
+ })
659
+ }
660
+ )
661
+ },
662
+ /**
663
+ * 修改按钮事件
664
+ * @param modifyModelData 修改表单数据
665
+ */
666
+ edit (modifyModelData) {
667
+ if (this.customEdit) {
668
+ this.$emit('edit')
669
+ } else {
670
+ const res = this.realQueryConfig
671
+ const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
672
+ this.$refs.xAddForm.init({
673
+ businessType: '修改',
674
+ title: this.title || res.title,
675
+ isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
676
+ configName: this.queryParamsName,
677
+ configContent: this.queryParamsJson,
678
+ formItems: res.formJson,
679
+ viewMode: this.viewMode,
680
+ localEditMode: localEditMode,
681
+ isKeyHandle: !Boolean(localEditMode),
682
+ serviceName: this.serviceName,
683
+ fixedAddForm: this.fixedAddForm,
684
+ getDataParams: this.getDataParams,
685
+ modifyModelData: modifyModelData,
686
+ layout: res.xAddFormLayout || 'horizontal',
687
+ env: this.env
688
+ })
689
+ }
690
+ },
691
+ /**
692
+ * 删除按钮事件
693
+ */
694
+ del (keys, callback) {
695
+ if (this.customDelete) {
696
+ this.$emit('del', keys, callback)
697
+ }
698
+ },
699
+ /**
700
+ * 删除后事件
701
+ * @param res
702
+ */
703
+ afterDelete (res) {
704
+ this.$emit('afterDelete', res)
705
+ },
706
+ /**
707
+ * 行选择事件
708
+ * @param row 选中行
709
+ */
710
+ rowChoose (row) {
711
+ this.$emit('rowChoose', row)
712
+ },
713
+ /**
714
+ * 本地编辑模式下校验表格并同步本地数据
715
+ * @param currRow 当前行
716
+ * @param defaultAppendRowData 默认追加的行数据
717
+ */
718
+ validateTableAndSyncData (currRow, defaultAppendRowData) {
719
+ this.$refs.xTable.validateTableAndSyncData(currRow, defaultAppendRowData)
720
+ },
721
+ /**
722
+ * 更多条件是否展示
723
+ */
724
+ toggleAdvanced () {
725
+ this.$refs.xTable.setScrollYHeight({})
726
+ },
727
+ /**
728
+ * 查询表单部分显示/隐藏切换
729
+ */
730
+ toggleIsFormShow () {
731
+ this.toggleIsFormIcon = this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
732
+ this.$refs.xForm.toggleVisible()
733
+ this.$refs.xTable.setScrollYHeight({})
734
+ },
735
+ /**
736
+ * 选择列事件
737
+ * @param selectedRowKeys 选中列Key集合
738
+ * @param selectedRows 选中列
739
+ */
740
+ selectRow (selectedRowKeys, selectedRows) {
741
+ this.table_selectedRowKeys = selectedRowKeys
742
+ this.table_selectedRows = selectedRows
743
+ this.$emit('selectRow', selectedRowKeys, selectedRows)
744
+ },
745
+ /**
746
+ * 清除勾选数据
747
+ */
748
+ clearRowKeys () {
749
+ this.$refs.xTable.clearRowKeys()
750
+ },
751
+ /**
752
+ * 刷新表格
753
+ * @param toFirstPage 是否到第一页
754
+ */
755
+ refreshTable (toFirstPage = true) {
756
+ this.$refs.xTable.refresh(toFirstPage)
757
+ },
758
+ /**
759
+ * 刷新表格
760
+ * @param toFirstPage 是否到第一页
761
+ */
762
+ refresh (toFirstPage = true) {
763
+ this.$refs.xTable.refresh(toFirstPage)
764
+ },
765
+ /**
766
+ * 获取表格数据
767
+ */
768
+ getTableData () {
769
+ return this.$refs.xTable.getTableData()
770
+ },
771
+ // 在行编辑等情况下,让界面生效
772
+ update () {
773
+ this.getTableData().push(...[])
774
+ },
775
+
776
+ /**
777
+ * 设置表格数据
778
+ */
779
+ setTableData (data) {
780
+ this.$refs.xTable.setTableData(data)
781
+ },
782
+ /**
783
+ * 表单本地提交
784
+ */
785
+ onLocalSubmit (res, callback) {
786
+ const form = res.realForm
787
+ if (res.businessType === '新增') {
788
+ this.$refs.xTable.appendLocalData(form)
789
+ } else {
790
+ this.$refs.xTable.modifyLocalData(form['序号'], form)
791
+ }
792
+ this.$message.success(res.businessType + '成功!')
793
+ this.onAddOrEditSubmitAfterSubmit(res, callback)
794
+ if (callback) {
795
+ callback()
796
+ }
797
+ },
798
+ emitFunc (func, data, value) {
799
+ this.$emit(func, data, value)
800
+ },
801
+ // 直接转发事件的函数
802
+ emitEvent (event, ...args) {
803
+ this.$emit(event, ...args)
804
+ }
805
+ },
806
+ action: {
807
+ /**
808
+ * 实现doAction方法
809
+ */
810
+ doAction (actionType, args, data) {
811
+ switch (actionType) {
812
+ case 'refreshTable':
813
+ for (const item in args) {
814
+ console.log('item', item)
815
+ }
816
+ break
817
+ default:
818
+ break
819
+ }
820
+ }
821
+ },
822
+ mounted () {
823
+ this.initConfig()
824
+ if (this.getSelectedData && typeof this.getSelectedData === 'function') {
825
+ const selectedId = this.getSelectedData()
826
+ if (!selectedId) {
827
+ return
828
+ }
829
+ if (typeof selectedId === 'object') {
830
+ const data = JSON.parse(JSON.stringify(selectedId))
831
+ if (data.selectedId) {
832
+ data.selected_id = data.selectedId
833
+ delete data.selectedId
834
+ }
835
+ Object.assign(this.fixedAddForm, data)
836
+ Object.assign(this.fixedQueryForm, data)
837
+ } else {
838
+ Object.assign(this.fixedAddForm, { selected_id: selectedId })
839
+ Object.assign(this.fixedQueryForm, { selected_id: selectedId })
840
+ }
841
+ }
842
+ }
843
+ }
844
+ </script>
845
+ <style lang="less" scoped>
846
+ .crud_title {
847
+ height: 32px;
848
+ font-size: 16px;
849
+ font-weight: 500;
850
+ color: #000000d9;
851
+ line-height: 32px;
852
+ margin-bottom: 12px;
853
+ }
854
+ </style>