af-mobile-client-vue3 1.3.1 → 1.3.2-2.1
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/CLAUDE.md +5 -0
- package/README.md +2 -1
- package/compress.js +36 -36
- package/package.json +114 -114
- package/postcss.config.ts +1 -1
- package/src/App.vue +1 -1
- package/src/components/core/NavBar/index.vue +1 -1
- package/src/components/core/XGridDropOption/index.vue +7 -9
- package/src/components/core/XMultiSelect/index.vue +1 -1
- package/src/components/data/CardContainer/CardContainer.vue +118 -0
- package/src/components/data/CardContainer/CardHeader.vue +99 -0
- package/src/components/data/InfoDisplay/index.vue +132 -0
- package/src/components/data/UserDetail/api.ts +24 -0
- package/src/components/data/UserDetail/index.vue +620 -0
- package/src/components/data/UserDetail/recordEntries.ts +159 -0
- package/src/components/data/UserDetail/types.ts +26 -0
- package/src/components/data/XCellList/index.vue +66 -20
- package/src/components/data/XForm/index.vue +1 -1
- package/src/components/data/XFormGroup/doc/README.md +33 -20
- package/src/components/data/XFormGroup/index.vue +42 -36
- package/src/components/data/XFormItem/index.vue +11 -11
- package/src/components/data/XOlMap/README.md +61 -61
- package/src/components/data/XOlMap/XLocationPicker/index.vue +2 -1
- package/src/components/data/XReportGrid/XAddReport/index.md +17 -16
- package/src/components/data/XReportGrid/index.md +14 -10
- package/src/components/data/XSignature/index.vue +1 -2
- package/src/font-style/font.css +1 -1
- package/src/hooks/useBoolean.ts +26 -0
- package/src/hooks/useLoading.ts +16 -0
- package/src/plugins/collectIcons.ts +10 -0
- package/src/router/README.md +1 -1
- package/src/router/guards.ts +1 -1
- package/src/router/index.ts +1 -1
- package/src/router/routes.ts +176 -0
- package/src/services/api/user.ts +17 -0
- package/src/stores/modules/setting.ts +2 -1
- package/src/styles/var.less +9 -0
- package/src/views/component/IconifyView/index.vue +0 -3
- package/src/views/component/UserDetailView/UserDetailPage.vue +77 -0
- package/src/views/component/UserDetailView/index.vue +234 -0
- package/src/views/component/XCellListView/index.vue +2 -2
- package/src/views/component/XOlMapView/testData.ts +1 -1
- package/src/views/component/index.vue +4 -0
- package/src/views/component/menu.vue +1 -1
- package/src/views/user/login/ForgetPasswordForm.vue +1 -1
- package/src/views/user/login/LoginForm.vue +4 -3
- package/src/views/user/login/LoginWave.vue +1 -1
- package/src/views/user/my/comm/ModifyPassword.vue +346 -0
- package/src/views/user/my/index.vue +440 -183
- package/src/views/user/register/index.vue +952 -0
- package/src/views/userRecords/AbnormalAlarmRecords.vue +21 -0
- package/src/views/userRecords/CardReplacementRecords.vue +21 -0
- package/src/views/userRecords/ChangeRecords.vue +19 -0
- package/src/views/userRecords/CommandViewRecords.vue +20 -0
- package/src/views/userRecords/GasCompensationRecords.vue +20 -0
- package/src/views/userRecords/InstrumentCollectionRecords.vue +21 -0
- package/src/views/userRecords/MeterRecords.vue +20 -0
- package/src/views/userRecords/OperateRecords.vue +51 -0
- package/src/views/userRecords/OtherChargeRecords.vue +19 -0
- package/src/views/userRecords/PaymentRecords.vue +28 -0
- package/src/views/userRecords/PriceAdjustmentRecords.vue +19 -0
- package/src/views/userRecords/ReplacementRecords.vue +19 -0
- package/src/views/userRecords/SafetyRecords.vue +19 -0
- package/src/views/userRecords/TransactionRecords.vue +21 -0
- package/src/views/userRecords/TransferRecords.vue +19 -0
- package/src/views/userRecords/operateRecordDetail/index.vue +316 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/AddUserDetail.vue +124 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/AdvanceDeliveryDetail.vue +88 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/AutoAccountsCancelDetail.vue +205 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/AutoAccountsDetail.vue +192 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/BankDkDetail.vue +192 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/BankPayDetail.vue +192 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/BlacklistDetail.vue +153 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/CancellationDetail.vue +101 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/CardMeterCenterCancelDetail.vue +127 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/CardMeterCenterDetail.vue +153 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/CardOverUserDetail.vue +153 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ChangeMeterCancelDetail.vue +166 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ChangeMeterDetail.vue +205 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/DisableManageDetail.vue +127 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/EnableManageDetail.vue +114 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/FaZheChangeDetail.vue +124 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/FeeDeductionDetail.vue +153 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/GasPriceChangeDetail.vue +126 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/InputtorChangeDetail.vue +126 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/IotMeterCenterCancelDetail.vue +114 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/IotMeterCenterDetail.vue +127 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/IotOpenDetail.vue +88 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/MachineCardDetail.vue +101 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/MachineMeterCenterCancelDetail.vue +218 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/MachineMeterCenterDetail.vue +153 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/OffGasAddGasDetail.vue +140 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/OtherChargeCancelDetail.vue +127 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/OtherChargeDetail.vue +114 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/OverUserChangeDetail.vue +127 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ReBillDetail.vue +127 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/RefundDetail.vue +114 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ReplaceCardManageCancelDetail.vue +127 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/ReplaceCardManageDetail.vue +114 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/SaleCardGasDetail.vue +140 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/TransferManageCancelDetail.vue +152 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/TransferManageDetail.vue +178 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/UserChangeDetail.vue +123 -0
- package/src/views/userRecords/operateRecordDetail/operateRecordDetails/WechatPayDetail.vue +192 -0
- package/src/views/userRecords/types.ts +66 -0
- package/uno.config.ts +5 -1
- package/vite.config.ts +9 -2
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// 记录入口默认配置
|
|
2
|
+
export interface RecordEntry {
|
|
3
|
+
id: string
|
|
4
|
+
title: string
|
|
5
|
+
icon: string
|
|
6
|
+
bgColor: string
|
|
7
|
+
textColor: string
|
|
8
|
+
dateLabel: string
|
|
9
|
+
route: string
|
|
10
|
+
path: string
|
|
11
|
+
forMeterTypes: string[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// 默认记录入口配置
|
|
15
|
+
export const defaultRecordEntries: RecordEntry[] = [
|
|
16
|
+
{
|
|
17
|
+
id: 'OperateRecords',
|
|
18
|
+
title: '操作记录',
|
|
19
|
+
icon: 'i-fa-solid-list',
|
|
20
|
+
bgColor: 'bg-gray-100',
|
|
21
|
+
textColor: 'text-gray-500',
|
|
22
|
+
dateLabel: '操作记录',
|
|
23
|
+
route: 'OperateRecords',
|
|
24
|
+
path: '/userRecords/operateRecords',
|
|
25
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'payment',
|
|
29
|
+
title: '缴费记录',
|
|
30
|
+
icon: 'i-fa6-solid-money-bill-wave',
|
|
31
|
+
bgColor: 'bg-blue-100',
|
|
32
|
+
textColor: 'text-blue-500',
|
|
33
|
+
dateLabel: '缴费',
|
|
34
|
+
route: 'PaymentRecords',
|
|
35
|
+
path: '/userRecords/payment',
|
|
36
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'meter',
|
|
40
|
+
title: '抄表记录',
|
|
41
|
+
icon: 'i-fa6-solid-chart-line',
|
|
42
|
+
bgColor: 'bg-green-100',
|
|
43
|
+
textColor: 'text-green-500',
|
|
44
|
+
dateLabel: '抄表',
|
|
45
|
+
route: 'MeterRecords',
|
|
46
|
+
path: '/userRecords/meter',
|
|
47
|
+
forMeterTypes: ['物联网表', '机表'],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'transfer',
|
|
51
|
+
title: '过户记录',
|
|
52
|
+
icon: 'i-fa-solid-exchange-alt',
|
|
53
|
+
bgColor: 'bg-purple-100',
|
|
54
|
+
textColor: 'text-purple-500',
|
|
55
|
+
dateLabel: '过户',
|
|
56
|
+
route: 'TransferRecords',
|
|
57
|
+
path: '/userRecords/transfer',
|
|
58
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'replacement',
|
|
62
|
+
title: '换表记录',
|
|
63
|
+
icon: 'i-fa-solid-sync-alt',
|
|
64
|
+
bgColor: 'bg-orange-100',
|
|
65
|
+
textColor: 'text-orange-500',
|
|
66
|
+
dateLabel: '换表',
|
|
67
|
+
route: 'ReplacementRecords',
|
|
68
|
+
path: '/userRecords/replacement',
|
|
69
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'otherCharge',
|
|
73
|
+
title: '其他收费记录',
|
|
74
|
+
icon: 'i-fa-solid-receipt',
|
|
75
|
+
bgColor: 'bg-indigo-100',
|
|
76
|
+
textColor: 'text-indigo-500',
|
|
77
|
+
dateLabel: '其他收费',
|
|
78
|
+
route: 'OtherChargeRecords',
|
|
79
|
+
path: '/userRecords/otherCharge',
|
|
80
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 'abnormalAlarm',
|
|
84
|
+
title: '异常报警记录',
|
|
85
|
+
icon: 'i-fa-solid-exclamation-triangle',
|
|
86
|
+
bgColor: 'bg-red-100',
|
|
87
|
+
textColor: 'text-red-500',
|
|
88
|
+
dateLabel: '异常报警',
|
|
89
|
+
route: 'AbnormalAlarmRecords',
|
|
90
|
+
path: '/userRecords/abnormalAlarm',
|
|
91
|
+
forMeterTypes: ['物联网表', '机表'],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: 'cardReplacement',
|
|
95
|
+
title: '补卡记录',
|
|
96
|
+
icon: 'i-fa-solid-sync-alt',
|
|
97
|
+
bgColor: 'bg-orange-100',
|
|
98
|
+
textColor: 'text-orange-500',
|
|
99
|
+
dateLabel: '补卡',
|
|
100
|
+
route: 'CardReplacementRecords',
|
|
101
|
+
path: '/userRecords/cardReplacement',
|
|
102
|
+
forMeterTypes: ['气量卡表', '金额卡表', '机表'],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'change',
|
|
106
|
+
title: '变更记录',
|
|
107
|
+
icon: 'i-fa-solid-exchange-alt',
|
|
108
|
+
bgColor: 'bg-purple-100',
|
|
109
|
+
textColor: 'text-purple-500',
|
|
110
|
+
dateLabel: '变更',
|
|
111
|
+
route: 'ChangeRecords',
|
|
112
|
+
path: '/userRecords/change',
|
|
113
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'commandView',
|
|
117
|
+
title: '指令查看记录',
|
|
118
|
+
icon: 'i-fa-solid-eye',
|
|
119
|
+
bgColor: 'bg-blue-100',
|
|
120
|
+
textColor: 'text-blue-500',
|
|
121
|
+
dateLabel: '指令查看',
|
|
122
|
+
route: 'CommandViewRecords',
|
|
123
|
+
path: '/userRecords/commandView',
|
|
124
|
+
forMeterTypes: ['物联网表', '机表'],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'gasCompensation',
|
|
128
|
+
title: '补气记录',
|
|
129
|
+
icon: 'i-fa-solid-plus',
|
|
130
|
+
bgColor: 'bg-green-100',
|
|
131
|
+
textColor: 'text-green-500',
|
|
132
|
+
dateLabel: '流水',
|
|
133
|
+
route: 'GasCompensationRecords',
|
|
134
|
+
path: '/userRecords/gasCompensation',
|
|
135
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: 'instrumentCollection',
|
|
139
|
+
title: '表具采集记录',
|
|
140
|
+
icon: 'i-fa-solid-list',
|
|
141
|
+
bgColor: 'bg-gray-100',
|
|
142
|
+
textColor: 'text-gray-500',
|
|
143
|
+
dateLabel: '表具采集',
|
|
144
|
+
route: 'InstrumentCollectionRecords',
|
|
145
|
+
path: '/userRecords/instrumentCollection',
|
|
146
|
+
forMeterTypes: ['物联网表', '机表'],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'priceAdjustment',
|
|
150
|
+
title: '价格调整记录',
|
|
151
|
+
icon: 'i-fa-solid-dollar-sign',
|
|
152
|
+
bgColor: 'bg-red-100',
|
|
153
|
+
textColor: 'text-red-500',
|
|
154
|
+
dateLabel: '价格调整',
|
|
155
|
+
route: 'PriceAdjustmentRecords',
|
|
156
|
+
path: '/userRecords/priceAdjustment',
|
|
157
|
+
forMeterTypes: ['气量卡表', '金额卡表', '物联网表', '机表'],
|
|
158
|
+
},
|
|
159
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// 通用用户类型定义
|
|
2
|
+
export interface BaseUser {
|
|
3
|
+
f_userinfo_id: string
|
|
4
|
+
f_userinfo_code: string
|
|
5
|
+
f_user_name: string
|
|
6
|
+
f_user_phone?: string
|
|
7
|
+
f_address?: string
|
|
8
|
+
f_user_state?: string
|
|
9
|
+
f_user_type?: string
|
|
10
|
+
f_meter_type?: string
|
|
11
|
+
f_meternumber?: string
|
|
12
|
+
f_balance?: number
|
|
13
|
+
f_balance_amount?: number
|
|
14
|
+
f_userfiles_id?: string
|
|
15
|
+
[key: string]: any // 允许扩展其他字段
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// 信息显示配置项
|
|
19
|
+
export interface ConfigItem {
|
|
20
|
+
label: string
|
|
21
|
+
field: string
|
|
22
|
+
full?: boolean
|
|
23
|
+
format?: (value: string | number) => string
|
|
24
|
+
template?: string
|
|
25
|
+
condition?: (data: any) => boolean
|
|
26
|
+
}
|
|
@@ -31,6 +31,8 @@ const {
|
|
|
31
31
|
scanOptions,
|
|
32
32
|
customAdd = false,
|
|
33
33
|
customEdit = false,
|
|
34
|
+
customDelete = false,
|
|
35
|
+
hideAllActions = false,
|
|
34
36
|
} = defineProps<{
|
|
35
37
|
configName?: string
|
|
36
38
|
fixQueryForm?: object
|
|
@@ -41,15 +43,18 @@ const {
|
|
|
41
43
|
type?: string | string[] // 显示类型:可以是单个类型或类型数组 'nfc' / ['scan', 'nfc']
|
|
42
44
|
defaultMode?: string // 默认模式
|
|
43
45
|
}
|
|
44
|
-
//
|
|
46
|
+
// 是否自定义新增、编辑、删除按钮
|
|
45
47
|
customAdd?: boolean
|
|
46
48
|
customEdit?: boolean
|
|
49
|
+
customDelete?: boolean
|
|
50
|
+
// 是否隐藏所有操作按钮
|
|
51
|
+
hideAllActions?: boolean
|
|
47
52
|
}>()
|
|
48
53
|
|
|
49
54
|
const emit = defineEmits<{
|
|
50
55
|
(e: 'toDetail', item: any): void
|
|
51
56
|
(e: 'update', item: any): void
|
|
52
|
-
(e: '
|
|
57
|
+
(e: 'delete', item: any): void
|
|
53
58
|
(e: 'add'): void
|
|
54
59
|
(e: string, item: any): void
|
|
55
60
|
(e: 'updateCondition', params: any): void
|
|
@@ -151,7 +156,7 @@ const currInst = getCurrentInstance()
|
|
|
151
156
|
|
|
152
157
|
// 列表底部的文字显示
|
|
153
158
|
function finishedBottomText() {
|
|
154
|
-
if (buttonState.value?.add && buttonState.value.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr))))))
|
|
159
|
+
if (!hideAllActions && buttonState.value?.add && buttonState.value.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr))))))
|
|
155
160
|
return '已加载全部内容,如需新增请点击右上角的 + 号'
|
|
156
161
|
else
|
|
157
162
|
return '已加载全部内容'
|
|
@@ -231,9 +236,9 @@ function initComponent() {
|
|
|
231
236
|
buttonState.value = result.buttonState
|
|
232
237
|
buttonPermissions.value = result.buttonPermissions
|
|
233
238
|
if (buttonState.value.edit && buttonState.value.edit === true && (filterButtonPermissions('edit').state === false || ((filterButtonPermissions('edit').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('edit').roleStr))))))
|
|
234
|
-
allActions.value.push({ text: '修改', func: '
|
|
239
|
+
allActions.value.push({ text: '修改', func: 'update' })
|
|
235
240
|
if (buttonState.value.delete && buttonState.value.delete === true && (filterButtonPermissions('delete').state === false || ((filterButtonPermissions('delete').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('delete').roleStr))))))
|
|
236
|
-
allActions.value.push({ text: '删除', func: '
|
|
241
|
+
allActions.value.push({ text: '删除', func: 'delete' })
|
|
237
242
|
}
|
|
238
243
|
splitArrayAt(allActions.value, 3)
|
|
239
244
|
|
|
@@ -426,14 +431,19 @@ const reversedMainActions = computed(() => {
|
|
|
426
431
|
// 设置 Popover 的事件
|
|
427
432
|
function onSelectMenu(item: any, event: any) {
|
|
428
433
|
if (event.text === '删除') {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
434
|
+
if (customDelete) {
|
|
435
|
+
emit('delete', item)
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
showConfirmDialog({
|
|
439
|
+
title: '删除',
|
|
440
|
+
message:
|
|
441
|
+
'请确认是否删除!!!',
|
|
442
|
+
}).then(() => {
|
|
443
|
+
emit(event.func, item)
|
|
444
|
+
}).catch(() => {
|
|
445
|
+
})
|
|
446
|
+
}
|
|
437
447
|
}
|
|
438
448
|
else if (event.text === '修改') {
|
|
439
449
|
if (customEdit) {
|
|
@@ -560,7 +570,7 @@ defineExpose({
|
|
|
560
570
|
/>
|
|
561
571
|
</VanCol>
|
|
562
572
|
<!-- 新增按钮,放在查询框后、查询条件下拉按钮前 -->
|
|
563
|
-
<VanCol v-if="buttonState?.add && buttonState.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr)))))" class="add-col">
|
|
573
|
+
<VanCol v-if="!hideAllActions && buttonState?.add && buttonState.add === true && (filterButtonPermissions('add').state === false || ((filterButtonPermissions('add').state === true && userState.f.resources.f_role_name.includes((filterButtonPermissions('add').roleStr)))))" class="add-col">
|
|
564
574
|
<VanButton
|
|
565
575
|
icon="add"
|
|
566
576
|
type="primary"
|
|
@@ -629,7 +639,7 @@ defineExpose({
|
|
|
629
639
|
/>
|
|
630
640
|
</p>
|
|
631
641
|
</div>
|
|
632
|
-
<div class="action-buttons">
|
|
642
|
+
<div v-if="!hideAllActions" class="action-buttons">
|
|
633
643
|
<VanButton
|
|
634
644
|
v-for="btn in btnList"
|
|
635
645
|
:key="btn.dataIndex"
|
|
@@ -704,14 +714,12 @@ defineExpose({
|
|
|
704
714
|
</VanRow>
|
|
705
715
|
<!-- 添加详情插槽 -->
|
|
706
716
|
<slot name="item-detail" :item="item" />
|
|
707
|
-
<VanRow v-if="allActions.length > 0" gutter="20" class="card_item_bottom">
|
|
717
|
+
<VanRow v-if="!hideAllActions && allActions.length > 0" gutter="20" class="card_item_bottom">
|
|
708
718
|
<VanCol span="4">
|
|
709
719
|
<VanPopover
|
|
710
720
|
v-if="getActionGroups(item, index).more.length"
|
|
711
721
|
v-model:show="showPopover[index]"
|
|
712
722
|
placement="bottom-start"
|
|
713
|
-
theme="dark"
|
|
714
|
-
overlay
|
|
715
723
|
:actions="getActionGroups(item, index).more"
|
|
716
724
|
@select="onSelectMenu(item, $event)"
|
|
717
725
|
>
|
|
@@ -934,8 +942,8 @@ defineExpose({
|
|
|
934
942
|
border-top: 1px solid rgba(0, 0, 0, 0.06);
|
|
935
943
|
|
|
936
944
|
.more-button {
|
|
937
|
-
width:
|
|
938
|
-
height:
|
|
945
|
+
width: 37px;
|
|
946
|
+
height: 37px;
|
|
939
947
|
display: flex;
|
|
940
948
|
align-items: center;
|
|
941
949
|
justify-content: center;
|
|
@@ -946,6 +954,7 @@ defineExpose({
|
|
|
946
954
|
border-radius: 6px;
|
|
947
955
|
transition: all 0.2s ease;
|
|
948
956
|
border: 1px solid rgba(0, 0, 0, 0.06);
|
|
957
|
+
margin: 2px 0 0 0;
|
|
949
958
|
span {
|
|
950
959
|
line-height: 1;
|
|
951
960
|
margin-top: -2px;
|
|
@@ -963,6 +972,7 @@ defineExpose({
|
|
|
963
972
|
min-width: 76px;
|
|
964
973
|
height: 40px;
|
|
965
974
|
border-radius: 10px;
|
|
975
|
+
padding: 0 14px;
|
|
966
976
|
// font-size: var(--van-font-size-md);
|
|
967
977
|
transition: all 0.2s ease;
|
|
968
978
|
&:active {
|
|
@@ -978,6 +988,42 @@ defineExpose({
|
|
|
978
988
|
height: 100%;
|
|
979
989
|
}
|
|
980
990
|
|
|
991
|
+
:deep(.van-popup),
|
|
992
|
+
:deep(.van-popover) {
|
|
993
|
+
border: none !important;
|
|
994
|
+
outline: none !important;
|
|
995
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
|
|
996
|
+
background-color: #ffffff !important;
|
|
997
|
+
|
|
998
|
+
&::before,
|
|
999
|
+
&::after {
|
|
1000
|
+
border: none !important;
|
|
1001
|
+
outline: none !important;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
.van-popover__content {
|
|
1005
|
+
background-color: #ffffff !important;
|
|
1006
|
+
border: none !important;
|
|
1007
|
+
outline: none !important;
|
|
1008
|
+
border-radius: 8px !important;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
.van-popover__arrow,
|
|
1012
|
+
.van-popover_arrow {
|
|
1013
|
+
background-color: #ffffff !important;
|
|
1014
|
+
border: none !important;
|
|
1015
|
+
outline: none !important;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
.van-popover__action {
|
|
1019
|
+
color: #333 !important;
|
|
1020
|
+
|
|
1021
|
+
&:hover {
|
|
1022
|
+
background-color: #f5f5f5 !important;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
981
1027
|
.filter-condition {
|
|
982
1028
|
display: flex;
|
|
983
1029
|
align-items: center;
|
|
@@ -208,7 +208,7 @@ async function initWithGroupFormItems() {
|
|
|
208
208
|
function setupFormConfig(config: GroupFormItems) {
|
|
209
209
|
loadParamLogicNameData(config.paramLogicName)
|
|
210
210
|
formConfig.value = config
|
|
211
|
-
myServiceName.value = props.serviceName
|
|
211
|
+
myServiceName.value = props.serviceName
|
|
212
212
|
formGroupName.value = config.groupName || 'default'
|
|
213
213
|
form.value = props.formData || {}
|
|
214
214
|
// 清理并重新设置验证规则
|
|
@@ -22,18 +22,21 @@ XFormGroup 是一个基于 Vue 3 + TypeScript + Vant 4 开发的表单组组件
|
|
|
22
22
|
## Props 参数详解
|
|
23
23
|
|
|
24
24
|
### configName
|
|
25
|
+
|
|
25
26
|
- **类型**: `string`
|
|
26
27
|
- **默认值**: `''`
|
|
27
28
|
- **说明**: 表单配置名称,用于从后端获取表单配置信息
|
|
28
29
|
- **示例**: `'appapplyuserinfoFormGroup'`
|
|
29
30
|
|
|
30
31
|
### serviceName
|
|
32
|
+
|
|
31
33
|
- **类型**: `string | undefined`
|
|
32
34
|
- **默认值**: `undefined`
|
|
33
35
|
- **说明**: 服务名称,用于指定后端服务
|
|
34
36
|
- **示例**: `'af-apply'`
|
|
35
37
|
|
|
36
38
|
### groupFormData
|
|
39
|
+
|
|
37
40
|
- **类型**: `object`
|
|
38
41
|
- **默认值**: `() => ({})`
|
|
39
42
|
- **说明**: 表单组数据,用于初始化表单数据
|
|
@@ -47,6 +50,7 @@ XFormGroup 是一个基于 Vue 3 + TypeScript + Vant 4 开发的表单组组件
|
|
|
47
50
|
```
|
|
48
51
|
|
|
49
52
|
### mode
|
|
53
|
+
|
|
50
54
|
- **类型**: `string`
|
|
51
55
|
- **默认值**: `'查询'`
|
|
52
56
|
- **说明**: `表单模式,控制表单的显示和操作模式`
|
|
@@ -136,7 +140,8 @@ async function submit() {
|
|
|
136
140
|
if (formInstance.formGroupName && typeof formInstance.getFormData === 'function') {
|
|
137
141
|
allFormData[formInstance.formGroupName] = formInstance.getFormData()
|
|
138
142
|
}
|
|
139
|
-
}
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
140
145
|
console.error('表单验证失败:', error)
|
|
141
146
|
return
|
|
142
147
|
}
|
|
@@ -164,9 +169,11 @@ async function submit() {
|
|
|
164
169
|
## 事件
|
|
165
170
|
|
|
166
171
|
### submit
|
|
172
|
+
|
|
167
173
|
- **参数**: `formData: object`
|
|
168
174
|
- **说明**: 表单提交事件,当用户点击提交按钮时触发
|
|
169
175
|
- **示例**:
|
|
176
|
+
|
|
170
177
|
```javascript
|
|
171
178
|
function handleSubmit(formData) {
|
|
172
179
|
console.log('表单数据:', formData)
|
|
@@ -177,42 +184,47 @@ function handleSubmit(formData) {
|
|
|
177
184
|
## 方法
|
|
178
185
|
|
|
179
186
|
### init(params: Form)
|
|
187
|
+
|
|
180
188
|
- **参数**: `params` - 初始化参数对象
|
|
181
189
|
- **说明**: 手动初始化组件,可以动态改变配置
|
|
182
190
|
- **示例**:
|
|
191
|
+
|
|
183
192
|
```javascript
|
|
184
193
|
formGroup.value.init({
|
|
185
194
|
configName: 'newConfig',
|
|
186
195
|
serviceName: 'newService',
|
|
187
|
-
groupFormData: { ... },
|
|
196
|
+
groupFormData: { ...any },
|
|
188
197
|
mode: '新增'
|
|
189
198
|
})
|
|
190
199
|
```
|
|
191
200
|
|
|
192
201
|
### setRef(refValue)
|
|
202
|
+
|
|
193
203
|
- **参数**: `refValue` - 表单实例
|
|
194
204
|
- **说明**: 注册表单实例到组件中,用于统一管理和提交
|
|
195
205
|
|
|
196
206
|
### removeRef(refValue)
|
|
207
|
+
|
|
197
208
|
- **参数**: `refValue` - 表单实例
|
|
198
209
|
- **说明**: 从组件中注销表单实例
|
|
199
210
|
|
|
200
211
|
## 配置结构说明
|
|
201
212
|
|
|
202
213
|
### 基础配置结构
|
|
203
|
-
|
|
214
|
+
|
|
215
|
+
```json
|
|
204
216
|
{
|
|
205
|
-
groups: [
|
|
217
|
+
"groups": [
|
|
206
218
|
{
|
|
207
219
|
"groupName": "userInfo",
|
|
208
220
|
"describe": "用户信息",
|
|
209
221
|
"tableName": "用户信息表",
|
|
210
|
-
"formGroupType": "form",
|
|
211
|
-
"slotName": "user",
|
|
222
|
+
"formGroupType": "form",
|
|
223
|
+
"slotName": "user",
|
|
212
224
|
"showSubmitBtn": false
|
|
213
225
|
},
|
|
214
226
|
{
|
|
215
|
-
"groupName": "deviceInfo",
|
|
227
|
+
"groupName": "deviceInfo",
|
|
216
228
|
"describe": "设备信息",
|
|
217
229
|
"tableName": "设备信息表",
|
|
218
230
|
"formGroupType": "slot",
|
|
@@ -220,20 +232,20 @@ formGroup.value.init({
|
|
|
220
232
|
"showSubmitBtn": true
|
|
221
233
|
}
|
|
222
234
|
],
|
|
223
|
-
|
|
235
|
+
"showSubmitBtn": true
|
|
224
236
|
}
|
|
225
237
|
```
|
|
226
238
|
|
|
227
239
|
### 配置项说明
|
|
228
240
|
|
|
229
|
-
| 字段名
|
|
230
|
-
|
|
231
|
-
| groupName
|
|
232
|
-
| describe
|
|
233
|
-
| tableName
|
|
234
|
-
| formGroupType | string
|
|
235
|
-
| slotName
|
|
236
|
-
| showSubmitBtn | boolean | 是否显示提交按钮
|
|
241
|
+
| 字段名 | 类型 | 说明 |
|
|
242
|
+
| ------------- | ------- | ------------------------------------------- |
|
|
243
|
+
| groupName | string | 分组名称,用于数据分组 |
|
|
244
|
+
| describe | string | 标签页显示标题 |
|
|
245
|
+
| tableName | string | 表名,当 describe 为空时作为标题 |
|
|
246
|
+
| formGroupType | string | 表单类型,'form' 为普通表单,'slot' 为插槽 |
|
|
247
|
+
| slotName | string | 插槽名称,当 formGroupType 为 'slot' 时使用 |
|
|
248
|
+
| showSubmitBtn | boolean | 是否显示提交按钮 |
|
|
237
249
|
|
|
238
250
|
## 样式定制
|
|
239
251
|
|
|
@@ -243,16 +255,16 @@ formGroup.value.init({
|
|
|
243
255
|
#x-form-group {
|
|
244
256
|
background-color: #f7f8fa;
|
|
245
257
|
padding-bottom: 10px;
|
|
246
|
-
|
|
258
|
+
|
|
247
259
|
.x-form-group-item {
|
|
248
260
|
margin: 20px 0;
|
|
249
261
|
}
|
|
250
|
-
|
|
262
|
+
|
|
251
263
|
// 自定义标签页样式
|
|
252
264
|
:deep(.van-tabs__nav) {
|
|
253
265
|
background-color: #fff;
|
|
254
266
|
}
|
|
255
|
-
|
|
267
|
+
|
|
256
268
|
// 自定义按钮样式
|
|
257
269
|
:deep(.van-button--primary) {
|
|
258
270
|
background-color: #1989fa;
|
|
@@ -270,4 +282,5 @@ formGroup.value.init({
|
|
|
270
282
|
|
|
271
283
|
```
|
|
272
284
|
|
|
273
|
-
## 这个文档详细介绍了 XFormGroup 组件的使用方法,特别是插槽的使用方式和各个参数的详细说明。开发者可以根据这个文档快速上手使用该组件。
|
|
285
|
+
## 这个文档详细介绍了 XFormGroup 组件的使用方法,特别是插槽的使用方式和各个参数的详细说明。开发者可以根据这个文档快速上手使用该组件。
|
|
286
|
+
```
|