vue2-client 1.12.59 → 1.12.61

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 (388) hide show
  1. package/.cursorrules +19 -19
  2. package/.env.gaslink +19 -19
  3. package/.env.his +19 -19
  4. package/.env.iot +19 -19
  5. package/.env.liuli +19 -19
  6. package/.env.revenue +19 -19
  7. package/.env.scada +19 -19
  8. package/.eslintrc.js +90 -90
  9. package/CHANGELOG.md +824 -824
  10. package/Components.md +60 -60
  11. package/docs/Logic/345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +45 -45
  12. package/docs/LowCode/lowcode.md +155 -155
  13. package/docs/LowCode/lowcodeForDeveloper.md +230 -230
  14. package/docs/index.md +30 -30
  15. package/index.js +31 -31
  16. package/jest-transform-stub.js +8 -8
  17. package/jest.setup.js +7 -7
  18. package/jsconfig.json +19 -19
  19. package/package.json +108 -108
  20. package/public/his/editor/editor.html +51 -51
  21. package/public/his/editor/mock/bind_data.html +779 -779
  22. package/public/his/editor/mock/data_table.html +40 -40
  23. package/public/his/editor/mock/sign.html +75 -75
  24. package/public/his/editor/vender/JsBarcode.all.js +3669 -3669
  25. package/public/his/editor/vender/date97/My97DatePicker.htm +65 -65
  26. package/public/his/editor/vender/date97/WdatePicker.js +677 -677
  27. package/public/his/editor/vender/date97/calendar.js +4 -4
  28. package/public/his/editor/vender/date97/lang/en.js +13 -13
  29. package/public/his/editor/vender/date97/lang/zh-cn.js +13 -13
  30. package/public/his/editor/vender/date97/lang/zh-tw.js +13 -13
  31. package/public/his/editor/vender/date97/skin/WdatePicker.css +10 -10
  32. package/public/his/editor/vender/date97/skin/default/datepicker.css +328 -328
  33. package/public/his/editor/vender/date97/skin/ext/datepicker.css +308 -308
  34. package/public/his/editor/vender/date97/skin/whyGreen/datepicker.css +255 -255
  35. package/public/his/editor/vender/diff.js +1627 -1627
  36. package/public/his/editor/vender/editor.js +1 -1
  37. package/public/his/editor/vender/fabric.js +31187 -31187
  38. package/public/his/editor/vender/jquery/jquery.base64.js +190 -190
  39. package/public/his/editor/vender/jquery/jquery.js +10872 -10872
  40. package/public/his/editor/vender/jquery/jquery.print.js +255 -255
  41. package/public/his/editor/vender/jquery/zTreeStyle/zTreeStyle.css +96 -96
  42. package/public/his/editor/vender/mui/mui.min.css +4 -4
  43. package/public/his/editor/vender/mui/mui.min.js +5 -5
  44. package/public/his/editor/vender/mui/mui.picker.min.css +6 -6
  45. package/public/his/editor/vender/mui/mui.picker.min.js +6 -6
  46. package/public/his/editor/vender/qrcode.js +7 -7
  47. package/public/his/editor/vender/requirejs/require.js +2145 -2145
  48. package/public/his/editor/vender/signature/jSignature.CompressorSVG.js +518 -518
  49. package/public/his/editor/vender/signature/jSignature.UndoButton.js +164 -164
  50. package/public/his/editor/vender/signature/jSignature.js +1486 -1486
  51. package/public/his/editor/vender/validator.js +5094 -5094
  52. package/public/his/editor/vender/weui/weui.css +5659 -5659
  53. package/public/his/editor/vender/weui/weui.min.css +4 -4
  54. package/public/his/editor/vender/weui/weui.min.js +11 -11
  55. package/public/index.html +27 -27
  56. package/src/ReportView.js +19 -19
  57. package/src/assets/img/querySlotDemo.svg +15 -15
  58. package/src/assets/svg/badtwo.svg +1 -1
  59. package/src/assets/svg/goodtwo.svg +1 -1
  60. package/src/base-client/components/AI/AskAiBtn.vue +136 -136
  61. package/src/base-client/components/AI/demo.vue +31 -31
  62. package/src/base-client/components/common/AMisRender/index.js +3 -3
  63. package/src/base-client/components/common/AMisRender/index.vue +263 -263
  64. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +470 -470
  65. package/src/base-client/components/common/AddressSearchCombobox/IcMapIcon.vue +16 -16
  66. package/src/base-client/components/common/AddressSearchCombobox/demo.vue +36 -36
  67. package/src/base-client/components/common/AddressSearchCombobox/ic_map.svg +6 -6
  68. package/src/base-client/components/common/AmapMarker/AmapPointRendering.vue +120 -120
  69. package/src/base-client/components/common/CitySelect/index.js +3 -3
  70. package/src/base-client/components/common/CitySelect/index.md +109 -109
  71. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -669
  72. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1014 -1014
  73. package/src/base-client/components/common/CreateQuery/index.js +3 -3
  74. package/src/base-client/components/common/CreateQuery/index.md +42 -42
  75. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +452 -452
  76. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +511 -511
  77. package/src/base-client/components/common/CreateSimpleFormQuery/index.js +3 -3
  78. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +42 -42
  79. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +149 -149
  80. package/src/base-client/components/common/FormGroupEdit/index.js +3 -3
  81. package/src/base-client/components/common/FormGroupEdit/index.md +43 -43
  82. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +166 -166
  83. package/src/base-client/components/common/FormGroupQuery/index.js +3 -3
  84. package/src/base-client/components/common/FormGroupQuery/index.md +43 -43
  85. package/src/base-client/components/common/JSONToTree/jsontotree.vue +271 -271
  86. package/src/base-client/components/common/LowCodeComponent/LowCodeEditorModal.vue +108 -108
  87. package/src/base-client/components/common/LowCodeComponent/LowCodeEditorPanel.vue +413 -413
  88. package/src/base-client/components/common/LowCodeComponent/LowCodePageOrganization.vue +502 -502
  89. package/src/base-client/components/common/LowCodeComponent/LowCodeRender.vue +728 -728
  90. package/src/base-client/components/common/LowCodeComponent/LowCodeRenderEnter.vue +29 -29
  91. package/src/base-client/components/common/LowCodeComponent/LowCodeUIStore.vue +219 -219
  92. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeAddPageModal.vue +117 -117
  93. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeCustomJSModal.vue +80 -80
  94. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeEventEditorModal.vue +398 -398
  95. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLifeCycleModal.vue +65 -65
  96. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicCallbackModal.vue +64 -64
  97. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeLogicParamModal.vue +73 -73
  98. package/src/base-client/components/common/LowCodeComponent/modal/lowCodeRunFunctionParamModal.vue +76 -76
  99. package/src/base-client/components/common/PersonSetting/PersonSetting.vue +208 -208
  100. package/src/base-client/components/common/PersonSetting/index.js +3 -3
  101. package/src/base-client/components/common/Recording/Recording.vue +243 -243
  102. package/src/base-client/components/common/Recording/index.js +3 -3
  103. package/src/base-client/components/common/Tree/Tree.vue +149 -149
  104. package/src/base-client/components/common/Tree/index.js +2 -2
  105. package/src/base-client/components/common/Upload/index.js +3 -3
  106. package/src/base-client/components/common/XAddForm/XAddForm.vue +113 -113
  107. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +1156 -1156
  108. package/src/base-client/components/common/XAddNativeForm/index.md +146 -146
  109. package/src/base-client/components/common/XAddNativeFormOA/XAddNativeFormOA.vue +303 -303
  110. package/src/base-client/components/common/XAddNativeFormOA/index.js +3 -3
  111. package/src/base-client/components/common/XAddNativeFormOA/index.md +146 -146
  112. package/src/base-client/components/common/XAddReport/index.js +3 -3
  113. package/src/base-client/components/common/XAddReport/index.md +56 -56
  114. package/src/base-client/components/common/XBadge/XBadge.vue +94 -94
  115. package/src/base-client/components/common/XButtons/XButtonDemo.vue +28 -28
  116. package/src/base-client/components/common/XButtons/XButtons.vue +71 -71
  117. package/src/base-client/components/common/XButtons/index.js +3 -3
  118. package/src/base-client/components/common/XButtons/index.md +61 -61
  119. package/src/base-client/components/common/XCard/XCard.vue +64 -64
  120. package/src/base-client/components/common/XCheckList/XCheckList.vue +106 -106
  121. package/src/base-client/components/common/XCheckList/XCheckListDemo.vue +41 -41
  122. package/src/base-client/components/common/XCollapse/XCollapse.vue +176 -154
  123. package/src/base-client/components/common/XCollapse/XCollapseDemo.vue +15 -0
  124. package/src/base-client/components/common/XDataCard/index.js +3 -3
  125. package/src/base-client/components/common/XDataCard/index.md +1 -1
  126. package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -180
  127. package/src/base-client/components/common/XDataDrawer/index.js +3 -3
  128. package/src/base-client/components/common/XDataDrawer/index.md +41 -41
  129. package/src/base-client/components/common/XDatePicker/demo.vue +153 -153
  130. package/src/base-client/components/common/XDatePicker/index.vue +269 -269
  131. package/src/base-client/components/common/XDescriptions/index.js +3 -3
  132. package/src/base-client/components/common/XDescriptions/index.md +83 -83
  133. package/src/base-client/components/common/XDetailsView/XDetailsView.vue +238 -238
  134. package/src/base-client/components/common/XDetailsView/index.js +3 -3
  135. package/src/base-client/components/common/XForm/XForm.vue +404 -404
  136. package/src/base-client/components/common/XForm/XFormItem.vue +1310 -1310
  137. package/src/base-client/components/common/XForm/XStatusButton.vue +54 -54
  138. package/src/base-client/components/common/XForm/XTreeSelect.vue +270 -270
  139. package/src/base-client/components/common/XForm/index.md +178 -178
  140. package/src/base-client/components/common/XForm/itemComponent/XClickChangeBtn/index.vue +49 -49
  141. package/src/base-client/components/common/XFormGroup/index.js +3 -3
  142. package/src/base-client/components/common/XFormGroup/index.md +38 -38
  143. package/src/base-client/components/common/XFormGroupDetails/XFormGroupDetails.vue +72 -72
  144. package/src/base-client/components/common/XFormGroupDetails/index.js +3 -3
  145. package/src/base-client/components/common/XFormTable/index.md +92 -92
  146. package/src/base-client/components/common/XImportExcel/XImportExcel.vue +167 -167
  147. package/src/base-client/components/common/XLabelSelect/XLabelSelect.vue +110 -110
  148. package/src/base-client/components/common/XLabelSelect/XLabelSelectDemo.vue +35 -35
  149. package/src/base-client/components/common/XLicensePlate/XLicensePlate.vue +193 -193
  150. package/src/base-client/components/common/XLicensePlate/XLicensePlateDemo.vue +48 -48
  151. package/src/base-client/components/common/XPrint/OpenInvoice.vue +21 -21
  152. package/src/base-client/components/common/XPrint/PrintBill.vue +302 -302
  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/XReport.vue +892 -892
  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/index.md +44 -44
  163. package/src/base-client/components/common/XReport/print.js +186 -186
  164. package/src/base-client/components/common/XReportDrawer/index.js +3 -3
  165. package/src/base-client/components/common/XReportGrid/XReportDesign.vue +616 -398
  166. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +700 -699
  167. package/src/base-client/components/common/XReportGrid/index.js +3 -3
  168. package/src/base-client/components/common/XReportGrid/index.md +44 -44
  169. package/src/base-client/components/common/XReportSlot/XReportSlot.vue +110 -110
  170. package/src/base-client/components/common/XReportSlot/index.js +3 -3
  171. package/src/base-client/components/common/XReportSlot/index.md +48 -48
  172. package/src/base-client/components/common/XSimpleDescriptions/XSimpleDescriptions.vue +166 -166
  173. package/src/base-client/components/common/XSimpleDescriptions/index.js +3 -3
  174. package/src/base-client/components/common/XSimpleDescriptions/index.md +7 -7
  175. package/src/base-client/components/common/XStepView/XStepView.vue +252 -252
  176. package/src/base-client/components/common/XStepView/index.js +3 -3
  177. package/src/base-client/components/common/XStepView/index.md +31 -31
  178. package/src/base-client/components/common/XTab/XTabDemo.vue +22 -22
  179. package/src/base-client/components/common/XTab/index.js +3 -3
  180. package/src/base-client/components/common/XTable/CustomFuncCel.vue +51 -51
  181. package/src/base-client/components/common/XTable/TableCellRenderer.vue +161 -161
  182. package/src/base-client/components/common/XTable/index.md +255 -255
  183. package/src/base-client/components/common/XTagGroup/index.vue +52 -52
  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/XHisEditor/index.js +3 -3
  192. package/src/base-client/components/his/XList/XList.vue +86 -0
  193. package/src/base-client/components/his/XSidebar/XSidebar.vue +1 -2
  194. package/src/base-client/components/index.js +51 -51
  195. package/src/base-client/components/layout/XPageView/XErrorView.vue +11 -11
  196. package/src/base-client/components/layout/XPageView/XPageView.vue +155 -155
  197. package/src/base-client/components/layout/XPageView/index.js +3 -3
  198. package/src/base-client/components/layout/XPageView/index.md +38 -38
  199. package/src/base-client/components/layout/XTreeView/XTreeView.vue +130 -130
  200. package/src/base-client/components/layout/XTreeView/index.js +3 -3
  201. package/src/base-client/components/layout/XTreeView/index.md +46 -46
  202. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +232 -232
  203. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
  204. package/src/base-client/plugins/AppData.js +126 -126
  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/FilePreview/FilePreview.vue +181 -181
  227. package/src/components/FilePreview/FilePreviewDemo.vue +30 -30
  228. package/src/components/HeightScanner/index.vue +571 -571
  229. package/src/components/NumberInfo/NumberInfo.vue +54 -54
  230. package/src/components/NumberInfo/index.js +3 -3
  231. package/src/components/NumberInfo/index.less +54 -54
  232. package/src/components/NumberInfo/index.md +43 -43
  233. package/src/components/STable/index.js +434 -434
  234. package/src/components/card/ChartCard.vue +79 -79
  235. package/src/components/chart/Bar.vue +60 -60
  236. package/src/components/chart/MiniArea.vue +67 -67
  237. package/src/components/chart/MiniBar.vue +59 -59
  238. package/src/components/chart/MiniProgress.vue +57 -57
  239. package/src/components/chart/Radar.vue +80 -80
  240. package/src/components/chart/RankingList.vue +60 -60
  241. package/src/components/chart/Trend.vue +79 -79
  242. package/src/components/chart/index.less +9 -9
  243. package/src/components/checkbox/ColorCheckbox.vue +157 -157
  244. package/src/components/checkbox/ImgCheckbox.vue +117 -117
  245. package/src/components/checkbox/ImgCheckboxGroup.vue +76 -76
  246. package/src/components/checkbox/index.js +9 -9
  247. package/src/components/exception/ExceptionPage.vue +70 -70
  248. package/src/components/g2Charts/constants.js +202 -202
  249. package/src/components/g2Charts/demo.vue +808 -808
  250. package/src/components/g2Charts/designer.vue +228 -228
  251. package/src/components/g2Charts/designerBaseConfig.vue +61 -61
  252. package/src/components/g2Charts/designerDataConfig.vue +259 -259
  253. package/src/components/g2Charts/designerStyleConfig.vue +16 -16
  254. package/src/components/g2Charts/index.vue +397 -397
  255. package/src/components/index.js +36 -36
  256. package/src/components/input/IInput.vue +66 -66
  257. package/src/components/menu/SideMenu.vue +75 -75
  258. package/src/components/menu/menu.js +273 -273
  259. package/src/components/setting/Setting.vue +234 -234
  260. package/src/components/tool/AStepItem.vue +60 -60
  261. package/src/config/CreateQueryConfig.js +325 -325
  262. package/src/config/default/antd.config.js +89 -89
  263. package/src/config/default/setting.config.js +55 -55
  264. package/src/font-style/font.css +4 -4
  265. package/src/layouts/CommonLayout.vue +56 -56
  266. package/src/layouts/PageLayout.vue +151 -151
  267. package/src/layouts/SinglePageView.vue +136 -136
  268. package/src/layouts/header/AdminHeader.vue +132 -132
  269. package/src/layouts/header/HeaderNotice.vue +177 -177
  270. package/src/layouts/header/InstitutionDetail.vue +181 -181
  271. package/src/layouts/tabs/TabsHead.vue +189 -189
  272. package/src/layouts/tabs/TabsView.vue +389 -389
  273. package/src/lib.js +1 -1
  274. package/src/main.js +34 -34
  275. package/src/mixins/formValidationMixin.js +46 -46
  276. package/src/mock/extend/index.js +84 -84
  277. package/src/mock/goods/index.js +108 -108
  278. package/src/pages/AMisDemo/AMisDemo.vue +325 -325
  279. package/src/pages/AMisDemo/AMisDemo2.vue +74 -74
  280. package/src/pages/DefaultExample/index.vue +77 -77
  281. package/src/pages/DynamicStatistics/ChartSelector.vue +331 -331
  282. package/src/pages/DynamicStatistics/DataTabs.vue +83 -83
  283. package/src/pages/DynamicStatistics/DynamicTable.vue +128 -128
  284. package/src/pages/DynamicStatistics/EvaluationArea.vue +69 -69
  285. package/src/pages/DynamicStatistics/FavoriteList.vue +50 -50
  286. package/src/pages/DynamicStatistics/QuestionHistoryAndFavorites.vue +591 -591
  287. package/src/pages/DynamicStatistics/SearchBar.vue +192 -192
  288. package/src/pages/DynamicStatistics/index.vue +282 -282
  289. package/src/pages/Example/childIndex.vue +15 -15
  290. package/src/pages/Example/index.vue +30 -30
  291. package/src/pages/NewDynamicStatistics/ChartSelector.vue +331 -331
  292. package/src/pages/NewDynamicStatistics/DataTabs.vue +122 -122
  293. package/src/pages/NewDynamicStatistics/DynamicTable.vue +128 -128
  294. package/src/pages/NewDynamicStatistics/EvaluationArea.vue +69 -69
  295. package/src/pages/NewDynamicStatistics/FavoriteList.vue +50 -50
  296. package/src/pages/NewDynamicStatistics/QuestionHistoryAndFavorites.vue +289 -289
  297. package/src/pages/NewDynamicStatistics/SearchBar.vue +193 -193
  298. package/src/pages/NewDynamicStatistics/index.vue +258 -258
  299. package/src/pages/Recording/index.vue +77 -77
  300. package/src/pages/ServiceReview/index.vue +284 -284
  301. package/src/pages/SubExample/index.vue +26 -26
  302. package/src/pages/WorkflowDetail/WorkflowDetail.vue +235 -235
  303. package/src/pages/WorkflowDetail/WorkflowPageDetail/LeaveMessage.vue +131 -131
  304. package/src/pages/WorkflowDetail/WorkflowPageDetail/TrimTextTail.vue +23 -23
  305. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformation.vue +302 -302
  306. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformationDetails.vue +276 -276
  307. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandleReso.vue +997 -997
  308. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +222 -222
  309. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkOrderParentDetails.vue +233 -233
  310. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowDetailResso.vue +261 -261
  311. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowListResolution.vue +248 -248
  312. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowLog.vue +73 -73
  313. package/src/pages/XPageViewExample/index.vue +38 -38
  314. package/src/pages/XReportView/index.vue +64 -64
  315. package/src/pages/XTreeOneProExample/index.vue +67 -67
  316. package/src/pages/dashboard/workplace/WorkPlace.vue +141 -141
  317. package/src/pages/login/Login.vue +378 -378
  318. package/src/pages/login/LoginV3.vue +389 -389
  319. package/src/pages/lowCode/lowCodeEditor.vue +1219 -1219
  320. package/src/pages/lowCode/lowCodeRenderPage.vue +43 -43
  321. package/src/pages/report/ReportTable.js +124 -124
  322. package/src/pages/resourceManage/orgListManage.vue +98 -98
  323. package/src/pages/system/dictionary/index.vue +44 -44
  324. package/src/pages/system/monitor/loginInfor/index.vue +37 -37
  325. package/src/pages/system/monitor/operLog/index.vue +37 -37
  326. package/src/pages/system/settings/modifyPassword.vue +117 -117
  327. package/src/pages/system/ticket/index.vue +480 -480
  328. package/src/pages/system/ticket/submitTicketSuccess.vue +484 -484
  329. package/src/pages/userInfoDetailManage/ChangeMeterRecordQuery/index.vue +64 -64
  330. package/src/pages/userInfoDetailManage/FillCardRecordQuery/index.vue +76 -76
  331. package/src/pages/userInfoDetailManage/FillGasRecordQuery/index.vue +74 -74
  332. package/src/pages/userInfoDetailManage/InfoChangeRecordQuery/index.vue +64 -64
  333. package/src/pages/userInfoDetailManage/InstructRecordQuery/index.vue +64 -64
  334. package/src/pages/userInfoDetailManage/MachineRecordQuery/index.vue +74 -74
  335. package/src/pages/userInfoDetailManage/MeterParamRecordQuery/index.vue +64 -64
  336. package/src/pages/userInfoDetailManage/OtherChargeRecordQuery/index.vue +74 -74
  337. package/src/pages/userInfoDetailManage/TransferRecordQuery/index.vue +66 -66
  338. package/src/pages/userInfoDetailManage/UserChargeRecordQuery/index.vue +92 -92
  339. package/src/pages/userInfoDetailManage/UserHandRecordQuery/index.vue +86 -86
  340. package/src/pages/userInfoDetailManage/UserRecordQuery/index.vue +73 -73
  341. package/src/pages/userInfoDetailManage/WatchCollectionRecordQuery/index.vue +64 -64
  342. package/src/pages/userInfoDetailManage/userInfoDetailQueryTabs.vue +132 -132
  343. package/src/plugins/EventLogPlugin.js +33 -33
  344. package/src/plugins/FindParentsData.js +17 -17
  345. package/src/router/async/config.async.js +35 -35
  346. package/src/router/async/router.map.js +122 -119
  347. package/src/router/index.js +27 -27
  348. package/src/router.js +19 -19
  349. package/src/services/DataModel.js +30 -30
  350. package/src/services/LodopFuncs.js +137 -137
  351. package/src/services/api/TicketDetailsViewApi.js +46 -46
  352. package/src/services/api/cas.js +79 -79
  353. package/src/services/api/common.js +346 -346
  354. package/src/services/api/entity.js +18 -18
  355. package/src/services/api/index.js +17 -17
  356. package/src/services/api/restTools.js +145 -145
  357. package/src/services/api/workFlow.js +63 -63
  358. package/src/services/apiService.js +16 -16
  359. package/src/store/modules/account.js +115 -115
  360. package/src/store/modules/index.js +5 -5
  361. package/src/store/modules/lowCode.js +33 -33
  362. package/src/store/modules/setting.js +119 -119
  363. package/src/theme/default/style.less +58 -58
  364. package/src/theme/global.less +159 -159
  365. package/src/utils/authority-utils.js +85 -85
  366. package/src/utils/errorCode.js +6 -6
  367. package/src/utils/formatter.js +74 -74
  368. package/src/utils/htmlToPDF.js +108 -108
  369. package/src/utils/htmlToPDFApi.js +5 -5
  370. package/src/utils/login.js +188 -188
  371. package/src/utils/lowcode/lowcodeComponentMixin.js +120 -120
  372. package/src/utils/lowcode/lowcodeLog.js +29 -29
  373. package/src/utils/lowcode/lowcodeUtils.js +373 -373
  374. package/src/utils/lowcode/registerComponentForEditor.js +1 -1
  375. package/src/utils/lowcode/registerComponentForRender.js +11 -11
  376. package/src/utils/map-utils.js +47 -47
  377. package/src/utils/reg.js +95 -95
  378. package/src/utils/runEvalFunction.js +14 -14
  379. package/src/utils/theme-color-replacer-extend.js +92 -92
  380. package/src/utils/util.js +329 -329
  381. package/src/utils/waterMark.js +31 -31
  382. package/test/Amis.spec.js +164 -164
  383. package/test/Tree.spec.js +168 -168
  384. package/test/myDialog.spec.js +47 -47
  385. package/test/util.test.js +53 -53
  386. package/test/v3Api.test.js +1984 -1984
  387. package/vue.config.js +214 -214
  388. package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -15
@@ -1,699 +1,700 @@
1
- <template>
2
- <a-row id="has_row" type="flex" :gutter="gutter" :style="isWidget ? {margin: '0px'} : {'margin-bottom': '.5rem'}">
3
- <template v-for="(cell, cellIndex) in columns">
4
- <a-col
5
- name="trGroup"
6
- v-if="Array.isArray(cell) || !cell.dontShowRow"
7
- :key="cellIndex"
8
- :ref="`trGroup_${ cell.slotRef || cellIndex}`"
9
- @hook:mounted="(h)=>applyAllStyles(cell,cellIndex)"
10
- :span="calculateColSpan(cell)">
11
- <div id="report_widget" v-if="isWidget">
12
- <!-- 插槽渲染 -->
13
- <template v-if="Array.isArray(cell)">
14
- <!-- 处理 cell 是数组的情况 -->
15
- <div v-for="(item, index) in cell" :key="index">
16
- <x-report-tr-group
17
- :env="env"
18
- :key="index"
19
- :columns="recalculateItem(item)"
20
- :config-data="configData"
21
- :config="config"
22
- :display="true">
23
- </x-report-tr-group>
24
- </div>
25
- </template>
26
- <template v-else-if="cell.type === 'slot'">
27
- <template
28
- v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar'].includes(cell.slotType)">
29
- <component
30
- :is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
31
- :key="cellIndex"
32
- :ref="`dynamicComponent_${ cell.slotRef || cellIndex}`"
33
- :serviceName="cell.serviceName"
34
- :serverName="cell.serviceName"
35
- v-on="getEventHandlers(cell)"
36
- @hook:mounted="(h)=>onComponentMounted(h,cell,cellIndex)"
37
- :queryParamsName="cell.slotConfig"
38
- :configName="cell.slotConfig"
39
- :countVisible="false"
40
- :env="env"
41
- />
42
- </template>
43
- </template>
44
- </div>
45
- <a-card v-else class="flexItem" :bordered="false">
46
- <!-- 插槽渲染 -->
47
- <template v-if="Array.isArray(cell)">
48
- <!-- 处理 cell 是数组的情况 -->
49
- <div v-for="(item, index) in cell" :key="index">
50
- <x-report-tr-group
51
- :server-name="serverName"
52
- :env="env"
53
- :key="index"
54
- :columns="recalculateItem(item)"
55
- :config-data="configData"
56
- :config="config"
57
- :display="true">
58
- </x-report-tr-group>
59
- </div>
60
- </template>
61
- <template v-else-if="cell.type === 'slot'">
62
- <template
63
- v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse', 'x-h-descriptions', 'x-sidebar'].includes(cell.slotType)">
64
- <component
65
- :is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
66
- :key="cellIndex"
67
- :ref="`dynamicComponent_${ cell.slotRef || cellIndex}`"
68
- :serviceName="cell.serviceName"
69
- :serverName="cell.serviceName"
70
- v-on="getEventHandlers(cell)"
71
- @hook:mounted="(h)=>onComponentMounted(h,cell,cellIndex)"
72
- :queryParamsName="cell.slotConfig"
73
- :configName="cell.slotConfig"
74
- :countVisible="false"
75
- :env="env"
76
- />
77
- </template>
78
- </template>
79
- </a-card>
80
- </a-col>
81
- </template>
82
- </a-row>
83
- </template>
84
-
85
- <script>
86
- import Upload from '@vue2-client/base-client/components/common/Upload'
87
- import { getRealKeyData } from '@vue2-client/utils/util'
88
- import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
89
- import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
90
- import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@vue2-client/utils/microAppUtils'
91
-
92
- export default {
93
- name: 'XReportTrGroup',
94
- components: {
95
- Upload,
96
- XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'),
97
- XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'),
98
- XFormGroup: () => import('@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'),
99
- XTreePro: () => import('@vue2-client/base-client/components/common/XTree/XTreePro.vue'),
100
- XHisEditor: () => import('@vue2-client/base-client/components/his/XHisEditor/XHisEditor.vue'),
101
- XTab: () => import('@vue2-client/base-client/components/common/XTab/XTab.vue'),
102
- XReport: () => import('@vue2-client/base-client/components/common/XReport/XReport.vue'),
103
- XButtons: () => import('@vue2-client/base-client/components/common/XButtons/XButtons.vue'),
104
- XLabelSelect: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelect.vue'),
105
- XConversation: () => import('@vue2-client/base-client/components/common/XConversation/XConversation.vue'),
106
- XCheckList: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
107
- XCardSet: () => import('@vue2-client/base-client/components/common/XCardSet/XCardSet.vue'),
108
- XCollapse: () => import('@vue2-client/base-client/components/common/XCollapse/XCollapse.vue'),
109
- XHDescriptions: () => import('@vue2-client/base-client/components/his/XHDescriptions/XHDescriptions.vue'),
110
- XSidebar: () => import('@vue2-client/base-client/components/his/XSidebar/XSidebar.vue'),
111
- },
112
- props: {
113
- // 每一行的配置
114
- columns: {
115
- type: Array,
116
- required: true
117
- },
118
- showImgInCell: {
119
- type: Boolean,
120
- default: false
121
- },
122
- config: {
123
- type: Object,
124
- default: function () {
125
- return {}
126
- }
127
- },
128
- // 命名空间
129
- serverName: {
130
- type: String,
131
- default: 'af-system'
132
- },
133
- // 环境
134
- env: {
135
- type: String,
136
- default: 'prod'
137
- },
138
- // 原始配置
139
- configData: {
140
- type: Object,
141
- required: true
142
- },
143
- // 是否为展示行
144
- display: {
145
- type: Boolean,
146
- default: false
147
- },
148
- },
149
- computed: {
150
- allSlotSum () {
151
- // 计算总共有多少个Slot
152
- let sum = 0
153
- this.columns.forEach((item) => {
154
- console.log('item', item)
155
- if (Array.isArray(item)) {
156
- item.forEach((cell) => {
157
- if (cell.type === 'slot') {
158
- sum++
159
- }
160
- })
161
- } else if (item.type && item.type === 'slot') {
162
- sum++
163
- }
164
- })
165
- console.log(`=总共有 ${sum} 个插槽栅格`)
166
- return sum
167
- }
168
- },
169
- data () {
170
- return {
171
- gutter: [8, { xs: 8, sm: 16, md: 24, lg: 32 }], // 设置水槽大小
172
- maxColSpan: 12,
173
- uploadParams: {
174
- type: 'image',
175
- accept: ['*'],
176
- resUploadStock: 1,
177
- pathKey: 'cs'
178
- },
179
- mixinData: {},
180
- flexItemBodyState: {},
181
- // 已经渲染得插槽得数量
182
- slotRendered: 0,
183
- // tableConfig: {}
184
- }
185
- },
186
- watch: {
187
- columns: {
188
- deep: true,
189
- immediate: true,
190
- handler (newVal) {
191
- console.log('columns变化:', JSON.parse(JSON.stringify(newVal)))
192
- // 使用nextTick确保DOM更新
193
- this.$nextTick(() => {
194
- this.$forceUpdate()
195
- })
196
- }
197
- }
198
- },
199
- inject: ['openDialog', 'emitEvent', 'registerComponent', 'setColSpanByName', 'setGlobalData', 'getGlobalData', 'getComponentByName', 'runLogic', 'getMixinData', 'getSelectedId', 'isInAModal', 'getConfigByName', 'getSelectedData', 'getOutEnv', 'currUser', 'isWidget'],
200
- methods: {
201
- getWindow,
202
- isMicroAppEnv,
203
- microDispatch,
204
- getMicroData,
205
- getRealKeyData,
206
- calculateColSpan (cell) {
207
- return Array.isArray(cell)
208
- ? cell[0][0]?.colSpan * 2
209
- : (cell?.colSpan ?? cell?.def?.colSpan ?? 1) * 2
210
- },
211
- applyAllStyles (cell, cellIndex) {
212
- // 应用组件样式
213
- const component = this.$refs[`trGroup_${ cell.slotRef || cellIndex}`][0]
214
- // 确保组件已经完全挂载
215
- this.$nextTick(() => {
216
- this.applyComponentStyles(component, cell, cellIndex)
217
- })
218
- },
219
- onComponentMounted (h, cell, cellIndex) {
220
- this.slotRendered += 1
221
- if (this.slotRendered >= this.allSlotSum) {
222
- this.$emit('slotRendered')
223
- }
224
- if (this.getMixinData && this.getMixinData()) {
225
- this.mixinData = this.getMixinData()
226
- }
227
- if (cell.slotRef) {
228
- this.registerComponent(cell.slotRef, this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0])
229
- }
230
- // 传递给祖先组件
231
- console.log(`插槽组件已经初始化 slotType ${cell.slotType},ref= dynamicComponent_${cell.slotRef || cellIndex} , serviceName = ${cell.serviceName}`)
232
- const shouldInit = cell.shouldInit == null ? true : cell.shouldInit
233
- if (shouldInit) {
234
- if (cell.slotType === 'x-add-native-form') {
235
- // 简易表单需要主动调用初始化方法
236
- getConfigByName(cell.slotConfig, cell.serviceName, async (res) => {
237
- // 如果配置了 表单初始化logic
238
- // 调用 logic 获取参数
239
- let param = { ...this.mixinData }
240
- let selectedId
241
- if (res.paramLogicName) {
242
- if (!!this.getSelectedId) {
243
- selectedId = this.getSelectedId()
244
- if (typeof selectedId !== 'object') {
245
- selectedId = { selectedId: selectedId }
246
- }
247
- }
248
- param = Object.assign(param, await runLogic(res.paramLogicName, selectedId, cell.serviceName))
249
- }
250
- console.info('给表单赋值', res)
251
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
252
- serviceName: cell.serviceName,
253
- configName: cell.slotConfig,
254
- formItems: res.formJson,
255
- showSubmitBtn: !this.isInAModal,
256
- businessType: param.businessType || '新增',
257
- layout: res.xAddFormLayout,
258
- primaryKey: res.primaryKey,
259
- ...res,
260
- fixedAddForm: param,
261
- modifyModelData: {
262
- files: param.files,
263
- images: param.images
264
- }
265
- })
266
- }, this.env === 'dev')
267
- } else if (cell.slotType === 'x-form-group') {
268
- // 简易表单需要主动调用初始化方法
269
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
270
- // 如果配置了 表单初始化logic
271
- // 调用 logic 获取参数
272
- const param = { ...this.mixinData }
273
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
274
- ...res,
275
- serviceName: cell.serviceName,
276
- showSubmitBtn: !this.isInAModal,
277
- businessType: param.businessType || '新增',
278
- modifyModelData: param,
279
- showLeftTab: true,
280
- })
281
- }, this.env === 'dev')
282
- } else if (cell.slotType === 'x-buttons') {
283
- // 按钮组需要主动调用初始化方法
284
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
285
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
286
- ...res,
287
- serviceName: cell.serviceName,
288
- })
289
- }, this.env === 'dev')
290
- } else if (cell.slotType === 'x-label-select') {
291
- // 按钮组需要主动调用初始化方法
292
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
293
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
294
- ...res,
295
- serviceName: cell.serviceName,
296
- })
297
- }, this.env === 'dev')
298
- }
299
- }
300
- if (cell.slotType === 'x-report') {
301
- const param = { ...this.mixinData }
302
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init(param)
303
- }
304
- if (cell.slotType === 'x-conversation') {
305
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
306
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
307
- serviceName: cell.serviceName,
308
- ...res,
309
- })
310
- }, this.env === 'dev')
311
- }
312
- if (cell.slotType === 'x-check-list') {
313
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
314
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
315
- serviceName: cell.serviceName,
316
- ...res,
317
- })
318
- }, this.env === 'dev')
319
- }
320
- },
321
- recalculateItem (item) {
322
- const totalColSpan = item.reduce((sum, cell) => {
323
- // 保留手动设置的colSpan
324
- return sum + (cell._isManualColSpan ? 0 : (cell.colSpan || 1))
325
- }, 0)
326
- return item.map(cell => {
327
- // 跳过已手动设置的单元格
328
- if (cell._isManualColSpan) return cell
329
- const newColSpan = Math.round((cell.colSpan || 1) / totalColSpan * 12)
330
- return {
331
- ...cell,
332
- colSpan: newColSpan,
333
- // 标记自动计算的单元格
334
- _isAutoCalculated: true
335
- }
336
- })
337
- },
338
-
339
- getEventHandlers (cell) {
340
- const handlers = {}
341
- if (!cell?.events || cell?.events?.length === 0) {
342
- return handlers
343
- }
344
- cell.events.forEach(event => {
345
- handlers[event.type] = async (...args) => {
346
- console.info('Event handled:', event.type, args)
347
- let func = event.customFunction
348
- if (func && func.startsWith('function')) {
349
- func = func.replace('function', 'async function')
350
- }
351
- const result = await executeStrFunctionByContext(this, func, args)
352
- if (result instanceof Promise) {
353
- result.then((res) => {
354
- if (!res) return
355
- let messageType = 'success'
356
- // 如果传递了组件名字 自动调用刷新
357
- if (res?.name) {
358
- const waitRefreshRef = this.getComponentByName(res.name)
359
- if (waitRefreshRef) {
360
- waitRefreshRef.refresh()
361
- } else {
362
- console.warn(`未找到组件${res.name}无法刷新`)
363
- }
364
- }
365
- // 如果传递消息类型 自动调用消息
366
- if (res?.messageType) {
367
- messageType = res.messageType
368
- }
369
- // 如果传递了提示信息自动调用提示
370
- if (res?.message) {
371
- this.$message[messageType](res?.message)
372
- }
373
- })
374
- }
375
- }
376
- })
377
- return handlers
378
- },
379
- getComponentName (queryParamsName, serviceName, componentName) {
380
- return componentName
381
- },
382
- // 判断单元格样式
383
- determineCellStyle (cell, color = '#000', borderWidth = '1px') {
384
- // 如果声明了borderColor
385
- if (this.config.style.borderColor) {
386
- color = this.config.style.borderColor
387
- }
388
- let result = {}
389
- // 如果表格也声明了样式,用表格样式将样式覆盖
390
- if (cell.style) {
391
- if (cell.noBorder) {
392
- result = { ...cell.style }
393
- } else {
394
- if (this.noTopBorder) {
395
- result = { ...cell.style }
396
- } else {
397
- result = { ...cell.style }
398
- }
399
- }
400
- return result
401
- }
402
- return result
403
- },
404
- // 把用户定义的组件,传递到整个杉格中,方便调用
405
- passComponentNamesToAncestor (refs) {
406
- console.log('组件的keys', Object.entries(refs), refs)
407
- // 遍历所有 refs
408
- Object.entries(refs).forEach(([refKey, refValue]) => {
409
- // 检查 ref 是否以 dynamicComponent_ 开头
410
- if (refKey.startsWith('dynamicComponent_')) {
411
- console.log('组件名存在')
412
- const componentRef = refValue[0]
413
- if (componentRef) {
414
- // 去掉前缀并获取组件名字
415
- const index = refKey.replace('dynamicComponent_', '') // 去掉前缀
416
- console.log('注册组件', index)
417
- // 传递给祖先组件
418
- this.registerComponent(index, componentRef)
419
- }
420
- }
421
- })
422
- },
423
- // 获取组件样式配置
424
- async getComponentStyleConfig (componentType) {
425
- try {
426
- // 从配置中获取样式定义
427
- const styleConfig = this.$appdata.getStylesByKey(componentType)
428
- return styleConfig || {}
429
- } catch (error) {
430
- console.error('获取组件样式配置失败:', error)
431
- return {}
432
- }
433
- },
434
-
435
- // 解析组件样式配置
436
- async parseComponentStyles (cell) {
437
- if (!cell.class) return { rootStyles: {}, childStyles: {} }
438
-
439
- const styleConfig = await this.getComponentStyleConfig(cell.slotType)
440
- if (!styleConfig) return { rootStyles: {}, childStyles: {} }
441
-
442
- const rootStyles = {}
443
- const childStyles = new Map()
444
-
445
- // 处理每个class配置
446
- cell.class.split(' ').forEach(className => {
447
- const classConfig = styleConfig[className]
448
- if (!classConfig) return
449
-
450
- // 处理根节点样式
451
- Object.entries(classConfig).forEach(([key, value]) => {
452
- if (!key.startsWith('*') && typeof key !== 'object') {
453
- rootStyles[key] = value
454
- }
455
- })
456
-
457
- // 处理子节点样式
458
- this.parseNestedStyles(classConfig, childStyles)
459
- })
460
-
461
- console.warn('样式配置', rootStyles, childStyles)
462
- return {
463
- rootStyles,
464
- childStyles
465
- }
466
- },
467
-
468
- // 递归解析嵌套的样式配置
469
- parseNestedStyles (config, styleMap, parentKey = '') {
470
- Object.entries(config).forEach(([key, value]) => {
471
- if (!key.startsWith('*')) return
472
-
473
- const className = key.replace('*', '.')
474
-
475
- // 如果值是对象,检查是否包含样式和子节点
476
- if (typeof value === 'object') {
477
- const { style = {}, children = {} } = this.separateStyleAndChildren(value)
478
-
479
- // 创建或获取当前节点的样式配置
480
- if (!styleMap.has(className)) {
481
- styleMap.set(className, {
482
- styles: {},
483
- children: new Map()
484
- })
485
- }
486
-
487
- const nodeData = styleMap.get(className)
488
-
489
- // 合并样式
490
- Object.assign(nodeData.styles, style)
491
-
492
- // 递归处理子节点
493
- this.parseNestedStyles(children, nodeData.children, className)
494
- }
495
- })
496
- },
497
-
498
- // 分离样式属性和子节点配置
499
- separateStyleAndChildren (obj) {
500
- const style = {}
501
- const children = {}
502
-
503
- Object.entries(obj).forEach(([key, value]) => {
504
- if (key.startsWith('*')) {
505
- // 子节点配置
506
- children[key] = value
507
- } else {
508
- // 样式属性
509
- style[key] = value
510
- }
511
- })
512
-
513
- return { style, children }
514
- },
515
-
516
- // 应用组件样式
517
- async applyComponentStyles (component, cell, cellIndex) {
518
- if (!component || !component.$el) return
519
-
520
- const { rootStyles, childStyles } = await this.parseComponentStyles(cell)
521
-
522
- // 应用根节点样式
523
- if (Object.keys(rootStyles).length > 0) {
524
- Object.entries(rootStyles).forEach(([property, value]) => {
525
- component.$el.style.setProperty(property, value, 'important')
526
- })
527
- }
528
-
529
- // 如果没有子节点样式,直接返回
530
- if (childStyles.size === 0) return
531
-
532
- let retryCount = 0
533
- const maxRetries = 5
534
- const retryInterval = 100 // 100ms
535
-
536
- const applyStyles = () => {
537
- this.applyChildStylesOptimized(component.$el, childStyles)
538
- }
539
-
540
- // 首次应用样式
541
- applyStyles()
542
-
543
- // 创建重试机制
544
- const retryApplyStyles = () => {
545
- if (retryCount >= maxRetries) return
546
-
547
- setTimeout(() => {
548
- applyStyles()
549
- retryCount++
550
- retryApplyStyles()
551
- }, retryInterval)
552
- }
553
-
554
- // 开始重试
555
- retryApplyStyles()
556
-
557
- // 创建 MutationObserver 用于动态内容
558
- const observer = new MutationObserver((mutations) => {
559
- // 检查是否有新增节点
560
- const hasNewNodes = mutations.some(mutation =>
561
- mutation.type === 'childList' && mutation.addedNodes.length > 0
562
- )
563
-
564
- if (hasNewNodes) {
565
- applyStyles()
566
- }
567
- })
568
-
569
- // 配置 observer
570
- observer.observe(component.$el, {
571
- childList: true,
572
- subtree: true,
573
- attributes: false
574
- })
575
-
576
- // 3秒后停止观察
577
- setTimeout(() => {
578
- observer.disconnect()
579
- }, 3000)
580
-
581
- // 组件销毁时清理
582
- this.$once('hook:beforeDestroy', () => {
583
- observer.disconnect()
584
- })
585
- },
586
-
587
- // 优化后的子节点样式应用方法
588
- applyChildStylesOptimized (rootElement, styleMap, parentSelector = '') {
589
- if (!rootElement) return
590
-
591
- // 处理样式映射
592
- for (const [selector, data] of styleMap.entries()) {
593
- const currentSelector = parentSelector ? `${parentSelector} ${selector}` : selector
594
-
595
- try {
596
- // 查找匹配的元素
597
- const elements = Array.from(rootElement.querySelectorAll(currentSelector))
598
-
599
- if (!elements.length) continue
600
-
601
- // 应用当前层级样式
602
- if (data.styles) {
603
- elements.forEach(element => {
604
- if (!element) return
605
-
606
- // 应用每个样式属性
607
- Object.entries(data.styles).forEach(([property, value]) => {
608
- try {
609
- element.style.setProperty(property, value, 'important')
610
- } catch (err) {
611
- console.warn(`设置样式失败: ${property}=${value}`, err)
612
- }
613
- })
614
- })
615
- }
616
-
617
- // 处理子层级
618
- if (data.children && data.children.size > 0) {
619
- elements.forEach(element => {
620
- if (element) {
621
- this.applyChildStylesOptimized(element, data.children, currentSelector)
622
- }
623
- })
624
- }
625
- } catch (err) {
626
- console.warn(`处理选择器失败: ${currentSelector}`, err)
627
- continue
628
- }
629
- }
630
- },
631
- },
632
- beforeMount () {
633
- if (this.useOssForImg) {
634
- this.uploadParams.resUploadMode = 'oss'
635
- }
636
- },
637
- mounted () {
638
- },
639
- }
640
-
641
- </script>
642
-
643
- <style scoped lang="less">
644
- .inputsDiv {
645
- display: flex;
646
- justify-content: space-between;
647
-
648
- .inputsDivItem {
649
- display: flex;
650
- align-items: center;
651
- padding: 0 4px;
652
- white-space: nowrap;
653
-
654
- .inputsDivItemLabel {
655
- padding: 0 4px;
656
- }
657
- }
658
- }
659
-
660
- .tdNoBorder {
661
- border-left: 1px solid #000;
662
- border-right: 1px solid #000;
663
- padding: 8px;
664
- }
665
-
666
- .tdWithBorder {
667
- border: 1px solid #000;
668
- padding: 8px;
669
- }
670
-
671
- .tdWithNoTopBorder {
672
- border-top-style: none;
673
- border-left: 1px solid #000;
674
- border-right: 1px solid #000;
675
- border-bottom: 1px solid #000;
676
- padding: 8px;
677
- }
678
-
679
- .grid-content {
680
- border-radius: 4px;
681
- min-height: 36px;
682
- text-align: center;
683
- color: #fff;
684
- background-color: #606266;
685
- }
686
-
687
- .bg-purple {
688
- background: #9254de;
689
- }
690
-
691
- .bg-purple-light {
692
- background: #b37feb;
693
- }
694
-
695
- .flexItem {
696
- border-radius: 8px;
697
- height: 100%;
698
- }
699
- </style>
1
+ <template>
2
+ <a-row id="has_row" type="flex" :gutter="gutter" :style="isWidget ? {margin: '0px'} : {'margin-bottom': '.5rem'}">
3
+ <template v-for="(cell, cellIndex) in columns">
4
+ <a-col
5
+ name="trGroup"
6
+ v-if="Array.isArray(cell) || !cell.dontShowRow"
7
+ :key="cellIndex"
8
+ :ref="`trGroup_${ cell.slotRef || cellIndex}`"
9
+ @hook:mounted="(h)=>applyAllStyles(cell,cellIndex)"
10
+ :span="calculateColSpan(cell)">
11
+ <div id="report_widget" v-if="isWidget">
12
+ <!-- 插槽渲染 -->
13
+ <template v-if="Array.isArray(cell)">
14
+ <!-- 处理 cell 是数组的情况 -->
15
+ <div v-for="(item, index) in cell" :key="index">
16
+ <x-report-tr-group
17
+ :env="env"
18
+ :key="index"
19
+ :columns="recalculateItem(item)"
20
+ :config-data="configData"
21
+ :config="config"
22
+ :display="true">
23
+ </x-report-tr-group>
24
+ </div>
25
+ </template>
26
+ <template v-else-if="cell.type === 'slot'">
27
+ <template
28
+ v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse','x-h-descriptions', 'x-sidebar', 'x-list'].includes(cell.slotType)">
29
+ <component
30
+ :is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
31
+ :key="cellIndex"
32
+ :ref="`dynamicComponent_${ cell.slotRef || cellIndex}`"
33
+ :serviceName="cell.serviceName"
34
+ :serverName="cell.serviceName"
35
+ v-on="getEventHandlers(cell)"
36
+ @hook:mounted="(h)=>onComponentMounted(h,cell,cellIndex)"
37
+ :queryParamsName="cell.slotConfig"
38
+ :configName="cell.slotConfig"
39
+ :countVisible="false"
40
+ :env="env"
41
+ />
42
+ </template>
43
+ </template>
44
+ </div>
45
+ <a-card v-else class="flexItem" :bordered="false">
46
+ <!-- 插槽渲染 -->
47
+ <template v-if="Array.isArray(cell)">
48
+ <!-- 处理 cell 是数组的情况 -->
49
+ <div v-for="(item, index) in cell" :key="index">
50
+ <x-report-tr-group
51
+ :server-name="serverName"
52
+ :env="env"
53
+ :key="index"
54
+ :columns="recalculateItem(item)"
55
+ :config-data="configData"
56
+ :config="config"
57
+ :display="true">
58
+ </x-report-tr-group>
59
+ </div>
60
+ </template>
61
+ <template v-else-if="cell.type === 'slot'">
62
+ <template
63
+ v-if="['x-form-table','x-add-native-form','x-tree-pro', 'x-his-editor', 'x-tab', 'x-form-group', 'x-report', 'x-buttons', 'x-label-select', 'x-conversation', 'x-check-list', 'x-cardSet', 'x-collapse', 'x-h-descriptions', 'x-sidebar', 'x-list'].includes(cell.slotType)">
64
+ <component
65
+ :is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
66
+ :key="cellIndex"
67
+ :ref="`dynamicComponent_${ cell.slotRef || cellIndex}`"
68
+ :serviceName="cell.serviceName"
69
+ :serverName="cell.serviceName"
70
+ v-on="getEventHandlers(cell)"
71
+ @hook:mounted="(h)=>onComponentMounted(h,cell,cellIndex)"
72
+ :queryParamsName="cell.slotConfig"
73
+ :configName="cell.slotConfig"
74
+ :countVisible="false"
75
+ :env="env"
76
+ />
77
+ </template>
78
+ </template>
79
+ </a-card>
80
+ </a-col>
81
+ </template>
82
+ </a-row>
83
+ </template>
84
+
85
+ <script>
86
+ import Upload from '@vue2-client/base-client/components/common/Upload'
87
+ import { getRealKeyData } from '@vue2-client/utils/util'
88
+ import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
89
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
90
+ import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@vue2-client/utils/microAppUtils'
91
+
92
+ export default {
93
+ name: 'XReportTrGroup',
94
+ components: {
95
+ Upload,
96
+ XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'),
97
+ XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'),
98
+ XFormGroup: () => import('@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'),
99
+ XTreePro: () => import('@vue2-client/base-client/components/common/XTree/XTreePro.vue'),
100
+ XHisEditor: () => import('@vue2-client/base-client/components/his/XHisEditor/XHisEditor.vue'),
101
+ XTab: () => import('@vue2-client/base-client/components/common/XTab/XTab.vue'),
102
+ XReport: () => import('@vue2-client/base-client/components/common/XReport/XReport.vue'),
103
+ XButtons: () => import('@vue2-client/base-client/components/common/XButtons/XButtons.vue'),
104
+ XLabelSelect: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelect.vue'),
105
+ XConversation: () => import('@vue2-client/base-client/components/common/XConversation/XConversation.vue'),
106
+ XCheckList: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
107
+ XCardSet: () => import('@vue2-client/base-client/components/common/XCardSet/XCardSet.vue'),
108
+ XCollapse: () => import('@vue2-client/base-client/components/common/XCollapse/XCollapse.vue'),
109
+ XHDescriptions: () => import('@vue2-client/base-client/components/his/XHDescriptions/XHDescriptions.vue'),
110
+ XSidebar: () => import('@vue2-client/base-client/components/his/XSidebar/XSidebar.vue'),
111
+ XList: () => import('@vue2-client/base-client/components/his/XList/XList.vue'),
112
+ },
113
+ props: {
114
+ // 每一行的配置
115
+ columns: {
116
+ type: Array,
117
+ required: true
118
+ },
119
+ showImgInCell: {
120
+ type: Boolean,
121
+ default: false
122
+ },
123
+ config: {
124
+ type: Object,
125
+ default: function () {
126
+ return {}
127
+ }
128
+ },
129
+ // 命名空间
130
+ serverName: {
131
+ type: String,
132
+ default: 'af-system'
133
+ },
134
+ // 环境
135
+ env: {
136
+ type: String,
137
+ default: 'prod'
138
+ },
139
+ // 原始配置
140
+ configData: {
141
+ type: Object,
142
+ required: true
143
+ },
144
+ // 是否为展示行
145
+ display: {
146
+ type: Boolean,
147
+ default: false
148
+ },
149
+ },
150
+ computed: {
151
+ allSlotSum () {
152
+ // 计算总共有多少个Slot
153
+ let sum = 0
154
+ this.columns.forEach((item) => {
155
+ console.log('item', item)
156
+ if (Array.isArray(item)) {
157
+ item.forEach((cell) => {
158
+ if (cell.type === 'slot') {
159
+ sum++
160
+ }
161
+ })
162
+ } else if (item.type && item.type === 'slot') {
163
+ sum++
164
+ }
165
+ })
166
+ console.log(`=总共有 ${sum} 个插槽栅格`)
167
+ return sum
168
+ }
169
+ },
170
+ data () {
171
+ return {
172
+ gutter: [8, { xs: 8, sm: 16, md: 24, lg: 32 }], // 设置水槽大小
173
+ maxColSpan: 12,
174
+ uploadParams: {
175
+ type: 'image',
176
+ accept: ['*'],
177
+ resUploadStock: 1,
178
+ pathKey: 'cs'
179
+ },
180
+ mixinData: {},
181
+ flexItemBodyState: {},
182
+ // 已经渲染得插槽得数量
183
+ slotRendered: 0,
184
+ // tableConfig: {}
185
+ }
186
+ },
187
+ watch: {
188
+ columns: {
189
+ deep: true,
190
+ immediate: true,
191
+ handler (newVal) {
192
+ console.log('columns变化:', JSON.parse(JSON.stringify(newVal)))
193
+ // 使用nextTick确保DOM更新
194
+ this.$nextTick(() => {
195
+ this.$forceUpdate()
196
+ })
197
+ }
198
+ }
199
+ },
200
+ inject: ['openDialog', 'emitEvent', 'registerComponent', 'setColSpanByName', 'setGlobalData', 'getGlobalData', 'getComponentByName', 'runLogic', 'getMixinData', 'getSelectedId', 'isInAModal', 'getConfigByName', 'getSelectedData', 'getOutEnv', 'currUser', 'isWidget'],
201
+ methods: {
202
+ getWindow,
203
+ isMicroAppEnv,
204
+ microDispatch,
205
+ getMicroData,
206
+ getRealKeyData,
207
+ calculateColSpan (cell) {
208
+ return Array.isArray(cell)
209
+ ? cell[0][0]?.colSpan * 2
210
+ : (cell?.colSpan ?? cell?.def?.colSpan ?? 1) * 2
211
+ },
212
+ applyAllStyles (cell, cellIndex) {
213
+ // 应用组件样式
214
+ const component = this.$refs[`trGroup_${ cell.slotRef || cellIndex}`][0]
215
+ // 确保组件已经完全挂载
216
+ this.$nextTick(() => {
217
+ this.applyComponentStyles(component, cell, cellIndex)
218
+ })
219
+ },
220
+ onComponentMounted (h, cell, cellIndex) {
221
+ this.slotRendered += 1
222
+ if (this.slotRendered >= this.allSlotSum) {
223
+ this.$emit('slotRendered')
224
+ }
225
+ if (this.getMixinData && this.getMixinData()) {
226
+ this.mixinData = this.getMixinData()
227
+ }
228
+ if (cell.slotRef) {
229
+ this.registerComponent(cell.slotRef, this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0])
230
+ }
231
+ // 传递给祖先组件
232
+ console.log(`插槽组件已经初始化 slotType ${cell.slotType},ref= dynamicComponent_${cell.slotRef || cellIndex} serviceName = ${cell.serviceName}`)
233
+ const shouldInit = cell.shouldInit == null ? true : cell.shouldInit
234
+ if (shouldInit) {
235
+ if (cell.slotType === 'x-add-native-form') {
236
+ // 简易表单需要主动调用初始化方法
237
+ getConfigByName(cell.slotConfig, cell.serviceName, async (res) => {
238
+ // 如果配置了 表单初始化logic
239
+ // 调用 logic 获取参数
240
+ let param = { ...this.mixinData }
241
+ let selectedId
242
+ if (res.paramLogicName) {
243
+ if (!!this.getSelectedId) {
244
+ selectedId = this.getSelectedId()
245
+ if (typeof selectedId !== 'object') {
246
+ selectedId = { selectedId: selectedId }
247
+ }
248
+ }
249
+ param = Object.assign(param, await runLogic(res.paramLogicName, selectedId, cell.serviceName))
250
+ }
251
+ console.info('给表单赋值', res)
252
+ this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
253
+ serviceName: cell.serviceName,
254
+ configName: cell.slotConfig,
255
+ formItems: res.formJson,
256
+ showSubmitBtn: !this.isInAModal,
257
+ businessType: param.businessType || '新增',
258
+ layout: res.xAddFormLayout,
259
+ primaryKey: res.primaryKey,
260
+ ...res,
261
+ fixedAddForm: param,
262
+ modifyModelData: {
263
+ files: param.files,
264
+ images: param.images
265
+ }
266
+ })
267
+ }, this.env === 'dev')
268
+ } else if (cell.slotType === 'x-form-group') {
269
+ // 简易表单需要主动调用初始化方法
270
+ getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
271
+ // 如果配置了 表单初始化logic
272
+ // 调用 logic 获取参数
273
+ const param = { ...this.mixinData }
274
+ this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
275
+ ...res,
276
+ serviceName: cell.serviceName,
277
+ showSubmitBtn: !this.isInAModal,
278
+ businessType: param.businessType || '新增',
279
+ modifyModelData: param,
280
+ showLeftTab: true,
281
+ })
282
+ }, this.env === 'dev')
283
+ } else if (cell.slotType === 'x-buttons') {
284
+ // 按钮组需要主动调用初始化方法
285
+ getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
286
+ this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
287
+ ...res,
288
+ serviceName: cell.serviceName,
289
+ })
290
+ }, this.env === 'dev')
291
+ } else if (cell.slotType === 'x-label-select') {
292
+ // 按钮组需要主动调用初始化方法
293
+ getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
294
+ this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
295
+ ...res,
296
+ serviceName: cell.serviceName,
297
+ })
298
+ }, this.env === 'dev')
299
+ }
300
+ }
301
+ if (cell.slotType === 'x-report') {
302
+ const param = { ...this.mixinData }
303
+ this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init(param)
304
+ }
305
+ if (cell.slotType === 'x-conversation') {
306
+ getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
307
+ this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
308
+ serviceName: cell.serviceName,
309
+ ...res,
310
+ })
311
+ }, this.env === 'dev')
312
+ }
313
+ if (cell.slotType === 'x-check-list') {
314
+ getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
315
+ this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
316
+ serviceName: cell.serviceName,
317
+ ...res,
318
+ })
319
+ }, this.env === 'dev')
320
+ }
321
+ },
322
+ recalculateItem (item) {
323
+ const totalColSpan = item.reduce((sum, cell) => {
324
+ // 保留手动设置的colSpan
325
+ return sum + (cell._isManualColSpan ? 0 : (cell.colSpan || 1))
326
+ }, 0)
327
+ return item.map(cell => {
328
+ // 跳过已手动设置的单元格
329
+ if (cell._isManualColSpan) return cell
330
+ const newColSpan = Math.round((cell.colSpan || 1) / totalColSpan * 12)
331
+ return {
332
+ ...cell,
333
+ colSpan: newColSpan,
334
+ // 标记自动计算的单元格
335
+ _isAutoCalculated: true
336
+ }
337
+ })
338
+ },
339
+
340
+ getEventHandlers (cell) {
341
+ const handlers = {}
342
+ if (!cell?.events || cell?.events?.length === 0) {
343
+ return handlers
344
+ }
345
+ cell.events.forEach(event => {
346
+ handlers[event.type] = async (...args) => {
347
+ console.info('Event handled:', event.type, args)
348
+ let func = event.customFunction
349
+ if (func && func.startsWith('function')) {
350
+ func = func.replace('function', 'async function')
351
+ }
352
+ const result = await executeStrFunctionByContext(this, func, args)
353
+ if (result instanceof Promise) {
354
+ result.then((res) => {
355
+ if (!res) return
356
+ let messageType = 'success'
357
+ // 如果传递了组件名字 自动调用刷新
358
+ if (res?.name) {
359
+ const waitRefreshRef = this.getComponentByName(res.name)
360
+ if (waitRefreshRef) {
361
+ waitRefreshRef.refresh()
362
+ } else {
363
+ console.warn(`未找到组件${res.name}无法刷新`)
364
+ }
365
+ }
366
+ // 如果传递消息类型 自动调用消息
367
+ if (res?.messageType) {
368
+ messageType = res.messageType
369
+ }
370
+ // 如果传递了提示信息自动调用提示
371
+ if (res?.message) {
372
+ this.$message[messageType](res?.message)
373
+ }
374
+ })
375
+ }
376
+ }
377
+ })
378
+ return handlers
379
+ },
380
+ getComponentName (queryParamsName, serviceName, componentName) {
381
+ return componentName
382
+ },
383
+ // 判断单元格样式
384
+ determineCellStyle (cell, color = '#000', borderWidth = '1px') {
385
+ // 如果声明了borderColor
386
+ if (this.config.style.borderColor) {
387
+ color = this.config.style.borderColor
388
+ }
389
+ let result = {}
390
+ // 如果表格也声明了样式,用表格样式将样式覆盖
391
+ if (cell.style) {
392
+ if (cell.noBorder) {
393
+ result = { ...cell.style }
394
+ } else {
395
+ if (this.noTopBorder) {
396
+ result = { ...cell.style }
397
+ } else {
398
+ result = { ...cell.style }
399
+ }
400
+ }
401
+ return result
402
+ }
403
+ return result
404
+ },
405
+ // 把用户定义的组件,传递到整个杉格中,方便调用
406
+ passComponentNamesToAncestor (refs) {
407
+ console.log('组件的keys', Object.entries(refs), refs)
408
+ // 遍历所有 refs
409
+ Object.entries(refs).forEach(([refKey, refValue]) => {
410
+ // 检查 ref 是否以 dynamicComponent_ 开头
411
+ if (refKey.startsWith('dynamicComponent_')) {
412
+ console.log('组件名存在')
413
+ const componentRef = refValue[0]
414
+ if (componentRef) {
415
+ // 去掉前缀并获取组件名字
416
+ const index = refKey.replace('dynamicComponent_', '') // 去掉前缀
417
+ console.log('注册组件', index)
418
+ // 传递给祖先组件
419
+ this.registerComponent(index, componentRef)
420
+ }
421
+ }
422
+ })
423
+ },
424
+ // 获取组件样式配置
425
+ async getComponentStyleConfig (componentType) {
426
+ try {
427
+ // 从配置中获取样式定义
428
+ const styleConfig = this.$appdata.getStylesByKey(componentType)
429
+ return styleConfig || {}
430
+ } catch (error) {
431
+ console.error('获取组件样式配置失败:', error)
432
+ return {}
433
+ }
434
+ },
435
+
436
+ // 解析组件样式配置
437
+ async parseComponentStyles (cell) {
438
+ if (!cell.class) return { rootStyles: {}, childStyles: {} }
439
+
440
+ const styleConfig = await this.getComponentStyleConfig(cell.slotType)
441
+ if (!styleConfig) return { rootStyles: {}, childStyles: {} }
442
+
443
+ const rootStyles = {}
444
+ const childStyles = new Map()
445
+
446
+ // 处理每个class配置
447
+ cell.class.split(' ').forEach(className => {
448
+ const classConfig = styleConfig[className]
449
+ if (!classConfig) return
450
+
451
+ // 处理根节点样式
452
+ Object.entries(classConfig).forEach(([key, value]) => {
453
+ if (!key.startsWith('*') && typeof key !== 'object') {
454
+ rootStyles[key] = value
455
+ }
456
+ })
457
+
458
+ // 处理子节点样式
459
+ this.parseNestedStyles(classConfig, childStyles)
460
+ })
461
+
462
+ console.warn('样式配置', rootStyles, childStyles)
463
+ return {
464
+ rootStyles,
465
+ childStyles
466
+ }
467
+ },
468
+
469
+ // 递归解析嵌套的样式配置
470
+ parseNestedStyles (config, styleMap, parentKey = '') {
471
+ Object.entries(config).forEach(([key, value]) => {
472
+ if (!key.startsWith('*')) return
473
+
474
+ const className = key.replace('*', '.')
475
+
476
+ // 如果值是对象,检查是否包含样式和子节点
477
+ if (typeof value === 'object') {
478
+ const { style = {}, children = {} } = this.separateStyleAndChildren(value)
479
+
480
+ // 创建或获取当前节点的样式配置
481
+ if (!styleMap.has(className)) {
482
+ styleMap.set(className, {
483
+ styles: {},
484
+ children: new Map()
485
+ })
486
+ }
487
+
488
+ const nodeData = styleMap.get(className)
489
+
490
+ // 合并样式
491
+ Object.assign(nodeData.styles, style)
492
+
493
+ // 递归处理子节点
494
+ this.parseNestedStyles(children, nodeData.children, className)
495
+ }
496
+ })
497
+ },
498
+
499
+ // 分离样式属性和子节点配置
500
+ separateStyleAndChildren (obj) {
501
+ const style = {}
502
+ const children = {}
503
+
504
+ Object.entries(obj).forEach(([key, value]) => {
505
+ if (key.startsWith('*')) {
506
+ // 子节点配置
507
+ children[key] = value
508
+ } else {
509
+ // 样式属性
510
+ style[key] = value
511
+ }
512
+ })
513
+
514
+ return { style, children }
515
+ },
516
+
517
+ // 应用组件样式
518
+ async applyComponentStyles (component, cell, cellIndex) {
519
+ if (!component || !component.$el) return
520
+
521
+ const { rootStyles, childStyles } = await this.parseComponentStyles(cell)
522
+
523
+ // 应用根节点样式
524
+ if (Object.keys(rootStyles).length > 0) {
525
+ Object.entries(rootStyles).forEach(([property, value]) => {
526
+ component.$el.style.setProperty(property, value, 'important')
527
+ })
528
+ }
529
+
530
+ // 如果没有子节点样式,直接返回
531
+ if (childStyles.size === 0) return
532
+
533
+ let retryCount = 0
534
+ const maxRetries = 5
535
+ const retryInterval = 100 // 100ms
536
+
537
+ const applyStyles = () => {
538
+ this.applyChildStylesOptimized(component.$el, childStyles)
539
+ }
540
+
541
+ // 首次应用样式
542
+ applyStyles()
543
+
544
+ // 创建重试机制
545
+ const retryApplyStyles = () => {
546
+ if (retryCount >= maxRetries) return
547
+
548
+ setTimeout(() => {
549
+ applyStyles()
550
+ retryCount++
551
+ retryApplyStyles()
552
+ }, retryInterval)
553
+ }
554
+
555
+ // 开始重试
556
+ retryApplyStyles()
557
+
558
+ // 创建 MutationObserver 用于动态内容
559
+ const observer = new MutationObserver((mutations) => {
560
+ // 检查是否有新增节点
561
+ const hasNewNodes = mutations.some(mutation =>
562
+ mutation.type === 'childList' && mutation.addedNodes.length > 0
563
+ )
564
+
565
+ if (hasNewNodes) {
566
+ applyStyles()
567
+ }
568
+ })
569
+
570
+ // 配置 observer
571
+ observer.observe(component.$el, {
572
+ childList: true,
573
+ subtree: true,
574
+ attributes: false
575
+ })
576
+
577
+ // 3秒后停止观察
578
+ setTimeout(() => {
579
+ observer.disconnect()
580
+ }, 3000)
581
+
582
+ // 组件销毁时清理
583
+ this.$once('hook:beforeDestroy', () => {
584
+ observer.disconnect()
585
+ })
586
+ },
587
+
588
+ // 优化后的子节点样式应用方法
589
+ applyChildStylesOptimized (rootElement, styleMap, parentSelector = '') {
590
+ if (!rootElement) return
591
+
592
+ // 处理样式映射
593
+ for (const [selector, data] of styleMap.entries()) {
594
+ const currentSelector = parentSelector ? `${parentSelector} ${selector}` : selector
595
+
596
+ try {
597
+ // 查找匹配的元素
598
+ const elements = Array.from(rootElement.querySelectorAll(currentSelector))
599
+
600
+ if (!elements.length) continue
601
+
602
+ // 应用当前层级样式
603
+ if (data.styles) {
604
+ elements.forEach(element => {
605
+ if (!element) return
606
+
607
+ // 应用每个样式属性
608
+ Object.entries(data.styles).forEach(([property, value]) => {
609
+ try {
610
+ element.style.setProperty(property, value, 'important')
611
+ } catch (err) {
612
+ console.warn(`设置样式失败: ${property}=${value}`, err)
613
+ }
614
+ })
615
+ })
616
+ }
617
+
618
+ // 处理子层级
619
+ if (data.children && data.children.size > 0) {
620
+ elements.forEach(element => {
621
+ if (element) {
622
+ this.applyChildStylesOptimized(element, data.children, currentSelector)
623
+ }
624
+ })
625
+ }
626
+ } catch (err) {
627
+ console.warn(`处理选择器失败: ${currentSelector}`, err)
628
+ continue
629
+ }
630
+ }
631
+ },
632
+ },
633
+ beforeMount () {
634
+ if (this.useOssForImg) {
635
+ this.uploadParams.resUploadMode = 'oss'
636
+ }
637
+ },
638
+ mounted () {
639
+ },
640
+ }
641
+
642
+ </script>
643
+
644
+ <style scoped lang="less">
645
+ .inputsDiv {
646
+ display: flex;
647
+ justify-content: space-between;
648
+
649
+ .inputsDivItem {
650
+ display: flex;
651
+ align-items: center;
652
+ padding: 0 4px;
653
+ white-space: nowrap;
654
+
655
+ .inputsDivItemLabel {
656
+ padding: 0 4px;
657
+ }
658
+ }
659
+ }
660
+
661
+ .tdNoBorder {
662
+ border-left: 1px solid #000;
663
+ border-right: 1px solid #000;
664
+ padding: 8px;
665
+ }
666
+
667
+ .tdWithBorder {
668
+ border: 1px solid #000;
669
+ padding: 8px;
670
+ }
671
+
672
+ .tdWithNoTopBorder {
673
+ border-top-style: none;
674
+ border-left: 1px solid #000;
675
+ border-right: 1px solid #000;
676
+ border-bottom: 1px solid #000;
677
+ padding: 8px;
678
+ }
679
+
680
+ .grid-content {
681
+ border-radius: 4px;
682
+ min-height: 36px;
683
+ text-align: center;
684
+ color: #fff;
685
+ background-color: #606266;
686
+ }
687
+
688
+ .bg-purple {
689
+ background: #9254de;
690
+ }
691
+
692
+ .bg-purple-light {
693
+ background: #b37feb;
694
+ }
695
+
696
+ .flexItem {
697
+ border-radius: 8px;
698
+ height: 100%;
699
+ }
700
+ </style>