@jx3box/jx3box-common-ui 7.4.0 → 7.4.1
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
CHANGED
package/service/admin.js
CHANGED
|
@@ -12,4 +12,8 @@ function postSetting(data) {
|
|
|
12
12
|
return $cms().put(`/api/cms/post/${data.ID}/setting`, data);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
function sendMessage(data){
|
|
16
|
+
return $cms().post(`/api/cms/admin/direct-message`, data);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { getSetting, postSetting, sendMessage };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a
|
|
3
|
+
class="u-message el-button el-button--warning el-button--medium u-op-public"
|
|
4
|
+
@click="onButtonClick"
|
|
5
|
+
>
|
|
6
|
+
<i class="el-icon-message"></i>
|
|
7
|
+
<span>私信</span>
|
|
8
|
+
</a>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import { sendMessage } from "../../service/admin";
|
|
13
|
+
export default {
|
|
14
|
+
name: "AdminDirectMessage",
|
|
15
|
+
props: {
|
|
16
|
+
size: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "medium",
|
|
19
|
+
},
|
|
20
|
+
sourceId: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 0,
|
|
23
|
+
},
|
|
24
|
+
sourceType: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "",
|
|
27
|
+
},
|
|
28
|
+
userId: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 0,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
onButtonClick() {
|
|
35
|
+
this.$prompt("请输入私信内容", "管理私信", {
|
|
36
|
+
confirmButtonText: "确定",
|
|
37
|
+
cancelButtonText: "取消",
|
|
38
|
+
inputPlaceholder: "请输入私信内容",
|
|
39
|
+
inputValidator: (value) => {
|
|
40
|
+
if (!value) {
|
|
41
|
+
return "请输入私信内容";
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
beforeClose: (action, instance, done) => {
|
|
45
|
+
if (action === "confirm") {
|
|
46
|
+
const data = {
|
|
47
|
+
id: this.sourceId,
|
|
48
|
+
source_type: this.sourceType,
|
|
49
|
+
user_id: this.userId,
|
|
50
|
+
content: "运营通知:" + instance.inputValue,
|
|
51
|
+
};
|
|
52
|
+
sendMessage(data).then(() => {
|
|
53
|
+
this.$message.success("私信成功");
|
|
54
|
+
done();
|
|
55
|
+
})
|
|
56
|
+
} else {
|
|
57
|
+
done();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</script>
|