@titaui/pc 1.16.44 → 1.16.45-beta.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/lib/utils/editor.js +17 -7
- package/package.json +1 -1
package/lib/utils/editor.js
CHANGED
|
@@ -30,16 +30,21 @@ var appendUsers = function appendUsers(users) {
|
|
|
30
30
|
return (0, _flatten["default"])(users.map(function (_ref) {
|
|
31
31
|
var Name = _ref.Name,
|
|
32
32
|
Id = _ref.Id,
|
|
33
|
-
DepartmentName = _ref.DepartmentName
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
DepartmentName = _ref.DepartmentName,
|
|
34
|
+
_ref$type = _ref.type,
|
|
35
|
+
type = _ref$type === void 0 ? 'user' : _ref$type;
|
|
36
|
+
var mentionName = Name || DepartmentName;
|
|
36
37
|
return [{
|
|
37
38
|
type: 'mention',
|
|
38
39
|
attrs: {
|
|
39
40
|
mentionId: Id,
|
|
40
|
-
mentionName:
|
|
41
|
+
mentionName: mentionName,
|
|
41
42
|
mentionType: type
|
|
42
|
-
}
|
|
43
|
+
},
|
|
44
|
+
content: [{
|
|
45
|
+
type: 'text',
|
|
46
|
+
text: "@".concat(mentionName)
|
|
47
|
+
}]
|
|
43
48
|
}, {
|
|
44
49
|
type: 'text',
|
|
45
50
|
text: ' '
|
|
@@ -68,7 +73,11 @@ var appendUserSelectorData = function appendUserSelectorData(selectNodes) {
|
|
|
68
73
|
mentionId: id,
|
|
69
74
|
mentionName: title,
|
|
70
75
|
mentionType: userSelectTypeToEditorType(nodeType)
|
|
71
|
-
}
|
|
76
|
+
},
|
|
77
|
+
content: [{
|
|
78
|
+
type: 'text',
|
|
79
|
+
text: "@".concat(title)
|
|
80
|
+
}]
|
|
72
81
|
}, {
|
|
73
82
|
type: 'text',
|
|
74
83
|
text: ' '
|
|
@@ -100,7 +109,8 @@ var usersTypeToNumber = function usersTypeToNumber(mentionUsers) {
|
|
|
100
109
|
mentionType: {
|
|
101
110
|
user: UserTypeNumberEnum.User,
|
|
102
111
|
all_members: UserTypeNumberEnum.AllMembers,
|
|
103
|
-
department: UserTypeNumberEnum.Department
|
|
112
|
+
department: UserTypeNumberEnum.Department,
|
|
113
|
+
group: UserTypeNumberEnum.Group
|
|
104
114
|
}[user.mentionType]
|
|
105
115
|
});
|
|
106
116
|
});
|