@jx3box/jx3box-vue3-ui 0.7.2 → 0.7.4
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 +4 -4
- package/service/cms.js +31 -28
- package/service/design.js +13 -0
- package/src/App.vue +3 -3
- package/src/Breadcrumb.vue +13 -5
- package/src/bread/Admin.vue +46 -8
- package/src/bread/AdminDirectMessage.vue +1 -1
- package/src/bread/AdminDrop.vue +123 -0
- package/src/bread/DesignTask.vue +194 -0
- package/src/comment/CommentContent.vue +5 -5
- package/src/comment/CommentContentSimple.vue +3 -3
- package/src/header/UserInfo.vue +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-vue3-ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"description": "JX3BOX Vue3 UI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@element-plus/icons-vue": "^2.1.0",
|
|
29
|
-
"@jx3box/jx3box-common": "^8.2.
|
|
29
|
+
"@jx3box/jx3box-common": "^8.2.17",
|
|
30
30
|
"@jx3box/jx3box-data": "^3.5.8",
|
|
31
|
-
"@jx3box/jx3box-emotion": "^1.2.
|
|
31
|
+
"@jx3box/jx3box-emotion": "^1.2.7",
|
|
32
32
|
"@jx3box/jx3box-macro": "^1.0.1",
|
|
33
33
|
"@jx3box/jx3box-talent": "^1.2.7",
|
|
34
34
|
"@jx3box/reporter": "^0.0.4",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"js-base64": "^3.7.5",
|
|
45
45
|
"katex": "^0.16.9",
|
|
46
46
|
"lodash": "^4.17.21",
|
|
47
|
-
"mitt": "^3.0.
|
|
47
|
+
"mitt": "^3.0.1",
|
|
48
48
|
"qrcode.vue": "^3.3.4",
|
|
49
49
|
"sortablejs": "^1.15.0",
|
|
50
50
|
"url": "^0.11.3",
|
package/service/cms.js
CHANGED
|
@@ -5,24 +5,6 @@ function getPostAuthors(post_id) {
|
|
|
5
5
|
return $cms({ mute: true }).get(`/api/cms/post/${post_id}/authors`);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
function uploadFile(data) {
|
|
9
|
-
return $cms().post(`/api/cms/upload`, data);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// 获取用户列表
|
|
13
|
-
function loadAuthors(params) {
|
|
14
|
-
return $cms().get(`/api/cms/user/list`, {
|
|
15
|
-
params: params,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// 获取表情列表
|
|
20
|
-
function loadEmotions(params) {
|
|
21
|
-
return $cms().get(`/api/cms/post/emotions`, {
|
|
22
|
-
params: params,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
8
|
function uploadImage(formData) {
|
|
27
9
|
return $cms().post(`/api/cms/upload/avatar`, formData);
|
|
28
10
|
}
|
|
@@ -36,26 +18,22 @@ function getDecorationJson() {
|
|
|
36
18
|
let url = JX3BOX.__imgPath + "decoration/index.json";
|
|
37
19
|
return axios.get(url);
|
|
38
20
|
}
|
|
39
|
-
function getHonorJson() {
|
|
40
|
-
let url = JX3BOX.__imgPath + "decoration/honor.json";
|
|
41
|
-
return axios.get(url);
|
|
42
|
-
}
|
|
43
21
|
// 通用上传
|
|
44
22
|
function upload(formData) {
|
|
45
23
|
return $cms().post(`/api/cms/upload`, formData);
|
|
46
24
|
}
|
|
47
25
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
26
|
+
// 检测当前用户是否为团队成员
|
|
27
|
+
function checkTeamMember() {
|
|
28
|
+
return $cms().get(`/api/cms/config/teammates/check`);
|
|
51
29
|
}
|
|
52
30
|
|
|
53
|
-
function getSliders(source_type, source_ids, client=
|
|
31
|
+
function getSliders(source_type, source_ids, client="std") {
|
|
54
32
|
let _params = {
|
|
55
33
|
type: "slider",
|
|
56
34
|
source_type,
|
|
57
35
|
per: 10,
|
|
58
|
-
client
|
|
36
|
+
client,
|
|
59
37
|
};
|
|
60
38
|
|
|
61
39
|
if (source_ids) {
|
|
@@ -71,4 +49,29 @@ function getCollection(id) {
|
|
|
71
49
|
return $cms({ mute: true }).get(`/api/cms/post/collection/${id}`);
|
|
72
50
|
}
|
|
73
51
|
|
|
74
|
-
|
|
52
|
+
// 获取自定义主题
|
|
53
|
+
function getTopicBucket(params) {
|
|
54
|
+
return $cms().get(`/api/cms/topic/bucket`, { params });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 获取config
|
|
58
|
+
function getConfig(params) {
|
|
59
|
+
return $cms().get(`/api/cms/config`, { params }).then((res) => {
|
|
60
|
+
return res.data.data;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 获取用户meta
|
|
65
|
+
function getUserMeta(params) {
|
|
66
|
+
return $cms().get(`/api/cms/user/my/meta`, { params }).then((res) => {
|
|
67
|
+
return res.data.data;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// 设置用户meta
|
|
72
|
+
function setUserMeta(key,data) {
|
|
73
|
+
return $cms().post(`/api/cms/user/my/meta?key=${key}`, data);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson, checkTeamMember,
|
|
77
|
+
getSliders, getCollection, getTopicBucket, getConfig, getUserMeta, setUserMeta };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { $cms } from "@jx3box/jx3box-common/js/https_v2";
|
|
2
|
+
|
|
3
|
+
export const createDesignTask = (data) => {
|
|
4
|
+
return $cms().post(`/api/cms/design/task`, data);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const getDesignTask = (params) => {
|
|
8
|
+
return $cms().get(`/api/cms/design/task/log`, { params });
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const getConfigBannerTypes = (params) => {
|
|
12
|
+
return $cms().get(`/api/cms/config/banner/types`, { params });
|
|
13
|
+
}
|
package/src/App.vue
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
<template #op-prepend>
|
|
17
17
|
|
|
18
|
-
<AdminDirectMessage :user-id="8" :sourceId="19382" sourceType="macro"></AdminDirectMessage>
|
|
18
|
+
<!-- <AdminDirectMessage :user-id="8" :sourceId="19382" sourceType="macro"></AdminDirectMessage> -->
|
|
19
19
|
</template>
|
|
20
20
|
</breadcrumb>
|
|
21
21
|
<LeftSidebar :open="true" :uid="7">
|
|
@@ -91,7 +91,7 @@ import PostTopic from "./single/PostTopic.vue";
|
|
|
91
91
|
import axios from "axios";
|
|
92
92
|
import post_topics from "@jx3box/jx3box-common/data/post_topics.json";
|
|
93
93
|
import { get_item } from "../service/item";
|
|
94
|
-
import AdminDirectMessage from "./bread/AdminDirectMessage.vue";
|
|
94
|
+
// import AdminDirectMessage from "./bread/AdminDirectMessage.vue";
|
|
95
95
|
// import Admin from "@/bread/Admin.vue";
|
|
96
96
|
export default {
|
|
97
97
|
name: "App",
|
|
@@ -103,7 +103,7 @@ export default {
|
|
|
103
103
|
// PostHeader,
|
|
104
104
|
PostTopic,
|
|
105
105
|
UploadAlum,
|
|
106
|
-
AdminDirectMessage,
|
|
106
|
+
// AdminDirectMessage,
|
|
107
107
|
singlebox,
|
|
108
108
|
// Admin,
|
|
109
109
|
},
|
package/src/Breadcrumb.vue
CHANGED
|
@@ -34,8 +34,9 @@
|
|
|
34
34
|
<el-icon><InfoFilled /></el-icon>
|
|
35
35
|
<span>反馈</span>
|
|
36
36
|
</a>
|
|
37
|
-
<AdminButton v-if="adminEnable" class="u-admin" />
|
|
38
|
-
<Admin v-if="adminEnable" />
|
|
37
|
+
<!-- <AdminButton v-if="adminEnable" class="u-admin" /> -->
|
|
38
|
+
<Admin v-if="adminEnable" :marksOptions="adminMarks" :show-extend="showExtend" :app="slug" :subtypeMap="subtypeMap" />
|
|
39
|
+
<!-- <AdminDrop v-if="adminEnable" /> -->
|
|
39
40
|
<slot name="op-prepend"></slot>
|
|
40
41
|
</div>
|
|
41
42
|
</div>
|
|
@@ -47,7 +48,8 @@ import { publishLink, getAppIcon } from "@jx3box/jx3box-common/js/utils";
|
|
|
47
48
|
import User from "@jx3box/jx3box-common/js/user";
|
|
48
49
|
import Admin from "./bread/Admin";
|
|
49
50
|
import Crumb from "./bread/Crumb";
|
|
50
|
-
import AdminButton from "./bread/AdminButton";
|
|
51
|
+
// import AdminButton from "./bread/AdminButton";
|
|
52
|
+
// import AdminDrop from "./bread/AdminDrop";
|
|
51
53
|
|
|
52
54
|
import { isApp } from "../assets/js/app.js";
|
|
53
55
|
import Bus from "../utils/bus";
|
|
@@ -55,15 +57,20 @@ import Bus from "../utils/bus";
|
|
|
55
57
|
export default {
|
|
56
58
|
name: "CommonBreadcrumb",
|
|
57
59
|
props: [
|
|
58
|
-
|
|
60
|
+
"name",
|
|
59
61
|
"slug",
|
|
60
62
|
"root",
|
|
61
63
|
"publishEnable",
|
|
62
64
|
"adminEnable",
|
|
65
|
+
"topicEnable",
|
|
63
66
|
"feedbackEnable",
|
|
64
67
|
"overlayEnable",
|
|
65
68
|
"crumbEnable",
|
|
66
69
|
"withoutLeft",
|
|
70
|
+
"adminMarks",
|
|
71
|
+
"icon",
|
|
72
|
+
"subtypeMap",
|
|
73
|
+
"showExtend"
|
|
67
74
|
],
|
|
68
75
|
data: function () {
|
|
69
76
|
return {
|
|
@@ -126,7 +133,8 @@ export default {
|
|
|
126
133
|
components: {
|
|
127
134
|
Admin,
|
|
128
135
|
Crumb,
|
|
129
|
-
AdminButton,
|
|
136
|
+
// AdminButton,
|
|
137
|
+
// AdminDrop
|
|
130
138
|
},
|
|
131
139
|
};
|
|
132
140
|
</script>
|
package/src/bread/Admin.vue
CHANGED
|
@@ -112,12 +112,17 @@ import { getRewrite } from "@jx3box/jx3box-common/js/utils";
|
|
|
112
112
|
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
|
|
113
113
|
import { getSetting, postSetting } from "../../service/admin";
|
|
114
114
|
import User from "@jx3box/jx3box-common/js/user";
|
|
115
|
-
import
|
|
115
|
+
import { cms as marks } from "@jx3box/jx3box-common/data/mark.json";
|
|
116
|
+
import { getTopicBucket } from "../../service/cms";
|
|
116
117
|
// import { onClickOutside } from "@vueuse/core";
|
|
117
118
|
export default {
|
|
118
119
|
name: "BreadAdmin",
|
|
119
120
|
emits: ["update"],
|
|
120
121
|
props: {
|
|
122
|
+
marksOptions: {
|
|
123
|
+
type: Object,
|
|
124
|
+
default: () => {},
|
|
125
|
+
},
|
|
121
126
|
// 入口是否是后台管理/list
|
|
122
127
|
fromList: {
|
|
123
128
|
type: Boolean,
|
|
@@ -136,6 +141,18 @@ export default {
|
|
|
136
141
|
type: Boolean,
|
|
137
142
|
default: false,
|
|
138
143
|
},
|
|
144
|
+
showExtend: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: false,
|
|
147
|
+
},
|
|
148
|
+
subtypeMap: {
|
|
149
|
+
type: Object,
|
|
150
|
+
default: () => {},
|
|
151
|
+
},
|
|
152
|
+
app: {
|
|
153
|
+
type: String,
|
|
154
|
+
default: "",
|
|
155
|
+
},
|
|
139
156
|
},
|
|
140
157
|
data() {
|
|
141
158
|
return {
|
|
@@ -164,7 +181,6 @@ export default {
|
|
|
164
181
|
|
|
165
182
|
// 角标
|
|
166
183
|
mark: [],
|
|
167
|
-
mark_options: MARK.cms,
|
|
168
184
|
|
|
169
185
|
// 高亮
|
|
170
186
|
isHighlight: false,
|
|
@@ -181,6 +197,7 @@ export default {
|
|
|
181
197
|
// 置顶
|
|
182
198
|
isSticky: false,
|
|
183
199
|
sticky: 0,
|
|
200
|
+
isStar: 0,
|
|
184
201
|
|
|
185
202
|
// 海报
|
|
186
203
|
uploadurl: JX3BOX.__cms + "api/cms/upload",
|
|
@@ -190,6 +207,9 @@ export default {
|
|
|
190
207
|
// 类型
|
|
191
208
|
post_type: "",
|
|
192
209
|
type_options: [],
|
|
210
|
+
post_subtype: "",
|
|
211
|
+
topics: [],
|
|
212
|
+
tags: [],
|
|
193
213
|
|
|
194
214
|
// 作者
|
|
195
215
|
post_author: "",
|
|
@@ -207,11 +227,19 @@ export default {
|
|
|
207
227
|
color: this.isHighlight ? this.color : "",
|
|
208
228
|
mark: this.mark || [],
|
|
209
229
|
sticky: this.isSticky ? Date.now() : null,
|
|
230
|
+
star: this.isStar,
|
|
231
|
+
topics: this.topics,
|
|
232
|
+
post_subtype: this.post_subtype,
|
|
210
233
|
};
|
|
211
234
|
},
|
|
212
235
|
isAdmin: function () {
|
|
213
236
|
return User.isAdmin();
|
|
214
237
|
},
|
|
238
|
+
mark_options: function () {
|
|
239
|
+
return this.marksOptions && Object.keys(this.marksOptions)
|
|
240
|
+
? Object.assign({}, marks, this.marksOptions)
|
|
241
|
+
: marks;
|
|
242
|
+
},
|
|
215
243
|
},
|
|
216
244
|
methods: {
|
|
217
245
|
// 是否有权限
|
|
@@ -259,7 +287,7 @@ export default {
|
|
|
259
287
|
// 拉
|
|
260
288
|
pull: function () {
|
|
261
289
|
getSetting(this.pid).then((data) => {
|
|
262
|
-
let { ID, color, mark, post_status, post_author, sticky, post_banner, post_type, visible } = data;
|
|
290
|
+
let { ID, color, mark, post_status, post_author, sticky, post_banner, post_type, visible, star, post_subtype, topics } = data;
|
|
263
291
|
this.pid = ID;
|
|
264
292
|
this.post_status = post_status;
|
|
265
293
|
this.visible = visible;
|
|
@@ -272,6 +300,10 @@ export default {
|
|
|
272
300
|
this.sticky = sticky || 0;
|
|
273
301
|
if (this.sticky) this.isSticky = true;
|
|
274
302
|
|
|
303
|
+
this.isStar = star || 0;
|
|
304
|
+
this.topics = topics?.map(item => item.topic) || [];
|
|
305
|
+
this.post_subtype = post_subtype || "";
|
|
306
|
+
|
|
275
307
|
// 设置加载完成标识
|
|
276
308
|
this.pulled = true;
|
|
277
309
|
});
|
|
@@ -299,6 +331,13 @@ export default {
|
|
|
299
331
|
this.close();
|
|
300
332
|
});
|
|
301
333
|
},
|
|
334
|
+
// 获取topic标签
|
|
335
|
+
loadTopic() {
|
|
336
|
+
getTopicBucket({ type: "bbs" }).then((res) => {
|
|
337
|
+
const data = res.data.data?.map((item) => item.name) || [];
|
|
338
|
+
this.tags = data;
|
|
339
|
+
});
|
|
340
|
+
},
|
|
302
341
|
},
|
|
303
342
|
watch: {
|
|
304
343
|
"$route.params.id": function () {
|
|
@@ -336,12 +375,11 @@ export default {
|
|
|
336
375
|
if (this.pid && this.hasRight) {
|
|
337
376
|
this.pull();
|
|
338
377
|
}
|
|
339
|
-
});
|
|
340
378
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
379
|
+
if (this.showExtend && this.app && this.dialog_visible) {
|
|
380
|
+
this.loadTopic();
|
|
381
|
+
}
|
|
382
|
+
});
|
|
345
383
|
},
|
|
346
384
|
};
|
|
347
385
|
</script>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="c-admin-drop">
|
|
3
|
+
<el-dropdown trigger="click" @command="handleCommand">
|
|
4
|
+
<el-button type="primary" class="c-admin-button c-admin-drop__button" :size="buttonSize" icon="Setting"
|
|
5
|
+
> 管理 <el-icon style="margin-left: 5px;"><ArrowDown></ArrowDown></el-icon>
|
|
6
|
+
</el-button>
|
|
7
|
+
<template #dropdown>
|
|
8
|
+
<el-dropdown-menu>
|
|
9
|
+
<el-dropdown-item v-if="isEditor" command="toggleAdminPanel" icon="Setting">
|
|
10
|
+
<span>设置</span>
|
|
11
|
+
</el-dropdown-item>
|
|
12
|
+
<el-dropdown-item v-if="isEditor" command="directMessage" icon="Message">
|
|
13
|
+
<span>私信</span>
|
|
14
|
+
</el-dropdown-item>
|
|
15
|
+
<el-dropdown-item icon="UploadFilled" command="designTask" v-if="hasPermission('push_banner')">
|
|
16
|
+
<span>推送</span>
|
|
17
|
+
</el-dropdown-item>
|
|
18
|
+
</el-dropdown-menu>
|
|
19
|
+
</template>
|
|
20
|
+
</el-dropdown>
|
|
21
|
+
|
|
22
|
+
<design-task v-model="showDesignTask" :post="post"></design-task>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import Bus from "../../utils/bus";
|
|
28
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
29
|
+
import DesignTask from "./DesignTask.vue";
|
|
30
|
+
import { sendMessage } from "../../service/admin";
|
|
31
|
+
export default {
|
|
32
|
+
name: "AdminDrop",
|
|
33
|
+
components: {
|
|
34
|
+
DesignTask
|
|
35
|
+
},
|
|
36
|
+
props: {
|
|
37
|
+
buttonSize: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "default",
|
|
40
|
+
},
|
|
41
|
+
post: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: () => {},
|
|
44
|
+
},
|
|
45
|
+
userId: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 0,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
data() {
|
|
51
|
+
return {
|
|
52
|
+
showDesignTask: false,
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
isEditor() {
|
|
57
|
+
return User.isEditor();
|
|
58
|
+
},
|
|
59
|
+
sourceId() {
|
|
60
|
+
return this.post?.ID
|
|
61
|
+
},
|
|
62
|
+
sourceType() {
|
|
63
|
+
return this.post?.post_type
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
methods: {
|
|
67
|
+
handleCommand(command) {
|
|
68
|
+
this[command]();
|
|
69
|
+
},
|
|
70
|
+
toggleAdminPanel() {
|
|
71
|
+
Bus.emit("toggleAdminPanel");
|
|
72
|
+
},
|
|
73
|
+
directMessage() {
|
|
74
|
+
this.$prompt("请输入私信内容", "管理私信", {
|
|
75
|
+
confirmButtonText: "确定",
|
|
76
|
+
cancelButtonText: "取消",
|
|
77
|
+
inputPlaceholder: "请输入私信内容",
|
|
78
|
+
inputValidator: (value) => {
|
|
79
|
+
if (!value) {
|
|
80
|
+
return "请输入私信内容";
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
beforeClose: (action, instance, done) => {
|
|
84
|
+
if (action === "confirm") {
|
|
85
|
+
const data = {
|
|
86
|
+
source_id: String(this.sourceId),
|
|
87
|
+
source_type: this.sourceType,
|
|
88
|
+
user_id: this.userId,
|
|
89
|
+
content: "运营通知:" + instance.inputValue,
|
|
90
|
+
type: "system",
|
|
91
|
+
subtype: "admin_message"
|
|
92
|
+
};
|
|
93
|
+
sendMessage(data).then(() => {
|
|
94
|
+
this.$message.success("私信成功");
|
|
95
|
+
done();
|
|
96
|
+
})
|
|
97
|
+
} else {
|
|
98
|
+
done();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}).catch(() => {})
|
|
102
|
+
},
|
|
103
|
+
designTask() {
|
|
104
|
+
this.showDesignTask = true;
|
|
105
|
+
},
|
|
106
|
+
hasPermission(permission) {
|
|
107
|
+
return User.hasPermission(permission);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<style lang="less">
|
|
114
|
+
.c-admin-drop {
|
|
115
|
+
float: right;
|
|
116
|
+
margin-top: -2px;
|
|
117
|
+
margin-right: 10px;
|
|
118
|
+
}
|
|
119
|
+
.c-admin-drop__button {
|
|
120
|
+
padding: 8px 18px !important;
|
|
121
|
+
align-items: center;
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog class="m-design-task" :width="isPhone ? '95%' : '600px'" :model-value="modelValue" @close="close" title="快捷推送" append-to-body>
|
|
3
|
+
<el-form :model="form" ref="form" :label-position="isPhone ? 'top' : 'left'" label-width="80px">
|
|
4
|
+
<el-form-item label="标题">
|
|
5
|
+
<el-input v-model="form.title" placeholder="请输入标题"></el-input>
|
|
6
|
+
</el-form-item>
|
|
7
|
+
<el-form-item label="类型">
|
|
8
|
+
<el-select v-model="form.type" placeholder="请选择类型" style="width:100%;" filterable>
|
|
9
|
+
<el-option v-for="item in config" :key="item.id" :label="item.label" :value="item.name"></el-option>
|
|
10
|
+
</el-select>
|
|
11
|
+
</el-form-item>
|
|
12
|
+
<el-form-item label="版本">
|
|
13
|
+
<el-radio-group v-model="form.version">
|
|
14
|
+
<el-radio-button v-for="(label, key) in versions" :key="key" :label="key">{{ label }}</el-radio-button>
|
|
15
|
+
</el-radio-group>
|
|
16
|
+
</el-form-item>
|
|
17
|
+
<el-form-item label="备注">
|
|
18
|
+
<el-input v-model="form.remark" placeholder="请输入备注"></el-input>
|
|
19
|
+
</el-form-item>
|
|
20
|
+
<el-form-item label="星级" class="m-star-line">
|
|
21
|
+
<el-rate v-model="form.star" :colors="colors"></el-rate>
|
|
22
|
+
</el-form-item>
|
|
23
|
+
</el-form>
|
|
24
|
+
|
|
25
|
+
<el-divider content-position="left">
|
|
26
|
+
近期推送
|
|
27
|
+
</el-divider>
|
|
28
|
+
<template v-if="logs && logs.length">
|
|
29
|
+
<el-table :data="logs" border size="small" max-height="300px">
|
|
30
|
+
<el-table-column label="推送时间" prop="push_at" align="center">
|
|
31
|
+
<template #default="{row}">
|
|
32
|
+
{{ formatTime(row.push_at) }}
|
|
33
|
+
</template>
|
|
34
|
+
</el-table-column>
|
|
35
|
+
<el-table-column label="推送人" prop="pusher.display_name" align="center"></el-table-column>
|
|
36
|
+
<el-table-column label="星级" prop="star" align="center">
|
|
37
|
+
<template #default="{row}">
|
|
38
|
+
<el-rate v-model="row.star" disabled :colors="colors"></el-rate>
|
|
39
|
+
</template>
|
|
40
|
+
</el-table-column>
|
|
41
|
+
<el-table-column label="备注" prop="remark" align="center"></el-table-column>
|
|
42
|
+
</el-table>
|
|
43
|
+
</template>
|
|
44
|
+
<el-alert v-else title="当前文章暂无历史推送" type="info" show-icon :closable="false"></el-alert>
|
|
45
|
+
<template #footer>
|
|
46
|
+
<el-button @click="close">取 消</el-button>
|
|
47
|
+
<el-button type="primary" @click="onConfirm">确 定</el-button>
|
|
48
|
+
</template>
|
|
49
|
+
</el-dialog>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
import { createDesignTask, getDesignTask, getConfigBannerTypes } from "../../service/design";
|
|
54
|
+
import {pick} from "lodash";
|
|
55
|
+
import dayjs from "dayjs";
|
|
56
|
+
import User from "@jx3box/jx3box-common/js/user";
|
|
57
|
+
export default {
|
|
58
|
+
name: "DesignTask",
|
|
59
|
+
props: {
|
|
60
|
+
modelValue: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
post: {
|
|
65
|
+
type: Object,
|
|
66
|
+
default: () => {}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
model: {
|
|
70
|
+
prop: "modelValue",
|
|
71
|
+
event: "update:modelValue"
|
|
72
|
+
},
|
|
73
|
+
emits: ["update:modelValue"],
|
|
74
|
+
data() {
|
|
75
|
+
return {
|
|
76
|
+
form: {
|
|
77
|
+
title: "",
|
|
78
|
+
remark: "",
|
|
79
|
+
star: 0,
|
|
80
|
+
subtype: "",
|
|
81
|
+
version: "std"
|
|
82
|
+
},
|
|
83
|
+
colors: ['#99A9BF', '#F7BA2A', '#FF9900'],
|
|
84
|
+
|
|
85
|
+
logs: [],
|
|
86
|
+
config: [],
|
|
87
|
+
|
|
88
|
+
isPhone: window.innerWidth < 768,
|
|
89
|
+
isEditor: User.isEditor(),
|
|
90
|
+
|
|
91
|
+
versions: {
|
|
92
|
+
"std": "旗舰",
|
|
93
|
+
"origin": "缘起",
|
|
94
|
+
"wujie": "无界",
|
|
95
|
+
"test": "体服"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
watch: {
|
|
100
|
+
modelValue(val) {
|
|
101
|
+
if (val) {
|
|
102
|
+
if (this.post) {
|
|
103
|
+
this.form.title = this.post.post_title;
|
|
104
|
+
}
|
|
105
|
+
this.loadLogs();
|
|
106
|
+
|
|
107
|
+
if (User.isTeammate()) {
|
|
108
|
+
this.loadConfig();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
methods: {
|
|
114
|
+
close(){
|
|
115
|
+
this.$emit("update:modelValue",false)
|
|
116
|
+
},
|
|
117
|
+
clearForm() {
|
|
118
|
+
this.form = {
|
|
119
|
+
title: "",
|
|
120
|
+
remark: "",
|
|
121
|
+
star: 0,
|
|
122
|
+
subtype: "",
|
|
123
|
+
version: "std",
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
this.$refs?.form?.clearValidate();
|
|
127
|
+
},
|
|
128
|
+
onConfirm() {
|
|
129
|
+
if (!this.post?.ID) return;
|
|
130
|
+
const data = pick(this.post, ["client", "author"]);
|
|
131
|
+
data.title = this.form.title;
|
|
132
|
+
data.remark = this.form.remark;
|
|
133
|
+
data.star = this.form.star;
|
|
134
|
+
data.subtype = this.form.type;
|
|
135
|
+
data.version = this.form.version;
|
|
136
|
+
|
|
137
|
+
data.source_type = this.post?.post_type;
|
|
138
|
+
data.source_id = String(this.post?.ID);
|
|
139
|
+
data.link = `/${this.post?.post_type}/${this.post?.ID}`;
|
|
140
|
+
data.flow = 0;
|
|
141
|
+
|
|
142
|
+
createDesignTask(data).then(() => {
|
|
143
|
+
this.$message.success("提交成功");
|
|
144
|
+
this.close();
|
|
145
|
+
})
|
|
146
|
+
},
|
|
147
|
+
onCancel() {
|
|
148
|
+
this.close();
|
|
149
|
+
this.clearForm();
|
|
150
|
+
},
|
|
151
|
+
loadLogs() {
|
|
152
|
+
if (!this.post?.ID) return;
|
|
153
|
+
getDesignTask({ source_id: this.post?.ID }).then(res => {
|
|
154
|
+
this.logs = res.data.data || [];
|
|
155
|
+
})
|
|
156
|
+
},
|
|
157
|
+
loadConfig() {
|
|
158
|
+
getConfigBannerTypes({ _no_page: 1 }).then(res => {
|
|
159
|
+
this.config = res.data.data || [];
|
|
160
|
+
this.config = this.config.filter(item => item.parent_id == 1);
|
|
161
|
+
})
|
|
162
|
+
},
|
|
163
|
+
formatTime(time) {
|
|
164
|
+
return dayjs(time).format("YYYY-MM-DD HH:mm:ss");
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</script>
|
|
169
|
+
|
|
170
|
+
<style lang="less">
|
|
171
|
+
.m-design-task {
|
|
172
|
+
.el-form-item {
|
|
173
|
+
margin-bottom: 12px;
|
|
174
|
+
}
|
|
175
|
+
.m-star-line {
|
|
176
|
+
.el-form-item__content {
|
|
177
|
+
top: 10px;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
.u-time {
|
|
181
|
+
color: #c0c4cc;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@media screen and (max-width: @phone) {
|
|
186
|
+
.m-design-task {
|
|
187
|
+
.m-star-line {
|
|
188
|
+
.el-form-item__content {
|
|
189
|
+
top: 0;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<el-button
|
|
20
20
|
class="u-admin"
|
|
21
21
|
v-if="!currentUserHadLike"
|
|
22
|
-
|
|
22
|
+
link
|
|
23
23
|
size="small"
|
|
24
24
|
@click="doLike(true)"
|
|
25
25
|
><img
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
>
|
|
31
31
|
<el-button
|
|
32
32
|
class="u-admin"
|
|
33
|
-
|
|
33
|
+
link
|
|
34
34
|
size="small"
|
|
35
35
|
v-if="currentUserHadLike"
|
|
36
36
|
@click="doLike(false)"
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
>
|
|
64
64
|
<el-button
|
|
65
65
|
class="u-admin"
|
|
66
|
-
|
|
66
|
+
link
|
|
67
67
|
size="small"
|
|
68
68
|
icon="Delete"
|
|
69
69
|
v-if="canHide"
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
<el-button
|
|
121
121
|
class="u-admin u-filter"
|
|
122
122
|
v-if="canAddWhite"
|
|
123
|
-
|
|
123
|
+
link
|
|
124
124
|
size="small"
|
|
125
125
|
@click="setWhiteComment(true)"
|
|
126
126
|
>
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
<el-button
|
|
135
135
|
class="u-admin u-filter"
|
|
136
136
|
v-if="canRemoveWhite"
|
|
137
|
-
|
|
137
|
+
link
|
|
138
138
|
size="small"
|
|
139
139
|
@click="setWhiteComment(false)"
|
|
140
140
|
><img
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<el-button
|
|
26
26
|
class="u-admin"
|
|
27
27
|
v-if="!currentUserHadLike"
|
|
28
|
-
|
|
28
|
+
link
|
|
29
29
|
size="mini"
|
|
30
30
|
@click="doLike(true)"
|
|
31
31
|
><img
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
>
|
|
39
39
|
<el-button
|
|
40
40
|
class="u-admin"
|
|
41
|
-
|
|
41
|
+
link
|
|
42
42
|
size="mini"
|
|
43
43
|
v-if="currentUserHadLike"
|
|
44
44
|
@click="doLike(false)"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
>
|
|
73
73
|
<el-button
|
|
74
74
|
class="u-admin"
|
|
75
|
-
|
|
75
|
+
link
|
|
76
76
|
size="mini"
|
|
77
77
|
icon="Delete"
|
|
78
78
|
v-if="canHide"
|
package/src/header/UserInfo.vue
CHANGED
|
@@ -195,6 +195,9 @@ export default {
|
|
|
195
195
|
this.user = data;
|
|
196
196
|
this.isSuperAuthor = !!data.sign;
|
|
197
197
|
this.isTeammate = this.user?.is_teammate;
|
|
198
|
+
localStorage.setItem("is_teammate", this.isTeammate);
|
|
199
|
+
const permissions = this.user?.permission?.map(item => item.action)?.join(",");
|
|
200
|
+
localStorage.setItem("jx3box_permission", permissions);
|
|
198
201
|
this.$emit("update", this.user);
|
|
199
202
|
if (this.user.deleted) {
|
|
200
203
|
this.logout(true);
|