vue2-client 1.22.21 → 1.22.23

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 (87) hide show
  1. package/.env.his +19 -19
  2. package/.idea/.name +1 -0
  3. package/.idea/MarsCodeWorkspaceAppSettings.xml +8 -0
  4. package/.idea/deployment.xml +14 -0
  5. package/.idea/gradle.xml +7 -0
  6. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  7. package/.idea/libraries/contour_plot.xml +9 -0
  8. package/.idea/material_theme_project_new.xml +18 -0
  9. package/.idea/misc.xml +87 -5
  10. package/package.json +1 -1
  11. package/src/base-client/components/common/HIS/HForm/HForm.vue +1186 -1186
  12. package/src/base-client/components/common/HIS/HTab/HTab.vue +790 -790
  13. package/src/base-client/components/common/XInspectionDetailDrawer/components/AiDeviceStatus.vue +25 -4
  14. package/src/base-client/components/common/XInspectionDetailDrawer/components/ImageAnnotationShow.vue +1371 -0
  15. package/src/base-client/components/common/XMarkdownViewer/demo.vue +102 -102
  16. package/src/base-client/components/his/XTransfer/index.md +327 -327
  17. package/.history/.eslintrc_20260521171150.js +0 -74
  18. package/.history/.eslintrc_20260521171213.js +0 -74
  19. package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154443.vue +0 -726
  20. package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154700.vue +0 -478
  21. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260512175435.vue +0 -706
  22. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260512175450.vue +0 -694
  23. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260611152602.vue +0 -755
  24. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260513145941.vue +0 -524
  25. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260513153133.vue +0 -731
  26. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260513160316.vue +0 -525
  27. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260601144150.vue +0 -1046
  28. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310142713.vue +0 -512
  29. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310145118.vue +0 -511
  30. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260311094834.vue +0 -696
  31. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260320143028.vue +0 -693
  32. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260409101450.vue +0 -677
  33. package/.history/src/base-client/components/common/HIS/HTab/HTab_20260625173703.vue +0 -767
  34. package/.history/src/base-client/components/common/HIS/HTab/HTab_20260626112425.vue +0 -803
  35. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513140637.vue +0 -1455
  36. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513140935.vue +0 -1441
  37. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513150818.vue +0 -1441
  38. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513153119.vue +0 -1442
  39. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513153126.vue +0 -1486
  40. package/.history/src/base-client/components/common/XForm/XFormItem_20260513140854.vue +0 -1607
  41. package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140403.vue +0 -643
  42. package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140829.vue +0 -628
  43. package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519142824.vue +0 -104
  44. package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519143155.vue +0 -102
  45. package/.history/src/base-client/components/common/XReportGrid/XReport_20260309171231.vue +0 -1241
  46. package/.history/src/base-client/components/common/XReportGrid/XReport_20260309171441.vue +0 -1223
  47. package/.history/src/base-client/components/his/HAi/HAi_20260612174826.vue +0 -472
  48. package/.history/src/base-client/components/his/HAi/HAi_20260612175839.vue +0 -538
  49. package/.history/src/base-client/components/his/HAi/HAi_20260615103331.vue +0 -650
  50. package/.history/src/base-client/components/his/HAi/HAi_20260618140214.vue +0 -1396
  51. package/.history/src/base-client/components/his/HAi/HAi_20260618140556.vue +0 -1396
  52. package/.history/src/base-client/components/his/XHDescriptions/XHDescriptions_20260424134504.vue +0 -1469
  53. package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171133.vue +0 -788
  54. package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171151.vue +0 -780
  55. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511170841.vue +0 -585
  56. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511171138.vue +0 -787
  57. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260512141830.vue +0 -739
  58. package/.history/src/components/STable/index_20260409155138.js +0 -806
  59. package/.history/src/components/STable/index_20260409155218.js +0 -814
  60. package/.history/src/expression/core/Expression_20260305164427.js +0 -1371
  61. package/.history/src/expression/core/Expression_20260305170258.js +0 -1358
  62. package/.history/src/expression/core/Program_20260305111830.js +0 -944
  63. package/.history/src/expression/core/Program_20260305112041.js +0 -931
  64. package/.history/src/logic/LogicRunner_20260304154306.js +0 -170
  65. package/.history/src/logic/LogicRunner_20260304155553.js +0 -112
  66. package/.history/src/logic/LogicRunner_20260305105834.js +0 -112
  67. package/.history/src/logic/LogicRunner_20260305112718.js +0 -129
  68. package/.history/src/logic/LogicRunner_20260305182436.js +0 -133
  69. package/.history/src/logic/LogicRunner_20260306151301.js +0 -213
  70. package/.history/src/logic/LogicRunner_20260306152419.js +0 -213
  71. package/.history/src/logic/plugins/common/DateTools_20260305154159.js +0 -61
  72. package/.history/src/logic/plugins/common/DateTools_20260305154217.js +0 -44
  73. package/.history/src/logic/plugins/common/DateTools_20260305161014.js +0 -44
  74. package/.history/src/logic/plugins/common/HttpTools_20260305164352.js +0 -80
  75. package/.history/src/logic/plugins/common/HttpTools_20260305170258.js +0 -75
  76. package/.history/src/logic/plugins/common/HttpTools_20260305171634.js +0 -75
  77. package/.history/src/logic/plugins/common/HttpTools_20260306152419.js +0 -72
  78. package/.history/src/services/api/restTools_20260427142149.js +0 -245
  79. package/.history/src/services/api/restTools_20260427142853.js +0 -230
  80. package/.history/src/services/api/restTools_20260519135558.js +0 -230
  81. package/.history/src/services/api/restTools_20260519140825.js +0 -230
  82. package/.history/src/services/api/restTools_20260519151223.js +0 -230
  83. package/.history/src/utils/indexedDB_20260306150918.js +0 -593
  84. package/.history/src/utils/indexedDB_20260306151301.js +0 -586
  85. package/.idea/codeStyles/Project.xml +0 -62
  86. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  87. package/preview-input-box.html +0 -180
@@ -1,790 +1,790 @@
1
- <script setup>
2
- import XTab from '@vue2-client/base-client/components/common/XTab/XTab.vue'
3
- import { ref, computed, useAttrs, useSlots, onMounted } from 'vue'
4
- import { getConfigByName } from '@vue2-client/services/api/common'
5
-
6
- const props = defineProps({
7
- // 标签栏右侧附加区域的配置名(可选)。提供时将自动加载配置并渲染到 tabBar 右侧。
8
- tabBarExtraConfig: {
9
- type: String,
10
- default: undefined
11
- },
12
- // 控制标签间距,覆盖内部 XTab 的默认 10px;默认置 0 清除外边距
13
- tabBarGutter: {
14
- type: Number,
15
- default: 0
16
- }
17
- })
18
-
19
- // 兼容多种样式配置
20
- const attrs = useAttrs()
21
- const wrapperClassObject = computed(() => {
22
- const a = attrs
23
- const classes = {}
24
-
25
- // 通用布尔样式开关(以存在/空字符串/'true' 为真)
26
- // hasTopMargin: 标签增加顶部外边距,同时调整 ant-card-body 内边距
27
- // useStyle7: 细下划线指示器样式,透明背景,支持配合 useCycle 显示圆点
28
- // useCycle: 与 useStyle7 配合使用,在标签左侧显示蓝色圆点指示器
29
- // useStyle8: 等宽卡片式标签,带边框和圆角,激活项高亮并隐藏底部边框
30
- // out-tab: 去除标签栏所有外边距与内边距,实现紧凑贴边效果
31
- // no-underline: 隐藏底部边框与 ink-bar 下划线指示器
32
- // useStyle9: 圆角卡片标签,带边框,激活项填充品牌色,禁用切换动画
33
- // useStyle10: 无下划线 + 左侧蓝色圆点,透明背景,激活项高亮品牌色
34
- // useStyle11: 去除边框,选中显示蓝色下划线,字体 #313131 / #0057FE,标签宽度平均分配
35
- const booleanStyleKeys = [
36
- 'hasTopMargin', 'useStyle7', 'useCycle', 'useStyle8', 'out-tab', 'no-underline', 'useStyle9', 'useStyle10', 'useStyle11'
37
- ]
38
- for (const key of booleanStyleKeys) {
39
- const val = a[key]
40
- const truthy = val === true || val === '' || val === 'true'
41
- if (truthy) classes[`h-tab-${key}`] = true
42
- }
43
- return classes
44
- })
45
-
46
- // 创建对XTab组件的引用
47
- const xTabRef = ref()
48
-
49
- // 获取插槽(避免模板中直接使用 $slots 触发类型检查错误)
50
- const slots = useSlots()
51
- const slotNames = computed(() => {
52
- try {
53
- return Object.keys(slots || {})
54
- } catch (e) {
55
- return []
56
- }
57
- })
58
-
59
- // 右侧附加区域的动态配置
60
- const extraConfig = ref(null)
61
- const extraItems = computed(() => {
62
- const cfg = extraConfig.value
63
- return cfg && cfg.value ? cfg.value : []
64
- })
65
-
66
- // 本地异步组件映射(未全局注册时生效)
67
- const localMap = {
68
- 'x-input': () => import('@vue2-client/base-client/components/common/XInput/XInput.vue'),
69
- 'x-select': () => import('@vue2-client/base-client/components/his/XSelect/XSelect.vue'),
70
- 'x-radio': () => import('@vue2-client/base-client/components/his/XRadio/XRadio.vue'),
71
- 'x-buttons': () => import('@vue2-client/base-client/components/common/XButtons/XButtons.vue'),
72
- 'x-time-select': () => import('@vue2-client/base-client/components/his/XTimeSelect/XTimeSelect.vue'),
73
- 'h-buttons': () => import('@vue2-client/base-client/components/common/HIS/HButtons/HButtons.vue')
74
- }
75
-
76
- // 从 attrs 中读取 serverName 与 env(保持向后兼容)
77
- const serverName = computed(() => (attrs && attrs.serverName))
78
- const env = computed(() => (attrs && attrs.env) || 'prod')
79
-
80
- const loadExtraConfig = (configName) => {
81
- if (!configName) {
82
- extraConfig.value = null
83
- return
84
- }
85
- getConfigByName(configName, serverName.value, (res) => {
86
- extraConfig.value = res
87
- }, env.value === 'dev')
88
- }
89
-
90
- onMounted(() => {
91
- loadExtraConfig(props.tabBarExtraConfig)
92
- })
93
-
94
- // 暴露方法给父组件使用
95
- defineExpose({
96
- // 为了兼容性,保留getXTabInstance方法
97
- getXTabInstance: () => xTabRef.value,
98
- })
99
- </script>
100
-
101
- <template>
102
- <div
103
- class="h-tab-wrapper"
104
- :class="[wrapperClassObject, extraItems.length > 1 ? 'h-tab-extra-wrapper-multiple' : '']">
105
- <x-tab
106
- ref="xTabRef"
107
- :tabBarGutter="props.tabBarGutter"
108
- v-bind="$attrs"
109
- v-on="$listeners"
110
- >
111
- <template v-if="extraItems.length" #tabBarExtraContent>
112
- <!-- 父级可接管渲染;未提供则按配置兜底渲染 -->
113
- <slot name="tabBarExtraContent" :config="extraConfig" :items="extraItems">
114
- <div class="h-tab-extra-wrapper">
115
- <component
116
- v-for="(item, idx) in extraItems"
117
- :is="localMap[item.slotType] || item.slotType"
118
- :key="idx"
119
- :ref="item.slotRef || `extra_${idx}`"
120
- :serviceName="item.serviceName || serverName"
121
- :serverName="item.serviceName || serverName"
122
- :queryParamsName="item.slotConfig"
123
- :env="env"
124
- v-on="$listeners"
125
- v-bind="item.attrs"
126
- />
127
- </div>
128
- </slot>
129
- </template>
130
- <template v-for="name in slotNames" #[name]="slotData">
131
- <slot :name="name" v-bind="slotData" />
132
- </template>
133
- </x-tab>
134
- </div>
135
- </template>
136
-
137
- <style scoped lang="less">
138
- .h-tab-wrapper {
139
- width: 100%;
140
- overflow: visible !important;
141
-
142
- // 基础样式
143
- :deep(.ant-tabs-tab-next) {
144
- display: none;
145
- }
146
- :deep(.ant-tabs-nav-wrap) {
147
- margin-top: 18px;
148
- margin-bottom: 0;
149
- }
150
- :deep(.ant-tabs-nav) {
151
- // 去除导航容器默认左右内边距,避免收缩时左侧多出一截
152
- .ant-tabs-nav-container,
153
- .ant-tabs-nav-scroll {
154
- margin: 0px;
155
- }
156
-
157
- // 移除左右切换箭头带来的占位
158
- .ant-tabs-tab-prev,
159
- .ant-tabs-tab-next {
160
- display: none !important;
161
- width: 0 !important;
162
- }
163
- .ant-tabs-tab-next-icon {
164
- display: none;
165
- }
166
- .ant-tabs-tab {
167
- background-color: transparent;
168
- border-radius: 6px 6px 0 0;
169
- color: #5D5C5C;
170
- font-weight: bold;
171
- min-width: 134px;
172
- width: auto;
173
- font-size: 18px;
174
- line-height: 26px;
175
- font-family: "Source Han Sans";
176
- transition: all 0.3s;
177
- height: 32px;
178
- text-align: center;
179
- margin: 0 !important;
180
- padding: 0 12px !important;
181
- }
182
- .ant-tabs-tab-active {
183
- background-color: #0057FE;
184
- color: #ffffff;
185
- min-width: 134px;
186
- width: auto;
187
- line-height: 26px;
188
- height: 32px;
189
- text-align: center;
190
- margin: 0 !important;
191
- padding: 0 12px !important;
192
- }
193
- }
194
-
195
- :deep(.ant-tabs-bar) {
196
- border-bottom: 2px solid #0057FE;
197
- margin: 0px 0px;
198
- width: 100%;
199
- height: 50px;
200
- }
201
-
202
- // 滚动状态下的容器左右内边距清零,避免左侧多出一截
203
- :deep(.ant-tabs-nav-container-scrolling) {
204
- padding-left: 0 !important;
205
- padding-right: 0 !important;
206
- }
207
-
208
- :deep(.ant-tabs-tab-arrow-show) {
209
- display: none;
210
- }
211
-
212
- :deep(.ant-tabs-ink-bar) {
213
- background-color: transparent;
214
- bottom: 0px;
215
- display: none;
216
- height: 0;
217
- }
218
-
219
- :deep(.ant-tabs-tab-prev-icon-target) {
220
- display: none;
221
- }
222
-
223
- // 带顶部边距的样式
224
- &.h-tab-hasTopMargin {
225
- :deep(.ant-tabs-nav) {
226
- margin-top: 6px;
227
- }
228
-
229
- :deep(.ant-tabs-bar) {
230
- margin: 0 6px;
231
- }
232
-
233
- :deep(.ant-card-body) {
234
- padding: 6px 0;
235
-
236
- .ant-card-body {
237
- padding: 6px;
238
- }
239
- }
240
- }
241
-
242
- // 通用样式7:细下划线、透明背景、可配置宽度
243
- &.h-tab-useStyle7 {
244
- :deep(.ant-tabs-tab-next),
245
- :deep(.ant-tabs-tab-prev-icon-target),
246
- :deep(.ant-tabs-tab-next-icon) { display: none; }
247
-
248
- :deep(.ant-tabs-bar) {
249
- border-bottom: none !important;
250
- height: 38px !important;
251
- margin: 0 !important;
252
- }
253
-
254
- :deep(.ant-tabs-ink-bar) {
255
- display: block !important;
256
- background-color: #0057FE !important;
257
- bottom: 0px !important;
258
- height: 2px !important;
259
- margin-left: 0 !important;
260
- }
261
-
262
- :deep(.ant-tabs-nav-wrap) {
263
- margin-top: 0 !important;
264
- margin-bottom: 0 !important;
265
- padding-left: 0 !important;
266
- padding-right: 0 !important;
267
- overflow: visible !important;
268
- height: auto !important;
269
- }
270
-
271
- :deep(.ant-tabs-nav-container) {
272
- padding-left: 0 !important;
273
- padding-right: 0 !important;
274
- margin: 0 !important;
275
- height: auto !important;
276
- }
277
-
278
- :deep(.ant-tabs-nav-scroll) {
279
- height: auto !important;
280
- }
281
-
282
- :deep(.ant-tabs-nav) {
283
- width: 100% !important;
284
- display: flex !important;
285
- flex-direction: row !important;
286
- flex-wrap: nowrap !important;
287
-
288
- .ant-tabs-nav-list {
289
- width: 100% !important;
290
- display: flex !important;
291
- flex-direction: row !important;
292
- flex-wrap: nowrap !important;
293
- gap: 16px !important;
294
- }
295
-
296
- .ant-tabs-tab {
297
- position: relative !important;
298
- background-color: transparent !important;
299
- border-radius: 0 !important;
300
- color: #313131 !important;
301
- font-weight: bold !important;
302
- min-width: var(--tab-min-width, 108px) !important;
303
- width: var(--tab-width, auto) !important;
304
- padding: 0 12px !important;
305
- font-size: 16px !important;
306
- line-height: 38px !important;
307
- font-family: "Source Han Sans" !important;
308
- transition: all 0.3s !important;
309
- height: 38px !important;
310
- opacity: 1 !important;
311
- text-align: center !important;
312
- margin-right: 0 !important;
313
- letter-spacing: 0em !important;
314
- font-feature-settings: "kern" on !important;
315
- display: inline-flex !important;
316
- align-items: center !important;
317
- justify-content: center !important;
318
- box-sizing: border-box !important;
319
- }
320
- .ant-tabs-tab-active {
321
- background-color: transparent !important;
322
- color: #0057FE !important;
323
- font-weight: bold !important;
324
- width: var(--tab-width, auto) !important;
325
- padding: 0 12px !important;
326
- line-height: 38px !important;
327
- height: 38px !important;
328
- opacity: 1 !important;
329
- text-align: center !important;
330
- letter-spacing: 0em !important;
331
- font-feature-settings: "kern" on !important;
332
- display: inline-flex !important;
333
- align-items: center !important;
334
- justify-content: center !important;
335
- box-sizing: border-box !important;
336
- }
337
- }
338
-
339
- // 可选:标签左侧圆点
340
- &.h-tab-useCycle {
341
- :deep(.ant-tabs-tab) {
342
- display: inline-flex !important;
343
- align-items: center !important;
344
- gap: 8px !important;
345
- padding-left: 0 !important;
346
- margin-right: 0 !important;
347
- height: 38px !important;
348
- opacity: 1;
349
- }
350
- :deep(.ant-tabs-tab::before) {
351
- content: "" !important;
352
- position: static !important;
353
- width: 8px !important;
354
- height: 8px !important;
355
- background: #3362DA !important;
356
- border-radius: 50% !important;
357
- flex-shrink: 0 !important;
358
- opacity: 1 !important;
359
- z-index: 1 !important;
360
- top: auto !important;
361
- bottom: auto !important;
362
- transform: none !important;
363
- }
364
- :deep(.ant-tabs-tab-active::before) {
365
- background: #0057FE !important;
366
- }
367
- }
368
- }
369
- // 用户词条使用样式
370
- &.h-tab-useStyle8 {
371
- :deep(.ant-tabs-tab-next),
372
- :deep(.ant-tabs-tab-prev-icon-target),
373
- :deep(.ant-tabs-tab-next-icon) {
374
- display: none;
375
- }
376
-
377
- :deep(.ant-tabs-nav-wrap) {
378
- margin-top: 0;
379
- }
380
-
381
- // Make the main Ant Design tabs container a flex column to arrange tab bar and content vertically
382
- :deep(.ant-tabs) {
383
- display: flex !important;
384
- flex-direction: column !important; // 确保选项卡栏在顶部,内容区域在下方
385
- height: auto !important; // 高度自适应
386
- }
387
-
388
- :deep(.ant-tabs-bar) {
389
- border-bottom: 1px solid #d9d9d9; // 底部边框
390
- border-right: none; // 移除右侧边框
391
- margin-right: 0 !important; // 移除重叠修复
392
- flex-shrink: 1 !important; // 允许收缩
393
- height: auto !important; // 高度自适应
394
- margin-bottom: 0px !important;
395
- }
396
-
397
- :deep(.ant-tabs-content) {
398
- flex: none !important; // 移除 flex: 1,允许内容区域自然流淌
399
- }
400
-
401
- :deep(.ant-tabs-nav) {
402
- .ant-tabs-nav-container,
403
- .ant-tabs-nav-wrap,
404
- .ant-tabs-nav-scroll,
405
- & > div:first-child {
406
- display: flex !important;
407
- flex-direction: row !important;
408
- flex-wrap: nowrap !important; // 确保不换行
409
- width: 100% !important; // 占据全部宽度
410
- height: auto !important;
411
- }
412
-
413
- height: auto !important; // 高度自适应内容
414
- width: 100% !important; // 确保容器占据全部宽度
415
-
416
- .ant-tabs-tab {
417
- flex: 1 !important; // 宽度等分布局
418
- margin-right: 0 !important;
419
- margin-bottom: 0 !important; // 移除底部间距
420
- border-top: 1px solid #d9d9d9;
421
- border-left: 1px solid #d9d9d9;
422
- border-bottom: 1px solid #d9d9d9; // 所有选项卡都有底部边框
423
- border-right: none; // 默认没有右边框
424
- &:last-child {
425
- border-right: 1px solid #d9d9d9; // 最后一个选项卡有右边框
426
- }
427
- border-radius: 0; // 默认无圆角,避免中间相邻处出现圆角
428
- background-color: #f5f5f5;
429
- color: #333333;
430
- font-weight: 500;
431
- font-size: 16px;
432
- height: 40px; // 固定高度
433
- width: auto !important; // 移除固定宽度,以便等分
434
- display: flex;
435
- justify-content: center;
436
- align-items: center;
437
- padding: 0;
438
- }
439
- // 首项:仅左侧圆角
440
- .ant-tabs-tab:first-child {
441
- border-top-left-radius: 10px;
442
- border-bottom-left-radius: 10px;
443
- }
444
- // 末项:仅右侧圆角
445
- .ant-tabs-tab:last-child {
446
- border-top-right-radius: 10px;
447
- border-bottom-right-radius: 10px;
448
- }
449
- .ant-tabs-tab-active {
450
- border-bottom: 1px solid transparent; // 激活时隐藏底部边框,与 ant-tabs-bar 的边框衔接
451
- background-color: #0057FE;
452
- color: #ffffff;
453
- font-weight: 600;
454
- }
455
- }
456
- :deep(.ant-tabs-ink-bar) {
457
- display: none; // 隐藏下划线
458
- }
459
- }
460
- &.h-tab-extra-wrapper-multiple {
461
- :deep(.h-tab-extra-wrapper){
462
- display: flex;
463
- justify-content: end;
464
- gap: 8px;
465
- }
466
- :deep(.x-radio-group){
467
- height: 32px;
468
- }
469
- :deep(.x-radio-item){
470
- height: 32px;
471
- display: flex;
472
- align-items: center;
473
- margin-bottom: 0px;
474
- }
475
- :deep(.ant-tabs-tab){
476
- height: 34px;
477
- }
478
- :deep(.ant-tabs-nav-container){
479
- padding-top: 2px;
480
- }
481
- :deep(.ant-tabs-extra-content){
482
- line-height: 0px !important;
483
- }
484
- }
485
-
486
- &.h-tab-out-tab {
487
- :deep(.ant-tabs-nav-wrap) {
488
- margin-top: 0px !important;
489
- margin-bottom: 0px !important;
490
- }
491
- :deep(.ant-tabs-nav) {
492
- margin-bottom: 0px !important;
493
- }
494
- :deep(.ant-tabs-nav-container) {
495
- padding-top: 0px !important;
496
- padding-bottom: 0px !important;
497
- }
498
-
499
- :deep(.ant-tabs-bar) {
500
- margin-top: 0px !important;
501
- margin-bottom: 0px !important;
502
- height: auto !important;
503
- min-height: 0px !important;
504
- }
505
-
506
- :deep(.ant-tabs-content) {
507
- margin-top: 0px !important;
508
- }
509
- }
510
-
511
- // 无下划线样式:隐藏底部指示器线条和边框
512
- &.h-tab-no-underline {
513
- :deep(.ant-tabs-bar) {
514
- border-bottom: none !important;
515
- }
516
- :deep(.ant-tabs-ink-bar) {
517
- display: none !important;
518
- }
519
- }
520
-
521
- // 样式9:圆角卡片式标签(带边框、居中文字、字体切换)
522
- &.h-tab-useStyle9 {
523
- :deep(.ant-tabs-tab-next),
524
- :deep(.ant-tabs-tab-prev-icon-target),
525
- :deep(.ant-tabs-tab-next-icon) { display: none; }
526
-
527
- // 保持 ant-tabs 为 column 布局
528
- :deep(.ant-tabs) {
529
- display: flex !important;
530
- flex-direction: column !important;
531
- height: auto !important;
532
- width: 100% !important;
533
- }
534
-
535
- // 移除 a-card 的默认样式影响
536
- :deep(.ant-card) {
537
- overflow: visible !important;
538
- width: 100% !important;
539
- }
540
- :deep(.ant-card-body) {
541
- padding: 0 !important;
542
- overflow: visible !important;
543
- }
544
-
545
- :deep(.ant-tabs-bar) {
546
- border-bottom: none !important;
547
- flex-shrink: 0 !important;
548
- height: auto !important;
549
- margin-bottom: 0 !important;
550
- width: 100% !important;
551
- overflow: visible !important;
552
- }
553
-
554
- :deep(.ant-tabs-content) {
555
- flex: 1 !important;
556
- height: auto !important;
557
- overflow: visible !important;
558
- }
559
-
560
- :deep(.ant-tabs-tabpane) {
561
- overflow: visible !important;
562
- display: block !important;
563
- }
564
-
565
- :deep(.ant-tabs-tabpane-active) {
566
- overflow: visible !important;
567
- }
568
-
569
- // 禁用切换动画,避免抖动
570
- :deep(.ant-tabs) {
571
- transition: none !important;
572
- }
573
- :deep(.ant-tabs-tabpane) {
574
- transition: none !important;
575
- }
576
-
577
- :deep(.ant-tabs-nav-wrap) {
578
- margin: 0 !important;
579
- padding: 0 !important;
580
- overflow: visible !important;
581
- position: relative !important;
582
- display: block !important;
583
- }
584
-
585
- :deep(.ant-tabs-nav-container) {
586
- padding: 0 !important;
587
- overflow: visible !important;
588
- display: block !important;
589
- }
590
-
591
- :deep(.ant-tabs-nav) {
592
- display: flex !important;
593
- flex-direction: row !important;
594
- flex-wrap: nowrap !important;
595
- width: auto !important;
596
- max-width: 100% !important;
597
- height: auto !important;
598
- margin: 0 !important;
599
- overflow: visible !important;
600
-
601
- .ant-tabs-tab {
602
- flex: none;
603
- width: auto;
604
- min-width: 100px;
605
- box-sizing: border-box;
606
- border: 1px solid #E5E9F0;
607
- border-radius: 6px;
608
- background: #FFFFFF;
609
- color: #333333;
610
- font-family: "Source Han Sans";
611
- font-size: 18px;
612
- font-weight: bold;
613
- line-height: 32px;
614
- height: 32px;
615
- text-align: center;
616
- margin: 0 !important;
617
- padding: 0 16px !important;
618
- overflow: hidden !important;
619
- }
620
- .ant-tabs-tab-active {
621
- background-color: #0057FE;
622
- color: #ffffff;
623
- font-weight: bold;
624
- border: 1px solid #0057FE;
625
- }
626
- }
627
-
628
- :deep(.ant-tabs-ink-bar) {
629
- display: none;
630
- }
631
- }
632
- // 样式10:无下划线、左侧绿色圆点、字体样式切换
633
- &.h-tab-useStyle10 {
634
- :deep(.ant-tabs-tab-next),
635
- :deep(.ant-tabs-tab-prev-icon-target),
636
- :deep(.ant-tabs-tab-next-icon) { display: none; }
637
-
638
- :deep(.ant-tabs-bar) {
639
- border-bottom: none !important;
640
- }
641
-
642
- :deep(.ant-tabs-ink-bar) {
643
- display: none !important;
644
- }
645
-
646
- :deep(.ant-tabs-nav-wrap) {
647
- margin-top: 0;
648
- padding-left: 0 !important;
649
- padding-right: 0 !important;
650
- }
651
-
652
- :deep(.ant-tabs-nav-container) {
653
- padding-left: 0 !important;
654
- padding-right: 0 !important;
655
- }
656
-
657
- :deep(.ant-tabs-nav) {
658
- display: flex;
659
- flex-wrap: wrap;
660
- gap: 8px;
661
- .ant-tabs-tab {
662
- position: relative;
663
- background-color: transparent;
664
- border-radius: 0;
665
- color: #313131;
666
- font-family: "Source Han Sans";
667
- font-size: 16px;
668
- font-weight: bold;
669
- line-height: normal;
670
- letter-spacing: 0em;
671
- font-feature-settings: "kern" on;
672
- width: auto;
673
- padding: 0 12px 6px;
674
- padding-left: 18px !important;
675
- transition: all 0.3s;
676
- height: 40px;
677
- text-align: center;
678
- margin-right: 0px !important;
679
- display: inline-flex !important;
680
- align-items: center;
681
- vertical-align: top;
682
- }
683
- .ant-tabs-tab::before {
684
- content: "" !important;
685
- position: absolute !important;
686
- left: 0 !important;
687
- top: 50% !important;
688
- transform: translateY(-50%) !important;
689
- width: 8px !important;
690
- height: 8px !important;
691
- background: #0057FE !important;
692
- border-radius: 50% !important;
693
- display: block !important;
694
- z-index: 1 !important;
695
- }
696
- .ant-tabs-tab-active {
697
- background-color: transparent;
698
- color: #0057FE;
699
- font-weight: bold;
700
- width: auto;
701
- padding: 0 12px 6px;
702
- padding-left: 18px !important;
703
- height: 40px;
704
- text-align: center;
705
- }
706
- .ant-tabs-tab-active::before {
707
- background: #0057FE !important;
708
- }
709
- }
710
- }
711
-
712
- // 样式11:去除边框、选中显示蓝色下划线,标签宽度平均分配
713
- &.h-tab-useStyle11 {
714
- :deep(.ant-tabs-tab-next),
715
- :deep(.ant-tabs-tab-prev-icon-target),
716
- :deep(.ant-tabs-tab-next-icon) { display: none; }
717
-
718
- :deep(.ant-tabs-bar) {
719
- border-bottom: none !important;
720
- height: 32px !important;
721
- line-height: 32px !important;
722
- }
723
-
724
- :deep(.ant-tabs-ink-bar) {
725
- display: block !important;
726
- background-color: #0057FE !important;
727
- bottom: 0px !important;
728
- height: 2px !important;
729
- margin-left: 0 !important;
730
- }
731
-
732
- :deep(.ant-tabs-nav-wrap) {
733
- margin-top: 0;
734
- padding-left: 0 !important;
735
- padding-right: 0 !important;
736
- width: 100% !important;
737
- }
738
-
739
- :deep(.ant-tabs-nav-container) {
740
- padding-left: 0 !important;
741
- padding-right: 0 !important;
742
- width: 100% !important;
743
- }
744
-
745
- :deep(.ant-tabs-nav-container-scrolling) {
746
- padding-left: 0 !important;
747
- padding-right: 0 !important;
748
- }
749
-
750
- :deep(.ant-tabs-nav) {
751
- width: 100% !important;
752
-
753
- .ant-tabs-nav-list {
754
- width: 100% !important;
755
- display: grid !important;
756
- grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
757
- }
758
-
759
- .ant-tabs-tab {
760
- width: 50%;
761
- height: 32px;
762
- box-sizing: border-box !important;
763
- opacity: 1;
764
- font-family: "Source Han Sans";
765
- font-size: 16px;
766
- font-weight: bold;
767
- line-height: normal;
768
- text-align: center;
769
- letter-spacing: 0em;
770
- color: #313131;
771
- background-color: transparent;
772
- border: none;
773
- border-radius: 0;
774
- padding: 0 12px 6px;
775
- margin-right: 16px !important;
776
- display: inline-flex !important;
777
- align-items: center;
778
- justify-content: center;
779
- transition: all 0.3s;
780
- }
781
-
782
- .ant-tabs-tab-active {
783
- color: #0057FE;
784
- background-color: transparent;
785
- border: none;
786
- }
787
- }
788
- }
789
- }
790
- </style>
1
+ <script setup>
2
+ import XTab from '@vue2-client/base-client/components/common/XTab/XTab.vue'
3
+ import { ref, computed, useAttrs, useSlots, onMounted } from 'vue'
4
+ import { getConfigByName } from '@vue2-client/services/api/common'
5
+
6
+ const props = defineProps({
7
+ // 标签栏右侧附加区域的配置名(可选)。提供时将自动加载配置并渲染到 tabBar 右侧。
8
+ tabBarExtraConfig: {
9
+ type: String,
10
+ default: undefined
11
+ },
12
+ // 控制标签间距,覆盖内部 XTab 的默认 10px;默认置 0 清除外边距
13
+ tabBarGutter: {
14
+ type: Number,
15
+ default: 0
16
+ }
17
+ })
18
+
19
+ // 兼容多种样式配置
20
+ const attrs = useAttrs()
21
+ const wrapperClassObject = computed(() => {
22
+ const a = attrs
23
+ const classes = {}
24
+
25
+ // 通用布尔样式开关(以存在/空字符串/'true' 为真)
26
+ // hasTopMargin: 标签增加顶部外边距,同时调整 ant-card-body 内边距
27
+ // useStyle7: 细下划线指示器样式,透明背景,支持配合 useCycle 显示圆点
28
+ // useCycle: 与 useStyle7 配合使用,在标签左侧显示蓝色圆点指示器
29
+ // useStyle8: 等宽卡片式标签,带边框和圆角,激活项高亮并隐藏底部边框
30
+ // out-tab: 去除标签栏所有外边距与内边距,实现紧凑贴边效果
31
+ // no-underline: 隐藏底部边框与 ink-bar 下划线指示器
32
+ // useStyle9: 圆角卡片标签,带边框,激活项填充品牌色,禁用切换动画
33
+ // useStyle10: 无下划线 + 左侧蓝色圆点,透明背景,激活项高亮品牌色
34
+ // useStyle11: 去除边框,选中显示蓝色下划线,字体 #313131 / #0057FE,标签宽度平均分配
35
+ const booleanStyleKeys = [
36
+ 'hasTopMargin', 'useStyle7', 'useCycle', 'useStyle8', 'out-tab', 'no-underline', 'useStyle9', 'useStyle10', 'useStyle11'
37
+ ]
38
+ for (const key of booleanStyleKeys) {
39
+ const val = a[key]
40
+ const truthy = val === true || val === '' || val === 'true'
41
+ if (truthy) classes[`h-tab-${key}`] = true
42
+ }
43
+ return classes
44
+ })
45
+
46
+ // 创建对XTab组件的引用
47
+ const xTabRef = ref()
48
+
49
+ // 获取插槽(避免模板中直接使用 $slots 触发类型检查错误)
50
+ const slots = useSlots()
51
+ const slotNames = computed(() => {
52
+ try {
53
+ return Object.keys(slots || {})
54
+ } catch (e) {
55
+ return []
56
+ }
57
+ })
58
+
59
+ // 右侧附加区域的动态配置
60
+ const extraConfig = ref(null)
61
+ const extraItems = computed(() => {
62
+ const cfg = extraConfig.value
63
+ return cfg && cfg.value ? cfg.value : []
64
+ })
65
+
66
+ // 本地异步组件映射(未全局注册时生效)
67
+ const localMap = {
68
+ 'x-input': () => import('@vue2-client/base-client/components/common/XInput/XInput.vue'),
69
+ 'x-select': () => import('@vue2-client/base-client/components/his/XSelect/XSelect.vue'),
70
+ 'x-radio': () => import('@vue2-client/base-client/components/his/XRadio/XRadio.vue'),
71
+ 'x-buttons': () => import('@vue2-client/base-client/components/common/XButtons/XButtons.vue'),
72
+ 'x-time-select': () => import('@vue2-client/base-client/components/his/XTimeSelect/XTimeSelect.vue'),
73
+ 'h-buttons': () => import('@vue2-client/base-client/components/common/HIS/HButtons/HButtons.vue')
74
+ }
75
+
76
+ // 从 attrs 中读取 serverName 与 env(保持向后兼容)
77
+ const serverName = computed(() => (attrs && attrs.serverName))
78
+ const env = computed(() => (attrs && attrs.env) || 'prod')
79
+
80
+ const loadExtraConfig = (configName) => {
81
+ if (!configName) {
82
+ extraConfig.value = null
83
+ return
84
+ }
85
+ getConfigByName(configName, serverName.value, (res) => {
86
+ extraConfig.value = res
87
+ }, env.value === 'dev')
88
+ }
89
+
90
+ onMounted(() => {
91
+ loadExtraConfig(props.tabBarExtraConfig)
92
+ })
93
+
94
+ // 暴露方法给父组件使用
95
+ defineExpose({
96
+ // 为了兼容性,保留getXTabInstance方法
97
+ getXTabInstance: () => xTabRef.value,
98
+ })
99
+ </script>
100
+
101
+ <template>
102
+ <div
103
+ class="h-tab-wrapper"
104
+ :class="[wrapperClassObject, extraItems.length > 1 ? 'h-tab-extra-wrapper-multiple' : '']">
105
+ <x-tab
106
+ ref="xTabRef"
107
+ :tabBarGutter="props.tabBarGutter"
108
+ v-bind="$attrs"
109
+ v-on="$listeners"
110
+ >
111
+ <template v-if="extraItems.length" #tabBarExtraContent>
112
+ <!-- 父级可接管渲染;未提供则按配置兜底渲染 -->
113
+ <slot name="tabBarExtraContent" :config="extraConfig" :items="extraItems">
114
+ <div class="h-tab-extra-wrapper">
115
+ <component
116
+ v-for="(item, idx) in extraItems"
117
+ :is="localMap[item.slotType] || item.slotType"
118
+ :key="idx"
119
+ :ref="item.slotRef || `extra_${idx}`"
120
+ :serviceName="item.serviceName || serverName"
121
+ :serverName="item.serviceName || serverName"
122
+ :queryParamsName="item.slotConfig"
123
+ :env="env"
124
+ v-on="$listeners"
125
+ v-bind="item.attrs"
126
+ />
127
+ </div>
128
+ </slot>
129
+ </template>
130
+ <template v-for="name in slotNames" #[name]="slotData">
131
+ <slot :name="name" v-bind="slotData" />
132
+ </template>
133
+ </x-tab>
134
+ </div>
135
+ </template>
136
+
137
+ <style scoped lang="less">
138
+ .h-tab-wrapper {
139
+ width: 100%;
140
+ overflow: visible !important;
141
+
142
+ // 基础样式
143
+ :deep(.ant-tabs-tab-next) {
144
+ display: none;
145
+ }
146
+ :deep(.ant-tabs-nav-wrap) {
147
+ margin-top: 18px;
148
+ margin-bottom: 0;
149
+ }
150
+ :deep(.ant-tabs-nav) {
151
+ // 去除导航容器默认左右内边距,避免收缩时左侧多出一截
152
+ .ant-tabs-nav-container,
153
+ .ant-tabs-nav-scroll {
154
+ margin: 0px;
155
+ }
156
+
157
+ // 移除左右切换箭头带来的占位
158
+ .ant-tabs-tab-prev,
159
+ .ant-tabs-tab-next {
160
+ display: none !important;
161
+ width: 0 !important;
162
+ }
163
+ .ant-tabs-tab-next-icon {
164
+ display: none;
165
+ }
166
+ .ant-tabs-tab {
167
+ background-color: transparent;
168
+ border-radius: 6px 6px 0 0;
169
+ color: #5D5C5C;
170
+ font-weight: bold;
171
+ min-width: 134px;
172
+ width: auto;
173
+ font-size: 18px;
174
+ line-height: 26px;
175
+ font-family: "Source Han Sans";
176
+ transition: all 0.3s;
177
+ height: 32px;
178
+ text-align: center;
179
+ margin: 0 !important;
180
+ padding: 0 12px !important;
181
+ }
182
+ .ant-tabs-tab-active {
183
+ background-color: #0057FE;
184
+ color: #ffffff;
185
+ min-width: 134px;
186
+ width: auto;
187
+ line-height: 26px;
188
+ height: 32px;
189
+ text-align: center;
190
+ margin: 0 !important;
191
+ padding: 0 12px !important;
192
+ }
193
+ }
194
+
195
+ :deep(.ant-tabs-bar) {
196
+ border-bottom: 2px solid #0057FE;
197
+ margin: 0px 0px;
198
+ width: 100%;
199
+ height: 50px;
200
+ }
201
+
202
+ // 滚动状态下的容器左右内边距清零,避免左侧多出一截
203
+ :deep(.ant-tabs-nav-container-scrolling) {
204
+ padding-left: 0 !important;
205
+ padding-right: 0 !important;
206
+ }
207
+
208
+ :deep(.ant-tabs-tab-arrow-show) {
209
+ display: none;
210
+ }
211
+
212
+ :deep(.ant-tabs-ink-bar) {
213
+ background-color: transparent;
214
+ bottom: 0px;
215
+ display: none;
216
+ height: 0;
217
+ }
218
+
219
+ :deep(.ant-tabs-tab-prev-icon-target) {
220
+ display: none;
221
+ }
222
+
223
+ // 带顶部边距的样式
224
+ &.h-tab-hasTopMargin {
225
+ :deep(.ant-tabs-nav) {
226
+ margin-top: 6px;
227
+ }
228
+
229
+ :deep(.ant-tabs-bar) {
230
+ margin: 0 6px;
231
+ }
232
+
233
+ :deep(.ant-card-body) {
234
+ padding: 6px 0;
235
+
236
+ .ant-card-body {
237
+ padding: 6px;
238
+ }
239
+ }
240
+ }
241
+
242
+ // 通用样式7:细下划线、透明背景、可配置宽度
243
+ &.h-tab-useStyle7 {
244
+ :deep(.ant-tabs-tab-next),
245
+ :deep(.ant-tabs-tab-prev-icon-target),
246
+ :deep(.ant-tabs-tab-next-icon) { display: none; }
247
+
248
+ :deep(.ant-tabs-bar) {
249
+ border-bottom: none !important;
250
+ height: 38px !important;
251
+ margin: 0 !important;
252
+ }
253
+
254
+ :deep(.ant-tabs-ink-bar) {
255
+ display: block !important;
256
+ background-color: #0057FE !important;
257
+ bottom: 0px !important;
258
+ height: 2px !important;
259
+ margin-left: 0 !important;
260
+ }
261
+
262
+ :deep(.ant-tabs-nav-wrap) {
263
+ margin-top: 0 !important;
264
+ margin-bottom: 0 !important;
265
+ padding-left: 0 !important;
266
+ padding-right: 0 !important;
267
+ overflow: visible !important;
268
+ height: auto !important;
269
+ }
270
+
271
+ :deep(.ant-tabs-nav-container) {
272
+ padding-left: 0 !important;
273
+ padding-right: 0 !important;
274
+ margin: 0 !important;
275
+ height: auto !important;
276
+ }
277
+
278
+ :deep(.ant-tabs-nav-scroll) {
279
+ height: auto !important;
280
+ }
281
+
282
+ :deep(.ant-tabs-nav) {
283
+ width: 100% !important;
284
+ display: flex !important;
285
+ flex-direction: row !important;
286
+ flex-wrap: nowrap !important;
287
+
288
+ .ant-tabs-nav-list {
289
+ width: 100% !important;
290
+ display: flex !important;
291
+ flex-direction: row !important;
292
+ flex-wrap: nowrap !important;
293
+ gap: 16px !important;
294
+ }
295
+
296
+ .ant-tabs-tab {
297
+ position: relative !important;
298
+ background-color: transparent !important;
299
+ border-radius: 0 !important;
300
+ color: #313131 !important;
301
+ font-weight: bold !important;
302
+ min-width: var(--tab-min-width, 108px) !important;
303
+ width: var(--tab-width, auto) !important;
304
+ padding: 0 12px !important;
305
+ font-size: 16px !important;
306
+ line-height: 38px !important;
307
+ font-family: "Source Han Sans" !important;
308
+ transition: all 0.3s !important;
309
+ height: 38px !important;
310
+ opacity: 1 !important;
311
+ text-align: center !important;
312
+ margin-right: 0 !important;
313
+ letter-spacing: 0em !important;
314
+ font-feature-settings: "kern" on !important;
315
+ display: inline-flex !important;
316
+ align-items: center !important;
317
+ justify-content: center !important;
318
+ box-sizing: border-box !important;
319
+ }
320
+ .ant-tabs-tab-active {
321
+ background-color: transparent !important;
322
+ color: #0057FE !important;
323
+ font-weight: bold !important;
324
+ width: var(--tab-width, auto) !important;
325
+ padding: 0 12px !important;
326
+ line-height: 38px !important;
327
+ height: 38px !important;
328
+ opacity: 1 !important;
329
+ text-align: center !important;
330
+ letter-spacing: 0em !important;
331
+ font-feature-settings: "kern" on !important;
332
+ display: inline-flex !important;
333
+ align-items: center !important;
334
+ justify-content: center !important;
335
+ box-sizing: border-box !important;
336
+ }
337
+ }
338
+
339
+ // 可选:标签左侧圆点
340
+ &.h-tab-useCycle {
341
+ :deep(.ant-tabs-tab) {
342
+ display: inline-flex !important;
343
+ align-items: center !important;
344
+ gap: 8px !important;
345
+ padding-left: 0 !important;
346
+ margin-right: 0 !important;
347
+ height: 38px !important;
348
+ opacity: 1;
349
+ }
350
+ :deep(.ant-tabs-tab::before) {
351
+ content: "" !important;
352
+ position: static !important;
353
+ width: 8px !important;
354
+ height: 8px !important;
355
+ background: #3362DA !important;
356
+ border-radius: 50% !important;
357
+ flex-shrink: 0 !important;
358
+ opacity: 1 !important;
359
+ z-index: 1 !important;
360
+ top: auto !important;
361
+ bottom: auto !important;
362
+ transform: none !important;
363
+ }
364
+ :deep(.ant-tabs-tab-active::before) {
365
+ background: #0057FE !important;
366
+ }
367
+ }
368
+ }
369
+ // 用户词条使用样式
370
+ &.h-tab-useStyle8 {
371
+ :deep(.ant-tabs-tab-next),
372
+ :deep(.ant-tabs-tab-prev-icon-target),
373
+ :deep(.ant-tabs-tab-next-icon) {
374
+ display: none;
375
+ }
376
+
377
+ :deep(.ant-tabs-nav-wrap) {
378
+ margin-top: 0;
379
+ }
380
+
381
+ // Make the main Ant Design tabs container a flex column to arrange tab bar and content vertically
382
+ :deep(.ant-tabs) {
383
+ display: flex !important;
384
+ flex-direction: column !important; // 确保选项卡栏在顶部,内容区域在下方
385
+ height: auto !important; // 高度自适应
386
+ }
387
+
388
+ :deep(.ant-tabs-bar) {
389
+ border-bottom: 1px solid #d9d9d9; // 底部边框
390
+ border-right: none; // 移除右侧边框
391
+ margin-right: 0 !important; // 移除重叠修复
392
+ flex-shrink: 1 !important; // 允许收缩
393
+ height: auto !important; // 高度自适应
394
+ margin-bottom: 0px !important;
395
+ }
396
+
397
+ :deep(.ant-tabs-content) {
398
+ flex: none !important; // 移除 flex: 1,允许内容区域自然流淌
399
+ }
400
+
401
+ :deep(.ant-tabs-nav) {
402
+ .ant-tabs-nav-container,
403
+ .ant-tabs-nav-wrap,
404
+ .ant-tabs-nav-scroll,
405
+ & > div:first-child {
406
+ display: flex !important;
407
+ flex-direction: row !important;
408
+ flex-wrap: nowrap !important; // 确保不换行
409
+ width: 100% !important; // 占据全部宽度
410
+ height: auto !important;
411
+ }
412
+
413
+ height: auto !important; // 高度自适应内容
414
+ width: 100% !important; // 确保容器占据全部宽度
415
+
416
+ .ant-tabs-tab {
417
+ flex: 1 !important; // 宽度等分布局
418
+ margin-right: 0 !important;
419
+ margin-bottom: 0 !important; // 移除底部间距
420
+ border-top: 1px solid #d9d9d9;
421
+ border-left: 1px solid #d9d9d9;
422
+ border-bottom: 1px solid #d9d9d9; // 所有选项卡都有底部边框
423
+ border-right: none; // 默认没有右边框
424
+ &:last-child {
425
+ border-right: 1px solid #d9d9d9; // 最后一个选项卡有右边框
426
+ }
427
+ border-radius: 0; // 默认无圆角,避免中间相邻处出现圆角
428
+ background-color: #f5f5f5;
429
+ color: #333333;
430
+ font-weight: 500;
431
+ font-size: 16px;
432
+ height: 40px; // 固定高度
433
+ width: auto !important; // 移除固定宽度,以便等分
434
+ display: flex;
435
+ justify-content: center;
436
+ align-items: center;
437
+ padding: 0;
438
+ }
439
+ // 首项:仅左侧圆角
440
+ .ant-tabs-tab:first-child {
441
+ border-top-left-radius: 10px;
442
+ border-bottom-left-radius: 10px;
443
+ }
444
+ // 末项:仅右侧圆角
445
+ .ant-tabs-tab:last-child {
446
+ border-top-right-radius: 10px;
447
+ border-bottom-right-radius: 10px;
448
+ }
449
+ .ant-tabs-tab-active {
450
+ border-bottom: 1px solid transparent; // 激活时隐藏底部边框,与 ant-tabs-bar 的边框衔接
451
+ background-color: #0057FE;
452
+ color: #ffffff;
453
+ font-weight: 600;
454
+ }
455
+ }
456
+ :deep(.ant-tabs-ink-bar) {
457
+ display: none; // 隐藏下划线
458
+ }
459
+ }
460
+ &.h-tab-extra-wrapper-multiple {
461
+ :deep(.h-tab-extra-wrapper){
462
+ display: flex;
463
+ justify-content: end;
464
+ gap: 8px;
465
+ }
466
+ :deep(.x-radio-group){
467
+ height: 32px;
468
+ }
469
+ :deep(.x-radio-item){
470
+ height: 32px;
471
+ display: flex;
472
+ align-items: center;
473
+ margin-bottom: 0px;
474
+ }
475
+ :deep(.ant-tabs-tab){
476
+ height: 34px;
477
+ }
478
+ :deep(.ant-tabs-nav-container){
479
+ padding-top: 2px;
480
+ }
481
+ :deep(.ant-tabs-extra-content){
482
+ line-height: 0px !important;
483
+ }
484
+ }
485
+
486
+ &.h-tab-out-tab {
487
+ :deep(.ant-tabs-nav-wrap) {
488
+ margin-top: 0px !important;
489
+ margin-bottom: 0px !important;
490
+ }
491
+ :deep(.ant-tabs-nav) {
492
+ margin-bottom: 0px !important;
493
+ }
494
+ :deep(.ant-tabs-nav-container) {
495
+ padding-top: 0px !important;
496
+ padding-bottom: 0px !important;
497
+ }
498
+
499
+ :deep(.ant-tabs-bar) {
500
+ margin-top: 0px !important;
501
+ margin-bottom: 0px !important;
502
+ height: auto !important;
503
+ min-height: 0px !important;
504
+ }
505
+
506
+ :deep(.ant-tabs-content) {
507
+ margin-top: 0px !important;
508
+ }
509
+ }
510
+
511
+ // 无下划线样式:隐藏底部指示器线条和边框
512
+ &.h-tab-no-underline {
513
+ :deep(.ant-tabs-bar) {
514
+ border-bottom: none !important;
515
+ }
516
+ :deep(.ant-tabs-ink-bar) {
517
+ display: none !important;
518
+ }
519
+ }
520
+
521
+ // 样式9:圆角卡片式标签(带边框、居中文字、字体切换)
522
+ &.h-tab-useStyle9 {
523
+ :deep(.ant-tabs-tab-next),
524
+ :deep(.ant-tabs-tab-prev-icon-target),
525
+ :deep(.ant-tabs-tab-next-icon) { display: none; }
526
+
527
+ // 保持 ant-tabs 为 column 布局
528
+ :deep(.ant-tabs) {
529
+ display: flex !important;
530
+ flex-direction: column !important;
531
+ height: auto !important;
532
+ width: 100% !important;
533
+ }
534
+
535
+ // 移除 a-card 的默认样式影响
536
+ :deep(.ant-card) {
537
+ overflow: visible !important;
538
+ width: 100% !important;
539
+ }
540
+ :deep(.ant-card-body) {
541
+ padding: 0 !important;
542
+ overflow: visible !important;
543
+ }
544
+
545
+ :deep(.ant-tabs-bar) {
546
+ border-bottom: none !important;
547
+ flex-shrink: 0 !important;
548
+ height: auto !important;
549
+ margin-bottom: 0 !important;
550
+ width: 100% !important;
551
+ overflow: visible !important;
552
+ }
553
+
554
+ :deep(.ant-tabs-content) {
555
+ flex: 1 !important;
556
+ height: auto !important;
557
+ overflow: visible !important;
558
+ }
559
+
560
+ :deep(.ant-tabs-tabpane) {
561
+ overflow: visible !important;
562
+ display: block !important;
563
+ }
564
+
565
+ :deep(.ant-tabs-tabpane-active) {
566
+ overflow: visible !important;
567
+ }
568
+
569
+ // 禁用切换动画,避免抖动
570
+ :deep(.ant-tabs) {
571
+ transition: none !important;
572
+ }
573
+ :deep(.ant-tabs-tabpane) {
574
+ transition: none !important;
575
+ }
576
+
577
+ :deep(.ant-tabs-nav-wrap) {
578
+ margin: 0 !important;
579
+ padding: 0 !important;
580
+ overflow: visible !important;
581
+ position: relative !important;
582
+ display: block !important;
583
+ }
584
+
585
+ :deep(.ant-tabs-nav-container) {
586
+ padding: 0 !important;
587
+ overflow: visible !important;
588
+ display: block !important;
589
+ }
590
+
591
+ :deep(.ant-tabs-nav) {
592
+ display: flex !important;
593
+ flex-direction: row !important;
594
+ flex-wrap: nowrap !important;
595
+ width: auto !important;
596
+ max-width: 100% !important;
597
+ height: auto !important;
598
+ margin: 0 !important;
599
+ overflow: visible !important;
600
+
601
+ .ant-tabs-tab {
602
+ flex: none;
603
+ width: auto;
604
+ min-width: 100px;
605
+ box-sizing: border-box;
606
+ border: 1px solid #E5E9F0;
607
+ border-radius: 6px;
608
+ background: #FFFFFF;
609
+ color: #333333;
610
+ font-family: "Source Han Sans";
611
+ font-size: 18px;
612
+ font-weight: bold;
613
+ line-height: 32px;
614
+ height: 32px;
615
+ text-align: center;
616
+ margin: 0 !important;
617
+ padding: 0 16px !important;
618
+ overflow: hidden !important;
619
+ }
620
+ .ant-tabs-tab-active {
621
+ background-color: #0057FE;
622
+ color: #ffffff;
623
+ font-weight: bold;
624
+ border: 1px solid #0057FE;
625
+ }
626
+ }
627
+
628
+ :deep(.ant-tabs-ink-bar) {
629
+ display: none;
630
+ }
631
+ }
632
+ // 样式10:无下划线、左侧绿色圆点、字体样式切换
633
+ &.h-tab-useStyle10 {
634
+ :deep(.ant-tabs-tab-next),
635
+ :deep(.ant-tabs-tab-prev-icon-target),
636
+ :deep(.ant-tabs-tab-next-icon) { display: none; }
637
+
638
+ :deep(.ant-tabs-bar) {
639
+ border-bottom: none !important;
640
+ }
641
+
642
+ :deep(.ant-tabs-ink-bar) {
643
+ display: none !important;
644
+ }
645
+
646
+ :deep(.ant-tabs-nav-wrap) {
647
+ margin-top: 0;
648
+ padding-left: 0 !important;
649
+ padding-right: 0 !important;
650
+ }
651
+
652
+ :deep(.ant-tabs-nav-container) {
653
+ padding-left: 0 !important;
654
+ padding-right: 0 !important;
655
+ }
656
+
657
+ :deep(.ant-tabs-nav) {
658
+ display: flex;
659
+ flex-wrap: wrap;
660
+ gap: 8px;
661
+ .ant-tabs-tab {
662
+ position: relative;
663
+ background-color: transparent;
664
+ border-radius: 0;
665
+ color: #313131;
666
+ font-family: "Source Han Sans";
667
+ font-size: 16px;
668
+ font-weight: bold;
669
+ line-height: normal;
670
+ letter-spacing: 0em;
671
+ font-feature-settings: "kern" on;
672
+ width: auto;
673
+ padding: 0 12px 6px;
674
+ padding-left: 18px !important;
675
+ transition: all 0.3s;
676
+ height: 40px;
677
+ text-align: center;
678
+ margin-right: 0px !important;
679
+ display: inline-flex !important;
680
+ align-items: center;
681
+ vertical-align: top;
682
+ }
683
+ .ant-tabs-tab::before {
684
+ content: "" !important;
685
+ position: absolute !important;
686
+ left: 0 !important;
687
+ top: 50% !important;
688
+ transform: translateY(-50%) !important;
689
+ width: 8px !important;
690
+ height: 8px !important;
691
+ background: #0057FE !important;
692
+ border-radius: 50% !important;
693
+ display: block !important;
694
+ z-index: 1 !important;
695
+ }
696
+ .ant-tabs-tab-active {
697
+ background-color: transparent;
698
+ color: #0057FE;
699
+ font-weight: bold;
700
+ width: auto;
701
+ padding: 0 12px 6px;
702
+ padding-left: 18px !important;
703
+ height: 40px;
704
+ text-align: center;
705
+ }
706
+ .ant-tabs-tab-active::before {
707
+ background: #0057FE !important;
708
+ }
709
+ }
710
+ }
711
+
712
+ // 样式11:去除边框、选中显示蓝色下划线,标签宽度平均分配
713
+ &.h-tab-useStyle11 {
714
+ :deep(.ant-tabs-tab-next),
715
+ :deep(.ant-tabs-tab-prev-icon-target),
716
+ :deep(.ant-tabs-tab-next-icon) { display: none; }
717
+
718
+ :deep(.ant-tabs-bar) {
719
+ border-bottom: none !important;
720
+ height: 32px !important;
721
+ line-height: 32px !important;
722
+ }
723
+
724
+ :deep(.ant-tabs-ink-bar) {
725
+ display: block !important;
726
+ background-color: #0057FE !important;
727
+ bottom: 0px !important;
728
+ height: 2px !important;
729
+ margin-left: 0 !important;
730
+ }
731
+
732
+ :deep(.ant-tabs-nav-wrap) {
733
+ margin-top: 0;
734
+ padding-left: 0 !important;
735
+ padding-right: 0 !important;
736
+ width: 100% !important;
737
+ }
738
+
739
+ :deep(.ant-tabs-nav-container) {
740
+ padding-left: 0 !important;
741
+ padding-right: 0 !important;
742
+ width: 100% !important;
743
+ }
744
+
745
+ :deep(.ant-tabs-nav-container-scrolling) {
746
+ padding-left: 0 !important;
747
+ padding-right: 0 !important;
748
+ }
749
+
750
+ :deep(.ant-tabs-nav) {
751
+ width: 100% !important;
752
+
753
+ .ant-tabs-nav-list {
754
+ width: 100% !important;
755
+ display: grid !important;
756
+ grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
757
+ }
758
+
759
+ .ant-tabs-tab {
760
+ width: 50%;
761
+ height: 32px;
762
+ box-sizing: border-box !important;
763
+ opacity: 1;
764
+ font-family: "Source Han Sans";
765
+ font-size: 16px;
766
+ font-weight: bold;
767
+ line-height: normal;
768
+ text-align: center;
769
+ letter-spacing: 0em;
770
+ color: #313131;
771
+ background-color: transparent;
772
+ border: none;
773
+ border-radius: 0;
774
+ padding: 0 12px 6px;
775
+ margin-right: 16px !important;
776
+ display: inline-flex !important;
777
+ align-items: center;
778
+ justify-content: center;
779
+ transition: all 0.3s;
780
+ }
781
+
782
+ .ant-tabs-tab-active {
783
+ color: #0057FE;
784
+ background-color: transparent;
785
+ border: none;
786
+ }
787
+ }
788
+ }
789
+ }
790
+ </style>