@jx3box/jx3box-common-ui 5.8.5 → 5.8.8
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 +4 -4
- package/src/wiki/WikiComments.vue +7 -2
- package/src/wiki/WikiRevisions.vue +20 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-common-ui",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.8",
|
|
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.
|
|
35
|
-
"@jx3box/jx3box-data": "^1.9.
|
|
36
|
-
"@jx3box/jx3box-editor": "^1.2.
|
|
34
|
+
"@jx3box/jx3box-common": "^7.2.4",
|
|
35
|
+
"@jx3box/jx3box-data": "^1.9.9",
|
|
36
|
+
"@jx3box/jx3box-editor": "^1.2.8",
|
|
37
37
|
"axios": "^0.26.1",
|
|
38
38
|
"dayjs": "^1.11.0",
|
|
39
39
|
"element-ui": "^2.13.2",
|
|
@@ -59,10 +59,15 @@ export default {
|
|
|
59
59
|
},
|
|
60
60
|
};
|
|
61
61
|
},
|
|
62
|
+
computed: {
|
|
63
|
+
client: function () {
|
|
64
|
+
return location.href.includes("classic") || location.href.includes("origin") ? "origin" : "std";
|
|
65
|
+
},
|
|
66
|
+
},
|
|
62
67
|
methods: {
|
|
63
68
|
get_comments() {
|
|
64
69
|
if (!this.type || !this.sourceId) return;
|
|
65
|
-
WikiComment.list(this.type, this.sourceId).then(
|
|
70
|
+
WikiComment.list(this.type, this.sourceId, this.client).then(
|
|
66
71
|
(res) => {
|
|
67
72
|
res = res.data;
|
|
68
73
|
if (res.code === 200) {
|
|
@@ -115,7 +120,7 @@ export default {
|
|
|
115
120
|
parent_id: parent_id,
|
|
116
121
|
user_nickname: form.user_nickname || User.getInfo().name,
|
|
117
122
|
content: form.content,
|
|
118
|
-
})
|
|
123
|
+
}, this.client)
|
|
119
124
|
.then(
|
|
120
125
|
(res) => {
|
|
121
126
|
res = res.data;
|
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
</tr>
|
|
21
21
|
<tr class="history" v-for="(ver, key) in versions" :key="key">
|
|
22
22
|
<td>
|
|
23
|
-
<a
|
|
23
|
+
<a
|
|
24
|
+
:href="link(type, `${ver.source_id}/${ver.id}`)"
|
|
25
|
+
v-text="'v' + (versions.length - key)"
|
|
26
|
+
@click="redirectRevision(ver, $event)"
|
|
27
|
+
></a>
|
|
24
28
|
</td>
|
|
25
29
|
<td v-text="ts2str(ver.updated)"></td>
|
|
26
30
|
<td>
|
|
@@ -43,37 +47,40 @@ import { __Root, __OriginRoot } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
|
43
47
|
export default {
|
|
44
48
|
name: "WikiRevisions",
|
|
45
49
|
props: ["type", "sourceId", "isGame"],
|
|
46
|
-
data: function() {
|
|
50
|
+
data: function () {
|
|
47
51
|
return {
|
|
48
52
|
versions: null,
|
|
49
53
|
};
|
|
50
54
|
},
|
|
51
55
|
computed: {
|
|
52
|
-
|
|
53
|
-
return
|
|
56
|
+
client: function () {
|
|
57
|
+
return location.href.includes("classic") || location.href.includes("origin") ? "origin" : "std";
|
|
54
58
|
},
|
|
55
|
-
|
|
59
|
+
baseUrl: function () {
|
|
60
|
+
return this.client == "origin" ? __OriginRoot : __Root;
|
|
61
|
+
},
|
|
62
|
+
prefix: function () {
|
|
56
63
|
if (this.isGame) {
|
|
57
|
-
return this.baseUrl.slice(0
|
|
64
|
+
return this.baseUrl.slice(0, -1);
|
|
58
65
|
} else {
|
|
59
66
|
return "";
|
|
60
67
|
}
|
|
61
68
|
},
|
|
62
69
|
},
|
|
63
70
|
methods: {
|
|
64
|
-
link: function(type, id) {
|
|
71
|
+
link: function (type, id) {
|
|
65
72
|
return this.prefix + getLink(type, id);
|
|
66
73
|
},
|
|
67
|
-
author_url: function(uid) {
|
|
74
|
+
author_url: function (uid) {
|
|
68
75
|
return this.prefix + authorLink(uid);
|
|
69
76
|
},
|
|
70
77
|
ts2str,
|
|
71
|
-
redirectRevision
|
|
72
|
-
if(!this.isGame && this.$router){
|
|
78
|
+
redirectRevision: function (ver, e) {
|
|
79
|
+
if (!this.isGame && this.$router) {
|
|
73
80
|
e.preventDefault();
|
|
74
|
-
this.$router.replace({path
|
|
81
|
+
this.$router.replace({ path: `/view/${ver.source_id}/${ver.id}` });
|
|
75
82
|
}
|
|
76
|
-
}
|
|
83
|
+
},
|
|
77
84
|
},
|
|
78
85
|
components: {
|
|
79
86
|
WikiPanel,
|
|
@@ -83,7 +90,7 @@ export default {
|
|
|
83
90
|
immediate: true,
|
|
84
91
|
handler() {
|
|
85
92
|
if (this.sourceId) {
|
|
86
|
-
WikiPost.versions(this.type, this.sourceId).then(
|
|
93
|
+
WikiPost.versions(this.type, this.sourceId, this.client).then(
|
|
87
94
|
(res) => {
|
|
88
95
|
res = res.data;
|
|
89
96
|
this.versions = res.code === 200 ? res.data.versions : false;
|