@jx3box/jx3box-common-ui 5.5.15 → 5.5.18

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.5.15",
3
+ "version": "5.5.18",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,10 +30,10 @@
30
30
  "last 2 versions"
31
31
  ],
32
32
  "dependencies": {
33
- "@jx3box/jx3box-comment-ui": "^1.6.6",
34
- "@jx3box/jx3box-common": "^7.0.5",
33
+ "@jx3box/jx3box-comment-ui": "^1.6.7",
34
+ "@jx3box/jx3box-common": "^7.0.17",
35
35
  "@jx3box/jx3box-data": "^1.8.3",
36
- "@jx3box/jx3box-editor": "^1.2.0",
36
+ "@jx3box/jx3box-editor": "^1.2.4",
37
37
  "axios": "^0.19.2",
38
38
  "element-ui": "^2.13.2",
39
39
  "jquery": "^3.5.1",
@@ -98,7 +98,7 @@ export default {
98
98
  immediate : true,
99
99
  deep : true,
100
100
  handler : function (){
101
- this.postType && !!this.postId && this.loadData();
101
+ this.postType && this.postId && this.loadData();
102
102
  }
103
103
  },
104
104
  params: {
@@ -51,7 +51,7 @@ export default {
51
51
  },
52
52
  computed: {
53
53
  id: function () {
54
- return ~~this.postId;
54
+ return this.postId;
55
55
  },
56
56
  visible: function () {
57
57
  return this.other_authors && this.other_authors?.length;
@@ -62,7 +62,7 @@ export default {
62
62
  immediate : true,
63
63
  deep:true,
64
64
  handler : function (){
65
- this.postType && !!~~this.postId && this.loadBoxcoinConfig()
65
+ this.postType && this.postId && this.loadBoxcoinConfig()
66
66
  }
67
67
  }
68
68
  },
@@ -18,25 +18,13 @@
18
18
  <th>贡献者</th>
19
19
  <th>修订说明</th>
20
20
  </tr>
21
- <tr
22
- class="history"
23
- v-for="(ver, key) in versions"
24
- :key="key"
25
- >
21
+ <tr class="history" v-for="(ver, key) in versions" :key="key">
26
22
  <td>
27
- <a
28
- :href="link(type, `${ver.source_id}/${ver.id}`)"
29
- v-text="'v' + (versions.length - key)"
30
- ></a>
23
+ <a :href="link(type, `${ver.source_id}/${ver.id}`)" v-text="'v' + (versions.length - key)" @click="redirectRevision(ver,$event)"></a>
31
24
  </td>
32
25
  <td v-text="ts2str(ver.updated)"></td>
33
26
  <td>
34
- <a
35
- :href="
36
- ver.user_id ? author_url(ver.user_id) : null
37
- "
38
- v-text="ver.user_nickname"
39
- ></a>
27
+ <a :href="ver.user_id ? author_url(ver.user_id) : null" v-text="ver.user_nickname"></a>
40
28
  </td>
41
29
  <td v-text="ver.remark"></td>
42
30
  </tr>
@@ -50,36 +38,42 @@
50
38
  import WikiPanel from "./WikiPanel";
51
39
  import { WikiPost } from "@jx3box/jx3box-common/js/helper";
52
40
  import { getLink, authorLink, ts2str } from "@jx3box/jx3box-common/js/utils";
53
- import {__Root,__OriginRoot} from '@jx3box/jx3box-common/data/jx3box.json'
41
+ import { __Root, __OriginRoot } from "@jx3box/jx3box-common/data/jx3box.json";
54
42
 
55
43
  export default {
56
44
  name: "WikiRevisions",
57
- props: ["type", "sourceId",'isGame'],
45
+ props: ["type", "sourceId", "isGame"],
58
46
  data: function() {
59
47
  return {
60
48
  versions: null,
61
49
  };
62
50
  },
63
- computed : {
64
- baseUrl : function (){
65
- return location.href.includes('classic') ? __OriginRoot : __Root
51
+ computed: {
52
+ baseUrl: function() {
53
+ return (location.href.includes("classic") || location.href.includes("origin")) ? __OriginRoot : __Root;
66
54
  },
67
- prefix : function (){
68
- if(this.isGame){
69
- return this.baseUrl
70
- }else{
71
- return ''
55
+ prefix: function() {
56
+ if (this.isGame) {
57
+ return this.baseUrl.slice(0,-1);
58
+ } else {
59
+ return "";
72
60
  }
73
- }
61
+ },
74
62
  },
75
63
  methods: {
76
- link: function (type,id){
77
- return this.prefix + getLink(type,id)
64
+ link: function(type, id) {
65
+ return this.prefix + getLink(type, id);
78
66
  },
79
- author_url: function (uid){
80
- return this.prefix + authorLink(uid)
67
+ author_url: function(uid) {
68
+ return this.prefix + authorLink(uid);
81
69
  },
82
70
  ts2str,
71
+ redirectRevision : function (ver,e){
72
+ if(!this.isGame && this.$router){
73
+ e.preventDefault();
74
+ this.$router.replace({path:`/view/${ver.source_id}/${ver.id}`})
75
+ }
76
+ }
83
77
  },
84
78
  components: {
85
79
  WikiPanel,
@@ -92,8 +86,7 @@ export default {
92
86
  WikiPost.versions(this.type, this.sourceId).then(
93
87
  (res) => {
94
88
  res = res.data;
95
- this.versions =
96
- res.code === 200 ? res.data.versions : false;
89
+ this.versions = res.code === 200 ? res.data.versions : false;
97
90
  },
98
91
  () => {
99
92
  this.versions = false;