@ebiz/designer-components 0.1.83 → 0.1.86
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,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="user-info" :class="{ 'user-info-loading': state.loading }">
|
|
2
|
+
<div class="user-info" :class="{ 'user-info-loading': state.loading }" @click="handleClick">
|
|
3
3
|
<div v-if="state.loading && showLoading" class="user-loading">
|
|
4
4
|
<div class="loading-avatar"></div>
|
|
5
5
|
<div class="loading-text"></div>
|
|
@@ -7,17 +7,13 @@
|
|
|
7
7
|
<div v-else class="user-content" :class="layout">
|
|
8
8
|
<!-- 头像 -->
|
|
9
9
|
<div class="user-avatar" :class="avatarSize">
|
|
10
|
-
<img
|
|
11
|
-
|
|
12
|
-
:src="state.userInfo.avatar"
|
|
13
|
-
:alt="state.userInfo.name || '用户头像'"
|
|
14
|
-
@error="handleAvatarError"
|
|
15
|
-
/>
|
|
10
|
+
<img v-if="state.userInfo?.avatar" :src="state.userInfo.avatar" :alt="state.userInfo.name || '用户头像'"
|
|
11
|
+
@error="handleAvatarError" />
|
|
16
12
|
<div v-else class="default-avatar">
|
|
17
13
|
{{ getAvatarText() }}
|
|
18
14
|
</div>
|
|
19
15
|
</div>
|
|
20
|
-
|
|
16
|
+
|
|
21
17
|
<!-- 用户信息 -->
|
|
22
18
|
<div class="user-details" v-if="showDetails">
|
|
23
19
|
<div class="user-name" :class="nameSize">
|
|
@@ -39,48 +35,48 @@ import * as vue from 'vue'
|
|
|
39
35
|
import { defineProps, defineEmits } from 'vue'
|
|
40
36
|
|
|
41
37
|
const props = defineProps({
|
|
42
|
-
userId: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: ''
|
|
38
|
+
userId: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ''
|
|
45
41
|
},
|
|
46
42
|
userInfo: {
|
|
47
43
|
type: Object,
|
|
48
44
|
default: null
|
|
49
45
|
},
|
|
50
|
-
layout: {
|
|
51
|
-
type: String,
|
|
46
|
+
layout: {
|
|
47
|
+
type: String,
|
|
52
48
|
default: 'horizontal', // horizontal, vertical
|
|
53
49
|
validator: (value) => ['horizontal', 'vertical'].includes(value)
|
|
54
50
|
},
|
|
55
|
-
avatarSize: {
|
|
56
|
-
type: String,
|
|
51
|
+
avatarSize: {
|
|
52
|
+
type: String,
|
|
57
53
|
default: 'medium', // small, medium, large
|
|
58
54
|
validator: (value) => ['small', 'medium', 'large'].includes(value)
|
|
59
55
|
},
|
|
60
|
-
nameSize: {
|
|
61
|
-
type: String,
|
|
56
|
+
nameSize: {
|
|
57
|
+
type: String,
|
|
62
58
|
default: 'normal', // small, normal, large
|
|
63
59
|
validator: (value) => ['small', 'normal', 'large'].includes(value)
|
|
64
60
|
},
|
|
65
|
-
showDetails: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: true
|
|
61
|
+
showDetails: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: true
|
|
68
64
|
},
|
|
69
|
-
showJobNumber: {
|
|
70
|
-
type: Boolean,
|
|
71
|
-
default: true
|
|
65
|
+
showJobNumber: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true
|
|
72
68
|
},
|
|
73
|
-
showDepartment: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: false
|
|
69
|
+
showDepartment: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
76
72
|
},
|
|
77
|
-
showLoading: {
|
|
78
|
-
type: Boolean,
|
|
79
|
-
default: false
|
|
73
|
+
showLoading: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
80
76
|
},
|
|
81
|
-
clickable: {
|
|
82
|
-
type: Boolean,
|
|
83
|
-
default: false
|
|
77
|
+
clickable: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: false
|
|
84
80
|
}
|
|
85
81
|
})
|
|
86
82
|
|
|
@@ -106,6 +102,16 @@ const state = vue.reactive({
|
|
|
106
102
|
error: null
|
|
107
103
|
})
|
|
108
104
|
|
|
105
|
+
import { wwJsSdk } from "../../index"
|
|
106
|
+
const handleClick = () => {
|
|
107
|
+
wwJsSdk((ww) => {
|
|
108
|
+
ww.openUserProfile({
|
|
109
|
+
type: 1,
|
|
110
|
+
userid: props.userInfo.jobNumber
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
|
|
109
115
|
// 获取头像文字(取姓名最后一个字符)
|
|
110
116
|
const getAvatarText = () => {
|
|
111
117
|
const name = state.userInfo?.name || props.userId || '?'
|
|
@@ -331,6 +337,7 @@ vue.watch(
|
|
|
331
337
|
0% {
|
|
332
338
|
background-position: 200% 0;
|
|
333
339
|
}
|
|
340
|
+
|
|
334
341
|
100% {
|
|
335
342
|
background-position: -200% 0;
|
|
336
343
|
}
|
|
@@ -340,4 +347,4 @@ vue.watch(
|
|
|
340
347
|
.user-content.vertical .user-details {
|
|
341
348
|
align-items: center;
|
|
342
349
|
}
|
|
343
|
-
</style>
|
|
350
|
+
</style>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div style="padding-bottom: 16px;">
|
|
4
4
|
<EbizTdesignCard v-if="showPageHeader || $slots.form" :bordered="false">
|
|
5
5
|
<EbizPageHeader v-if="showPageHeader"></EbizPageHeader>
|
|
6
|
-
<EbizDivider v-if="showPageHeader"></EbizDivider>
|
|
6
|
+
<EbizDivider v-if="showPageHeader && $slots.form"></EbizDivider>
|
|
7
7
|
|
|
8
8
|
<!-- 表单区域 -->
|
|
9
9
|
<ebiz-s-form v-if="$slots.form" v-model="formDataValue" ref="formRef" layout="inline" labelAlign="top"
|