@jx3box/jx3box-common-ui 7.4.0 → 7.4.2

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