@jx3box/jx3box-vue3-ui 1.0.5 → 1.0.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 +3 -3
- package/service/cms.js +37 -12
- package/src/bread/AdminDrop.vue +40 -12
- package/src/editor/Tinymce.vue +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-vue3-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "JX3BOX Vue3 UI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@element-plus/icons-vue": "^2.1.0",
|
|
29
29
|
"@jx3box/jx3box-common": "^8.7.1",
|
|
30
|
-
"@jx3box/jx3box-data": "^3.8.
|
|
31
|
-
"@jx3box/jx3box-emotion": "^1.2.
|
|
30
|
+
"@jx3box/jx3box-data": "^3.8.3",
|
|
31
|
+
"@jx3box/jx3box-emotion": "^1.2.14",
|
|
32
32
|
"@jx3box/jx3box-macro": "^1.0.1",
|
|
33
33
|
"@jx3box/jx3box-talent": "^1.3.3",
|
|
34
34
|
"@jx3box/reporter": "^0.0.4",
|
package/service/cms.js
CHANGED
|
@@ -28,7 +28,7 @@ function checkTeamMember() {
|
|
|
28
28
|
return $cms().get(`/api/cms/config/teammates/check`);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function getSliders(source_type, source_ids, client="std") {
|
|
31
|
+
function getSliders(source_type, source_ids, client = "std") {
|
|
32
32
|
let _params = {
|
|
33
33
|
type: "slider",
|
|
34
34
|
source_type,
|
|
@@ -56,26 +56,29 @@ function getTopicBucket(params) {
|
|
|
56
56
|
|
|
57
57
|
// 获取config
|
|
58
58
|
function getConfig(params) {
|
|
59
|
-
return $cms()
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
return $cms()
|
|
60
|
+
.get(`/api/cms/config`, { params })
|
|
61
|
+
.then((res) => {
|
|
62
|
+
return res.data.data;
|
|
63
|
+
});
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
// 获取用户meta
|
|
65
67
|
function getUserMeta(params) {
|
|
66
|
-
return $cms()
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
return $cms()
|
|
69
|
+
.get(`/api/cms/user/my/meta`, { params })
|
|
70
|
+
.then((res) => {
|
|
71
|
+
return res.data.data;
|
|
72
|
+
});
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
// 设置用户meta
|
|
72
|
-
function setUserMeta(key,data) {
|
|
76
|
+
function setUserMeta(key, data) {
|
|
73
77
|
return $cms().post(`/api/cms/user/my/meta?key=${key}`, data);
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
function getUserHonor(uid) {
|
|
77
|
-
return $cms({ mute: true })
|
|
78
|
-
.get(`/api/cms/user/honor/${uid}/using`)
|
|
81
|
+
return $cms({ mute: true }).get(`/api/cms/user/honor/${uid}/using`);
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
// 获取用户列表
|
|
@@ -96,5 +99,27 @@ function uploadFile(data) {
|
|
|
96
99
|
return $cms().post(`/api/cms/upload`, data);
|
|
97
100
|
}
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
// 创建qqbot图片任务 刷图
|
|
103
|
+
function refreshQQBotImage(data) {
|
|
104
|
+
return $cms().post(`/api/cms/qqbot/picture_task`, data);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
getPostAuthors,
|
|
109
|
+
uploadImage,
|
|
110
|
+
upload,
|
|
111
|
+
getDecoration,
|
|
112
|
+
getDecorationJson,
|
|
113
|
+
checkTeamMember,
|
|
114
|
+
getSliders,
|
|
115
|
+
getCollection,
|
|
116
|
+
getTopicBucket,
|
|
117
|
+
getConfig,
|
|
118
|
+
getUserMeta,
|
|
119
|
+
setUserMeta,
|
|
120
|
+
getUserHonor,
|
|
121
|
+
loadAuthors,
|
|
122
|
+
loadEmotions,
|
|
123
|
+
uploadFile,
|
|
124
|
+
refreshQQBotImage,
|
|
125
|
+
};
|
package/src/bread/AdminDrop.vue
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="c-admin-drop">
|
|
3
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
|
-
|
|
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
6
|
</el-button>
|
|
7
7
|
<template #dropdown>
|
|
8
8
|
<el-dropdown-menu>
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
<el-dropdown-item icon="UploadFilled" command="designTask" v-if="hasPermission('push_banner')">
|
|
16
16
|
<span>推送</span>
|
|
17
17
|
</el-dropdown-item>
|
|
18
|
+
<el-dropdown-item icon="Refresh" command="pictureTask">
|
|
19
|
+
<span>刷图</span>
|
|
20
|
+
</el-dropdown-item>
|
|
18
21
|
</el-dropdown-menu>
|
|
19
22
|
</template>
|
|
20
23
|
</el-dropdown>
|
|
@@ -28,10 +31,11 @@ import Bus from "../../utils/bus";
|
|
|
28
31
|
import User from "@jx3box/jx3box-common/js/user";
|
|
29
32
|
import DesignTask from "./DesignTask.vue";
|
|
30
33
|
import { sendMessage } from "../../service/admin";
|
|
34
|
+
import { refreshQQBotImage } from "@/service/cms";
|
|
31
35
|
export default {
|
|
32
36
|
name: "AdminDrop",
|
|
33
37
|
components: {
|
|
34
|
-
DesignTask
|
|
38
|
+
DesignTask,
|
|
35
39
|
},
|
|
36
40
|
props: {
|
|
37
41
|
buttonSize: {
|
|
@@ -50,17 +54,17 @@ export default {
|
|
|
50
54
|
data() {
|
|
51
55
|
return {
|
|
52
56
|
showDesignTask: false,
|
|
53
|
-
}
|
|
57
|
+
};
|
|
54
58
|
},
|
|
55
59
|
computed: {
|
|
56
60
|
isEditor() {
|
|
57
61
|
return User.isEditor();
|
|
58
62
|
},
|
|
59
63
|
sourceId() {
|
|
60
|
-
return this.post?.ID
|
|
64
|
+
return this.post?.ID;
|
|
61
65
|
},
|
|
62
66
|
sourceType() {
|
|
63
|
-
return this.post?.post_type
|
|
67
|
+
return this.post?.post_type;
|
|
64
68
|
},
|
|
65
69
|
},
|
|
66
70
|
methods: {
|
|
@@ -88,25 +92,49 @@ export default {
|
|
|
88
92
|
user_id: this.userId,
|
|
89
93
|
content: "运营通知:" + instance.inputValue,
|
|
90
94
|
type: "system",
|
|
91
|
-
subtype: "admin_message"
|
|
95
|
+
subtype: "admin_message",
|
|
92
96
|
};
|
|
93
97
|
sendMessage(data).then(() => {
|
|
94
98
|
this.$message.success("私信成功");
|
|
95
99
|
done();
|
|
96
|
-
})
|
|
100
|
+
});
|
|
97
101
|
} else {
|
|
98
102
|
done();
|
|
99
103
|
}
|
|
100
|
-
}
|
|
101
|
-
}).catch(() => {})
|
|
104
|
+
},
|
|
105
|
+
}).catch(() => {});
|
|
102
106
|
},
|
|
103
107
|
designTask() {
|
|
104
108
|
this.showDesignTask = true;
|
|
105
109
|
},
|
|
110
|
+
pictureTask() {
|
|
111
|
+
const pathname = location.pathname;
|
|
112
|
+
// 适用于pvp/1234 horse/1_234 等
|
|
113
|
+
const pattern = /\/([^/]+)\/([\d_]+)/;
|
|
114
|
+
const match = pathname.match(pattern);
|
|
115
|
+
let task_type = "";
|
|
116
|
+
let task_target_id = "";
|
|
117
|
+
if (match) {
|
|
118
|
+
task_type = match[1];
|
|
119
|
+
task_target_id = match[2];
|
|
120
|
+
}
|
|
121
|
+
if (task_type && task_target_id) {
|
|
122
|
+
refreshQQBotImage({
|
|
123
|
+
task_type,
|
|
124
|
+
task_target_id,
|
|
125
|
+
}).then((res) => {
|
|
126
|
+
if (!res.data.code) {
|
|
127
|
+
this.$message.success("QQ机器人图片生成提交成功");
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
} else {
|
|
131
|
+
this.$message.error("参数不正确");
|
|
132
|
+
}
|
|
133
|
+
},
|
|
106
134
|
hasPermission(permission) {
|
|
107
135
|
return User.hasPermission(permission);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
136
|
+
},
|
|
137
|
+
},
|
|
110
138
|
};
|
|
111
139
|
</script>
|
|
112
140
|
|
package/src/editor/Tinymce.vue
CHANGED
|
@@ -182,7 +182,7 @@ export default {
|
|
|
182
182
|
if (!emotion.filename.startsWith("http")) {
|
|
183
183
|
src = `${__imgPath}emotion/output/${emotion.filename}`;
|
|
184
184
|
}
|
|
185
|
-
const IMAGE = `<img class="t-emotion" src="${src}" alt="${src}" />`;
|
|
185
|
+
const IMAGE = `<img class="t-emotion" src="${src}" alt="${src}" style="max-width:60px; max-height: 60px"/>`;
|
|
186
186
|
tinyMCE.editors["tinymce"].insertContent(IMAGE);
|
|
187
187
|
},
|
|
188
188
|
},
|