vue2-client 1.22.28 → 1.22.30

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 (90) hide show
  1. package/.env.his +19 -19
  2. package/.idea/af-vue2-client.iml +2 -3
  3. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. package/package.json +1 -1
  5. package/src/base-client/components/common/HIS/HButtons/HButtons.vue +775 -775
  6. package/src/base-client/components/common/HIS/HForm/HForm.vue +1708 -1708
  7. package/src/base-client/components/common/HIS/HTab/HTab.vue +790 -790
  8. package/src/base-client/components/common/XInspectionDetailDrawer/components/HazardPhotos.vue +18 -0
  9. package/src/base-client/components/common/XInspectionDetailDrawer/index.vue +6 -1
  10. package/src/base-client/components/common/XMarkdownViewer/demo.vue +102 -102
  11. package/src/base-client/components/his/XTransfer/index.md +327 -327
  12. package/.history/.eslintrc_20260521171150.js +0 -74
  13. package/.history/.eslintrc_20260521171213.js +0 -74
  14. package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154443.vue +0 -726
  15. package/.history/src/base-client/components/common/HIS/HAddNativeForm/HAddNativeForm_20260601154700.vue +0 -478
  16. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260611152602.vue +0 -755
  17. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702161223.vue +0 -748
  18. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702163310.vue +0 -832
  19. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702163324.vue +0 -748
  20. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702165416.vue +0 -748
  21. package/.history/src/base-client/components/common/HIS/HButtons/HButtons_20260702174939.vue +0 -793
  22. package/.history/src/base-client/components/common/HIS/HForm/HForm_20260702115430.vue +0 -1463
  23. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310142713.vue +0 -512
  24. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260310145118.vue +0 -511
  25. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260311094834.vue +0 -696
  26. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260320143028.vue +0 -693
  27. package/.history/src/base-client/components/common/HIS/HFormTable/HFormTable_20260409101450.vue +0 -677
  28. package/.history/src/base-client/components/common/HIS/HTab/HTab_20260625173703.vue +0 -767
  29. package/.history/src/base-client/components/common/HIS/HTab/HTab_20260626112425.vue +0 -803
  30. package/.history/src/base-client/components/common/XAddNativeForm/XAddNativeForm_20260626173854.vue +0 -1522
  31. package/.history/src/base-client/components/common/XCollapse/XCollapse_20260703180349.vue +0 -862
  32. package/.history/src/base-client/components/common/XCollapse/XCollapse_20260703180623.vue +0 -862
  33. package/.history/src/base-client/components/common/XCollapse/XCollapse_20260703180702.vue +0 -842
  34. package/.history/src/base-client/components/common/XForm/XFormItem_20260703101840.vue +0 -1621
  35. package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140403.vue +0 -643
  36. package/.history/src/base-client/components/common/XMarkdownViewer/XMarkdownViewer_20260519140829.vue +0 -628
  37. package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519142824.vue +0 -104
  38. package/.history/src/base-client/components/common/XMarkdownViewer/demo_20260519143155.vue +0 -102
  39. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20260703180412.vue +0 -1102
  40. package/.history/src/base-client/components/common/XReportGrid/XReportTrGroup_20260703180623.vue +0 -1093
  41. package/.history/src/base-client/components/common/XReportGrid/XReport_20260309171231.vue +0 -1241
  42. package/.history/src/base-client/components/common/XReportGrid/XReport_20260309171441.vue +0 -1223
  43. package/.history/src/base-client/components/his/HAi/HAi_20260612174826.vue +0 -472
  44. package/.history/src/base-client/components/his/HAi/HAi_20260612175839.vue +0 -538
  45. package/.history/src/base-client/components/his/HAi/HAi_20260615103331.vue +0 -650
  46. package/.history/src/base-client/components/his/HAi/HAi_20260618140214.vue +0 -1396
  47. package/.history/src/base-client/components/his/HAi/HAi_20260618140556.vue +0 -1396
  48. package/.history/src/base-client/components/his/XHDescriptions/XHDescriptions_20260424134504.vue +0 -1469
  49. package/.history/src/base-client/components/his/XRadio/XRadio_20260702140351.vue +0 -774
  50. package/.history/src/base-client/components/his/XRadio/XRadio_20260702140441.vue +0 -774
  51. package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171133.vue +0 -788
  52. package/.history/src/base-client/components/his/XSidebar/XSidebar_20260610171151.vue +0 -780
  53. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511170841.vue +0 -585
  54. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260511171138.vue +0 -787
  55. package/.history/src/base-client/components/his/XTransfer/XTransfer_20260512141830.vue +0 -739
  56. package/.history/src/components/STable/index_20260409155138.js +0 -806
  57. package/.history/src/components/STable/index_20260409155218.js +0 -814
  58. package/.history/src/expression/core/Expression_20260305164427.js +0 -1371
  59. package/.history/src/expression/core/Expression_20260305170258.js +0 -1358
  60. package/.history/src/expression/core/Program_20260305111830.js +0 -944
  61. package/.history/src/expression/core/Program_20260305112041.js +0 -931
  62. package/.history/src/logic/LogicRunner_20260304154306.js +0 -170
  63. package/.history/src/logic/LogicRunner_20260304155553.js +0 -112
  64. package/.history/src/logic/LogicRunner_20260305105834.js +0 -112
  65. package/.history/src/logic/LogicRunner_20260305112718.js +0 -129
  66. package/.history/src/logic/LogicRunner_20260305182436.js +0 -133
  67. package/.history/src/logic/LogicRunner_20260306151301.js +0 -213
  68. package/.history/src/logic/LogicRunner_20260306152419.js +0 -213
  69. package/.history/src/logic/plugins/common/DateTools_20260305154159.js +0 -61
  70. package/.history/src/logic/plugins/common/DateTools_20260305154217.js +0 -44
  71. package/.history/src/logic/plugins/common/DateTools_20260305161014.js +0 -44
  72. package/.history/src/logic/plugins/common/HttpTools_20260305164352.js +0 -80
  73. package/.history/src/logic/plugins/common/HttpTools_20260305170258.js +0 -75
  74. package/.history/src/logic/plugins/common/HttpTools_20260305171634.js +0 -75
  75. package/.history/src/logic/plugins/common/HttpTools_20260306152419.js +0 -72
  76. package/.history/src/services/api/restTools_20260427142149.js +0 -245
  77. package/.history/src/services/api/restTools_20260427142853.js +0 -230
  78. package/.history/src/services/api/restTools_20260519135558.js +0 -230
  79. package/.history/src/services/api/restTools_20260519140825.js +0 -230
  80. package/.history/src/services/api/restTools_20260519151223.js +0 -230
  81. package/.history/src/theme/global_20260703101634.less +0 -370
  82. package/.history/src/theme/global_20260703101840.less +0 -337
  83. package/.history/src/theme/global_20260703104511.less +0 -337
  84. package/.history/src/utils/indexedDB_20260306150918.js +0 -593
  85. package/.history/src/utils/indexedDB_20260306151301.js +0 -586
  86. package/.idea/codeStyles/Project.xml +0 -62
  87. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  88. package/.idea/misc.xml +0 -6
  89. 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 +0 -153
  90. package/preview-input-box.html +0 -180
@@ -1,775 +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
- '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>
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>