@jx3box/jx3box-common-ui 5.1.0 → 5.1.4
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 +1 -1
- package/service/author.js +1 -1
- package/src/App.vue +12 -2
- package/src/author/UserPop.vue +124 -0
- package/src/header/user.vue +1 -1
- package/src/single/Collection.vue +3 -0
- package/src/single/Creators.vue +6 -2
package/package.json
CHANGED
package/service/author.js
CHANGED
package/src/App.vue
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
|
|
25
25
|
<Creators :postId="28" style="margin-bottom:10px"/>
|
|
26
26
|
<Collection :id="59" :defaultVisible="true"/>
|
|
27
|
+
<UserPop title="添加用户" v-model="visible" @confirm="addUser"/>
|
|
28
|
+
<el-button @click="visible = true">用户POP</el-button>
|
|
27
29
|
|
|
28
30
|
<Thx :postId="23865" postType="bbs" :userId="7" :adminBoxcoinEnable="true" :userBoxcoinEnable="true"/>
|
|
29
31
|
|
|
@@ -94,6 +96,7 @@ import Breadcrumb from "./Breadcrumb.vue";
|
|
|
94
96
|
import LeftSidebar from "./LeftSidebar.vue";
|
|
95
97
|
import LeftSideToggle from "./LeftSideToggle.vue";
|
|
96
98
|
import Author from "./Author.vue";
|
|
99
|
+
import UserPop from "./author/UserPop.vue";
|
|
97
100
|
|
|
98
101
|
import Main from "./Main.vue";
|
|
99
102
|
import RightSidebar from "./RightSidebar.vue";
|
|
@@ -170,12 +173,15 @@ export default {
|
|
|
170
173
|
WikiPanel,
|
|
171
174
|
WikiRevisions,
|
|
172
175
|
WikiComments,
|
|
176
|
+
|
|
177
|
+
UserPop
|
|
173
178
|
},
|
|
174
179
|
data: function() {
|
|
175
180
|
return {
|
|
176
181
|
author: "",
|
|
177
182
|
wikiPost: null,
|
|
178
|
-
tag : ''
|
|
183
|
+
tag : '',
|
|
184
|
+
visible : false,
|
|
179
185
|
};
|
|
180
186
|
},
|
|
181
187
|
created: function() {
|
|
@@ -186,6 +192,10 @@ export default {
|
|
|
186
192
|
}
|
|
187
193
|
);
|
|
188
194
|
},
|
|
189
|
-
methods: {
|
|
195
|
+
methods: {
|
|
196
|
+
addUser : function (val){
|
|
197
|
+
console.log(val)
|
|
198
|
+
}
|
|
199
|
+
},
|
|
190
200
|
};
|
|
191
201
|
</script>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
class="w-userpop"
|
|
4
|
+
:title="title"
|
|
5
|
+
:visible.sync="visible"
|
|
6
|
+
:close-on-click-modal="false"
|
|
7
|
+
:close-on-press-escape="false"
|
|
8
|
+
>
|
|
9
|
+
<div class="u-tip">
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="u-input">
|
|
13
|
+
<el-input v-model.number="uid" placeholder="请输入UID(数字)"></el-input>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="u-preview">
|
|
16
|
+
<img class="u-avatar" :src="userdata.user_avatar | showAvatar" />
|
|
17
|
+
<span class="u-name">{{ userdata.display_name || "-" }}</span>
|
|
18
|
+
</div>
|
|
19
|
+
<span slot="footer" class="dialog-footer">
|
|
20
|
+
<el-button @click="visible = false">取 消</el-button>
|
|
21
|
+
<el-button type="primary" @click="confirm">确 定</el-button>
|
|
22
|
+
</span>
|
|
23
|
+
</el-dialog>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import { showAvatar } from "@jx3box/jx3box-common/js/utils";
|
|
28
|
+
import { getUserInfo } from "../../service/author";
|
|
29
|
+
export default {
|
|
30
|
+
name: "userpop",
|
|
31
|
+
props: ["title", "show"],
|
|
32
|
+
data: function () {
|
|
33
|
+
return {
|
|
34
|
+
visible: false,
|
|
35
|
+
uid: "",
|
|
36
|
+
userdata: {
|
|
37
|
+
name: "",
|
|
38
|
+
avatar: "",
|
|
39
|
+
},
|
|
40
|
+
status: false,
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
model: {
|
|
44
|
+
prop: "show",
|
|
45
|
+
event: "switchUserPop",
|
|
46
|
+
},
|
|
47
|
+
watch: {
|
|
48
|
+
uid: function (newval) {
|
|
49
|
+
getUserInfo(newval).then((data) => {
|
|
50
|
+
if (data) {
|
|
51
|
+
this.status = true;
|
|
52
|
+
this.userdata = data;
|
|
53
|
+
} else {
|
|
54
|
+
this.status = false;
|
|
55
|
+
this.userdata = {
|
|
56
|
+
name: "",
|
|
57
|
+
avatar: "",
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
show: function (newval) {
|
|
63
|
+
this.visible = newval;
|
|
64
|
+
},
|
|
65
|
+
visible: function (newval) {
|
|
66
|
+
this.$emit("switchUserPop", newval);
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
filters: {
|
|
70
|
+
showAvatar: function (val) {
|
|
71
|
+
return showAvatar(val, "l");
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
computed: {},
|
|
75
|
+
methods: {
|
|
76
|
+
confirm: function () {
|
|
77
|
+
if (this.status) {
|
|
78
|
+
this.visible = false;
|
|
79
|
+
this.$emit("confirm", this.userdata);
|
|
80
|
+
} else {
|
|
81
|
+
this.$alert("用户不存在 或 UID不正确", "提醒", {
|
|
82
|
+
confirmButtonText: "确定",
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
mounted: function () {},
|
|
88
|
+
components: {},
|
|
89
|
+
};
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<style lang="less">
|
|
93
|
+
.w-userpop {
|
|
94
|
+
.fz(1rem, 2.5);
|
|
95
|
+
.el-dialog {
|
|
96
|
+
min-width: 520px;
|
|
97
|
+
}
|
|
98
|
+
.el-dialog__body {
|
|
99
|
+
padding: 0 20px;
|
|
100
|
+
}
|
|
101
|
+
.u-avatar {
|
|
102
|
+
.mt(20px);
|
|
103
|
+
.size(120px);
|
|
104
|
+
.db;
|
|
105
|
+
.auto(x);
|
|
106
|
+
border: 1px solid #eee;
|
|
107
|
+
padding: 5px;
|
|
108
|
+
}
|
|
109
|
+
.u-name {
|
|
110
|
+
.bold;
|
|
111
|
+
.x;
|
|
112
|
+
.db;
|
|
113
|
+
}
|
|
114
|
+
.u-tip {
|
|
115
|
+
.fz(13px);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media screen and (max-width: @phone) {
|
|
120
|
+
.w-userpop .el-dialog {
|
|
121
|
+
.w(100%) !important;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</style>
|
package/src/header/user.vue
CHANGED
package/src/single/Creators.vue
CHANGED
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
:key="i"
|
|
19
19
|
:href="item.post_author_info.ID | authorLink"
|
|
20
20
|
target="_blank"
|
|
21
|
+
v-show="item.status"
|
|
21
22
|
>
|
|
22
23
|
<img class="u-avatar" :src="item.post_author_info.user_avatar | showAvatar" />
|
|
23
24
|
<span class="u-name">{{item.post_author_info.display_name}}</span>
|
|
24
|
-
<i class="u-label">{{item.label}}</i>
|
|
25
|
+
<i class="u-label">{{item.label | formatLabel}}</i>
|
|
25
26
|
</a>
|
|
26
27
|
</div>
|
|
27
28
|
<a class="w-creators-edit" :href="editLink" v-if="isCreator">
|
|
@@ -91,6 +92,9 @@ export default {
|
|
|
91
92
|
return showAvatar(val, 48);
|
|
92
93
|
},
|
|
93
94
|
authorLink,
|
|
95
|
+
formatLabel : function (str){
|
|
96
|
+
return str && str.slice(0,8)
|
|
97
|
+
}
|
|
94
98
|
},
|
|
95
99
|
created: function () {},
|
|
96
100
|
mounted: function () {},
|
|
@@ -114,7 +118,7 @@ export default {
|
|
|
114
118
|
.lt(0);
|
|
115
119
|
writing-mode: vertical-rl;
|
|
116
120
|
.fz(12px);
|
|
117
|
-
background:
|
|
121
|
+
background: @primary;
|
|
118
122
|
color: #fff;
|
|
119
123
|
.h(100%);
|
|
120
124
|
.x;
|