@jx3box/jx3box-common-ui 5.4.1 → 5.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.
- package/assets/css/{post_list.less → cms-list.less} +0 -0
- package/assets/css/{post_single.less → cms-single.less} +4 -0
- package/assets/css/crumb.less +5 -0
- package/package.json +3 -1
- package/src/App.vue +102 -85
- package/src/header/nav.vue +1 -1
- package/src/single/Collection.vue +29 -28
- package/src/single/cms-list.vue +77 -0
- package/src/single/cms-single.vue +120 -0
|
File without changes
|
package/assets/css/crumb.less
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jx3box/jx3box-common-ui",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.2",
|
|
4
4
|
"description": "JX3BOX UI",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,8 +30,10 @@
|
|
|
30
30
|
"last 2 versions"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@jx3box/jx3box-comment-ui": "^1.6.6",
|
|
33
34
|
"@jx3box/jx3box-common": "^6.7.8",
|
|
34
35
|
"@jx3box/jx3box-data": "^1.8.3",
|
|
36
|
+
"@jx3box/jx3box-editor": "^1.0.4",
|
|
35
37
|
"axios": "^0.19.2",
|
|
36
38
|
"element-ui": "^2.13.2",
|
|
37
39
|
"jquery": "^3.5.1",
|
package/src/App.vue
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="container-page">
|
|
3
3
|
<Header></Header>
|
|
4
|
-
<Breadcrumb
|
|
5
|
-
name="频道名称"
|
|
6
|
-
slug="slug"
|
|
7
|
-
root="/slug"
|
|
8
|
-
:publishEnable="true"
|
|
9
|
-
:feedbackEnable="true"
|
|
10
|
-
:adminEnable="true"
|
|
11
|
-
>
|
|
4
|
+
<Breadcrumb name="频道名称" slug="slug" root="/slug" :publishEnable="true" :feedbackEnable="true" :adminEnable="true">
|
|
12
5
|
<img slot="logo" svg-inline src="../assets/img/jx3.svg" />
|
|
13
6
|
bread info
|
|
14
7
|
</Breadcrumb>
|
|
@@ -20,64 +13,74 @@
|
|
|
20
13
|
</LeftSidebar>
|
|
21
14
|
|
|
22
15
|
<Main :withoutLeft="false" :withoutRight="false">
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
16
|
+
<el-tabs v-model="tab" type="card">
|
|
17
|
+
<el-tab-pane label="CMS作品" name="post">
|
|
18
|
+
<el-radio-group v-model="post_id">
|
|
19
|
+
<el-radio label="35605">测试Markdown</el-radio>
|
|
20
|
+
<el-radio label="32035">仅小册</el-radio>
|
|
21
|
+
<el-radio label="30017">仅联合创作者</el-radio>
|
|
22
|
+
<el-radio label="30582">小册和联合创作者</el-radio>
|
|
23
|
+
<el-radio label="31129">无小册和联合创作者</el-radio>
|
|
24
|
+
</el-radio-group>
|
|
25
|
+
<singlebox :post="post" />
|
|
26
|
+
</el-tab-pane>
|
|
27
|
+
<el-tab-pane label="通用组件" name="widget">
|
|
28
|
+
<PostHeader :post="post" />
|
|
29
|
+
<Creators :postId="30432" style="margin-bottom:10px" />
|
|
30
|
+
<Collection :id="59" :defaultVisible="true" />
|
|
31
|
+
<UserPop title="添加用户" v-model="visible" @confirm="addUser" />
|
|
32
|
+
<el-button @click="visible = true">用户POP</el-button>
|
|
33
|
+
|
|
34
|
+
<Thx :postId="23865" postType="bbs" :userId="7" :adminBoxcoinEnable="true" :userBoxcoinEnable="true" />
|
|
35
|
+
|
|
36
|
+
<hr />
|
|
37
|
+
|
|
38
|
+
<Like mode="heart" :count="100" :showCount="true" />
|
|
39
|
+
<Down :count="100" :showCount="true" />
|
|
40
|
+
<Mark label="KEY" value="VALUE" BGL="#000" BGR="#F39" />
|
|
41
|
+
<Fav post-id="90" post-type="jx3dat" />
|
|
42
|
+
<Feed post-id="90" post-type="jx3dat" />
|
|
43
|
+
<Print title="传入标题" />
|
|
44
|
+
<QRcode />
|
|
45
|
+
<Sharing />
|
|
46
|
+
|
|
47
|
+
<hr />
|
|
48
|
+
|
|
49
|
+
<markBy />
|
|
50
|
+
<menuBy :data="['test1', 'test2']" />
|
|
51
|
+
<orderBy />
|
|
52
|
+
<tagBy :data="['PVE', 'PVX']" :type="tag" />
|
|
53
|
+
<clientBy type="" />
|
|
54
|
+
<zlpBy />
|
|
55
|
+
</el-tab-pane>
|
|
56
|
+
<el-tab-pane label="百科组件" name="wiki"
|
|
57
|
+
><WikiPanel :wiki-post="wikiPost">
|
|
58
|
+
<template slot="head-title">
|
|
59
|
+
<i class="el-icon-location-information"></i>
|
|
60
|
+
<span class="u-title">通识正文</span>
|
|
61
|
+
</template>
|
|
62
|
+
<template slot="head-actions">
|
|
63
|
+
<a class="el-button el-button--primary u-publish">
|
|
64
|
+
<i class="el-icon-edit"></i>
|
|
65
|
+
<span>完善百科通识</span>
|
|
66
|
+
</a>
|
|
67
|
+
<span class="u-more">查看更多</span>
|
|
68
|
+
</template>
|
|
69
|
+
<template slot="body">正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容</template>
|
|
70
|
+
</WikiPanel>
|
|
71
|
+
<hr />
|
|
72
|
+
|
|
73
|
+
<WikiRevisions type="achievement" source-id="9096"/>
|
|
74
|
+
<hr />
|
|
75
|
+
|
|
76
|
+
<WikiComments type="achievement" source-id="9096"/>
|
|
77
|
+
<hr
|
|
78
|
+
/></el-tab-pane>
|
|
79
|
+
</el-tabs>
|
|
77
80
|
|
|
78
81
|
<RightSidebar>
|
|
79
|
-
<RightSideMsg>Hello</RightSideMsg
|
|
80
|
-
<PostCollection :id="59"/>
|
|
82
|
+
<RightSideMsg>Hello</RightSideMsg>
|
|
83
|
+
<PostCollection :id="59" />
|
|
81
84
|
</RightSidebar>
|
|
82
85
|
|
|
83
86
|
<Footer></Footer>
|
|
@@ -102,6 +105,7 @@ import RightSideMsg from "./RightSideMsg.vue";
|
|
|
102
105
|
import Footer from "./Footer.vue";
|
|
103
106
|
import Bottom from "./Bottom.vue";
|
|
104
107
|
|
|
108
|
+
import singlebox from "./single/cms-single.vue";
|
|
105
109
|
import PostHeader from "./single/PostHeader.vue";
|
|
106
110
|
import PostCollection from "./single/PostCollection.vue";
|
|
107
111
|
|
|
@@ -145,6 +149,7 @@ export default {
|
|
|
145
149
|
Bottom,
|
|
146
150
|
RightSidebar,
|
|
147
151
|
|
|
152
|
+
singlebox,
|
|
148
153
|
PostHeader,
|
|
149
154
|
PostCollection,
|
|
150
155
|
|
|
@@ -177,39 +182,51 @@ export default {
|
|
|
177
182
|
WikiRevisions,
|
|
178
183
|
WikiComments,
|
|
179
184
|
|
|
180
|
-
UserPop
|
|
185
|
+
UserPop,
|
|
181
186
|
},
|
|
182
187
|
data: function() {
|
|
183
188
|
return {
|
|
189
|
+
tab: "post",
|
|
190
|
+
|
|
191
|
+
post: "",
|
|
192
|
+
post_id: "35605",
|
|
193
|
+
|
|
184
194
|
author: "",
|
|
185
195
|
wikiPost: null,
|
|
186
|
-
tag
|
|
187
|
-
visible
|
|
188
|
-
|
|
189
|
-
post : ''
|
|
196
|
+
tag: "",
|
|
197
|
+
visible: false,
|
|
190
198
|
};
|
|
191
199
|
},
|
|
192
200
|
created: function() {
|
|
193
|
-
WikiPost.view(11042).then(
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
axios.get('/api/cms/post/32035').then((res) => {
|
|
200
|
-
this.post = res.data.data
|
|
201
|
-
})
|
|
201
|
+
WikiPost.view(11042).then((res) => {
|
|
202
|
+
res = res.data;
|
|
203
|
+
if (res.code === 200) this.wikiPost = res.data;
|
|
204
|
+
});
|
|
202
205
|
},
|
|
203
206
|
methods: {
|
|
204
|
-
addUser
|
|
205
|
-
console.log(val)
|
|
206
|
-
}
|
|
207
|
+
addUser: function(val) {
|
|
208
|
+
console.log(val);
|
|
209
|
+
},
|
|
210
|
+
loadPost: function() {
|
|
211
|
+
axios.get(`/api/cms/post/${this.post_id}`).then((res) => {
|
|
212
|
+
this.post = res.data.data;
|
|
213
|
+
this.$forceUpdate()
|
|
214
|
+
});
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
watch: {
|
|
218
|
+
post_id: {
|
|
219
|
+
immediate: true,
|
|
220
|
+
handler: function(val) {
|
|
221
|
+
this.loadPost();
|
|
222
|
+
},
|
|
223
|
+
},
|
|
207
224
|
},
|
|
208
225
|
};
|
|
209
226
|
</script>
|
|
210
227
|
|
|
211
228
|
<style lang="less">
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
</style>
|
|
229
|
+
body {
|
|
230
|
+
padding-top: 0;
|
|
231
|
+
}
|
|
232
|
+
</style>
|
package/src/header/nav.vue
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="w-collection" v-if="list && list.length">
|
|
3
3
|
<div class="w-collection-title" @click="handleShow" :class="{ on: visible }">
|
|
4
|
-
<span>
|
|
5
|
-
<i class="el-icon-notebook-1"></i> 该作品已被收录至作者的剑三小册
|
|
6
|
-
</span>
|
|
4
|
+
<span> <i class="el-icon-notebook-1"></i> 该作品已被收录至作者的剑三小册 </span>
|
|
7
5
|
<a @click.stop :href="id | collectionLink" target="_blank">《{{ title }}》</a>
|
|
8
6
|
</div>
|
|
9
7
|
<transition name="fade">
|
|
10
8
|
<div class="w-collection-list" v-if="visible">
|
|
11
|
-
<ol
|
|
12
|
-
v-if="list && list.length"
|
|
13
|
-
class="u-list"
|
|
14
|
-
:style="{ display: visible ? 'block' : 'none' }"
|
|
15
|
-
>
|
|
9
|
+
<ol v-if="list && list.length" class="u-list" :style="{ display: visible ? 'block' : 'none' }">
|
|
16
10
|
<li v-for="(item, i) in list" :key="i" class="u-item">
|
|
17
11
|
<a v-if="item" :href="item | showLink" target="_blank">
|
|
18
12
|
<!-- <i class="el-icon-link"></i> -->
|
|
@@ -30,10 +24,10 @@ import { getLink } from "@jx3box/jx3box-common/js/utils";
|
|
|
30
24
|
import { getCollection } from "../../service/helper";
|
|
31
25
|
export default {
|
|
32
26
|
name: "Collection",
|
|
33
|
-
props: ["id",
|
|
27
|
+
props: ["id", "defaultVisible"],
|
|
34
28
|
inject: [],
|
|
35
29
|
components: {},
|
|
36
|
-
data: function
|
|
30
|
+
data: function() {
|
|
37
31
|
return {
|
|
38
32
|
visible: this.defaultVisible || false,
|
|
39
33
|
data: {
|
|
@@ -43,39 +37,46 @@ export default {
|
|
|
43
37
|
};
|
|
44
38
|
},
|
|
45
39
|
computed: {
|
|
46
|
-
title: function
|
|
40
|
+
title: function() {
|
|
47
41
|
return this.data?.title;
|
|
48
42
|
},
|
|
49
|
-
list: function
|
|
43
|
+
list: function() {
|
|
50
44
|
return this.data?.posts;
|
|
51
45
|
},
|
|
52
46
|
},
|
|
53
47
|
watch: {
|
|
54
48
|
id: {
|
|
55
49
|
immediate: true,
|
|
56
|
-
handler: function
|
|
57
|
-
!!~~val
|
|
50
|
+
handler: function(val) {
|
|
51
|
+
if (!!~~val) {
|
|
52
|
+
this.loadData();
|
|
53
|
+
} else {
|
|
54
|
+
this.data = {
|
|
55
|
+
title: "",
|
|
56
|
+
posts: [],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
58
59
|
},
|
|
59
60
|
},
|
|
60
|
-
defaultVisible
|
|
61
|
-
this.visible = val
|
|
62
|
-
}
|
|
61
|
+
defaultVisible: function(val) {
|
|
62
|
+
this.visible = val;
|
|
63
|
+
},
|
|
63
64
|
},
|
|
64
65
|
methods: {
|
|
65
|
-
handleShow: function
|
|
66
|
+
handleShow: function() {
|
|
66
67
|
this.visible = !this.visible;
|
|
67
68
|
},
|
|
68
|
-
loadData: function
|
|
69
|
+
loadData: function() {
|
|
69
70
|
getCollection(this.id).then((res) => {
|
|
70
71
|
this.data = res.data?.data?.collection;
|
|
71
72
|
});
|
|
72
73
|
},
|
|
73
74
|
},
|
|
74
75
|
filters: {
|
|
75
|
-
collectionLink: function
|
|
76
|
+
collectionLink: function(id) {
|
|
76
77
|
return getLink("collection", id);
|
|
77
78
|
},
|
|
78
|
-
showLink: function
|
|
79
|
+
showLink: function(item) {
|
|
79
80
|
if (item.type == "custom") {
|
|
80
81
|
return item.url;
|
|
81
82
|
} else {
|
|
@@ -83,12 +84,12 @@ export default {
|
|
|
83
84
|
}
|
|
84
85
|
},
|
|
85
86
|
},
|
|
86
|
-
created: function
|
|
87
|
-
mounted: function
|
|
87
|
+
created: function() {},
|
|
88
|
+
mounted: function() {},
|
|
88
89
|
};
|
|
89
90
|
</script>
|
|
90
91
|
|
|
91
|
-
<style
|
|
92
|
+
<style lang="less">
|
|
92
93
|
.w-collection {
|
|
93
94
|
&-title {
|
|
94
95
|
cursor: pointer;
|
|
@@ -126,7 +127,7 @@ export default {
|
|
|
126
127
|
|
|
127
128
|
counter-reset: collection;
|
|
128
129
|
.u-item {
|
|
129
|
-
.fz(13px,32px);
|
|
130
|
+
.fz(13px, 32px);
|
|
130
131
|
border-bottom: 1px solid #eee;
|
|
131
132
|
transition: 0.15s ease-in-out;
|
|
132
133
|
.nobreak;
|
|
@@ -143,8 +144,8 @@ export default {
|
|
|
143
144
|
color: @pink;
|
|
144
145
|
}
|
|
145
146
|
}
|
|
146
|
-
&:last-child{
|
|
147
|
-
border-bottom:none;
|
|
147
|
+
&:last-child {
|
|
148
|
+
border-bottom: none;
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
|
|
@@ -172,4 +173,4 @@ export default {
|
|
|
172
173
|
opacity: 0;
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
|
-
</style>
|
|
176
|
+
</style>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="m-archive-box">
|
|
3
|
+
<!-- 搜索靠前 -->
|
|
4
|
+
<slot name="search-before"></slot>
|
|
5
|
+
<!-- 筛选 -->
|
|
6
|
+
<div class="m-archive-filter" v-if="$slots.filter">
|
|
7
|
+
<slot name="filter"></slot>
|
|
8
|
+
</div>
|
|
9
|
+
<!-- 搜索靠后 -->
|
|
10
|
+
<slot name="search-after"></slot>
|
|
11
|
+
<!-- 列表 -->
|
|
12
|
+
<slot></slot>
|
|
13
|
+
<!-- 空 -->
|
|
14
|
+
<el-alert v-if="!list.length" class="m-archive-null" title="没有找到相关条目" type="info" center show-icon></el-alert>
|
|
15
|
+
<!-- 下一页 -->
|
|
16
|
+
<el-button class="m-archive-more" :class="{ show: hasNextPage }" type="primary" @click="appendPage">加载更多</el-button>
|
|
17
|
+
<!-- 分页 -->
|
|
18
|
+
<el-pagination
|
|
19
|
+
class="m-archive-pages"
|
|
20
|
+
background
|
|
21
|
+
layout="total, prev, pager, next,jumper"
|
|
22
|
+
:hide-on-single-page="true"
|
|
23
|
+
:page-size="perPage"
|
|
24
|
+
:total="totalRecords"
|
|
25
|
+
:current-page.sync="currentPage"
|
|
26
|
+
@current-change="changePage"
|
|
27
|
+
></el-pagination>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
<script>
|
|
31
|
+
export default {
|
|
32
|
+
name: "cms-list",
|
|
33
|
+
props: ["data", "total", "per", "pages", "page"],
|
|
34
|
+
data: function() {
|
|
35
|
+
return {
|
|
36
|
+
currentPage: this.page || 1,
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
list: function() {
|
|
41
|
+
return this.data;
|
|
42
|
+
},
|
|
43
|
+
totalRecords: function() {
|
|
44
|
+
return this.total;
|
|
45
|
+
},
|
|
46
|
+
totalPages: function() {
|
|
47
|
+
return this.pages;
|
|
48
|
+
},
|
|
49
|
+
perPage: function() {
|
|
50
|
+
return this.per;
|
|
51
|
+
},
|
|
52
|
+
hasNextPage: function() {
|
|
53
|
+
return this.totalRecords > 1 && this.currentPage < this.totalPages;
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
appendPage: function() {
|
|
58
|
+
this.$emit("appendPage", ++this.currentPage);
|
|
59
|
+
},
|
|
60
|
+
changePage: function(i) {
|
|
61
|
+
this.$emit("changePage", i);
|
|
62
|
+
this.$route.query.page = i;
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
watch: {
|
|
66
|
+
page: function(page) {
|
|
67
|
+
this.currentPage = page;
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
mounted: function() {},
|
|
71
|
+
components: {},
|
|
72
|
+
};
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<style lang="less">
|
|
76
|
+
@import "../../assets/css/cms-list.less";
|
|
77
|
+
</style>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="m-single-box">
|
|
3
|
+
<!-- 头部 -->
|
|
4
|
+
<PostHeader :post="post" :stat="stat">
|
|
5
|
+
<slot name="single-header"></slot>
|
|
6
|
+
</PostHeader>
|
|
7
|
+
|
|
8
|
+
<!-- 文章前 -->
|
|
9
|
+
<div class="m-single-prepend">
|
|
10
|
+
<!-- 联合创作者 -->
|
|
11
|
+
<Creators class="m-single-creators" :postId="id" :postType="post_type" />
|
|
12
|
+
<!-- 文集小册 -->
|
|
13
|
+
<Collection class="m-single-collection" :id="collection_id" :defaultVisible="collection_collapse" />
|
|
14
|
+
<slot name="single-prepend"></slot>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<!-- 文章内容 -->
|
|
18
|
+
<div class="m-single-post" v-if="visible">
|
|
19
|
+
<el-divider content-position="left">JX3BOX</el-divider>
|
|
20
|
+
<div class="m-single-content">
|
|
21
|
+
<ArticleMarkdown v-if="isMarkdown" :content="post_content" />
|
|
22
|
+
<Article v-else :content="post_content" />
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="m-single-null" v-else>
|
|
27
|
+
<el-alert :title="null_tip" type="warning" show-icon></el-alert>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<!-- 文章后 -->
|
|
31
|
+
<div class="m-single-append">
|
|
32
|
+
<!-- 打赏 -->
|
|
33
|
+
<Thx class="m-single-thx" :postId="id" :postType="post_type" :userId="author_id" :adminBoxcoinEnable="true" :userBoxcoinEnable="true"/>
|
|
34
|
+
|
|
35
|
+
<slot name="single-append"></slot>
|
|
36
|
+
|
|
37
|
+
<!-- 评论 -->
|
|
38
|
+
<div class="m-single-comment">
|
|
39
|
+
<el-divider content-position="left">评论</el-divider>
|
|
40
|
+
<Comment :id="id" category="post" v-if="id && allow_comment" />
|
|
41
|
+
<el-alert title="作者没有开启评论功能" type="warning" show-icon v-else></el-alert>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<!-- 底部 -->
|
|
46
|
+
<footer class="m-single-footer">
|
|
47
|
+
<slot name="single-footer"></slot>
|
|
48
|
+
</footer>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
import PostHeader from "./PostHeader.vue";
|
|
54
|
+
import Creators from "./Creators.vue";
|
|
55
|
+
import Collection from "./Collection.vue";
|
|
56
|
+
import Thx from "./Thx.vue";
|
|
57
|
+
import Article from "@jx3box/jx3box-editor/src/Article.vue";
|
|
58
|
+
import ArticleMarkdown from "@jx3box/jx3box-editor/src/ArticleMarkdown.vue";
|
|
59
|
+
import Comment from "@jx3box/jx3box-comment-ui/src/Comment.vue";
|
|
60
|
+
import { __visibleMap } from "@jx3box/jx3box-common/data/jx3box.json";
|
|
61
|
+
export default {
|
|
62
|
+
name: "cms-single",
|
|
63
|
+
components: {
|
|
64
|
+
PostHeader,
|
|
65
|
+
Creators,
|
|
66
|
+
Collection,
|
|
67
|
+
Thx,
|
|
68
|
+
Article,
|
|
69
|
+
ArticleMarkdown,
|
|
70
|
+
Comment,
|
|
71
|
+
},
|
|
72
|
+
props: ["post", "stat"],
|
|
73
|
+
data: function() {
|
|
74
|
+
return {
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
computed: {
|
|
78
|
+
id: function() {
|
|
79
|
+
return ~~this.post?.ID || 0;
|
|
80
|
+
},
|
|
81
|
+
post_type: function() {
|
|
82
|
+
return this.post?.post_type;
|
|
83
|
+
},
|
|
84
|
+
author_id : function (){
|
|
85
|
+
return this.post?.post_author
|
|
86
|
+
},
|
|
87
|
+
collection_id: function() {
|
|
88
|
+
return this.post?.post_collection;
|
|
89
|
+
},
|
|
90
|
+
collection_collapse: function() {
|
|
91
|
+
return this.post?.collection_collapse;
|
|
92
|
+
},
|
|
93
|
+
visible: function() {
|
|
94
|
+
return !!this.post?._check;
|
|
95
|
+
},
|
|
96
|
+
null_tip: function() {
|
|
97
|
+
let str = "作者设置了【";
|
|
98
|
+
str += __visibleMap[this.post?.visible];
|
|
99
|
+
str += "】";
|
|
100
|
+
return str;
|
|
101
|
+
},
|
|
102
|
+
post_content: function() {
|
|
103
|
+
return this.post?.post_content || "";
|
|
104
|
+
},
|
|
105
|
+
post_mode: function() {
|
|
106
|
+
return this.post?.post_mode || "tinymce";
|
|
107
|
+
},
|
|
108
|
+
isMarkdown: function() {
|
|
109
|
+
return this.post_mode == "markdown";
|
|
110
|
+
},
|
|
111
|
+
allow_comment : function (){
|
|
112
|
+
return !this.post?.comment
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<style lang="less">
|
|
119
|
+
@import "../../assets/css/cms-single.less";
|
|
120
|
+
</style>
|