@jx3box/jx3box-common-ui 5.8.6 → 5.8.9

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": "5.8.6",
3
+ "version": "5.8.9",
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.1.8",
34
+ "@jx3box/jx3box-common": "^7.3.1",
35
35
  "@jx3box/jx3box-data": "^1.9.9",
36
- "@jx3box/jx3box-editor": "^1.2.8",
36
+ "@jx3box/jx3box-editor": "^1.3.2",
37
37
  "axios": "^0.26.1",
38
38
  "dayjs": "^1.11.0",
39
39
  "element-ui": "^2.13.2",
package/src/App.vue CHANGED
@@ -84,10 +84,10 @@
84
84
  </WikiPanel>
85
85
  <hr />
86
86
 
87
- <WikiRevisions type="achievement" source-id="9096"/>
87
+ <WikiRevisions type="achievement" source-id="2996"/>
88
88
  <hr />
89
89
 
90
- <WikiComments type="achievement" source-id="9096"/>
90
+ <WikiComments type="achievement" source-id="2996"/>
91
91
  <hr
92
92
  /></el-tab-pane>
93
93
  </el-tabs>
@@ -155,7 +155,7 @@ import WikiComments from "./wiki/WikiComments.vue";
155
155
 
156
156
  import axios from "axios";
157
157
  import { __server } from "@jx3box/jx3box-common/data/jx3box.json";
158
- import { WikiPost } from "@jx3box/jx3box-common/js/helper";
158
+ import { wiki } from "@jx3box/jx3box-common/js/wiki";
159
159
 
160
160
  export default {
161
161
  name: "App",
@@ -227,9 +227,10 @@ export default {
227
227
  };
228
228
  },
229
229
  created: function() {
230
- WikiPost.view(11042).then((res) => {
230
+ wiki.getById(25594)
231
+ .then((res) => {
231
232
  res = res.data;
232
- if (res.code === 200) this.wikiPost = res.data;
233
+ this.wikiPost = res.data;
233
234
  });
234
235
  },
235
236
  methods: {
@@ -44,7 +44,8 @@
44
44
  <script>
45
45
  import WikiPanel from "./WikiPanel";
46
46
  import Comment from "./WikiComment.vue";
47
- import { WikiComment } from "@jx3box/jx3box-common/js/helper";
47
+ import { wikiComment } from "@jx3box/jx3box-common/js/wiki";
48
+ import qs from "qs";
48
49
  import User from "@jx3box/jx3box-common/js/user";
49
50
 
50
51
  export default {
@@ -59,10 +60,17 @@ export default {
59
60
  },
60
61
  };
61
62
  },
63
+ computed: {
64
+ client: function () {
65
+ return location.href.includes("classic") || location.href.includes("origin") ? "origin" : "std";
66
+ },
67
+ },
62
68
  methods: {
63
69
  get_comments() {
64
70
  if (!this.type || !this.sourceId) return;
65
- WikiComment.list(this.type, this.sourceId).then(
71
+ // WikiComment.list(this.type, this.sourceId, this.client)
72
+ wikiComment.list({ type: this.type, id: this.sourceId }, { client: this.client })
73
+ .then(
66
74
  (res) => {
67
75
  res = res.data;
68
76
  if (res.code === 200) {
@@ -108,14 +116,17 @@ export default {
108
116
  });
109
117
  return;
110
118
  }
111
-
112
- WikiComment.save({
113
- type: this.type,
114
- source_id: this.sourceId,
115
- parent_id: parent_id,
116
- user_nickname: form.user_nickname || User.getInfo().name,
117
- content: form.content,
118
- })
119
+ const data = {
120
+ comment: {
121
+ type: this.type,
122
+ source_id: this.sourceId,
123
+ parent_id: parent_id,
124
+ user_nickname: form.user_nickname || User.getInfo().name,
125
+ content: form.content,
126
+ },
127
+ client: this.client
128
+ }
129
+ wikiComment.post({ data: qs.stringify(data) }, {})
119
130
  .then(
120
131
  (res) => {
121
132
  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 :href="link(type, `${ver.source_id}/${ver.id}`)" v-text="'v' + (versions.length - key)" @click="redirectRevision(ver,$event)"></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>
@@ -36,44 +40,47 @@
36
40
 
37
41
  <script>
38
42
  import WikiPanel from "./WikiPanel";
39
- import { WikiPost } from "@jx3box/jx3box-common/js/helper";
43
+ import { wiki } from "@jx3box/jx3box-common/js/wiki";
40
44
  import { getLink, authorLink, ts2str } from "@jx3box/jx3box-common/js/utils";
41
45
  import { __Root, __OriginRoot } from "@jx3box/jx3box-common/data/jx3box.json";
42
46
 
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
- baseUrl: function() {
53
- return (location.href.includes("classic") || location.href.includes("origin")) ? __OriginRoot : __Root;
56
+ client: function () {
57
+ return location.href.includes("classic") || location.href.includes("origin") ? "origin" : "std";
54
58
  },
55
- prefix: function() {
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,-1);
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 : function (ver,e){
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:`/view/${ver.source_id}/${ver.id}`})
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,8 @@ export default {
83
90
  immediate: true,
84
91
  handler() {
85
92
  if (this.sourceId) {
86
- WikiPost.versions(this.type, this.sourceId).then(
93
+ wiki.versions({ type: this.type, id: this.sourceId }, { client: this.client })
94
+ .then(
87
95
  (res) => {
88
96
  res = res.data;
89
97
  this.versions = res.code === 200 ? res.data.versions : false;