vue2-client 1.17.44 → 1.17.46

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 (351) hide show
  1. package/.claude/settings.local.json +20 -20
  2. package/.cursorrules +19 -19
  3. package/.env.apply +19 -19
  4. package/.env.gaslink +19 -19
  5. package/.env.his +19 -19
  6. package/.env.liuli +20 -20
  7. package/.env.scada +19 -19
  8. package/.eslintrc.js +90 -90
  9. package/.serena/memories/code_style_conventions.md +217 -217
  10. package/.serena/memories/project_overview.md +54 -54
  11. package/.serena/memories/project_structure.md +329 -329
  12. package/.serena/memories/suggested_commands.md +127 -127
  13. package/.serena/memories/task_completion_checklist.md +183 -183
  14. package/.serena/memories/tech_stack.md +94 -94
  15. package/CHANGELOG.md +830 -830
  16. package/CLAUDE.md +97 -97
  17. package/Components.md +60 -60
  18. package/docs/LowCode/lowcode.md +155 -155
  19. package/docs/LowCode/lowcodeForDeveloper.md +230 -230
  20. package/docs/index.md +30 -30
  21. package/index.js +31 -31
  22. package/jest-transform-stub.js +8 -8
  23. package/jest.setup.js +7 -7
  24. package/jsconfig.json +19 -19
  25. package/package.json +1 -1
  26. package/public/his/editor/editor.html +51 -51
  27. package/public/his/editor/mock/bind_data.html +779 -779
  28. package/public/his/editor/mock/data_table.html +40 -40
  29. package/public/his/editor/mock/sign.html +75 -75
  30. package/public/his/editor/vender/JsBarcode.all.js +3669 -3669
  31. package/public/his/editor/vender/date97/My97DatePicker.htm +65 -65
  32. package/public/his/editor/vender/date97/WdatePicker.js +677 -677
  33. package/public/his/editor/vender/date97/calendar.js +4 -4
  34. package/public/his/editor/vender/date97/lang/en.js +13 -13
  35. package/public/his/editor/vender/date97/lang/zh-cn.js +13 -13
  36. package/public/his/editor/vender/date97/lang/zh-tw.js +13 -13
  37. package/public/his/editor/vender/date97/skin/WdatePicker.css +10 -10
  38. package/public/his/editor/vender/date97/skin/default/datepicker.css +328 -328
  39. package/public/his/editor/vender/date97/skin/ext/datepicker.css +308 -308
  40. package/public/his/editor/vender/date97/skin/whyGreen/datepicker.css +255 -255
  41. package/public/his/editor/vender/diff.js +1627 -1627
  42. package/public/his/editor/vender/editor.js +1 -1
  43. package/public/his/editor/vender/fabric.js +31187 -31187
  44. package/public/his/editor/vender/jquery/jquery.base64.js +190 -190
  45. package/public/his/editor/vender/jquery/jquery.js +10872 -10872
  46. package/public/his/editor/vender/jquery/jquery.print.js +255 -255
  47. package/public/his/editor/vender/jquery/zTreeStyle/zTreeStyle.css +96 -96
  48. package/public/his/editor/vender/mui/mui.min.css +4 -4
  49. package/public/his/editor/vender/mui/mui.min.js +5 -5
  50. package/public/his/editor/vender/mui/mui.picker.min.css +6 -6
  51. package/public/his/editor/vender/mui/mui.picker.min.js +6 -6
  52. package/public/his/editor/vender/qrcode.js +7 -7
  53. package/public/his/editor/vender/requirejs/require.js +2145 -2145
  54. package/public/his/editor/vender/signature/jSignature.CompressorSVG.js +518 -518
  55. package/public/his/editor/vender/signature/jSignature.UndoButton.js +164 -164
  56. package/public/his/editor/vender/signature/jSignature.js +1486 -1486
  57. package/public/his/editor/vender/validator.js +5094 -5094
  58. package/public/his/editor/vender/weui/weui.css +5659 -5659
  59. package/public/his/editor/vender/weui/weui.min.css +4 -4
  60. package/public/his/editor/vender/weui/weui.min.js +11 -11
  61. package/src/assets/img/paymentMethod/package.info +1 -1
  62. package/src/assets/img/querySlotDemo.svg +15 -15
  63. package/src/assets/svg/badtwo.svg +1 -1
  64. package/src/assets/svg/female.svg +1 -1
  65. package/src/assets/svg/goodtwo.svg +1 -1
  66. package/src/assets/svg/male.svg +1 -1
  67. package/src/base-client/components/AI/AskAiBtn.vue +136 -136
  68. package/src/base-client/components/AI/demo.vue +31 -31
  69. package/src/base-client/components/common/AddressSearchCombobox/IcMapIcon.vue +16 -16
  70. package/src/base-client/components/common/AddressSearchCombobox/demo.vue +36 -36
  71. package/src/base-client/components/common/AddressSearchCombobox/ic_map.svg +6 -6
  72. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
  73. package/src/base-client/components/common/CitySelect/index.js +3 -3
  74. package/src/base-client/components/common/CitySelect/index.md +109 -109
  75. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
  76. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1014 -1014
  77. package/src/base-client/components/common/CreateQuery/index.js +3 -3
  78. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  79. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +452 -452
  80. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +511 -511
  81. package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
  82. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  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/HIS/HButtons/HButtons.vue +491 -491
  89. package/src/base-client/components/common/HIS/HFormGroup/index.js +3 -3
  90. package/src/base-client/components/common/HIS/HTab/HTab.vue +443 -443
  91. package/src/base-client/components/common/HIS/demo.vue +61 -61
  92. package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
  93. package/src/base-client/components/common/LowCodeComponent/LowCodeEditorModal.vue +108 -108
  94. package/src/base-client/components/common/LowCodeComponent/LowCodeEditorPanel.vue +413 -413
  95. package/src/base-client/components/common/LowCodeComponent/LowCodePageOrganization.vue +502 -502
  96. package/src/base-client/components/common/LowCodeComponent/LowCodeRender.vue +728 -728
  97. package/src/base-client/components/common/LowCodeComponent/LowCodeRenderEnter.vue +29 -29
  98. package/src/base-client/components/common/LowCodeComponent/LowCodeUIStore.vue +219 -219
  99. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeAddPageModal.vue +117 -117
  100. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeCustomJSModal.vue +80 -80
  101. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeEventEditorModal.vue +398 -398
  102. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLifeCycleModal.vue +65 -65
  103. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicCallbackModal.vue +64 -64
  104. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicParamModal.vue +73 -73
  105. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeRunFunctionParamModal.vue +76 -76
  106. package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
  107. package/src/base-client/components/common/PersonSetting/index.js +3 -3
  108. package/src/base-client/components/common/Recording/Recording.vue +243 -243
  109. package/src/base-client/components/common/Recording/index.js +3 -3
  110. package/src/base-client/components/common/Tree/Tree.vue +149 -149
  111. package/src/base-client/components/common/Tree/index.js +2 -2
  112. package/src/base-client/components/common/Upload/index.js +3 -3
  113. package/src/base-client/components/common/XAddForm/XAddForm.vue +113 -113
  114. package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
  115. package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +304 -304
  116. package/src/base-client/components/common/XAddNativeFormOA/index.js +3 -3
  117. package/src/base-client/components/common/XAddNativeFormOA/index.md +146 -146
  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/index.js +3 -3
  123. package/src/base-client/components/common/XButtons/index.md +61 -61
  124. package/src/base-client/components/common/XCalendar/XCalendar.vue +4 -4
  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/XCollapse/XCollapse.vue +830 -830
  129. package/src/base-client/components/common/XDataCard/index.js +3 -3
  130. package/src/base-client/components/common/XDataCard/index.md +1 -1
  131. package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
  132. package/src/base-client/components/common/XDataDrawer/index.js +3 -3
  133. package/src/base-client/components/common/XDataDrawer/index.md +41 -41
  134. package/src/base-client/components/common/XDatePicker/demo.vue +153 -153
  135. package/src/base-client/components/common/XDescriptions/index.js +3 -3
  136. package/src/base-client/components/common/XDescriptions/index.md +83 -83
  137. package/src/base-client/components/common/XDetailsView/XDetailsView.vue +238 -238
  138. package/src/base-client/components/common/XDetailsView/index.js +3 -3
  139. package/src/base-client/components/common/XForm/XStatusButton.vue +54 -54
  140. package/src/base-client/components/common/XForm/index.md +178 -178
  141. package/src/base-client/components/common/XForm/itemComponent/XClickChangeBtn/index.vue +49 -49
  142. package/src/base-client/components/common/XFormGroup/index.js +3 -3
  143. package/src/base-client/components/common/XFormGroup/index.md +38 -38
  144. package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
  145. package/src/base-client/components/common/XFormTable/XFormTable.vue +1093 -1093
  146. package/src/base-client/components/common/XFormTable/demo.vue +113 -113
  147. package/src/base-client/components/common/XFormTable/index.md +92 -92
  148. package/src/base-client/components/common/XLabelSelect/XLabelSelect.vue +110 -110
  149. package/src/base-client/components/common/XLabelSelect/XLabelSelectDemo.vue +35 -35
  150. package/src/base-client/components/common/XLicensePlate/XLicensePlate.vue +193 -193
  151. package/src/base-client/components/common/XLicensePlate/XLicensePlateDemo.vue +48 -48
  152. package/src/base-client/components/common/XPrint/OpenInvoice.vue +21 -21
  153. package/src/base-client/components/common/XPrint/PrintHtml.js +98 -98
  154. package/src/base-client/components/common/XPrint/css/hiPrintCss.js +359 -359
  155. package/src/base-client/components/common/XPrint/css/lodopCss.js +26 -26
  156. package/src/base-client/components/common/XPrint/css/print-lock.css +351 -351
  157. package/src/base-client/components/common/XPrint/index.vue +97 -97
  158. package/src/base-client/components/common/XReport/XReportDesign.vue +463 -463
  159. package/src/base-client/components/common/XReport/XReportJsonRender.vue +381 -381
  160. package/src/base-client/components/common/XReport/index.js +3 -3
  161. package/src/base-client/components/common/XReport/print.js +186 -186
  162. package/src/base-client/components/common/XReportDrawer/index.js +3 -3
  163. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +6 -3
  164. package/src/base-client/components/common/XReportGrid/index.js +3 -3
  165. package/src/base-client/components/common/XReportGrid/index.md +44 -44
  166. package/src/base-client/components/common/XReportSlot/XReportSlot.vue +110 -110
  167. package/src/base-client/components/common/XReportSlot/index.js +3 -3
  168. package/src/base-client/components/common/XReportSlot/index.md +48 -48
  169. package/src/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue +166 -166
  170. package/src/base-client/components/common/XSimpleDescriptions/index.js +3 -3
  171. package/src/base-client/components/common/XSimpleDescriptions/index.md +7 -7
  172. package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
  173. package/src/base-client/components/common/XStepView/index.js +3 -3
  174. package/src/base-client/components/common/XStepView/index.md +31 -31
  175. package/src/base-client/components/common/XTab/XTabDemo.vue +22 -22
  176. package/src/base-client/components/common/XTab/index.js +3 -3
  177. package/src/base-client/components/common/XTable/CustomFuncCel.vue +51 -51
  178. package/src/base-client/components/common/XTable/TableCellRenderer.vue +161 -161
  179. package/src/base-client/components/common/XTable/XTableWrapper.vue +732 -732
  180. package/src/base-client/components/common/XTable/index.md +255 -255
  181. package/src/base-client/components/common/XTagGroup/index.vue +52 -52
  182. package/src/base-client/components/common/XTimeline/XTimeline.vue +477 -477
  183. package/src/base-client/components/common/XTree/XTree.vue +424 -424
  184. package/src/base-client/components/common/XTree/index.js +3 -3
  185. package/src/base-client/components/common/XTree/index.md +36 -36
  186. package/src/base-client/components/common/XTreeOne/XTreeOne.vue +113 -113
  187. package/src/base-client/components/common/XTreeOne/XTreeOnePro.vue +128 -128
  188. package/src/base-client/components/common/richTextModal/index.vue +56 -56
  189. package/src/base-client/components/common/richTextModal/richDemo.vue +48 -48
  190. package/src/base-client/components/his/XCharge/XChargeDemo.vue +145 -145
  191. package/src/base-client/components/his/XHisEditor/XHisEditor.vue +705 -705
  192. package/src/base-client/components/his/XHisEditor/index.js +3 -3
  193. package/src/base-client/components/his/XList/XList.vue +938 -938
  194. package/src/base-client/components/his/XSidebar/XSidebar.vue +1 -1
  195. package/src/base-client/components/his/XTimeSelect/XTimeSelect.vue +354 -354
  196. package/src/base-client/components/his/XTitle/XTitle.vue +314 -314
  197. package/src/base-client/components/his/XTreeRows/XTreeRows.vue +341 -341
  198. package/src/base-client/components/his/threeTestOrders/editor.vue +113 -113
  199. package/src/base-client/components/index.js +51 -51
  200. package/src/base-client/components/layout/XTreeView/XTreeView.vue +130 -130
  201. package/src/base-client/components/layout/XTreeView/index.js +3 -3
  202. package/src/base-client/components/layout/XTreeView/index.md +46 -46
  203. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  204. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  205. package/src/base-client/plugins/Config.js +19 -19
  206. package/src/base-client/plugins/GetLoginInfoService.js +183 -183
  207. package/src/base-client/plugins/Recording.js +258 -258
  208. package/src/base-client/plugins/index.js +23 -23
  209. package/src/base-client/plugins/tabs-page-plugin.js +39 -39
  210. package/src/components/Charts/Bar.vue +62 -62
  211. package/src/components/Charts/ChartCard.vue +134 -134
  212. package/src/components/Charts/Liquid.vue +67 -67
  213. package/src/components/Charts/MiniArea.vue +39 -39
  214. package/src/components/Charts/MiniBar.vue +39 -39
  215. package/src/components/Charts/MiniProgress.vue +75 -75
  216. package/src/components/Charts/MiniSmoothArea.vue +40 -40
  217. package/src/components/Charts/Radar.vue +68 -68
  218. package/src/components/Charts/RankList.vue +77 -77
  219. package/src/components/Charts/TagCloud.vue +113 -113
  220. package/src/components/Charts/TransferBar.vue +64 -64
  221. package/src/components/Charts/Trend.vue +82 -82
  222. package/src/components/Charts/chart.less +12 -12
  223. package/src/components/Charts/smooth.area.less +13 -13
  224. package/src/components/CodeMirror/inedx.vue +118 -118
  225. package/src/components/CodeMirror/setting.js +40 -40
  226. package/src/components/NumberInfo/NumberInfo.vue +54 -54
  227. package/src/components/NumberInfo/index.js +3 -3
  228. package/src/components/NumberInfo/index.less +54 -54
  229. package/src/components/NumberInfo/index.md +43 -43
  230. package/src/components/card/ChartCard.vue +79 -79
  231. package/src/components/chart/Bar.vue +60 -60
  232. package/src/components/chart/MiniArea.vue +67 -67
  233. package/src/components/chart/MiniBar.vue +59 -59
  234. package/src/components/chart/MiniProgress.vue +57 -57
  235. package/src/components/chart/Radar.vue +80 -80
  236. package/src/components/chart/RankingList.vue +60 -60
  237. package/src/components/chart/Trend.vue +79 -79
  238. package/src/components/chart/index.less +9 -9
  239. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  240. package/src/components/checkbox/ImgCheckbox.vue +117 -117
  241. package/src/components/checkbox/ImgCheckboxGroup.vue +76 -76
  242. package/src/components/checkbox/index.js +9 -9
  243. package/src/components/exception/ExceptionPage.vue +70 -70
  244. package/src/components/g2Charts/constants.js +202 -202
  245. package/src/components/g2Charts/demo.vue +808 -808
  246. package/src/components/g2Charts/designer.vue +228 -228
  247. package/src/components/g2Charts/designerBaseConfig.vue +61 -61
  248. package/src/components/g2Charts/designerDataConfig.vue +259 -259
  249. package/src/components/g2Charts/designerStyleConfig.vue +16 -16
  250. package/src/components/g2Charts/index.vue +397 -397
  251. package/src/components/index.js +36 -36
  252. package/src/components/input/IInput.vue +66 -66
  253. package/src/components/menu/SideMenu.vue +75 -75
  254. package/src/components/menu/menu.js +273 -273
  255. package/src/components/setting/Setting.vue +234 -234
  256. package/src/components/tool/AStepItem.vue +60 -60
  257. package/src/config/CreateQueryConfig.js +325 -325
  258. package/src/config/default/antd.config.js +89 -89
  259. package/src/config/default/setting.config.js +55 -55
  260. package/src/font-style/font.css +60 -60
  261. package/src/layouts/CommonLayout.vue +56 -56
  262. package/src/layouts/PageLayout.vue +151 -151
  263. package/src/layouts/SinglePageView.vue +136 -136
  264. package/src/layouts/header/AdminHeader.vue +132 -132
  265. package/src/layouts/header/HeaderNotice.vue +177 -177
  266. package/src/layouts/header/InstitutionDetail.vue +181 -181
  267. package/src/layouts/tabs/TabsHead.vue +189 -189
  268. package/src/lib.js +1 -1
  269. package/src/mock/extend/index.js +84 -84
  270. package/src/mock/goods/index.js +108 -108
  271. package/src/pages/DefaultExample/index.vue +77 -77
  272. package/src/pages/DynamicStatistics/ChartSelector.vue +331 -331
  273. package/src/pages/DynamicStatistics/DataTabs.vue +83 -83
  274. package/src/pages/DynamicStatistics/DynamicTable.vue +128 -128
  275. package/src/pages/DynamicStatistics/EvaluationArea.vue +69 -69
  276. package/src/pages/DynamicStatistics/FavoriteList.vue +50 -50
  277. package/src/pages/DynamicStatistics/QuestionHistoryAndFavorites.vue +591 -591
  278. package/src/pages/DynamicStatistics/SearchBar.vue +192 -192
  279. package/src/pages/DynamicStatistics/index.vue +282 -282
  280. package/src/pages/Example/childIndex.vue +15 -15
  281. package/src/pages/Example/index.vue +30 -30
  282. package/src/pages/NewDynamicStatistics/ChartSelector.vue +331 -331
  283. package/src/pages/NewDynamicStatistics/DataTabs.vue +122 -122
  284. package/src/pages/NewDynamicStatistics/DynamicTable.vue +128 -128
  285. package/src/pages/NewDynamicStatistics/EvaluationArea.vue +69 -69
  286. package/src/pages/NewDynamicStatistics/FavoriteList.vue +50 -50
  287. package/src/pages/NewDynamicStatistics/QuestionHistoryAndFavorites.vue +289 -289
  288. package/src/pages/NewDynamicStatistics/SearchBar.vue +193 -193
  289. package/src/pages/NewDynamicStatistics/index.vue +258 -258
  290. package/src/pages/Recording/index.vue +77 -77
  291. package/src/pages/ServiceReview/index.vue +284 -284
  292. package/src/pages/SubExample/index.vue +26 -26
  293. package/src/pages/WorkflowDetail/WorkflowPageDetail/TrimTextTail.vue +23 -23
  294. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +1815 -1815
  295. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +1014 -1014
  296. package/src/pages/XReportView/index.vue +64 -64
  297. package/src/pages/XTreeOneProExample/index.vue +67 -67
  298. package/src/pages/dashboard/workplace/WorkPlace.vue +141 -141
  299. package/src/pages/login/Login.vue +379 -379
  300. package/src/pages/login/LoginV3.vue +389 -389
  301. package/src/pages/lowCode/lowCodeEditor.vue +1219 -1219
  302. package/src/pages/lowCode/lowCodeRenderPage.vue +43 -43
  303. package/src/pages/report/ReportTable.js +124 -124
  304. package/src/pages/resourceManage/orgListManage.vue +98 -98
  305. package/src/pages/system/dictionary/index.vue +44 -44
  306. package/src/pages/system/monitor/loginInfor/index.vue +37 -37
  307. package/src/pages/system/monitor/operLog/index.vue +37 -37
  308. package/src/pages/system/settings/modifyPassword.vue +117 -117
  309. package/src/pages/system/ticket/index.vue +480 -480
  310. package/src/pages/system/ticket/submitTicketSuccess.vue +484 -484
  311. package/src/pages/userInfoDetailManage/ChangeMeterRecordQuery/index.vue +64 -64
  312. package/src/pages/userInfoDetailManage/ExceptionRecordQuery/index.vue +45 -45
  313. package/src/pages/userInfoDetailManage/InfoChangeRecordQuery/index.vue +64 -64
  314. package/src/pages/userInfoDetailManage/InstructRecordQuery/index.vue +64 -64
  315. package/src/pages/userInfoDetailManage/MeterParamRecordQuery/index.vue +64 -64
  316. package/src/pages/userInfoDetailManage/TransferRecordQuery/index.vue +66 -66
  317. package/src/pages/userInfoDetailManage/WatchCollectionRecordQuery/index.vue +64 -64
  318. package/src/plugins/EventLogPlugin.js +33 -33
  319. package/src/plugins/FindParentsData.js +17 -17
  320. package/src/services/DataModel.js +30 -30
  321. package/src/services/LodopFuncs.js +137 -137
  322. package/src/services/api/TicketDetailsViewApi.js +46 -46
  323. package/src/services/api/cas.js +79 -79
  324. package/src/services/api/entity.js +18 -18
  325. package/src/services/api/index.js +17 -17
  326. package/src/store/modules/account.js +121 -121
  327. package/src/store/modules/index.js +5 -5
  328. package/src/store/modules/lowCode.js +33 -33
  329. package/src/store/modules/setting.js +119 -119
  330. package/src/theme/default/style.less +58 -58
  331. package/src/theme/global.less +313 -313
  332. package/src/utils/authority-utils.js +85 -85
  333. package/src/utils/errorCode.js +6 -6
  334. package/src/utils/formatter.js +74 -74
  335. package/src/utils/htmlToPDF.js +108 -108
  336. package/src/utils/htmlToPDFApi.js +5 -5
  337. package/src/utils/login.js +188 -188
  338. package/src/utils/lowcode/lowcodeComponentMixin.js +120 -120
  339. package/src/utils/lowcode/lowcodeLog.js +29 -29
  340. package/src/utils/lowcode/lowcodeUtils.js +373 -373
  341. package/src/utils/lowcode/registerComponentForEditor.js +1 -1
  342. package/src/utils/lowcode/registerComponentForRender.js +11 -11
  343. package/src/utils/map-utils.js +47 -47
  344. package/src/utils/reg.js +95 -95
  345. package/src/utils/runEvalFunction.js +14 -14
  346. package/src/utils/theme-color-replacer-extend.js +92 -92
  347. package/src/utils/util.js +329 -329
  348. package/src/utils/waterMark.js +31 -31
  349. package/src-base-client/components/common/HIS/HForm/HForm.vue +347 -0
  350. package/src-base-client/components/common/XCollapse/XCollapse.vue +0 -0
  351. package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
@@ -1,1093 +1,1093 @@
1
- <template>
2
- <splitpanes
3
- class="default-theme"
4
- :horizontal="false"
5
- @resized="storePaneSize"
6
- >
7
- <pane
8
- :size="treeSize"
9
- :min-size="15"
10
- :max-size="40"
11
- v-if="xTreeConfigName">
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
- </pane>
21
- <pane
22
- :size="100 - treeSize"
23
- >
24
- <a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
25
- <a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
26
- <div v-show="!loading">
27
- <template v-if="!loadError">
28
- <x-add-form
29
- ref="xAddForm"
30
- @onLocalSubmit="onLocalSubmit"
31
- @x-form-item-emit-func="emitFunc"
32
- @afterSubmit="onAddOrEditSubmitAfterSubmit"
33
- >
34
- <template slot="groupFormItems" slot-scope="{form, model, rules, modifyModelData}">
35
- <slot
36
- name="groupFormItems"
37
- :form="form"
38
- :model="model"
39
- :rules="rules"
40
- :modifyModelData="modifyModelData"></slot>
41
- </template>
42
- </x-add-form>
43
- <x-add-report
44
- v-if="moveType"
45
- ref="xAddReport"
46
- >
47
- </x-add-report>
48
- <div v-if="crudTitle" class="crud_title">
49
- {{ crudTitle }}
50
- </div>
51
- <x-form
52
- ref="xForm"
53
- @x-form-item-emit-func="emitFunc"
54
- @toggleAdvanced="toggleAdvanced"
55
- @onSubmit="onSearchSubmit">
56
- <slot name="formBtnExpand"></slot>
57
- </x-form>
58
- <x-table
59
- ref="xTable"
60
- :fixedQueryForm="fixedQueryForm"
61
- :queryParamsName="queryParamsName"
62
- :query-params-json="queryParamsJson"
63
- :show-pagination="showPagination"
64
- :customDelete="customDelete"
65
- :extraHeight="extraHeight"
66
- :serviceName="serviceName"
67
- :pageMaxSize="realQueryConfig.queryPagesSize"
68
- :externalSelectedRowKeys="externalSelectedRowKeys"
69
- :customPagination="customPagination"
70
- :hiddenFunctionalArea="hiddenFunctionalArea"
71
- @x-form-item-emit-func="emitFunc"
72
- @add="add"
73
- @move="move"
74
- @edit="edit"
75
- @del="del"
76
- @rowChoose="rowChoose"
77
- @customEvent="customEvent"
78
- @afterDelete="afterDelete"
79
- @action="action"
80
- @selectRow="selectRow"
81
- @afterQuery="afterQuery"
82
- @columnClick="columnClick"
83
- @gotoUserDetail="gotoUserDetail"
84
- @editButtonStateDataClick="editButtonStateDataClick"
85
- @importExcelOk="importExcelOk"
86
- @rowClick="handleRowClick"
87
- @beforeDataChange="beforeDataChange"
88
- @expand="onExpand">
89
- <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
90
- <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
91
- </template>
92
- <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
93
- <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
94
- </template>
95
- <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
96
- <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
97
- <a-tooltip title="收起查询条件" placement="bottom">
98
- <a-button @click="toggleIsFormShow">
99
- <a-icon :style="iconStyle" :type="toggleIsFormIcon"/>
100
- </a-button>
101
- </a-tooltip>
102
- </template>
103
- <!-- 底部插槽 -->
104
- <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
105
- <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
106
- </template>
107
- <!-- excel导入说明插槽 -->
108
- <template #importExcelSlot>
109
- <slot name="importExcelSlot"></slot>
110
- </template>
111
- </x-table>
112
- </template>
113
- <template v-else>
114
- <a-empty>
115
- <span slot="description"> 页面配置不存在,请联系系统管理员</span>
116
- </a-empty>
117
- </template>
118
- </div>
119
- </pane>
120
- <UserInfoDetailManage ref="userInfo" @close="refresh(false)"/>
121
- </splitpanes>
122
- </template>
123
- <script>
124
- import XForm from '@vue2-client/base-client/components/common/XForm'
125
- import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
126
- import XAddReport from '@vue2-client/base-client/components/common/XAddReport'
127
- import XTable from '@vue2-client/base-client/components/common/XTable'
128
- import XTree from '@vue2-client/base-client/components/common/XTree'
129
- import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
130
- import { Splitpanes, Pane } from 'splitpanes'
131
- import 'splitpanes/dist/splitpanes.css'
132
- import {
133
- getConfigByName,
134
- getConfigByLogic,
135
- parseConfig, runLogic, getConfigByNameAsync,
136
- } from '@vue2-client/services/api/common'
137
- import { mapState } from 'vuex'
138
- import XTreePro from '@vue2-client/base-client/components/common/XTree/XTreePro.vue'
139
- import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
140
- import { getRealKeyData } from '@vue2-client/utils/util'
141
- import * as util from '@vue2-client/utils/util'
142
- import UserInfoDetailManage from '@vue2-client/pages/userInfoDetailManage/index.vue'
143
-
144
- export default {
145
- name: 'XFormTable',
146
- components: {
147
- UserInfoDetailManage,
148
- XTreePro,
149
- XTable,
150
- XForm,
151
- XTree,
152
- XAddForm,
153
- XAddReport,
154
- XImportExcel,
155
- Splitpanes,
156
- Pane
157
- },
158
- provide () {
159
- return {
160
- getSelf: () => this,
161
- emitEvent: this.emitEvent.bind(this)
162
- }
163
- },
164
- inject: {
165
- getSelectedId: {
166
- default: () => () => {
167
- console.warn('getSelectedId is not provided.')
168
- return null
169
- },
170
- },
171
- setGlobalData: {
172
- default: () => () => {
173
- console.warn('setGlobalData is not provided.')
174
- return null
175
- },
176
- },
177
- getGlobalData: {
178
- default: () => () => {
179
- console.warn('getGlobalData is not provided.')
180
- return null
181
- },
182
- },
183
- getSelectedData: {
184
- default: () => () => {
185
- console.warn('getSelectedData is not provided.')
186
- return null
187
- },
188
- },
189
- getMixinData: {
190
- default: () => () => {
191
- console.warn('getMixinData is not provided.')
192
- return {}
193
- },
194
- },
195
- getOutEnv: {
196
- default: () => () => {
197
- console.warn('getOutEnv is not provided.')
198
- return {}
199
- },
200
- },
201
- currUser: {
202
- default: () => {
203
- console.warn('currUser is not provided.')
204
- return { id: null, name: 'Guest' }
205
- },
206
- },
207
-
208
- /**
209
- * 祖先组件注入的自定义函数对象
210
- * 此对象包含祖先组件通过provide/inject机制注入的各种自定义函数
211
- * 子组件可以通过this.generalFunction来访问这些函数
212
- * 使用示例:
213
- * - this.generalFunction.handleCustomEvent(data)
214
- * - this.generalFunction.submitForm(formData)
215
- * - this.generalFunction.validateData(data)
216
- */
217
- generalFunction: {
218
- default: () => {
219
- console.warn('generalFunction is not provided.')
220
- return null
221
- }
222
- }
223
- },
224
- data () {
225
- return {
226
- // 加载状态
227
- loading: false,
228
- // 图标样式
229
- iconStyle: {
230
- position: 'relative',
231
- top: '1px'
232
- },
233
- loadError: false,
234
- moveType: false,
235
- // 添加按钮对应的配置名
236
- moveconfig: '',
237
- // 实际查询配置内容
238
- realQueryConfig: {},
239
- toggleIsFormIcon: 'vertical-align-top',
240
- table_selectedRowKeys: [],
241
- table_selectedRows: [],
242
- // 数据只有一页时是否展示分页,true:展示,auto:隐藏
243
- showPagination: true,
244
- isMounted: false,
245
- treeSize: localStorage.getItem('CURD::' + this.xTreeConfigName + '::TreeSize') ?? 25
246
- }
247
- },
248
- computed: {
249
- ...mapState('setting', ['isMobile'])
250
- },
251
- props: {
252
- // 业务名称
253
- title: {
254
- type: String,
255
- default: ''
256
- },
257
- // 外部传入的选中行keys
258
- externalSelectedRowKeys: {
259
- type: Array,
260
- default: () => []
261
- },
262
- // 卡片标题
263
- crudTitle: {
264
- type: String,
265
- default: null
266
- },
267
- // 查询配置文件名
268
- queryParamsName: {
269
- type: String,
270
- default: null
271
- },
272
- // 配置所属命名空间
273
- serviceName: {
274
- type: String,
275
- default: process.env.VUE_APP_SYSTEM_NAME
276
- },
277
- // 查询配置文件Json,用于查询配置生成器的预览
278
- queryParamsJson: {
279
- type: Object,
280
- default: null
281
- },
282
- // xTree 配置
283
- xTreeConfigName: {
284
- type: String,
285
- default: null
286
- },
287
- // 业务逻辑名称, 通过logic获取表单表格配置
288
- logicName: {
289
- type: String,
290
- default: null
291
- },
292
- // 执行logic传递的参数
293
- logicParam: {
294
- type: Object,
295
- default: () => {
296
- }
297
- },
298
- // 固定新增表单
299
- fixedAddForm: {
300
- type: Object,
301
- default: () => {
302
- return {}
303
- }
304
- },
305
- // 固定查询表单
306
- fixedQueryForm: {
307
- type: Object,
308
- default: () => {
309
- return {}
310
- }
311
- },
312
- // 预览模式
313
- viewMode: {
314
- type: Boolean,
315
- default: () => {
316
- return false
317
- }
318
- },
319
- // 本地编辑模式
320
- localEditMode: {
321
- type: Boolean,
322
- default: () => {
323
- return false
324
- }
325
- },
326
- // 行选择模式
327
- rowSelectMode: {
328
- type: Boolean,
329
- default: () => {
330
- return false
331
- }
332
- },
333
- // 行选择模式-允许选中行数量,0:任意数量行,大于0:指定值数量的行
334
- allowSelectRowNum: {
335
- type: Number,
336
- default: () => {
337
- return 0
338
- }
339
- },
340
- // 环境
341
- env: {
342
- type: String,
343
- default: () => {
344
- return 'prod'
345
- }
346
- },
347
- // 调用logic获取数据源的追加参数
348
- getDataParams: {
349
- type: Object,
350
- default: undefined
351
- },
352
- // 可以控制组件中导出等按钮的隐藏
353
- buttonState: {
354
- type: Object,
355
- default: undefined
356
- },
357
- // 是否自定义新增按钮的功能
358
- customAdd: {
359
- type: Boolean,
360
- default: false
361
- },
362
- reportQueryName: {
363
- type: String,
364
- default: undefined,
365
- },
366
- // 是否自定义删除按钮的功能
367
- customDelete: {
368
- type: Boolean,
369
- default: false
370
- },
371
- // 是否自定义修改按钮的功能
372
- customEdit: {
373
- type: Boolean,
374
- default: false
375
- },
376
- // 是否自定义增加按钮
377
- customMove: {
378
- type: Boolean,
379
- default: false
380
- },
381
- // 自适应底部边距
382
- extraHeight: {
383
- type: Number,
384
- default: 80
385
- },
386
- // 是否禁用右侧操作行为
387
- disableAction: {
388
- type: Boolean,
389
- default: false
390
- },
391
- // 额外参数,用于控制组件行为
392
- extraParams: {
393
- type: Object,
394
- default: () => {
395
- return {}
396
- }
397
- },
398
- /**
399
- * 额外数据对象
400
- * 类型:Object
401
- * 默认值:返回一个空对象
402
- * 用途:用于传递组件需要的额外数据参数,此参数在点击导入时会将对象传入到自定义前后置插槽业务中
403
- */
404
- extraData: {
405
- type: Object,
406
- default: () => {
407
- return {}
408
- }
409
- },
410
- // 是否使用自定义分页样式
411
- customPagination: {
412
- type: Boolean,
413
- default: false
414
- },
415
- // 是否隐藏顶部功能区域
416
- hiddenFunctionalArea: {
417
- type: Boolean,
418
- default: false
419
- }
420
- },
421
- watch: {
422
- logicParam: {
423
- handler () {
424
- this.initConfig()
425
- },
426
- deep: true
427
- },
428
- queryParamsJson: {
429
- handler () {
430
- this.initConfig()
431
- },
432
- deep: true
433
- },
434
- queryParamsName: {
435
- handler () {
436
- this.initConfig()
437
- }
438
- },
439
- serviceName: {
440
- handler () {
441
- this.initConfig()
442
- }
443
- }
444
- },
445
- methods: {
446
- runLogic,
447
- getRealKeyData,
448
- getConfigByNameAsync,
449
- getConfigByName,
450
- storePaneSize (treeSize) {
451
- localStorage.setItem('CURD::' + this.xTreeConfigName + '::TreeSize', treeSize[0].size)
452
- },
453
- customEvent (func, data) {
454
- this.$emit(func, data)
455
- },
456
- columnClick (key, value, record) {
457
- this.$emit('columnClick', key, value, record)
458
- },
459
- gotoUserDetail (key, value, record) {
460
- this.$refs.userInfo.init(getRealKeyData(record))
461
- },
462
- // 获取主表的数据内容,去掉主表别名
463
- getPrimaryData (rows) {
464
- const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
465
- const prefix = `${alias}_` // 构建前缀
466
- const result = []
467
-
468
- // 遍历 rows 的每一项,提取符合条件的数据
469
- rows.forEach(row => {
470
- const itemResult = {}
471
- Object.keys(row).forEach(key => {
472
- if (key.startsWith(prefix)) {
473
- const newKey = key.slice(prefix.length) // 去掉前缀
474
- itemResult[newKey] = row[key] // 添加到结果对象中
475
- }
476
- })
477
- result.push(itemResult) // 将处理后的项添加到结果数组中
478
- })
479
-
480
- return result // 返回去掉前缀后的对象数组
481
- },
482
-
483
- // 给数据区域添加主表数据,给的数据没有主表别名,放着时添加主表别名
484
- pushPrimaryData (rows) {
485
- const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
486
- const prefix = `${alias}_` // 构建前缀
487
- const result = rows.map(row => {
488
- const itemResult = {}
489
- Object.keys(row).forEach(key => {
490
- itemResult[prefix + key] = row[key] // 复制原始数据
491
- })
492
- return itemResult // 返回添加了主表别名的数据
493
- })
494
- // 把结果添加到数据区
495
- this.getTableData().push(...result)
496
- },
497
-
498
- // 设置固定查询条件,主表别名自动带
499
- setFixedQueryForm (data) {
500
- const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
501
- const prefixedData = {}
502
-
503
- // 为每个键添加主表别名
504
- Object.keys(data).forEach(key => {
505
- prefixedData[`${alias}_${key}`] = data[key]
506
- })
507
-
508
- Object.assign(this.fixedQueryForm, prefixedData)
509
- },
510
-
511
- importExcelOk (data) {
512
- this.$emit('importExcelOk', data)
513
- },
514
- initConfig () {
515
- this.loading = true
516
- this.loadError = false
517
- if (this.queryParamsName) {
518
- this.getConfig()
519
- } else if (this.queryParamsJson) {
520
- this.getConfigBySource()
521
- } else if (this.logicName && this.logicParam) {
522
- this.getColumnJsonByLogic()
523
- } else {
524
- this.loading = false
525
- this.loadError = true
526
- }
527
- },
528
-
529
- getConfig () {
530
- getConfigByName(this.queryParamsName, this.serviceName, (res) => {
531
- if (!res) {
532
- this.loading = false
533
- this.loadError = true
534
- return
535
- }
536
- this.updateComponents(res)
537
- }, this.env === 'dev')
538
- },
539
- getConfigBySource () {
540
- parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
541
- if (!res) {
542
- this.loading = false
543
- this.loadError = true
544
- return
545
- }
546
- this.updateComponents(res, true)
547
- })
548
- },
549
- getColumnJsonByLogic () {
550
- getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
551
- if (!res) {
552
- this.loading = false
553
- this.loadError = true
554
- return
555
- }
556
- this.updateComponents(res, true)
557
- }, this.env === 'dev')
558
- },
559
-
560
- /**
561
- * 更新子组件
562
- * @param res 参数
563
- * @param setQueryParams 是否设置queryParams参数
564
- */
565
- updateComponents (res, setQueryParams) {
566
- this.realQueryConfig = res
567
- if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
568
- // 设置添加按钮对应的配置名
569
- this.moveconfig = res.moveconfig
570
- this.showPagination = res.showPagination === null ? true : res.showPagination
571
- // 是否展示排序按钮控制
572
- if (res.showSortIcon !== null && !res.showSortIcon) {
573
- res.columnJson.forEach(item => {
574
- item.sorter = false
575
- })
576
- }
577
- const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
578
- const initTable = () => {
579
- // 初始化 xTable 子组件
580
- this.$refs.xTable.init({
581
- formItems: res.formJson,
582
- queryParams: setQueryParams ? res : null,
583
- realQueryParams: res,
584
- tableColumns: res.columnJson,
585
- buttonState: Object.assign(res.buttonState, this.buttonState),
586
- title: this.title || res.title,
587
- viewMode: this.viewMode,
588
- localEditMode: localEditMode,
589
- rowSelectMode: this.rowSelectMode,
590
- allowSelectRowNum: this.allowSelectRowNum,
591
- tableSummaryMap: res.tableSummaryMap,
592
- serviceName: this.serviceName,
593
- env: this.env,
594
- form: this.$refs.xForm.form,
595
- summaryUpdate: true,
596
- disableAction: this.disableAction,
597
- extraData: this.extraData,
598
- rowStyleFunction: res.rowStyleFunction,
599
- ...res
600
- })
601
- if (this.realQueryConfig?.funcData?.pageMounted) {
602
- executeStrFunctionByContext(this, this.realQueryConfig.funcData.pageMounted, [util, runLogic, getConfigByNameAsync])
603
- }
604
- this.$emit('afterTableInit')
605
- }
606
- // 初始化 xForm 子组件
607
- if (!localEditMode && !this.rowSelectMode) {
608
- this.$refs.xForm.init({
609
- queryParamsName: this.queryParamsName || 'localConfig',
610
- formItems: res.formJson,
611
- serviceName: this.serviceName,
612
- getDataParams: this.getDataParams,
613
- simpleMode: res.simpleMode,
614
- funcData: res.funcData,
615
- env: this.env
616
- })
617
- } else {
618
- // TODO 此处应删除
619
- initTable()
620
- }
621
- // 初始化 xTable 子组件
622
- // 等待 x-from-item 的 mounted 完成
623
- this.$refs.xForm.$on('itemsMounted', initTable)
624
- }
625
- this.loading = false
626
- },
627
- // 自定义按钮
628
- editButtonStateDataClick (functionName, rows) {
629
- console.log('functionName', functionName)
630
- console.log('rows', rows)
631
- this.$emit(functionName, rows)
632
- },
633
-
634
- /**
635
- * 提交查询表单事件
636
- * @param res 参数
637
- */
638
- onSearchSubmit (res) {
639
- if (res.valid) {
640
- // 表单赋值
641
- this.$refs.xTable.setQueryForm(res.form)
642
- this.$refs.xTable.summaryUpdate = true
643
- // commit
644
- this.$emit('afterSearchSubmit', res)
645
- } else {
646
- return false
647
- }
648
- },
649
- active (props) {
650
- let num = false
651
- for (const key in props) {
652
- // eslint-disable-next-line no-prototype-builtins
653
- if (this.$props.hasOwnProperty(key)) {
654
- if (this.$props[key] instanceof Object) {
655
- this.$props[key] = JSON.parse(props[key])
656
- } else {
657
- this.$props[key] = props[key]
658
- }
659
- num = true
660
- }
661
- }
662
- if (num) {
663
- this.initConfig()
664
- }
665
- },
666
- /**
667
- * 提交新增/修改表单后事件
668
- */
669
- onAddOrEditSubmitAfterSubmit (res) {
670
- this.refreshTable(res.businessType === '新增')
671
- // commit
672
- this.$emit('afterSubmit', res)
673
- },
674
- /**
675
- * 表格查询后事件
676
- * @param res 参数
677
- * @param conditionParams 查询条件
678
- */
679
- afterQuery (res, conditionParams) {
680
- this.$emit('afterQuery', res, conditionParams)
681
- },
682
- /**
683
- * 详情按钮事件
684
- * @param record 本条数据
685
- * @param id 数据标识
686
- * @param actionType 操作类型
687
- * @param fun 向上级传递的事件
688
- */
689
- action (record, id, actionType, fun = 'action', index) {
690
- this.$emit('innerXFormTableEmit', fun, record, id, actionType, index, this)
691
- this.$emit(fun, record, id, actionType, index, this)
692
- },
693
- treeOnChecked (checkedKeys, deepNodes, deepKeys) {
694
- this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
695
- },
696
- treeBtnFuncClick (index, func) {
697
- this.$emit('treeBtnFuncClick', index, func)
698
- },
699
- /**
700
- * 新增按钮事件
701
- */
702
- add () {
703
- if (this.customAdd) {
704
- this.$emit('add')
705
- } else {
706
- if (this.$listeners.curdAddBefore) {
707
- this.$emit('curdAddBefore', this.addFormInit)
708
- } else {
709
- this.addFormInit()
710
- }
711
- }
712
- },
713
- addFormInit () {
714
- const res = this.realQueryConfig
715
- const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
716
- this.$refs.xAddForm.init({
717
- businessType: '新增',
718
- title: this.title || res.title,
719
- isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
720
- configName: this.queryParamsName,
721
- configContent: this.queryParamsJson,
722
- formItems: res.formJson,
723
- viewMode: this.viewMode,
724
- localEditMode: localEditMode,
725
- isKeyHandle: !Boolean(localEditMode),
726
- serviceName: this.serviceName,
727
- fixedAddForm: this.fixedAddForm,
728
- getDataParams: this.getDataParams,
729
- layout: res.xAddFormLayout || 'horizontal',
730
- xAddFormLayoutWidth: res.xAddFormLayoutWidth,
731
- formItemLayout: res.formItemLayout || {},
732
- env: this.env
733
- })
734
- },
735
- /**
736
- * 添加按钮事件
737
- */
738
- move () {
739
- this.moveType = true
740
- this.$nextTick(
741
- () => {
742
- this.$refs.xAddReport.init({
743
- configName: this.moveconfig,
744
- selectedId: this.fixedAddForm.selected_id
745
- })
746
- }
747
- )
748
- },
749
- /**
750
- * 修改按钮事件
751
- * @param modifyModelData 修改表单数据
752
- */
753
- edit (modifyModelData) {
754
- if (this.customEdit) {
755
- this.$emit('edit')
756
- } else {
757
- const res = this.realQueryConfig
758
- const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
759
- this.$refs.xAddForm.init({
760
- businessType: '修改',
761
- title: this.title || res.title,
762
- isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
763
- configName: this.queryParamsName,
764
- configContent: this.queryParamsJson,
765
- formItems: res.formJson,
766
- viewMode: this.viewMode,
767
- localEditMode: localEditMode,
768
- isKeyHandle: !Boolean(localEditMode),
769
- serviceName: this.serviceName,
770
- fixedAddForm: this.fixedAddForm,
771
- getDataParams: this.getDataParams,
772
- modifyModelData: modifyModelData,
773
- layout: res.xAddFormLayout || 'horizontal',
774
- env: this.env
775
- })
776
- }
777
- },
778
- /**
779
- * 删除按钮事件
780
- */
781
- del (keys, callback) {
782
- if (this.customDelete) {
783
- this.$emit('del', keys, callback)
784
- }
785
- },
786
- /**
787
- * 删除后事件
788
- * @param res
789
- */
790
- afterDelete (res) {
791
- this.$emit('afterDelete', res)
792
- },
793
- /**
794
- * 行选择事件
795
- * @param row 选中行
796
- */
797
- rowChoose (row) {
798
- this.$emit('rowChoose', row)
799
- },
800
- /**
801
- * 本地编辑模式下校验表格并同步本地数据
802
- * @param currRow 当前行
803
- * @param defaultAppendRowData 默认追加的行数据
804
- */
805
- validateTableAndSyncData (currRow, defaultAppendRowData) {
806
- this.$refs.xTable.validateTableAndSyncData(currRow, defaultAppendRowData)
807
- },
808
- /**
809
- * 更多条件是否展示
810
- */
811
- toggleAdvanced () {
812
- this.$refs.xTable.setScrollYHeight({})
813
- },
814
- /**
815
- * 查询表单部分显示/隐藏切换
816
- */
817
- toggleIsFormShow () {
818
- this.toggleIsFormIcon = this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
819
- this.$refs.xForm.toggleVisible()
820
- this.$refs.xTable.setScrollYHeight({})
821
- },
822
- /**
823
- * 选择列事件
824
- * @param selectedRowKeys 选中列Key集合
825
- * @param selectedRows 选中列
826
- */
827
- selectRow (selectedRowKeys, selectedRows) {
828
- this.table_selectedRowKeys = selectedRowKeys
829
- this.table_selectedRows = selectedRows
830
- this.$emit('selectRow', selectedRowKeys, selectedRows)
831
- },
832
- /**
833
- * 清除勾选数据
834
- */
835
- clearRowKeys () {
836
- this.$refs.xTable.clearRowKeys()
837
- },
838
- /**
839
- * 刷新表格
840
- * @param toFirstPage 是否到第一页
841
- */
842
- refreshTable (toFirstPage = true) {
843
- this.$refs.xTable.refresh(toFirstPage)
844
- },
845
- /**
846
- * 刷新表格
847
- * @param toFirstPage 是否到第一页
848
- */
849
- refresh (toFirstPage = true) {
850
- this.$refs.xTable.refresh(toFirstPage)
851
- },
852
- /**
853
- * 获取表格数据
854
- */
855
- getTableData () {
856
- return this.$refs.xTable.getTableData()
857
- },
858
- // 在行编辑等情况下,让界面生效
859
- update () {
860
- this.getTableData().push(...[])
861
- },
862
-
863
- /**
864
- * 设置表格数据
865
- */
866
- setTableData (data) {
867
- this.$refs.xTable.setTableData(data)
868
- },
869
- /**
870
- * 表单本地提交
871
- */
872
- onLocalSubmit (res, callback) {
873
- const form = res.realForm
874
- if (res.businessType === '新增') {
875
- this.$refs.xTable.appendLocalData(form)
876
- } else {
877
- this.$refs.xTable.modifyLocalData(form['序号'], form)
878
- }
879
- this.$message.success(res.businessType + '成功!')
880
- this.onAddOrEditSubmitAfterSubmit(res, callback)
881
- if (callback) {
882
- callback()
883
- }
884
- },
885
- emitFunc (func, ...args) {
886
- this.$emit(func, ...args)
887
- this.$emit('getEmitFuncData', func, ...args)
888
- },
889
- // 直接转发事件的函数
890
- emitEvent (event, ...args) {
891
- this.$emit(event, ...args)
892
- },
893
- // 添加处理 rowClick 的方法
894
- handleRowClick (record) {
895
- this.$emit('rowClick', record)
896
- },
897
- beforeDataChange (record) {
898
- this.$emit('beforeDataChange', record)
899
- },
900
- onExpand (expanded, record) {
901
- this.$emit('expand', expanded, record)
902
- }
903
- },
904
- action: {
905
- /**
906
- * 实现doAction方法
907
- */
908
- doAction (actionType, args, data) {
909
- switch (actionType) {
910
- case 'refreshTable':
911
- for (const item in args) {
912
- console.log('item', item)
913
- }
914
- break
915
- default:
916
- break
917
- }
918
- }
919
- },
920
- mounted () {
921
- if (!this.isMounted) {
922
- // 防止多次调用
923
- // 不知道为啥他会执行两次 mounted 暂时处理方式
924
- this.initConfig()
925
- this.isMounted = true
926
- }
927
- if (this.getSelectedData && typeof this.getSelectedData === 'function') {
928
- const selectedId = this.getSelectedData()
929
- if (!selectedId) {
930
- return
931
- }
932
- if (typeof selectedId === 'object') {
933
- const data = JSON.parse(JSON.stringify(selectedId))
934
- if (data.selectedId) {
935
- data.selected_id = data.selectedId
936
- delete data.selectedId
937
- }
938
- Object.assign(this.fixedAddForm, data)
939
- Object.assign(this.fixedQueryForm, data)
940
- } else {
941
- Object.assign(this.fixedAddForm, { selected_id: selectedId })
942
- Object.assign(this.fixedQueryForm, { selected_id: selectedId })
943
- }
944
- }
945
- }
946
- }
947
- </script>
948
- <style lang="less" scoped>
949
- .crud_title {
950
- height: 32px;
951
- font-size: 16px;
952
- font-weight: 500;
953
- color: #000000d9;
954
- line-height: 32px;
955
- margin-bottom: 12px;
956
- }
957
- // 表格行样式类型
958
- .ant-table-tbody {
959
- // 成功样式 - 绿色 (#52c41a)
960
- .ant-table-row-success {
961
- background-color: rgba(82, 196, 26, 0.2);
962
-
963
- &:hover {
964
- background-color: rgba(82, 196, 26, 0.3) !important;
965
-
966
- td {
967
- background-color: transparent;
968
- }
969
- }
970
-
971
- // 选中状态
972
- &.ant-table-row-selected {
973
- background-color: rgba(82, 196, 26, 0.4);
974
-
975
- td {
976
- background-color: transparent;
977
- }
978
- }
979
-
980
- td {
981
- background-color: transparent;
982
- }
983
- }
984
-
985
- // 警告样式 - 黄色 (#faad14)
986
- .ant-table-row-warning {
987
- background-color: rgba(250, 173, 20, 0.1) ;
988
-
989
- &:hover {
990
- background-color: rgba(250, 173, 20, 0.15) ;
991
-
992
- td {
993
- background-color: transparent ;
994
- }
995
- }
996
-
997
- // 选中状态
998
- &.ant-table-row-selected {
999
- background-color: rgba(250, 173, 20, 0.2);
1000
-
1001
- td {
1002
- background-color: transparent;
1003
- }
1004
- }
1005
-
1006
- td {
1007
- background-color: transparent ;
1008
- }
1009
- }
1010
-
1011
- // 错误样式 - 红色 (#f5222f)
1012
- .ant-table-row-error {
1013
- background-color: rgba(245, 34, 47, 0.1) ;
1014
-
1015
- &:hover {
1016
- background-color: rgba(245, 34, 47, 0.15) ;
1017
-
1018
- td {
1019
- background-color: transparent ;
1020
- }
1021
- }
1022
-
1023
- // 选中状态
1024
- &.ant-table-row-selected {
1025
- background-color: rgba(245, 34, 47, 0.2) ;
1026
-
1027
- td {
1028
- background-color: transparent ;
1029
- }
1030
- }
1031
-
1032
- td {
1033
- background-color: transparent ;
1034
- }
1035
- }
1036
-
1037
- // 魔法样式 - 紫色
1038
- .ant-table-row-magic {
1039
- background-color: rgba(114, 46, 209, 0.1) ;
1040
-
1041
- &:hover {
1042
- background-color: rgba(114, 46, 209, 0.15) ;
1043
-
1044
- td {
1045
- background-color: transparent ;
1046
- }
1047
- }
1048
-
1049
- // 选中状态
1050
- &.ant-table-row-selected {
1051
- background-color: rgba(114, 46, 209, 0.2) ;
1052
-
1053
- td {
1054
- background-color: transparent ;
1055
- }
1056
- }
1057
-
1058
- td {
1059
- background-color: transparent ;
1060
- }
1061
- }
1062
-
1063
- // 默认选中状态(没有特殊行样式时)
1064
- .ant-table-row-selected:not(.ant-table-row-success):not(.ant-table-row-warning):not(.ant-table-row-error):not(.ant-table-row-magic) {
1065
- background-color: rgba(24, 144, 255, 0.1) ;
1066
- }
1067
- }
1068
- </style>
1069
- <style>
1070
-
1071
- .splitpanes.default-theme .splitpanes__splitter {
1072
- border: 0;
1073
- width: 1rem;
1074
- position: relative;
1075
-
1076
- &:before {
1077
- content: '';
1078
- position: absolute;
1079
- left: 50%;
1080
- top: 50%;
1081
- transform: translate(-50%, -50%);
1082
- width: 2px;
1083
- height: 30px;
1084
- border-radius: 1px;
1085
- }
1086
- }
1087
-
1088
- .splitpanes.default-theme .splitpanes__pane {
1089
- overflow: visible;
1090
- background-color: transparent;
1091
- }
1092
-
1093
- </style>
1
+ <template>
2
+ <splitpanes
3
+ class="default-theme"
4
+ :horizontal="false"
5
+ @resized="storePaneSize"
6
+ >
7
+ <pane
8
+ :size="treeSize"
9
+ :min-size="15"
10
+ :max-size="40"
11
+ v-if="xTreeConfigName">
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
+ </pane>
21
+ <pane
22
+ :size="100 - treeSize"
23
+ >
24
+ <a-skeleton :loading="loading" :paragraph="{ rows: 4 }"/>
25
+ <a-row style="height: 12px" v-if="xTreeConfigName"></a-row>
26
+ <div v-show="!loading">
27
+ <template v-if="!loadError">
28
+ <x-add-form
29
+ ref="xAddForm"
30
+ @onLocalSubmit="onLocalSubmit"
31
+ @x-form-item-emit-func="emitFunc"
32
+ @afterSubmit="onAddOrEditSubmitAfterSubmit"
33
+ >
34
+ <template slot="groupFormItems" slot-scope="{form, model, rules, modifyModelData}">
35
+ <slot
36
+ name="groupFormItems"
37
+ :form="form"
38
+ :model="model"
39
+ :rules="rules"
40
+ :modifyModelData="modifyModelData"></slot>
41
+ </template>
42
+ </x-add-form>
43
+ <x-add-report
44
+ v-if="moveType"
45
+ ref="xAddReport"
46
+ >
47
+ </x-add-report>
48
+ <div v-if="crudTitle" class="crud_title">
49
+ {{ crudTitle }}
50
+ </div>
51
+ <x-form
52
+ ref="xForm"
53
+ @x-form-item-emit-func="emitFunc"
54
+ @toggleAdvanced="toggleAdvanced"
55
+ @onSubmit="onSearchSubmit">
56
+ <slot name="formBtnExpand"></slot>
57
+ </x-form>
58
+ <x-table
59
+ ref="xTable"
60
+ :fixedQueryForm="fixedQueryForm"
61
+ :queryParamsName="queryParamsName"
62
+ :query-params-json="queryParamsJson"
63
+ :show-pagination="showPagination"
64
+ :customDelete="customDelete"
65
+ :extraHeight="extraHeight"
66
+ :serviceName="serviceName"
67
+ :pageMaxSize="realQueryConfig.queryPagesSize"
68
+ :externalSelectedRowKeys="externalSelectedRowKeys"
69
+ :customPagination="customPagination"
70
+ :hiddenFunctionalArea="hiddenFunctionalArea"
71
+ @x-form-item-emit-func="emitFunc"
72
+ @add="add"
73
+ @move="move"
74
+ @edit="edit"
75
+ @del="del"
76
+ @rowChoose="rowChoose"
77
+ @customEvent="customEvent"
78
+ @afterDelete="afterDelete"
79
+ @action="action"
80
+ @selectRow="selectRow"
81
+ @afterQuery="afterQuery"
82
+ @columnClick="columnClick"
83
+ @gotoUserDetail="gotoUserDetail"
84
+ @editButtonStateDataClick="editButtonStateDataClick"
85
+ @importExcelOk="importExcelOk"
86
+ @rowClick="handleRowClick"
87
+ @beforeDataChange="beforeDataChange"
88
+ @expand="onExpand">
89
+ <template slot="leftButton" slot-scope="{selectedRowKeys, selectedRows}">
90
+ <slot name="leftButton" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
91
+ </template>
92
+ <template slot="button" slot-scope="{selectedRowKeys, selectedRows}">
93
+ <slot name="button" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
94
+ </template>
95
+ <template slot="rightBtnExpand" slot-scope="{selectedRowKeys, selectedRows}">
96
+ <slot name="rightBtnExpand" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
97
+ <a-tooltip title="收起查询条件" placement="bottom">
98
+ <a-button @click="toggleIsFormShow">
99
+ <a-icon :style="iconStyle" :type="toggleIsFormIcon"/>
100
+ </a-button>
101
+ </a-tooltip>
102
+ </template>
103
+ <!-- 底部插槽 -->
104
+ <template slot="footer" slot-scope="{selectedRowKeys, selectedRows}">
105
+ <slot name="footer" :selectedRowKeys="selectedRowKeys" :selectedRows="selectedRows"></slot>
106
+ </template>
107
+ <!-- excel导入说明插槽 -->
108
+ <template #importExcelSlot>
109
+ <slot name="importExcelSlot"></slot>
110
+ </template>
111
+ </x-table>
112
+ </template>
113
+ <template v-else>
114
+ <a-empty>
115
+ <span slot="description"> 页面配置不存在,请联系系统管理员</span>
116
+ </a-empty>
117
+ </template>
118
+ </div>
119
+ </pane>
120
+ <UserInfoDetailManage ref="userInfo" @close="refresh(false)"/>
121
+ </splitpanes>
122
+ </template>
123
+ <script>
124
+ import XForm from '@vue2-client/base-client/components/common/XForm'
125
+ import XAddForm from '@vue2-client/base-client/components/common/XAddForm'
126
+ import XAddReport from '@vue2-client/base-client/components/common/XAddReport'
127
+ import XTable from '@vue2-client/base-client/components/common/XTable'
128
+ import XTree from '@vue2-client/base-client/components/common/XTree'
129
+ import XImportExcel from '@vue2-client/base-client/components/common/XImportExcel'
130
+ import { Splitpanes, Pane } from 'splitpanes'
131
+ import 'splitpanes/dist/splitpanes.css'
132
+ import {
133
+ getConfigByName,
134
+ getConfigByLogic,
135
+ parseConfig, runLogic, getConfigByNameAsync,
136
+ } from '@vue2-client/services/api/common'
137
+ import { mapState } from 'vuex'
138
+ import XTreePro from '@vue2-client/base-client/components/common/XTree/XTreePro.vue'
139
+ import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
140
+ import { getRealKeyData } from '@vue2-client/utils/util'
141
+ import * as util from '@vue2-client/utils/util'
142
+ import UserInfoDetailManage from '@vue2-client/pages/userInfoDetailManage/index.vue'
143
+
144
+ export default {
145
+ name: 'XFormTable',
146
+ components: {
147
+ UserInfoDetailManage,
148
+ XTreePro,
149
+ XTable,
150
+ XForm,
151
+ XTree,
152
+ XAddForm,
153
+ XAddReport,
154
+ XImportExcel,
155
+ Splitpanes,
156
+ Pane
157
+ },
158
+ provide () {
159
+ return {
160
+ getSelf: () => this,
161
+ emitEvent: this.emitEvent.bind(this)
162
+ }
163
+ },
164
+ inject: {
165
+ getSelectedId: {
166
+ default: () => () => {
167
+ console.warn('getSelectedId is not provided.')
168
+ return null
169
+ },
170
+ },
171
+ setGlobalData: {
172
+ default: () => () => {
173
+ console.warn('setGlobalData is not provided.')
174
+ return null
175
+ },
176
+ },
177
+ getGlobalData: {
178
+ default: () => () => {
179
+ console.warn('getGlobalData is not provided.')
180
+ return null
181
+ },
182
+ },
183
+ getSelectedData: {
184
+ default: () => () => {
185
+ console.warn('getSelectedData is not provided.')
186
+ return null
187
+ },
188
+ },
189
+ getMixinData: {
190
+ default: () => () => {
191
+ console.warn('getMixinData is not provided.')
192
+ return {}
193
+ },
194
+ },
195
+ getOutEnv: {
196
+ default: () => () => {
197
+ console.warn('getOutEnv is not provided.')
198
+ return {}
199
+ },
200
+ },
201
+ currUser: {
202
+ default: () => {
203
+ console.warn('currUser is not provided.')
204
+ return { id: null, name: 'Guest' }
205
+ },
206
+ },
207
+
208
+ /**
209
+ * 祖先组件注入的自定义函数对象
210
+ * 此对象包含祖先组件通过provide/inject机制注入的各种自定义函数
211
+ * 子组件可以通过this.generalFunction来访问这些函数
212
+ * 使用示例:
213
+ * - this.generalFunction.handleCustomEvent(data)
214
+ * - this.generalFunction.submitForm(formData)
215
+ * - this.generalFunction.validateData(data)
216
+ */
217
+ generalFunction: {
218
+ default: () => {
219
+ console.warn('generalFunction is not provided.')
220
+ return null
221
+ }
222
+ }
223
+ },
224
+ data () {
225
+ return {
226
+ // 加载状态
227
+ loading: false,
228
+ // 图标样式
229
+ iconStyle: {
230
+ position: 'relative',
231
+ top: '1px'
232
+ },
233
+ loadError: false,
234
+ moveType: false,
235
+ // 添加按钮对应的配置名
236
+ moveconfig: '',
237
+ // 实际查询配置内容
238
+ realQueryConfig: {},
239
+ toggleIsFormIcon: 'vertical-align-top',
240
+ table_selectedRowKeys: [],
241
+ table_selectedRows: [],
242
+ // 数据只有一页时是否展示分页,true:展示,auto:隐藏
243
+ showPagination: true,
244
+ isMounted: false,
245
+ treeSize: localStorage.getItem('CURD::' + this.xTreeConfigName + '::TreeSize') ?? 25
246
+ }
247
+ },
248
+ computed: {
249
+ ...mapState('setting', ['isMobile'])
250
+ },
251
+ props: {
252
+ // 业务名称
253
+ title: {
254
+ type: String,
255
+ default: ''
256
+ },
257
+ // 外部传入的选中行keys
258
+ externalSelectedRowKeys: {
259
+ type: Array,
260
+ default: () => []
261
+ },
262
+ // 卡片标题
263
+ crudTitle: {
264
+ type: String,
265
+ default: null
266
+ },
267
+ // 查询配置文件名
268
+ queryParamsName: {
269
+ type: String,
270
+ default: null
271
+ },
272
+ // 配置所属命名空间
273
+ serviceName: {
274
+ type: String,
275
+ default: process.env.VUE_APP_SYSTEM_NAME
276
+ },
277
+ // 查询配置文件Json,用于查询配置生成器的预览
278
+ queryParamsJson: {
279
+ type: Object,
280
+ default: null
281
+ },
282
+ // xTree 配置
283
+ xTreeConfigName: {
284
+ type: String,
285
+ default: null
286
+ },
287
+ // 业务逻辑名称, 通过logic获取表单表格配置
288
+ logicName: {
289
+ type: String,
290
+ default: null
291
+ },
292
+ // 执行logic传递的参数
293
+ logicParam: {
294
+ type: Object,
295
+ default: () => {
296
+ }
297
+ },
298
+ // 固定新增表单
299
+ fixedAddForm: {
300
+ type: Object,
301
+ default: () => {
302
+ return {}
303
+ }
304
+ },
305
+ // 固定查询表单
306
+ fixedQueryForm: {
307
+ type: Object,
308
+ default: () => {
309
+ return {}
310
+ }
311
+ },
312
+ // 预览模式
313
+ viewMode: {
314
+ type: Boolean,
315
+ default: () => {
316
+ return false
317
+ }
318
+ },
319
+ // 本地编辑模式
320
+ localEditMode: {
321
+ type: Boolean,
322
+ default: () => {
323
+ return false
324
+ }
325
+ },
326
+ // 行选择模式
327
+ rowSelectMode: {
328
+ type: Boolean,
329
+ default: () => {
330
+ return false
331
+ }
332
+ },
333
+ // 行选择模式-允许选中行数量,0:任意数量行,大于0:指定值数量的行
334
+ allowSelectRowNum: {
335
+ type: Number,
336
+ default: () => {
337
+ return 0
338
+ }
339
+ },
340
+ // 环境
341
+ env: {
342
+ type: String,
343
+ default: () => {
344
+ return 'prod'
345
+ }
346
+ },
347
+ // 调用logic获取数据源的追加参数
348
+ getDataParams: {
349
+ type: Object,
350
+ default: undefined
351
+ },
352
+ // 可以控制组件中导出等按钮的隐藏
353
+ buttonState: {
354
+ type: Object,
355
+ default: undefined
356
+ },
357
+ // 是否自定义新增按钮的功能
358
+ customAdd: {
359
+ type: Boolean,
360
+ default: false
361
+ },
362
+ reportQueryName: {
363
+ type: String,
364
+ default: undefined,
365
+ },
366
+ // 是否自定义删除按钮的功能
367
+ customDelete: {
368
+ type: Boolean,
369
+ default: false
370
+ },
371
+ // 是否自定义修改按钮的功能
372
+ customEdit: {
373
+ type: Boolean,
374
+ default: false
375
+ },
376
+ // 是否自定义增加按钮
377
+ customMove: {
378
+ type: Boolean,
379
+ default: false
380
+ },
381
+ // 自适应底部边距
382
+ extraHeight: {
383
+ type: Number,
384
+ default: 80
385
+ },
386
+ // 是否禁用右侧操作行为
387
+ disableAction: {
388
+ type: Boolean,
389
+ default: false
390
+ },
391
+ // 额外参数,用于控制组件行为
392
+ extraParams: {
393
+ type: Object,
394
+ default: () => {
395
+ return {}
396
+ }
397
+ },
398
+ /**
399
+ * 额外数据对象
400
+ * 类型:Object
401
+ * 默认值:返回一个空对象
402
+ * 用途:用于传递组件需要的额外数据参数,此参数在点击导入时会将对象传入到自定义前后置插槽业务中
403
+ */
404
+ extraData: {
405
+ type: Object,
406
+ default: () => {
407
+ return {}
408
+ }
409
+ },
410
+ // 是否使用自定义分页样式
411
+ customPagination: {
412
+ type: Boolean,
413
+ default: false
414
+ },
415
+ // 是否隐藏顶部功能区域
416
+ hiddenFunctionalArea: {
417
+ type: Boolean,
418
+ default: false
419
+ }
420
+ },
421
+ watch: {
422
+ logicParam: {
423
+ handler () {
424
+ this.initConfig()
425
+ },
426
+ deep: true
427
+ },
428
+ queryParamsJson: {
429
+ handler () {
430
+ this.initConfig()
431
+ },
432
+ deep: true
433
+ },
434
+ queryParamsName: {
435
+ handler () {
436
+ this.initConfig()
437
+ }
438
+ },
439
+ serviceName: {
440
+ handler () {
441
+ this.initConfig()
442
+ }
443
+ }
444
+ },
445
+ methods: {
446
+ runLogic,
447
+ getRealKeyData,
448
+ getConfigByNameAsync,
449
+ getConfigByName,
450
+ storePaneSize (treeSize) {
451
+ localStorage.setItem('CURD::' + this.xTreeConfigName + '::TreeSize', treeSize[0].size)
452
+ },
453
+ customEvent (func, data) {
454
+ this.$emit(func, data)
455
+ },
456
+ columnClick (key, value, record) {
457
+ this.$emit('columnClick', key, value, record)
458
+ },
459
+ gotoUserDetail (key, value, record) {
460
+ this.$refs.userInfo.init(getRealKeyData(record))
461
+ },
462
+ // 获取主表的数据内容,去掉主表别名
463
+ getPrimaryData (rows) {
464
+ const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
465
+ const prefix = `${alias}_` // 构建前缀
466
+ const result = []
467
+
468
+ // 遍历 rows 的每一项,提取符合条件的数据
469
+ rows.forEach(row => {
470
+ const itemResult = {}
471
+ Object.keys(row).forEach(key => {
472
+ if (key.startsWith(prefix)) {
473
+ const newKey = key.slice(prefix.length) // 去掉前缀
474
+ itemResult[newKey] = row[key] // 添加到结果对象中
475
+ }
476
+ })
477
+ result.push(itemResult) // 将处理后的项添加到结果数组中
478
+ })
479
+
480
+ return result // 返回去掉前缀后的对象数组
481
+ },
482
+
483
+ // 给数据区域添加主表数据,给的数据没有主表别名,放着时添加主表别名
484
+ pushPrimaryData (rows) {
485
+ const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
486
+ const prefix = `${alias}_` // 构建前缀
487
+ const result = rows.map(row => {
488
+ const itemResult = {}
489
+ Object.keys(row).forEach(key => {
490
+ itemResult[prefix + key] = row[key] // 复制原始数据
491
+ })
492
+ return itemResult // 返回添加了主表别名的数据
493
+ })
494
+ // 把结果添加到数据区
495
+ this.getTableData().push(...result)
496
+ },
497
+
498
+ // 设置固定查询条件,主表别名自动带
499
+ setFixedQueryForm (data) {
500
+ const alias = this.realQueryConfig.tableAliasName // 获取主表的别名
501
+ const prefixedData = {}
502
+
503
+ // 为每个键添加主表别名
504
+ Object.keys(data).forEach(key => {
505
+ prefixedData[`${alias}_${key}`] = data[key]
506
+ })
507
+
508
+ Object.assign(this.fixedQueryForm, prefixedData)
509
+ },
510
+
511
+ importExcelOk (data) {
512
+ this.$emit('importExcelOk', data)
513
+ },
514
+ initConfig () {
515
+ this.loading = true
516
+ this.loadError = false
517
+ if (this.queryParamsName) {
518
+ this.getConfig()
519
+ } else if (this.queryParamsJson) {
520
+ this.getConfigBySource()
521
+ } else if (this.logicName && this.logicParam) {
522
+ this.getColumnJsonByLogic()
523
+ } else {
524
+ this.loading = false
525
+ this.loadError = true
526
+ }
527
+ },
528
+
529
+ getConfig () {
530
+ getConfigByName(this.queryParamsName, this.serviceName, (res) => {
531
+ if (!res) {
532
+ this.loading = false
533
+ this.loadError = true
534
+ return
535
+ }
536
+ this.updateComponents(res)
537
+ }, this.env === 'dev')
538
+ },
539
+ getConfigBySource () {
540
+ parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
541
+ if (!res) {
542
+ this.loading = false
543
+ this.loadError = true
544
+ return
545
+ }
546
+ this.updateComponents(res, true)
547
+ })
548
+ },
549
+ getColumnJsonByLogic () {
550
+ getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
551
+ if (!res) {
552
+ this.loading = false
553
+ this.loadError = true
554
+ return
555
+ }
556
+ this.updateComponents(res, true)
557
+ }, this.env === 'dev')
558
+ },
559
+
560
+ /**
561
+ * 更新子组件
562
+ * @param res 参数
563
+ * @param setQueryParams 是否设置queryParams参数
564
+ */
565
+ updateComponents (res, setQueryParams) {
566
+ this.realQueryConfig = res
567
+ if (this.$refs.xTable && this.$refs.xForm && this.$refs.xAddForm) {
568
+ // 设置添加按钮对应的配置名
569
+ this.moveconfig = res.moveconfig
570
+ this.showPagination = res.showPagination === null ? true : res.showPagination
571
+ // 是否展示排序按钮控制
572
+ if (res.showSortIcon !== null && !res.showSortIcon) {
573
+ res.columnJson.forEach(item => {
574
+ item.sorter = false
575
+ })
576
+ }
577
+ const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
578
+ const initTable = () => {
579
+ // 初始化 xTable 子组件
580
+ this.$refs.xTable.init({
581
+ formItems: res.formJson,
582
+ queryParams: setQueryParams ? res : null,
583
+ realQueryParams: res,
584
+ tableColumns: res.columnJson,
585
+ buttonState: Object.assign(res.buttonState, this.buttonState),
586
+ title: this.title || res.title,
587
+ viewMode: this.viewMode,
588
+ localEditMode: localEditMode,
589
+ rowSelectMode: this.rowSelectMode,
590
+ allowSelectRowNum: this.allowSelectRowNum,
591
+ tableSummaryMap: res.tableSummaryMap,
592
+ serviceName: this.serviceName,
593
+ env: this.env,
594
+ form: this.$refs.xForm.form,
595
+ summaryUpdate: true,
596
+ disableAction: this.disableAction,
597
+ extraData: this.extraData,
598
+ rowStyleFunction: res.rowStyleFunction,
599
+ ...res
600
+ })
601
+ if (this.realQueryConfig?.funcData?.pageMounted) {
602
+ executeStrFunctionByContext(this, this.realQueryConfig.funcData.pageMounted, [util, runLogic, getConfigByNameAsync])
603
+ }
604
+ this.$emit('afterTableInit')
605
+ }
606
+ // 初始化 xForm 子组件
607
+ if (!localEditMode && !this.rowSelectMode) {
608
+ this.$refs.xForm.init({
609
+ queryParamsName: this.queryParamsName || 'localConfig',
610
+ formItems: res.formJson,
611
+ serviceName: this.serviceName,
612
+ getDataParams: this.getDataParams,
613
+ simpleMode: res.simpleMode,
614
+ funcData: res.funcData,
615
+ env: this.env
616
+ })
617
+ } else {
618
+ // TODO 此处应删除
619
+ initTable()
620
+ }
621
+ // 初始化 xTable 子组件
622
+ // 等待 x-from-item 的 mounted 完成
623
+ this.$refs.xForm.$on('itemsMounted', initTable)
624
+ }
625
+ this.loading = false
626
+ },
627
+ // 自定义按钮
628
+ editButtonStateDataClick (functionName, rows) {
629
+ console.log('functionName', functionName)
630
+ console.log('rows', rows)
631
+ this.$emit(functionName, rows)
632
+ },
633
+
634
+ /**
635
+ * 提交查询表单事件
636
+ * @param res 参数
637
+ */
638
+ onSearchSubmit (res) {
639
+ if (res.valid) {
640
+ // 表单赋值
641
+ this.$refs.xTable.setQueryForm(res.form)
642
+ this.$refs.xTable.summaryUpdate = true
643
+ // commit
644
+ this.$emit('afterSearchSubmit', res)
645
+ } else {
646
+ return false
647
+ }
648
+ },
649
+ active (props) {
650
+ let num = false
651
+ for (const key in props) {
652
+ // eslint-disable-next-line no-prototype-builtins
653
+ if (this.$props.hasOwnProperty(key)) {
654
+ if (this.$props[key] instanceof Object) {
655
+ this.$props[key] = JSON.parse(props[key])
656
+ } else {
657
+ this.$props[key] = props[key]
658
+ }
659
+ num = true
660
+ }
661
+ }
662
+ if (num) {
663
+ this.initConfig()
664
+ }
665
+ },
666
+ /**
667
+ * 提交新增/修改表单后事件
668
+ */
669
+ onAddOrEditSubmitAfterSubmit (res) {
670
+ this.refreshTable(res.businessType === '新增')
671
+ // commit
672
+ this.$emit('afterSubmit', res)
673
+ },
674
+ /**
675
+ * 表格查询后事件
676
+ * @param res 参数
677
+ * @param conditionParams 查询条件
678
+ */
679
+ afterQuery (res, conditionParams) {
680
+ this.$emit('afterQuery', res, conditionParams)
681
+ },
682
+ /**
683
+ * 详情按钮事件
684
+ * @param record 本条数据
685
+ * @param id 数据标识
686
+ * @param actionType 操作类型
687
+ * @param fun 向上级传递的事件
688
+ */
689
+ action (record, id, actionType, fun = 'action', index) {
690
+ this.$emit('innerXFormTableEmit', fun, record, id, actionType, index, this)
691
+ this.$emit(fun, record, id, actionType, index, this)
692
+ },
693
+ treeOnChecked (checkedKeys, deepNodes, deepKeys) {
694
+ this.$emit('treeOnChecked', checkedKeys, deepNodes, deepKeys)
695
+ },
696
+ treeBtnFuncClick (index, func) {
697
+ this.$emit('treeBtnFuncClick', index, func)
698
+ },
699
+ /**
700
+ * 新增按钮事件
701
+ */
702
+ add () {
703
+ if (this.customAdd) {
704
+ this.$emit('add')
705
+ } else {
706
+ if (this.$listeners.curdAddBefore) {
707
+ this.$emit('curdAddBefore', this.addFormInit)
708
+ } else {
709
+ this.addFormInit()
710
+ }
711
+ }
712
+ },
713
+ addFormInit () {
714
+ const res = this.realQueryConfig
715
+ const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
716
+ this.$refs.xAddForm.init({
717
+ businessType: '新增',
718
+ title: this.title || res.title,
719
+ isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
720
+ configName: this.queryParamsName,
721
+ configContent: this.queryParamsJson,
722
+ formItems: res.formJson,
723
+ viewMode: this.viewMode,
724
+ localEditMode: localEditMode,
725
+ isKeyHandle: !Boolean(localEditMode),
726
+ serviceName: this.serviceName,
727
+ fixedAddForm: this.fixedAddForm,
728
+ getDataParams: this.getDataParams,
729
+ layout: res.xAddFormLayout || 'horizontal',
730
+ xAddFormLayoutWidth: res.xAddFormLayoutWidth,
731
+ formItemLayout: res.formItemLayout || {},
732
+ env: this.env
733
+ })
734
+ },
735
+ /**
736
+ * 添加按钮事件
737
+ */
738
+ move () {
739
+ this.moveType = true
740
+ this.$nextTick(
741
+ () => {
742
+ this.$refs.xAddReport.init({
743
+ configName: this.moveconfig,
744
+ selectedId: this.fixedAddForm.selected_id
745
+ })
746
+ }
747
+ )
748
+ },
749
+ /**
750
+ * 修改按钮事件
751
+ * @param modifyModelData 修改表单数据
752
+ */
753
+ edit (modifyModelData) {
754
+ if (this.customEdit) {
755
+ this.$emit('edit')
756
+ } else {
757
+ const res = this.realQueryConfig
758
+ const localEditMode = !this.localEditMode ? res.localEditMode : this.localEditMode
759
+ this.$refs.xAddForm.init({
760
+ businessType: '修改',
761
+ title: this.title || res.title,
762
+ isShow: !res.buttonState || res.buttonState.add || res.buttonState.edit,
763
+ configName: this.queryParamsName,
764
+ configContent: this.queryParamsJson,
765
+ formItems: res.formJson,
766
+ viewMode: this.viewMode,
767
+ localEditMode: localEditMode,
768
+ isKeyHandle: !Boolean(localEditMode),
769
+ serviceName: this.serviceName,
770
+ fixedAddForm: this.fixedAddForm,
771
+ getDataParams: this.getDataParams,
772
+ modifyModelData: modifyModelData,
773
+ layout: res.xAddFormLayout || 'horizontal',
774
+ env: this.env
775
+ })
776
+ }
777
+ },
778
+ /**
779
+ * 删除按钮事件
780
+ */
781
+ del (keys, callback) {
782
+ if (this.customDelete) {
783
+ this.$emit('del', keys, callback)
784
+ }
785
+ },
786
+ /**
787
+ * 删除后事件
788
+ * @param res
789
+ */
790
+ afterDelete (res) {
791
+ this.$emit('afterDelete', res)
792
+ },
793
+ /**
794
+ * 行选择事件
795
+ * @param row 选中行
796
+ */
797
+ rowChoose (row) {
798
+ this.$emit('rowChoose', row)
799
+ },
800
+ /**
801
+ * 本地编辑模式下校验表格并同步本地数据
802
+ * @param currRow 当前行
803
+ * @param defaultAppendRowData 默认追加的行数据
804
+ */
805
+ validateTableAndSyncData (currRow, defaultAppendRowData) {
806
+ this.$refs.xTable.validateTableAndSyncData(currRow, defaultAppendRowData)
807
+ },
808
+ /**
809
+ * 更多条件是否展示
810
+ */
811
+ toggleAdvanced () {
812
+ this.$refs.xTable.setScrollYHeight({})
813
+ },
814
+ /**
815
+ * 查询表单部分显示/隐藏切换
816
+ */
817
+ toggleIsFormShow () {
818
+ this.toggleIsFormIcon = this.toggleIsFormIcon === 'vertical-align-top' ? 'vertical-align-bottom' : 'vertical-align-top'
819
+ this.$refs.xForm.toggleVisible()
820
+ this.$refs.xTable.setScrollYHeight({})
821
+ },
822
+ /**
823
+ * 选择列事件
824
+ * @param selectedRowKeys 选中列Key集合
825
+ * @param selectedRows 选中列
826
+ */
827
+ selectRow (selectedRowKeys, selectedRows) {
828
+ this.table_selectedRowKeys = selectedRowKeys
829
+ this.table_selectedRows = selectedRows
830
+ this.$emit('selectRow', selectedRowKeys, selectedRows)
831
+ },
832
+ /**
833
+ * 清除勾选数据
834
+ */
835
+ clearRowKeys () {
836
+ this.$refs.xTable.clearRowKeys()
837
+ },
838
+ /**
839
+ * 刷新表格
840
+ * @param toFirstPage 是否到第一页
841
+ */
842
+ refreshTable (toFirstPage = true) {
843
+ this.$refs.xTable.refresh(toFirstPage)
844
+ },
845
+ /**
846
+ * 刷新表格
847
+ * @param toFirstPage 是否到第一页
848
+ */
849
+ refresh (toFirstPage = true) {
850
+ this.$refs.xTable.refresh(toFirstPage)
851
+ },
852
+ /**
853
+ * 获取表格数据
854
+ */
855
+ getTableData () {
856
+ return this.$refs.xTable.getTableData()
857
+ },
858
+ // 在行编辑等情况下,让界面生效
859
+ update () {
860
+ this.getTableData().push(...[])
861
+ },
862
+
863
+ /**
864
+ * 设置表格数据
865
+ */
866
+ setTableData (data) {
867
+ this.$refs.xTable.setTableData(data)
868
+ },
869
+ /**
870
+ * 表单本地提交
871
+ */
872
+ onLocalSubmit (res, callback) {
873
+ const form = res.realForm
874
+ if (res.businessType === '新增') {
875
+ this.$refs.xTable.appendLocalData(form)
876
+ } else {
877
+ this.$refs.xTable.modifyLocalData(form['序号'], form)
878
+ }
879
+ this.$message.success(res.businessType + '成功!')
880
+ this.onAddOrEditSubmitAfterSubmit(res, callback)
881
+ if (callback) {
882
+ callback()
883
+ }
884
+ },
885
+ emitFunc (func, ...args) {
886
+ this.$emit(func, ...args)
887
+ this.$emit('getEmitFuncData', func, ...args)
888
+ },
889
+ // 直接转发事件的函数
890
+ emitEvent (event, ...args) {
891
+ this.$emit(event, ...args)
892
+ },
893
+ // 添加处理 rowClick 的方法
894
+ handleRowClick (record) {
895
+ this.$emit('rowClick', record)
896
+ },
897
+ beforeDataChange (record) {
898
+ this.$emit('beforeDataChange', record)
899
+ },
900
+ onExpand (expanded, record) {
901
+ this.$emit('expand', expanded, record)
902
+ }
903
+ },
904
+ action: {
905
+ /**
906
+ * 实现doAction方法
907
+ */
908
+ doAction (actionType, args, data) {
909
+ switch (actionType) {
910
+ case 'refreshTable':
911
+ for (const item in args) {
912
+ console.log('item', item)
913
+ }
914
+ break
915
+ default:
916
+ break
917
+ }
918
+ }
919
+ },
920
+ mounted () {
921
+ if (!this.isMounted) {
922
+ // 防止多次调用
923
+ // 不知道为啥他会执行两次 mounted 暂时处理方式
924
+ this.initConfig()
925
+ this.isMounted = true
926
+ }
927
+ if (this.getSelectedData && typeof this.getSelectedData === 'function') {
928
+ const selectedId = this.getSelectedData()
929
+ if (!selectedId) {
930
+ return
931
+ }
932
+ if (typeof selectedId === 'object') {
933
+ const data = JSON.parse(JSON.stringify(selectedId))
934
+ if (data.selectedId) {
935
+ data.selected_id = data.selectedId
936
+ delete data.selectedId
937
+ }
938
+ Object.assign(this.fixedAddForm, data)
939
+ Object.assign(this.fixedQueryForm, data)
940
+ } else {
941
+ Object.assign(this.fixedAddForm, { selected_id: selectedId })
942
+ Object.assign(this.fixedQueryForm, { selected_id: selectedId })
943
+ }
944
+ }
945
+ }
946
+ }
947
+ </script>
948
+ <style lang="less" scoped>
949
+ .crud_title {
950
+ height: 32px;
951
+ font-size: 16px;
952
+ font-weight: 500;
953
+ color: #000000d9;
954
+ line-height: 32px;
955
+ margin-bottom: 12px;
956
+ }
957
+ // 表格行样式类型
958
+ .ant-table-tbody {
959
+ // 成功样式 - 绿色 (#52c41a)
960
+ .ant-table-row-success {
961
+ background-color: rgba(82, 196, 26, 0.2);
962
+
963
+ &:hover {
964
+ background-color: rgba(82, 196, 26, 0.3) !important;
965
+
966
+ td {
967
+ background-color: transparent;
968
+ }
969
+ }
970
+
971
+ // 选中状态
972
+ &.ant-table-row-selected {
973
+ background-color: rgba(82, 196, 26, 0.4);
974
+
975
+ td {
976
+ background-color: transparent;
977
+ }
978
+ }
979
+
980
+ td {
981
+ background-color: transparent;
982
+ }
983
+ }
984
+
985
+ // 警告样式 - 黄色 (#faad14)
986
+ .ant-table-row-warning {
987
+ background-color: rgba(250, 173, 20, 0.1) ;
988
+
989
+ &:hover {
990
+ background-color: rgba(250, 173, 20, 0.15) ;
991
+
992
+ td {
993
+ background-color: transparent ;
994
+ }
995
+ }
996
+
997
+ // 选中状态
998
+ &.ant-table-row-selected {
999
+ background-color: rgba(250, 173, 20, 0.2);
1000
+
1001
+ td {
1002
+ background-color: transparent;
1003
+ }
1004
+ }
1005
+
1006
+ td {
1007
+ background-color: transparent ;
1008
+ }
1009
+ }
1010
+
1011
+ // 错误样式 - 红色 (#f5222f)
1012
+ .ant-table-row-error {
1013
+ background-color: rgba(245, 34, 47, 0.1) ;
1014
+
1015
+ &:hover {
1016
+ background-color: rgba(245, 34, 47, 0.15) ;
1017
+
1018
+ td {
1019
+ background-color: transparent ;
1020
+ }
1021
+ }
1022
+
1023
+ // 选中状态
1024
+ &.ant-table-row-selected {
1025
+ background-color: rgba(245, 34, 47, 0.2) ;
1026
+
1027
+ td {
1028
+ background-color: transparent ;
1029
+ }
1030
+ }
1031
+
1032
+ td {
1033
+ background-color: transparent ;
1034
+ }
1035
+ }
1036
+
1037
+ // 魔法样式 - 紫色
1038
+ .ant-table-row-magic {
1039
+ background-color: rgba(114, 46, 209, 0.1) ;
1040
+
1041
+ &:hover {
1042
+ background-color: rgba(114, 46, 209, 0.15) ;
1043
+
1044
+ td {
1045
+ background-color: transparent ;
1046
+ }
1047
+ }
1048
+
1049
+ // 选中状态
1050
+ &.ant-table-row-selected {
1051
+ background-color: rgba(114, 46, 209, 0.2) ;
1052
+
1053
+ td {
1054
+ background-color: transparent ;
1055
+ }
1056
+ }
1057
+
1058
+ td {
1059
+ background-color: transparent ;
1060
+ }
1061
+ }
1062
+
1063
+ // 默认选中状态(没有特殊行样式时)
1064
+ .ant-table-row-selected:not(.ant-table-row-success):not(.ant-table-row-warning):not(.ant-table-row-error):not(.ant-table-row-magic) {
1065
+ background-color: rgba(24, 144, 255, 0.1) ;
1066
+ }
1067
+ }
1068
+ </style>
1069
+ <style>
1070
+
1071
+ .splitpanes.default-theme .splitpanes__splitter {
1072
+ border: 0;
1073
+ width: 1rem;
1074
+ position: relative;
1075
+
1076
+ &:before {
1077
+ content: '';
1078
+ position: absolute;
1079
+ left: 50%;
1080
+ top: 50%;
1081
+ transform: translate(-50%, -50%);
1082
+ width: 2px;
1083
+ height: 30px;
1084
+ border-radius: 1px;
1085
+ }
1086
+ }
1087
+
1088
+ .splitpanes.default-theme .splitpanes__pane {
1089
+ overflow: visible;
1090
+ background-color: transparent;
1091
+ }
1092
+
1093
+ </style>