vue2-client 1.22.26 → 1.22.28

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 (96) hide show
  1. package/.env.his +19 -19
  2. package/.history/.eslintrc_20260521171150.js +74 -0
  3. package/.history/.eslintrc_20260521171213.js +74 -0
  4. package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154443.vue +726 -0
  5. package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154700.vue +478 -0
  6. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260611152602.vue +755 -0
  7. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702161223.vue +748 -0
  8. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702163310.vue +832 -0
  9. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702163324.vue +748 -0
  10. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702165416.vue +748 -0
  11. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702174939.vue +793 -0
  12. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260702115430.vue +1463 -0
  13. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310142713.vue +512 -0
  14. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310145118.vue +511 -0
  15. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260311094834.vue +696 -0
  16. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260320143028.vue +693 -0
  17. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260409101450.vue +677 -0
  18. package/.history/src/base-client/components/common/HIS/HTab/HTab_20260625173703.vue +767 -0
  19. package/.history/src/base-client/components/common/HIS/HTab/HTab_20260626112425.vue +803 -0
  20. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260626173854.vue +1522 -0
  21. package/.history/src/base-client/components/common/XCollapse/XCollapse_20260703180349.vue +862 -0
  22. package/.history/src/base-client/components/common/XCollapse/XCollapse_20260703180623.vue +862 -0
  23. package/.history/src/base-client/components/common/XCollapse/XCollapse_20260703180702.vue +842 -0
  24. package/.history/src/base-client/components/common/XForm/XFormItem_20260703101840.vue +1621 -0
  25. package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140403.vue +643 -0
  26. package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140829.vue +628 -0
  27. package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519142824.vue +104 -0
  28. package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519143155.vue +102 -0
  29. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20260703180412.vue +1102 -0
  30. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20260703180623.vue +1093 -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/XRadio/XRadio_20260702140351.vue +774 -0
  40. package/.history/src/base-client/components/his/XRadio/XRadio_20260702140441.vue +774 -0
  41. package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171133.vue +788 -0
  42. package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171151.vue +780 -0
  43. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511170841.vue +585 -0
  44. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511171138.vue +787 -0
  45. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260512141830.vue +739 -0
  46. package/.history/src/components/STable/index_20260409155138.js +806 -0
  47. package/.history/src/components/STable/index_20260409155218.js +814 -0
  48. package/.history/src/expression/core/Expression_20260305164427.js +1371 -0
  49. package/.history/src/expression/core/Expression_20260305170258.js +1358 -0
  50. package/.history/src/expression/core/Program_20260305111830.js +944 -0
  51. package/.history/src/expression/core/Program_20260305112041.js +931 -0
  52. package/.history/src/logic/LogicRunner_20260304154306.js +170 -0
  53. package/.history/src/logic/LogicRunner_20260304155553.js +112 -0
  54. package/.history/src/logic/LogicRunner_20260305105834.js +112 -0
  55. package/.history/src/logic/LogicRunner_20260305112718.js +129 -0
  56. package/.history/src/logic/LogicRunner_20260305182436.js +133 -0
  57. package/.history/src/logic/LogicRunner_20260306151301.js +213 -0
  58. package/.history/src/logic/LogicRunner_20260306152419.js +213 -0
  59. package/.history/src/logic/plugins/common/DateTools_20260305154159.js +61 -0
  60. package/.history/src/logic/plugins/common/DateTools_20260305154217.js +44 -0
  61. package/.history/src/logic/plugins/common/DateTools_20260305161014.js +44 -0
  62. package/.history/src/logic/plugins/common/HttpTools_20260305164352.js +80 -0
  63. package/.history/src/logic/plugins/common/HttpTools_20260305170258.js +75 -0
  64. package/.history/src/logic/plugins/common/HttpTools_20260305171634.js +75 -0
  65. package/.history/src/logic/plugins/common/HttpTools_20260306152419.js +72 -0
  66. package/.history/src/services/api/restTools_20260427142149.js +245 -0
  67. package/.history/src/services/api/restTools_20260427142853.js +230 -0
  68. package/.history/src/services/api/restTools_20260519135558.js +230 -0
  69. package/.history/src/services/api/restTools_20260519140825.js +230 -0
  70. package/.history/src/services/api/restTools_20260519151223.js +230 -0
  71. package/.history/src/theme/global_20260703101634.less +370 -0
  72. package/.history/src/theme/global_20260703101840.less +337 -0
  73. package/.history/src/theme/global_20260703104511.less +337 -0
  74. package/.history/src/utils/indexedDB_20260306150918.js +593 -0
  75. package/.history/src/utils/indexedDB_20260306151301.js +586 -0
  76. package/.idea/codeStyles/Project.xml +62 -0
  77. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  78. package/.idea/misc.xml +5 -87
  79. package/docs/XCollapse/345/261/225/345/274/200/347/251/272/347/231/275/346/216/222/346/237/245/350/256/260/345/275/225.md +153 -0
  80. package/package.json +1 -1
  81. package/preview-input-box.html +180 -0
  82. package/src/base-client/components/common/HIS/HButtons/HButtons.vue +775 -748
  83. package/src/base-client/components/common/HIS/HForm/HForm.vue +1708 -1186
  84. package/src/base-client/components/common/HIS/HTab/HTab.vue +790 -790
  85. package/src/base-client/components/common/XMarkdownViewer/demo.vue +102 -102
  86. package/src/base-client/components/his/XRadio/XRadio.vue +73 -1
  87. package/src/base-client/components/his/XTitle/XTitle.vue +63 -3
  88. package/src/base-client/components/his/XTransfer/index.md +327 -327
  89. package/src/services/user.js +1 -0
  90. package/.idea/.name +0 -1
  91. package/.idea/MarsCodeWorkspaceAppSettings.xml +0 -8
  92. package/.idea/deployment.xml +0 -14
  93. package/.idea/gradle.xml +0 -7
  94. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  95. package/.idea/libraries/contour_plot.xml +0 -9
  96. package/.idea/material_theme_project_new.xml +0 -18
@@ -1,748 +1,775 @@
1
- <script setup >
2
- import XButtons from '@vue2-client/base-client/components/common/XButtons/XButtons.vue'
3
- import { ref, computed, useAttrs, nextTick, onMounted } from 'vue'
4
-
5
- const props = defineProps({
6
- // HButtons特有的属性
7
- buttonStyle: {
8
- type: String,
9
- default: 'button24'
10
- }
11
- })
12
-
13
- const emit = defineEmits(['update:activeIndex', 'activeChange', 'configEnd'])
14
-
15
- // 内部 XButtons 实例引用
16
- const xButtonsRef = ref()
17
-
18
- // useStyle10模式下激活按钮的索引(从0开始)
19
- const activeIndex = ref(0)
20
-
21
- // 兼容多种样式配置
22
- const attrs = useAttrs()
23
-
24
- // 判断是否使用 useStyle10 模式
25
- const isUseStyle10 = computed(() => {
26
- return props.buttonStyle === 'useStyle10' || attrs.useStyle10 === true || attrs.useStyle10 === '' || attrs.useStyle10 === 'true'
27
- })
28
-
29
- const wrapperClassObject = computed(() => {
30
- const a = attrs
31
- const classes = {}
32
-
33
- // 通用布尔样式开关(以存在/空字符串/'true' 为真)
34
- const booleanStyleKeys = [
35
- 'max-width200',
36
- 'width173',
37
- 'button_refresh',
38
- 'border', 'no-style',
39
- 'fill-container',
40
- 'no-boder-style',
41
- 'form-inline',
42
- 'one-button-style', // 一个按钮样式,占满整个宽度
43
- 'useStyle10', // 左侧蓝色圆点指示器样式
44
- 'custom-icon-style' // 自定义图标边框样式
45
- ]
46
- for (const key of booleanStyleKeys) {
47
- const val = a[key]
48
- const truthy = val === true || val === '' || val === 'true'
49
- if (truthy) classes[`h-buttons-${key}`] = true
50
- }
51
- return classes
52
- })
53
-
54
- // 获取内部按钮元素列表
55
- const getButtonElements = () => {
56
- const xEl = xButtonsRef.value?.$el
57
- if (!xEl) return []
58
- return Array.from(xEl.querySelectorAll('.ant-btn'))
59
- }
60
-
61
- // 设置按钮激活状态
62
- const setActiveState = (btn, isActive) => {
63
- if (!btn) return
64
- if (isActive) {
65
- btn.classList.add('h-btn-active')
66
- // 使用内联样式确保颜色生效
67
- btn.style.color = '#0057FE'
68
- } else {
69
- btn.classList.remove('h-btn-active')
70
- // 清除内联样式
71
- btn.style.color = ''
72
- }
73
- }
74
-
75
- // 清除所有按钮的激活样式
76
- const clearAllActiveStyles = () => {
77
- const buttons = getButtonElements()
78
- buttons.forEach(btn => {
79
- setActiveState(btn, false)
80
- })
81
- }
82
-
83
- // 设置指定索引按钮为激活状态
84
- const setActiveButton = (index) => {
85
- const buttons = getButtonElements()
86
- clearAllActiveStyles()
87
-
88
- if (buttons[index]) {
89
- setActiveState(buttons[index], true)
90
- }
91
- }
92
-
93
- // 事件委托:处理按钮点击
94
- const handleButtonClick = (event) => {
95
- if (!isUseStyle10.value) return
96
-
97
- // 查找被点击的按钮元素
98
- const target = event.target.closest('.ant-btn')
99
- if (!target) return
100
-
101
- const buttons = getButtonElements()
102
- const index = buttons.indexOf(target)
103
-
104
- if (index === -1) return
105
-
106
-
107
- // 更新激活索引
108
- activeIndex.value = index
109
- emit('update:activeIndex', index)
110
- emit('activeChange', index)
111
-
112
- // 更新按钮样式
113
- clearAllActiveStyles()
114
- setActiveState(buttons[index], true)
115
- }
116
-
117
- // 初始化 useStyle10 样式(带重试机制)
118
- const initUseStyle10 = (retryCount = 0) => {
119
-
120
- if (!isUseStyle10.value) {
121
- return
122
- }
123
-
124
- const buttons = getButtonElements()
125
-
126
-
127
- // 如果没有找到按钮,重试最多10次
128
- if (buttons.length === 0 && retryCount < 10) {
129
- setTimeout(() => {
130
- initUseStyle10(retryCount + 1)
131
- }, 100)
132
- return
133
- }
134
-
135
- if (buttons.length === 0) {
136
-
137
- return
138
- }
139
-
140
- // 设置第一个按钮为激活状态
141
- clearAllActiveStyles()
142
- setActiveState(buttons[0], true)
143
- }
144
-
145
- // 监听 XButtons 配置结束,初始化激活状态
146
- const handleConfigEnd = async () => {
147
- await nextTick()
148
- initUseStyle10()
149
- emit('configEnd')
150
- }
151
-
152
- // 在挂载时也尝试初始化(作为备用方案)
153
- onMounted(() => {
154
- setTimeout(() => {
155
- initUseStyle10()
156
- }, 300)
157
- })
158
-
159
- // 暴露方法:获取内部 XButtons 实例
160
- defineExpose({
161
- getXButtonsInstance: function () { return xButtonsRef.value },
162
- /** 等待配置结束的异步方法,委托给内部 XButtons */
163
- waitConfigEnd: () => xButtonsRef.value?.waitConfigEnd?.() ?? Promise.resolve(),
164
- /** 获取当前激活按钮索引 */
165
- getActiveIndex: () => activeIndex.value,
166
- /** 设置激活按钮索引 */
167
- setActiveIndex: (index) => {
168
- activeIndex.value = index
169
- setActiveButton(index)
170
- },
171
- /** 获取当前激活按钮元素 */
172
- getActiveButton: () => {
173
- const buttons = getButtonElements()
174
- return buttons[activeIndex.value]
175
- }
176
- })
177
- </script>
178
-
179
- <template>
180
- <div
181
- class="h-buttons-wrapper"
182
- :class="[
183
- `h-buttons-${buttonStyle}`,
184
- wrapperClassObject
185
- ]"
186
- @click="handleButtonClick"
187
- >
188
- <x-buttons
189
- ref="xButtonsRef"
190
- v-bind="$attrs"
191
- v-on="$listeners"
192
- @configEnd="handleConfigEnd"
193
- >
194
- <template v-for="(_, name) in $slots" #[name]="slotData">
195
- <slot :name="name" v-bind="slotData" />
196
- </template>
197
- </x-buttons>
198
- </div>
199
- </template>
200
-
201
- <style scoped lang="less">
202
- .h-buttons-wrapper {
203
- // 基础样式
204
- :deep(.ant-btn-group) {
205
- .ant-btn {
206
- border-radius: 6px;
207
- background-color: #FFFFFF;
208
- border: 1px solid #9499A0;
209
- color: #313131;
210
- font-weight: normal;
211
- letter-spacing: 0em;
212
- width: 110px;
213
- font-size: 16px;
214
- font-family: "Source Han Sans";
215
- line-height: normal;
216
- margin-right: 25px;
217
- height: 32px;
218
- }
219
- }
220
- // button24样式
221
- &.h-buttons-button24 {
222
- :deep(.ant-btn-group) {
223
- .ant-btn {
224
- border: 1px solid #CDCDCD;
225
- color: #5D5C5C;
226
- // top: -100px;
227
- width: fit-content;
228
- min-width: 110px;
229
- }
230
- }
231
- }
232
- // button23样式
233
- &.h-buttons-button23 {
234
- :deep(.ant-btn-group) {
235
- .ant-btn {
236
- border: none;
237
- padding: 0 !important;
238
- color: #FFFFFF;
239
- border-radius: 50%;
240
- background-color: #1890FF;
241
- margin-left: 10px;
242
- top: -88px;
243
- width: 30px;
244
- height: 30px;
245
- }
246
- }
247
- }
248
- // +号样式(共享基础样式)
249
- &.h-buttons-table-height-button23,
250
- &.h-buttons-table-height-button23-no-transform {
251
- :deep(.ant-btn-group) {
252
- display: inline-flex;
253
- align-items: center;
254
- height: 100%;
255
-
256
- .ant-btn {
257
- display: inline-flex;
258
- align-items: center;
259
- justify-content: center;
260
- border: none;
261
- padding: 0 !important;
262
- color: #FFFFFF;
263
- border-radius: 50%;
264
- background-color: #1890FF;
265
- margin-left: 10px;
266
- width: 30px;
267
- height: 30px;
268
- }
269
- }
270
- }
271
- // 仅在有分页的场景上移
272
- &.h-buttons-table-height-button23 {
273
- :deep(.ant-btn-group) {
274
- .ant-btn { transform: translateY(-100%); }
275
- }
276
- }
277
- // 居中+悬停高亮的新样式
278
- &.h-buttons-plus-center {
279
- :deep(.ant-btn-group) {
280
- display: flex;
281
- align-items: center;
282
- justify-content: center;
283
- gap: 16px;
284
-
285
- .ant-btn {
286
- display: inline-flex;
287
- align-items: center;
288
- justify-content: center;
289
- border: 1px solid #CDCDCD;
290
- color: #5D5C5C;
291
- min-width: 110px;
292
- transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
293
-
294
- &:hover {
295
- background-color: #0057FE;
296
- border-color: #0057FE;
297
- color: #FFFFFF;
298
- }
299
- /* 支持通过 data-type 改变悬停颜色 */
300
- &[data-type='success']:hover {
301
- background-color: #34C76E;
302
- border-color: #34C76E;
303
- color: #FFFFFF;
304
- }
305
- }
306
- }
307
- }
308
- // 按钮布局样式公共部分
309
- &.h-buttons-button-left,
310
- &.h-buttons-button-center,
311
- &.h-buttons-button-right,
312
- &.h-buttons-button-space-between {
313
- :deep(.ant-btn-group) {
314
- width: 100%;
315
- display: flex;
316
- flex-wrap: nowrap;
317
- .ant-btn {
318
- border: 1px solid #CDCDCD;
319
- color: #5D5C5C;
320
- white-space: nowrap;
321
- overflow: hidden;
322
- margin-right: 0px;
323
- text-overflow: ellipsis;
324
- }
325
- }
326
- }
327
- &.h-buttons-max-width200 {
328
- :deep(.ant-btn) {
329
- max-width: 200px !important;
330
- }
331
- }
332
- // button-left样式 - 按钮从左到右排列
333
- &.h-buttons-button-left {
334
- :deep(.ant-btn-group) {
335
- justify-content: flex-start;
336
- gap: 12px;
337
- }
338
- }
339
- // button-center样式 - 按钮居中排列
340
- &.h-buttons-button-center {
341
- :deep(.ant-btn-group) {
342
- justify-content: center;
343
- gap: 12px;
344
- }
345
- }
346
- // button-right样式 - 按钮从右到左排列
347
- &.h-buttons-button-right {
348
- :deep(.ant-btn-group) {
349
- justify-content: flex-end;
350
- gap: 12px;
351
- }
352
- }
353
- // button-space-between样式 - 按钮两端对齐(两个按钮时分布在两端)
354
- &.h-buttons-button-space-between {
355
- :deep(.ant-btn-group) {
356
- justify-content: space-between;
357
- }
358
- }
359
-
360
- // button-icon-tiles样式 - 左侧彩色图标块 + 右侧文字
361
- &.h-buttons-button-icon-tiles {
362
- :deep(.ant-btn-group) {
363
- width: 100%;
364
- display: flex;
365
- flex-wrap: wrap; // 允许自动换行
366
- justify-content: flex-start; // 左对齐
367
- gap: 0; // 取消统一间距
368
-
369
- .ant-btn {
370
- position: relative;
371
- display: inline-flex;
372
- align-items: center;
373
- gap: 10px; // 控制图标与文字间距
374
- border: 1px solid #E6E8EB;
375
- font-size: 14px;
376
- height: 44px;
377
- padding: 0 10px 0 10px;
378
- border-radius: 8px;
379
- min-width: 116px;
380
- box-shadow: 0 2px 0 rgba(0,0,0,0.02);
381
- margin-right: 12px; // 用margin控制横向间距,末尾一排自然换行
382
- }
383
-
384
- .ant-btn .anticon {
385
- width: 26px;
386
- height: 26px;
387
- display: inline-flex;
388
- align-items: center;
389
- justify-content: center;
390
- border-radius: 6px;
391
- color: #fff;
392
- font-size: 14px;
393
- flex: 0 0 26px; // 固定正方形,防止随文本挤压变形
394
- box-sizing: border-box;
395
- }
396
-
397
- /* 默认蓝色,支持通过 data-type 改变色块(success/warning/error/default)*/
398
- .ant-btn .anticon { background: #3FA7FF; }
399
- .ant-btn[data-type='success'] .anticon { background: #34C76E; }
400
- .ant-btn[data-type='warning'] .anticon { background: #FFA940; }
401
- .ant-btn[data-type='error'] .anticon { background: #FF7875; }
402
- .ant-btn[disabled] .anticon { background: #BFBFBF; }
403
-
404
- /* 图标与文字间距在有图标时更自然 */
405
- .ant-btn > .anticon + span { margin-left: 10px; }
406
- }
407
- }
408
- // 水印图标与按钮容器布局调整
409
- &.h-buttons-button-watermark-icon {
410
- :deep(.watermark-icon) { transform: translate(-50%, -54%) !important; }
411
- :deep(.x-button) { display: flex !important; }
412
- :deep(.ant-btn-group) {
413
- margin: 0 auto;
414
- display: block;
415
- }
416
- }
417
- &.h-buttons-0padding-button {
418
- padding: 0px 4px;
419
- }
420
- // button25样式 用于会诊申请侧边栏按钮样式
421
- &.h-buttons-button25 {
422
- :deep(.x-buttons) {
423
- .ant-btn-group {
424
- width: 173px;
425
- justify-content: space-between;
426
-
427
- .ant-btn {
428
- width: 173px;
429
- }
430
- }
431
- }
432
- }
433
- &.h-buttons-button_refresh {
434
- margin-top: 10px;
435
- }
436
- // 居中样式 用于门诊收费左侧按钮样式(三个按钮居中样式)
437
- &.h-buttons-out-button {
438
- :deep(.x-buttons) {
439
- margin-top: 2px !important;
440
- margin-bottom: 10px !important;
441
- display: flex;
442
- justify-content: center;
443
- .ant-btn-group {
444
- display: flex;
445
- flex-wrap: nowrap;
446
- gap: 12px;
447
- .ant-btn {
448
- width: 110px;
449
- height: 32px;
450
- border-radius: 6px;
451
- opacity: 1;
452
- background: #FFFFFF;
453
- box-sizing: border-box;
454
- border: 1px solid #9499A0;
455
- margin-right: 0px;
456
- /* 允许正常文本渲染,避免省略号导致的“变成点了” */
457
- font-family: "Source Han Sans";
458
- font-size: 16px;
459
- font-weight: normal;
460
- line-height: normal;
461
- color: #313131;
462
- }
463
- /* 还原子元素默认高度,避免文字被压缩成点 */
464
- }
465
- }
466
- }
467
- // button15样式 - 垂直排列的深色按钮组
468
- &.h-buttons-button15 {
469
- :deep(.x-buttons) {
470
- margin-top: -22px;
471
- .ant-btn-group {
472
- flex-direction: column; /* 按钮垂直排列 */
473
- display: flex; /* 启用flex布局 */
474
- gap: 6px; /* 按钮间距 */
475
- .ant-btn {
476
- border: none; /* 移除边框 */
477
- color: #FFFFFF; /* 字体颜色 */
478
- background-color: #0057FE; /* 背景色 */
479
- box-sizing: border-box; /* 盒模型 */
480
- left: 12px; /* 左偏移 */
481
- width: 280px; /* 宽度 */
482
- }
483
- }
484
- }
485
- }
486
- // button2样式
487
- &.h-buttons-button2 {
488
- :deep(.x-buttons) {
489
- margin: -20px 6px -20px 6px;
490
- .ant-btn-group {
491
- width: 100%;
492
- justify-content: space-between;
493
- display: flex; /* 确保flex布局 */
494
- flex-wrap: nowrap; /* 防止换行 */
495
- .ant-btn {
496
- border-radius: 6px; /* 边框圆角 */
497
- border: none; /* 移除边框 */
498
- flex: 0 0 46%; /* flex-grow: 0, flex-shrink: 0, flex-basis: 46% */
499
- min-width: 0; /* 覆盖可能的默认最小宽度 */
500
- font-size: 16px; /* 字体大小 */
501
- height: 32px; /* 高度 */
502
- color: #FFFFFF; /* 字体颜色 */
503
- background-color: #1890FF; /* 背景颜色 */
504
- }
505
- }
506
- }
507
- }
508
- // 与表单项内联使用时的垂直居中对齐样式
509
- &.h-buttons-form-inline {
510
- :deep(.ant-btn-group){
511
- height: 45px;
512
- display: flex;
513
- align-items: center;
514
- }
515
- }
516
- &.h-buttons-width173 {
517
- :deep(.ant-btn) {
518
- width: 173px !important;
519
- }
520
- }
521
- // 按钮无边框+无图标+无阴影
522
- &.h-button-no-style{
523
- :deep(.ant-btn) {
524
- border: 0px;
525
- .anticon{
526
- display: none;
527
- }
528
- }
529
- :deep(.ant-btn-primary){
530
- text-shadow: none;
531
- box-shadow: none;
532
- }
533
- }
534
- // 按钮组边距
535
- &.h-button-border{
536
- border: 1px solid #E5E9F0;
537
- border-radius: 6px;
538
- }
539
- // 按钮撑开整个容器
540
- &.h-buttons-fill-container{
541
- :deep(.x-buttons) {
542
- width: 100%;
543
- .ant-btn-group{
544
- width: 100%;
545
- .ant-btn{
546
- width: 100%;
547
- margin-right: 0px;
548
- }
549
- }
550
- }
551
- }
552
- &.h-buttons-one-button-style {
553
- margin: 0 !important;
554
- padding: 0 !important;
555
- :deep(.x-buttons) {
556
- margin: 0 !important;
557
- padding: 0 !important;
558
- .ant-btn-group {
559
- width: 100%;
560
- height: 32px;
561
- justify-content: space-between;
562
- display: flex;
563
- flex-wrap: nowrap;
564
- .ant-btn {
565
- width: 100%;
566
- margin-right: 0px !important;
567
- min-width: 100% !important;
568
- border-radius: 6px; /* 边框圆角 */
569
- font-size: 18px; /* 字体大小 */
570
- line-height: 26px;
571
- font-weight: bold;
572
- letter-spacing: 14px;
573
- height: 32px; /* 高度 */
574
- color: #FFFFFF; /* 字体颜色 */
575
- background: #0057FE;/* 背景颜色 */
576
- }
577
- }
578
- }
579
- }
580
- // no-boder-style样式 - 无边框样式
581
- &.h-buttons-no-boder-style {
582
- :deep(.ant-btn-group) {
583
- margin-left: -20px;
584
- .ant-btn {
585
- border: none !important;
586
- background: transparent !important;
587
- height: 23px;
588
- opacity: 1;
589
- font-family: "Source Han Sans";
590
- font-size: 16px;
591
- font-weight: normal;
592
- line-height: normal;
593
- letter-spacing: 0em;
594
- color: #313131;
595
- padding: 0;
596
- box-shadow: none;
597
- margin-right: 0;
598
- margin-left: 0;
599
-
600
- // 图标样式
601
- .anticon {
602
- height: 16px;
603
- width: 16px;
604
- opacity: 1;
605
- background: transparent;
606
- display: inline-flex;
607
- align-items: center;
608
- justify-content: center;
609
- color: #94979E;
610
- margin-right: 4px;
611
- }
612
-
613
- &:hover {
614
- background: transparent !important;
615
- color: #313131;
616
- }
617
-
618
- &:focus {
619
- background: transparent !important;
620
- color: #313131;
621
- }
622
- }
623
- }
624
- }
625
- // useStyle10样式 - 左侧蓝色圆点指示器样式,与HTab useStyle10效果一致
626
- &.h-buttons-useStyle10 {
627
- :deep(.ant-btn-group) {
628
- display: flex;
629
- flex-wrap: wrap;
630
- gap: 8px;
631
- margin-left: 0 !important;
632
- padding: 0 !important;
633
-
634
- .ant-btn {
635
- position: relative;
636
- background-color: transparent !important;
637
- border: none !important;
638
- border-radius: 0 !important;
639
- color: #313131;
640
- font-family: "Source Han Sans";
641
- font-size: 16px;
642
- font-weight: bold;
643
- line-height: normal;
644
- letter-spacing: 0em;
645
- font-feature-settings: "kern" on;
646
- font-variation-settings: "opsz" auto;
647
- width: auto;
648
- height: 40px;
649
- padding: 0 12px 6px 18px;
650
- text-align: center;
651
- margin-right: 0 !important;
652
- box-shadow: none !important;
653
- display: inline-flex;
654
- align-items: center;
655
- vertical-align: top;
656
- outline: none !important;
657
- background: transparent !important;
658
- background-image: none !important;
659
- border-color: transparent !important;
660
- border-width: 0 !important;
661
-
662
- &::before {
663
- content: "" !important;
664
- position: absolute !important;
665
- left: 5px !important;
666
- top: 50% !important;
667
- transform: translateY(-50%) !important;
668
- width: 8px !important;
669
- height: 8px !important;
670
- background-color: #1890ff !important;
671
- background-image: none !important;
672
- border-radius: 50% !important;
673
- display: block !important;
674
- z-index: 10 !important;
675
- pointer-events: none !important;
676
- opacity: 1 !important;
677
- mix-blend-mode: normal !important;
678
- box-shadow: none !important;
679
- filter: none !important;
680
- -webkit-filter: none !important;
681
- }
682
-
683
- .anticon {
684
- display: none !important;
685
- }
686
- }
687
-
688
- // 激活状态:通过 h-btn-active 类控制
689
- .ant-btn.h-btn-active {
690
- color: #0057FE !important;
691
- }
692
- }
693
- }
694
-
695
- // 自定义图标边框样式
696
- &.h-buttons-custom-icon-style {
697
- :deep(.x-buttons) {
698
- .ant-btn-group {
699
- width: 100%;
700
- justify-content: space-between;
701
- display: flex;
702
- flex-wrap: nowrap;
703
-
704
- .ant-btn {
705
- width: 100%;
706
- margin-right: 0px !important;
707
- min-width: 100% !important;
708
- height: 32px;
709
- border-radius: 6px;
710
- opacity: 1;
711
- background: #FFFFFF;
712
- box-sizing: border-box;
713
- border: 1px solid #9499A0;
714
- font-family: "Source Han Sans";
715
- font-size: 16px;
716
- font-weight: normal;
717
- line-height: normal;
718
- letter-spacing: 0em;
719
- color: #313131;
720
- display: inline-flex;
721
- align-items: center;
722
- justify-content: center;
723
- gap: 8px;
724
-
725
- .anticon {
726
- width: 18px;
727
- height: 18px;
728
- opacity: 1;
729
- background: #0057FE;
730
- border-radius: 50%;
731
- display: inline-flex;
732
- align-items: center;
733
- justify-content: center;
734
- position: relative;
735
- flex-shrink: 0;
736
- color: #FFFFFF;
737
-
738
- svg {
739
- width: 12px;
740
- height: 12px;
741
- }
742
- }
743
- }
744
- }
745
- }
746
- }
747
- }
748
- </style>
1
+ <script setup >
2
+ import XButtons from '@vue2-client/base-client/components/common/XButtons/XButtons.vue'
3
+ import { ref, computed, useAttrs, nextTick, onMounted } from 'vue'
4
+
5
+ const props = defineProps({
6
+ // HButtons特有的属性
7
+ buttonStyle: {
8
+ type: String,
9
+ default: 'button24'
10
+ }
11
+ })
12
+
13
+ const emit = defineEmits(['update:activeIndex', 'activeChange', 'configEnd'])
14
+
15
+ // 内部 XButtons 实例引用
16
+ const xButtonsRef = ref()
17
+
18
+ // useStyle10模式下激活按钮的索引(从0开始)
19
+ const activeIndex = ref(0)
20
+
21
+ // 兼容多种样式配置
22
+ const attrs = useAttrs()
23
+
24
+ // 判断是否使用 useStyle10 模式
25
+ const isUseStyle10 = computed(() => {
26
+ return props.buttonStyle === 'useStyle10' || attrs.useStyle10 === true || attrs.useStyle10 === '' || attrs.useStyle10 === 'true'
27
+ })
28
+
29
+ const wrapperClassObject = computed(() => {
30
+ const a = attrs
31
+ const classes = {}
32
+
33
+ // 通用布尔样式开关(以存在/空字符串/'true' 为真)
34
+ const booleanStyleKeys = [
35
+ 'max-width200',
36
+ 'width173',
37
+ 'button_refresh',
38
+ 'border', 'no-style',
39
+ 'fill-container',
40
+ 'no-boder-style',
41
+ 'form-inline',
42
+ 'one-button-style', // 一个按钮样式,占满整个宽度
43
+ 'useStyle10', // 左侧蓝色圆点指示器样式
44
+ 'custom-icon-style', // 自定义图标边框样式
45
+ 'drop-down-style' // 图标切换样式
46
+ ]
47
+ for (const key of booleanStyleKeys) {
48
+ const val = a[key]
49
+ const truthy = val === true || val === '' || val === 'true'
50
+ if (truthy) classes[`h-buttons-${key}`] = true
51
+ }
52
+ return classes
53
+ })
54
+
55
+ // 展开/合并切换按钮样式开关
56
+ const isDropDownStyle = computed(() => {
57
+ const val = attrs['drop-down-style']
58
+ return val === true || val === '' || val === 'true'
59
+ })
60
+
61
+ // 获取内部按钮元素列表
62
+ const getButtonElements = () => {
63
+ const xEl = xButtonsRef.value?.$el
64
+ if (!xEl) return []
65
+ return Array.from(xEl.querySelectorAll('.ant-btn'))
66
+ }
67
+
68
+ // 设置按钮激活状态
69
+ const setActiveState = (btn, isActive) => {
70
+ if (!btn) return
71
+ if (isActive) {
72
+ btn.classList.add('h-btn-active')
73
+ // 使用内联样式确保颜色生效
74
+ btn.style.color = '#0057FE'
75
+ } else {
76
+ btn.classList.remove('h-btn-active')
77
+ // 清除内联样式
78
+ btn.style.color = ''
79
+ }
80
+ }
81
+
82
+ // 清除所有按钮的激活样式
83
+ const clearAllActiveStyles = () => {
84
+ const buttons = getButtonElements()
85
+ buttons.forEach(btn => {
86
+ setActiveState(btn, false)
87
+ })
88
+ }
89
+
90
+ // 设置指定索引按钮为激活状态
91
+ const setActiveButton = (index) => {
92
+ const buttons = getButtonElements()
93
+ clearAllActiveStyles()
94
+
95
+ if (buttons[index]) {
96
+ setActiveState(buttons[index], true)
97
+ }
98
+ }
99
+
100
+ // 事件委托:处理按钮点击
101
+ const handleButtonClick = (event) => {
102
+ // 下拉按钮样式下,点击展开/合并按钮时反转图标
103
+ if (isDropDownStyle.value) {
104
+ const target = event.target.closest('.ant-btn')
105
+ if (target) {
106
+ target.classList.toggle('h-buttons-icon-expanded')
107
+ }
108
+ }
109
+
110
+ if (!isUseStyle10.value) return
111
+
112
+ // 查找被点击的按钮元素
113
+ const target = event.target.closest('.ant-btn')
114
+ if (!target) return
115
+
116
+ const buttons = getButtonElements()
117
+ const index = buttons.indexOf(target)
118
+
119
+ if (index === -1) return
120
+
121
+
122
+ // 更新激活索引
123
+ activeIndex.value = index
124
+ emit('update:activeIndex', index)
125
+ emit('activeChange', index)
126
+
127
+ // 更新按钮样式
128
+ clearAllActiveStyles()
129
+ setActiveState(buttons[index], true)
130
+ }
131
+ // 初始化 useStyle10 样式(带重试机制)
132
+ const initUseStyle10 = (retryCount = 0) => {
133
+
134
+ if (!isUseStyle10.value) {
135
+ return
136
+ }
137
+
138
+ const buttons = getButtonElements()
139
+
140
+
141
+ // 如果没有找到按钮,重试最多10次
142
+ if (buttons.length === 0 && retryCount < 10) {
143
+ setTimeout(() => {
144
+ initUseStyle10(retryCount + 1)
145
+ }, 100)
146
+ return
147
+ }
148
+
149
+ if (buttons.length === 0) {
150
+
151
+ return
152
+ }
153
+
154
+ // 设置第一个按钮为激活状态
155
+ clearAllActiveStyles()
156
+ setActiveState(buttons[0], true)
157
+ }
158
+
159
+ // 监听 XButtons 配置结束,初始化激活状态
160
+ const handleConfigEnd = async () => {
161
+ await nextTick()
162
+ initUseStyle10()
163
+ emit('configEnd')
164
+ }
165
+
166
+ // 在挂载时也尝试初始化(作为备用方案)
167
+ onMounted(() => {
168
+ setTimeout(() => {
169
+ initUseStyle10()
170
+ }, 300)
171
+ })
172
+
173
+ // 暴露方法:获取内部 XButtons 实例
174
+ defineExpose({
175
+ getXButtonsInstance: function () { return xButtonsRef.value },
176
+ /** 等待配置结束的异步方法,委托给内部 XButtons */
177
+ waitConfigEnd: () => xButtonsRef.value?.waitConfigEnd?.() ?? Promise.resolve(),
178
+ /** 获取当前激活按钮索引 */
179
+ getActiveIndex: () => activeIndex.value,
180
+ /** 设置激活按钮索引 */
181
+ setActiveIndex: (index) => {
182
+ activeIndex.value = index
183
+ setActiveButton(index)
184
+ },
185
+ /** 获取当前激活按钮元素 */
186
+ getActiveButton: () => {
187
+ const buttons = getButtonElements()
188
+ return buttons[activeIndex.value]
189
+ }
190
+ })
191
+ </script>
192
+
193
+ <template>
194
+ <div
195
+ class="h-buttons-wrapper"
196
+ :class="[
197
+ `h-buttons-${buttonStyle}`,
198
+ wrapperClassObject
199
+ ]"
200
+ @click="handleButtonClick"
201
+ >
202
+ <x-buttons
203
+ ref="xButtonsRef"
204
+ v-bind="$attrs"
205
+ v-on="$listeners"
206
+ @configEnd="handleConfigEnd"
207
+ >
208
+ <template v-for="(_, name) in $slots" #[name]="slotData">
209
+ <slot :name="name" v-bind="slotData" />
210
+ </template>
211
+ </x-buttons>
212
+ </div>
213
+ </template>
214
+
215
+ <style scoped lang="less">
216
+ .h-buttons-wrapper {
217
+ // 基础样式
218
+ :deep(.ant-btn-group) {
219
+ .ant-btn {
220
+ border-radius: 6px;
221
+ background-color: #FFFFFF;
222
+ border: 1px solid #9499A0;
223
+ color: #313131;
224
+ font-weight: normal;
225
+ letter-spacing: 0em;
226
+ width: 110px;
227
+ font-size: 16px;
228
+ font-family: "Source Han Sans";
229
+ line-height: normal;
230
+ margin-right: 25px;
231
+ height: 32px;
232
+ }
233
+ }
234
+ // button24样式
235
+ &.h-buttons-button24 {
236
+ :deep(.ant-btn-group) {
237
+ .ant-btn {
238
+ border: 1px solid #CDCDCD;
239
+ color: #5D5C5C;
240
+ // top: -100px;
241
+ width: fit-content;
242
+ min-width: 110px;
243
+ }
244
+ }
245
+ }
246
+ // button23样式
247
+ &.h-buttons-button23 {
248
+ :deep(.ant-btn-group) {
249
+ .ant-btn {
250
+ border: none;
251
+ padding: 0 !important;
252
+ color: #FFFFFF;
253
+ border-radius: 50%;
254
+ background-color: #1890FF;
255
+ margin-left: 10px;
256
+ top: -88px;
257
+ width: 30px;
258
+ height: 30px;
259
+ }
260
+ }
261
+ }
262
+ // +号样式(共享基础样式)
263
+ &.h-buttons-table-height-button23,
264
+ &.h-buttons-table-height-button23-no-transform {
265
+ :deep(.ant-btn-group) {
266
+ display: inline-flex;
267
+ align-items: center;
268
+ height: 100%;
269
+
270
+ .ant-btn {
271
+ display: inline-flex;
272
+ align-items: center;
273
+ justify-content: center;
274
+ border: none;
275
+ padding: 0 !important;
276
+ color: #FFFFFF;
277
+ border-radius: 50%;
278
+ background-color: #1890FF;
279
+ margin-left: 10px;
280
+ width: 30px;
281
+ height: 30px;
282
+ }
283
+ }
284
+ }
285
+ // 仅在有分页的场景上移
286
+ &.h-buttons-table-height-button23 {
287
+ :deep(.ant-btn-group) {
288
+ .ant-btn { transform: translateY(-100%); }
289
+ }
290
+ }
291
+ // 居中+悬停高亮的新样式
292
+ &.h-buttons-plus-center {
293
+ :deep(.ant-btn-group) {
294
+ display: flex;
295
+ align-items: center;
296
+ justify-content: center;
297
+ gap: 16px;
298
+
299
+ .ant-btn {
300
+ display: inline-flex;
301
+ align-items: center;
302
+ justify-content: center;
303
+ border: 1px solid #CDCDCD;
304
+ color: #5D5C5C;
305
+ min-width: 110px;
306
+ transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
307
+
308
+ &:hover {
309
+ background-color: #0057FE;
310
+ border-color: #0057FE;
311
+ color: #FFFFFF;
312
+ }
313
+ /* 支持通过 data-type 改变悬停颜色 */
314
+ &[data-type='success']:hover {
315
+ background-color: #34C76E;
316
+ border-color: #34C76E;
317
+ color: #FFFFFF;
318
+ }
319
+ }
320
+ }
321
+ }
322
+ // 按钮布局样式公共部分
323
+ &.h-buttons-button-left,
324
+ &.h-buttons-button-center,
325
+ &.h-buttons-button-right,
326
+ &.h-buttons-button-space-between {
327
+ :deep(.ant-btn-group) {
328
+ width: 100%;
329
+ display: flex;
330
+ flex-wrap: nowrap;
331
+ .ant-btn {
332
+ border: 1px solid #CDCDCD;
333
+ color: #5D5C5C;
334
+ white-space: nowrap;
335
+ overflow: hidden;
336
+ margin-right: 0px;
337
+ text-overflow: ellipsis;
338
+ }
339
+ }
340
+ }
341
+ &.h-buttons-max-width200 {
342
+ :deep(.ant-btn) {
343
+ max-width: 200px !important;
344
+ }
345
+ }
346
+ // button-left样式 - 按钮从左到右排列
347
+ &.h-buttons-button-left {
348
+ :deep(.ant-btn-group) {
349
+ justify-content: flex-start;
350
+ gap: 12px;
351
+ }
352
+ }
353
+ // button-center样式 - 按钮居中排列
354
+ &.h-buttons-button-center {
355
+ :deep(.ant-btn-group) {
356
+ justify-content: center;
357
+ gap: 12px;
358
+ }
359
+ }
360
+ // button-right样式 - 按钮从右到左排列
361
+ &.h-buttons-button-right {
362
+ :deep(.ant-btn-group) {
363
+ justify-content: flex-end;
364
+ gap: 12px;
365
+ }
366
+ }
367
+ // button-space-between样式 - 按钮两端对齐(两个按钮时分布在两端)
368
+ &.h-buttons-button-space-between {
369
+ :deep(.ant-btn-group) {
370
+ justify-content: space-between;
371
+ }
372
+ }
373
+
374
+ // button-icon-tiles样式 - 左侧彩色图标块 + 右侧文字
375
+ &.h-buttons-button-icon-tiles {
376
+ :deep(.ant-btn-group) {
377
+ width: 100%;
378
+ display: flex;
379
+ flex-wrap: wrap; // 允许自动换行
380
+ justify-content: flex-start; // 左对齐
381
+ gap: 0; // 取消统一间距
382
+
383
+ .ant-btn {
384
+ position: relative;
385
+ display: inline-flex;
386
+ align-items: center;
387
+ gap: 10px; // 控制图标与文字间距
388
+ border: 1px solid #E6E8EB;
389
+ font-size: 14px;
390
+ height: 44px;
391
+ padding: 0 10px 0 10px;
392
+ border-radius: 8px;
393
+ min-width: 116px;
394
+ box-shadow: 0 2px 0 rgba(0,0,0,0.02);
395
+ margin-right: 12px; // 用margin控制横向间距,末尾一排自然换行
396
+ }
397
+
398
+ .ant-btn .anticon {
399
+ width: 26px;
400
+ height: 26px;
401
+ display: inline-flex;
402
+ align-items: center;
403
+ justify-content: center;
404
+ border-radius: 6px;
405
+ color: #fff;
406
+ font-size: 14px;
407
+ flex: 0 0 26px; // 固定正方形,防止随文本挤压变形
408
+ box-sizing: border-box;
409
+ }
410
+
411
+ /* 默认蓝色,支持通过 data-type 改变色块(success/warning/error/default)*/
412
+ .ant-btn .anticon { background: #3FA7FF; }
413
+ .ant-btn[data-type='success'] .anticon { background: #34C76E; }
414
+ .ant-btn[data-type='warning'] .anticon { background: #FFA940; }
415
+ .ant-btn[data-type='error'] .anticon { background: #FF7875; }
416
+ .ant-btn[disabled] .anticon { background: #BFBFBF; }
417
+
418
+ /* 图标与文字间距在有图标时更自然 */
419
+ .ant-btn > .anticon + span { margin-left: 10px; }
420
+ }
421
+ }
422
+ // 水印图标与按钮容器布局调整
423
+ &.h-buttons-button-watermark-icon {
424
+ :deep(.watermark-icon) { transform: translate(-50%, -54%) !important; }
425
+ :deep(.x-button) { display: flex !important; }
426
+ :deep(.ant-btn-group) {
427
+ margin: 0 auto;
428
+ display: block;
429
+ }
430
+ }
431
+ &.h-buttons-0padding-button {
432
+ padding: 0px 4px;
433
+ }
434
+ // button25样式 用于会诊申请侧边栏按钮样式
435
+ &.h-buttons-button25 {
436
+ :deep(.x-buttons) {
437
+ .ant-btn-group {
438
+ width: 173px;
439
+ justify-content: space-between;
440
+
441
+ .ant-btn {
442
+ width: 173px;
443
+ }
444
+ }
445
+ }
446
+ }
447
+ &.h-buttons-button_refresh {
448
+ margin-top: 10px;
449
+ }
450
+ // 居中样式 用于门诊收费左侧按钮样式(三个按钮居中样式)
451
+ &.h-buttons-out-button {
452
+ :deep(.x-buttons) {
453
+ margin-top: 2px !important;
454
+ margin-bottom: 10px !important;
455
+ display: flex;
456
+ justify-content: center;
457
+ .ant-btn-group {
458
+ display: flex;
459
+ flex-wrap: nowrap;
460
+ gap: 12px;
461
+ .ant-btn {
462
+ width: 110px;
463
+ height: 32px;
464
+ border-radius: 6px;
465
+ opacity: 1;
466
+ background: #FFFFFF;
467
+ box-sizing: border-box;
468
+ border: 1px solid #9499A0;
469
+ margin-right: 0px;
470
+ /* 允许正常文本渲染,避免省略号导致的“变成点了” */
471
+ font-family: "Source Han Sans";
472
+ font-size: 16px;
473
+ font-weight: normal;
474
+ line-height: normal;
475
+ color: #313131;
476
+ }
477
+ /* 还原子元素默认高度,避免文字被压缩成点 */
478
+ }
479
+ }
480
+ }
481
+ // button15样式 - 垂直排列的深色按钮组
482
+ &.h-buttons-button15 {
483
+ :deep(.x-buttons) {
484
+ margin-top: -22px;
485
+ .ant-btn-group {
486
+ flex-direction: column; /* 按钮垂直排列 */
487
+ display: flex; /* 启用flex布局 */
488
+ gap: 6px; /* 按钮间距 */
489
+ .ant-btn {
490
+ border: none; /* 移除边框 */
491
+ color: #FFFFFF; /* 字体颜色 */
492
+ background-color: #0057FE; /* 背景色 */
493
+ box-sizing: border-box; /* 盒模型 */
494
+ left: 12px; /* 左偏移 */
495
+ width: 280px; /* 宽度 */
496
+ }
497
+ }
498
+ }
499
+ }
500
+ // button2样式
501
+ &.h-buttons-button2 {
502
+ :deep(.x-buttons) {
503
+ margin: -20px 6px -20px 6px;
504
+ .ant-btn-group {
505
+ width: 100%;
506
+ justify-content: space-between;
507
+ display: flex; /* 确保flex布局 */
508
+ flex-wrap: nowrap; /* 防止换行 */
509
+ .ant-btn {
510
+ border-radius: 6px; /* 边框圆角 */
511
+ border: none; /* 移除边框 */
512
+ flex: 0 0 46%; /* flex-grow: 0, flex-shrink: 0, flex-basis: 46% */
513
+ min-width: 0; /* 覆盖可能的默认最小宽度 */
514
+ font-size: 16px; /* 字体大小 */
515
+ height: 32px; /* 高度 */
516
+ color: #FFFFFF; /* 字体颜色 */
517
+ background-color: #1890FF; /* 背景颜色 */
518
+ }
519
+ }
520
+ }
521
+ }
522
+ // 与表单项内联使用时的垂直居中对齐样式
523
+ &.h-buttons-form-inline {
524
+ :deep(.ant-btn-group){
525
+ height: 45px;
526
+ display: flex;
527
+ align-items: center;
528
+ }
529
+ }
530
+ &.h-buttons-width173 {
531
+ :deep(.ant-btn) {
532
+ width: 173px !important;
533
+ }
534
+ }
535
+ // 按钮无边框+无图标+无阴影
536
+ &.h-button-no-style{
537
+ :deep(.ant-btn) {
538
+ border: 0px;
539
+ .anticon{
540
+ display: none;
541
+ }
542
+ }
543
+ :deep(.ant-btn-primary){
544
+ text-shadow: none;
545
+ box-shadow: none;
546
+ }
547
+ }
548
+ // 按钮组边距
549
+ &.h-button-border{
550
+ border: 1px solid #E5E9F0;
551
+ border-radius: 6px;
552
+ }
553
+ // 按钮撑开整个容器
554
+ &.h-buttons-fill-container{
555
+ :deep(.x-buttons) {
556
+ width: 100%;
557
+ .ant-btn-group{
558
+ width: 100%;
559
+ .ant-btn{
560
+ width: 100%;
561
+ margin-right: 0px;
562
+ }
563
+ }
564
+ }
565
+ }
566
+ &.h-buttons-one-button-style {
567
+ margin: 0 !important;
568
+ padding: 0 !important;
569
+ :deep(.x-buttons) {
570
+ margin: 0 !important;
571
+ padding: 0 !important;
572
+ .ant-btn-group {
573
+ width: 100%;
574
+ height: 32px;
575
+ justify-content: space-between;
576
+ display: flex;
577
+ flex-wrap: nowrap;
578
+ .ant-btn {
579
+ width: 100%;
580
+ margin-right: 0px !important;
581
+ min-width: 100% !important;
582
+ border-radius: 6px; /* 边框圆角 */
583
+ font-size: 18px; /* 字体大小 */
584
+ line-height: 26px;
585
+ font-weight: bold;
586
+ letter-spacing: 14px;
587
+ height: 32px; /* 高度 */
588
+ color: #FFFFFF; /* 字体颜色 */
589
+ background: #0057FE;/* 背景颜色 */
590
+ }
591
+ }
592
+ }
593
+ }
594
+ // no-boder-style样式 - 无边框样式
595
+ &.h-buttons-no-boder-style {
596
+ :deep(.ant-btn-group) {
597
+ margin-left: -20px;
598
+ .ant-btn {
599
+ border: none !important;
600
+ background: transparent !important;
601
+ height: 23px;
602
+ opacity: 1;
603
+ font-family: "Source Han Sans";
604
+ font-size: 16px;
605
+ font-weight: normal;
606
+ line-height: normal;
607
+ letter-spacing: 0em;
608
+ color: #313131;
609
+ padding: 0;
610
+ box-shadow: none;
611
+ margin-right: 0;
612
+ margin-left: 0;
613
+
614
+ // 图标样式
615
+ .anticon {
616
+ height: 16px;
617
+ width: 16px;
618
+ opacity: 1;
619
+ background: transparent;
620
+ display: inline-flex;
621
+ align-items: center;
622
+ justify-content: center;
623
+ color: #94979E;
624
+ margin-right: 4px;
625
+ }
626
+
627
+ &:hover {
628
+ background: transparent !important;
629
+ color: #313131;
630
+ }
631
+
632
+ &:focus {
633
+ background: transparent !important;
634
+ color: #313131;
635
+ }
636
+ }
637
+ }
638
+ }
639
+ // useStyle10样式 - 左侧蓝色圆点指示器样式,与HTab useStyle10效果一致
640
+ &.h-buttons-useStyle10 {
641
+ :deep(.ant-btn-group) {
642
+ display: flex;
643
+ flex-wrap: wrap;
644
+ gap: 8px;
645
+ margin-left: 0 !important;
646
+ padding: 0 !important;
647
+
648
+ .ant-btn {
649
+ position: relative;
650
+ background-color: transparent !important;
651
+ border: none !important;
652
+ border-radius: 0 !important;
653
+ color: #313131;
654
+ font-family: "Source Han Sans";
655
+ font-size: 16px;
656
+ font-weight: bold;
657
+ line-height: normal;
658
+ letter-spacing: 0em;
659
+ font-feature-settings: "kern" on;
660
+ font-variation-settings: "opsz" auto;
661
+ width: auto;
662
+ height: 40px;
663
+ padding: 0 12px 6px 18px;
664
+ text-align: center;
665
+ margin-right: 0 !important;
666
+ box-shadow: none !important;
667
+ display: inline-flex;
668
+ align-items: center;
669
+ vertical-align: top;
670
+ outline: none !important;
671
+ background: transparent !important;
672
+ background-image: none !important;
673
+ border-color: transparent !important;
674
+ border-width: 0 !important;
675
+
676
+ &::before {
677
+ content: "" !important;
678
+ position: absolute !important;
679
+ left: 5px !important;
680
+ top: 50% !important;
681
+ transform: translateY(-50%) !important;
682
+ width: 8px !important;
683
+ height: 8px !important;
684
+ background-color: #1890ff !important;
685
+ background-image: none !important;
686
+ border-radius: 50% !important;
687
+ display: block !important;
688
+ z-index: 10 !important;
689
+ pointer-events: none !important;
690
+ opacity: 1 !important;
691
+ mix-blend-mode: normal !important;
692
+ box-shadow: none !important;
693
+ filter: none !important;
694
+ -webkit-filter: none !important;
695
+ }
696
+
697
+ .anticon {
698
+ display: none !important;
699
+ }
700
+ }
701
+
702
+ // 激活状态:通过 h-btn-active 类控制
703
+ .ant-btn.h-btn-active {
704
+ color: #0057FE !important;
705
+ }
706
+ }
707
+ }
708
+
709
+ // 自定义图标边框样式
710
+ &.h-buttons-custom-icon-style {
711
+ :deep(.x-buttons) {
712
+ .ant-btn-group {
713
+ width: 100%;
714
+ justify-content: space-between;
715
+ display: flex;
716
+ flex-wrap: nowrap;
717
+
718
+ .ant-btn {
719
+ width: 100%;
720
+ margin-right: 0px !important;
721
+ min-width: 100% !important;
722
+ height: 32px;
723
+ border-radius: 6px;
724
+ opacity: 1;
725
+ background: #FFFFFF;
726
+ box-sizing: border-box;
727
+ border: 1px solid #9499A0;
728
+ font-family: "Source Han Sans";
729
+ font-size: 16px;
730
+ font-weight: normal;
731
+ line-height: normal;
732
+ letter-spacing: 0em;
733
+ color: #313131;
734
+ display: inline-flex;
735
+ align-items: center;
736
+ justify-content: center;
737
+ gap: 8px;
738
+
739
+ .anticon {
740
+ width: 18px;
741
+ height: 18px;
742
+ opacity: 1;
743
+ background: #0057FE;
744
+ border-radius: 50%;
745
+ display: inline-flex;
746
+ align-items: center;
747
+ justify-content: center;
748
+ position: relative;
749
+ flex-shrink: 0;
750
+ color: #FFFFFF;
751
+
752
+ svg {
753
+ width: 12px;
754
+ height: 12px;
755
+ }
756
+ }
757
+ }
758
+ }
759
+ }
760
+ }
761
+
762
+ // 图标模式下,点击展开/合并按钮后反转图标
763
+ &.h-buttons-drop-down-style {
764
+ :deep(.ant-btn) {
765
+ .anticon {
766
+ transition: transform 0.2s ease;
767
+ }
768
+
769
+ &.h-buttons-icon-expanded .anticon {
770
+ transform: rotate(180deg);
771
+ }
772
+ }
773
+ }
774
+ }
775
+ </style>