@jx3box/jx3box-common-ui 5.3.8 → 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/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,67 +13,74 @@
20
13
  </LeftSidebar>
21
14
 
22
15
  <Main :withoutLeft="false" :withoutRight="false">
23
-
24
-
25
- <Creators :postId="30432" style="margin-bottom:10px"/>
26
- <Collection :id="59" :defaultVisible="true"/>
27
- <UserPop title="添加用户" v-model="visible" @confirm="addUser"/>
28
- <el-button @click="visible = true">用户POP</el-button>
29
-
30
- <Thx :postId="23865" postType="bbs" :userId="7" :adminBoxcoinEnable="true" :userBoxcoinEnable="true"/>
31
-
32
- <hr />
33
-
34
- <Like mode="heart" :count="100" :showCount="true" />
35
- <Down :count="100" :showCount="true" />
36
- <Mark label="KEY" value="VALUE" BGL="#000" BGR="#F39" />
37
- <Fav post-id="90" post-type="jx3dat" />
38
- <Feed post-id="90" post-type="jx3dat" />
39
- <Print title="传入标题" />
40
- <QRcode />
41
- <Sharing />
42
-
43
- <hr />
44
-
45
- <markBy />
46
- <menuBy :data="['test1', 'test2']" />
47
- <orderBy />
48
- <tagBy :data="['PVE', 'PVX']" :type="tag"/>
49
- <clientBy type=""/>
50
- <zlpBy/>
51
-
52
- <hr />
53
-
54
- <WikiPanel :wiki-post="wikiPost">
55
- <template slot="head-title">
56
- <i class="el-icon-location-information"></i>
57
- <span class="u-title">通识正文</span>
58
- </template>
59
- <template slot="head-actions">
60
- <a class="el-button el-button--primary u-publish">
61
- <i class="el-icon-edit"></i>
62
- <span>完善百科通识</span>
63
- </a>
64
- <span class="u-more">查看更多</span>
65
- </template>
66
- <template slot="body"
67
- >正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容正文内容</template
68
- >
69
- </WikiPanel>
70
- <hr />
71
-
72
- <WikiRevisions type="achievement" source-id="9096" />
73
- <hr>
74
-
75
- <WikiComments type="achievement" source-id="9096" />
76
- <hr>
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
- <div style="height:1200px;">
80
- <RightSideMsg>Test</RightSideMsg>
81
-
82
- <Author :author="author" uid="5" />
83
- </div>
82
+ <RightSideMsg>Hello</RightSideMsg>
83
+ <PostCollection :id="59" />
84
84
  </RightSidebar>
85
85
 
86
86
  <Footer></Footer>
@@ -105,6 +105,10 @@ import RightSideMsg from "./RightSideMsg.vue";
105
105
  import Footer from "./Footer.vue";
106
106
  import Bottom from "./Bottom.vue";
107
107
 
108
+ import singlebox from "./single/cms-single.vue";
109
+ import PostHeader from "./single/PostHeader.vue";
110
+ import PostCollection from "./single/PostCollection.vue";
111
+
108
112
  import Thx from "./single/Thx.vue";
109
113
  import Collection from "./single/Collection.vue";
110
114
  import Creators from "./single/Creators.vue";
@@ -145,6 +149,10 @@ export default {
145
149
  Bottom,
146
150
  RightSidebar,
147
151
 
152
+ singlebox,
153
+ PostHeader,
154
+ PostCollection,
155
+
148
156
  Thx,
149
157
  Collection,
150
158
  Creators,
@@ -174,28 +182,51 @@ export default {
174
182
  WikiRevisions,
175
183
  WikiComments,
176
184
 
177
- UserPop
185
+ UserPop,
178
186
  },
179
187
  data: function() {
180
188
  return {
189
+ tab: "post",
190
+
191
+ post: "",
192
+ post_id: "35605",
193
+
181
194
  author: "",
182
195
  wikiPost: null,
183
- tag : '',
184
- visible : false,
196
+ tag: "",
197
+ visible: false,
185
198
  };
186
199
  },
187
200
  created: function() {
188
- WikiPost.view(11042).then(
189
- (res) => {
190
- res = res.data;
191
- if (res.code === 200) this.wikiPost = res.data;
192
- }
193
- );
201
+ WikiPost.view(11042).then((res) => {
202
+ res = res.data;
203
+ if (res.code === 200) this.wikiPost = res.data;
204
+ });
194
205
  },
195
206
  methods: {
196
- addUser : function (val){
197
- console.log(val)
198
- }
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
+ },
199
224
  },
200
225
  };
201
226
  </script>
227
+
228
+ <style lang="less">
229
+ body {
230
+ padding-top: 0;
231
+ }
232
+ </style>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <nav class="c-header-nav" v-if="finalNav">
3
- <div class="u-item-box" v-for="item in finalNav" :key="item.key">
3
+ <div class="u-item-box" v-for="item in finalNav" :key="'header-nav-' + item.key">
4
4
  <template
5
5
  v-if="item.status && item.children && item.children.length"
6
6
  >
@@ -16,7 +16,7 @@
16
16
  <el-dropdown-menu slot="dropdown" class="c-header-menu">
17
17
  <el-dropdown-item
18
18
  v-for="subitem in item.children"
19
- :key="subitem.key"
19
+ :key="'header-nav-drop-' + subitem.key"
20
20
  class="u-menu-item"
21
21
  >
22
22
  <a
@@ -6,8 +6,15 @@
6
6
  <el-tooltip effect="dark" content="我的消息" placement="bottom">
7
7
  <a class="u-msg" :href="url.msg">
8
8
  <i class="u-icon u-icon-msg">
9
- <i class="u-pop" style="display: none;" v-show="pop"></i>
10
- <img svg-inline src="../../assets/img/header/msg.svg" />
9
+ <i
10
+ class="u-pop"
11
+ style="display: none"
12
+ v-show="pop"
13
+ ></i>
14
+ <img
15
+ svg-inline
16
+ src="../../assets/img/header/msg.svg"
17
+ />
11
18
  </i>
12
19
  </a>
13
20
  </el-tooltip>
@@ -17,14 +24,22 @@
17
24
  <div class="c-header-panel" id="c-header-panel">
18
25
  <el-tooltip effect="dark" content="发布中心" placement="bottom">
19
26
  <a class="u-post" :href="url.publish">
20
- <img class="u-add" svg-inline src="../../assets/img/header/add.svg" />
27
+ <img
28
+ class="u-add"
29
+ svg-inline
30
+ src="../../assets/img/header/add.svg"
31
+ />
21
32
  </a>
22
33
  </el-tooltip>
23
34
  </div>
24
35
 
25
36
  <!-- user info -->
26
37
  <div class="c-header-info">
27
- <div class="c-header-profile" id="c-header-profile" @click="showmenu">
38
+ <div
39
+ class="c-header-profile"
40
+ id="c-header-profile"
41
+ @click="showmenu"
42
+ >
28
43
  <img class="u-avatar" :src="user.avatar" />
29
44
  <span class="u-dropdown"></span>
30
45
  <ul class="u-menu" v-show="!fold">
@@ -47,14 +62,17 @@
47
62
  href="/vip/premium?from=header_usermenu"
48
63
  target="_blank"
49
64
  >
50
- <i class="i-icon-vip" :class="{ on: isVIP || isPRO }">{{ vipType }}</i>
65
+ <i
66
+ class="i-icon-vip"
67
+ :class="{ on: isVIP || isPRO }"
68
+ >{{ vipType }}</i
69
+ >
51
70
  <span class="u-vip-type">
52
71
  <template v-if="isVIP || isPRO">
53
- {{ vipTypeTxt
54
- }}
55
- <span
56
- class="u-vip-left"
57
- >({{ vipLeftDays }}天)</span>
72
+ {{ vipTypeTxt }}
73
+ <span class="u-vip-left"
74
+ >({{ vipLeftDays }}天)</span
75
+ >
58
76
  </template>
59
77
  <template v-else>升级账号类型</template>
60
78
  </span>
@@ -63,7 +81,10 @@
63
81
  </li>
64
82
  <hr />
65
83
  <template v-for="(item, i) in panel">
66
- <li :key="'panel-' + i" v-if="isEditor || !item.onlyAdmin">
84
+ <li
85
+ :key="'panel-' + i"
86
+ v-if="isEditor || !item.onlyAdmin"
87
+ >
67
88
  <a :href="item.link">{{ item.label }}</a>
68
89
  </li>
69
90
  </template>
@@ -104,7 +125,7 @@ export default {
104
125
  data: function () {
105
126
  return {
106
127
  panel,
107
- isEditor : false,
128
+ isEditor: false,
108
129
 
109
130
  // 是否有消息
110
131
  pop: false,
@@ -200,7 +221,7 @@ export default {
200
221
  });
201
222
  },
202
223
  loadPanel: function () {
203
- getMenu('panel').then((res) => {
224
+ getMenu("panel").then((res) => {
204
225
  this.panel = res.data?.data?.val || panel;
205
226
  });
206
227
  },
@@ -237,7 +258,7 @@ export default {
237
258
  // 初始化
238
259
  init: function () {
239
260
  if (this.isLogin) {
240
- this.isEditor = User.isEditor()
261
+ this.isEditor = User.isEditor();
241
262
  this.checkMSG();
242
263
  this.loadPanel();
243
264
  this.loadAsset();
@@ -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",'defaultVisible'],
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 (val) {
57
- !!~~val && this.loadData();
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 : function (val){
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 (id) {
76
+ collectionLink: function(id) {
76
77
  return getLink("collection", id);
77
78
  },
78
- showLink: function (item) {
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 scoped lang="less">
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,86 @@
1
+ <template>
2
+ <div class="m-single-collection" v-if="list && list.length">
3
+ <div class="u-title"><i class="el-icon-connection"></i> 关联</div>
4
+ <ul class="u-list">
5
+ <li v-for="(item, i) in list" :key="i">
6
+ <el-tooltip class="item" effect="dark" :content="item.title" placement="left">
7
+ <a :href="item | showLink" target="_blank">
8
+ <i class="el-icon-link"></i>
9
+ {{ item.title }}
10
+ </a>
11
+ </el-tooltip>
12
+ </li>
13
+ </ul>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ import { getLink } from "@jx3box/jx3box-common/js/utils";
19
+ import { getCollection } from "../../service/helper";
20
+ export default {
21
+ name: "PostCollection",
22
+ props: ["id", "store"],
23
+ components: {},
24
+ data: function() {
25
+ return {
26
+ data: {
27
+ title: "",
28
+ posts: [],
29
+ },
30
+ };
31
+ },
32
+ computed: {
33
+ list: function() {
34
+ return this.data?.posts || this.store?.posts;
35
+ },
36
+ },
37
+ watch: {
38
+ id: {
39
+ immediate: true,
40
+ handler: function(val) {
41
+ !!~~val && this.loadData();
42
+ },
43
+ },
44
+ },
45
+ methods: {
46
+ loadData: function() {
47
+ getCollection(this.id).then((res) => {
48
+ this.data = res.data?.data?.collection;
49
+ });
50
+ },
51
+ },
52
+ filters: {
53
+ showLink: function(item) {
54
+ if (item.type == "custom") {
55
+ return item.url;
56
+ } else {
57
+ return getLink(item.type, item.id);
58
+ }
59
+ },
60
+ },
61
+ };
62
+ </script>
63
+ <style scoped lang="less">
64
+ .m-single-collection {
65
+ .u-title {
66
+ font-weight: 300;
67
+ font-size: 20px;
68
+ }
69
+ .u-list {
70
+ list-style: none;
71
+ padding: 10px 20px;
72
+ margin: 0;
73
+ li {
74
+ .fz(13px, 36px);
75
+ }
76
+ a {
77
+ .db;
78
+ transition: 0.15s ease-in-out;
79
+ .nobreak;
80
+ &:hover {
81
+ background-color: #e6f0fb;
82
+ }
83
+ }
84
+ }
85
+ }
86
+ </style>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <div class="m-single-contents">
3
+ <!-- TODO: -->
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name : 'PostContents',
10
+ props:[],
11
+ components : {},
12
+ data : function(){
13
+ return {
14
+
15
+ }
16
+ },
17
+ computed:{},
18
+ watch:{},
19
+ methods:{},
20
+ filters:{},
21
+ created:function(){},
22
+ mounted:function(){},
23
+ }
24
+ </script>