af-mobile-client-vue3 1.2.6 → 1.2.8
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
|
@@ -4,8 +4,8 @@ import { ref } from 'vue'
|
|
|
4
4
|
|
|
5
5
|
const { serviceName, dictName, dictValue } = withDefaults(defineProps<{
|
|
6
6
|
serviceName: string
|
|
7
|
-
dictName: string
|
|
8
|
-
dictValue: string
|
|
7
|
+
dictName: string | null | undefined
|
|
8
|
+
dictValue: string | null | undefined
|
|
9
9
|
}>(), {})
|
|
10
10
|
|
|
11
11
|
// 字面值
|
|
@@ -186,8 +186,8 @@ function initComponent() {
|
|
|
186
186
|
})
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
|
|
190
|
-
if (item.
|
|
189
|
+
console.log('item===', item)
|
|
190
|
+
if (item.btnIcon)
|
|
191
191
|
btnList.value.push(item)
|
|
192
192
|
|
|
193
193
|
if (result.showSortIcon && item.sortable) {
|
|
@@ -604,7 +604,7 @@ defineExpose({
|
|
|
604
604
|
<VanRow gutter="20" class="card_item_details" @click="emit('toDetail', item)">
|
|
605
605
|
<VanCol v-for="column of detailColumns" :key="`details_${column.dataIndex}`" :span="column.span">
|
|
606
606
|
<p>
|
|
607
|
-
{{ `${column.title}: ` }}
|
|
607
|
+
{{ `${column.showLabel ? `${column.title}: ` : ''}` }}
|
|
608
608
|
<XBadge
|
|
609
609
|
:style="handleFunctionStyle(column.styleFunctionForValue, item)"
|
|
610
610
|
:dict-name="column.dictName" :dict-value="item[column.dataIndex]"
|
|
@@ -629,7 +629,7 @@ defineExpose({
|
|
|
629
629
|
>
|
|
630
630
|
<div class="tag-content">
|
|
631
631
|
<VanIcon v-if="column.tagIcon" :name="column.tagIcon" class="tag-icon" />
|
|
632
|
-
<span class="tag-title">{{ column.title }}
|
|
632
|
+
<span class="tag-title">{{ `${column.showLabel ? `${column.title}: ` : ''}` }}</span>
|
|
633
633
|
<XBadge
|
|
634
634
|
:dict-name="column.dictName"
|
|
635
635
|
:dict-value="item[column.dataIndex]"
|
|
@@ -651,7 +651,7 @@ defineExpose({
|
|
|
651
651
|
<VanCol v-for="column of footColumns" :key="`foot_${column.dataIndex}`" :span="12">
|
|
652
652
|
<p>
|
|
653
653
|
<span :style="handleFunctionStyle(column.styleFunctionForTitle, item)">
|
|
654
|
-
{{ column.title }}
|
|
654
|
+
{{ `${column.showLabel ? `${column.title}: ` : ''}` }}
|
|
655
655
|
</span>
|
|
656
656
|
<XBadge
|
|
657
657
|
:style="handleFunctionStyle(column.styleFunctionForValue, item)"
|
|
@@ -718,6 +718,8 @@ defineExpose({
|
|
|
718
718
|
--van-search-padding: 3px;
|
|
719
719
|
--van-dropdown-menu-title-padding: 3px;
|
|
720
720
|
--van-cell-vertical-padding: 0px;
|
|
721
|
+
--van-text-color-2: rgb(75, 85, 99);
|
|
722
|
+
--van-button-normal-font-size: 13px;
|
|
721
723
|
.main {
|
|
722
724
|
flex: 1;
|
|
723
725
|
min-height: 0;
|
|
@@ -760,7 +762,7 @@ defineExpose({
|
|
|
760
762
|
align-items: center;
|
|
761
763
|
.card_item_title {
|
|
762
764
|
font-size: var(--van-font-size-lg);
|
|
763
|
-
font-weight:
|
|
765
|
+
font-weight: 700;
|
|
764
766
|
color: var(--van-text-color);
|
|
765
767
|
margin: 0;
|
|
766
768
|
}
|
|
@@ -771,9 +773,8 @@ defineExpose({
|
|
|
771
773
|
align-items: center;
|
|
772
774
|
margin-left: 8px;
|
|
773
775
|
.card_item_subtitle {
|
|
774
|
-
font-size: var(--van-font-size-
|
|
776
|
+
font-size: var(--van-font-size-md);
|
|
775
777
|
color: var(--van-text-color-2);
|
|
776
|
-
margin: 0;
|
|
777
778
|
}
|
|
778
779
|
}
|
|
779
780
|
|
|
@@ -790,7 +791,7 @@ defineExpose({
|
|
|
790
791
|
color: var(--van-primary-color);
|
|
791
792
|
background-color: rgba(25, 137, 250, 0.1);
|
|
792
793
|
border-radius: 6px;
|
|
793
|
-
font-size:
|
|
794
|
+
font-size: var(--van-font-size-lg);
|
|
794
795
|
display: flex;
|
|
795
796
|
align-items: center;
|
|
796
797
|
justify-content: center;
|
|
@@ -821,8 +822,8 @@ defineExpose({
|
|
|
821
822
|
|
|
822
823
|
.tag-item {
|
|
823
824
|
width: auto;
|
|
824
|
-
font-size: var(--van-font-size-
|
|
825
|
-
margin:
|
|
825
|
+
font-size: var(--van-font-size-sm);
|
|
826
|
+
margin: 4px 4px;
|
|
826
827
|
:deep(.van-tag) {
|
|
827
828
|
width: fit-content;
|
|
828
829
|
display: inline-flex;
|
|
@@ -849,9 +850,9 @@ defineExpose({
|
|
|
849
850
|
}
|
|
850
851
|
|
|
851
852
|
.card_item_details {
|
|
852
|
-
font-size: var(--van-font-size-
|
|
853
|
+
font-size: var(--van-font-size-md);
|
|
853
854
|
color: var(--van-text-color-2);
|
|
854
|
-
padding:
|
|
855
|
+
padding: 4px 0;
|
|
855
856
|
|
|
856
857
|
.van-col {
|
|
857
858
|
margin-bottom: 4px;
|
|
@@ -876,9 +877,9 @@ defineExpose({
|
|
|
876
877
|
}
|
|
877
878
|
|
|
878
879
|
.card_item_footer {
|
|
879
|
-
font-size: var(--van-font-size-
|
|
880
|
+
font-size: var(--van-font-size-md);
|
|
880
881
|
color: var(--van-text-color-2);
|
|
881
|
-
padding:
|
|
882
|
+
padding: 4px 0;
|
|
882
883
|
.van-col:last-child {
|
|
883
884
|
text-align: right;
|
|
884
885
|
}
|
|
@@ -888,8 +889,8 @@ defineExpose({
|
|
|
888
889
|
}
|
|
889
890
|
|
|
890
891
|
.card_item_bottom {
|
|
891
|
-
margin-top:
|
|
892
|
-
padding-top:
|
|
892
|
+
margin-top: 8px;
|
|
893
|
+
padding-top: 10px;
|
|
893
894
|
border-top: 1px solid rgba(0, 0, 0, 0.06);
|
|
894
895
|
|
|
895
896
|
.more-button {
|
|
@@ -900,7 +901,7 @@ defineExpose({
|
|
|
900
901
|
justify-content: center;
|
|
901
902
|
color: var(--van-text-color-2);
|
|
902
903
|
cursor: pointer;
|
|
903
|
-
font-size:
|
|
904
|
+
font-size: var(--van-font-size-lg);
|
|
904
905
|
background-color: var(--van-background);
|
|
905
906
|
border-radius: 6px;
|
|
906
907
|
transition: all 0.2s ease;
|
|
@@ -922,7 +923,7 @@ defineExpose({
|
|
|
922
923
|
min-width: 76px;
|
|
923
924
|
height: 40px;
|
|
924
925
|
border-radius: 10px;
|
|
925
|
-
font-size:
|
|
926
|
+
// font-size: var(--van-font-size-md);
|
|
926
927
|
transition: all 0.2s ease;
|
|
927
928
|
&:active {
|
|
928
929
|
transform: scale(0.95);
|
|
@@ -348,22 +348,22 @@ function handleCloseScanButton() {
|
|
|
348
348
|
<VanCol span="10">
|
|
349
349
|
排序字段
|
|
350
350
|
</VanCol>
|
|
351
|
-
<VanCol span="2">
|
|
351
|
+
<!-- <VanCol span="2">
|
|
352
352
|
<div class="reset-item" @click.stop="currentOrderVal = undefined">
|
|
353
353
|
重置
|
|
354
354
|
</div>
|
|
355
|
-
</VanCol>
|
|
355
|
+
</VanCol> -->
|
|
356
356
|
</VanRow>
|
|
357
357
|
<XGridDropOption :columns="props.orderList" :columns-field-names="colFieldNames" />
|
|
358
358
|
<VanRow justify="space-between" class="filter-title">
|
|
359
359
|
<VanCol span="10">
|
|
360
360
|
排序规则
|
|
361
361
|
</VanCol>
|
|
362
|
-
<VanCol span="2">
|
|
362
|
+
<!-- <VanCol span="2">
|
|
363
363
|
<div class="reset-item" @click.stop="currentSortordVal = undefined">
|
|
364
364
|
重置
|
|
365
365
|
</div>
|
|
366
|
-
</VanCol>
|
|
366
|
+
</VanCol> -->
|
|
367
367
|
</VanRow>
|
|
368
368
|
<XGridDropOption :columns="sortordList" :columns-field-names="colFieldNames" />
|
|
369
369
|
</template>
|
|
@@ -372,11 +372,11 @@ function handleCloseScanButton() {
|
|
|
372
372
|
<VanCol span="10">
|
|
373
373
|
{{ item.name }}
|
|
374
374
|
</VanCol>
|
|
375
|
-
<VanCol span="2">
|
|
375
|
+
<!-- <VanCol span="2">
|
|
376
376
|
<div class="reset-item" @click.stop="resetOptionItem(item.model)">
|
|
377
377
|
重置
|
|
378
378
|
</div>
|
|
379
|
-
</VanCol>
|
|
379
|
+
</VanCol> -->
|
|
380
380
|
</VanRow>
|
|
381
381
|
<XFormItem v-model="conditionParams[item.model]" :form="conditionParams" :attr="item" :service-name="props.serviceName" :show-label="false" />
|
|
382
382
|
</template>
|
|
@@ -400,6 +400,7 @@ function handleCloseScanButton() {
|
|
|
400
400
|
|
|
401
401
|
<style scoped lang="less">
|
|
402
402
|
#XCellListFilter {
|
|
403
|
+
--van-cell-horizontal-padding: 0;
|
|
403
404
|
width: 100%;
|
|
404
405
|
.filter-buttons {
|
|
405
406
|
display: flex;
|
|
@@ -490,7 +491,7 @@ function handleCloseScanButton() {
|
|
|
490
491
|
}
|
|
491
492
|
// 下拉菜单遮罩层
|
|
492
493
|
:deep(.van-overlay) {
|
|
493
|
-
z-index: 9
|
|
494
|
+
z-index: 9;
|
|
494
495
|
}
|
|
495
496
|
}
|
|
496
497
|
|
|
@@ -501,7 +502,7 @@ function handleCloseScanButton() {
|
|
|
501
502
|
width: 40px;
|
|
502
503
|
height: 40px;
|
|
503
504
|
border-radius: 10px;
|
|
504
|
-
background-color: rgba(245,245,245);
|
|
505
|
+
background-color: rgba(245, 245, 245);
|
|
505
506
|
cursor: pointer;
|
|
506
507
|
position: relative;
|
|
507
508
|
z-index: 1;
|
|
@@ -1,34 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import useRouteCache from '@af-mobile-client-vue3/stores/modules/routeCache'
|
|
3
|
-
import useRouteTransitionNameStore from '@af-mobile-client-vue3/stores/modules/routeTransitionName'
|
|
4
|
-
import { storeToRefs } from 'pinia'
|
|
5
|
-
import { computed } from 'vue'
|
|
6
|
-
|
|
7
|
-
const keepAliveRouteNames = computed(() => {
|
|
8
|
-
return useRouteCache().routeCaches as string[]
|
|
9
|
-
})
|
|
10
|
-
const routeTransitionNameStore = useRouteTransitionNameStore()
|
|
11
|
-
const { routeTransitionName } = storeToRefs(routeTransitionNameStore)
|
|
12
2
|
</script>
|
|
13
3
|
|
|
14
4
|
<template>
|
|
15
|
-
<div class="pageLayout"
|
|
16
|
-
<router-view v-slot="{ Component, route }">
|
|
17
|
-
<transition :name="routeTransitionName">
|
|
18
|
-
<keep-alive :include="keepAliveRouteNames">
|
|
19
|
-
<div :key="route.name" class="app-wrapper">
|
|
20
|
-
<component :is="Component" />
|
|
21
|
-
</div>
|
|
22
|
-
</keep-alive>
|
|
23
|
-
</transition>
|
|
24
|
-
</router-view>
|
|
25
|
-
</div>
|
|
5
|
+
<div class="pageLayout" />
|
|
26
6
|
</template>
|
|
27
7
|
|
|
28
8
|
<style lang="less" scoped>
|
|
29
|
-
.app-wrapper {
|
|
30
|
-
width: 100%;
|
|
31
|
-
height: 100%;
|
|
32
|
-
overflow-y: auto;
|
|
33
|
-
}
|
|
34
9
|
</style>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { mobileUtil } from './mobileUtil'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 批量安全存储数据到本地
|
|
5
|
+
* @param storageItems 要存储的数据项数组,每项格式为 {key: string, value: object}
|
|
6
|
+
*/
|
|
7
|
+
export function secureStorageBatchWrite(storageItems: Array<{ key: string, value: any }>) {
|
|
8
|
+
console.log('storageItems===', storageItems)
|
|
9
|
+
if (!Array.isArray(storageItems) || storageItems.length === 0)
|
|
10
|
+
return
|
|
11
|
+
|
|
12
|
+
for (const item of storageItems) {
|
|
13
|
+
try {
|
|
14
|
+
mobileUtil.execute({
|
|
15
|
+
funcName: 'secureStorageWrite',
|
|
16
|
+
param: {
|
|
17
|
+
key: item.key,
|
|
18
|
+
value: typeof item.value === 'string' ? item.value : JSON.stringify(item.value),
|
|
19
|
+
},
|
|
20
|
+
callbackFunc: () => {},
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
console.error(`写入本地缓存失败 [${item.key}]`, e)
|
|
25
|
+
// 单条失败跳过继续处理下一条
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 安全存储单个数据到本地
|
|
32
|
+
* @param key 存储键名
|
|
33
|
+
* @param value 存储值
|
|
34
|
+
* @param callback 可选回调函数
|
|
35
|
+
*/
|
|
36
|
+
export function secureStorageWrite(key: string, value: any, callback?: () => void) {
|
|
37
|
+
try {
|
|
38
|
+
mobileUtil.execute({
|
|
39
|
+
funcName: 'secureStorageWrite',
|
|
40
|
+
param: {
|
|
41
|
+
key,
|
|
42
|
+
value: typeof value === 'string' ? value : JSON.stringify(value),
|
|
43
|
+
},
|
|
44
|
+
callbackFunc: callback || (() => {}),
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
console.error(`写入本地缓存失败 [${key}]`, e)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 从安全存储读取数据
|
|
54
|
+
* @param key 存储键名
|
|
55
|
+
* @param callback 读取结果回调函数
|
|
56
|
+
*/
|
|
57
|
+
export function secureStorageRead(key: string, callback: (result: any) => void) {
|
|
58
|
+
try {
|
|
59
|
+
mobileUtil.execute({
|
|
60
|
+
funcName: 'secureStorageRead',
|
|
61
|
+
param: { key },
|
|
62
|
+
callbackFunc: (result: any) => {
|
|
63
|
+
callback(result)
|
|
64
|
+
},
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
console.error(`读取本地缓存失败 [${key}]`, e)
|
|
69
|
+
callback({ status: 'error', message: e })
|
|
70
|
+
}
|
|
71
|
+
}
|