@jx3box/jx3box-common-ui 8.7.3 → 8.7.5
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/bread/CommunityAdmin.vue +102 -66
package/package.json
CHANGED
|
@@ -8,18 +8,26 @@
|
|
|
8
8
|
:modal="false"
|
|
9
9
|
:withHeader="false"
|
|
10
10
|
>
|
|
11
|
-
<div class="c-admin-wrapper">
|
|
11
|
+
<div class="c-admin-wrapper c-community-wrapper">
|
|
12
12
|
<el-divider content-position="left">信息设置</el-divider>
|
|
13
13
|
<div class="c-admin-extend">
|
|
14
|
-
<div class="u-condition u-map">
|
|
14
|
+
<div class="u-condition u-map u-title-condition">
|
|
15
|
+
<span class="u-prepend el-input-group__prepend">
|
|
16
|
+
<el-select v-model="form.category" filterable placeholder="请选择">
|
|
17
|
+
<el-option
|
|
18
|
+
v-for="item in categoryList"
|
|
19
|
+
:value="item.name"
|
|
20
|
+
:label="item.name"
|
|
21
|
+
:key="item.name"
|
|
22
|
+
>
|
|
23
|
+
</el-option>
|
|
24
|
+
</el-select>
|
|
25
|
+
</span>
|
|
15
26
|
<el-input v-model="form.title" placeholder="请输入标题" class="input-author drawer-item-content">
|
|
16
|
-
<template #prepend>
|
|
17
|
-
<span class="u-keyword">标题</span>
|
|
18
|
-
</template>
|
|
19
27
|
</el-input>
|
|
20
28
|
</div>
|
|
21
29
|
</div>
|
|
22
|
-
<div class="c-admin-extend">
|
|
30
|
+
<!-- <div class="c-admin-extend">
|
|
23
31
|
<div class="u-condition u-map">
|
|
24
32
|
<span class="u-prepend el-input-group__prepend">分类</span>
|
|
25
33
|
<el-select v-model="form.category" filterable placeholder="请选择">
|
|
@@ -27,7 +35,7 @@
|
|
|
27
35
|
</el-option>
|
|
28
36
|
</el-select>
|
|
29
37
|
</div>
|
|
30
|
-
</div>
|
|
38
|
+
</div> -->
|
|
31
39
|
<div class="c-admin-extend m-community-tag">
|
|
32
40
|
<div class="u-condition u-map">
|
|
33
41
|
<span class="u-prepend el-input-group__prepend">标签</span>
|
|
@@ -45,12 +53,11 @@
|
|
|
45
53
|
</el-option>
|
|
46
54
|
</el-select>
|
|
47
55
|
</div>
|
|
48
|
-
<div
|
|
56
|
+
<div class="m-community-tag__content">
|
|
49
57
|
<template v-if="finalTags && finalTags.length">
|
|
50
58
|
<div class="m-community-tag__list" v-for="item in finalTags" :key="item.uuid">
|
|
51
59
|
<el-input v-model="item.label"></el-input>
|
|
52
|
-
<el-color-picker v-model="item.color"
|
|
53
|
-
:predefine="color_options"></el-color-picker>
|
|
60
|
+
<el-color-picker v-model="item.color" :predefine="color_options"></el-color-picker>
|
|
54
61
|
</div>
|
|
55
62
|
</template>
|
|
56
63
|
<el-alert title="暂未设置标签" v-else type="info" show-icon :closable="false"></el-alert>
|
|
@@ -67,6 +74,12 @@
|
|
|
67
74
|
<template #prepend>
|
|
68
75
|
<span class="u-keyword">作者ID</span>
|
|
69
76
|
</template>
|
|
77
|
+
<template #append>
|
|
78
|
+
<a class="m-user" :href="authorLink(userInfo.ID)" target="_blank">
|
|
79
|
+
<el-avatar class="u-avatar" :src="userInfo.user_avatar" size="small" />
|
|
80
|
+
{{ userInfo.display_name || "匿名" }}
|
|
81
|
+
</a>
|
|
82
|
+
</template>
|
|
70
83
|
</el-input>
|
|
71
84
|
</div>
|
|
72
85
|
</div>
|
|
@@ -97,31 +110,19 @@
|
|
|
97
110
|
|
|
98
111
|
<p class="c-admin-space">
|
|
99
112
|
<span class="c-admin-label">置顶:</span>
|
|
100
|
-
<el-checkbox-group
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
size="small"
|
|
104
|
-
>
|
|
105
|
-
<el-checkbox-button label="is_top">全局置顶</el-checkbox-button>
|
|
106
|
-
<el-checkbox-button label="is_category_top">版内置顶</el-checkbox-button>
|
|
113
|
+
<el-checkbox-group v-model="topStatus" class="c-admin-status" size="small">
|
|
114
|
+
<el-checkbox label="is_top">全局置顶</el-checkbox>
|
|
115
|
+
<el-checkbox label="is_category_top">版内置顶</el-checkbox>
|
|
107
116
|
</el-checkbox-group>
|
|
108
117
|
</p>
|
|
109
118
|
<p class="c-admin-space">
|
|
110
119
|
<span class="c-admin-label">精选:</span>
|
|
111
|
-
<el-switch
|
|
112
|
-
v-model="form.is_star"
|
|
113
|
-
:active-value="1"
|
|
114
|
-
:inactive-value="0"
|
|
115
|
-
/>
|
|
120
|
+
<el-switch v-model="form.is_star" :active-value="1" :inactive-value="0" />
|
|
116
121
|
</p>
|
|
117
122
|
|
|
118
123
|
<p class="c-admin-space">
|
|
119
124
|
<span class="c-admin-label">高亮:</span>
|
|
120
|
-
<el-switch
|
|
121
|
-
v-model="form.is_hight"
|
|
122
|
-
:active-value="1"
|
|
123
|
-
:inactive-value="0"
|
|
124
|
-
/>
|
|
125
|
+
<el-switch v-model="form.is_hight" :active-value="1" :inactive-value="0" />
|
|
125
126
|
<span v-show="showColors">
|
|
126
127
|
<el-color-picker
|
|
127
128
|
class="c-admin-highlight-block"
|
|
@@ -135,17 +136,17 @@
|
|
|
135
136
|
</span>
|
|
136
137
|
</p>
|
|
137
138
|
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
139
|
+
<div class="c-community-buttons">
|
|
140
|
+
<div class="c-community-buttons_left">
|
|
141
|
+
<el-button type="danger" size="small" icon="el-icon-delete" @click="deleteTopic">删除帖子</el-button>
|
|
142
|
+
<el-button type="warning" size="small" icon="el-icon-refresh-left" @click="handleCheck"
|
|
143
|
+
>转为待审核</el-button
|
|
144
|
+
>
|
|
145
|
+
</div>
|
|
146
|
+
<div class="c-community-buttons_right">
|
|
147
|
+
<el-button type="primary" size="small" @click="submit" :loading="pushing">提交修改</el-button>
|
|
148
|
+
<el-button type="plain" size="small" @click="close">取消</el-button>
|
|
149
|
+
</div>
|
|
149
150
|
</div>
|
|
150
151
|
</div>
|
|
151
152
|
</el-drawer>
|
|
@@ -160,9 +161,12 @@ import {
|
|
|
160
161
|
getTopicDetails,
|
|
161
162
|
manageTopic,
|
|
162
163
|
updateTopicItem,
|
|
163
|
-
manageTopicAll
|
|
164
|
+
manageTopicAll,
|
|
164
165
|
} from "../../service/community";
|
|
165
166
|
import { __cms } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
167
|
+
import {getUserInfo} from "../../service/author";
|
|
168
|
+
import { debounce } from "lodash";
|
|
169
|
+
import { authorLink } from "@jx3box/jx3box-common/js/utils";
|
|
166
170
|
|
|
167
171
|
export default {
|
|
168
172
|
name: "CommunityAdmin",
|
|
@@ -205,6 +209,7 @@ export default {
|
|
|
205
209
|
is_hight: 0,
|
|
206
210
|
is_category_top: 0,
|
|
207
211
|
hight_color: "rgb(255,0,1)",
|
|
212
|
+
user_id: "",
|
|
208
213
|
},
|
|
209
214
|
|
|
210
215
|
finalTags: [],
|
|
@@ -213,6 +218,8 @@ export default {
|
|
|
213
218
|
uploadurl: __cms + "api/cms/upload",
|
|
214
219
|
banner_preview: "",
|
|
215
220
|
post_banner: "",
|
|
221
|
+
|
|
222
|
+
userInfo: {},
|
|
216
223
|
};
|
|
217
224
|
},
|
|
218
225
|
computed: {
|
|
@@ -224,16 +231,22 @@ export default {
|
|
|
224
231
|
},
|
|
225
232
|
},
|
|
226
233
|
watch: {
|
|
227
|
-
modelValue: async function(val) {
|
|
234
|
+
modelValue: async function (val) {
|
|
228
235
|
if (val) {
|
|
229
236
|
await this.getCategoryList();
|
|
230
237
|
await this.getCommunityTags();
|
|
231
238
|
await this.getTopicDetails();
|
|
232
239
|
}
|
|
233
240
|
},
|
|
234
|
-
|
|
241
|
+
"form.user_id": debounce(function (id) {
|
|
242
|
+
id &&
|
|
243
|
+
getUserInfo(id).then((res) => {
|
|
244
|
+
this.userInfo = res || {};
|
|
245
|
+
});
|
|
246
|
+
}, 500),
|
|
235
247
|
},
|
|
236
248
|
methods: {
|
|
249
|
+
authorLink,
|
|
237
250
|
handleCheck() {
|
|
238
251
|
const id = this.post.id;
|
|
239
252
|
if (!id) {
|
|
@@ -264,23 +277,26 @@ export default {
|
|
|
264
277
|
|
|
265
278
|
const promises = [];
|
|
266
279
|
|
|
267
|
-
promises.push(
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
is_top: this.topStatus.includes("is_top") ? 1 : 0,
|
|
277
|
-
is_category_top: this.topStatus.includes("is_category_top") ? 1 : 0,
|
|
278
|
-
is_star: this.form.is_star,
|
|
279
|
-
is_hight: this.form.is_hight,
|
|
280
|
-
hight_color: this.form.hight_color,
|
|
281
|
-
color_tag: this.finalTags,
|
|
282
|
-
}));
|
|
280
|
+
promises.push(
|
|
281
|
+
updateTopicItem(id, {
|
|
282
|
+
...this.post,
|
|
283
|
+
user_id: Number(this.form.user_id),
|
|
284
|
+
title: this.form.title,
|
|
285
|
+
category: this.form.category,
|
|
286
|
+
banner_img: this.post_banner,
|
|
287
|
+
})
|
|
288
|
+
);
|
|
283
289
|
|
|
290
|
+
promises.push(
|
|
291
|
+
manageTopicAll(id, {
|
|
292
|
+
is_top: this.topStatus.includes("is_top") ? 1 : 0,
|
|
293
|
+
is_category_top: this.topStatus.includes("is_category_top") ? 1 : 0,
|
|
294
|
+
is_star: this.form.is_star,
|
|
295
|
+
is_hight: this.form.is_hight,
|
|
296
|
+
hight_color: this.form.hight_color,
|
|
297
|
+
color_tag: this.finalTags,
|
|
298
|
+
})
|
|
299
|
+
);
|
|
284
300
|
|
|
285
301
|
Promise.all(promises).then(() => {
|
|
286
302
|
this.$message({
|
|
@@ -350,7 +366,7 @@ export default {
|
|
|
350
366
|
title: this.post.title,
|
|
351
367
|
hight_color: this.post.hight_color,
|
|
352
368
|
tags: this.post?.color_tag?.map((item) => item.label) || [],
|
|
353
|
-
}
|
|
369
|
+
};
|
|
354
370
|
|
|
355
371
|
this.finalTags = this.post.color_tag;
|
|
356
372
|
this.topStatus = [];
|
|
@@ -374,7 +390,7 @@ export default {
|
|
|
374
390
|
return {
|
|
375
391
|
label: item,
|
|
376
392
|
color: "rgb(255,0,1)",
|
|
377
|
-
}
|
|
393
|
+
};
|
|
378
394
|
});
|
|
379
395
|
this.finalTags = tags;
|
|
380
396
|
},
|
|
@@ -408,11 +424,17 @@ export default {
|
|
|
408
424
|
font-size: 14px;
|
|
409
425
|
font-weight: 500;
|
|
410
426
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
427
|
+
|
|
428
|
+
.c-community-wrapper {
|
|
429
|
+
height: 100%;
|
|
430
|
+
}
|
|
431
|
+
.c-community-buttons {
|
|
432
|
+
.flex;
|
|
433
|
+
justify-content: space-between;
|
|
434
|
+
align-items: center;
|
|
435
|
+
.pa;
|
|
436
|
+
width: calc(100% - 40px);
|
|
437
|
+
bottom: 20px;
|
|
416
438
|
}
|
|
417
439
|
.c-admin-extend .u-map .u-prepend {
|
|
418
440
|
font-size: 14px;
|
|
@@ -429,10 +451,10 @@ export default {
|
|
|
429
451
|
|
|
430
452
|
.m-community-tag {
|
|
431
453
|
.u-prepend {
|
|
432
|
-
border-bottom-left-radius: 0!important;
|
|
454
|
+
border-bottom-left-radius: 0 !important;
|
|
433
455
|
}
|
|
434
456
|
.el-input__inner {
|
|
435
|
-
border-bottom-right-radius: 0!important;
|
|
457
|
+
border-bottom-right-radius: 0 !important;
|
|
436
458
|
}
|
|
437
459
|
}
|
|
438
460
|
|
|
@@ -451,5 +473,19 @@ export default {
|
|
|
451
473
|
margin-bottom: 10px;
|
|
452
474
|
}
|
|
453
475
|
}
|
|
476
|
+
|
|
477
|
+
.u-title-condition {
|
|
478
|
+
.flex;
|
|
479
|
+
.el-select {
|
|
480
|
+
margin-left: 0 !important;
|
|
481
|
+
top: 10px;
|
|
482
|
+
left: -10px;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
.m-user {
|
|
486
|
+
.flex;
|
|
487
|
+
align-items: center;
|
|
488
|
+
gap: 5px;
|
|
489
|
+
}
|
|
454
490
|
}
|
|
455
491
|
</style>
|