vue2-client 1.16.49 → 1.16.51

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 (45) hide show
  1. package/package.json +112 -112
  2. package/src/assets/svg/female.svg +1 -0
  3. package/src/assets/svg/male.svg +1 -0
  4. package/src/base-client/components/common/HIS/HButtons/HButtons.vue +371 -371
  5. package/src/base-client/components/common/HIS/HFormGroup/HFormGroup.vue +120 -120
  6. package/src/base-client/components/common/HIS/HFormGroup/index.js +3 -3
  7. package/src/base-client/components/common/HIS/HFormTable/HFormTable.vue +379 -257
  8. package/src/base-client/components/common/HIS/demo.vue +61 -61
  9. package/src/base-client/components/common/XCollapse/XCollapse.vue +461 -461
  10. package/src/base-client/components/common/XInput/XInput.vue +147 -147
  11. package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +824 -824
  12. package/src/base-client/components/common/XTable/XTable.vue +1610 -1610
  13. package/src/base-client/components/common/XTimeline/XTimeline.vue +454 -454
  14. package/src/base-client/components/his/XHisEditor/XHisEditor.vue +705 -705
  15. package/src/base-client/components/his/XList/XList.vue +829 -607
  16. package/src/base-client/components/his/threeTestOrders/editor.vue +113 -113
  17. package/src/pages/WorkflowDetail/WorkFlowDemo3.vue +203 -225
  18. package/src/pages/userInfoDetailManage/ExceptionRecordQuery/index.vue +45 -45
  19. package/src/router/async/router.map.js +129 -129
  20. package/src/services/api/common.js +0 -2
  21. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145434.vue +0 -641
  22. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145453.vue +0 -641
  23. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145610.vue +0 -647
  24. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145629.vue +0 -647
  25. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145901.vue +0 -645
  26. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145907.vue +0 -651
  27. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926145920.vue +0 -651
  28. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926150047.vue +0 -651
  29. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926151820.vue +0 -646
  30. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926151827.vue +0 -646
  31. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152115.vue +0 -646
  32. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152212.vue +0 -653
  33. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152215.vue +0 -653
  34. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152337.vue +0 -657
  35. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152341.vue +0 -657
  36. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152826.vue +0 -657
  37. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926152828.vue +0 -646
  38. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153121.vue +0 -654
  39. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153242.vue +0 -654
  40. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153318.vue +0 -646
  41. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153415.vue +0 -646
  42. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153435.vue +0 -655
  43. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153606.vue +0 -655
  44. package/.history/src/base-client/components/common/XDataCard/XDataCard_20250926153653.vue +0 -655
  45. package/src/base-client/components/common/XDataCard/test.vue +0 -367
@@ -1,654 +0,0 @@
1
- <template>
2
- <div>
3
- <div v-if="render" class="XCard">
4
- <template v-for="(card, itemIndex) in data">
5
- <a-card
6
- :key="'card' + itemIndex"
7
- class="data-card"
8
- :class="{ 'card-clicked': card.isClicked }"
9
- :headStyle="{ backgroundColor: '#f9f9f9' }"
10
- >
11
- <div
12
- v-if="config && card[config.ribbon]"
13
- class="ribbon"
14
- :style="{ backgroundColor: getRibbonColor(card[config.ribbonColor]) }">
15
- {{ card[config.ribbon] }}
16
- </div>
17
- <!-- 自定义标题 -->
18
- <template #title>
19
- <div class="custom-title" @click="cardClick(card, 'cardclick', itemIndex)">
20
- <a-tooltip placement="top">
21
- <template #title>{{ card[config.id] }}</template>
22
- <div class="title-id" v-if="card[config.id]">{{ card[config.id] }}</div>
23
- </a-tooltip>
24
- <div class="title-basic">
25
- <div class="title-main">
26
- <span class="title-name">{{ card[config.title] }}</span>
27
- <span class="title-info">{{ card[config.title2] }}</span>
28
- <span class="title-title3">{{ card[config.title3] }}</span>
29
- </div>
30
- <div class="additional-info" v-if="card[config.subtitle2] || card[config.subtitle3] || card[config.subtitle4]">
31
- <a-tooltip placement="top" v-if="card[config.subtitle2]">
32
- <template #title>{{ card[config.subtitle2] }}</template>
33
- <span class="subtitle2">{{ card[config.subtitle2] }}</span>
34
- </a-tooltip>
35
- <a-tooltip placement="top" v-if="card[config.subtitle3]">
36
- <template #title>{{ card[config.subtitle3] }}</template>
37
- <span class="subtitle3">{{ card[config.subtitle3] }}</span>
38
- </a-tooltip>
39
- <span class="subtitle4" v-if="card[config.subtitle4]">{{ card[config.subtitle4] }}</span>
40
- </div>
41
- </div>
42
- </div>
43
- </template>
44
- <!-- 主体 -->
45
- <div class="body" v-if="card[config.text] || (config.content && config.content.length > 0)">
46
- <div class="body-text" v-if="card[config.text]">
47
- <a-tooltip :title="card[config.text]">
48
- <span class="text-ellipsis">{{ card[config.text] }}</span>
49
- </a-tooltip>
50
- </div>
51
- <template v-for="(item, bodyIndex) in config.content" v-if="bodyIndex < 6">
52
- <div :key="'body' + bodyIndex" class="body-item">
53
- <span class="body-item-label">{{ item.label }}:</span>
54
- <template v-if="item.type === 'progress'">
55
- <div class="progress">
56
- <div class="progress-bar">
57
- <div class="progress-done" :style="'width:' + card[item.key] * 100 + '%;backgroundColor: ' + determineRatioColor(card[item.key] * 100)"></div>
58
- </div>
59
- </div>
60
- <a-progress :percent="card[item.key]" :stroke-color="{ '0%': '#108ee9', '100%': '#87d068' }" strokeWidth="10" :style="{ width: '95%' }" />
61
- </template>
62
- <template v-else-if="item.type === 'custom' && tableColumns">
63
- <!-- 根据 tableColumns 显示自定义内容 -->
64
- <span v-for="column in tableColumns" v-if="column.dataIndex === item.key" :key="column.dataIndex">
65
- <template v-if="column.slotType === 'badge'">
66
- <x-badge
67
- :service-name="serviceName"
68
- :env="env"
69
- :dataCard="true"
70
- :badge-key="column.slotKeyMap"
71
- :value="card[item.key]" />
72
- </template>
73
- <template v-else>
74
- <slot :name="column.slots.customRender">{{ card[item.key] }}</slot>
75
- </template>
76
- </span>
77
- </template>
78
- <template v-else>
79
- <span class="body-item-value" style="float: right;">{{ card[item.key] }}</span>
80
- </template>
81
- </div>
82
- <a-divider
83
- v-if="bodyIndex !== config.content.length - 1"
84
- dashed
85
- :key="'body' + bodyIndex + 'after'"
86
- class="body-split" />
87
- </template>
88
- </div>
89
- <!-- 下方按钮 -->
90
- <template #actions>
91
- <div class="custom-actions" v-if="config && config.footer && config.footer.length > 0">
92
- <template v-for="(item, footerIndex) in config.footer">
93
- <div :key="'footer_' + footerIndex" class="footer-item" @click="clickFooter(card, item.emit, itemIndex)">
94
- <a-icon :type="item.icon" class="footer-icon" />
95
- <span>{{ item.label }}</span>
96
- </div>
97
- <a-divider
98
- v-if="footerIndex !== config.footer.length - 1"
99
- :key="'footer_' + footerIndex + 'after'"
100
- type="vertical"
101
- class="footer-item-split" />
102
- </template>
103
- </div>
104
- </template>
105
- </a-card>
106
- </template>
107
- </div>
108
- <div v-else>
109
- <a-skeleton />
110
- </div>
111
- <div v-if="this.showPagination">
112
- <a-divider />
113
- <a-pagination
114
- v-model="pageNum"
115
- style="float: right"
116
- :total="total"
117
- show-less-items
118
- :page-size="pageSize"
119
- :page-size-options="pageSizeOptions"
120
- show-size-changer
121
- @change="pageNumChange"
122
- :showTotal="paginationShowTotal"
123
- @showSizeChange="pageSizeChange">
124
- </a-pagination>
125
- </div>
126
- </div>
127
- </template>
128
-
129
- <script>
130
- import XBadge from '@vue2-client/base-client/components/common/XBadge'
131
-
132
- export default {
133
- name: 'XDataCard',
134
- components: {
135
- XBadge,
136
- },
137
- props: {
138
- // 卡片数据更新方法
139
- cardData: {
140
- type: Function,
141
- default: undefined
142
- },
143
- // 卡片的配置
144
- cardConfig: {
145
- type: Object,
146
- default: undefined
147
- },
148
- showPagination: {
149
- type: Boolean,
150
- default: false
151
- },
152
- // 临时
153
- testData: {
154
- type: Array,
155
- default: undefined
156
- },
157
- tableColumns: {
158
- type: Array,
159
- default: undefined
160
- },
161
- // 服务名称
162
- serviceName: undefined,
163
- // 当前环境
164
- env: {
165
- type: String,
166
- default: 'prod'
167
- },
168
- // pageSize参数
169
- prePageSize: {
170
- type: Number,
171
- default: undefined
172
- },
173
- // 初始是否加载数据
174
- createdQuery: {
175
- type: Boolean,
176
- default: false
177
- }
178
- },
179
- inject: ['getConfigByName'],
180
- data () {
181
- return {
182
- // 配置
183
- config: {},
184
- // 数据
185
- data: {},
186
- // 当前页码
187
- pageNum: 1,
188
- // 控制渲染
189
- render: true,
190
- // 分页大小
191
- pageSize: 10,
192
- // 分页大小选项
193
- pageSizeOptions: ['4', '6', '8', '10'],
194
- // 数据总数
195
- total: 0,
196
- activeCardIndex: null, // 新增:记录当前激活的卡片索引
197
- // 混入插槽组件的数据
198
- mixinData: {},
199
- }
200
- },
201
- created () {
202
- // 根据参数初始化数据值
203
- if (this.prePageSize) {
204
- this.pageSize = this.prePageSize
205
- }
206
- },
207
- mounted () {
208
- // 配置初始化
209
- if (this.cardConfig) {
210
- this.config = this.cardConfig
211
- } else {
212
- this.config = {
213
- id: '未获取到配置',
214
- title: '未获取到配置',
215
- title2: '未获取到配置',
216
- title3: '未获取到配置',
217
- subtitle2: '未获取到配置',
218
- subtitle3: '未获取到配置',
219
- subtitle4: '未获取到配置',
220
- text: '未获取到配置',
221
- ribbon: '未获取到配置',
222
- ribbonColor: '未获取到配置',
223
- content: [
224
- {
225
- label: '未获取到配置',
226
- key: 'one'
227
- },
228
- {
229
- label: '未获取到配置',
230
- key: 'two'
231
- },
232
- {
233
- label: '未获取到配置',
234
- key: 'three'
235
- },
236
- {
237
- label: '未获取到配置',
238
- key: 'four'
239
- },
240
- {
241
- label: '未获取到配置',
242
- key: 'five'
243
- },
244
- {
245
- label: '未获取到配置',
246
- key: 'six',
247
- type: 'progress'
248
- }
249
- ],
250
- footer: [
251
- {
252
- icon: 'edit',
253
- label: '未获取到配置',
254
- emit: 'planEdit'
255
- },
256
- {
257
- icon: 'user',
258
- label: '未获取到配置',
259
- emit: 'user'
260
- }
261
- ]
262
- }
263
- console.warn(this.config)
264
- }
265
-
266
- // 数据初始化
267
- if (this.cardData) {
268
- // if (this.createdQuery) {
269
- // this.loadData()
270
- // }
271
- } else {
272
- this.data = {
273
- one: '未获取到配置',
274
- two: '未获取到配置',
275
- three: '未获取到配置',
276
- four: '未获取到配置',
277
- five: '未获取到配置',
278
- six: 70,
279
- }
280
- }
281
- // 测试数据初始化
282
- if (this.testData) {
283
- this.data = this.testData
284
- }
285
- },
286
- methods: {
287
- // 根据比例计算出颜色
288
- determineRatioColor (ratio, isNum = false) {
289
- let result
290
- // 如果是数字,并且比例大于79,则将数字显示为黑色
291
- if (isNum && ratio > 79) {
292
- return 'rgb(0,0,0)'
293
- }
294
- if (ratio >= 90) {
295
- result = 'rgb( 1,245, 38 )'
296
- } else if (ratio >= 75) {
297
- result = 'rgb( 139,245, 0)'
298
- } else if (ratio >= 40) {
299
- result = 'rgb(245,163, 0)'
300
- } else if (ratio >= 20) {
301
- result = 'rgb(244, 96, 0)'
302
- } else {
303
- result = 'rgb(255, 0, 0)'
304
- }
305
- return result
306
- },
307
- async cardClick (card, itemIndex) {
308
- try {
309
- // 等待 beforeSwitch 完全执行完成
310
- const result = await this.beforeSwitch(card, 'beforeSwitch', itemIndex)
311
- // 如果返回 undefined 说明没有监听器,或者返回 true 说明检查通过
312
- if (result === undefined || result === true) {
313
- await this.clickFooter(card, 'cardclick', itemIndex)
314
- }
315
- } catch (error) {
316
- }
317
- },
318
- // 点击按钮
319
- async clickFooter (data, eventName, index) {
320
- if (eventName === 'cardclick') {
321
- // 清除所有卡片的点击状态
322
- if (this.data && Array.isArray(this.data)) {
323
- this.data.forEach(item => {
324
- if (item.isClicked) {
325
- this.$set(item, 'isClicked', false)
326
- }
327
- })
328
- }
329
- // 设置当前卡片的点击状态
330
- this.$set(data, 'isClicked', true)
331
- }
332
- this.$emit('cardEmit', data, eventName)
333
- },
334
- async beforeSwitch (data, eventName, index) {
335
- return new Promise((resolve) => {
336
- // 检查是否有其他卡片已经被点击
337
- const hasClickedCard = this.data.some(item => item.isClicked)
338
- // 如果没有任何卡片被点击过,直接通过
339
- if (!hasClickedCard) {
340
- resolve(true)
341
- return
342
- }
343
- // 检查是否有监听器
344
- const hasListeners = this._events?.cardEmit?.length > 0
345
-
346
- // 如果没有监听器,返回 undefined 表示继续执行
347
- if (!hasListeners) {
348
- resolve(undefined)
349
- return
350
- }
351
- // 如果有监听器,执行事件检查
352
- try {
353
- this.$emit('cardEmit', data, eventName)
354
- resolve(true)
355
- } catch (error) {
356
- resolve(false)
357
- }
358
- })
359
- },
360
- // 获取数据
361
- loadData () {
362
- this.render = false
363
- const parameter = Object.assign({
364
- querySummary: false, // 分页查询的情况不重新获取汇总数据
365
- pageNo: this.pageNum,
366
- pageSize: this.pageSize
367
- }
368
- )
369
- this.cardData(parameter).then(res => {
370
- this.data = res.data
371
- this.total = res.totalCount
372
- this.render = true
373
- })
374
- },
375
- // 页码改变
376
- pageNumChange (page, pageSize) {
377
- this.pageNum = page
378
- this.pageSize = pageSize
379
- this.loadData()
380
- },
381
- // 分页大小改变
382
- pageSizeChange (current, pageSize) {
383
- this.pageSize = pageSize
384
- this.loadData()
385
- },
386
- // 刷新
387
- refresh () {
388
- this.loadData()
389
- },
390
- // 分页前展示当前项和总数
391
- paginationShowTotal () {
392
- return `${(this.pageNum - 1) * this.pageSize + 1 } - ${ this.pageNum * this.pageSize } | 共 ${ this.total } 项`
393
- },
394
- getRibbonColor (color) {
395
- switch (color) {
396
- case 'red':
397
- return '#ff4d4f'
398
- case 'blue':
399
- return '#1890ff'
400
- case 'yellow':
401
- return '#fadb14'
402
- default:
403
- return '#ff4d4f' // 默认红色
404
- }
405
- }
406
- }
407
- }
408
- </script>
409
-
410
- <style lang="less" scoped>
411
- .hide-page-numbers /deep/ .ant-pagination-item,
412
- .hide-page-numbers /deep/ .ant-pagination-jump-next {
413
- display: none !important; /* 隐藏数字页码和多页跳转 */
414
- }
415
- .hide-page-numbers /deep/ .ant-pagination-prev,
416
- .hide-page-numbers /deep/ .ant-pagination-next {
417
- display: inline-block !important; /* 保留左右跳转按钮 */
418
- }
419
-
420
- .XCard {
421
- display: flex;
422
- flex-wrap: wrap;
423
- justify-content: flex-start;
424
- overflow-y: auto;
425
- overflow-x: hidden;
426
- max-height: 85vh;
427
- .data-card {
428
- flex: 0 0 20%;
429
- max-width: 20%;
430
- box-sizing: border-box;
431
- border: 2px solid rgb(244,244,244);
432
- border-radius: 5px;
433
- margin: 0;
434
- overflow: hidden;
435
-
436
- ::v-deep .ant-card-body {
437
- padding: 15px !important; // 使用 !important 确保样式覆盖
438
- }
439
- ::v-deep .ant-card-head {
440
- padding: 0 15px !important; // 与 body 左右 15px 对齐
441
- }
442
- ::v-deep .ant-card-head-title {
443
- padding: 12px 0 !important; // 只保留上下内边距
444
- margin: 0 !important;
445
- }
446
-
447
- .header {
448
- width: 100%;
449
- background-color: rgb(244,244,244);
450
- padding: 5px 15px;
451
-
452
- span {
453
- font-weight: bold;
454
- font-size: 1.1em;
455
- }
456
- }
457
-
458
- .body {
459
- .body-text{
460
- width: 500px;
461
- font-weight: bold;
462
- font-size: 1.1em;
463
- .text-ellipsis{
464
- display: inline-block;
465
- max-width: 260px; /* 控制文本的最大宽度 */
466
- white-space: nowrap;
467
- overflow: hidden;
468
- text-overflow: ellipsis;
469
- }
470
- }
471
-
472
- .body-item {
473
- padding: 3px 5px;
474
- }
475
-
476
- .body-split {
477
- margin: 1px 0;
478
- }
479
-
480
- .body-item-label {
481
- color: rgba(117, 117, 117, 0.8);
482
- font-size: 0.95em;
483
- }
484
-
485
- .body-item-value {
486
- color: black;
487
- }
488
-
489
- .progress {
490
- display: inline-block;
491
- width: 60%;
492
- height: 60%;
493
- float: right;
494
- padding-right: 1.5%;
495
- margin-top: 0.5%;
496
-
497
- .progress-bar {
498
- width: 100%;
499
- height: 90%;
500
- display: inline-block;
501
- border-radius: 10%;
502
- background-color: rgba(212,217,218, 0.6);
503
-
504
- .progress-done {
505
- float: left;
506
- display: inline-block;
507
- height: 100%;
508
- border-radius: 10%;
509
- }
510
- }
511
- }
512
- .progress-num {
513
- position: relative;
514
- top: -83%;
515
- left: -3%;
516
- text-align: end;
517
- font-size: 0.9em;
518
- color: black;
519
- }
520
- }
521
-
522
- &.card-clicked {
523
- :deep(.ant-card-head) {
524
- background-color: #e6f7ff;
525
- transition: background-color 0.3s ease;
526
- }
527
- }
528
- }
529
-
530
- .custom-title {
531
- display: flex;
532
- align-items: center;
533
- gap: 12px;
534
- padding-left: 5px; // 与 .body-item 左 padding 5px 对齐
535
-
536
- &:hover {
537
- cursor: pointer;
538
- }
539
-
540
- .title-id {
541
- flex-shrink: 0;
542
- width: 65px;
543
- color: #1890ff;
544
- font-size: 16px;
545
- font-weight: bold;
546
- padding: 4px 8px;
547
- border: 1px solid #1890ff;
548
- border-radius: 4px;
549
- line-height: 1.4;
550
- text-align: center;
551
- white-space: nowrap;
552
- overflow: hidden;
553
- text-overflow: ellipsis;
554
- }
555
-
556
- .title-basic {
557
- display: flex;
558
- flex-direction: column;
559
- flex-grow: 1;
560
-
561
- .subtitle2, .subtitle3 {
562
- display: inline-block;
563
- max-width: 50px; /* 固定宽度 */
564
- white-space: nowrap;
565
- overflow: hidden;
566
- text-overflow: ellipsis;
567
- }
568
-
569
- .title-main {
570
- display: flex;
571
- align-items: center;
572
- gap: 8px;
573
- .title-info {
574
- margin-left: 6px;
575
- color: #808080;
576
- }
577
- .title-name {
578
- font-weight: bold;
579
- }
580
- .title-title3 {
581
- color: #808080;
582
- }
583
- }
584
-
585
- .additional-info {
586
- display: flex;
587
- gap: 8px;
588
- font-size: 13px;
589
- color: #808080;
590
- .subtitle4 {
591
- color: rgba(0, 0, 255, 0.8);
592
- }
593
- }
594
- }
595
- }
596
-
597
- .ribbon {
598
- position: absolute;
599
- top: 16px;
600
- right: -6px;
601
- background-color: #ff4d4f;
602
- color: white;
603
- padding: 5px 25px;
604
- font-size: 12px;
605
- transform: rotate(45deg) translateX(30%);
606
- transform-origin: top right;
607
- z-index: 1;
608
- }
609
-
610
- .custom-actions {
611
- display: flex;
612
- align-items: center;
613
- justify-content: space-between;
614
- width: 100%;
615
- .footer-icon {
616
- margin-right: 5px;
617
- }
618
-
619
- .footer-item-split {
620
- color: rgba(220, 220, 220, 0.59);
621
- }
622
-
623
- .footer-item {
624
- color: rgba(117, 117, 117, 0.8);
625
- font-size: 1em;
626
- white-space: nowrap;
627
- display: inline-flex;
628
- align-items: center;
629
- justify-content: center;
630
- flex: 1 1 0;
631
- min-width: 0;
632
- }
633
-
634
- .footer-item:hover {
635
- color: rgb( 24,144,255 );
636
- cursor: pointer;
637
- }
638
- :deep(.ant-divider-vertical) {
639
- height: 24px;
640
- border-left: 1px solid rgba(220, 220, 220, 0.59);
641
- top: 0;
642
- margin: 0 8px;
643
- }
644
- }
645
- }
646
-
647
- .ellipsis {
648
- display: inline-block;
649
- max-width: 60px;
650
- white-space: nowrap;
651
- overflow: hidden;
652
- text-overflow: ellipsis;
653
- }
654
- </style>