@jx3box/jx3box-common-ui 7.0.2 → 7.0.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.
@@ -0,0 +1,23 @@
1
+ .w-filter-topics {
2
+ display: inline-block;
3
+ .u-toggle {
4
+ color: #606266;
5
+ font-size: 12px;
6
+ .pointer;
7
+ }
8
+ }
9
+
10
+ .w-filter-topic__pop {
11
+ .u-group-title {
12
+ color: #606266;
13
+ padding-bottom: 10px;
14
+ }
15
+ .u-group {
16
+ .flex;
17
+ flex-wrap: wrap;
18
+ gap: 10px;
19
+ }
20
+ .u-tag {
21
+ .pointer;
22
+ }
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "7.0.2",
3
+ "version": "7.0.4",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,9 +31,9 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@jx3box/jx3box-comment-ui": "^1.7.8",
34
- "@jx3box/jx3box-common": "^7.7.2",
34
+ "@jx3box/jx3box-common": "^7.7.3",
35
35
  "@jx3box/jx3box-data": "^3.0.4",
36
- "@jx3box/jx3box-editor": "^1.7.3",
36
+ "@jx3box/jx3box-editor": "^1.7.4",
37
37
  "axios": "^0.26.1",
38
38
  "dayjs": "^1.11.0",
39
39
  "element-ui": "^2.13.2",
package/src/App.vue CHANGED
@@ -66,6 +66,8 @@
66
66
  <clientBy type="" />
67
67
  <zlpBy />
68
68
 
69
+ <tagBy2 v-model="tag2" :topics="post_topics" />
70
+
69
71
  <hr />
70
72
  <uploadImage
71
73
  v-model="upload"
@@ -171,6 +173,7 @@ import orderBy from "./filters/orderBy.vue";
171
173
  import tagBy from "./filters/tagBy.vue";
172
174
  import clientBy from "./filters/clientBy.vue";
173
175
  import zlpBy from "./filters/zlpBy.vue";
176
+ import tagBy2 from "./filters/tagBy2.vue";
174
177
 
175
178
  import uploadImage from "./upload/upload_banner.vue";
176
179
  import AuthorMedal from "./medal/medal.vue";
@@ -181,6 +184,7 @@ import WikiComments from "./wiki/WikiComments.vue";
181
184
  import axios from "axios";
182
185
  import { __server } from "@jx3box/jx3box-common/data/jx3box.json";
183
186
  import { wiki } from "@jx3box/jx3box-common/js/wiki";
187
+ import post_topics from "@jx3box/jx3box-common/data/post_topics.json";
184
188
 
185
189
  export default {
186
190
  name: "App",
@@ -223,6 +227,7 @@ export default {
223
227
  tagBy,
224
228
  clientBy,
225
229
  zlpBy,
230
+ tagBy2,
226
231
 
227
232
  uploadImage,
228
233
  AuthorMedal,
@@ -249,6 +254,9 @@ export default {
249
254
 
250
255
  upload: "",
251
256
  text: `<Text>text="使用:<BUFF 3222 1 desc>,持续<BUFF 3222 1 time>。\\\n" font=105 </text><Text>text="红豆沙做馅儿,精致细腻的广式月饼。" font=100 </text><Text>text="使用:能在唐门套装供应商处换取如下装备。\\\n" font=105 </text><Text>text="[燕云·重泉靴]" name="iteminfolink" eventid=513 script="this.nVersion=0 this.dwTabType=7 this.dwIndex=35244 this.OnItemLButtonDown=function() OnItemLinkDown(this) end" font=100 r=255 g=40 b=255 </text><Text>text="," font=105 </text><Text>text="[燕云·铭松靴]" name="iteminfolink" eventid=513 script="this.nVersion=0 this.dwTabType=7 this.dwIndex=35245 this.OnItemLButtonDown=function() OnItemLinkDown(this) end" font=100 r=255 g=40 b=255 </text><Text>text="。" font=100 </text>`,
257
+
258
+ post_topics: post_topics['pve'],
259
+ tag2: ''
252
260
  };
253
261
  },
254
262
  created: function () {
@@ -158,7 +158,9 @@ export default {
158
158
  cursor: default;
159
159
  &:hover {
160
160
  cursor: pointer;
161
- background: #ecf5ff;
161
+ background: #409eff;
162
+ color: #fff;
163
+ border-color: #409eff;
162
164
  }
163
165
  }
164
166
 
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <div class="w-filter-topics" ref="tagBy">
3
+ <el-popover
4
+ v-model="visible"
5
+ trigger="manual"
6
+ ref="pop"
7
+ :width="400"
8
+ popper-class="w-filter-topic__pop"
9
+ :popper-options="{ boundariesElement: 'parent' }"
10
+ >
11
+ <div class="w-filter-tag__content">
12
+ <div class="u-group">
13
+ <el-tag
14
+ v-for="item in computedTopics" :key="item"
15
+ @click="onTagClick(item)"
16
+ class="u-group-item u-tag"
17
+ :effect="item === value ? 'dark' : 'plain'"
18
+ >{{ item }}</el-tag
19
+ >
20
+ </div>
21
+ </div>
22
+
23
+ <template #reference>
24
+ <span @click="onToggle" class="u-toggle" :class="{ active: !!value }">
25
+ <i class="el-icon-s-operation"></i>
26
+ {{ activeText }}
27
+ <i class="el-icon-arrow-down el-icon--right"></i>
28
+ </span>
29
+ </template>
30
+ </el-popover>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ export default {
36
+ name: "tagBy2",
37
+ props: {
38
+ topics: {
39
+ type: Array,
40
+ default: () => [],
41
+ },
42
+ modelValue: {
43
+ type: String,
44
+ default: "",
45
+ },
46
+ },
47
+ emits: ["update:modelValue"],
48
+ model: {
49
+ prop: "modelValue",
50
+ event: "update:modelValue",
51
+ },
52
+ data() {
53
+ return {
54
+ visible: false,
55
+ value: "全部",
56
+ };
57
+ },
58
+ computed: {
59
+ activeText() {
60
+ const { value } = this;
61
+ return value === "全部" ? "主题" : value;
62
+ },
63
+ computedTopics() {
64
+ return ['全部', ...this.topics]
65
+ },
66
+ },
67
+ watch: {
68
+ modelValue: {
69
+ immediate: true,
70
+ handler(val) {
71
+ this.value = val === '' ? '全部' : val;
72
+ },
73
+ },
74
+ value(val) {
75
+ if (val === '全部') val = ''
76
+ this.$emit("update:modelValue", val);
77
+ },
78
+ },
79
+ mounted() {
80
+ document.addEventListener("click", this.clickOutside);
81
+ },
82
+ beforeDestroy() {
83
+ document.removeEventListener("click", this.clickOutside);
84
+ },
85
+ methods: {
86
+ onToggle() {
87
+ this.visible = !this.visible;
88
+ },
89
+ onTagClick(item) {
90
+ this.value = item;
91
+
92
+ setTimeout(() => {
93
+ this.visible = false;
94
+ }, 100);
95
+ },
96
+ clickOutside(e) {
97
+ const tagBy = this.$refs.tagBy;
98
+ const pop = this.$refs.pop;
99
+
100
+ if (tagBy && !tagBy.contains(e.target) && pop && !pop.$el.contains(e.target)) {
101
+ this.visible = false;
102
+ }
103
+ },
104
+ },
105
+ };
106
+ </script>
107
+
108
+ <style lang="less">
109
+ @import "../../assets/css/tag-by2.less";
110
+ </style>