af-mobile-client-vue3 1.6.19 → 1.6.21
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/.env +11 -11
- package/package.json +121 -121
- package/src/api/user/index.ts +50 -50
- package/src/components/common/MateChat/apiService.ts +310 -310
- package/src/components/data/OtherCharge/OtherChargeGroupModal.vue +542 -542
- package/src/components/data/UserDetail/api.ts +24 -24
- package/src/components/data/UserDetail/index.vue +660 -660
- package/src/components/data/XFormGroup/doc/UserForm.vue +102 -102
- package/src/components/data/step/index.vue +1975 -1975
- package/src/router/invoiceRoutes.ts +37 -37
- package/src/services/api/Login.ts +6 -6
- package/src/services/v3Api.ts +170 -170
- package/src/stores/modules/user.ts +441 -441
- package/src/types/platform.ts +194 -194
- package/src/utils/Storage.ts +124 -124
- package/src/utils/http/index.ts +228 -228
- package/src/utils/login/loginVerify.ts +317 -317
- package/src/views/SafeInspection/SecurityCertificate/AddDevice/index.vue +662 -661
- package/src/views/SafeInspection/SecurityCertificate/OverallHiddenDangers/index.vue +376 -376
- package/src/views/SafeInspection/SecurityCertificate/contractSign/index.vue +80 -80
- package/src/views/SafeInspection/SecurityCertificate/photoSignature/SignatureComponent/SignatureComponent.vue +285 -285
- package/src/views/SafeInspection/SecurityCertificate/photoSignature/index.vue +258 -258
- package/src/views/SafeInspection/SecurityCertificate/photoSignature/slots/QinHuaSignature.vue +82 -82
- package/src/views/SafeInspection/SecurityCertificate/slots/GasDevice.vue +132 -132
- package/src/views/SafeInspection/SecurityCertificate/userInfo/index.vue +1 -0
- package/src/views/SafeInspection/SecurityCertificate/userInfo/upaddress.vue +239 -239
- package/src/views/SafeInspection/SecurityFormItem/XMultiSelect/index.vue +194 -194
- package/src/views/SafeInspection/SecurityFormItem/XSignature/index.vue +68 -68
- package/src/views/SafeInspection/SecurityFormItem/index.vue +418 -418
- package/src/views/component/UserDetailView/UserDetailPage.vue +78 -78
- package/src/views/component/UserDetailView/index.vue +234 -234
- package/src/views/external/index.vue +158 -158
- package/src/views/user/employeeBinding/index.vue +392 -392
- package/src/views/user/register/index.vue +995 -995
- package/src/views/userRecords/AbnormalAlarmRecords.vue +21 -21
- package/src/views/userRecords/CardReplacementRecords.vue +21 -21
- package/src/views/userRecords/ChangeRecords.vue +19 -19
- package/src/views/userRecords/CommandViewRecords.vue +20 -20
- package/src/views/userRecords/GasCompensationRecords.vue +20 -20
- package/src/views/userRecords/GasPurchaseRecords.vue +19 -19
- package/src/views/userRecords/InstrumentCollectionRecords.vue +21 -21
- package/src/views/userRecords/MeterRecords.vue +20 -20
- package/src/views/userRecords/OperateRecords.vue +51 -51
- package/src/views/userRecords/OtherChargeRecords.vue +19 -19
- package/src/views/userRecords/PaymentRecords.vue +114 -114
- package/src/views/userRecords/PriceAdjustmentRecords.vue +19 -19
- package/src/views/userRecords/RepairRecords.vue +19 -19
- package/src/views/userRecords/ReplacementRecords.vue +19 -19
- package/src/views/userRecords/SafetyRecords.vue +19 -19
- package/src/views/userRecords/TransactionRecords.vue +21 -21
- package/src/views/userRecords/TransferGasRecords.vue +19 -19
- package/src/views/userRecords/TransferRecords.vue +19 -19
- package/vite.config.ts +121 -121
- package/certs/127.0.0.1+2-key.pem +0 -28
- package/certs/127.0.0.1+2.pem +0 -27
- package/mock/modules/prose.mock.ts.timestamp-1758877157774.mjs +0 -53
- package/mock/modules/user.mock.ts.timestamp-1758877157774.mjs +0 -97
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { RecordEntry } from '@af-mobile-client-vue3/components/data/UserDetail/recordEntries'
|
|
3
|
-
import type { BaseUser } from '@af-mobile-client-vue3/components/data/UserDetail/types'
|
|
4
|
-
import UserDetail from '@af-mobile-client-vue3/components/data/UserDetail/index.vue'
|
|
5
|
-
import { showToast, Dialog as VanDialog, NavBar as VanNavBar } from 'vant'
|
|
6
|
-
import { useRoute, useRouter } from 'vue-router'
|
|
7
|
-
|
|
8
|
-
const route = useRoute()
|
|
9
|
-
const router = useRouter()
|
|
10
|
-
|
|
11
|
-
// 从路由参数获取用户ID
|
|
12
|
-
const userInfoId = route.params.userInfoId as string
|
|
13
|
-
|
|
14
|
-
// 返回上一页
|
|
15
|
-
function handleBack() {
|
|
16
|
-
router.back()
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// 记录点击处理
|
|
20
|
-
function handleRecordClick(entry: RecordEntry, user: BaseUser) {
|
|
21
|
-
showToast(`点击了${entry.title},用户:${user.f_user_name}`)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// 业务办理点击处理
|
|
25
|
-
function handleBusinessClick(user: BaseUser) {
|
|
26
|
-
VanDialog.alert({
|
|
27
|
-
title: '业务办理',
|
|
28
|
-
message: `为用户 ${user.f_user_name}(${user.f_userinfo_code})办理业务`,
|
|
29
|
-
})
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// 打印处理
|
|
33
|
-
function handlePrint(user: BaseUser) {
|
|
34
|
-
showToast(`打印用户 ${user.f_user_name} 的档案`)
|
|
35
|
-
}
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<template>
|
|
39
|
-
<div class="user-detail-page">
|
|
40
|
-
<!-- 导航栏 -->
|
|
41
|
-
<VanNavBar
|
|
42
|
-
title="用户详情"
|
|
43
|
-
left-text="返回"
|
|
44
|
-
left-arrow
|
|
45
|
-
@click-left="handleBack"
|
|
46
|
-
/>
|
|
47
|
-
|
|
48
|
-
<!-- 用户详情组件 -->
|
|
49
|
-
<UserDetail
|
|
50
|
-
:user-info-id="userInfoId"
|
|
51
|
-
service-name="af-revenue"
|
|
52
|
-
:show-recent-time="true"
|
|
53
|
-
:show-bottom-buttons="true"
|
|
54
|
-
business-button-text="立即办理"
|
|
55
|
-
@record-click="handleRecordClick"
|
|
56
|
-
@business-click="handleBusinessClick"
|
|
57
|
-
@print="handlePrint"
|
|
58
|
-
/>
|
|
59
|
-
</div>
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<style scoped lang="less">
|
|
63
|
-
.user-detail-page {
|
|
64
|
-
height: 100vh;
|
|
65
|
-
display: flex;
|
|
66
|
-
flex-direction: column;
|
|
67
|
-
background-color: #f5f7fa;
|
|
68
|
-
|
|
69
|
-
.van-nav-bar {
|
|
70
|
-
flex-shrink: 0;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:deep(.user-detail) {
|
|
74
|
-
flex: 1;
|
|
75
|
-
overflow-y: auto;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { RecordEntry } from '@af-mobile-client-vue3/components/data/UserDetail/recordEntries'
|
|
3
|
+
import type { BaseUser } from '@af-mobile-client-vue3/components/data/UserDetail/types'
|
|
4
|
+
import UserDetail from '@af-mobile-client-vue3/components/data/UserDetail/index.vue'
|
|
5
|
+
import { showToast, Dialog as VanDialog, NavBar as VanNavBar } from 'vant'
|
|
6
|
+
import { useRoute, useRouter } from 'vue-router'
|
|
7
|
+
|
|
8
|
+
const route = useRoute()
|
|
9
|
+
const router = useRouter()
|
|
10
|
+
|
|
11
|
+
// 从路由参数获取用户ID
|
|
12
|
+
const userInfoId = route.params.userInfoId as string
|
|
13
|
+
|
|
14
|
+
// 返回上一页
|
|
15
|
+
function handleBack() {
|
|
16
|
+
router.back()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// 记录点击处理
|
|
20
|
+
function handleRecordClick(entry: RecordEntry, user: BaseUser) {
|
|
21
|
+
showToast(`点击了${entry.title},用户:${user.f_user_name}`)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// 业务办理点击处理
|
|
25
|
+
function handleBusinessClick(user: BaseUser) {
|
|
26
|
+
VanDialog.alert({
|
|
27
|
+
title: '业务办理',
|
|
28
|
+
message: `为用户 ${user.f_user_name}(${user.f_userinfo_code})办理业务`,
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 打印处理
|
|
33
|
+
function handlePrint(user: BaseUser) {
|
|
34
|
+
showToast(`打印用户 ${user.f_user_name} 的档案`)
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<div class="user-detail-page">
|
|
40
|
+
<!-- 导航栏 -->
|
|
41
|
+
<VanNavBar
|
|
42
|
+
title="用户详情"
|
|
43
|
+
left-text="返回"
|
|
44
|
+
left-arrow
|
|
45
|
+
@click-left="handleBack"
|
|
46
|
+
/>
|
|
47
|
+
|
|
48
|
+
<!-- 用户详情组件 -->
|
|
49
|
+
<UserDetail
|
|
50
|
+
:user-info-id="userInfoId"
|
|
51
|
+
service-name="af-revenue"
|
|
52
|
+
:show-recent-time="true"
|
|
53
|
+
:show-bottom-buttons="true"
|
|
54
|
+
business-button-text="立即办理"
|
|
55
|
+
@record-click="handleRecordClick"
|
|
56
|
+
@business-click="handleBusinessClick"
|
|
57
|
+
@print="handlePrint"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<style scoped lang="less">
|
|
63
|
+
.user-detail-page {
|
|
64
|
+
height: 100vh;
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
background-color: #f5f7fa;
|
|
68
|
+
|
|
69
|
+
.van-nav-bar {
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:deep(.user-detail) {
|
|
74
|
+
flex: 1;
|
|
75
|
+
overflow-y: auto;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -1,234 +1,234 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { BaseUser } from '@af-mobile-client-vue3/components/data/UserDetail/types'
|
|
3
|
-
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
-
import { Button as VanButton } from 'vant'
|
|
5
|
-
|
|
6
|
-
import { reactive } from 'vue'
|
|
7
|
-
import { useRouter } from 'vue-router'
|
|
8
|
-
|
|
9
|
-
const router = useRouter()
|
|
10
|
-
|
|
11
|
-
// 模拟用户数据
|
|
12
|
-
const mockUsers = reactive<BaseUser[]>([
|
|
13
|
-
{
|
|
14
|
-
f_userinfo_id: '96603',
|
|
15
|
-
f_userinfo_code: '0011059531',
|
|
16
|
-
f_user_name: '脱**试',
|
|
17
|
-
f_user_phone: '155****7852',
|
|
18
|
-
f_address: '凤凰岭街***12室',
|
|
19
|
-
f_user_state: '正常',
|
|
20
|
-
f_user_type: '非民用',
|
|
21
|
-
f_meter_type: '机表',
|
|
22
|
-
f_meternumber: '11',
|
|
23
|
-
f_balance: 144.98,
|
|
24
|
-
f_balance_amount: 0,
|
|
25
|
-
f_userfiles_id: '110919994',
|
|
26
|
-
f_times: 0,
|
|
27
|
-
f_total_gas: 0,
|
|
28
|
-
f_valve_state: null,
|
|
29
|
-
f_hascard: '是',
|
|
30
|
-
f_card_id: null,
|
|
31
|
-
},
|
|
32
|
-
])
|
|
33
|
-
|
|
34
|
-
// 切换用户 - 现在跳转到新路由
|
|
35
|
-
function switchUser() {
|
|
36
|
-
const user = mockUsers[0]
|
|
37
|
-
router.push({
|
|
38
|
-
name: 'UserDetailRoute',
|
|
39
|
-
params: { userInfoId: user.f_userinfo_id },
|
|
40
|
-
})
|
|
41
|
-
}
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<template>
|
|
45
|
-
<NormalDataLayout title="UserDetail 用户详情组件">
|
|
46
|
-
<template #layout_content>
|
|
47
|
-
<div class="demo-container">
|
|
48
|
-
<!-- 基础使用说明 -->
|
|
49
|
-
<div class="demo-section">
|
|
50
|
-
<h3>基础使用</h3>
|
|
51
|
-
<p>UserDetail 组件用于展示用户的详细信息,支持动态配置记录入口和交互功能。</p>
|
|
52
|
-
</div>
|
|
53
|
-
|
|
54
|
-
<!-- 用户选择器 -->
|
|
55
|
-
<div class="demo-section">
|
|
56
|
-
<h3>点击用户查看详情</h3>
|
|
57
|
-
<div class="user-selector">
|
|
58
|
-
<VanButton
|
|
59
|
-
size="small"
|
|
60
|
-
@click="switchUser()"
|
|
61
|
-
>
|
|
62
|
-
{{ mockUsers[0].f_user_name }}
|
|
63
|
-
<span class="user-status" :class="`status-${mockUsers[0].f_user_state}`">
|
|
64
|
-
{{ mockUsers[0].f_user_state }}
|
|
65
|
-
</span>
|
|
66
|
-
</VanButton>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
<!-- 功能特性说明 -->
|
|
71
|
-
<div class="demo-section">
|
|
72
|
-
<h3>组件特性</h3>
|
|
73
|
-
<ul class="feature-list">
|
|
74
|
-
<li>📋 用户基本信息展示与折叠</li>
|
|
75
|
-
<li>🔗 可配置的记录入口</li>
|
|
76
|
-
<li>⏰ 支持显示最近业务时间</li>
|
|
77
|
-
<li>🖨️ 内置打印功能</li>
|
|
78
|
-
<li>⚙️ 自定义 API 接口</li>
|
|
79
|
-
<li>🎨 多种用户状态样式</li>
|
|
80
|
-
</ul>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<!-- Props 说明 -->
|
|
84
|
-
<div class="demo-section">
|
|
85
|
-
<h3>主要 Props</h3>
|
|
86
|
-
<div class="props-table">
|
|
87
|
-
<div class="props-row">
|
|
88
|
-
<span class="prop-name">userInfoId</span>
|
|
89
|
-
<span class="prop-type">string</span>
|
|
90
|
-
<span class="prop-desc">用户ID(必传)</span>
|
|
91
|
-
</div>
|
|
92
|
-
<div class="props-row">
|
|
93
|
-
<span class="prop-name">showRecentTime</span>
|
|
94
|
-
<span class="prop-type">boolean</span>
|
|
95
|
-
<span class="prop-desc">是否展示历史时间</span>
|
|
96
|
-
</div>
|
|
97
|
-
<div class="props-row">
|
|
98
|
-
<span class="prop-name">recordEntries</span>
|
|
99
|
-
<span class="prop-type">RecordEntry[]</span>
|
|
100
|
-
<span class="prop-desc">记录入口配置</span>
|
|
101
|
-
</div>
|
|
102
|
-
<div class="props-row">
|
|
103
|
-
<span class="prop-name">showBottomButtons</span>
|
|
104
|
-
<span class="prop-type">boolean</span>
|
|
105
|
-
<span class="prop-desc">是否显示底部按钮区域</span>
|
|
106
|
-
</div>
|
|
107
|
-
<div class="props-row">
|
|
108
|
-
<span class="prop-name">showHeader</span>
|
|
109
|
-
<span class="prop-type">boolean</span>
|
|
110
|
-
<span class="prop-desc">是否显示头部导航栏</span>
|
|
111
|
-
</div>
|
|
112
|
-
<div class="props-row">
|
|
113
|
-
<span class="prop-name">headerTitle</span>
|
|
114
|
-
<span class="prop-type">string</span>
|
|
115
|
-
<span class="prop-desc">头部标题文本</span>
|
|
116
|
-
</div>
|
|
117
|
-
<div class="props-row">
|
|
118
|
-
<span class="prop-name">#bottom</span>
|
|
119
|
-
<span class="prop-type">slot</span>
|
|
120
|
-
<span class="prop-desc">底部插槽,可自定义按钮内容</span>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
</template>
|
|
126
|
-
</NormalDataLayout>
|
|
127
|
-
</template>
|
|
128
|
-
|
|
129
|
-
<style scoped lang="less">
|
|
130
|
-
.demo-container {
|
|
131
|
-
padding: 16px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.demo-section {
|
|
135
|
-
margin-bottom: 24px;
|
|
136
|
-
|
|
137
|
-
h3 {
|
|
138
|
-
margin: 0 0 12px 0;
|
|
139
|
-
font-size: 16px;
|
|
140
|
-
font-weight: 600;
|
|
141
|
-
color: #323233;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
p {
|
|
145
|
-
margin: 0 0 12px 0;
|
|
146
|
-
font-size: 14px;
|
|
147
|
-
color: #646566;
|
|
148
|
-
line-height: 1.5;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.user-selector {
|
|
153
|
-
display: flex;
|
|
154
|
-
gap: 8px;
|
|
155
|
-
flex-wrap: wrap;
|
|
156
|
-
|
|
157
|
-
.van-button {
|
|
158
|
-
display: flex;
|
|
159
|
-
align-items: center;
|
|
160
|
-
gap: 6px;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.user-status {
|
|
164
|
-
font-size: 12px;
|
|
165
|
-
padding: 1px 6px;
|
|
166
|
-
border-radius: 10px;
|
|
167
|
-
|
|
168
|
-
&.status-正常 {
|
|
169
|
-
background-color: #e6ffed;
|
|
170
|
-
color: #52c41a;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
&.status-欠费 {
|
|
174
|
-
background-color: #fff1f0;
|
|
175
|
-
color: #f5222d;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
&.status-暂停 {
|
|
179
|
-
background-color: #fff7e6;
|
|
180
|
-
color: #fa8c16;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.feature-list {
|
|
186
|
-
margin: 0;
|
|
187
|
-
padding-left: 20px;
|
|
188
|
-
|
|
189
|
-
li {
|
|
190
|
-
margin-bottom: 8px;
|
|
191
|
-
font-size: 14px;
|
|
192
|
-
color: #646566;
|
|
193
|
-
line-height: 1.5;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.props-table {
|
|
198
|
-
background-color: #f8f9fa;
|
|
199
|
-
border-radius: 8px;
|
|
200
|
-
padding: 12px;
|
|
201
|
-
|
|
202
|
-
.props-row {
|
|
203
|
-
display: flex;
|
|
204
|
-
align-items: center;
|
|
205
|
-
padding: 8px 0;
|
|
206
|
-
border-bottom: 1px solid #ebedf0;
|
|
207
|
-
|
|
208
|
-
&:last-child {
|
|
209
|
-
border-bottom: none;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.prop-name {
|
|
214
|
-
flex: 0 0 120px;
|
|
215
|
-
font-size: 13px;
|
|
216
|
-
font-weight: 600;
|
|
217
|
-
color: #1976d2;
|
|
218
|
-
font-family: 'Monaco', 'Consolas', monospace;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.prop-type {
|
|
222
|
-
flex: 0 0 80px;
|
|
223
|
-
font-size: 12px;
|
|
224
|
-
color: #e91e63;
|
|
225
|
-
font-family: 'Monaco', 'Consolas', monospace;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.prop-desc {
|
|
229
|
-
flex: 1;
|
|
230
|
-
font-size: 13px;
|
|
231
|
-
color: #646566;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { BaseUser } from '@af-mobile-client-vue3/components/data/UserDetail/types'
|
|
3
|
+
import NormalDataLayout from '@af-mobile-client-vue3/components/layout/NormalDataLayout/index.vue'
|
|
4
|
+
import { Button as VanButton } from 'vant'
|
|
5
|
+
|
|
6
|
+
import { reactive } from 'vue'
|
|
7
|
+
import { useRouter } from 'vue-router'
|
|
8
|
+
|
|
9
|
+
const router = useRouter()
|
|
10
|
+
|
|
11
|
+
// 模拟用户数据
|
|
12
|
+
const mockUsers = reactive<BaseUser[]>([
|
|
13
|
+
{
|
|
14
|
+
f_userinfo_id: '96603',
|
|
15
|
+
f_userinfo_code: '0011059531',
|
|
16
|
+
f_user_name: '脱**试',
|
|
17
|
+
f_user_phone: '155****7852',
|
|
18
|
+
f_address: '凤凰岭街***12室',
|
|
19
|
+
f_user_state: '正常',
|
|
20
|
+
f_user_type: '非民用',
|
|
21
|
+
f_meter_type: '机表',
|
|
22
|
+
f_meternumber: '11',
|
|
23
|
+
f_balance: 144.98,
|
|
24
|
+
f_balance_amount: 0,
|
|
25
|
+
f_userfiles_id: '110919994',
|
|
26
|
+
f_times: 0,
|
|
27
|
+
f_total_gas: 0,
|
|
28
|
+
f_valve_state: null,
|
|
29
|
+
f_hascard: '是',
|
|
30
|
+
f_card_id: null,
|
|
31
|
+
},
|
|
32
|
+
])
|
|
33
|
+
|
|
34
|
+
// 切换用户 - 现在跳转到新路由
|
|
35
|
+
function switchUser() {
|
|
36
|
+
const user = mockUsers[0]
|
|
37
|
+
router.push({
|
|
38
|
+
name: 'UserDetailRoute',
|
|
39
|
+
params: { userInfoId: user.f_userinfo_id },
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<NormalDataLayout title="UserDetail 用户详情组件">
|
|
46
|
+
<template #layout_content>
|
|
47
|
+
<div class="demo-container">
|
|
48
|
+
<!-- 基础使用说明 -->
|
|
49
|
+
<div class="demo-section">
|
|
50
|
+
<h3>基础使用</h3>
|
|
51
|
+
<p>UserDetail 组件用于展示用户的详细信息,支持动态配置记录入口和交互功能。</p>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<!-- 用户选择器 -->
|
|
55
|
+
<div class="demo-section">
|
|
56
|
+
<h3>点击用户查看详情</h3>
|
|
57
|
+
<div class="user-selector">
|
|
58
|
+
<VanButton
|
|
59
|
+
size="small"
|
|
60
|
+
@click="switchUser()"
|
|
61
|
+
>
|
|
62
|
+
{{ mockUsers[0].f_user_name }}
|
|
63
|
+
<span class="user-status" :class="`status-${mockUsers[0].f_user_state}`">
|
|
64
|
+
{{ mockUsers[0].f_user_state }}
|
|
65
|
+
</span>
|
|
66
|
+
</VanButton>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
<!-- 功能特性说明 -->
|
|
71
|
+
<div class="demo-section">
|
|
72
|
+
<h3>组件特性</h3>
|
|
73
|
+
<ul class="feature-list">
|
|
74
|
+
<li>📋 用户基本信息展示与折叠</li>
|
|
75
|
+
<li>🔗 可配置的记录入口</li>
|
|
76
|
+
<li>⏰ 支持显示最近业务时间</li>
|
|
77
|
+
<li>🖨️ 内置打印功能</li>
|
|
78
|
+
<li>⚙️ 自定义 API 接口</li>
|
|
79
|
+
<li>🎨 多种用户状态样式</li>
|
|
80
|
+
</ul>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<!-- Props 说明 -->
|
|
84
|
+
<div class="demo-section">
|
|
85
|
+
<h3>主要 Props</h3>
|
|
86
|
+
<div class="props-table">
|
|
87
|
+
<div class="props-row">
|
|
88
|
+
<span class="prop-name">userInfoId</span>
|
|
89
|
+
<span class="prop-type">string</span>
|
|
90
|
+
<span class="prop-desc">用户ID(必传)</span>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="props-row">
|
|
93
|
+
<span class="prop-name">showRecentTime</span>
|
|
94
|
+
<span class="prop-type">boolean</span>
|
|
95
|
+
<span class="prop-desc">是否展示历史时间</span>
|
|
96
|
+
</div>
|
|
97
|
+
<div class="props-row">
|
|
98
|
+
<span class="prop-name">recordEntries</span>
|
|
99
|
+
<span class="prop-type">RecordEntry[]</span>
|
|
100
|
+
<span class="prop-desc">记录入口配置</span>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="props-row">
|
|
103
|
+
<span class="prop-name">showBottomButtons</span>
|
|
104
|
+
<span class="prop-type">boolean</span>
|
|
105
|
+
<span class="prop-desc">是否显示底部按钮区域</span>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="props-row">
|
|
108
|
+
<span class="prop-name">showHeader</span>
|
|
109
|
+
<span class="prop-type">boolean</span>
|
|
110
|
+
<span class="prop-desc">是否显示头部导航栏</span>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="props-row">
|
|
113
|
+
<span class="prop-name">headerTitle</span>
|
|
114
|
+
<span class="prop-type">string</span>
|
|
115
|
+
<span class="prop-desc">头部标题文本</span>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="props-row">
|
|
118
|
+
<span class="prop-name">#bottom</span>
|
|
119
|
+
<span class="prop-type">slot</span>
|
|
120
|
+
<span class="prop-desc">底部插槽,可自定义按钮内容</span>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</template>
|
|
126
|
+
</NormalDataLayout>
|
|
127
|
+
</template>
|
|
128
|
+
|
|
129
|
+
<style scoped lang="less">
|
|
130
|
+
.demo-container {
|
|
131
|
+
padding: 16px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.demo-section {
|
|
135
|
+
margin-bottom: 24px;
|
|
136
|
+
|
|
137
|
+
h3 {
|
|
138
|
+
margin: 0 0 12px 0;
|
|
139
|
+
font-size: 16px;
|
|
140
|
+
font-weight: 600;
|
|
141
|
+
color: #323233;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
p {
|
|
145
|
+
margin: 0 0 12px 0;
|
|
146
|
+
font-size: 14px;
|
|
147
|
+
color: #646566;
|
|
148
|
+
line-height: 1.5;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.user-selector {
|
|
153
|
+
display: flex;
|
|
154
|
+
gap: 8px;
|
|
155
|
+
flex-wrap: wrap;
|
|
156
|
+
|
|
157
|
+
.van-button {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
gap: 6px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.user-status {
|
|
164
|
+
font-size: 12px;
|
|
165
|
+
padding: 1px 6px;
|
|
166
|
+
border-radius: 10px;
|
|
167
|
+
|
|
168
|
+
&.status-正常 {
|
|
169
|
+
background-color: #e6ffed;
|
|
170
|
+
color: #52c41a;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&.status-欠费 {
|
|
174
|
+
background-color: #fff1f0;
|
|
175
|
+
color: #f5222d;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&.status-暂停 {
|
|
179
|
+
background-color: #fff7e6;
|
|
180
|
+
color: #fa8c16;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.feature-list {
|
|
186
|
+
margin: 0;
|
|
187
|
+
padding-left: 20px;
|
|
188
|
+
|
|
189
|
+
li {
|
|
190
|
+
margin-bottom: 8px;
|
|
191
|
+
font-size: 14px;
|
|
192
|
+
color: #646566;
|
|
193
|
+
line-height: 1.5;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.props-table {
|
|
198
|
+
background-color: #f8f9fa;
|
|
199
|
+
border-radius: 8px;
|
|
200
|
+
padding: 12px;
|
|
201
|
+
|
|
202
|
+
.props-row {
|
|
203
|
+
display: flex;
|
|
204
|
+
align-items: center;
|
|
205
|
+
padding: 8px 0;
|
|
206
|
+
border-bottom: 1px solid #ebedf0;
|
|
207
|
+
|
|
208
|
+
&:last-child {
|
|
209
|
+
border-bottom: none;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.prop-name {
|
|
214
|
+
flex: 0 0 120px;
|
|
215
|
+
font-size: 13px;
|
|
216
|
+
font-weight: 600;
|
|
217
|
+
color: #1976d2;
|
|
218
|
+
font-family: 'Monaco', 'Consolas', monospace;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.prop-type {
|
|
222
|
+
flex: 0 0 80px;
|
|
223
|
+
font-size: 12px;
|
|
224
|
+
color: #e91e63;
|
|
225
|
+
font-family: 'Monaco', 'Consolas', monospace;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.prop-desc {
|
|
229
|
+
flex: 1;
|
|
230
|
+
font-size: 13px;
|
|
231
|
+
color: #646566;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
</style>
|