@jx3box/jx3box-common-ui 6.0.4 → 6.0.7
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-common-ui",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.7",
|
|
4
4
|
"description": "JX3BOX UI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@jx3box/jx3box-comment-ui": "^1.7.0",
|
|
34
|
-
"@jx3box/jx3box-common": "^7.3.
|
|
35
|
-
"@jx3box/jx3box-data": "^1.10.
|
|
36
|
-
"@jx3box/jx3box-editor": "^1.4.
|
|
34
|
+
"@jx3box/jx3box-common": "^7.3.11",
|
|
35
|
+
"@jx3box/jx3box-data": "^1.10.6",
|
|
36
|
+
"@jx3box/jx3box-editor": "^1.4.4",
|
|
37
37
|
"axios": "^0.26.1",
|
|
38
38
|
"dayjs": "^1.11.0",
|
|
39
39
|
"element-ui": "^2.13.2",
|
package/src/Breadcrumb.vue
CHANGED
|
@@ -77,12 +77,7 @@ export default {
|
|
|
77
77
|
data: function () {
|
|
78
78
|
return {
|
|
79
79
|
isOpen: true,
|
|
80
|
-
feedback:
|
|
81
|
-
feedback +
|
|
82
|
-
"&subject=" +
|
|
83
|
-
location.href +
|
|
84
|
-
"?uid=" +
|
|
85
|
-
User.getInfo().uid,
|
|
80
|
+
feedback: '/feedback?refer=' + encodeURIComponent(window.location.href),
|
|
86
81
|
isNotAdmin: !User.isEditor(),
|
|
87
82
|
isOverlay: false,
|
|
88
83
|
isApp: isApp(),
|
|
@@ -59,6 +59,7 @@ import Article from "@jx3box/jx3box-editor/src/Article.vue";
|
|
|
59
59
|
import ArticleMarkdown from "@jx3box/jx3box-editor/src/ArticleMarkdown.vue";
|
|
60
60
|
import Comment from "@jx3box/jx3box-comment-ui/src/Comment.vue";
|
|
61
61
|
import { __visibleMap } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
62
|
+
import { getAppType } from '@jx3box/jx3box-common/js/utils'
|
|
62
63
|
export default {
|
|
63
64
|
name: "cms-single",
|
|
64
65
|
components: {
|
|
@@ -85,6 +86,9 @@ export default {
|
|
|
85
86
|
id: function() {
|
|
86
87
|
return ~~this.post?.ID || 0;
|
|
87
88
|
},
|
|
89
|
+
app_type: function() {
|
|
90
|
+
return getAppType();
|
|
91
|
+
},
|
|
88
92
|
post_type: function() {
|
|
89
93
|
return this.post?.post_type;
|
|
90
94
|
},
|
|
@@ -157,6 +161,15 @@ export default {
|
|
|
157
161
|
handler : function (val){
|
|
158
162
|
this.$emit('extendUpdate',val)
|
|
159
163
|
}
|
|
164
|
+
},
|
|
165
|
+
post_type: {
|
|
166
|
+
deep : true,
|
|
167
|
+
immediate : true,
|
|
168
|
+
handler : function (val){
|
|
169
|
+
if (val && val !== this.app_type) {
|
|
170
|
+
location.href = `/${val}/${this.id}`
|
|
171
|
+
}
|
|
172
|
+
}
|
|
160
173
|
}
|
|
161
174
|
}
|
|
162
175
|
};
|
package/src/wiki/WikiComment.vue
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
<!-- 展开、收起 -->
|
|
37
37
|
<el-button
|
|
38
38
|
type="default"
|
|
39
|
-
v-if="comment.reply_form.show"
|
|
39
|
+
v-if="comment.reply_form && comment.reply_form.show"
|
|
40
40
|
class="u-reply"
|
|
41
41
|
@click="
|
|
42
42
|
comment.reply_form.show = !comment.reply_form.show
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
></span>
|
|
65
65
|
</div>
|
|
66
66
|
<!-- 评论回复表单 -->
|
|
67
|
-
<div class="m-reply-form" v-if="comment.reply_form.show">
|
|
67
|
+
<div class="m-reply-form" v-if="comment.reply_form && comment.reply_form.show">
|
|
68
68
|
<textarea
|
|
69
69
|
class="u-reply-content"
|
|
70
70
|
v-model="comment.reply_form.content"
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<span>百科评论</span>
|
|
6
6
|
</template>
|
|
7
7
|
<template slot="body">
|
|
8
|
-
<div class="m-comments-panel">
|
|
8
|
+
<div class="m-comments-panel" v-loading="loading">
|
|
9
9
|
<div class="u-empty" v-if="!comments || !comments.length">
|
|
10
10
|
<span v-if="comments === null">🎉 数据加载中...</span>
|
|
11
11
|
<span v-if="comments === false">⚠️ 数据加载异常</span>
|
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
<!-- 递归评论组件 -->
|
|
15
15
|
<Comment :comments="comments" :source-id="sourceId" />
|
|
16
|
+
<el-pagination
|
|
17
|
+
class="u-pagination-box"
|
|
18
|
+
background :current-page="page"
|
|
19
|
+
:total="total"
|
|
20
|
+
:page-size="pageSize"
|
|
21
|
+
layout="prev, pager, next, total"
|
|
22
|
+
@current-change="handleCurrentChange"
|
|
23
|
+
></el-pagination>
|
|
16
24
|
<!-- 回复表单 -->
|
|
17
25
|
<div id="m-reply-form" class="m-reply-form">
|
|
18
26
|
<h4 class="u-title">
|
|
@@ -57,6 +65,10 @@ export default {
|
|
|
57
65
|
content: "",
|
|
58
66
|
user_nickname: User.getInfo().name,
|
|
59
67
|
},
|
|
68
|
+
page: 1,
|
|
69
|
+
pageSize: 10,
|
|
70
|
+
total: 0,
|
|
71
|
+
loading: false,
|
|
60
72
|
};
|
|
61
73
|
},
|
|
62
74
|
computed: {
|
|
@@ -68,7 +80,8 @@ export default {
|
|
|
68
80
|
get_comments() {
|
|
69
81
|
if (!this.type || !this.sourceId) return;
|
|
70
82
|
// WikiComment.list(this.type, this.sourceId, this.client)
|
|
71
|
-
|
|
83
|
+
this.loading = true;
|
|
84
|
+
wikiComment.list({ type: this.type, id: this.sourceId }, { client: this.client, page: this.page })
|
|
72
85
|
.then(
|
|
73
86
|
(res) => {
|
|
74
87
|
res = res.data;
|
|
@@ -81,11 +94,16 @@ export default {
|
|
|
81
94
|
user_nickname: User.getInfo().name,
|
|
82
95
|
};
|
|
83
96
|
}
|
|
97
|
+
this.page = res.data.current_page;
|
|
98
|
+
this.total = res.data.total
|
|
84
99
|
this.comments = filter(comments, 0);
|
|
100
|
+
// this.comments = comments;
|
|
101
|
+
this.loading = false;
|
|
85
102
|
}
|
|
86
103
|
},
|
|
87
104
|
() => {
|
|
88
105
|
this.comments = false;
|
|
106
|
+
this.loading = false;
|
|
89
107
|
}
|
|
90
108
|
);
|
|
91
109
|
|
|
@@ -95,11 +113,21 @@ export default {
|
|
|
95
113
|
let c = comments[index];
|
|
96
114
|
if (!c) continue;
|
|
97
115
|
if (c.parent_id === parent) {
|
|
98
|
-
//
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
116
|
+
// 递归
|
|
117
|
+
let children = filter(c.children, c.id);
|
|
118
|
+
c.children = children.map((item) => {
|
|
119
|
+
item.parent = {
|
|
120
|
+
user_id: c.user_id,
|
|
121
|
+
user_nickname: c.user_nickname,
|
|
122
|
+
id: c.id,
|
|
123
|
+
}
|
|
124
|
+
item.reply_form = {
|
|
125
|
+
show: false,
|
|
126
|
+
content: "",
|
|
127
|
+
user_nickname: User.getInfo().name,
|
|
128
|
+
}
|
|
129
|
+
return item
|
|
130
|
+
});
|
|
103
131
|
outputs.push(c);
|
|
104
132
|
}
|
|
105
133
|
}
|
|
@@ -152,6 +180,10 @@ export default {
|
|
|
152
180
|
form.show = false;
|
|
153
181
|
});
|
|
154
182
|
},
|
|
183
|
+
handleCurrentChange(page) {
|
|
184
|
+
this.page = page;
|
|
185
|
+
this.get_comments();
|
|
186
|
+
}
|
|
155
187
|
},
|
|
156
188
|
components: {
|
|
157
189
|
WikiPanel,
|