vue2-client 1.15.93 → 1.15.96

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 (147) hide show
  1. package/docs//345/207/275/346/225/260/344/275/277/347/224/250/347/233/270/345/205/263.md +0 -6
  2. package/package.json +1 -1
  3. package/src/base-client/components/common/XFormTable/demo.vue +2 -2
  4. package/src/base-client/components/his/XHisEditor/XHisEditor.vue +2 -52
  5. package/src/base-client/components/his/XImportExcelButton/XFrontImportExcel.vue +11 -7
  6. package/src/base-client/components/his/XImportExcelButton/XFrontImportExcelDemo.vue +1 -1
  7. package/src/base-client/components/his/XList/XList.vue +1 -1
  8. package/src/base-client/components/his/XTextCard/XTextCard.vue +207 -207
  9. package/src/base-client/components/his/threeTestOrders/editor.vue +111 -111
  10. package/src/layouts/BlankView.vue +5 -3
  11. package/src/pages/WorkflowDetail/WorkflowDetail.vue +5 -5
  12. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformation.vue +1 -1
  13. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowBaseInformationDetails.vue +1 -1
  14. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowHandle.vue +4 -4
  15. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkFlowTimeline.vue +1 -1
  16. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkOrderParentDetails.vue +2 -6
  17. package/src/pages/WorkflowDetail/WorkflowPageDetail/WorkflowListResolution.vue +2 -2
  18. package/src/router/async/router.map.js +2 -1
  19. package/src/utils/routerUtil.js +16 -2
  20. package/.history/public/his/editor/editor_20250606134713.html +0 -51
  21. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527173925.vue +0 -509
  22. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174316.vue +0 -524
  23. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174419.vue +0 -524
  24. package/.history/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox_20250527174422.vue +0 -524
  25. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172825.vue +0 -207
  26. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172945.vue +0 -211
  27. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611172949.vue +0 -212
  28. package/.history/src/base-client/components/common/XAddReport/XAddReport_20250611173010.vue +0 -212
  29. package/.history/src/base-client/components/common/XForm/XFormItem_20250508134122.vue +0 -1320
  30. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171604.vue +0 -1332
  31. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171613.vue +0 -1331
  32. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171703.vue +0 -1331
  33. package/.history/src/base-client/components/common/XForm/XFormItem_20250527171720.vue +0 -1331
  34. package/.history/src/base-client/components/common/XForm/XFormItem_20250527174327.vue +0 -1339
  35. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612092804.vue +0 -731
  36. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612112546.vue +0 -748
  37. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20250612113808.vue +0 -748
  38. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115237.vue +0 -1071
  39. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115346.vue +0 -1078
  40. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115350.vue +0 -1077
  41. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115415.vue +0 -1077
  42. package/.history/src/base-client/components/common/XReportGrid/XReport_20250612115429.vue +0 -1077
  43. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611091619.vue +0 -442
  44. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092547.vue +0 -442
  45. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092552.vue +0 -442
  46. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092744.vue +0 -475
  47. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092955.vue +0 -475
  48. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611092957.vue +0 -475
  49. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095652.vue +0 -477
  50. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095701.vue +0 -477
  51. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611095704.vue +0 -477
  52. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100005.vue +0 -473
  53. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100011.vue +0 -473
  54. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100014.vue +0 -473
  55. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100833.vue +0 -473
  56. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100853.vue +0 -473
  57. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611100940.vue +0 -473
  58. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101011.vue +0 -473
  59. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101013.vue +0 -473
  60. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101014.vue +0 -473
  61. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101159.vue +0 -473
  62. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101238.vue +0 -474
  63. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101240.vue +0 -474
  64. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101242.vue +0 -474
  65. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101404.vue +0 -472
  66. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101410.vue +0 -472
  67. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101459.vue +0 -472
  68. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101500.vue +0 -472
  69. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101502.vue +0 -472
  70. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101504.vue +0 -472
  71. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101610.vue +0 -501
  72. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101700.vue +0 -501
  73. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101702.vue +0 -501
  74. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101741.vue +0 -504
  75. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101749.vue +0 -504
  76. package/.history/src/base-client/components/his/XHisEditor/XHisEditor_20250611101759.vue +0 -504
  77. package/.history/src/base-client/components/his/XHisEditor/dome_20250611091349.vue +0 -131
  78. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105854.vue +0 -160
  79. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105902.vue +0 -160
  80. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105924.vue +0 -160
  81. package/.history/src/base-client/components/his/XHisEditor/dome_20250611105932.vue +0 -158
  82. package/.history/src/base-client/components/his/XList/XList_20250609135848.vue +0 -173
  83. package/.history/src/base-client/components/his/XList/XList_20250609141026.vue +0 -222
  84. package/.history/src/base-client/components/his/XList/XList_20250609141035.vue +0 -229
  85. package/.history/src/base-client/components/his/XList/XList_20250609141103.vue +0 -229
  86. package/.history/src/base-client/components/his/XList/XList_20250609141105.vue +0 -229
  87. package/.history/src/base-client/components/his/XList/XList_20250609141334.vue +0 -241
  88. package/.history/src/base-client/components/his/XList/XList_20250609141404.vue +0 -241
  89. package/.history/src/base-client/components/his/XList/XList_20250609141406.vue +0 -241
  90. package/.history/src/base-client/components/his/XList/XList_20250609141801.vue +0 -245
  91. package/.history/src/base-client/components/his/XList/XList_20250609142033.vue +0 -245
  92. package/.history/src/base-client/components/his/XList/XList_20250609142038.vue +0 -245
  93. package/.history/src/base-client/components/his/XList/XList_20250609142435.vue +0 -255
  94. package/.history/src/base-client/components/his/XList/XList_20250609142503.vue +0 -255
  95. package/.history/src/base-client/components/his/XList/XList_20250609142504.vue +0 -255
  96. package/.history/src/base-client/components/his/XList/XList_20250609143012.vue +0 -270
  97. package/.history/src/base-client/components/his/XList/XList_20250609143044.vue +0 -270
  98. package/.history/src/base-client/components/his/XList/XList_20250609143046.vue +0 -270
  99. package/.history/src/base-client/components/his/XList/XList_20250609143210.vue +0 -270
  100. package/.history/src/base-client/components/his/XList/XList_20250609144339.vue +0 -294
  101. package/.history/src/base-client/components/his/XList/XList_20250609144410.vue +0 -294
  102. package/.history/src/base-client/components/his/XList/XList_20250609144412.vue +0 -294
  103. package/.history/src/base-client/components/his/XList/XList_20250609144647.vue +0 -303
  104. package/.history/src/base-client/components/his/XList/XList_20250609144716.vue +0 -303
  105. package/.history/src/base-client/components/his/XList/XList_20250609144729.vue +0 -303
  106. package/.history/src/base-client/components/his/XList/XList_20250609151232.vue +0 -288
  107. package/.history/src/base-client/components/his/XList/XList_20250609151247.vue +0 -288
  108. package/.history/src/base-client/components/his/XList/XList_20250609151252.vue +0 -288
  109. package/.history/src/base-client/components/his/XList/XList_20250609161220.vue +0 -317
  110. package/.history/src/base-client/components/his/XList/XList_20250609161258.vue +0 -306
  111. package/.history/src/base-client/components/his/XList/XList_20250609161319.vue +0 -306
  112. package/.history/src/base-client/components/his/XList/XList_20250609161320.vue +0 -306
  113. package/.history/src/base-client/components/his/XList/XList_20250704142024.vue +0 -495
  114. package/.history/src/base-client/components/his/XList/XList_20250704142033.vue +0 -495
  115. package/.history/src/base-client/components/his/XList/XList_20250704142040.vue +0 -494
  116. package/.history/src/base-client/components/his/XList/XList_20250704142211.vue +0 -494
  117. package/.history/src/base-client/components/his/XList/XList_20250704142214.vue +0 -494
  118. package/.history/src/base-client/components/his/XList/XList_20250704143010.vue +0 -495
  119. package/.history/src/base-client/components/his/XList/XList_20250704143203.vue +0 -495
  120. package/.history/src/base-client/components/his/XList/XList_20250707095101.vue +0 -492
  121. package/.history/src/base-client/components/his/XList/XList_20250707100152.vue +0 -492
  122. package/.history/src/base-client/components/his/XList/XList_20250707100200.vue +0 -485
  123. package/.history/src/base-client/components/his/XList/XList_20250707100208.vue +0 -485
  124. package/.history/src/base-client/components/his/XList/XList_20250707100259.vue +0 -488
  125. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250609151519.vue +0 -222
  126. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155514.vue +0 -183
  127. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155556.vue +0 -183
  128. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612155600.vue +0 -183
  129. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181609.vue +0 -206
  130. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250612181629.vue +0 -209
  131. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095553.vue +0 -242
  132. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095610.vue +0 -242
  133. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613095612.vue +0 -242
  134. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100041.vue +0 -251
  135. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100047.vue +0 -251
  136. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100054.vue +0 -250
  137. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100105.vue +0 -250
  138. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100107.vue +0 -250
  139. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613100114.vue +0 -250
  140. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140844.vue +0 -238
  141. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140910.vue +0 -238
  142. package/.history/src/base-client/components/his/XShiftSchedule/XShiftSchedule_20250613140912.vue +0 -238
  143. package/Users/objecrt/af-vue2-client/src/base-client/components/his/XShiftSchedule/XShiftSchedule.vue +0 -36
  144. package/src/base-client/components/TreeList/TreeList.vue +0 -91
  145. package/src/base-client/components/TreeList/TreeNode.vue +0 -81
  146. package/src/base-client/components/common/XCardSet/XTiltle.vue +0 -191
  147. package/src/base-client/components/his/XHisEditor/dome.vue +0 -144
@@ -1,731 +0,0 @@
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','x-input','x-time-line', 'x-radio','x-calendar', 'x-time-select' ,'x-checkbox', 'x-title', 'x-select', 'x-tree-rows', 'x-three-test-orders', 'x-shift-schedule','x-charge','x-questionnaire'].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
- @beforeDataChange="beforeDataChange"
38
- @rowClick="handleRowClick"
39
- @onExpand="onExpand"
40
- :queryParamsName="cell.slotConfig"
41
- :configName="cell.slotConfig"
42
- :countVisible="false"
43
- :env="env"
44
- />
45
- </template>
46
- </template>
47
- </div>
48
- <a-card v-else class="flexItem" :bordered="false">
49
- <!-- 插槽渲染 -->
50
- <template v-if="Array.isArray(cell)">
51
- <!-- 处理 cell 是数组的情况 -->
52
- <div v-for="(item, index) in cell" :key="index">
53
- <x-report-tr-group
54
- :server-name="serverName"
55
- :env="env"
56
- :key="index"
57
- :columns="recalculateItem(item)"
58
- :config-data="configData"
59
- :config="config"
60
- :display="true">
61
- </x-report-tr-group>
62
- </div>
63
- </template>
64
- <template v-else-if="cell.type === 'slot'">
65
- <template
66
- 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','x-input','x-time-line', 'x-radio','x-calendar', 'x-time-select','x-checkbox', 'x-title', 'x-select', 'x-tree-rows', 'x-three-test-orders', 'x-shift-schedule','x-charge','x-questionnaire'].includes(cell.slotType)">
67
- <component
68
- :is="getComponentName(cell.slotConfig, cell.serviceName, cell.slotType)"
69
- :key="cellIndex"
70
- :ref="`dynamicComponent_${ cell.slotRef || cellIndex}`"
71
- :serviceName="cell.serviceName"
72
- :serverName="cell.serviceName"
73
- v-on="getEventHandlers(cell)"
74
- @hook:mounted="(h)=>onComponentMounted(h,cell,cellIndex)"
75
- @beforeDataChange="beforeDataChange"
76
- @rowClick="handleRowClick"
77
- @onExpand="onExpand"
78
- :queryParamsName="cell.slotConfig"
79
- :configName="cell.slotConfig"
80
- :countVisible="false"
81
- :env="env"
82
- />
83
- </template>
84
- </template>
85
- </a-card>
86
- </a-col>
87
- </template>
88
- </a-row>
89
- </template>
90
-
91
- <script>
92
- import Upload from '@vue2-client/base-client/components/common/Upload'
93
- import { getRealKeyData } from '@vue2-client/utils/util'
94
- import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
95
- import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
96
- import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@vue2-client/utils/microAppUtils'
97
-
98
- export default {
99
- name: 'XReportTrGroup',
100
- components: {
101
- Upload,
102
- XFormTable: () => import('@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'),
103
- XAddNativeForm: () => import('@vue2-client/base-client/components/common/XAddNativeForm/XAddNativeForm.vue'),
104
- XFormGroup: () => import('@vue2-client/base-client/components/common/XFormGroup/XFormGroup.vue'),
105
- XTreePro: () => import('@vue2-client/base-client/components/common/XTree/XTreePro.vue'),
106
- XHisEditor: () => import('@vue2-client/base-client/components/his/XHisEditor/XHisEditor.vue'),
107
- XTab: () => import('@vue2-client/base-client/components/common/XTab/XTab.vue'),
108
- XReport: () => import('@vue2-client/base-client/components/common/XReport/XReport.vue'),
109
- XButtons: () => import('@vue2-client/base-client/components/common/XButtons/XButtons.vue'),
110
- XLabelSelect: () => import('@vue2-client/base-client/components/common/XLabelSelect/XLabelSelect.vue'),
111
- XConversation: () => import('@vue2-client/base-client/components/common/XConversation/XConversation.vue'),
112
- XCheckList: () => import('@vue2-client/base-client/components/common/XCheckList/XCheckList.vue'),
113
- XCardSet: () => import('@vue2-client/base-client/components/common/XCardSet/XCardSet.vue'),
114
- XCollapse: () => import('@vue2-client/base-client/components/common/XCollapse/XCollapse.vue'),
115
- XHDescriptions: () => import('@vue2-client/base-client/components/his/XHDescriptions/XHDescriptions.vue'),
116
- XSidebar: () => import('@vue2-client/base-client/components/his/XSidebar/XSidebar.vue'),
117
- XList: () => import('@vue2-client/base-client/components/his/XList/XList.vue'),
118
- XInput: () => import('@vue2-client/base-client/components/common/XInput/XInput.vue'),
119
- XTimeLine: () => import('@vue2-client/base-client/components/common/XTimeline/XTimeline.vue'),
120
- XRadio: () => import('@vue2-client/base-client/components/his/XRadio/XRadio.vue'),
121
- XCalendar: () => import('@vue2-client/base-client/components/common/XCalendar/XCalendar.vue'),
122
- XTimeSelect: () => import('@vue2-client/base-client/components/his/XTimeSelect/XTimeSelect.vue'),
123
- XCheckbox: () => import('@vue2-client/base-client/components/his/XCheckbox/XCheckbox.vue'),
124
- XTitle: () => import('@vue2-client/base-client/components/his/XTitle/XTitle.vue'),
125
- XSelect: () => import('@vue2-client/base-client/components/his/XSelect/XSelect.vue'),
126
- XTreeRows: () => import('@vue2-client/base-client/components/his/XTreeRows/XTreeRows.vue'),
127
- XThreeTestOrders: () => import('@vue2-client/base-client/components/his/threeTestOrders/threeTestOrders.vue'),
128
- XShiftSchedule: () => import('@vue2-client/base-client/components/his/XShiftSchedule/XShiftSchedule.vue'),
129
- XCharge: () => import('@vue2-client/base-client/components/his/XCharge/XCharge.vue'),
130
- XQuestionnaire: () => import('@vue2-client/base-client/components/his/XQuestionnaire/XQuestionnaire.vue')
131
- },
132
- props: {
133
- // 每一行的配置
134
- columns: {
135
- type: Array,
136
- required: true
137
- },
138
- showImgInCell: {
139
- type: Boolean,
140
- default: false
141
- },
142
- config: {
143
- type: Object,
144
- default: function () {
145
- return {}
146
- }
147
- },
148
- // 命名空间
149
- serverName: {
150
- type: String,
151
- default: 'af-system'
152
- },
153
- // 环境
154
- env: {
155
- type: String,
156
- default: 'prod'
157
- },
158
- // 原始配置
159
- configData: {
160
- type: Object,
161
- required: true
162
- },
163
- // 是否为展示行
164
- display: {
165
- type: Boolean,
166
- default: false
167
- },
168
- },
169
- computed: {
170
- allSlotSum () {
171
- // 计算总共有多少个Slot
172
- let sum = 0
173
- this.columns.forEach((item) => {
174
- console.log('item', item)
175
- if (Array.isArray(item)) {
176
- item.forEach((cell) => {
177
- if (cell.type === 'slot') {
178
- sum++
179
- }
180
- })
181
- } else if (item.type && item.type === 'slot') {
182
- sum++
183
- }
184
- })
185
- console.log(`=总共有 ${sum} 个插槽栅格`)
186
- return sum
187
- }
188
- },
189
- data () {
190
- return {
191
- gutter: [8, { xs: 8, sm: 16, md: 24, lg: 32 }], // 设置水槽大小
192
- maxColSpan: 12,
193
- uploadParams: {
194
- type: 'image',
195
- accept: ['*'],
196
- resUploadStock: 1,
197
- pathKey: 'cs'
198
- },
199
- mixinData: {},
200
- flexItemBodyState: {},
201
- // 已经渲染得插槽得数量
202
- slotRendered: 0,
203
- // tableConfig: {}
204
- }
205
- },
206
- watch: {
207
- columns: {
208
- deep: true,
209
- immediate: true,
210
- handler (newVal) {
211
- console.log('columns变化:', JSON.parse(JSON.stringify(newVal)))
212
- // 使用nextTick确保DOM更新
213
- this.$nextTick(() => {
214
- this.$forceUpdate()
215
- })
216
- }
217
- }
218
- },
219
- inject: ['openDialog', 'emitEvent', 'registerComponent', 'setColSpanByName', 'setGlobalData', 'getGlobalData', 'getComponentByName', 'runLogic', 'getMixinData', 'getSelectedId', 'isInAModal', 'getConfigByName', 'getSelectedData', 'getOutEnv', 'currUser', 'isWidget', 'findComponentByName', 'closeAddReport'],
220
- methods: {
221
- getWindow,
222
- isMicroAppEnv,
223
- microDispatch,
224
- getMicroData,
225
- getRealKeyData,
226
- handleRowClick (record) {
227
- this.$emit('rowClick', record)
228
- },
229
- beforeDataChange (record) {
230
- this.$emit('beforeDataChange', record)
231
- },
232
- onExpand (expanded, record) {
233
- this.$emit('expand', expanded, record)
234
- },
235
- listClick (data) {
236
- this.$emit('listClick', data)
237
- },
238
- calculateColSpan (cell) {
239
- return Array.isArray(cell)
240
- ? cell[0][0]?.colSpan * 2
241
- : (cell?.colSpan ?? cell?.def?.colSpan ?? 1) * 2
242
- },
243
- applyAllStyles (cell, cellIndex) {
244
- // 应用组件样式
245
- const component = this.$refs[`trGroup_${ cell.slotRef || cellIndex}`][0]
246
- // 确保组件已经完全挂载
247
- this.$nextTick(() => {
248
- this.applyComponentStyles(component, cell, cellIndex)
249
- })
250
- },
251
- onComponentMounted (h, cell, cellIndex) {
252
- this.slotRendered += 1
253
- if (this.slotRendered >= this.allSlotSum) {
254
- this.$emit('slotRendered')
255
- }
256
- if (this.getMixinData && this.getMixinData()) {
257
- this.mixinData = this.getMixinData()
258
- }
259
- if (cell.slotRef) {
260
- this.registerComponent(cell.slotRef, this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0])
261
- }
262
- // 传递给祖先组件
263
- console.log(`插槽组件已经初始化 slotType ${cell.slotType},ref= dynamicComponent_${cell.slotRef || cellIndex} , serviceName = ${cell.serviceName}`)
264
- const shouldInit = cell.shouldInit == null ? true : cell.shouldInit
265
- if (shouldInit) {
266
- if (cell.slotType === 'x-add-native-form') {
267
- // 简易表单需要主动调用初始化方法
268
- getConfigByName(cell.slotConfig, cell.serviceName, async (res) => {
269
- // 如果配置了 表单初始化logic
270
- // 调用 logic 获取参数
271
- let param = { ...this.mixinData }
272
- let selectedId
273
- if (res.paramLogicName) {
274
- if (!!this.getSelectedId) {
275
- selectedId = this.getSelectedId()
276
- if (typeof selectedId !== 'object') {
277
- selectedId = { selectedId: selectedId }
278
- }
279
- }
280
- param = Object.assign(param, await runLogic(res.paramLogicName, selectedId, cell.serviceName))
281
- }
282
- console.info('给表单赋值', res)
283
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
284
- serviceName: cell.serviceName,
285
- configName: cell.slotConfig,
286
- formItems: res.formJson,
287
- showSubmitBtn: !this.isInAModal,
288
- businessType: param.businessType || '新增',
289
- layout: res.xAddFormLayout,
290
- primaryKey: res.primaryKey,
291
- ...res,
292
- fixedAddForm: param,
293
- modifyModelData: {
294
- files: param.files,
295
- images: param.images
296
- }
297
- })
298
- }, this.env === 'dev')
299
- } else if (cell.slotType === 'x-form-group') {
300
- // 简易表单需要主动调用初始化方法
301
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
302
- // 如果配置了 表单初始化logic
303
- // 调用 logic 获取参数
304
- const param = { ...this.mixinData }
305
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
306
- ...res,
307
- serviceName: cell.serviceName,
308
- showSubmitBtn: !this.isInAModal,
309
- businessType: param.businessType || '新增',
310
- modifyModelData: param,
311
- showLeftTab: true,
312
- })
313
- }, this.env === 'dev')
314
- } else if (cell.slotType === 'x-buttons') {
315
- // 按钮组需要主动调用初始化方法
316
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
317
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
318
- ...res,
319
- serviceName: cell.serviceName,
320
- })
321
- }, this.env === 'dev')
322
- } else if (cell.slotType === 'x-label-select') {
323
- // 按钮组需要主动调用初始化方法
324
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
325
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
326
- ...res,
327
- serviceName: cell.serviceName,
328
- })
329
- }, this.env === 'dev')
330
- }
331
- }
332
- if (cell.slotType === 'x-report') {
333
- const param = { ...this.mixinData }
334
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init(param)
335
- }
336
- if (cell.slotType === 'x-conversation') {
337
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
338
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
339
- serviceName: cell.serviceName,
340
- ...res,
341
- })
342
- }, this.env === 'dev')
343
- }
344
- if (cell.slotType === 'x-check-list') {
345
- getConfigByName(cell.slotConfig, cell.serviceName, (res) => {
346
- this.$refs[`dynamicComponent_${cell.slotRef || cellIndex}`][0].init({
347
- serviceName: cell.serviceName,
348
- ...res,
349
- })
350
- }, this.env === 'dev')
351
- }
352
- },
353
- recalculateItem (item) {
354
- const totalColSpan = item.reduce((sum, cell) => {
355
- // 保留手动设置的colSpan
356
- return sum + (cell._isManualColSpan ? 0 : (cell.colSpan || 1))
357
- }, 0)
358
- return item.map(cell => {
359
- // 跳过已手动设置的单元格
360
- if (cell._isManualColSpan) return cell
361
- const newColSpan = Math.round((cell.colSpan || 1) / totalColSpan * 12)
362
- return {
363
- ...cell,
364
- colSpan: newColSpan,
365
- // 标记自动计算的单元格
366
- _isAutoCalculated: true
367
- }
368
- })
369
- },
370
-
371
- getEventHandlers (cell) {
372
- const handlers = {}
373
- if (!cell?.events || cell?.events?.length === 0) {
374
- return handlers
375
- }
376
- cell.events.forEach(event => {
377
- handlers[event.type] = async (...args) => {
378
- console.info('Event handled:', event.type, args)
379
- let func = event.customFunction
380
- if (func && func.startsWith('function')) {
381
- func = func.replace('function', 'async function')
382
- }
383
- const result = await executeStrFunctionByContext(this, func, args)
384
- if (result instanceof Promise) {
385
- result.then((res) => {
386
- if (!res) return
387
- let messageType = 'success'
388
- // 如果传递了组件名字 自动调用刷新
389
- if (res?.name) {
390
- const waitRefreshRef = this.getComponentByName(res.name)
391
- if (waitRefreshRef) {
392
- waitRefreshRef.refresh()
393
- } else {
394
- console.warn(`未找到组件${res.name}无法刷新`)
395
- }
396
- }
397
- // 如果传递消息类型 自动调用消息
398
- if (res?.messageType) {
399
- messageType = res.messageType
400
- }
401
- // 如果传递了提示信息自动调用提示
402
- if (res?.message) {
403
- this.$message[messageType](res?.message)
404
- }
405
- })
406
- }
407
- }
408
- })
409
- return handlers
410
- },
411
- getComponentName (queryParamsName, serviceName, componentName) {
412
- return componentName
413
- },
414
- // 判断单元格样式
415
- determineCellStyle (cell, color = '#000', borderWidth = '1px') {
416
- // 如果声明了borderColor
417
- if (this.config.style.borderColor) {
418
- color = this.config.style.borderColor
419
- }
420
- let result = {}
421
- // 如果表格也声明了样式,用表格样式将样式覆盖
422
- if (cell.style) {
423
- if (cell.noBorder) {
424
- result = { ...cell.style }
425
- } else {
426
- if (this.noTopBorder) {
427
- result = { ...cell.style }
428
- } else {
429
- result = { ...cell.style }
430
- }
431
- }
432
- return result
433
- }
434
- return result
435
- },
436
- // 把用户定义的组件,传递到整个杉格中,方便调用
437
- passComponentNamesToAncestor (refs) {
438
- console.log('组件的keys', Object.entries(refs), refs)
439
- // 遍历所有 refs
440
- Object.entries(refs).forEach(([refKey, refValue]) => {
441
- // 检查 ref 是否以 dynamicComponent_ 开头
442
- if (refKey.startsWith('dynamicComponent_')) {
443
- console.log('组件名存在')
444
- const componentRef = refValue[0]
445
- if (componentRef) {
446
- // 去掉前缀并获取组件名字
447
- const index = refKey.replace('dynamicComponent_', '') // 去掉前缀
448
- console.log('注册组件', index)
449
- // 传递给祖先组件
450
- this.registerComponent(index, componentRef)
451
- }
452
- }
453
- })
454
- },
455
- // 获取组件样式配置
456
- async getComponentStyleConfig (componentType) {
457
- try {
458
- // 从配置中获取样式定义
459
- const styleConfig = this.$appdata.getStylesByKey(componentType)
460
- return styleConfig || {}
461
- } catch (error) {
462
- console.error('获取组件样式配置失败:', error)
463
- return {}
464
- }
465
- },
466
-
467
- // 解析组件样式配置
468
- async parseComponentStyles (cell) {
469
- if (!cell.class) return { rootStyles: {}, childStyles: {} }
470
-
471
- const styleConfig = await this.getComponentStyleConfig(cell.slotType)
472
- if (!styleConfig) return { rootStyles: {}, childStyles: {} }
473
-
474
- const rootStyles = {}
475
- const childStyles = new Map()
476
-
477
- // 处理每个class配置
478
- cell.class.split(' ').forEach(className => {
479
- const classConfig = styleConfig[className]
480
- if (!classConfig) return
481
-
482
- // 处理根节点样式
483
- Object.entries(classConfig).forEach(([key, value]) => {
484
- if (!key.startsWith('*') && typeof key !== 'object') {
485
- rootStyles[key] = value
486
- }
487
- })
488
-
489
- // 处理子节点样式
490
- this.parseNestedStyles(classConfig, childStyles)
491
- })
492
-
493
- console.warn('样式配置', rootStyles, childStyles)
494
- return {
495
- rootStyles,
496
- childStyles
497
- }
498
- },
499
-
500
- // 递归解析嵌套的样式配置
501
- parseNestedStyles (config, styleMap, parentKey = '') {
502
- Object.entries(config).forEach(([key, value]) => {
503
- if (!key.startsWith('*')) return
504
-
505
- const className = key.replace('*', '.')
506
-
507
- // 如果值是对象,检查是否包含样式和子节点
508
- if (typeof value === 'object') {
509
- const { style = {}, children = {} } = this.separateStyleAndChildren(value)
510
-
511
- // 创建或获取当前节点的样式配置
512
- if (!styleMap.has(className)) {
513
- styleMap.set(className, {
514
- styles: {},
515
- children: new Map()
516
- })
517
- }
518
-
519
- const nodeData = styleMap.get(className)
520
-
521
- // 合并样式
522
- Object.assign(nodeData.styles, style)
523
-
524
- // 递归处理子节点
525
- this.parseNestedStyles(children, nodeData.children, className)
526
- }
527
- })
528
- },
529
-
530
- // 分离样式属性和子节点配置
531
- separateStyleAndChildren (obj) {
532
- const style = {}
533
- const children = {}
534
-
535
- Object.entries(obj).forEach(([key, value]) => {
536
- if (key.startsWith('*')) {
537
- // 子节点配置
538
- children[key] = value
539
- } else {
540
- // 样式属性
541
- style[key] = value
542
- }
543
- })
544
-
545
- return { style, children }
546
- },
547
-
548
- // 应用组件样式
549
- async applyComponentStyles (component, cell, cellIndex) {
550
- if (!component || !component.$el) return
551
-
552
- const { rootStyles, childStyles } = await this.parseComponentStyles(cell)
553
-
554
- // 应用根节点样式
555
- if (Object.keys(rootStyles).length > 0) {
556
- Object.entries(rootStyles).forEach(([property, value]) => {
557
- component.$el.style.setProperty(property, value, 'important')
558
- })
559
- }
560
-
561
- // 如果没有子节点样式,直接返回
562
- if (childStyles.size === 0) return
563
-
564
- let retryCount = 0
565
- const maxRetries = 5
566
- const retryInterval = 100 // 100ms
567
-
568
- const applyStyles = () => {
569
- this.applyChildStylesOptimized(component.$el, childStyles)
570
- }
571
-
572
- // 首次应用样式
573
- applyStyles()
574
-
575
- // 创建重试机制
576
- const retryApplyStyles = () => {
577
- if (retryCount >= maxRetries) return
578
-
579
- setTimeout(() => {
580
- applyStyles()
581
- retryCount++
582
- retryApplyStyles()
583
- }, retryInterval)
584
- }
585
-
586
- // 开始重试
587
- retryApplyStyles()
588
-
589
- // 创建 MutationObserver 用于动态内容
590
- const observer = new MutationObserver((mutations) => {
591
- // 检查是否有新增节点
592
- const hasNewNodes = mutations.some(mutation =>
593
- mutation.type === 'childList' && mutation.addedNodes.length > 0
594
- )
595
-
596
- if (hasNewNodes) {
597
- applyStyles()
598
- }
599
- })
600
-
601
- // 配置 observer
602
- observer.observe(component.$el, {
603
- childList: true,
604
- subtree: true,
605
- attributes: false
606
- })
607
-
608
- // 3秒后停止观察
609
- // setTimeout(() => {
610
- // observer.disconnect()
611
- // }, 3000)
612
-
613
- // 组件销毁时清理
614
- this.$once('hook:beforeDestroy', () => {
615
- observer.disconnect()
616
- })
617
- },
618
-
619
- // 优化后的子节点样式应用方法
620
- applyChildStylesOptimized (rootElement, styleMap, parentSelector = '') {
621
- if (!rootElement) return
622
-
623
- // 处理样式映射
624
- for (const [selector, data] of styleMap.entries()) {
625
- const currentSelector = parentSelector ? `${parentSelector} ${selector}` : selector
626
-
627
- try {
628
- // 查找匹配的元素
629
- const elements = Array.from(rootElement.querySelectorAll(currentSelector))
630
-
631
- if (!elements.length) continue
632
-
633
- // 应用当前层级样式
634
- if (data.styles) {
635
- elements.forEach(element => {
636
- if (!element) return
637
-
638
- // 应用每个样式属性
639
- Object.entries(data.styles).forEach(([property, value]) => {
640
- try {
641
- element.style.setProperty(property, value, 'important')
642
- } catch (err) {
643
- console.warn(`设置样式失败: ${property}=${value}`, err)
644
- }
645
- })
646
- })
647
- }
648
-
649
- // 处理子层级
650
- if (data.children && data.children.size > 0) {
651
- elements.forEach(element => {
652
- if (element) {
653
- this.applyChildStylesOptimized(element, data.children, currentSelector)
654
- }
655
- })
656
- }
657
- } catch (err) {
658
- console.warn(`处理选择器失败: ${currentSelector}`, err)
659
- continue
660
- }
661
- }
662
- }
663
- },
664
- beforeMount () {
665
- if (this.useOssForImg) {
666
- this.uploadParams.resUploadMode = 'oss'
667
- }
668
- },
669
- mounted () {
670
- },
671
- }
672
-
673
- </script>
674
-
675
- <style scoped lang="less">
676
- .inputsDiv {
677
- display: flex;
678
- justify-content: space-between;
679
-
680
- .inputsDivItem {
681
- display: flex;
682
- align-items: center;
683
- padding: 0 4px;
684
- white-space: nowrap;
685
-
686
- .inputsDivItemLabel {
687
- padding: 0 4px;
688
- }
689
- }
690
- }
691
-
692
- .tdNoBorder {
693
- border-left: 1px solid #000;
694
- border-right: 1px solid #000;
695
- padding: 8px;
696
- }
697
-
698
- .tdWithBorder {
699
- border: 1px solid #000;
700
- padding: 8px;
701
- }
702
-
703
- .tdWithNoTopBorder {
704
- border-top-style: none;
705
- border-left: 1px solid #000;
706
- border-right: 1px solid #000;
707
- border-bottom: 1px solid #000;
708
- padding: 8px;
709
- }
710
-
711
- .grid-content {
712
- border-radius: 4px;
713
- min-height: 36px;
714
- text-align: center;
715
- color: #fff;
716
- background-color: #606266;
717
- }
718
-
719
- .bg-purple {
720
- background: #9254de;
721
- }
722
-
723
- .bg-purple-light {
724
- background: #b37feb;
725
- }
726
-
727
- .flexItem {
728
- border-radius: 8px;
729
- height: 100%;
730
- }
731
- </style>