@jx3box/jx3box-ui 2.0.6 → 2.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/.storybook/storybookMocks.js +23 -0
- package/README.md +39 -30
- package/assets/css/interact/qrcode.less +69 -0
- package/assets/css/wiki/wiki-comments.less +176 -0
- package/assets/css/wiki/wiki-panel.less +177 -0
- package/assets/css/wiki/wiki-revisions.less +62 -0
- package/package.json +1 -1
- package/src/App.vue +57 -1
- package/src/interact/Homework.vue +9 -10
- package/src/interact/QRcode.vue +104 -0
- package/src/single/VersionDialog.vue +2 -2
- package/src/stories/interact/QRcode.stories.js +59 -0
- package/src/stories/mockData.js +94 -0
- package/src/stories/wiki/GamePrice.stories.js +64 -0
- package/src/stories/wiki/WikiComments.stories.js +58 -0
- package/src/stories/wiki/WikiPanel.stories.js +69 -0
- package/src/stories/wiki/WikiRevisions.stories.js +47 -0
- package/src/wiki/GamePrice.vue +107 -0
- package/src/wiki/WikiComment.vue +153 -0
- package/src/wiki/WikiComments.vue +206 -0
- package/src/wiki/WikiPanel.vue +121 -0
- package/src/wiki/WikiRevisions.vue +125 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<WikiPanel class="c-wiki-revisions" scene="detail">
|
|
3
|
+
<template #head-title>
|
|
4
|
+
<i class="el-icon-time"></i>
|
|
5
|
+
<span>历史版本</span>
|
|
6
|
+
</template>
|
|
7
|
+
<template #body>
|
|
8
|
+
<div class="m-revisions-panel">
|
|
9
|
+
<div class="u-empty" v-if="!versions || !versions.length">
|
|
10
|
+
<span v-if="versions === null">🎉 数据加载中...</span>
|
|
11
|
+
<span v-if="versions === false">⚠️ 数据加载异常</span>
|
|
12
|
+
<span v-if="versions && !versions.length">💧 暂无数据</span>
|
|
13
|
+
</div>
|
|
14
|
+
<table v-if="versions && versions.length" class="m-histories">
|
|
15
|
+
<tr>
|
|
16
|
+
<th>版本</th>
|
|
17
|
+
<th>更新时间</th>
|
|
18
|
+
<th>贡献者</th>
|
|
19
|
+
<th>修订说明</th>
|
|
20
|
+
</tr>
|
|
21
|
+
<tr class="history" v-for="(ver, key) in versions" :key="key">
|
|
22
|
+
<td>
|
|
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>
|
|
28
|
+
</td>
|
|
29
|
+
<td v-text="ts2str(ver.updated)"></td>
|
|
30
|
+
<td>
|
|
31
|
+
<a :href="ver.user_id ? author_url(ver.user_id) : null" v-text="ver.user_nickname"></a>
|
|
32
|
+
</td>
|
|
33
|
+
<td v-text="ver.remark"></td>
|
|
34
|
+
</tr>
|
|
35
|
+
</table>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
</WikiPanel>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import WikiPanel from "./WikiPanel";
|
|
43
|
+
import { wiki } from "@jx3box/jx3box-common/js/wiki";
|
|
44
|
+
import { getLink, authorLink, ts2str } from "@jx3box/jx3box-common/js/utils";
|
|
45
|
+
import jx3box from "@jx3box/jx3box-common/data/jx3box.json";
|
|
46
|
+
const { __Root, __OriginRoot } = jx3box;
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
name: "WikiRevisions",
|
|
50
|
+
props: {
|
|
51
|
+
type: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "",
|
|
54
|
+
},
|
|
55
|
+
sourceId: {
|
|
56
|
+
type: [String, Number],
|
|
57
|
+
default: "",
|
|
58
|
+
},
|
|
59
|
+
isGame: {
|
|
60
|
+
type: [Boolean, Number],
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
data: function () {
|
|
65
|
+
return {
|
|
66
|
+
versions: [],
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
computed: {
|
|
70
|
+
client: function () {
|
|
71
|
+
return location.href.includes("classic") || location.href.includes("origin") ? "origin" : "std";
|
|
72
|
+
},
|
|
73
|
+
baseUrl: function () {
|
|
74
|
+
return this.client == "origin" ? __OriginRoot : __Root;
|
|
75
|
+
},
|
|
76
|
+
prefix: function () {
|
|
77
|
+
if (this.isGame) {
|
|
78
|
+
return this.baseUrl.slice(0, -1);
|
|
79
|
+
} else {
|
|
80
|
+
return "";
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
methods: {
|
|
85
|
+
link: function (type, id) {
|
|
86
|
+
return this.prefix + getLink(type, id);
|
|
87
|
+
},
|
|
88
|
+
author_url: function (uid) {
|
|
89
|
+
return this.prefix + authorLink(uid);
|
|
90
|
+
},
|
|
91
|
+
ts2str,
|
|
92
|
+
redirectRevision: function (ver, e) {
|
|
93
|
+
if (!this.isGame && this.$router) {
|
|
94
|
+
e.preventDefault();
|
|
95
|
+
this.$router.replace({ path: `/view/${ver.source_id}/${ver.id}` });
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
components: {
|
|
100
|
+
WikiPanel,
|
|
101
|
+
},
|
|
102
|
+
watch: {
|
|
103
|
+
sourceId: {
|
|
104
|
+
immediate: true,
|
|
105
|
+
handler() {
|
|
106
|
+
if (this.sourceId) {
|
|
107
|
+
wiki.versions({ type: this.type, id: this.sourceId }, { client: this.client }).then(
|
|
108
|
+
(res) => {
|
|
109
|
+
res = res.data;
|
|
110
|
+
this.versions = res.data || [];
|
|
111
|
+
},
|
|
112
|
+
() => {
|
|
113
|
+
this.versions = [];
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<style lang="less">
|
|
124
|
+
@import "../../assets/css/wiki/wiki-revisions.less";
|
|
125
|
+
</style>
|