@jx3box/jx3box-common-ui 8.0.3 → 8.0.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.
@@ -74,10 +74,38 @@
74
74
  .x;
75
75
  }
76
76
 
77
+ .c-admin-extend {
78
+ .u-condition {
79
+ .mt(10px);
80
+ .el-input-group__prepend {
81
+ padding-left: 10px;
82
+ padding-right: 10px;
83
+ }
84
+ }
85
+ .u-map {
86
+ .u-prepend {
87
+ .fl;
88
+ width: auto;
89
+ min-width: 57px;
90
+ box-sizing: border-box;
91
+ .fz(12px,38px);
92
+ text-align: center;
93
+ }
94
+ .el-select {
95
+ .db;
96
+ .ml(57px);
97
+ }
98
+ .el-input__inner {
99
+ border-top-left-radius: 0;
100
+ border-bottom-left-radius: 0;
101
+ }
102
+ }
103
+ }
104
+
77
105
  @media screen and (max-width:@ipad){
78
106
  .c-admin{
79
107
  .el-drawer{
80
108
  .w(100%) !important;
81
109
  }
82
110
  }
83
- }
111
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "8.0.3",
3
+ "version": "8.0.5",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/service/cms.js CHANGED
@@ -53,4 +53,9 @@ function getCollection(id) {
53
53
  return $cms({ mute: true }).get(`/api/cms/post/collection/${id}`);
54
54
  }
55
55
 
56
- export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson, checkTeamMember, getHonorJson, getSliders, getCollection };
56
+ // 获取自定义主题
57
+ function getTopicBucket(params) {
58
+ return $cms().get(`/api/cms/topic/bucket`, { params });
59
+ }
60
+
61
+ export { getPostAuthors, uploadImage, upload, getDecoration, getDecorationJson, checkTeamMember, getHonorJson, getSliders, getCollection, getTopicBucket, };
@@ -47,7 +47,7 @@
47
47
  </a>
48
48
  <Adminbutton v-if="adminEnable" class="u-admin" />
49
49
  <ListAdmin v-if="topicEnable" />
50
- <Admin v-if="adminEnable" :marksOptions="adminMarks" />
50
+ <Admin v-if="adminEnable" :marksOptions="adminMarks" :show-extend="true" :app="slug" :subtypeMap="subtypeMap" />
51
51
  <slot name="op-prepend"></slot>
52
52
  </div>
53
53
  </div>
@@ -80,7 +80,9 @@ export default {
80
80
  "crumbEnable",
81
81
  "withoutLeft",
82
82
  "adminMarks",
83
- "icon"
83
+ "icon",
84
+ "subtypeMap",
85
+ "showExtend"
84
86
  ],
85
87
  data: function () {
86
88
  return {
@@ -89,7 +91,7 @@ export default {
89
91
  isNotAdmin: !User.isEditor(),
90
92
  isOverlay: false,
91
93
  isApp: isApp(),
92
- show: false
94
+ show: false,
93
95
  };
94
96
  },
95
97
  computed: {
@@ -41,9 +41,13 @@
41
41
  :predefine="color_options"
42
42
  size="mini"
43
43
  ></el-color-picker>
44
- <span class="c-admin-highlight-preview" :style="{ color: color }" style="margin-right: 10px;">预览高亮效果</span>
44
+ <span class="c-admin-highlight-preview" :style="{ color: color }" style="margin-right: 10px"
45
+ >预览高亮效果</span
46
+ >
45
47
  </template>
46
- <el-checkbox class="c-admin-highlight-checkbox" v-model="isStar" :true-label="1" :false-label="0">精选</el-checkbox>
48
+ <el-checkbox class="c-admin-highlight-checkbox" v-model="isStar" :true-label="1" :false-label="0"
49
+ >精选</el-checkbox
50
+ >
47
51
 
48
52
  <el-divider content-position="left">封面海报</el-divider>
49
53
  <div class="c-admin-banner">
@@ -94,6 +98,22 @@
94
98
  </div>
95
99
  </div>
96
100
 
101
+ <div class="c-admin-extend" v-if="showExtend">
102
+ <div class="u-condition u-map" v-if="Object.keys(subtypeMap)">
103
+ <span class="u-prepend el-input-group__prepend">子类型</span>
104
+ <el-select v-model="post_subtype" filterable placeholder="请选择" clearable>
105
+ <el-option v-for="(label, value) in subtypeMap" :value="value" :label="label" :key="value">
106
+ </el-option>
107
+ </el-select>
108
+ </div>
109
+ <div class="u-condition u-map">
110
+ <span class="u-prepend el-input-group__prepend">标签</span>
111
+ <el-select v-model="tag" filterable placeholder="请选择" clearable multiple collapse-tags>
112
+ <el-option v-for="value in tags" :value="value" :label="value" :key="value"> </el-option>
113
+ </el-select>
114
+ </div>
115
+ </div>
116
+
97
117
  <div class="c-admin-buttons">
98
118
  <el-button type="primary" @click="submit" :loading="pushing">提交</el-button>
99
119
  <el-button type="plain" @click="close">取消</el-button>
@@ -109,6 +129,7 @@ import { __cms, __postType, __visibleMap } from "@jx3box/jx3box-common/data/jx3b
109
129
  import { getSetting, postSetting } from "../../service/admin";
110
130
  import User from "@jx3box/jx3box-common/js/user";
111
131
  import { cms as marks } from "@jx3box/jx3box-common/data/mark.json";
132
+ import { getTopicBucket } from "../../service/cms";
112
133
  export default {
113
134
  name: "Admin",
114
135
  props: {
@@ -134,6 +155,18 @@ export default {
134
155
  type: Boolean,
135
156
  default: false,
136
157
  },
158
+ showExtend: {
159
+ type: Boolean,
160
+ default: false,
161
+ },
162
+ subtypeMap: {
163
+ type: Object,
164
+ default: () => {},
165
+ },
166
+ app: {
167
+ type: String,
168
+ default: "",
169
+ },
137
170
  },
138
171
  data() {
139
172
  return {
@@ -188,6 +221,9 @@ export default {
188
221
  // 类型
189
222
  post_type: "",
190
223
  type_options: [],
224
+ post_subtype: "",
225
+ tag: [],
226
+ tags: [],
191
227
 
192
228
  // 作者
193
229
  post_author: "",
@@ -205,7 +241,9 @@ export default {
205
241
  color: this.isHighlight ? this.color : "",
206
242
  mark: this.mark || [],
207
243
  sticky: this.isSticky ? Date.now() : null,
208
- star: this.isStar
244
+ star: this.isStar,
245
+ tags: this.tag,
246
+ post_subtype: this.post_subtype,
209
247
  };
210
248
  },
211
249
  isAdmin: function () {
@@ -263,7 +301,7 @@ export default {
263
301
  // 拉
264
302
  pull: function () {
265
303
  getSetting(this.pid).then((data) => {
266
- let { ID, color, mark, post_status, post_author, sticky, post_banner, post_type, visible, star } = data;
304
+ let { ID, color, mark, post_status, post_author, sticky, post_banner, post_type, visible, star, post_subtype, tags } = data;
267
305
  this.pid = ID;
268
306
  this.post_status = post_status;
269
307
  this.visible = visible;
@@ -277,6 +315,8 @@ export default {
277
315
  if (this.sticky) this.isSticky = true;
278
316
 
279
317
  this.isStar = star || 0;
318
+ this.tag = tags || [];
319
+ this.post_subtype = post_subtype || "";
280
320
 
281
321
  // 设置加载完成标识
282
322
  this.pulled = true;
@@ -305,6 +345,13 @@ export default {
305
345
  this.close();
306
346
  });
307
347
  },
348
+ // 获取topic标签
349
+ loadTopic() {
350
+ getTopicBucket({ type: "bbs" }).then((res) => {
351
+ const data = res.data.data?.map((item) => item.name) || [];
352
+ this.tags = data;
353
+ });
354
+ },
308
355
  },
309
356
  watch: {
310
357
  "$route.params.id": function (id) {
@@ -342,6 +389,10 @@ export default {
342
389
  if (this.pid && this.hasRight) {
343
390
  this.pull();
344
391
  }
392
+
393
+ if (this.showExtend && this.app && this.dialog_visible) {
394
+ this.loadTopic();
395
+ }
345
396
  });
346
397
  },
347
398
  };