af-mobile-client-vue3 1.3.5 → 1.3.6

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.3.5",
4
+ "version": "1.3.6",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -1,230 +1,336 @@
1
1
  <script setup lang="ts">
2
+ import useSettingStore from '@af-mobile-client-vue3/stores/modules/setting'
2
3
  import useUserStore from '@af-mobile-client-vue3/stores/modules/user'
3
- import {
4
- Cell as VanCell,
5
- Col as VanCol,
6
- List as VanList,
7
- Row as VanRow,
8
- } from 'vant/es'
4
+ import { ref } from 'vue'
5
+ import { useRouter } from 'vue-router'
6
+ import ModifyPassword from './comm/ModifyPassword.vue'
9
7
 
8
+ const router = useRouter()
10
9
  const username = useUserStore().getUserInfo().name
11
- const fullnames = useUserStore().getLogin().f.resources.parentname
10
+ const fullnames = useUserStore().getLogin().f.resources.fullnames
12
11
 
13
- async function exit_login() {
14
- await useUserStore().logout()
12
+ // 修改密码弹窗显示状态
13
+ const showModifyPassword = ref(false)
14
+ // 退出登录确认弹窗显示状态
15
+ const showLogoutConfirm = ref(false)
16
+
17
+ function exit_login() {
18
+ showLogoutConfirm.value = true
19
+ }
20
+
21
+ function confirmLogout() {
22
+ useUserStore().logout()
23
+ showLogoutConfirm.value = false
15
24
  }
25
+
26
+ function cancelLogout() {
27
+ showLogoutConfirm.value = false
28
+ }
29
+
30
+ function goToAttendance() {
31
+ router.push('/user/attendance')
32
+ }
33
+
34
+ function openModifyPassword() {
35
+ showModifyPassword.value = true
36
+ }
37
+
38
+ const webMobileConfig = useSettingStore().getSetting()
16
39
  </script>
17
40
 
18
41
  <template>
19
- <main class="my_main h-full w-full">
20
- <div class="header">
21
- <div class="style_back">
22
- <div class="circle circle1" />
23
- <div class="circle circle2" />
42
+ <main class="my_main">
43
+ <!-- 顶部导航栏 -->
44
+ <nav class="header_nav">
45
+ <div class="header_content">
46
+ <h1 class="main_title">
47
+ 我的
48
+ </h1>
49
+ <!-- <div class="setting_section"> -->
50
+ <!-- <van-icon name="setting-o" class="setting-icon" /> -->
51
+ <!-- </div> -->
24
52
  </div>
25
- <div class="header_main">
26
- <div class="user_nav">
27
- <img alt="setting_icon" class="user_setting_icon" src="../../../assets/img/user/my/setting.png">
28
- </div>
29
- <div class="user_content">
30
- <VanRow :gutter="18">
31
- <VanCol>
32
- <img alt="default-user-profile" class="default_user_profile" src="../../../assets/common/default-user-profile.png">
33
- </VanCol>
34
- <VanCol class="user_info_col">
35
- <p class="user_nickname">
36
- {{ username }}
37
- </p>
38
- <p class="user_remark">
39
- {{ fullnames }}
40
- </p>
41
- </VanCol>
42
- </VanRow>
43
- </div>
44
- </div>
45
- </div>
53
+ </nav>
54
+
55
+ <!-- 主要内容区域 -->
46
56
  <div class="content">
47
- <div class="core">
48
- <VanRow class="core_row">
49
- <VanCol>
50
- <p class="core_value">
51
- 24
57
+ <!-- 用户信息卡片 -->
58
+ <div class="user-card">
59
+ <div class="user-info">
60
+ <div class="avatar-wrap">
61
+ <img alt="default-user-profile" class="avatar" src="../../../assets/common/default-user-profile.png">
62
+ <div class="status-dot" />
63
+ </div>
64
+ <div class="user-detail">
65
+ <h2 class="username">
66
+ {{ username }}
67
+ </h2>
68
+ <p class="user-role">
69
+ {{ fullnames }}
52
70
  </p>
53
- <p class="core_title">
71
+ </div>
72
+ </div>
73
+ </div>
74
+
75
+ <!-- 工作统计 -->
76
+ <div class="stats-card">
77
+ <div class="stats-grid">
78
+ <div class="stat-item">
79
+ <div class="stat-value">
80
+ 0
81
+ </div>
82
+ <div class="stat-label">
54
83
  待办任务
55
- </p>
56
- </VanCol>
57
- <VanCol>
58
- <p class="core_value">
59
- 2
60
- </p>
61
- <p class="core_title">
84
+ </div>
85
+ </div>
86
+ <div class="stat-item">
87
+ <div class="stat-value">
88
+ 0
89
+ </div>
90
+ <div class="stat-label">
62
91
  待办流程
63
- </p>
64
- </VanCol>
65
- <VanCol>
66
- <p class="core_value">
67
- 7
68
- </p>
69
- <p class="core_title">
92
+ </div>
93
+ </div>
94
+ <div class="stat-item">
95
+ <div class="stat-value">
96
+ 0
97
+ </div>
98
+ <div class="stat-label">
70
99
  新消息
71
- </p>
72
- </VanCol>
73
- </VanRow>
100
+ </div>
101
+ </div>
102
+ </div>
74
103
  </div>
75
- <div class="setting">
76
- <VanList>
77
- <VanCell is-link @click="exit_login">
78
- <template #title>
79
- <VanRow :gutter="12" class="setting_row">
80
- <VanCol>
81
- <img alt="exit_login_icon" class="setting_icon" src="../../../assets/img/user/my/exit-login.png">
82
- </VanCol>
83
- <VanCol class="setting_name_col">
84
- <span class="setting_name_text">退出登录</span>
85
- </VanCol>
86
- </VanRow>
87
- </template>
88
- <template #right-icon>
89
- <img alt="setting_arrow_icon" class="setting_arrow_icon" src="../../../assets/img/user/my/setting-arrow.png">
90
- </template>
91
- </VanCell>
92
- </VanList>
104
+
105
+ <!-- 功能列表 -->
106
+ <div class="menu-card">
107
+ <div class="menu-section">
108
+ <h3 class="menu-title">
109
+ 系统功能
110
+ </h3>
111
+ <div class="menu-list">
112
+ <div v-if="webMobileConfig?.isAttendance" class="menu-item" @click="goToAttendance">
113
+ <div class="menu-item-content">
114
+ <van-icon name="user-o" class="menu-icon" />
115
+ <span class="menu-text">考勤管理</span>
116
+ </div>
117
+ <van-icon name="arrow" class="menu-arrow" />
118
+ </div>
119
+ <div class="menu-item" @click="openModifyPassword">
120
+ <div class="menu-item-content">
121
+ <van-icon name="lock" class="menu-icon" />
122
+ <span class="menu-text">修改密码</span>
123
+ </div>
124
+ <van-icon name="arrow" class="menu-arrow" />
125
+ </div>
126
+ <div class="menu-item" @click="exit_login">
127
+ <div class="menu-item-content">
128
+ <van-icon name="sign" class="menu-icon logout-icon" />
129
+ <span class="menu-text">退出登录</span>
130
+ </div>
131
+ <van-icon name="arrow" class="menu-arrow" />
132
+ </div>
133
+ </div>
134
+ </div>
93
135
  </div>
94
136
  </div>
137
+
138
+ <!-- 修改密码弹窗 -->
139
+ <ModifyPassword
140
+ v-model:visible="showModifyPassword"
141
+ />
142
+
143
+ <!-- 退出登录确认弹窗 -->
144
+ <van-dialog
145
+ v-model:show="showLogoutConfirm"
146
+ title="确认退出"
147
+ message="确定要退出登录吗?"
148
+ show-cancel-button
149
+ confirm-button-text="确认退出"
150
+ cancel-button-text="取消"
151
+ @confirm="confirmLogout"
152
+ @cancel="cancelLogout"
153
+ />
95
154
  </main>
96
155
  </template>
97
156
 
98
157
  <style scoped lang="less">
99
158
  .my_main {
100
- .header {
159
+ min-height: 100vh;
160
+ background-color: #f7f8fa;
161
+
162
+ // 顶部导航栏
163
+ .header_nav {
164
+ background-color: #fff;
165
+ padding: 0 16px;
166
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
101
167
  position: relative;
102
- height: 200px;
103
- background-color: #336bf1;
104
- overflow: hidden;
105
- .style_back {
106
- .circle {
107
- position: absolute;
108
- border-radius: 50%;
109
- }
110
- .circle1 {
111
- background-color: #3f7afa;
112
- width: 265px;
113
- height: 265px;
114
- top: -80px;
115
- left: -50px;
116
- z-index: 3;
117
- }
118
- .circle2 {
119
- background-color: #3c75f9;
120
- width: 300px;
121
- height: 300px;
122
- top: -80px;
123
- left: 10px;
124
- z-index: 2;
125
- }
126
- }
127
- .header_main {
128
- padding: var(--base-interval-1);
129
- .user_nav {
130
- padding: 0 var(--base-interval-0);
131
- color: #fff;
132
- position: relative;
133
- z-index: 4;
134
- font-size: 26px;
135
- text-align: right;
136
- .user_setting_icon {
137
- width: 26px;
138
- height: 26px;
139
- }
168
+ z-index: 50;
169
+
170
+ .header_content {
171
+ display: flex;
172
+ justify-content: space-between;
173
+ align-items: center;
174
+ height: 56px;
175
+
176
+ .main_title {
177
+ font-size: 1.25rem;
178
+ font-weight: 600;
179
+ color: #333;
180
+ margin: 0;
140
181
  }
141
- .user_content {
142
- padding: 0 35px 0 35px;
143
- color: #fff;
144
- position: relative;
145
- z-index: 4;
146
- .default_user_profile {
147
- border-radius: 50%;
148
- width: 76px;
149
- height: 76px;
150
- box-shadow:
151
- 0 10px 20px rgba(0, 0, 0, 0.05),
152
- 0 6px 6px rgba(0, 0, 0, 0.05);
153
- }
154
- .van-row {
155
- flex-wrap: nowrap;
156
- align-items: center;
157
- .user_info_col {
158
- flex-grow: 1;
159
- p {
160
- margin: 0;
161
- }
162
- .user_nickname {
163
- font-size: 20px;
164
- font-weight: bold;
165
- margin-bottom: 4px;
166
- }
167
- .user_remark {
168
- font-size: 14px;
169
- }
170
- }
182
+
183
+ .setting_section {
184
+ padding: 8px;
185
+ cursor: pointer;
186
+
187
+ .setting-icon {
188
+ font-size: 20px;
189
+ color: #666;
171
190
  }
172
191
  }
173
192
  }
174
193
  }
194
+
175
195
  .content {
176
- padding: var(--base-interval-1);
177
- .core {
178
- position: relative;
179
- bottom: 50px;
180
- padding: 16px 0;
196
+ padding: 16px;
197
+
198
+ // 用户信息卡片
199
+ .user-card {
181
200
  background-color: #fff;
182
- z-index: 4;
183
- margin: 0 16px;
184
- border-radius: 4px;
185
- box-shadow:
186
- 0 10px 20px rgba(0, 0, 0, 0.05),
187
- 0 6px 6px rgba(0, 0, 0, 0.05);
188
- .core_row {
189
- text-align: center;
190
- .van-col {
191
- flex-grow: 1;
192
- p {
193
- margin: 8px 0;
201
+ border-radius: 8px;
202
+ padding: 16px;
203
+ margin-bottom: 16px;
204
+
205
+ .user-info {
206
+ display: flex;
207
+ align-items: center;
208
+
209
+ .avatar-wrap {
210
+ position: relative;
211
+ margin-right: 16px;
212
+
213
+ .avatar {
214
+ width: 80px;
215
+ height: 80px;
216
+ border-radius: 50%;
217
+ object-fit: cover;
194
218
  }
195
- .core_value {
219
+
220
+ .status-dot {
221
+ position: absolute;
222
+ bottom: 2px;
223
+ right: 2px;
224
+ width: 16px;
225
+ height: 16px;
226
+ border-radius: 50%;
227
+ background-color: #10b981;
228
+ border: 2px solid #fff;
229
+ }
230
+ }
231
+
232
+ .user-detail {
233
+ .username {
196
234
  font-size: 20px;
197
- font-weight: bold;
235
+ font-weight: 600;
236
+ color: #333;
237
+ margin: 0 0 4px 0;
198
238
  }
199
- .core_title {
239
+
240
+ .user-role {
200
241
  font-size: 14px;
201
- color: #999;
242
+ color: #666;
243
+ margin: 0;
202
244
  }
203
245
  }
204
246
  }
205
247
  }
206
- .setting {
207
- .setting_row {
208
- align-items: center;
209
- .setting_icon {
210
- width: 28px;
211
- height: 28px;
212
- vertical-align: middle;
213
- }
214
- .setting_name_col {
215
- flex-grow: 1;
216
- .setting_name_text {
217
- font-size: 16px;
218
- font-weight: bold;
248
+
249
+ // 工作统计卡片
250
+ .stats-card {
251
+ background-color: #fff;
252
+ border-radius: 8px;
253
+ padding: 16px;
254
+ margin-bottom: 16px;
255
+
256
+ .stats-grid {
257
+ display: grid;
258
+ grid-template-columns: repeat(3, 1fr);
259
+ gap: 16px;
260
+ text-align: center;
261
+
262
+ .stat-item {
263
+ .stat-value {
264
+ font-size: 24px;
265
+ font-weight: 600;
266
+ color: #3b82f6;
267
+ margin-bottom: 4px;
268
+ }
269
+
270
+ .stat-label {
271
+ font-size: 14px;
272
+ color: #666;
219
273
  }
220
274
  }
221
275
  }
222
- .van-cell {
223
- align-items: center;
224
- .setting_arrow_icon {
225
- width: 12px;
226
- height: 12px;
227
- vertical-align: middle;
276
+ }
277
+
278
+ // 功能列表卡片
279
+ .menu-card {
280
+ background-color: #fff;
281
+ border-radius: 8px;
282
+ overflow: hidden;
283
+
284
+ .menu-section {
285
+ padding: 16px;
286
+
287
+ .menu-title {
288
+ font-size: 14px;
289
+ font-weight: 500;
290
+ color: #666;
291
+ margin-bottom: 12px;
292
+ }
293
+
294
+ .menu-list {
295
+ .menu-item {
296
+ display: flex;
297
+ align-items: center;
298
+ justify-content: space-between;
299
+ padding: 12px;
300
+ background-color: #f7f8fa;
301
+ border-radius: 8px;
302
+ margin-bottom: 8px;
303
+ cursor: pointer;
304
+
305
+ &:last-child {
306
+ margin-bottom: 0;
307
+ }
308
+
309
+ .menu-item-content {
310
+ display: flex;
311
+ align-items: center;
312
+ gap: 12px;
313
+
314
+ .menu-icon {
315
+ font-size: 24px;
316
+ color: #3b82f6;
317
+
318
+ &.logout-icon {
319
+ color: #ef4444;
320
+ }
321
+ }
322
+
323
+ .menu-text {
324
+ font-size: 16px;
325
+ color: #333;
326
+ }
327
+ }
328
+
329
+ .menu-arrow {
330
+ color: #999;
331
+ font-size: 16px;
332
+ }
333
+ }
228
334
  }
229
335
  }
230
336
  }