af-mobile-client-vue3 1.0.87 → 1.0.90

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,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.0.87",
4
+ "version": "1.0.90",
5
5
  "description": "Vue + Vite component lib",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -67,7 +67,7 @@ const resultLabel = computed({
67
67
  return ''
68
68
  const res = props.columns.filter((item) => {
69
69
  const data = props.offOption ? item : item[props.option.value]
70
- return data === resultValue.value[0]
70
+ return data === resultValue.value
71
71
  })
72
72
  return res.length ? (props.offOption ? res[0] : res[0][props.option.text]) : ''
73
73
  },
@@ -89,8 +89,8 @@ function search(val) {
89
89
  }
90
90
 
91
91
  function onConfirm(value, _index) {
92
- // resultValue.value = props.offOption ? value.selectedValues : value.selectedValues[0]
93
- resultValue.value = value.selectedValues
92
+ resultValue.value = props.offOption ? value.selectedValues : value.selectedValues[0]
93
+ // resultValue.value = value.selectedValues
94
94
  selectedOption.value = value.selectedOptions
95
95
  show.value = !show.value
96
96
  emits('confirm', value.selectedValues[0], value.selectedOptions)
@@ -10,6 +10,7 @@ import {
10
10
  Row as VanRow,
11
11
  Search as VanSearch,
12
12
  Space as VanSpace,
13
+ Tag as VanTag,
13
14
  showConfirmDialog,
14
15
  } from 'vant'
15
16
  import XBadge from '@af-mobile-client-vue3/components/data/XBadge/index.vue'
@@ -30,7 +31,7 @@ const { configName, serviceName, fixQueryForm } = withDefaults(defineProps<{
30
31
  serviceName: undefined,
31
32
  })
32
33
 
33
- const emit = defineEmits(['toDetail', 'addOption'])
34
+ const emit = defineEmits(['toDetail', 'addOption', 'handleCall', 'handleLocation'])
34
35
 
35
36
  const router = useRouter()
36
37
 
@@ -50,6 +51,9 @@ const subTitleColumns = ref([])
50
51
  // 详情列
51
52
  const detailColumns = ref([])
52
53
 
54
+ // 标签列
55
+ const tagList = ref([])
56
+
53
57
  // 底部列
54
58
  const footColumns = ref([])
55
59
 
@@ -85,7 +89,7 @@ const pageSize = 20
85
89
 
86
90
  const searchValue = ref('')
87
91
 
88
- const inputSpan = ref(22)
92
+ const inputSpan = ref(20)
89
93
 
90
94
  // 数据加载状态
91
95
  const loading = ref(false)
@@ -132,6 +136,9 @@ function initComponent() {
132
136
  else if (item.mobileColumnType === 'mobile_footer_column') {
133
137
  footColumns.value.push(item)
134
138
  }
139
+ else if (item.mobileColumnType === 'mobile_tag_column') {
140
+ tagList.value.push(item)
141
+ }
135
142
  else if (item.slotType === 'action' && item.actionArr) {
136
143
  for (let j = 0; j < item.actionArr.length; j++)
137
144
  allActions.value.push({ text: item.actionArr[j].text, func: item.actionArr[j].func })
@@ -298,6 +305,16 @@ function addOption() {
298
305
  })
299
306
  // emit('addOption', totalCount.value)
300
307
  }
308
+
309
+ // 处理拨打电话
310
+ // function handleCall(item: any) {
311
+ // emit('handleCall', item)
312
+ // }
313
+
314
+ // 处理查看位置
315
+ // function handleLocation(item: any) {
316
+ // emit('handleLocation', item)
317
+ // }
301
318
  </script>
302
319
 
303
320
  <template>
@@ -308,10 +325,12 @@ function addOption() {
308
325
  v-model="searchValue"
309
326
  class="title-search"
310
327
  clearable
328
+ placeholder="搜索信息..."
329
+ shape="round"
311
330
  @search="onRefresh"
312
331
  />
313
332
  </VanCol>
314
- <VanCol span="2" class="search-icon">
333
+ <VanCol span="4" class="search-icon">
315
334
  <XCellListFilter
316
335
  v-model:sortord-val="sortordVal"
317
336
  v-model:order-val="orderVal"
@@ -326,6 +345,7 @@ function addOption() {
326
345
  />
327
346
  </VanCol>
328
347
  </VanRow>
348
+ <slot name="search-after" />
329
349
  <div class="main">
330
350
  <VanPullRefresh v-model="refreshing" :success-text="finishedText" head-height="70" @refresh="onRefresh">
331
351
  <template v-if="!isError">
@@ -338,33 +358,49 @@ function addOption() {
338
358
  >
339
359
  <div v-for="(item, index) in list" :key="`card_${index}`" class="card_item_main">
340
360
  <VanRow gutter="20" class="card_item_header" align="center" @click="emit('toDetail', item)">
341
- <VanCol v-for="(column) in mainColumns" :key="`main_${column.dataIndex}`" :span="18">
342
- <p
343
- class="card_item_title"
344
- :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
345
- >
346
- {{ item[column.dataIndex] ? item[column.dataIndex] : '--' }}
347
- </p>
348
- </VanCol>
349
- <VanCol v-for="(column) in subTitleColumns" :key="`subtitle_${column.dataIndex}`" :span="6">
350
- <p
351
- class="card_item_subtitle"
352
- :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
353
- >
354
- <XBadge
355
- :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
356
- :dict-name="column.dictName" :dict-value="item[column.dataIndex]"
357
- :service-name="serviceName"
358
- />
359
- </p>
361
+ <VanCol :span="24">
362
+ <div class="title-row">
363
+ <div v-for="(column) in mainColumns" :key="`main_${column.dataIndex}`" class="main-title">
364
+ <p
365
+ class="card_item_title"
366
+ :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
367
+ >
368
+ {{ item[column.dataIndex] ? item[column.dataIndex] : '--' }}
369
+ </p>
370
+ </div>
371
+ <div v-for="(column) in subTitleColumns" :key="`subtitle_${column.dataIndex}`" class="sub-title">
372
+ <p
373
+ class="card_item_subtitle"
374
+ :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
375
+ >
376
+ <XBadge
377
+ :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
378
+ :dict-name="column.dictName" :dict-value="item[column.dataIndex]"
379
+ :service-name="serviceName"
380
+ />
381
+ </p>
382
+ </div>
383
+ <!-- <div class="action-buttons">
384
+ <VanButton
385
+ class="action-button"
386
+ icon="phone"
387
+ size="small"
388
+ @click.stop="handleCall(item)"
389
+ />
390
+ <VanButton
391
+ class="action-button"
392
+ icon="location"
393
+ size="small"
394
+ @click.stop="handleLocation(item)"
395
+ />
396
+ </div> -->
397
+ </div>
360
398
  </VanCol>
361
399
  </VanRow>
362
400
  <VanRow gutter="20" class="card_item_details" @click="emit('toDetail', item)">
363
401
  <VanCol v-for="column of detailColumns" :key="`details_${column.dataIndex}`" :span="column.span">
364
402
  <p>
365
- <span :style="handleFunctionStyle(column.styleFunctionForTitle, item[column.dataIndex])">{{
366
- column.title
367
- }}: </span>
403
+ {{ column.title }}:
368
404
  <XBadge
369
405
  :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
370
406
  :dict-name="column.dictName" :dict-value="item[column.dataIndex]"
@@ -373,12 +409,40 @@ function addOption() {
373
409
  </p>
374
410
  </VanCol>
375
411
  </VanRow>
412
+ <VanRow v-if="tagList.length > 0" gutter="20" class="tag-row" @click="emit('toDetail', item)">
413
+ <VanCol :span="24">
414
+ <div class="tag-container">
415
+ <div class="tag-wrapper">
416
+ <VanCol
417
+ v-for="column of tagList"
418
+ :key="`tag_${column.dataIndex}`"
419
+ :span="column.flexSpan"
420
+ class="tag-col"
421
+ >
422
+ <VanTag
423
+ :text-color="column.tagColor"
424
+ :color="column.tagBorderColor"
425
+ round
426
+ size="medium"
427
+ class="tag-item"
428
+ >
429
+ {{ column.title }}:<XBadge
430
+ :dict-name="column.dictName"
431
+ :dict-value="item[column.dataIndex]"
432
+ :service-name="serviceName"
433
+ />
434
+ </VanTag>
435
+ </VanCol>
436
+ </div>
437
+ </div>
438
+ </VanCol>
439
+ </VanRow>
376
440
  <VanRow gutter="20" class="card_item_footer" @click="emit('toDetail', item)">
377
441
  <VanCol v-for="column of footColumns" :key="`foot_${column.dataIndex}`" :span="12">
378
442
  <p>
379
- <span :style="handleFunctionStyle(column.styleFunctionForTitle, item[column.dataIndex])">{{
380
- column.title
381
- }}: </span>
443
+ <span :style="handleFunctionStyle(column.styleFunctionForTitle, item[column.dataIndex])">
444
+ {{ column.title }}:
445
+ </span>
382
446
  <XBadge
383
447
  :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
384
448
  :dict-name="column.dictName" :dict-value="item[column.dataIndex]"
@@ -396,10 +460,12 @@ function addOption() {
396
460
  @select="onSelectMenu(item, $event)"
397
461
  >
398
462
  <template #reference>
399
- <VanButton
400
- v-show="otherActions && otherActions.length !== 0" class="custom-button" size="small"
401
- icon="ellipsis" type="default"
402
- />
463
+ <div
464
+ v-show="otherActions && otherActions.length !== 0"
465
+ class="more-button"
466
+ >
467
+ <span>⋯</span>
468
+ </div>
403
469
  </template>
404
470
  </VanPopover>
405
471
  </VanCol>
@@ -411,6 +477,7 @@ function addOption() {
411
477
  :key="button.func"
412
478
  type="primary"
413
479
  size="small"
480
+ class="action-btn"
414
481
  @click="onSelectMenu(item, button)"
415
482
  >
416
483
  {{ button.text }}
@@ -457,14 +524,93 @@ function addOption() {
457
524
  .card_item_header {
458
525
  margin-bottom: var(--van-padding-base);
459
526
 
460
- .card_item_title {
461
- font-size: var(--van-font-size-lg);
527
+ .title-row {
528
+ display: flex;
529
+ align-items: center;
530
+ margin-bottom: 8px;
531
+ width: 100%;
532
+
533
+ .main-title {
534
+ display: inline-flex;
535
+ align-items: center;
536
+ .card_item_title {
537
+ font-size: var(--van-font-size-lg);
538
+ margin: 0;
539
+ }
540
+ }
541
+
542
+ .sub-title {
543
+ display: inline-flex;
544
+ align-items: center;
545
+ margin-left: 4px;
546
+ .card_item_subtitle {
547
+ font-size: var(--van-font-size-xs);
548
+ color: var(--van-text-color-2);
549
+ margin: 0;
550
+ }
551
+ }
552
+
553
+ .action-buttons {
554
+ display: flex;
555
+ align-items: center;
556
+ margin-left: auto;
557
+ .action-button {
558
+ margin-left: 4px;
559
+ width: 36px;
560
+ height: 36px;
561
+ padding: 0;
562
+ border: none;
563
+ color: var(--van-primary-color);
564
+ background-color: rgba(25, 137, 250, 0.3);
565
+ border-radius: 4px;
566
+ font-size: 20px;
567
+ display: flex;
568
+ align-items: center;
569
+ justify-content: center;
570
+ &:active {
571
+ opacity: 0.7;
572
+ background-color: rgba(25, 137, 250, 0.5);
573
+ }
574
+ }
575
+ }
462
576
  }
577
+ }
463
578
 
464
- .card_item_subtitle {
465
- font-size: var(--van-font-size-xs);
466
- color: var(--van-text-color-2);
467
- text-align: right;
579
+ .tag-row {
580
+ margin-bottom: var(--van-padding-base);
581
+ }
582
+
583
+ .tag-container {
584
+ width: 100%;
585
+ .tag-wrapper {
586
+ display: flex;
587
+ flex-wrap: wrap;
588
+ padding: 0 !important;
589
+ align-items: center;
590
+ width: 100%;
591
+ margin: 0 -8px;
592
+
593
+ .tag-col {
594
+ display: flex;
595
+ align-items: center;
596
+ padding: 0 8px;
597
+ min-height: 32px;
598
+ }
599
+
600
+ .tag-item {
601
+ width: auto;
602
+ text-align: left;
603
+ font-size: var(--van-font-size-xs);
604
+ display: flex;
605
+ align-items: center;
606
+ margin: 4px 0;
607
+ justify-content: center;
608
+ :deep(.van-tag) {
609
+ width: fit-content;
610
+ display: inline-flex;
611
+ align-items: center;
612
+ }
613
+ }
468
614
  }
469
615
  }
470
616
 
@@ -495,50 +641,35 @@ function addOption() {
495
641
  }
496
642
 
497
643
  .filter-condition {
644
+ display: flex;
645
+ align-items: center;
646
+ padding: 8px 12px;
647
+ background-color: #fff;
498
648
  :deep(.van-search) {
499
649
  padding: var(--van-search-padding);
500
- }
501
- .search-icon{
502
- display: flex;
503
- align-items: center;
504
- justify-content: center;
505
- height: 100%; // 确保高度与搜索框一致
506
- padding: var(--van-search-padding); // 使用与搜索框相同的内边距
650
+ background-color: transparent;
507
651
  }
508
652
  :deep(.van-search__content) {
509
- border-radius: 8px;
510
- }
511
-
512
- //.title-search {
513
- // height: 4vh;
514
- //}
515
-
516
- :deep(.van-dropdown-menu__bar) {
517
- height: calc(4vh - 4px);
518
- box-shadow: none;
653
+ border-radius: 5px;
654
+ background-color: #f5f5f5;
655
+ padding: 4px 8px;
519
656
  }
520
-
521
- :deep(.van-dropdown-menu__title) {
522
- padding: 0;
657
+ :deep(.van-field__left-icon) {
658
+ color: #999;
523
659
  }
524
-
525
- :deep(.van-dropdown-menu__title--down:after) {
526
- display: none;
660
+ :deep(.van-cell) {
661
+ background-color: transparent;
527
662
  }
528
-
529
- :deep(.van-dropdown-menu__title:after) {
530
- display: none;
663
+ :deep(.van-field__control::placeholder) {
664
+ color: #999;
665
+ font-size: 14px;
531
666
  }
532
-
533
- :deep(.van-dropdown-item__content) {
534
- position: absolute;
535
- max-height: var(--van-dropdown-menu-content-max-height);
536
- }
537
-
538
- :deep(.van-dropdown-menu__item) {
667
+ .search-icon {
539
668
  display: flex;
540
669
  align-items: center;
541
670
  justify-content: center;
671
+ height: 100%;
672
+ padding: var(--van-search-padding);
542
673
  }
543
674
  }
544
675
 
@@ -546,5 +677,31 @@ function addOption() {
546
677
  border: none !important;
547
678
  box-shadow: none !important;
548
679
  }
680
+
681
+ .more-button {
682
+ width: 24px;
683
+ height: 24px;
684
+ display: flex;
685
+ align-items: center;
686
+ justify-content: center;
687
+ color: #666;
688
+ cursor: pointer;
689
+ font-size: 20px;
690
+ background-color: #f7f8fa;
691
+ border-radius: 4px;
692
+ span {
693
+ line-height: 1;
694
+ margin-top: -2px;
695
+ }
696
+ &:active {
697
+ opacity: 0.7;
698
+ background-color: #ebedf0;
699
+ }
700
+ }
701
+ .action-btn {
702
+ min-width: 80px;
703
+ border-radius: 20px;
704
+ font-size: 14px;
705
+ }
549
706
  }
550
707
  </style>
@@ -103,10 +103,12 @@ onMounted(() => {
103
103
 
104
104
  <template>
105
105
  <div id="XCellListFilter">
106
- <VanDropdownMenu :close-on-click-outside="false">
106
+ <VanDropdownMenu :close-on-click-outside="false" class="filter-dropdown-menu">
107
107
  <VanDropdownItem ref="listFilterMenu">
108
108
  <template #title>
109
- <VanIcon name="filter-o" size="23" />
109
+ <div class="filter-icon-box">
110
+ <VanIcon name="apps-o" size="24" class="filter-icon" />
111
+ </div>
110
112
  </template>
111
113
  <div class="order-condition">
112
114
  <template v-if="props.orderList.length > 0">
@@ -165,6 +167,25 @@ onMounted(() => {
165
167
 
166
168
  <style scoped lang="less">
167
169
  #XCellListFilter {
170
+ .filter-dropdown-menu {
171
+ :deep(.van-dropdown-menu__bar) {
172
+ box-shadow: none;
173
+ height: auto;
174
+ }
175
+ :deep(.van-dropdown-menu__item) {
176
+ display: flex;
177
+ align-items: center;
178
+ justify-content: center;
179
+ }
180
+ }
181
+ .filter-icon {
182
+ color: #333;
183
+ background-color: rgba(245,245,245);
184
+ }
185
+ .filter-icon-box {
186
+ border-radius: 10px;
187
+ background-color: rgba(245,245,245);
188
+ }
168
189
  .order-condition {
169
190
  // padding-bottom: 10px;
170
191
  max-height: calc(var(--van-picker-toolbar-height) + var(--van-padding-base) + var(--van-tabs-line-height) + 35vh);