@jx3box/jx3box-common-ui 8.8.1 → 8.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "8.8.1",
3
+ "version": "8.8.2",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -266,7 +266,7 @@ export default {
266
266
  tab: "widget",
267
267
 
268
268
  post: {},
269
- post_id: "12839",
269
+ post_id: "77128",
270
270
 
271
271
  author: "",
272
272
  wikiPost: null,
@@ -5,10 +5,18 @@
5
5
  <span class="u-title u-sub-block" :href="url" :title="title">
6
6
  <i class="u-original" v-if="isOriginal">原创</i>
7
7
  <i class="u-private" v-if="post.post_status != 'publish' || !!~~post.visible">
8
- <i class="el-icon-lock" v-if="post.post_status == 'draft' || post.post_status == 'pending' || !!~~post.visible" style="color:#fb9b24"></i>
9
- <i class="el-icon-delete" v-if="post.post_status == 'dustbin'" style="color:#c00"></i>
8
+ <i
9
+ class="el-icon-lock"
10
+ v-if="post.post_status == 'draft' || post.post_status == 'pending' || !!~~post.visible"
11
+ style="color: #fb9b24"
12
+ ></i>
13
+ <i class="el-icon-delete" v-if="post.post_status == 'dustbin'" style="color: #c00"></i>
10
14
  </i>
11
15
  <span class="u-title-text">{{ title }}</span>
16
+ <template v-if="titleExtra">
17
+ <span class="u-client" :class="'i-client-' + client">{{ showClientLabel(client) }}</span>
18
+ <span class="u-client u-zlp">{{ zlp }}</span>
19
+ </template>
12
20
  </span>
13
21
  </div>
14
22
 
@@ -38,7 +46,7 @@
38
46
  </div>
39
47
 
40
48
  <!-- 发布日期 -->
41
- <span class="u-podate u-sub-block" :title="'发布日期:' + post_time">
49
+ <span class="u-podate u-sub-block" :title="'发布日期:' + post_time">
42
50
  <i class="u-icon-podate">
43
51
  <img svg-inline src="../../assets/img/single/podate.svg" />
44
52
  </i>
@@ -74,100 +82,107 @@
74
82
  </template>
75
83
 
76
84
  <script>
77
- import { __Root,__clients } from "@jx3box/jx3box-common/data/jx3box.json";
85
+ import { __Root, __clients } from "@jx3box/jx3box-common/data/jx3box.json";
78
86
  import { showDate, showTime } from "@jx3box/jx3box-common/js/moment";
79
87
  import { editLink, authorLink } from "@jx3box/jx3box-common/js/utils.js";
80
88
  import User from "@jx3box/jx3box-common/js/user.js";
81
89
  import $ from "jquery";
82
90
  export default {
83
91
  name: "single-header",
84
- props: ["post", "stat"],
85
- data: function() {
92
+ props: ["post", "stat", "titleExtra"],
93
+ data: function () {
86
94
  return {
87
95
  wordCount: 0,
88
96
  };
89
97
  },
90
98
  computed: {
91
- url: function() {
99
+ url: function () {
92
100
  return location.href;
93
101
  },
94
- isOriginal: function() {
102
+ isOriginal: function () {
95
103
  return !!~~this.post?.original;
96
104
  },
97
- title: function() {
105
+ title: function () {
98
106
  return this.post?.post_title || "无标题";
99
107
  },
100
- author_link: function() {
108
+ author_link: function () {
101
109
  return authorLink(this.post?.post_author);
102
110
  },
103
- author_name: function() {
111
+ author_name: function () {
104
112
  return this.post?.author_info?.display_name || "匿名";
105
113
  },
106
- post_date: function() {
114
+ post_date: function () {
107
115
  return showDate(new Date(this.post?.post_date));
108
116
  },
109
- update_date: function() {
117
+ update_date: function () {
110
118
  return showDate(new Date(this.post?.post_modified));
111
119
  },
112
- post_time: function() {
120
+ post_time: function () {
113
121
  return showTime(new Date(this.post?.post_date));
114
122
  },
115
- update_time: function() {
123
+ update_time: function () {
116
124
  return showTime(new Date(this.post?.post_modified));
117
125
  },
118
- views: function() {
126
+ views: function () {
119
127
  return this.stat?.views || "-";
120
128
  },
121
- edit_link: function() {
129
+ edit_link: function () {
122
130
  return editLink(this.post?.post_type, this.post?.ID);
123
131
  },
124
- canEdit: function() {
125
- return this.post?.post_author == User.getInfo().uid
132
+ canEdit: function () {
133
+ return this.post?.post_author == User.getInfo().uid;
126
134
  },
127
- client: function() {
135
+ client: function () {
128
136
  return this.post?.client || "std";
129
137
  },
138
+ zlp: function () {
139
+ return this.post?.zlp || "";
140
+ },
130
141
  },
131
142
  watch: {
132
143
  post: {
133
144
  deep: true,
134
- handler: function(val) {
145
+ handler: function (val) {
135
146
  this.countWords();
136
147
  },
137
- }
148
+ },
138
149
  },
139
150
  methods: {
140
- showClientLabel: function(val) {
151
+ showClientLabel: function (val) {
141
152
  return __clients[val];
142
153
  },
143
- countWords: function (){
154
+ countWords: function () {
144
155
  this.$nextTick(() => {
145
156
  // 需要去除空格 \n \g
146
- const text = $('.c-article').text()?.replace(/[\s|\n|\r|\t|\g|\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?|\,|\。|\?|\:|\;|\‘|\’|\”|\“|\、|\·|\!|\(|\)|\》|\《|\『|\』]/g, '');
157
+ const text = $(".c-article")
158
+ .text()
159
+ ?.replace(
160
+ /[\s|\n|\r|\t|\g|\ |\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?|\,|\。|\?|\:|\;|\‘|\’|\”|\“|\、|\·|\!|\(|\)|\》|\《|\『|\』]/g,
161
+ ""
162
+ );
147
163
 
148
164
  this.wordCount = text?.length || 0;
149
- })
150
- }
151
- },
152
- mounted: function() {
165
+ });
166
+ },
153
167
  },
168
+ mounted: function () {},
154
169
  };
155
170
  </script>
156
171
 
157
172
  <style lang="less">
158
- .i-client-all{
173
+ .i-client-all {
159
174
  border: 1px solid #a26ef7;
160
175
  color: #a26ef7;
161
176
  }
162
- .i-client-std{
177
+ .i-client-std {
163
178
  border: 1px solid #f0b400;
164
179
  color: #f0b400;
165
180
  }
166
- .i-client-origin{
181
+ .i-client-origin {
167
182
  border: 1px solid #0eb7ce;
168
183
  color: #0eb7ce;
169
184
  }
170
- .i-client-wujie{
185
+ .i-client-wujie {
171
186
  border: 1px solid #fc79bf;
172
187
  color: #fc79bf;
173
188
  }
@@ -207,6 +222,11 @@ export default {
207
222
  .db;
208
223
  .nobreak;
209
224
  }
225
+
226
+ .u-client {
227
+ .none;
228
+ }
229
+
210
230
  .u-author {
211
231
  .pr;
212
232
  }
@@ -329,6 +349,24 @@ export default {
329
349
  .none;
330
350
  }
331
351
  }
352
+
353
+ .m-single-title {
354
+ .u-client {
355
+ font-style: normal;
356
+ .fz(12px);
357
+ padding: 0px 5px;
358
+ .r(3px);
359
+ line-height: 20px;
360
+ .dbi;
361
+ margin-left: 2px;
362
+ }
363
+
364
+ .u-zlp {
365
+ background-color: #eee;
366
+ border: 1px solid #fa80a2;
367
+ color: #fa80a2;
368
+ }
369
+ }
332
370
  }
333
371
  @media print {
334
372
  .m-single-info {