@jx3box/jx3box-common-ui 8.6.3 → 8.6.5

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "8.6.3",
3
+ "version": "8.6.5",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -5,17 +5,20 @@
5
5
  ><i class="el-icon-setting"></i> 管理<i class="el-icon-arrow-down el-icon--right"></i>
6
6
  </el-button>
7
7
  <el-dropdown-menu slot="dropdown">
8
- <el-dropdown-item v-if="isEditor && !isCommunity" command="toggleAdminPanel" icon="el-icon-setting">
8
+ <el-dropdown-item v-if="hasPermission('update_post')" command="editPost" icon="el-icon-edit-outline">
9
+ <span>编辑</span>
10
+ </el-dropdown-item>
11
+ <el-dropdown-item v-if="!isCommunity && hasPermission('update_post')" command="toggleAdminPanel" icon="el-icon-setting">
9
12
  <span>设置</span>
10
13
  </el-dropdown-item>
11
14
  <el-dropdown-item
12
- v-else-if="isEditor && isCommunity"
15
+ v-else-if="isCommunity"
13
16
  command="toggleCommunityAdminPanel"
14
17
  icon="el-icon-setting"
15
18
  >
16
19
  <span>设置</span>
17
20
  </el-dropdown-item>
18
- <el-dropdown-item v-if="isEditor" command="directMessage" icon="el-icon-message">
21
+ <el-dropdown-item v-if="hasPermission('create_system_message')" command="directMessage" icon="el-icon-message">
19
22
  <span>私信</span>
20
23
  </el-dropdown-item>
21
24
  <el-dropdown-item v-if="isEditor && showMove" command="onMoveToCommunity" icon="el-icon-refresh">
@@ -28,7 +31,7 @@
28
31
  </el-dropdown>
29
32
 
30
33
  <design-task v-model="showDesignTask" :post="post"></design-task>
31
- <CommunityAdmin v-model="communityAdminVisible" :postId="post.id" />
34
+ <CommunityAdmin v-model="communityAdminVisible" :postId="post && post.id" />
32
35
  <MoveToCommunityDialog v-model="moveVisible" :post="post" />
33
36
  </div>
34
37
  </template>
@@ -40,6 +43,7 @@ import DesignTask from "./DesignTask.vue";
40
43
  import MoveToCommunityDialog from "./MoveToCommunityDialog.vue";
41
44
  import { sendMessage } from "../../service/admin";
42
45
  import CommunityAdmin from "./CommunityAdmin.vue";
46
+ import { editLink } from "@jx3box/jx3box-common/js/utils";
43
47
  export default {
44
48
  name: "AdminDrop",
45
49
  components: {
@@ -94,6 +98,9 @@ export default {
94
98
  return this.post?.post_type;
95
99
  }
96
100
  },
101
+ edit_link: function() {
102
+ return editLink(this.post?.post_type, this.post?.ID);
103
+ },
97
104
  },
98
105
  methods: {
99
106
  handleCommand(command) {
@@ -141,6 +148,9 @@ export default {
141
148
  designTask() {
142
149
  this.showDesignTask = true;
143
150
  },
151
+ editPost() {
152
+ location.href = this.edit_link + '?from=admin';
153
+ },
144
154
  hasPermission(permission) {
145
155
  return User.hasPermission(permission);
146
156
  },
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <el-drawer
3
- class="c-admin"
3
+ class="c-admin c-community-admin"
4
4
  title="管理面板"
5
5
  :visible.sync="modelValue"
6
6
  :before-close="close"
@@ -9,8 +9,25 @@
9
9
  :withHeader="false"
10
10
  >
11
11
  <div class="c-admin-wrapper">
12
- <el-divider content-position="left">标签</el-divider>
13
-
12
+ <el-divider content-position="left">信息设置</el-divider>
13
+ <div class="c-admin-extend">
14
+ <div class="u-condition u-map">
15
+ <el-input v-model="form.title" placeholder="请输入标题" class="input-author drawer-item-content">
16
+ <template #prepend>
17
+ <span class="u-keyword">标题</span>
18
+ </template>
19
+ </el-input>
20
+ </div>
21
+ </div>
22
+ <div class="c-admin-extend">
23
+ <div class="u-condition u-map">
24
+ <span class="u-prepend el-input-group__prepend">分类</span>
25
+ <el-select v-model="form.category" filterable placeholder="请选择">
26
+ <el-option v-for="item in categoryList" :value="item.name" :label="item.name" :key="item.name">
27
+ </el-option>
28
+ </el-select>
29
+ </div>
30
+ </div>
14
31
  <div class="c-admin-extend">
15
32
  <div class="u-condition u-map">
16
33
  <span class="u-prepend el-input-group__prepend">标签</span>
@@ -28,6 +45,21 @@
28
45
  </el-select>
29
46
  </div>
30
47
  </div>
48
+ <div class="c-admin-extend">
49
+ <div class="u-condition u-map">
50
+ <div>
51
+ <el-input
52
+ v-model="form.user_id"
53
+ placeholder="请输入作者ID"
54
+ class="input-author drawer-item-content"
55
+ >
56
+ <template #prepend>
57
+ <span class="u-keyword">作者ID</span>
58
+ </template>
59
+ </el-input>
60
+ </div>
61
+ </div>
62
+ </div>
31
63
 
32
64
  <el-divider content-position="left">高亮置顶</el-divider>
33
65
 
@@ -151,18 +183,6 @@ export default {
151
183
  showColors() {
152
184
  return this.form.is_hight;
153
185
  },
154
- params() {
155
- return {
156
- ...this.post,
157
- category: this.form.category,
158
- tags: this.form.tags,
159
- is_top: this.form.is_top,
160
- is_star: this.form.is_star,
161
- is_hight: this.form.is_hight,
162
- is_category_top: this.form.is_category_top,
163
- // color: this.color,
164
- };
165
- },
166
186
  },
167
187
  watch: {
168
188
  post() {
@@ -174,6 +194,8 @@ export default {
174
194
  is_star: this.post.is_star,
175
195
  tags: this.post.tags,
176
196
  is_category_top: this.post.is_category_top,
197
+ user_id: this.post.user_id,
198
+ title: this.post.title,
177
199
  };
178
200
  },
179
201
  form() {
@@ -256,10 +278,13 @@ export default {
256
278
  updateTopicItem(id, {
257
279
  ...this.post,
258
280
  tags: this.form.tags,
259
- is_top: 0,
281
+ user_id: this.form.user_id,
282
+ title: this.form.title,
283
+ category: this.form.category,
260
284
  }).then((res) => {
261
285
  this.$message.success("修改成功");
262
286
  this.$emit("update:modelValue", false);
287
+ window.location.reload();
263
288
  });
264
289
  },
265
290
  getCommunityTags() {
@@ -318,20 +343,35 @@ export default {
318
343
 
319
344
  <style lang="less">
320
345
  @import "../../assets/css/admin.less";
321
- .c-admin-space {
322
- .flex;
323
- align-items: center;
324
- flex-wrap: wrap;
325
- height: 28px;
326
- gap: 4px;
327
- }
328
- .c-admin-lable {
329
- font-size: 14px;
330
- font-weight: 500;
331
- }
332
- .c-admin-buttons {
333
- width: 100%;
334
- position: absolute;
335
- bottom: 80px;
346
+ .c-community-admin {
347
+ .c-admin-space {
348
+ .flex;
349
+ align-items: center;
350
+ flex-wrap: wrap;
351
+ height: 28px;
352
+ gap: 4px;
353
+ }
354
+ .c-admin-lable {
355
+ font-size: 14px;
356
+ font-weight: 500;
357
+ }
358
+ .c-admin-buttons {
359
+ width: 100%;
360
+ padding-top: 30px;
361
+ // position: absolute;
362
+ // bottom: 50px;
363
+ }
364
+ .c-admin-extend .u-map .u-prepend {
365
+ font-size: 14px;
366
+ min-width: 62px;
367
+ }
368
+ .c-admin-extend .u-map .el-select {
369
+ margin-left: 62px;
370
+ }
371
+ .el-input-group__prepend {
372
+ text-align: center;
373
+ min-width: 62px;
374
+ box-sizing: border-box;
375
+ }
336
376
  }
337
377
  </style>
@@ -122,7 +122,7 @@ export default {
122
122
  return editLink(this.post?.post_type, this.post?.ID);
123
123
  },
124
124
  canEdit: function() {
125
- return this.post?.post_author == User.getInfo().uid || User.isEditor();
125
+ return this.post?.post_author == User.getInfo().uid
126
126
  },
127
127
  client: function() {
128
128
  return this.post?.client || "std";