vue2-client 1.17.39 → 1.17.40

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