@jx3box/jx3box-common-ui 7.7.7 → 7.7.9
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 +1 -1
- package/src/filters/topicBy.vue +5 -1
- package/src/header/manage.vue +17 -44
package/package.json
CHANGED
package/src/filters/topicBy.vue
CHANGED
|
@@ -45,6 +45,10 @@ export default {
|
|
|
45
45
|
type: String,
|
|
46
46
|
default: "",
|
|
47
47
|
},
|
|
48
|
+
label: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "主题",
|
|
51
|
+
}
|
|
48
52
|
},
|
|
49
53
|
emits: ["update:modelValue"],
|
|
50
54
|
model: {
|
|
@@ -60,7 +64,7 @@ export default {
|
|
|
60
64
|
computed: {
|
|
61
65
|
activeText() {
|
|
62
66
|
const { value } = this;
|
|
63
|
-
return value === "全部" ?
|
|
67
|
+
return value === "全部" ? this.label : value;
|
|
64
68
|
},
|
|
65
69
|
computedTopics() {
|
|
66
70
|
return ["全部", ...this.topics];
|
package/src/header/manage.vue
CHANGED
|
@@ -4,21 +4,19 @@
|
|
|
4
4
|
<img class="u-add" svg-inline src="../../assets/img/header/manage.svg" />
|
|
5
5
|
</span>
|
|
6
6
|
<ul class="u-menu u-pop-content">
|
|
7
|
-
<li v-for="item in
|
|
7
|
+
<li v-for="item in userPanel" :key="item.label">
|
|
8
8
|
<a :href="item.link" :target="item.target || '_self'"
|
|
9
9
|
><i :class="item.icon || 'el-icon-present'"></i> {{ item.label }}</a
|
|
10
10
|
>
|
|
11
11
|
</li>
|
|
12
|
-
<hr v-if="
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<a href="/dashboard/feedback?tab=pending"><i class="el-icon-message"></i> 反馈处理</a>
|
|
21
|
-
</li>
|
|
12
|
+
<hr v-if="userPanel.length" />
|
|
13
|
+
<template v-if="isEditor">
|
|
14
|
+
<li v-for="item in adminPanel" :key="item.label">
|
|
15
|
+
<a :href="item.link" :target="item.target || '_self'"
|
|
16
|
+
><i :class="item.icon || 'el-icon-present'"></i> {{ item.label }}</a
|
|
17
|
+
>
|
|
18
|
+
</li>
|
|
19
|
+
</template>
|
|
22
20
|
</ul>
|
|
23
21
|
</div>
|
|
24
22
|
</template>
|
|
@@ -27,31 +25,23 @@
|
|
|
27
25
|
import User from "@jx3box/jx3box-common/js/user";
|
|
28
26
|
import panel from "../../assets/data/panel.json";
|
|
29
27
|
import { getMenu } from "../../service/header";
|
|
30
|
-
import { checkTeamMember } from "../../service/cms";
|
|
31
28
|
export default {
|
|
32
29
|
name: "Manage",
|
|
33
30
|
data() {
|
|
34
31
|
return {
|
|
35
32
|
panel,
|
|
36
|
-
|
|
37
|
-
isTeamMember: false,
|
|
38
33
|
};
|
|
39
34
|
},
|
|
40
35
|
computed: {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// 只返回有权限的
|
|
46
|
-
if (item.onlyAdmin) {
|
|
47
|
-
return this.isAdmin;
|
|
48
|
-
}
|
|
49
|
-
return true;
|
|
50
|
-
})
|
|
51
|
-
.slice(0, 2);
|
|
36
|
+
userPanel: function () {
|
|
37
|
+
return this.panel.filter((item) => {
|
|
38
|
+
return !item.onlyAdmin;
|
|
39
|
+
});
|
|
52
40
|
},
|
|
53
|
-
|
|
54
|
-
return
|
|
41
|
+
adminPanel: function () {
|
|
42
|
+
return this.panel.filter((item) => {
|
|
43
|
+
return item.onlyAdmin;
|
|
44
|
+
});
|
|
55
45
|
},
|
|
56
46
|
isEditor() {
|
|
57
47
|
return User.isEditor();
|
|
@@ -59,7 +49,6 @@ export default {
|
|
|
59
49
|
},
|
|
60
50
|
mounted() {
|
|
61
51
|
this.loadPanel();
|
|
62
|
-
this.check();
|
|
63
52
|
},
|
|
64
53
|
methods: {
|
|
65
54
|
loadPanel: function () {
|
|
@@ -78,22 +67,6 @@ export default {
|
|
|
78
67
|
console.log("loadPanel error", e);
|
|
79
68
|
}
|
|
80
69
|
},
|
|
81
|
-
check: function () {
|
|
82
|
-
try {
|
|
83
|
-
const isTeamMember = JSON.parse(localStorage.getItem("BoxTeam3"));
|
|
84
|
-
|
|
85
|
-
if (isTeamMember) {
|
|
86
|
-
this.isTeamMember = isTeamMember === "true" || isTeamMember;
|
|
87
|
-
} else {
|
|
88
|
-
checkTeamMember().then((res) => {
|
|
89
|
-
this.isTeamMember = res.data.data;
|
|
90
|
-
localStorage.setItem("BoxTeam3", this.isTeamMember);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
} catch (e) {
|
|
94
|
-
console.log("check error", e);
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
70
|
},
|
|
98
71
|
};
|
|
99
72
|
</script>
|