@jx3box/jx3box-common-ui 8.5.6 → 8.5.7
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/service/community.js +19 -0
- package/src/bread/AdminDrop.vue +11 -3
- package/src/bread/CommunityAdmin.vue +92 -43
package/package.json
CHANGED
package/service/community.js
CHANGED
|
@@ -15,3 +15,22 @@ export const updateTopicItem = (id, data) => {
|
|
|
15
15
|
export const deleteTopic = (id) => {
|
|
16
16
|
return $next().delete(`${API_PREFIX}/community/discussion/manage/topic/item/${id}`);
|
|
17
17
|
};
|
|
18
|
+
|
|
19
|
+
// status = pass:审核通过, reject:审核不通过 wait:待审核
|
|
20
|
+
export const auditTopic = (id, action) => {
|
|
21
|
+
return $next().put(`${API_PREFIX}/community/discussion/manage/topic/item/${id}/audit/${action}`);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param {*} id 帖子id
|
|
27
|
+
* @param {*} action 动作 top:置顶,star: 加精, hight: 高亮
|
|
28
|
+
* @param {*} value 1:确认操作, 0:取消操作
|
|
29
|
+
*/
|
|
30
|
+
export const manageTopic = (id, action, value) => {
|
|
31
|
+
return $next().put(`${API_PREFIX}/community/discussion/manage/topic/item/${id}/opt/${action}/${value}`);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const getTopicDetails = (id) => {
|
|
35
|
+
return $next().get(`${API_PREFIX}/community/discussion/topic/item/${id}`);
|
|
36
|
+
};
|
package/src/bread/AdminDrop.vue
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
</el-dropdown>
|
|
29
29
|
|
|
30
30
|
<design-task v-model="showDesignTask" :post="post"></design-task>
|
|
31
|
-
<CommunityAdmin v-model="communityAdminVisible" :
|
|
31
|
+
<CommunityAdmin v-model="communityAdminVisible" :postId="post.id" />
|
|
32
32
|
<MoveToCommunityDialog v-model="moveVisible" :post="post" />
|
|
33
33
|
</div>
|
|
34
34
|
</template>
|
|
@@ -81,10 +81,18 @@ export default {
|
|
|
81
81
|
return User.isEditor();
|
|
82
82
|
},
|
|
83
83
|
sourceId() {
|
|
84
|
-
|
|
84
|
+
if (this.isCommunity) {
|
|
85
|
+
return this.post?.id;
|
|
86
|
+
} else {
|
|
87
|
+
return this.post?.ID;
|
|
88
|
+
}
|
|
85
89
|
},
|
|
86
90
|
sourceType() {
|
|
87
|
-
|
|
91
|
+
if (this.isCommunity) {
|
|
92
|
+
return "community";
|
|
93
|
+
} else {
|
|
94
|
+
return this.post?.post_type;
|
|
95
|
+
}
|
|
88
96
|
},
|
|
89
97
|
},
|
|
90
98
|
methods: {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
>
|
|
11
11
|
<div class="c-admin-wrapper">
|
|
12
12
|
<el-divider content-position="left">标签</el-divider>
|
|
13
|
-
<!-- <el-radio-group v-model="
|
|
13
|
+
<!-- <el-radio-group v-model="tags" class="c-admin-status" size="small">
|
|
14
14
|
<el-radio-button v-for="(option, key) in categoryList" :label="key" :key="key">{{
|
|
15
15
|
option
|
|
16
16
|
}}</el-radio-button>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="u-condition u-map">
|
|
21
21
|
<span class="u-prepend el-input-group__prepend">标签</span>
|
|
22
22
|
<el-select
|
|
23
|
-
v-model="
|
|
23
|
+
v-model="form.tags"
|
|
24
24
|
multiple
|
|
25
25
|
filterable
|
|
26
26
|
allow-create
|
|
@@ -42,10 +42,24 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<el-divider content-position="left">高亮置顶</el-divider>
|
|
45
|
-
<el-checkbox
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
<el-checkbox
|
|
46
|
+
class="c-admin-highlight-checkbox"
|
|
47
|
+
v-model="form.is_top"
|
|
48
|
+
@change="onManageTopic($event, 'top')"
|
|
49
|
+
:true-label="1"
|
|
50
|
+
:false-label="0"
|
|
48
51
|
>
|
|
52
|
+
置顶
|
|
53
|
+
</el-checkbox>
|
|
54
|
+
<el-checkbox
|
|
55
|
+
class="c-admin-highlight-checkbox"
|
|
56
|
+
v-model="form.is_star"
|
|
57
|
+
@change="onManageTopic($event, 'star')"
|
|
58
|
+
:true-label="1"
|
|
59
|
+
:false-label="0"
|
|
60
|
+
>
|
|
61
|
+
精选
|
|
62
|
+
</el-checkbox>
|
|
49
63
|
<el-checkbox class="c-admin-highlight-checkbox" v-model="form.is_hight">高亮</el-checkbox>
|
|
50
64
|
<span v-show="showColors">
|
|
51
65
|
<el-color-picker
|
|
@@ -62,20 +76,28 @@
|
|
|
62
76
|
<el-divider content-position="left">状态变更</el-divider>
|
|
63
77
|
<div>
|
|
64
78
|
<el-button type="danger" @click="deleteTopic">删除帖子</el-button>
|
|
65
|
-
<el-button type="warning">转为待审核</el-button>
|
|
79
|
+
<el-button type="warning" @click="handleCheck">转为待审核</el-button>
|
|
66
80
|
</div>
|
|
67
81
|
|
|
68
|
-
<el-divider content-position="left"
|
|
82
|
+
<el-divider content-position="left"></el-divider>
|
|
69
83
|
<div>
|
|
70
|
-
<el-button type="primary" @click="submit" :loading="pushing">提交修改</el-button>
|
|
71
|
-
<el-button type="
|
|
84
|
+
<!-- <el-button type="primary" @click="submit" :loading="pushing">提交修改</el-button> -->
|
|
85
|
+
<el-button type="primary" @click="close">关闭窗口</el-button>
|
|
72
86
|
</div>
|
|
73
87
|
</div>
|
|
74
88
|
</el-drawer>
|
|
75
89
|
</template>
|
|
76
90
|
|
|
77
91
|
<script>
|
|
78
|
-
import {
|
|
92
|
+
import { post } from "jquery";
|
|
93
|
+
import {
|
|
94
|
+
auditTopic,
|
|
95
|
+
deleteTopic,
|
|
96
|
+
getTopicBucket,
|
|
97
|
+
getTopicDetails,
|
|
98
|
+
manageTopic,
|
|
99
|
+
updateTopicItem,
|
|
100
|
+
} from "../../service/community";
|
|
79
101
|
|
|
80
102
|
export default {
|
|
81
103
|
name: "CommunityAdmin",
|
|
@@ -84,11 +106,9 @@ export default {
|
|
|
84
106
|
type: Boolean,
|
|
85
107
|
default: false,
|
|
86
108
|
},
|
|
87
|
-
|
|
88
|
-
type:
|
|
89
|
-
default:
|
|
90
|
-
return {};
|
|
91
|
-
},
|
|
109
|
+
postId: {
|
|
110
|
+
type: Number,
|
|
111
|
+
default: 0,
|
|
92
112
|
},
|
|
93
113
|
},
|
|
94
114
|
model: {
|
|
@@ -98,7 +118,7 @@ export default {
|
|
|
98
118
|
emits: ["update:modelValue"],
|
|
99
119
|
data() {
|
|
100
120
|
return {
|
|
101
|
-
|
|
121
|
+
post: null,
|
|
102
122
|
pushing: false,
|
|
103
123
|
categoryList: [],
|
|
104
124
|
color: "rgb(255,0,1)",
|
|
@@ -112,10 +132,10 @@ export default {
|
|
|
112
132
|
],
|
|
113
133
|
form: {
|
|
114
134
|
category: "",
|
|
115
|
-
|
|
116
|
-
is_top:
|
|
117
|
-
is_star:
|
|
118
|
-
is_hight:
|
|
135
|
+
tags: [],
|
|
136
|
+
is_top: "0",
|
|
137
|
+
is_star: "0",
|
|
138
|
+
is_hight: "0",
|
|
119
139
|
},
|
|
120
140
|
};
|
|
121
141
|
},
|
|
@@ -130,30 +150,28 @@ export default {
|
|
|
130
150
|
return {
|
|
131
151
|
...this.post,
|
|
132
152
|
category: this.form.category,
|
|
133
|
-
|
|
134
|
-
is_top: this.form.is_top
|
|
135
|
-
is_star: this.form.is_star
|
|
136
|
-
is_hight: this.form.is_hight
|
|
153
|
+
tags: this.form.tags,
|
|
154
|
+
is_top: this.form.is_top,
|
|
155
|
+
is_star: this.form.is_star,
|
|
156
|
+
is_hight: this.form.is_hight,
|
|
137
157
|
// color: this.color,
|
|
138
158
|
};
|
|
139
159
|
},
|
|
140
160
|
},
|
|
141
161
|
watch: {
|
|
162
|
+
post() {
|
|
163
|
+
this.form = {
|
|
164
|
+
...this.form,
|
|
165
|
+
is_hight: this.post.is_hight,
|
|
166
|
+
category: this.post.category,
|
|
167
|
+
is_top: this.post.is_top,
|
|
168
|
+
is_star: this.post.is_star,
|
|
169
|
+
tags: this.post.tags,
|
|
170
|
+
};
|
|
171
|
+
},
|
|
142
172
|
modelValue(val) {
|
|
143
173
|
if (val) {
|
|
144
|
-
|
|
145
|
-
this.form.is_hight = true;
|
|
146
|
-
}
|
|
147
|
-
if (this.post.is_star === 1) {
|
|
148
|
-
this.form.is_star = true;
|
|
149
|
-
}
|
|
150
|
-
if (this.post.is_top === 1) {
|
|
151
|
-
this.form.is_top = true;
|
|
152
|
-
}
|
|
153
|
-
if (this.post.tages) {
|
|
154
|
-
this.form.tages = this.post.tages;
|
|
155
|
-
}
|
|
156
|
-
this.form.category = this.post.category;
|
|
174
|
+
this.getTopicDetails();
|
|
157
175
|
}
|
|
158
176
|
},
|
|
159
177
|
},
|
|
@@ -161,27 +179,53 @@ export default {
|
|
|
161
179
|
this.getCategoryList();
|
|
162
180
|
},
|
|
163
181
|
methods: {
|
|
182
|
+
onManageTopic(e, action) {
|
|
183
|
+
const value = e ? 1 : 0;
|
|
184
|
+
manageTopic(this.post.id, action, value).then(() => {
|
|
185
|
+
this.$message({
|
|
186
|
+
type: "success",
|
|
187
|
+
message: "操作成功!",
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
handleCheck() {
|
|
192
|
+
this.$confirm(`此操作将该数据转为 待审核 状态, 是否继续?`, "提示", {
|
|
193
|
+
confirmButtonText: "确定",
|
|
194
|
+
cancelButtonText: "取消",
|
|
195
|
+
type: "warning",
|
|
196
|
+
}).then(() => {
|
|
197
|
+
auditTopic(id, "wait").then(() => {
|
|
198
|
+
this.$message({
|
|
199
|
+
type: "success",
|
|
200
|
+
message: "操作成功!",
|
|
201
|
+
});
|
|
202
|
+
this.load();
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
},
|
|
164
206
|
submit() {
|
|
165
207
|
const id = this.post.id;
|
|
166
208
|
if (!id) {
|
|
167
209
|
this.$message.error("ID不存在!");
|
|
168
210
|
return;
|
|
169
211
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
212
|
+
updateTopicItem(id, this.params).then((res) => {
|
|
213
|
+
this.$message.success("修改成功");
|
|
214
|
+
this.$emit("update:modelValue", false);
|
|
215
|
+
});
|
|
174
216
|
},
|
|
175
217
|
// 关闭
|
|
176
218
|
close() {
|
|
177
219
|
this.form = {
|
|
178
220
|
category: "",
|
|
179
|
-
|
|
221
|
+
tags: [],
|
|
180
222
|
is_top: false,
|
|
181
223
|
is_star: false,
|
|
182
224
|
is_hight: false,
|
|
183
225
|
};
|
|
184
|
-
this.$
|
|
226
|
+
this.$nextTick(() => {
|
|
227
|
+
this.$emit("update:modelValue", false);
|
|
228
|
+
});
|
|
185
229
|
},
|
|
186
230
|
getCategoryList() {
|
|
187
231
|
getTopicBucket({ type: "community" }).then((res) => {
|
|
@@ -209,6 +253,11 @@ export default {
|
|
|
209
253
|
});
|
|
210
254
|
});
|
|
211
255
|
},
|
|
256
|
+
getTopicDetails() {
|
|
257
|
+
getTopicDetails(this.postId).then((res) => {
|
|
258
|
+
this.post = res.data.data;
|
|
259
|
+
});
|
|
260
|
+
},
|
|
212
261
|
},
|
|
213
262
|
};
|
|
214
263
|
</script>
|