@jx3box/jx3box-common-ui 8.7.2 → 8.7.3
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 +1 -1
- package/src/App.vue +1 -1
- package/src/bread/Admin.vue +1 -1
- package/src/bread/CommunityAdmin.vue +43 -3
- package/src/single/PostTopic.vue +1 -1
package/package.json
CHANGED
package/src/App.vue
CHANGED
package/src/bread/Admin.vue
CHANGED
|
@@ -282,7 +282,7 @@ export default {
|
|
|
282
282
|
// 上传
|
|
283
283
|
uploadSuccess: function (res, file, list) {
|
|
284
284
|
this.banner_preview = URL.createObjectURL(file.raw);
|
|
285
|
-
this.post_banner = res.data[0];
|
|
285
|
+
this.post_banner = res.data?.[0] || "";
|
|
286
286
|
},
|
|
287
287
|
uploadFail: function (err, file, fileList) {
|
|
288
288
|
this.$message.error("上传失败");
|
|
@@ -72,6 +72,27 @@
|
|
|
72
72
|
</div>
|
|
73
73
|
</div>
|
|
74
74
|
|
|
75
|
+
<el-divider content-position="left">封面海报</el-divider>
|
|
76
|
+
<div class="c-admin-banner">
|
|
77
|
+
<el-upload
|
|
78
|
+
class="c-admin-upload el-upload--picture-card"
|
|
79
|
+
:action="uploadurl"
|
|
80
|
+
:with-credentials="true"
|
|
81
|
+
:show-file-list="false"
|
|
82
|
+
:on-success="uploadSuccess"
|
|
83
|
+
:on-error="uploadFail"
|
|
84
|
+
>
|
|
85
|
+
<img v-if="post_banner" :src="post_banner" />
|
|
86
|
+
<i class="el-icon-plus"></i>
|
|
87
|
+
</el-upload>
|
|
88
|
+
<el-input class="u-banner" v-model="post_banner">
|
|
89
|
+
<span slot="prepend">海报地址</span>
|
|
90
|
+
<span slot="append">
|
|
91
|
+
<span class="u-btn" @click="removeBanner"> <i class="el-icon-circle-close"></i> 移除海报 </span>
|
|
92
|
+
</span>
|
|
93
|
+
</el-input>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
75
96
|
<el-divider content-position="left">高亮置顶</el-divider>
|
|
76
97
|
|
|
77
98
|
<p class="c-admin-space">
|
|
@@ -141,7 +162,7 @@ import {
|
|
|
141
162
|
updateTopicItem,
|
|
142
163
|
manageTopicAll
|
|
143
164
|
} from "../../service/community";
|
|
144
|
-
import {
|
|
165
|
+
import { __cms } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
145
166
|
|
|
146
167
|
export default {
|
|
147
168
|
name: "CommunityAdmin",
|
|
@@ -186,7 +207,12 @@ export default {
|
|
|
186
207
|
hight_color: "rgb(255,0,1)",
|
|
187
208
|
},
|
|
188
209
|
|
|
189
|
-
finalTags: []
|
|
210
|
+
finalTags: [],
|
|
211
|
+
|
|
212
|
+
// 海报
|
|
213
|
+
uploadurl: __cms + "api/cms/upload",
|
|
214
|
+
banner_preview: "",
|
|
215
|
+
post_banner: "",
|
|
190
216
|
};
|
|
191
217
|
},
|
|
192
218
|
computed: {
|
|
@@ -243,6 +269,7 @@ export default {
|
|
|
243
269
|
user_id: this.form.user_id,
|
|
244
270
|
title: this.form.title,
|
|
245
271
|
category: this.form.category,
|
|
272
|
+
banner_img: this.post_banner,
|
|
246
273
|
}));
|
|
247
274
|
|
|
248
275
|
promises.push(manageTopicAll(id, {
|
|
@@ -327,6 +354,7 @@ export default {
|
|
|
327
354
|
|
|
328
355
|
this.finalTags = this.post.color_tag;
|
|
329
356
|
this.topStatus = [];
|
|
357
|
+
this.post_banner = this.post.banner_img;
|
|
330
358
|
if (this.post.is_top) {
|
|
331
359
|
this.topStatus.push("is_top");
|
|
332
360
|
}
|
|
@@ -349,7 +377,19 @@ export default {
|
|
|
349
377
|
}
|
|
350
378
|
});
|
|
351
379
|
this.finalTags = tags;
|
|
352
|
-
}
|
|
380
|
+
},
|
|
381
|
+
// 上传
|
|
382
|
+
uploadSuccess: function (res, file, list) {
|
|
383
|
+
this.banner_preview = URL.createObjectURL(file.raw);
|
|
384
|
+
this.post_banner = res.data[0];
|
|
385
|
+
},
|
|
386
|
+
uploadFail: function (err, file, fileList) {
|
|
387
|
+
this.$message.error("上传失败");
|
|
388
|
+
console.log(err);
|
|
389
|
+
},
|
|
390
|
+
removeBanner: function () {
|
|
391
|
+
this.post_banner = "";
|
|
392
|
+
},
|
|
353
393
|
},
|
|
354
394
|
};
|
|
355
395
|
</script>
|
package/src/single/PostTopic.vue
CHANGED