vue2-client 1.22.19 → 1.22.21

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 (88) hide show
  1. package/.env.his +19 -19
  2. package/.env.message +19 -19
  3. package/.history/.eslintrc_20260521171150.js +74 -0
  4. package/.history/.eslintrc_20260521171213.js +74 -0
  5. package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154443.vue +726 -0
  6. package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154700.vue +478 -0
  7. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260512175435.vue +706 -0
  8. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260512175450.vue +694 -0
  9. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260611152602.vue +755 -0
  10. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260513145941.vue +524 -0
  11. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260513153133.vue +731 -0
  12. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260513160316.vue +525 -0
  13. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260601144150.vue +1046 -0
  14. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310142713.vue +512 -0
  15. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310145118.vue +511 -0
  16. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260311094834.vue +696 -0
  17. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260320143028.vue +693 -0
  18. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260409101450.vue +677 -0
  19. package/.history/src/base-client/components/common/HIS/HTab/HTab_20260625173703.vue +767 -0
  20. package/.history/src/base-client/components/common/HIS/HTab/HTab_20260626112425.vue +803 -0
  21. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513140637.vue +1455 -0
  22. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513140935.vue +1441 -0
  23. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513150818.vue +1441 -0
  24. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513153119.vue +1442 -0
  25. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260513153126.vue +1486 -0
  26. package/.history/src/base-client/components/common/XForm/XFormItem_20260513140854.vue +1607 -0
  27. package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140403.vue +643 -0
  28. package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140829.vue +628 -0
  29. package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519142824.vue +104 -0
  30. package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519143155.vue +102 -0
  31. package/.history/src/base-client/components/common/XReportGrid/XReport_20260309171231.vue +1241 -0
  32. package/.history/src/base-client/components/common/XReportGrid/XReport_20260309171441.vue +1223 -0
  33. package/.history/src/base-client/components/his/HAi/HAi_20260612174826.vue +472 -0
  34. package/.history/src/base-client/components/his/HAi/HAi_20260612175839.vue +538 -0
  35. package/.history/src/base-client/components/his/HAi/HAi_20260615103331.vue +650 -0
  36. package/.history/src/base-client/components/his/HAi/HAi_20260618140214.vue +1396 -0
  37. package/.history/src/base-client/components/his/HAi/HAi_20260618140556.vue +1396 -0
  38. package/.history/src/base-client/components/his/XHDescriptions/XHDescriptions_20260424134504.vue +1469 -0
  39. package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171133.vue +788 -0
  40. package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171151.vue +780 -0
  41. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511170841.vue +585 -0
  42. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511171138.vue +787 -0
  43. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260512141830.vue +739 -0
  44. package/.history/src/components/STable/index_20260409155138.js +806 -0
  45. package/.history/src/components/STable/index_20260409155218.js +814 -0
  46. package/.history/src/expression/core/Expression_20260305164427.js +1371 -0
  47. package/.history/src/expression/core/Expression_20260305170258.js +1358 -0
  48. package/.history/src/expression/core/Program_20260305111830.js +944 -0
  49. package/.history/src/expression/core/Program_20260305112041.js +931 -0
  50. package/.history/src/logic/LogicRunner_20260304154306.js +170 -0
  51. package/.history/src/logic/LogicRunner_20260304155553.js +112 -0
  52. package/.history/src/logic/LogicRunner_20260305105834.js +112 -0
  53. package/.history/src/logic/LogicRunner_20260305112718.js +129 -0
  54. package/.history/src/logic/LogicRunner_20260305182436.js +133 -0
  55. package/.history/src/logic/LogicRunner_20260306151301.js +213 -0
  56. package/.history/src/logic/LogicRunner_20260306152419.js +213 -0
  57. package/.history/src/logic/plugins/common/DateTools_20260305154159.js +61 -0
  58. package/.history/src/logic/plugins/common/DateTools_20260305154217.js +44 -0
  59. package/.history/src/logic/plugins/common/DateTools_20260305161014.js +44 -0
  60. package/.history/src/logic/plugins/common/HttpTools_20260305164352.js +80 -0
  61. package/.history/src/logic/plugins/common/HttpTools_20260305170258.js +75 -0
  62. package/.history/src/logic/plugins/common/HttpTools_20260305171634.js +75 -0
  63. package/.history/src/logic/plugins/common/HttpTools_20260306152419.js +72 -0
  64. package/.history/src/services/api/restTools_20260427142149.js +245 -0
  65. package/.history/src/services/api/restTools_20260427142853.js +230 -0
  66. package/.history/src/services/api/restTools_20260519135558.js +230 -0
  67. package/.history/src/services/api/restTools_20260519140825.js +230 -0
  68. package/.history/src/services/api/restTools_20260519151223.js +230 -0
  69. package/.history/src/utils/indexedDB_20260306150918.js +593 -0
  70. package/.history/src/utils/indexedDB_20260306151301.js +586 -0
  71. package/.idea/af-vue2-client.iml +4 -7
  72. package/.idea/codeStyles/Project.xml +62 -0
  73. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  74. package/.idea/misc.xml +6 -0
  75. package/CHANGELOG.md +837 -837
  76. package/package.json +117 -117
  77. package/preview-input-box.html +180 -0
  78. package/src/base-client/components/common/HIS/HForm/HForm.vue +1186 -1186
  79. package/src/base-client/components/common/HIS/HTab/HTab.vue +790 -757
  80. package/src/base-client/components/common/ImagePreviewModal/index.js +3 -3
  81. package/src/base-client/components/common/XMarkdownViewer/demo.vue +102 -102
  82. package/src/base-client/components/his/HAi/HAi.vue +159 -30
  83. package/src/base-client/components/his/XTransfer/index.md +327 -327
  84. package/src/components/MarkdownEditor/demo.vue +300 -300
  85. package/src/components/MarkdownEditor/index.vue +590 -590
  86. package/src/router/async/router.map.js +141 -141
  87. package/src/services/api/restTools.js +1 -1
  88. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
@@ -1,757 +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) { border-bottom: 2px solid transparent; }
249
-
250
- :deep(.ant-tabs-ink-bar) {
251
- display: block !important;
252
- background-color: #0057FE !important;
253
- bottom: 3px !important;
254
- height: 2px !important;
255
- /* antd 自身计算宽度,与页签宽度匹配 */
256
- margin-left: 0 !important;
257
- }
258
-
259
- :deep(.ant-tabs-nav-wrap) {
260
- margin-top: 0;
261
- padding-left: 0 !important; // 消除整个Tab的左间距
262
- padding-right: 0 !important; // 消除整个Tab的右间距
263
- }
264
-
265
- :deep(.ant-tabs-nav-container) {
266
- padding-left: 0 !important; // 确保容器也没有左右间距
267
- padding-right: 0 !important;
268
- }
269
-
270
- :deep(.ant-tabs-nav) {
271
- display: flex;
272
- flex-wrap: wrap;
273
- gap: 8px;
274
- .ant-tabs-tab {
275
- background-color: transparent;
276
- border-radius: 0;
277
- color: #333333;
278
- font-weight: 500;
279
- /* 自适应宽度,允许通过变量覆盖最小宽度 */
280
- min-width: var(--tab-min-width, 96px);
281
- width: auto;
282
- padding: 0 12px 6px;
283
- font-size: 16px;
284
- line-height: 10px;
285
- font-family: "Source Han Sans";
286
- transition: all 0.3s;
287
- height: 40px;
288
- text-align: center;
289
- margin-right: 0 !important;
290
- }
291
- .ant-tabs-tab-active {
292
- background-color: transparent;
293
- color: #0057FE;
294
- font-weight: 600;
295
- width: auto;
296
- padding: 0 12px 6px;
297
- line-height: 10px;
298
- height: 40px;
299
- text-align: center;
300
- }
301
- }
302
-
303
- // 可选:标签左侧圆点
304
- &.h-tab-useCycle {
305
- :deep(.ant-tabs-tab) {
306
- position: relative;
307
- padding-left: 18px !important;
308
- margin-right: 20px !important;
309
- display: inline-flex !important; // 使用inline-flex保持水平布局
310
- align-items: center !important; // 确保内容垂直居中
311
- line-height: normal !important; // 重置line-height避免冲突
312
- vertical-align: top !important; // 确保垂直对齐
313
- }
314
- :deep(.ant-tabs-tab::before) {
315
- content: "" !important;
316
- position: absolute !important;
317
- left: 0 !important;
318
- top: 50% !important;
319
- transform: translateY(-50%) !important;
320
- width: 12px !important;
321
- height: 12px !important;
322
- background: #0057FE !important;
323
- border-radius: 50% !important;
324
- display: block !important;
325
- z-index: 1 !important; // 确保圆点在最上层
326
- }
327
- :deep(.ant-tabs-nav) {
328
- display: flex !important;
329
- flex-direction: row !important; // 明确指定水平方向
330
- flex-wrap: nowrap !important;
331
- align-items: center !important; // 确保导航栏垂直居中
332
- }
333
- }
334
- }
335
- // 用户词条使用样式
336
- &.h-tab-useStyle8 {
337
- :deep(.ant-tabs-tab-next),
338
- :deep(.ant-tabs-tab-prev-icon-target),
339
- :deep(.ant-tabs-tab-next-icon) {
340
- display: none;
341
- }
342
-
343
- :deep(.ant-tabs-nav-wrap) {
344
- margin-top: 0;
345
- }
346
-
347
- // Make the main Ant Design tabs container a flex column to arrange tab bar and content vertically
348
- :deep(.ant-tabs) {
349
- display: flex !important;
350
- flex-direction: column !important; // 确保选项卡栏在顶部,内容区域在下方
351
- height: auto !important; // 高度自适应
352
- }
353
-
354
- :deep(.ant-tabs-bar) {
355
- border-bottom: 1px solid #d9d9d9; // 底部边框
356
- border-right: none; // 移除右侧边框
357
- margin-right: 0 !important; // 移除重叠修复
358
- flex-shrink: 1 !important; // 允许收缩
359
- height: auto !important; // 高度自适应
360
- margin-bottom: 0px !important;
361
- }
362
-
363
- :deep(.ant-tabs-content) {
364
- flex: none !important; // 移除 flex: 1,允许内容区域自然流淌
365
- }
366
-
367
- :deep(.ant-tabs-nav) {
368
- .ant-tabs-nav-container,
369
- .ant-tabs-nav-wrap,
370
- .ant-tabs-nav-scroll,
371
- & > div:first-child {
372
- display: flex !important;
373
- flex-direction: row !important;
374
- flex-wrap: nowrap !important; // 确保不换行
375
- width: 100% !important; // 占据全部宽度
376
- height: auto !important;
377
- }
378
-
379
- height: auto !important; // 高度自适应内容
380
- width: 100% !important; // 确保容器占据全部宽度
381
-
382
- .ant-tabs-tab {
383
- flex: 1 !important; // 宽度等分布局
384
- margin-right: 0 !important;
385
- margin-bottom: 0 !important; // 移除底部间距
386
- border-top: 1px solid #d9d9d9;
387
- border-left: 1px solid #d9d9d9;
388
- border-bottom: 1px solid #d9d9d9; // 所有选项卡都有底部边框
389
- border-right: none; // 默认没有右边框
390
- &:last-child {
391
- border-right: 1px solid #d9d9d9; // 最后一个选项卡有右边框
392
- }
393
- border-radius: 0; // 默认无圆角,避免中间相邻处出现圆角
394
- background-color: #f5f5f5;
395
- color: #333333;
396
- font-weight: 500;
397
- font-size: 16px;
398
- height: 40px; // 固定高度
399
- width: auto !important; // 移除固定宽度,以便等分
400
- display: flex;
401
- justify-content: center;
402
- align-items: center;
403
- padding: 0;
404
- }
405
- // 首项:仅左侧圆角
406
- .ant-tabs-tab:first-child {
407
- border-top-left-radius: 10px;
408
- border-bottom-left-radius: 10px;
409
- }
410
- // 末项:仅右侧圆角
411
- .ant-tabs-tab:last-child {
412
- border-top-right-radius: 10px;
413
- border-bottom-right-radius: 10px;
414
- }
415
- .ant-tabs-tab-active {
416
- border-bottom: 1px solid transparent; // 激活时隐藏底部边框,与 ant-tabs-bar 的边框衔接
417
- background-color: #0057FE;
418
- color: #ffffff;
419
- font-weight: 600;
420
- }
421
- }
422
- :deep(.ant-tabs-ink-bar) {
423
- display: none; // 隐藏下划线
424
- }
425
- }
426
- &.h-tab-extra-wrapper-multiple {
427
- :deep(.h-tab-extra-wrapper){
428
- display: flex;
429
- justify-content: end;
430
- gap: 8px;
431
- }
432
- :deep(.x-radio-group){
433
- height: 32px;
434
- }
435
- :deep(.x-radio-item){
436
- height: 32px;
437
- display: flex;
438
- align-items: center;
439
- margin-bottom: 0px;
440
- }
441
- :deep(.ant-tabs-tab){
442
- height: 34px;
443
- }
444
- :deep(.ant-tabs-nav-container){
445
- padding-top: 2px;
446
- }
447
- :deep(.ant-tabs-extra-content){
448
- line-height: 0px !important;
449
- }
450
- }
451
-
452
- &.h-tab-out-tab {
453
- :deep(.ant-tabs-nav-wrap) {
454
- margin-top: 0px !important;
455
- margin-bottom: 0px !important;
456
- }
457
- :deep(.ant-tabs-nav) {
458
- margin-bottom: 0px !important;
459
- }
460
- :deep(.ant-tabs-nav-container) {
461
- padding-top: 0px !important;
462
- padding-bottom: 0px !important;
463
- }
464
-
465
- :deep(.ant-tabs-bar) {
466
- margin-top: 0px !important;
467
- margin-bottom: 0px !important;
468
- height: auto !important;
469
- min-height: 0px !important;
470
- }
471
-
472
- :deep(.ant-tabs-content) {
473
- margin-top: 0px !important;
474
- }
475
- }
476
-
477
- // 无下划线样式:隐藏底部指示器线条和边框
478
- &.h-tab-no-underline {
479
- :deep(.ant-tabs-bar) {
480
- border-bottom: none !important;
481
- }
482
- :deep(.ant-tabs-ink-bar) {
483
- display: none !important;
484
- }
485
- }
486
-
487
- // 样式9:圆角卡片式标签(带边框、居中文字、字体切换)
488
- &.h-tab-useStyle9 {
489
- :deep(.ant-tabs-tab-next),
490
- :deep(.ant-tabs-tab-prev-icon-target),
491
- :deep(.ant-tabs-tab-next-icon) { display: none; }
492
-
493
- // 保持 ant-tabs 为 column 布局
494
- :deep(.ant-tabs) {
495
- display: flex !important;
496
- flex-direction: column !important;
497
- height: auto !important;
498
- width: 100% !important;
499
- }
500
-
501
- // 移除 a-card 的默认样式影响
502
- :deep(.ant-card) {
503
- overflow: visible !important;
504
- width: 100% !important;
505
- }
506
- :deep(.ant-card-body) {
507
- padding: 0 !important;
508
- overflow: visible !important;
509
- }
510
-
511
- :deep(.ant-tabs-bar) {
512
- border-bottom: none !important;
513
- flex-shrink: 0 !important;
514
- height: auto !important;
515
- margin-bottom: 0 !important;
516
- width: 100% !important;
517
- overflow: visible !important;
518
- }
519
-
520
- :deep(.ant-tabs-content) {
521
- flex: 1 !important;
522
- height: auto !important;
523
- overflow: visible !important;
524
- }
525
-
526
- :deep(.ant-tabs-tabpane) {
527
- overflow: visible !important;
528
- display: block !important;
529
- }
530
-
531
- :deep(.ant-tabs-tabpane-active) {
532
- overflow: visible !important;
533
- }
534
-
535
- // 禁用切换动画,避免抖动
536
- :deep(.ant-tabs) {
537
- transition: none !important;
538
- }
539
- :deep(.ant-tabs-tabpane) {
540
- transition: none !important;
541
- }
542
-
543
- :deep(.ant-tabs-nav-wrap) {
544
- margin: 0 !important;
545
- padding: 0 !important;
546
- overflow: visible !important;
547
- position: relative !important;
548
- display: block !important;
549
- }
550
-
551
- :deep(.ant-tabs-nav-container) {
552
- padding: 0 !important;
553
- overflow: visible !important;
554
- display: block !important;
555
- }
556
-
557
- :deep(.ant-tabs-nav) {
558
- display: flex !important;
559
- flex-direction: row !important;
560
- flex-wrap: nowrap !important;
561
- width: auto !important;
562
- max-width: 100% !important;
563
- height: auto !important;
564
- margin: 0 !important;
565
- overflow: visible !important;
566
-
567
- .ant-tabs-tab {
568
- flex: none;
569
- width: auto;
570
- min-width: 100px;
571
- box-sizing: border-box;
572
- border: 1px solid #E5E9F0;
573
- border-radius: 6px;
574
- background: #FFFFFF;
575
- color: #333333;
576
- font-family: "Source Han Sans";
577
- font-size: 18px;
578
- font-weight: bold;
579
- line-height: 32px;
580
- height: 32px;
581
- text-align: center;
582
- margin: 0 !important;
583
- padding: 0 16px !important;
584
- overflow: hidden !important;
585
- }
586
- .ant-tabs-tab-active {
587
- background-color: #0057FE;
588
- color: #ffffff;
589
- font-weight: bold;
590
- border: 1px solid #0057FE;
591
- }
592
- }
593
-
594
- :deep(.ant-tabs-ink-bar) {
595
- display: none;
596
- }
597
- }
598
- // 样式10:无下划线、左侧绿色圆点、字体样式切换
599
- &.h-tab-useStyle10 {
600
- :deep(.ant-tabs-tab-next),
601
- :deep(.ant-tabs-tab-prev-icon-target),
602
- :deep(.ant-tabs-tab-next-icon) { display: none; }
603
-
604
- :deep(.ant-tabs-bar) {
605
- border-bottom: none !important;
606
- }
607
-
608
- :deep(.ant-tabs-ink-bar) {
609
- display: none !important;
610
- }
611
-
612
- :deep(.ant-tabs-nav-wrap) {
613
- margin-top: 0;
614
- padding-left: 0 !important;
615
- padding-right: 0 !important;
616
- }
617
-
618
- :deep(.ant-tabs-nav-container) {
619
- padding-left: 0 !important;
620
- padding-right: 0 !important;
621
- }
622
-
623
- :deep(.ant-tabs-nav) {
624
- display: flex;
625
- flex-wrap: wrap;
626
- gap: 8px;
627
- .ant-tabs-tab {
628
- position: relative;
629
- background-color: transparent;
630
- border-radius: 0;
631
- color: #313131;
632
- font-family: "Source Han Sans";
633
- font-size: 16px;
634
- font-weight: bold;
635
- line-height: normal;
636
- letter-spacing: 0em;
637
- font-feature-settings: "kern" on;
638
- font-variation-settings: "opsz" auto;
639
- width: auto;
640
- padding: 0 12px 6px;
641
- padding-left: 18px !important;
642
- transition: all 0.3s;
643
- height: 40px;
644
- text-align: center;
645
- margin-right: 0px !important;
646
- display: inline-flex !important;
647
- align-items: center;
648
- vertical-align: top;
649
- }
650
- .ant-tabs-tab::before {
651
- content: "" !important;
652
- position: absolute !important;
653
- left: 0 !important;
654
- top: 50% !important;
655
- transform: translateY(-50%) !important;
656
- width: 8px !important;
657
- height: 8px !important;
658
- background: #0057FE !important;
659
- border-radius: 50% !important;
660
- display: block !important;
661
- z-index: 1 !important;
662
- }
663
- .ant-tabs-tab-active {
664
- background-color: transparent;
665
- color: #0057FE;
666
- font-weight: bold;
667
- width: auto;
668
- padding: 0 12px 6px;
669
- padding-left: 18px !important;
670
- height: 40px;
671
- text-align: center;
672
- }
673
- .ant-tabs-tab-active::before {
674
- background: #0057FE !important;
675
- }
676
- }
677
- }
678
-
679
- // 样式11:去除边框、选中显示蓝色下划线,标签宽度平均分配
680
- &.h-tab-useStyle11 {
681
- :deep(.ant-tabs-tab-next),
682
- :deep(.ant-tabs-tab-prev-icon-target),
683
- :deep(.ant-tabs-tab-next-icon) { display: none; }
684
-
685
- :deep(.ant-tabs-bar) {
686
- border-bottom: none !important;
687
- height: 32px !important;
688
- line-height: 32px !important;
689
- }
690
-
691
- :deep(.ant-tabs-ink-bar) {
692
- display: block !important;
693
- background-color: #0057FE !important;
694
- bottom: 0px !important;
695
- height: 2px !important;
696
- margin-left: 0 !important;
697
- }
698
-
699
- :deep(.ant-tabs-nav-wrap) {
700
- margin-top: 0;
701
- padding-left: 0 !important;
702
- padding-right: 0 !important;
703
- width: 100% !important;
704
- }
705
-
706
- :deep(.ant-tabs-nav-container) {
707
- padding-left: 0 !important;
708
- padding-right: 0 !important;
709
- width: 100% !important;
710
- }
711
-
712
- :deep(.ant-tabs-nav-container-scrolling) {
713
- padding-left: 0 !important;
714
- padding-right: 0 !important;
715
- }
716
-
717
- :deep(.ant-tabs-nav) {
718
- width: 100% !important;
719
-
720
- .ant-tabs-nav-list {
721
- width: 100% !important;
722
- display: grid !important;
723
- grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
724
- }
725
-
726
- .ant-tabs-tab {
727
- width: 50%;
728
- height: 32px;
729
- box-sizing: border-box !important;
730
- opacity: 1;
731
- font-family: "Source Han Sans";
732
- font-size: 16px;
733
- font-weight: bold;
734
- line-height: normal;
735
- text-align: center;
736
- letter-spacing: 0em;
737
- color: #313131;
738
- background-color: transparent;
739
- border: none;
740
- border-radius: 0;
741
- padding: 0 12px 6px;
742
- margin-right: 0 !important;
743
- display: inline-flex !important;
744
- align-items: center;
745
- justify-content: center;
746
- transition: all 0.3s;
747
- }
748
-
749
- .ant-tabs-tab-active {
750
- color: #0057FE;
751
- background-color: transparent;
752
- border: none;
753
- }
754
- }
755
- }
756
- }
757
- </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>