@jx3box/jx3box-common-ui 7.8.2 → 7.8.4
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 +2 -2
- package/src/bread/Admin.vue +69 -62
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-common-ui",
|
|
3
|
-
"version": "7.8.
|
|
3
|
+
"version": "7.8.4",
|
|
4
4
|
"description": "JX3BOX UI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@jx3box/jx3box-comment-ui": "^1.7.16",
|
|
34
|
-
"@jx3box/jx3box-common": "^8.0.
|
|
34
|
+
"@jx3box/jx3box-common": "^8.0.2",
|
|
35
35
|
"@jx3box/jx3box-data": "^3.5.2",
|
|
36
36
|
"@jx3box/jx3box-editor": "^1.9.9",
|
|
37
37
|
"@jx3box/reporter": "^0.0.4",
|
package/src/bread/Admin.vue
CHANGED
|
@@ -11,35 +11,28 @@
|
|
|
11
11
|
>
|
|
12
12
|
<div class="c-admin-wrapper">
|
|
13
13
|
<!-- <template v-if="isAdmin"> -->
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
>{{ option }}</el-radio-button>
|
|
21
|
-
</el-radio-group>
|
|
14
|
+
<el-divider content-position="left">状态变更</el-divider>
|
|
15
|
+
<el-radio-group v-model="post_status" size="small" class="c-admin-status">
|
|
16
|
+
<el-radio-button v-for="(option, key) in status_options" :label="key" :key="key">{{
|
|
17
|
+
option
|
|
18
|
+
}}</el-radio-button>
|
|
19
|
+
</el-radio-group>
|
|
22
20
|
<!-- </template> -->
|
|
23
21
|
|
|
24
22
|
<el-divider content-position="left">可见性变更</el-divider>
|
|
25
23
|
<el-radio-group v-model="visible" size="small" class="c-admin-status">
|
|
26
|
-
<el-radio-button
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
:key="key"
|
|
30
|
-
>{{ option }}</el-radio-button>
|
|
24
|
+
<el-radio-button v-for="(option, key) in visible_options" :label="key" :key="key">{{
|
|
25
|
+
option
|
|
26
|
+
}}</el-radio-button>
|
|
31
27
|
</el-radio-group>
|
|
32
28
|
|
|
33
29
|
<el-divider content-position="left">推荐角标</el-divider>
|
|
34
30
|
<el-checkbox-group v-model="mark" class="c-admin-mark">
|
|
35
|
-
<el-checkbox
|
|
36
|
-
v-for="(option, key) in mark_options"
|
|
37
|
-
:label="key"
|
|
38
|
-
:key="key"
|
|
39
|
-
>{{option}}</el-checkbox>
|
|
31
|
+
<el-checkbox v-for="(option, key) in mark_options" :label="key" :key="key">{{ option }}</el-checkbox>
|
|
40
32
|
</el-checkbox-group>
|
|
41
33
|
|
|
42
|
-
<el-divider content-position="left"
|
|
34
|
+
<el-divider content-position="left">高亮置顶</el-divider>
|
|
35
|
+
<el-checkbox class="c-admin-highlight-checkbox" v-model="isSticky">置顶</el-checkbox>
|
|
43
36
|
<el-checkbox class="c-admin-highlight-checkbox" v-model="isHighlight">开启高亮</el-checkbox>
|
|
44
37
|
<template v-if="isHighlight">
|
|
45
38
|
<el-color-picker
|
|
@@ -51,13 +44,6 @@
|
|
|
51
44
|
<span class="c-admin-highlight-preview" :style="{ color: color }">预览高亮效果</span>
|
|
52
45
|
</template>
|
|
53
46
|
|
|
54
|
-
<el-divider content-position="left">是否置顶</el-divider>
|
|
55
|
-
<el-switch
|
|
56
|
-
v-model="isSticky"
|
|
57
|
-
active-text="置顶"
|
|
58
|
-
class="switch-post-pinned drawer-item-content"
|
|
59
|
-
></el-switch>
|
|
60
|
-
|
|
61
47
|
<el-divider content-position="left">封面海报</el-divider>
|
|
62
48
|
<div class="c-admin-banner">
|
|
63
49
|
<el-upload
|
|
@@ -74,17 +60,22 @@
|
|
|
74
60
|
<el-input class="u-banner" v-model="post_banner" size="small">
|
|
75
61
|
<span slot="prepend">海报地址</span>
|
|
76
62
|
<span slot="append">
|
|
77
|
-
<span class="u-btn" @click="removeBanner">
|
|
78
|
-
<i class="el-icon-circle-close"></i> 移除海报
|
|
79
|
-
</span>
|
|
63
|
+
<span class="u-btn" @click="removeBanner"> <i class="el-icon-circle-close"></i> 移除海报 </span>
|
|
80
64
|
</span>
|
|
81
65
|
</el-input>
|
|
82
66
|
</div>
|
|
83
67
|
|
|
84
68
|
<el-divider content-position="left">元信息</el-divider>
|
|
85
69
|
<div class="c-admin-info">
|
|
86
|
-
<div class="c-admin-type">
|
|
87
|
-
<
|
|
70
|
+
<div class="w-select c-admin-type">
|
|
71
|
+
<div class="u-select-label">板块</div>
|
|
72
|
+
<el-select
|
|
73
|
+
v-model="post_type"
|
|
74
|
+
placeholder="请选择板块"
|
|
75
|
+
style="width: 100%"
|
|
76
|
+
class="u-select drawer-item-content"
|
|
77
|
+
:disabled="appDisabled"
|
|
78
|
+
>
|
|
88
79
|
<el-option
|
|
89
80
|
v-for="type in type_options"
|
|
90
81
|
:key="type.value"
|
|
@@ -94,11 +85,11 @@
|
|
|
94
85
|
</el-select>
|
|
95
86
|
</div>
|
|
96
87
|
<div class="c-admin-author">
|
|
97
|
-
<el-input
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
88
|
+
<el-input v-model="post_author" placeholder="请输入作者ID" class="input-author drawer-item-content">
|
|
89
|
+
<template #prepend>
|
|
90
|
+
<span class="u-keyword">作者ID</span>
|
|
91
|
+
</template>
|
|
92
|
+
</el-input>
|
|
102
93
|
</div>
|
|
103
94
|
</div>
|
|
104
95
|
|
|
@@ -113,11 +104,7 @@
|
|
|
113
104
|
<script>
|
|
114
105
|
import Bus from "../../service/bus";
|
|
115
106
|
import { getRewrite } from "@jx3box/jx3box-common/js/utils";
|
|
116
|
-
import {
|
|
117
|
-
__cms,
|
|
118
|
-
__postType,
|
|
119
|
-
__visibleMap,
|
|
120
|
-
} from "@jx3box/jx3box-common/data/jx3box.json";
|
|
107
|
+
import { __cms, __postType, __visibleMap } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
121
108
|
import { getSetting, postSetting } from "../../service/admin";
|
|
122
109
|
import User from "@jx3box/jx3box-common/js/user";
|
|
123
110
|
import { cms as marks } from "@jx3box/jx3box-common/data/mark.json";
|
|
@@ -127,7 +114,25 @@ export default {
|
|
|
127
114
|
marksOptions: {
|
|
128
115
|
type: Object,
|
|
129
116
|
default: () => {},
|
|
130
|
-
}
|
|
117
|
+
},
|
|
118
|
+
// 入口是否是后台管理/list
|
|
119
|
+
fromList: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: false,
|
|
122
|
+
},
|
|
123
|
+
show: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false,
|
|
126
|
+
},
|
|
127
|
+
postId: {
|
|
128
|
+
type: [Number, String],
|
|
129
|
+
default: 0,
|
|
130
|
+
},
|
|
131
|
+
// 是否禁止板块选择
|
|
132
|
+
appDisabled: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
default: false,
|
|
135
|
+
},
|
|
131
136
|
},
|
|
132
137
|
data() {
|
|
133
138
|
return {
|
|
@@ -200,12 +205,14 @@ export default {
|
|
|
200
205
|
sticky: this.isSticky ? Date.now() : null,
|
|
201
206
|
};
|
|
202
207
|
},
|
|
203
|
-
isAdmin
|
|
204
|
-
return User.isAdmin()
|
|
208
|
+
isAdmin: function () {
|
|
209
|
+
return User.isAdmin();
|
|
210
|
+
},
|
|
211
|
+
mark_options: function () {
|
|
212
|
+
return this.marksOptions && Object.keys(this.marksOptions)
|
|
213
|
+
? Object.assign({}, marks, this.marksOptions)
|
|
214
|
+
: marks;
|
|
205
215
|
},
|
|
206
|
-
mark_options: function (){
|
|
207
|
-
return this.marksOptions && Object.keys(this.marksOptions) ? Object.assign({}, marks, this.marksOptions) : marks
|
|
208
|
-
}
|
|
209
216
|
},
|
|
210
217
|
methods: {
|
|
211
218
|
// 是否有权限
|
|
@@ -214,10 +221,7 @@ export default {
|
|
|
214
221
|
},
|
|
215
222
|
// 获取pid
|
|
216
223
|
checkPostID: function () {
|
|
217
|
-
this.pid =
|
|
218
|
-
getRewrite("pid") ||
|
|
219
|
-
(this.$route && this.$route.params && this.$route.params.id) ||
|
|
220
|
-
0;
|
|
224
|
+
this.pid = getRewrite("pid") || (this.$route && this.$route.params && this.$route.params.id) || 0;
|
|
221
225
|
},
|
|
222
226
|
// 获取type
|
|
223
227
|
checkChannel: function () {
|
|
@@ -253,17 +257,7 @@ export default {
|
|
|
253
257
|
// 拉
|
|
254
258
|
pull: function () {
|
|
255
259
|
getSetting(this.pid).then((data) => {
|
|
256
|
-
let {
|
|
257
|
-
ID,
|
|
258
|
-
color,
|
|
259
|
-
mark,
|
|
260
|
-
post_status,
|
|
261
|
-
post_author,
|
|
262
|
-
sticky,
|
|
263
|
-
post_banner,
|
|
264
|
-
post_type,
|
|
265
|
-
visible,
|
|
266
|
-
} = data;
|
|
260
|
+
let { ID, color, mark, post_status, post_author, sticky, post_banner, post_type, visible } = data;
|
|
267
261
|
this.pid = ID;
|
|
268
262
|
this.post_status = post_status;
|
|
269
263
|
this.visible = visible;
|
|
@@ -289,6 +283,7 @@ export default {
|
|
|
289
283
|
push: function () {
|
|
290
284
|
postSetting(this.data)
|
|
291
285
|
.then((res) => {
|
|
286
|
+
this.$emit("update", this.data);
|
|
292
287
|
this.$message({
|
|
293
288
|
message: "设置成功",
|
|
294
289
|
type: "success",
|
|
@@ -304,6 +299,18 @@ export default {
|
|
|
304
299
|
"$route.params.id": function (id) {
|
|
305
300
|
this.checkPostID();
|
|
306
301
|
},
|
|
302
|
+
show: {
|
|
303
|
+
immediate: true,
|
|
304
|
+
handler(bol) {
|
|
305
|
+
if (this.fromList) {
|
|
306
|
+
this.dialog_visible = bol;
|
|
307
|
+
if (bol) {
|
|
308
|
+
this.pid = this.postId;
|
|
309
|
+
this.pull();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
},
|
|
307
314
|
},
|
|
308
315
|
created: function () {
|
|
309
316
|
// 是否mount
|