af-mobile-client-vue3 1.0.86 → 1.0.89

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.86",
4
+ "version": "1.0.89",
5
5
  "description": "Vue + Vite component lib",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import {
3
+ Button as vanButton,
3
4
  Uploader as vanUploader,
4
5
  } from 'vant'
5
6
  import { onMounted, ref } from 'vue'
@@ -97,7 +98,11 @@ onMounted(() => {
97
98
  :after-read="fileUpload"
98
99
  :show-upload="false"
99
100
  :deletable="false"
100
- />
101
+ >
102
+ <vanButton icon="photograph" type="primary">
103
+ 上传
104
+ </vanButton>
105
+ </van-uploader>
101
106
  <van-uploader
102
107
  v-else-if="props.authority === 'admin'"
103
108
  v-model="imageList"
@@ -105,7 +110,11 @@ onMounted(() => {
105
110
  :preview-image="true"
106
111
  :after-read="fileUpload"
107
112
  :before-delete="deleteFileFunction"
108
- />
113
+ >
114
+ <vanButton icon="photograph" type="primary">
115
+ 上传
116
+ </vanButton>
117
+ </van-uploader>
109
118
  </template>
110
119
 
111
120
  <style scoped lang="less">
@@ -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,48 @@ 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>
368
403
  <XBadge
369
404
  :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
370
405
  :dict-name="column.dictName" :dict-value="item[column.dataIndex]"
@@ -373,12 +408,40 @@ function addOption() {
373
408
  </p>
374
409
  </VanCol>
375
410
  </VanRow>
411
+ <VanRow v-if="tagList.length > 0" gutter="20" class="tag-row" @click="emit('toDetail', item)">
412
+ <VanCol :span="24">
413
+ <div class="tag-container">
414
+ <div class="tag-wrapper">
415
+ <VanCol
416
+ v-for="column of tagList"
417
+ :key="`tag_${column.dataIndex}`"
418
+ :span="column.flexSpan"
419
+ class="tag-col"
420
+ >
421
+ <VanTag
422
+ :text-color="column.tagColor"
423
+ :color="column.tagBorderColor"
424
+ round
425
+ size="medium"
426
+ class="tag-item"
427
+ >
428
+ {{ column.title }}:<XBadge
429
+ :dict-name="column.dictName"
430
+ :dict-value="item[column.dataIndex]"
431
+ :service-name="serviceName"
432
+ />
433
+ </VanTag>
434
+ </VanCol>
435
+ </div>
436
+ </div>
437
+ </VanCol>
438
+ </VanRow>
376
439
  <VanRow gutter="20" class="card_item_footer" @click="emit('toDetail', item)">
377
440
  <VanCol v-for="column of footColumns" :key="`foot_${column.dataIndex}`" :span="12">
378
441
  <p>
379
- <span :style="handleFunctionStyle(column.styleFunctionForTitle, item[column.dataIndex])">{{
380
- column.title
381
- }}: </span>
442
+ <span :style="handleFunctionStyle(column.styleFunctionForTitle, item[column.dataIndex])">
443
+ {{ column.title }}:
444
+ </span>
382
445
  <XBadge
383
446
  :style="handleFunctionStyle(column.styleFunctionForValue, item[column.dataIndex])"
384
447
  :dict-name="column.dictName" :dict-value="item[column.dataIndex]"
@@ -396,10 +459,12 @@ function addOption() {
396
459
  @select="onSelectMenu(item, $event)"
397
460
  >
398
461
  <template #reference>
399
- <VanButton
400
- v-show="otherActions && otherActions.length !== 0" class="custom-button" size="small"
401
- icon="ellipsis" type="default"
402
- />
462
+ <div
463
+ v-show="otherActions && otherActions.length !== 0"
464
+ class="more-button"
465
+ >
466
+ <span>⋯</span>
467
+ </div>
403
468
  </template>
404
469
  </VanPopover>
405
470
  </VanCol>
@@ -411,6 +476,7 @@ function addOption() {
411
476
  :key="button.func"
412
477
  type="primary"
413
478
  size="small"
479
+ class="action-btn"
414
480
  @click="onSelectMenu(item, button)"
415
481
  >
416
482
  {{ button.text }}
@@ -457,14 +523,93 @@ function addOption() {
457
523
  .card_item_header {
458
524
  margin-bottom: var(--van-padding-base);
459
525
 
460
- .card_item_title {
461
- font-size: var(--van-font-size-lg);
526
+ .title-row {
527
+ display: flex;
528
+ align-items: center;
529
+ margin-bottom: 8px;
530
+ width: 100%;
531
+
532
+ .main-title {
533
+ display: inline-flex;
534
+ align-items: center;
535
+ .card_item_title {
536
+ font-size: var(--van-font-size-lg);
537
+ margin: 0;
538
+ }
539
+ }
540
+
541
+ .sub-title {
542
+ display: inline-flex;
543
+ align-items: center;
544
+ margin-left: 4px;
545
+ .card_item_subtitle {
546
+ font-size: var(--van-font-size-xs);
547
+ color: var(--van-text-color-2);
548
+ margin: 0;
549
+ }
550
+ }
551
+
552
+ .action-buttons {
553
+ display: flex;
554
+ align-items: center;
555
+ margin-left: auto;
556
+ .action-button {
557
+ margin-left: 4px;
558
+ width: 36px;
559
+ height: 36px;
560
+ padding: 0;
561
+ border: none;
562
+ color: var(--van-primary-color);
563
+ background-color: rgba(25, 137, 250, 0.3);
564
+ border-radius: 4px;
565
+ font-size: 20px;
566
+ display: flex;
567
+ align-items: center;
568
+ justify-content: center;
569
+ &:active {
570
+ opacity: 0.7;
571
+ background-color: rgba(25, 137, 250, 0.5);
572
+ }
573
+ }
574
+ }
462
575
  }
576
+ }
463
577
 
464
- .card_item_subtitle {
465
- font-size: var(--van-font-size-xs);
466
- color: var(--van-text-color-2);
467
- text-align: right;
578
+ .tag-row {
579
+ margin-bottom: var(--van-padding-base);
580
+ }
581
+
582
+ .tag-container {
583
+ width: 100%;
584
+ .tag-wrapper {
585
+ display: flex;
586
+ flex-wrap: wrap;
587
+ padding: 0 !important;
588
+ align-items: center;
589
+ width: 100%;
590
+ margin: 0 -8px;
591
+
592
+ .tag-col {
593
+ display: flex;
594
+ align-items: center;
595
+ padding: 0 8px;
596
+ min-height: 32px;
597
+ }
598
+
599
+ .tag-item {
600
+ width: auto;
601
+ text-align: left;
602
+ font-size: var(--van-font-size-xs);
603
+ display: flex;
604
+ align-items: center;
605
+ margin: 4px 0;
606
+ justify-content: center;
607
+ :deep(.van-tag) {
608
+ width: fit-content;
609
+ display: inline-flex;
610
+ align-items: center;
611
+ }
612
+ }
468
613
  }
469
614
  }
470
615
 
@@ -495,50 +640,35 @@ function addOption() {
495
640
  }
496
641
 
497
642
  .filter-condition {
643
+ display: flex;
644
+ align-items: center;
645
+ padding: 8px 12px;
646
+ background-color: #fff;
498
647
  :deep(.van-search) {
499
648
  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); // 使用与搜索框相同的内边距
649
+ background-color: transparent;
507
650
  }
508
651
  :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;
652
+ border-radius: 5px;
653
+ background-color: #f5f5f5;
654
+ padding: 4px 8px;
519
655
  }
520
-
521
- :deep(.van-dropdown-menu__title) {
522
- padding: 0;
656
+ :deep(.van-field__left-icon) {
657
+ color: #999;
523
658
  }
524
-
525
- :deep(.van-dropdown-menu__title--down:after) {
526
- display: none;
659
+ :deep(.van-cell) {
660
+ background-color: transparent;
527
661
  }
528
-
529
- :deep(.van-dropdown-menu__title:after) {
530
- display: none;
662
+ :deep(.van-field__control::placeholder) {
663
+ color: #999;
664
+ font-size: 14px;
531
665
  }
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) {
666
+ .search-icon {
539
667
  display: flex;
540
668
  align-items: center;
541
669
  justify-content: center;
670
+ height: 100%;
671
+ padding: var(--van-search-padding);
542
672
  }
543
673
  }
544
674
 
@@ -546,5 +676,31 @@ function addOption() {
546
676
  border: none !important;
547
677
  box-shadow: none !important;
548
678
  }
679
+
680
+ .more-button {
681
+ width: 24px;
682
+ height: 24px;
683
+ display: flex;
684
+ align-items: center;
685
+ justify-content: center;
686
+ color: #666;
687
+ cursor: pointer;
688
+ font-size: 20px;
689
+ background-color: #f7f8fa;
690
+ border-radius: 4px;
691
+ span {
692
+ line-height: 1;
693
+ margin-top: -2px;
694
+ }
695
+ &:active {
696
+ opacity: 0.7;
697
+ background-color: #ebedf0;
698
+ }
699
+ }
700
+ .action-btn {
701
+ min-width: 80px;
702
+ border-radius: 20px;
703
+ font-size: 14px;
704
+ }
549
705
  }
550
706
  </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);