@jx3box/jx3box-common-ui 8.2.1 → 8.2.2

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": "8.2.1",
3
+ "version": "8.2.2",
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.8.7",
34
- "@jx3box/jx3box-common": "^8.2.2",
34
+ "@jx3box/jx3box-common": "^8.2.4",
35
35
  "@jx3box/jx3box-data": "^3.5.6",
36
- "@jx3box/jx3box-editor": "^2.1.4",
36
+ "@jx3box/jx3box-editor": "^2.1.6",
37
37
  "@jx3box/reporter": "^0.0.4",
38
38
  "axios": "^0.26.1",
39
39
  "dayjs": "^1.11.0",
package/src/App.vue CHANGED
@@ -100,7 +100,7 @@
100
100
  <WikiRevisions type="achievement" source-id="2996" />
101
101
  <hr />
102
102
 
103
- <WikiComments type="achievement" source-id="2996" />
103
+ <WikiComments type="achievement" source-id="456" />
104
104
  <hr />
105
105
  </el-tab-pane>
106
106
  <el-tab-pane label="头像" name="avatar">
@@ -29,19 +29,12 @@
29
29
  <i class="el-icon-chat-dot-round"></i>
30
30
  <span>回复</span>
31
31
  </h4>
32
- <textarea
33
- class="u-reply-content"
34
- v-model="reply_form.content"
35
- ></textarea>
32
+ <textarea class="u-reply-content" v-model="reply_form.content"></textarea>
36
33
  <div class="u-author">
37
34
  <span>昵称:</span>
38
35
  <input v-model="reply_form.user_nickname" type="text" />
39
36
  </div>
40
- <el-button
41
- type="primary"
42
- class="u-submit"
43
- @click="create_comment(reply_form)"
44
- >
37
+ <el-button type="primary" class="u-submit" @click="create_comment(reply_form)">
45
38
  <i class="el-icon-check"></i>
46
39
  <span>提交</span>
47
40
  </el-button>
@@ -54,7 +47,7 @@
54
47
  <script>
55
48
  import WikiPanel from "./WikiPanel";
56
49
  import Comment from "./WikiComment.vue";
57
- import { wikiComment } from "@jx3box/jx3box-common/js/wiki";
50
+ import { wikiComment } from "@jx3box/jx3box-common/js/wiki_v2";
58
51
  import User from "@jx3box/jx3box-common/js/user";
59
52
 
60
53
  export default {
@@ -81,33 +74,25 @@ export default {
81
74
  methods: {
82
75
  get_comments() {
83
76
  if (!this.type || !this.sourceId) return;
84
- // WikiComment.list(this.type, this.sourceId, this.client)
85
77
  this.loading = true;
86
- wikiComment.list({ type: this.type, id: this.sourceId }, { client: this.client, page: this.page })
87
- .then(
88
- (res) => {
78
+ wikiComment
79
+ .list({ type: this.type, id: this.sourceId }, { client: this.client, page: this.page })
80
+ .then((res) => {
89
81
  res = res.data;
90
- if (res.code === 200) {
91
- let comments = res.data.comments;
92
- for (let i = 0; i < comments.length; i++) {
93
- comments[i]["reply_form"] = {
94
- show: false,
95
- content: "",
96
- user_nickname: User.getInfo().name,
97
- };
98
- }
99
- this.page = res.data.current_page;
100
- this.total = res.data.total
101
- this.comments = filter(comments, 0);
102
- // this.comments = comments;
103
- this.loading = false;
82
+ let comments = res.data.list;
83
+ for (let i = 0; i < comments.length; i++) {
84
+ comments[i]["reply_form"] = {
85
+ show: false,
86
+ content: "",
87
+ user_nickname: User.getInfo().name,
88
+ };
104
89
  }
105
- },
106
- () => {
107
- this.comments = false;
90
+ this.page = res.data.page;
91
+ this.total = res.data.total;
92
+ this.comments = filter(comments, 0);
93
+ // this.comments = comments;
108
94
  this.loading = false;
109
- }
110
- );
95
+ });
111
96
 
112
97
  function filter(comments, parent) {
113
98
  let outputs = [];
@@ -122,13 +107,13 @@ export default {
122
107
  user_id: c.user_id,
123
108
  user_nickname: c.user_nickname,
124
109
  id: c.id,
125
- }
110
+ };
126
111
  item.reply_form = {
127
112
  show: false,
128
113
  content: "",
129
114
  user_nickname: User.getInfo().name,
130
- }
131
- return item
115
+ };
116
+ return item;
132
117
  });
133
118
  outputs.push(c);
134
119
  }
@@ -146,38 +131,23 @@ export default {
146
131
  return;
147
132
  }
148
133
  const data = {
149
- comment: {
150
- type: this.type,
151
- source_id: this.sourceId,
152
- parent_id: parent_id,
153
- user_nickname: form.user_nickname || User.getInfo().name,
154
- content: form.content,
155
- },
156
- client: this.client
157
- }
158
- wikiComment.post({ data }, {})
159
- .then(
160
- (res) => {
161
- res = res.data;
162
- if (res.code === 200) {
163
- form.content = "";
164
- this.$message({
165
- message: "提交成功,请等待审核",
166
- type: "success",
167
- });
168
- } else
169
- this.$message({
170
- message: `${res.message}`,
171
- type: "warning",
172
- });
173
- },
174
- () => {
175
- this.$message({
176
- message: "网络异常,提交失败",
177
- type: "warning",
178
- });
179
- }
180
- )
134
+ type: this.type,
135
+ source_id: this.sourceId,
136
+ parent_id: parent_id,
137
+ user_nickname: form.user_nickname || User.getInfo().name,
138
+ content: form.content,
139
+ client: this.client,
140
+ };
141
+ wikiComment
142
+ .post(data)
143
+ .then((res) => {
144
+ res = res.data;
145
+ form.content = "";
146
+ this.$message({
147
+ message: "提交成功,请等待审核",
148
+ type: "success",
149
+ });
150
+ })
181
151
  .finally(() => {
182
152
  form.show = false;
183
153
  });
@@ -185,7 +155,7 @@ export default {
185
155
  handleCurrentChange(page) {
186
156
  this.page = page;
187
157
  this.get_comments();
188
- }
158
+ },
189
159
  },
190
160
  components: {
191
161
  WikiPanel,