vue2-client 1.16.63 → 1.16.65

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.16.63",
3
+ "version": "1.16.65",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -109,4 +109,4 @@
109
109
  "not dead",
110
110
  "not ie 11"
111
111
  ]
112
- }
112
+ }
@@ -330,14 +330,14 @@ export default {
330
330
  })
331
331
  this.$forceUpdate()
332
332
  }
333
- // 默认展开当前页的所有面板
334
- this.activeKey = (this.config.showData || []).map((_, i) => i.toString())
335
- // 初始化关闭所有折叠面板
333
+ // 根据配置决定是否展开面板
336
334
  const shouldCollapseAll = this.config.collapseAllByDefault || false
337
335
  if (shouldCollapseAll) {
338
- setTimeout(() => {
339
- this.activeKey = [] // 关闭所有面板
340
- }, 0.00001)
336
+ // 如果配置为默认关闭,直接设置为空数组,避免展开动画
337
+ this.activeKey = []
338
+ } else {
339
+ // 默认展开当前页的所有面板
340
+ this.activeKey = (this.config.showData || []).map((_, i) => i.toString())
341
341
  }
342
342
  })
343
343
  })
@@ -429,11 +429,10 @@ export default {
429
429
  :deep(.ant-collapse-header) {
430
430
  display: flex;
431
431
  position: relative;
432
- border-bottom: v-bind('config.showLine ? "1px solid #000000" : "none"');
432
+ // border-bottom: v-bind('config.showLine ? "1px solid #000000" : "none"');
433
433
  align-items: center !important;
434
434
  background-color: #ffffff;
435
435
  padding: 12px 16px !important; /* 确保头部有足够的内边距 */
436
- min-height: 50px; /* 设置头部最小高度 */
437
436
  }
438
437
 
439
438
  :deep(.ant-collapse-header-text) {
@@ -466,7 +465,9 @@ export default {
466
465
  height: 12px;
467
466
  border-radius: 6px;
468
467
  background: #3362DA;
469
- margin: 6px;
468
+ margin-top: 15px;
469
+ margin-left: 11px;
470
+ margin-bottom: 12px;
470
471
  flex-shrink: 0;
471
472
  }
472
473
 
@@ -620,9 +621,14 @@ export default {
620
621
 
621
622
  /* 当前页码样式 */
622
623
  :deep(.ant-pagination .ant-pagination-item-active) {
623
- background: #FFFFFF;
624
+ background: #0057FE !important;
624
625
  border: 1px solid #1890ff;
625
- color: #1890ff;
626
+ color: #FFFFFF !important;
627
+ }
628
+
629
+ /* 确保选中页码文字颜色生效 */
630
+ :deep(.ant-pagination .ant-pagination-item-active a) {
631
+ color: #FFFFFF !important;
626
632
  }
627
633
 
628
634
  /* 禁用状态样式 */
@@ -642,14 +648,15 @@ export default {
642
648
  &.xcollapse-style1 {
643
649
  height: auto; /* 允许根据内容自适应高度,避免滚动被限制 */
644
650
  min-height: 600px;
645
- .blue-circle-icon { margin: 0 !important; }
646
651
  .header-text {
647
652
  font-family: "Source Han Sans";
648
653
  font-size: 16px;
649
654
  font-weight: 700;
650
- line-height: normal;
655
+ line-height: 23px;
651
656
  letter-spacing: 0em;
652
657
  color: #313131;
658
+ margin-top: 8px;
659
+ margin-bottom: 8px;
653
660
  margin-right: 0 !important;
654
661
  }
655
662
 
@@ -657,9 +664,11 @@ export default {
657
664
  font-family: "Source Han Sans";
658
665
  font-size: 16px;
659
666
  font-weight: 700;
660
- line-height: normal;
667
+ line-height: 23px;
661
668
  text-align: right;
662
669
  color: #313131;
670
+ margin-top: 9px;
671
+ margin-bottom: 7px;
663
672
  margin-left: 28.14px;
664
673
  letter-spacing: 0em
665
674
  }
@@ -668,8 +677,10 @@ export default {
668
677
  font-family: "Source Han Sans";
669
678
  font-size: 16px;
670
679
  font-weight: 400;
671
- line-height: normal;
680
+ line-height: 23px;
672
681
  text-align: right;
682
+ margin-top: 9px;
683
+ margin-bottom: 7px;
673
684
  color: #313131;
674
685
  letter-spacing: 0em;
675
686
  }
@@ -684,7 +695,7 @@ export default {
684
695
  width: 564px;
685
696
  min-height: auto;
686
697
  height: auto;
687
- margin: 3px 10px 26px 12px; // 面板之间留白
698
+ margin-bottom:10px;
688
699
  background: #FFFFFF; // 独立白底
689
700
  box-sizing: border-box;
690
701
  border: 1px solid #E5E9F0; // 每个面板自身边框
@@ -693,15 +704,18 @@ export default {
693
704
  :deep(.ant-collapse > .ant-collapse-item:first-child) { margin-top: 0; }
694
705
  :deep(.ant-collapse > .ant-collapse-item:last-child) { margin-bottom: 0; }
695
706
 
696
- :deep(.ant-collapse-content > .ant-collapse-content-box) { background: #FFFFFF; }
707
+ :deep(.ant-collapse-content > .ant-collapse-content-box) {
708
+ background: #FFFFFF;
709
+ padding: 0px !important; /* 自定义边距:上9px 右12px 下10px 左11px */
710
+ }
697
711
 
698
712
  // 表头:恢复合适的上下内边距,去掉顶部额外空白
699
713
  :deep(.ant-collapse-header) {
700
714
  background: #FFFFFF;
701
- padding: 0px 0px;
702
- align-items: center;
703
- height: 39px;
715
+ padding: 0px 0px !important;
716
+ height: 41px !important;
704
717
  border-bottom: none !important; // 移除标题处下边线,避免与外边框连为一体
718
+ border: 1px solid #E5E9F0; // 每个面板自身边框
705
719
  }
706
720
  }
707
721
  }
@@ -93,7 +93,7 @@
93
93
  <a-select
94
94
  v-if="!attr.lazyLoad || attr.lazyLoad === 'false'"
95
95
  v-model="form[attr.model]"
96
- :disabled="disabled"
96
+ :disabled="disabled || readOnly"
97
97
  @change="handleSelectChange"
98
98
  :filter-option="filterOption"
99
99
  :getPopupContainer="getPopupContainer"
@@ -166,7 +166,7 @@
166
166
  <a-select
167
167
  v-else
168
168
  v-model="form[attr.model]"
169
- :disabled="disabled"
169
+ :disabled="disabled || readOnly"
170
170
  @change="handleSelectChange"
171
171
  :filter-option="filterOption"
172
172
  :getPopupContainer="getPopupContainer"
@@ -193,6 +193,7 @@
193
193
  </a-select>
194
194
  </a-form-model-item>
195
195
  <a-form-model-item
196
+ :disabled="disabled || readOnly"
196
197
  v-bind="bindOther"
197
198
  :rules="rules"
198
199
  v-else-if="attr.showMode === 'radioGroup'"
@@ -13,7 +13,7 @@
13
13
  </div>
14
14
 
15
15
  <!-- 当有 layout 配置时使用 a-descriptions -->
16
- <template v-if="config && config.layout">
16
+ <template v-if="config && config.layout && !wrapperClassObject['xhdesc-medical-history']">
17
17
  <a-descriptions
18
18
  :column="config.layout"
19
19
  :size="(config && config.style && config.style.size)"
@@ -37,7 +37,24 @@
37
37
  <span class="label-text">{{ item.label }}</span>
38
38
  </div>
39
39
  </template>
40
- <div class="content-wrapper">
40
+ <a-tooltip
41
+ v-if="isContentOverflow(data[item.field])"
42
+ :title="data[item.field]"
43
+ placement="topLeft"
44
+ :overlay-style="{ maxWidth: '400px' }"
45
+ >
46
+ <div
47
+ class="content-wrapper ellipsis"
48
+ :data-full-text="data[item.field]"
49
+ >
50
+ {{ data[item.field] }}
51
+ </div>
52
+ </a-tooltip>
53
+ <div
54
+ v-else
55
+ class="content-wrapper"
56
+ :data-full-text="data[item.field]"
57
+ >
41
58
  {{ data[item.field] }}
42
59
  </div>
43
60
  </a-descriptions-item>
@@ -59,7 +76,11 @@
59
76
  <span class="label-text">{{ item.label }}</span>
60
77
  </div>
61
78
  </template>
62
- <div class="content-wrapper">
79
+ <div
80
+ class="content-wrapper"
81
+ :class="{ 'ellipsis': isContentOverflow(data[item.field]) }"
82
+ :data-full-text="data[item.field]"
83
+ >
63
84
  {{ data[item.field] }}
64
85
  </div>
65
86
  </a-descriptions-item>
@@ -68,6 +89,67 @@
68
89
  </a-descriptions>
69
90
  </template>
70
91
 
92
+ <!-- 医疗病史模式:使用自定义HTML结构实现文本环绕 -->
93
+ <template v-else-if="config && config.layout && wrapperClassObject['xhdesc-medical-history']">
94
+ <div class="medical-history-descriptions">
95
+ <template v-if="data">
96
+ <!-- 显示前N个标签 -->
97
+ <div
98
+ v-for="(item) in visibleItemsFiltered"
99
+ :key="item.field"
100
+ :class="['medical-history-item', { 'with-divider': item.isLine }]"
101
+ >
102
+ <div class="medical-history-content">
103
+ <a-tooltip
104
+ v-if="isContentOverflow(data[item.field])"
105
+ :title="data[item.field]"
106
+ placement="topLeft"
107
+ :overlay-style="{ maxWidth: '400px' }"
108
+ >
109
+ <div class="medical-history-text ellipsis">
110
+ <span class="medical-history-label">{{ item.label }}:</span>{{ data[item.field] }}
111
+ </div>
112
+ </a-tooltip>
113
+ <div
114
+ v-else
115
+ class="medical-history-text"
116
+ >
117
+ <span class="medical-history-label">{{ item.label }}:</span>{{ data[item.field] }}
118
+ </div>
119
+ </div>
120
+ </div>
121
+
122
+ <!-- 展开后显示剩余标签 -->
123
+ <template v-if="showAllItems">
124
+ <div
125
+ v-for="item in hiddenItemsFiltered"
126
+ :key="item.field"
127
+ class="medical-history-item"
128
+ >
129
+ <div class="medical-history-content">
130
+ <a-tooltip
131
+ v-if="isContentOverflow(data[item.field])"
132
+ :title="data[item.field]"
133
+ placement="topLeft"
134
+ :overlay-style="{ maxWidth: '400px' }"
135
+ >
136
+ <div class="medical-history-text ellipsis">
137
+ <span class="medical-history-label">{{ item.label }}:</span>{{ data[item.field] }}
138
+ </div>
139
+ </a-tooltip>
140
+ <div
141
+ v-else
142
+ class="medical-history-text"
143
+ >
144
+ <span class="medical-history-label">{{ item.label }}:</span>{{ data[item.field] }}
145
+ </div>
146
+ </div>
147
+ </div>
148
+ </template>
149
+ </template>
150
+ </div>
151
+ </template>
152
+
71
153
  <!-- 当没有 layout 配置时使用自适应布局 -->
72
154
  <template v-else>
73
155
  <div class="flex-descriptions">
@@ -87,7 +169,24 @@
87
169
  />
88
170
  <span class="label-text">{{ item.label }}:</span>
89
171
  </div>
90
- <div class="content-wrapper">
172
+ <a-tooltip
173
+ v-if="isContentOverflow(data[item.field])"
174
+ :title="data[item.field]"
175
+ placement="topLeft"
176
+ :overlay-style="{ maxWidth: '400px' }"
177
+ >
178
+ <div
179
+ class="content-wrapper ellipsis"
180
+ :data-full-text="data[item.field]"
181
+ >
182
+ {{ data[item.field] }}
183
+ </div>
184
+ </a-tooltip>
185
+ <div
186
+ v-else
187
+ class="content-wrapper"
188
+ :data-full-text="data[item.field]"
189
+ >
91
190
  {{ data[item.field] }}
92
191
  </div>
93
192
  </div>
@@ -108,7 +207,11 @@
108
207
  />
109
208
  <span class="label-text">{{ item.label }}:</span>
110
209
  </div>
111
- <div class="content-wrapper">
210
+ <div
211
+ class="content-wrapper"
212
+ :class="{ 'ellipsis': isContentOverflow(data[item.field]) }"
213
+ :data-full-text="data[item.field]"
214
+ >
112
215
  {{ data[item.field] }}
113
216
  </div>
114
217
  </div>
@@ -120,25 +223,79 @@
120
223
  <!-- 可选:底部区域(分割线 + 三列内容) -->
121
224
  <div v-if="config && config.footer && Array.isArray(config.footer.items) && data" class="xhdesc-footer">
122
225
  <div class="xhdesc-divider" />
123
- <div class="footer-grid">
226
+ <!-- 医疗病史模式下的footer结构 -->
227
+ <div v-if="wrapperClassObject['xhdesc-medical-history']" class="medical-history-footer">
228
+ <div
229
+ v-for="(item, idx) in config.footer.items"
230
+ :key="item.field || idx"
231
+ class="medical-history-item">
232
+ <div class="medical-history-content">
233
+ <a-tooltip
234
+ v-if="isContentOverflow(data[item.field])"
235
+ :title="data[item.field]"
236
+ placement="topLeft"
237
+ :overlay-style="{ maxWidth: '400px' }"
238
+ >
239
+ <div class="medical-history-text ellipsis">
240
+ <span class="medical-history-label">{{ item.label }}:</span>{{ data[item.field] }}
241
+ </div>
242
+ </a-tooltip>
243
+ <div
244
+ v-else
245
+ class="medical-history-text"
246
+ >
247
+ <span class="medical-history-label">{{ item.label }}:</span>{{ data[item.field] }}
248
+ </div>
249
+ </div>
250
+ </div>
251
+ <!-- 右侧信息:换到下一行并靠右对齐(如 医生 / 医嘱日期) -->
252
+ <div
253
+ v-if="Array.isArray(config.footer.rightItems) && config.footer.rightItems.length"
254
+ class="footer-right">
255
+ <div
256
+ v-for="(item, ridx) in config.footer.rightItems"
257
+ :key="item.field || ridx"
258
+ class="footer-right-item">
259
+ <div class="label-wrapper"><span class="label-text">{{ item.label }}:</span></div>
260
+ <div
261
+ class="content-wrapper"
262
+ :class="{ 'ellipsis': isContentOverflow(data[item.field]) }"
263
+ :data-full-text="data[item.field]"
264
+ >{{ data[item.field] }}
265
+ </div>
266
+ </div>
267
+ </div>
268
+ </div>
269
+ <!-- 非医疗病史模式下的footer结构 -->
270
+ <div v-else class="footer-grid">
124
271
  <div
125
272
  v-for="(item, idx) in config.footer.items"
126
273
  :key="item.field || idx"
127
274
  class="description-item">
128
275
  <div class="label-wrapper"><span class="label-text">{{ item.label }}:</span></div>
129
- <div class="content-wrapper">{{ data[item.field] }}</div>
276
+ <div
277
+ class="content-wrapper"
278
+ :class="{ 'ellipsis': isContentOverflow(data[item.field]) }"
279
+ :data-full-text="data[item.field]"
280
+ >{{ data[item.field] }}
281
+ </div>
130
282
  </div>
131
283
  </div>
132
284
  <!-- 右侧信息:换到下一行并靠右对齐(如 医生 / 医嘱日期) -->
133
285
  <div
134
- v-if="Array.isArray(config.footer.rightItems) && config.footer.rightItems.length"
286
+ v-if="!wrapperClassObject['xhdesc-medical-history'] && Array.isArray(config.footer.rightItems) && config.footer.rightItems.length"
135
287
  class="footer-right">
136
288
  <div
137
289
  v-for="(item, ridx) in config.footer.rightItems"
138
290
  :key="item.field || ridx"
139
291
  class="footer-right-item">
140
292
  <div class="label-wrapper"><span class="label-text">{{ item.label }}:</span></div>
141
- <div class="content-wrapper">{{ data[item.field] }}</div>
293
+ <div
294
+ class="content-wrapper"
295
+ :class="{ 'ellipsis': isContentOverflow(data[item.field]) }"
296
+ :data-full-text="data[item.field]"
297
+ >{{ data[item.field] }}
298
+ </div>
142
299
  </div>
143
300
  </div>
144
301
  </div>
@@ -265,6 +422,11 @@ export default {
265
422
  },
266
423
  toggleDetails () {
267
424
  this.showAllItems = !this.showAllItems
425
+ },
426
+ // 判断内容是否超过三行
427
+ isContentOverflow (content) {
428
+ if (!content || typeof content !== 'string') return false
429
+ return content.length > 150
268
430
  }
269
431
  },
270
432
  watch: {
@@ -333,10 +495,6 @@ export default {
333
495
  white-space: nowrap;
334
496
  }
335
497
 
336
- .label-wrapper.with-avatar {
337
- gap: 8px;
338
- }
339
-
340
498
  .label-text {
341
499
  white-space: nowrap;
342
500
  color: #313131; // 统一深灰
@@ -357,8 +515,7 @@ export default {
357
515
  }
358
516
 
359
517
  /* 强制移除任何链接样式(如接口返回含 <a>) */
360
- ::v-deep a,
361
- ::deep a {
518
+ ::v-deep a {
362
519
  color: #313131 !important;
363
520
  text-decoration: none !important;
364
521
  }
@@ -379,10 +536,17 @@ export default {
379
536
  }
380
537
 
381
538
  .xhdesc-divider {
382
- width: 100%;
539
+ width: calc(100% + 24px); /* 扩展到左右内边距之外 */
383
540
  height: 0;
384
- border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
385
- margin: 8px 0 12px;
541
+ border-bottom: 1px solid #E5E9F0;
542
+ margin: 10px -12px 14px; /* 抵消左右 12px 内边距 */
543
+ overflow: hidden;
544
+ }
545
+ /* medical-history 模式:左 padding 11px,右 12px(由外层设置),做精确抵消 */
546
+ .patient-info-descriptions.xhdesc-medical-history .xhdesc-divider {
547
+ width: calc(100% + 23px);
548
+ margin-left: -11px;
549
+ margin-right: -12px;
386
550
  }
387
551
 
388
552
  .footer-grid {
@@ -408,13 +572,13 @@ export default {
408
572
  }
409
573
 
410
574
  /* Ant Design 描述列表样式覆盖 */
411
- :deep(.ant-descriptions-row) {
575
+ ::v-deep(.ant-descriptions-row) {
412
576
  display: flex;
413
577
  flex-direction: row;
414
578
  align-items: flex-start;
415
579
  }
416
580
 
417
- :deep(.ant-descriptions-item) {
581
+ ::v-deep(.ant-descriptions-item) {
418
582
  padding: 0 !important;
419
583
  display: flex !important;
420
584
  align-items: flex-start !important;
@@ -424,7 +588,7 @@ export default {
424
588
  margin-bottom: 16px;
425
589
  }
426
590
 
427
- :deep(.ant-descriptions-item-container) {
591
+ ::v-deep(.ant-descriptions-item-container) {
428
592
  display: flex !important;
429
593
  flex-direction: row !important;
430
594
  align-items: flex-start !important;
@@ -433,7 +597,7 @@ export default {
433
597
  width: 100% !important;
434
598
  }
435
599
 
436
- :deep(.ant-descriptions-item-label) {
600
+ ::v-deep(.ant-descriptions-item-label) {
437
601
  color: rgba(0, 0, 0, 0.65);
438
602
  padding: 0 !important;
439
603
  margin: 0 !important;
@@ -446,7 +610,7 @@ export default {
446
610
  padding-right: 2px !important;
447
611
  }
448
612
 
449
- :deep(.ant-descriptions-item-content) {
613
+ ::v-deep(.ant-descriptions-item-content) {
450
614
  font-size: v-bind('(config && config.style && config.style.fontSize) || "14px"');
451
615
  display: inline-flex !important;
452
616
  align-items: center !important;
@@ -455,7 +619,7 @@ export default {
455
619
  margin-left: 0px !important;
456
620
  }
457
621
 
458
- :deep(.ant-descriptions-item-colon) {
622
+ ::v-deep(.ant-descriptions-item-colon) {
459
623
  position: static !important;
460
624
  display: inline-flex !important;
461
625
  align-items: center !important;
@@ -464,18 +628,18 @@ export default {
464
628
  margin-right: 2px !important;
465
629
  }
466
630
 
467
- :deep(.ant-descriptions-item-container:hover) {
631
+ ::v-deep(.ant-descriptions-item-container:hover) {
468
632
  background-color: rgba(0, 0, 0, 0.02);
469
633
  border-radius: 4px;
470
634
  }
471
635
 
472
- :deep(.ant-btn-link) {
636
+ ::v-deep(.ant-btn-link) {
473
637
  padding: 0;
474
638
  height: auto;
475
639
  line-height: 1;
476
640
  }
477
641
 
478
- :deep(.ant-btn-link:hover) {
642
+ ::v-deep(.ant-btn-link:hover) {
479
643
  color: #1890ff;
480
644
  background: transparent;
481
645
  }
@@ -513,12 +677,12 @@ export default {
513
677
  }
514
678
 
515
679
  /* 对于 Ant Design 描述列表的特殊处理 */
516
- :deep(.ant-descriptions-item.with-divider) {
680
+ ::v-deep(.ant-descriptions-item.with-divider) {
517
681
  position: relative;
518
682
  margin-bottom: 16px !important;
519
683
  }
520
684
 
521
- :deep(.ant-descriptions-item.with-divider::after) {
685
+ ::v-deep(.ant-descriptions-item.with-divider::after) {
522
686
  content: '';
523
687
  position: absolute;
524
688
  left: 0;
@@ -540,12 +704,12 @@ export default {
540
704
  padding: 6.5px 12px;
541
705
 
542
706
  /* *ant-btn-link */
543
- :deep(.ant-btn-link) {
707
+ ::v-deep .ant-btn-link {
544
708
  border: none;
545
709
  }
546
710
 
547
711
  /* *ant-descriptions-item-content */
548
- :deep(.ant-descriptions-item-content) {
712
+ ::v-deep .ant-descriptions-item-content {
549
713
  font-weight: bold;
550
714
  }
551
715
  }
@@ -554,179 +718,202 @@ export default {
554
718
  .xhdesc-margin-top-12 {
555
719
  margin-top: -12px;
556
720
  }
557
- .xhdesc-no-padding {
558
- padding: 0px;
559
- }
560
721
  .xhdesc-no-padding {
561
722
  padding: 0px;
562
723
  &.patient-info-descriptions,
563
724
  .patient-info-descriptions {
564
725
  /* *ant-descriptions-item-content */
565
- :deep(.descriptions-container) {
726
+ ::v-deep .descriptions-container {
566
727
  padding: 0px;
567
728
  }
568
- :deep(.content-wrapper) {
729
+ ::v-deep .content-wrapper {
569
730
  margin: 0px;
570
731
  }
571
732
  }
572
733
  }
734
+ /* 医疗病史模式:自定义HTML结构样式 */
735
+ .medical-history-descriptions {
736
+ width: 100%;
737
+ }
738
+
739
+ .medical-history-item {
740
+ margin: 0;
741
+ width: 100%;
742
+ }
743
+
744
+ .medical-history-item.with-divider {
745
+ position: relative;
746
+ padding-bottom: 4px; /* 分割线与上方间距 4px */
747
+ margin-bottom: 4px; /* 分割线与下方间距 4px */
748
+ }
749
+
750
+ .medical-history-item.with-divider::after {
751
+ content: '';
752
+ position: absolute;
753
+ left: 0;
754
+ bottom: 0; /* 贴合容器底部 */
755
+ width: 100%;
756
+ height: 0;
757
+ border-bottom: 1px solid rgba(0, 0, 0, 0.15);
758
+ }
759
+
760
+ .medical-history-content {
761
+ font-family: "Source Han Sans";
762
+ font-size: 18px;
763
+ line-height: 24px;
764
+ letter-spacing: 0em;
765
+ text-align: left;
766
+ word-break: break-word;
767
+ white-space: normal;
768
+ text-indent: 0;
769
+ padding-left: 0;
770
+ margin-left: 0;
771
+ /* 使用float实现真正的文本环绕 */
772
+ overflow: hidden;
773
+ /* 确保容器能够正确清除浮动 */
774
+ position: relative;
775
+ }
776
+
777
+ .medical-history-label {
778
+ font-family: "Source Han Sans";
779
+ font-size: 16px;
780
+ font-weight: 700;
781
+ color: #313131;
782
+ white-space: nowrap;
783
+ float: left;
784
+ margin-right: 0px;
785
+ /* 确保标签不会影响文本流 */
786
+ position: relative;
787
+ z-index: 1;
788
+ }
789
+
790
+ .medical-history-text {
791
+ font-family: "Source Han Sans";
792
+ font-size: 16px;
793
+ font-weight: 400;
794
+ color: #313131;
795
+ display: block;
796
+ overflow: hidden;
797
+ text-indent: 0;
798
+ padding-left: 0;
799
+ margin-left: 0;
800
+ word-break: break-word;
801
+ white-space: normal;
802
+ text-align: left;
803
+ line-height: 24px;
804
+ /* 确保文本能够正确环绕浮动元素 */
805
+ margin-top: 0;
806
+ margin-bottom: 0;
807
+ }
808
+
809
+ .medical-history-text.ellipsis {
810
+ display: -webkit-box;
811
+ -webkit-box-orient: vertical;
812
+ -webkit-line-clamp: 3;
813
+ line-clamp: 3;
814
+ overflow: hidden;
815
+ cursor: pointer;
816
+ position: relative;
817
+ word-break: break-word;
818
+ white-space: normal;
819
+ line-height: 24px;
820
+ text-indent: 0;
821
+ padding-left: 0;
822
+ margin-left: 0;
823
+ text-align: left;
824
+ -webkit-box-pack: start;
825
+ -webkit-box-align: start;
826
+ }
827
+
828
+ /* 使用-webkit-line-clamp时不需要手动添加省略号 */
829
+ .medical-history-text.ellipsis::after {
830
+ display: none;
831
+ }
832
+
833
+ /* 针对多行文本的特殊处理:确保换行文本与首行对齐 */
834
+ .medical-history-text.ellipsis::first-line {
835
+ text-indent: 0;
836
+ }
837
+
838
+ /* 为不支持-webkit-line-clamp的浏览器提供后备方案 */
839
+ @supports not (-webkit-line-clamp: 3) {
840
+ .medical-history-text.ellipsis {
841
+ display: block;
842
+ max-height: 72px; /* 3行 * 24px行高 */
843
+ overflow: hidden;
844
+ position: relative;
845
+ }
846
+
847
+ .medical-history-text.ellipsis::after {
848
+ content: '...';
849
+ position: absolute;
850
+ right: 0;
851
+ bottom: 0;
852
+ background: #fff;
853
+ padding-left: 4px;
854
+ display: block;
855
+ }
856
+ }
857
+
573
858
  /* 医疗病史样式开关:通过 wrapperClassObject 添加类 xhdesc-medical-history */
574
859
  .patient-info-descriptions.xhdesc-medical-history {
860
+ padding: 9px 12px 10px 11px !important;
575
861
  /* 移除右侧空白(本模式不需要详情按钮预留空间) */
576
862
  .descriptions-container {
577
863
  padding-right: 0;
578
- padding-left: 12px;
864
+ padding-left: 0px;
579
865
  }
580
-
581
- /* 保持原有的自适应布局样式 */
582
- .flex-descriptions {
583
- gap: 4px 16px;
584
- }
585
-
586
- .description-item {
587
- padding: 2px 4px;
866
+ /* 医疗病史模式下:footer 区域使用与上方相同的医疗病史样式 */
867
+ .medical-history-footer {
588
868
  width: 100%;
589
- align-items: flex-start;
869
+ }
870
+ .medical-history-footer .footer-right {
871
+ margin-top: 8px;
590
872
  display: flex;
591
- flex-direction: column;
873
+ justify-content: flex-end;
874
+ align-items: flex-start;
875
+ gap: 16px;
876
+ width: 100%;
592
877
  }
593
-
594
- /* 只修改布局,保持原有字体样式 */
595
- .label-wrapper {
878
+ /* 右侧(医生/医嘱日期)标签与值的字体要求 */
879
+ .medical-history-footer .footer-right .label-wrapper .label-text {
596
880
  font-family: "Source Han Sans";
597
- font-size: 18px;
598
- font-weight: 600;
599
- line-height: 24px;
600
- text-align: justify;
601
- letter-spacing: 0em;
602
- white-space: nowrap;
603
- margin-right: 8px;
604
- margin-bottom: 0;
605
- display: inline;
881
+ font-size: 16px;
882
+ font-weight: 700;
883
+ color: #313131;
884
+ line-height: 22px;
606
885
  }
607
-
608
- .content-wrapper {
886
+ .medical-history-footer .footer-right .content-wrapper {
609
887
  font-family: "Source Han Sans";
610
- font-size: 18px;
888
+ font-size: 16px;
611
889
  font-weight: 400;
612
- line-height: 24px;
613
- letter-spacing: 0em;
614
- margin-left: 0;
615
- max-width: none;
616
- overflow: visible;
617
- text-overflow: initial;
618
- white-space: normal;
619
- word-break: break-word;
620
- display: inline;
621
- }
622
-
623
- /* 修复Ant Design描述列表的布局,保持字体样式 */
624
- :deep(.ant-descriptions-item) {
625
- display: block !important;
626
- white-space: nowrap;
627
- width: 100% !important;
628
- margin-bottom: 8px;
629
- margin-right: 0;
630
- }
631
-
632
- :deep(.ant-descriptions-item-container) {
633
- display: inline !important;
634
- white-space: nowrap;
635
- width: auto !important;
636
- align-items: start !important;
637
- }
638
-
639
- :deep(.ant-descriptions-item-label) {
640
- display: inline !important;
641
- white-space: nowrap !important;
642
- min-width: auto !important;
643
- padding-right: 1px !important;
644
- /* 保持原有字体样式 */
645
- font-family: "Source Han Sans" !important;
646
- font-size: 18px !important;
647
- font-weight: 600 !important;
648
- line-height: 24px !important;
649
- text-align: justify !important;
650
- letter-spacing: 0em !important;
651
- }
652
-
653
- :deep(.ant-descriptions-item-content) {
654
- display: inline !important;
655
- white-space: normal !important;
656
- word-break: break-word !important;
657
- margin-left: 0 !important;
658
- overflow: visible !important;
659
- /* 保持原有字体样式 */
660
- font-family: "Source Han Sans" !important;
661
- font-size: 18px !important;
662
- font-weight: 400 !important;
663
- line-height: 24px !important;
664
- letter-spacing: 0em !important;
665
- }
666
-
667
- :deep(.ant-descriptions-item-colon) {
668
- margin-right: 2px !important;
669
- display: inline !important;
670
- }
671
-
672
- /* 确保内部元素正确对齐 */
673
- :deep(.ant-descriptions-item-label .label-wrapper) {
674
- display: inline !important;
675
- white-space: nowrap !important;
676
- width: auto !important;
677
- gap: 0 !important;
678
- margin: 0 !important;
679
- padding: 0 !important;
680
- line-height: 24px !important;
890
+ line-height: 22px;
891
+ color: #313131;
681
892
  }
682
893
 
683
- :deep(.ant-descriptions-row) {
684
- display: block !important;
685
- white-space: nowrap;
686
- width: 100%;
894
+ .medical-history-footer .footer-right .medical-history-item {
895
+ display: inline-block;
896
+ text-align: right;
687
897
  }
688
898
 
689
- /* 移除所有可能冲突的布局属性 */
690
- :deep(.ant-descriptions-item),
691
- :deep(.ant-descriptions-item-container) {
692
- float: none !important;
693
- flex: none !important;
694
- flex-direction: row !important;
695
- align-items: flex-start !important;
899
+ .medical-history-footer .footer-right .medical-history-content {
900
+ text-align: right;
696
901
  }
697
902
 
698
- /* 确保表格布局正确 */
699
- :deep(.ant-descriptions-view) {
700
- white-space: nowrap;
701
- table-layout: auto !important;
903
+ .medical-history-footer .footer-right .medical-history-label {
904
+ float: none;
905
+ display: inline;
906
+ margin-right: 0px;
702
907
  }
703
908
 
704
- :deep(.ant-descriptions-table) {
705
- table-layout: auto !important;
909
+ .medical-history-footer .footer-right .medical-history-text {
910
+ display: inline;
911
+ text-align: right;
706
912
  }
707
913
 
708
- /* 医疗病史模式下:footer 区域恢复与上方描述项一致的横向样式 */
709
- .xhdesc-footer {
710
- .description-item {
711
- display: inline-flex;
712
- flex-direction: row;
713
- align-items: center;
714
- width: 100%;
715
- }
716
- .label-wrapper {
717
- display: inline-flex;
718
- margin-right: 4px;
719
- margin-bottom: 0;
720
- font-weight: 600; // 与上方保持一致
721
- }
722
- .content-wrapper {
723
- display: inline-flex;
724
- margin-left: 0;
725
- max-width: 300px;
726
- overflow: hidden;
727
- text-overflow: ellipsis;
728
- white-space: nowrap;
729
- }
914
+ .medical-history-footer .footer-right .medical-history-text.ellipsis {
915
+ display: inline;
916
+ text-align: right;
730
917
  }
731
918
  }
732
919
  </style>
@@ -104,6 +104,43 @@ export default {
104
104
  }
105
105
  },
106
106
  methods: {
107
+ // 通用的样式保护方法
108
+ protectElementStyles (element, stylesToProtect = ['padding', 'padding-left', 'padding-right', 'padding-top', 'padding-bottom', 'margin', 'background-color', 'color', 'font-size', 'border']) {
109
+ const protectedStyles = {}
110
+
111
+ // 保存需要保护的样式
112
+ stylesToProtect.forEach(style => {
113
+ const value = element.style.getPropertyValue(style)
114
+ if (value) {
115
+ protectedStyles[style] = value
116
+ }
117
+ })
118
+
119
+ return protectedStyles
120
+ },
121
+
122
+ // 恢复保护的样式
123
+ restoreElementStyles (element, protectedStyles) {
124
+ Object.entries(protectedStyles).forEach(([property, value]) => {
125
+ if (value) {
126
+ element.style.setProperty(property, value, 'important')
127
+ }
128
+ })
129
+ },
130
+
131
+ // 安全地设置布局样式,保护其他样式
132
+ safeSetLayoutStyles (element, layoutStyles) {
133
+ // 保护所有可能的样式配置
134
+ const protectedStyles = this.protectElementStyles(element)
135
+
136
+ // 设置布局样式
137
+ Object.entries(layoutStyles).forEach(([property, value]) => {
138
+ element.style.setProperty(property, value)
139
+ })
140
+
141
+ // 恢复保护的样式
142
+ this.restoreElementStyles(element, protectedStyles)
143
+ },
107
144
  toggleDrawer () {
108
145
  this.isOpen = !this.isOpen
109
146
  this.$emit('on-drawer-change', this.isOpen)
@@ -144,7 +181,7 @@ export default {
144
181
  })
145
182
  },
146
183
  // 获取同级的其他所有a-col元素
147
- getSiblingCols () {
184
+ getSiblingCols (className) {
148
185
  try {
149
186
  // 找到当前组件所在的a-col
150
187
  let currentCol = this.$el.parentNode
@@ -162,10 +199,8 @@ export default {
162
199
  return []
163
200
  }
164
201
 
165
- // 修改这里:只获取直接子元素中的.ant-col-12
166
- const allCols = Array.from(row.children).filter(child =>
167
- child.className.includes('ant-col-12')
168
- )
202
+ // 修改这里 如果没有指定className 则获取全部
203
+ const allCols = Array.from(row.children).filter(child => !className || child.className.includes(className))
169
204
 
170
205
  // 过滤掉当前a-col,返回其他所有a-col
171
206
  return allCols.filter(col => col !== currentCol)
@@ -174,10 +209,48 @@ export default {
174
209
  return []
175
210
  }
176
211
  },
212
+
213
+ computeRemainingWidth (allElements, mainCol, currentCol) {
214
+ if (!allElements || allElements.length === 0) {
215
+ return '0px'
216
+ }
217
+
218
+ // 排除 mainCol 和 currentCol
219
+ const filteredElements = allElements.filter(element =>
220
+ element !== mainCol && element !== currentCol
221
+ )
222
+
223
+ if (filteredElements.length === 0) {
224
+ return '0px'
225
+ }
226
+
227
+ let totalWidth = 0
228
+
229
+ filteredElements.forEach(element => {
230
+ if (element && element.style) {
231
+ // 获取元素的计算样式
232
+ const computedStyle = window.getComputedStyle(element)
233
+
234
+ // 获取宽度(包括padding和border)
235
+ const width = parseFloat(computedStyle.width) || 0
236
+
237
+ // 获取左右margin
238
+ const marginLeft = parseFloat(computedStyle.marginLeft) || 0
239
+ const marginRight = parseFloat(computedStyle.marginRight) || 0
240
+
241
+ // 累加总宽度(宽度 + 左右margin)
242
+ totalWidth += width + marginLeft + marginRight
243
+ }
244
+ })
245
+
246
+ // 返回计算出的宽度,如果计算失败则返回默认值
247
+ return totalWidth > 0 ? `${totalWidth}px` : '0px'
248
+ },
249
+
177
250
  updateLayout (isOpen) {
178
251
  this.$nextTick(() => {
179
252
  try {
180
- const otherCols = this.getSiblingCols()
253
+ const otherCols = this.getSiblingCols('ant-col-12')
181
254
  if (otherCols.length > 0) {
182
255
  let currentCol = this.$el.parentNode
183
256
  while (currentCol && !currentCol.className.includes('ant-col')) {
@@ -197,28 +270,42 @@ export default {
197
270
  if (isOpen) {
198
271
  if (this.affectLayout) {
199
272
  if (this.widthMode === 'px') {
200
- const drawerWidth = this.expandedWidth || 584
201
- // 使用 style 对象逐个设置属性,保留其他样式
202
- currentCol.style.flex = `0 0 ${drawerWidth}px`
203
- currentCol.style.maxWidth = `${drawerWidth}px`
204
- currentCol.style.transition = 'all 0.3s'
273
+ const drawerWidth = this.expandedWidth || 602
274
+ // 使用安全的方式设置布局样式
275
+ this.safeSetLayoutStyles(currentCol, {
276
+ flex: `0 0 ${drawerWidth}px`,
277
+ maxWidth: `${drawerWidth}px`,
278
+ transition: 'all 0.3s'
279
+ })
205
280
  if (otherCols.length === 1) {
206
281
  const mainCol = otherCols[0]
207
- mainCol.style.flex = '1 1 auto'
208
- mainCol.style.maxWidth = `calc(${this.totalWidth} - ${drawerWidth}px)`
209
- mainCol.style.transition = 'all 0.3s'
282
+ const remainingWidth = this.computeRemainingWidth(this.getSiblingCols(undefined), mainCol, currentCol)
283
+
284
+ // 使用安全的方式设置布局样式
285
+ this.safeSetLayoutStyles(mainCol, {
286
+ flex: '1 1 auto',
287
+ maxWidth: `calc(100% - ${remainingWidth} - ${drawerWidth}px)`,
288
+ transition: 'all 0.3s'
289
+ })
210
290
  }
211
291
  } else {
212
292
  const drawerWidth = (this.expandedWidthPercent || 33.3)
213
- currentCol.style.flex = `0 0 ${drawerWidth}%`
214
- currentCol.style.maxWidth = `${drawerWidth}%`
215
- currentCol.style.transition = 'all 0.3s'
293
+ // 使用安全的方式设置布局样式
294
+ this.safeSetLayoutStyles(currentCol, {
295
+ flex: `0 0 ${drawerWidth}%`,
296
+ maxWidth: `${drawerWidth}%`,
297
+ transition: 'all 0.3s'
298
+ })
216
299
  if (otherCols.length === 1) {
217
300
  const mainCol = otherCols[0]
218
- const mainWidth = Math.max(0, Math.min(this.totalWidth, 100) - drawerWidth)
219
- mainCol.style.flex = `0 0 ${mainWidth}%`
220
- mainCol.style.maxWidth = `${mainWidth}%`
221
- mainCol.style.transition = 'all 0.3s'
301
+ const remainingWidth = this.computeRemainingWidth(this.getSiblingCols(undefined), mainCol, currentCol)
302
+
303
+ // 使用安全的方式设置布局样式
304
+ this.safeSetLayoutStyles(mainCol, {
305
+ flex: `0 0 calc(100% - ${remainingWidth} - ${drawerWidth}%)`,
306
+ maxWidth: `calc(100% - ${remainingWidth} - ${drawerWidth}%)`,
307
+ transition: 'all 0.3s'
308
+ })
222
309
  }
223
310
  }
224
311
  } else {
@@ -234,14 +321,23 @@ export default {
234
321
  triggerResize()
235
322
  } else {
236
323
  // 收缩状态
237
- currentCol.style.flex = '0 0 26px'
238
- currentCol.style.maxWidth = '26px'
239
- currentCol.style.transition = 'all 0.3s'
324
+ const width = this.widthMode === 'px' ? this.collapsedWidth + 'px' : this.collapsedWidthPercent + '%'
325
+ // 使用安全的方式设置布局样式
326
+ this.safeSetLayoutStyles(currentCol, {
327
+ flex: '0 0 ' + width,
328
+ maxWidth: width,
329
+ transition: 'all 0.3s'
330
+ })
240
331
  if (otherCols.length === 1) {
241
332
  const mainCol = otherCols[0]
242
- mainCol.style.flex = '1 1 auto'
243
- mainCol.style.maxWidth = 'calc(100% - 26px)'
244
- mainCol.style.transition = 'all 0.3s'
333
+ const remainingWidth = this.computeRemainingWidth(this.getSiblingCols(undefined), mainCol, currentCol)
334
+
335
+ // 使用安全的方式设置布局样式
336
+ this.safeSetLayoutStyles(mainCol, {
337
+ flex: '1 1 auto',
338
+ maxWth: `calc(100% - ${remainingWidth} - ${width})`,
339
+ transition: 'all 0.3s'
340
+ })
245
341
  }
246
342
  triggerResize()
247
343
  }