@cmstops/pro-compo 0.1.0 → 0.1.1
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/dist/index.css +90 -0
- package/dist/index.min.css +1 -1
- package/es/appCenter/component.d.ts +0 -0
- package/es/appCenter/component.js +185 -0
- package/es/appCenter/index.d.ts +2 -0
- package/es/appCenter/index.js +7 -0
- package/es/appCenter/script/api.d.ts +10 -0
- package/es/appCenter/script/api.js +27 -0
- package/es/appCenter/script/apps.d.ts +23 -0
- package/es/appCenter/script/apps.js +122 -0
- package/es/appCenter/script/permissionMap.d.ts +6 -0
- package/es/appCenter/script/permissionMap.js +19 -0
- package/es/appCenter/script/routeMap.d.ts +4 -0
- package/es/appCenter/script/routeMap.js +109 -0
- package/es/appCenter/style/css.js +1 -0
- package/es/appCenter/style/index.css +90 -0
- package/es/appCenter/style/index.d.ts +1 -0
- package/es/appCenter/style/index.js +1 -0
- package/es/appCenter/style/index.less +100 -0
- package/es/button/style/css.js +1 -1
- package/es/button/style/index.js +1 -1
- package/es/index.css +90 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.less +1 -0
- package/es/utils/auth.d.ts +5 -0
- package/es/utils/auth.js +9 -0
- package/es/utils/request.d.ts +9 -0
- package/es/utils/request.js +36 -0
- package/lib/appCenter/component.js +186 -0
- package/lib/appCenter/index.js +8 -0
- package/lib/appCenter/script/api.js +32 -0
- package/lib/appCenter/script/apps.js +123 -0
- package/lib/appCenter/script/permissionMap.js +20 -0
- package/lib/appCenter/script/routeMap.js +110 -0
- package/lib/appCenter/style/css.js +2 -0
- package/lib/appCenter/style/index.css +90 -0
- package/lib/appCenter/style/index.js +2 -0
- package/lib/appCenter/style/index.less +100 -0
- package/lib/button/style/css.js +1 -1
- package/lib/button/style/index.js +1 -1
- package/lib/index.css +90 -0
- package/lib/index.js +2 -0
- package/lib/index.less +1 -0
- package/lib/utils/auth.js +12 -0
- package/lib/utils/request.js +41 -0
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -2,3 +2,93 @@
|
|
|
2
2
|
height: auto;
|
|
3
3
|
padding: 20px;
|
|
4
4
|
}
|
|
5
|
+
.reference-btn {
|
|
6
|
+
border: none;
|
|
7
|
+
padding: 12px 16px;
|
|
8
|
+
border-radius: 4px;
|
|
9
|
+
color: #5f5f5f;
|
|
10
|
+
}
|
|
11
|
+
.app-list-wrap {
|
|
12
|
+
position: relative;
|
|
13
|
+
padding: 10px;
|
|
14
|
+
}
|
|
15
|
+
.app-title {
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
font-weight: bold;
|
|
18
|
+
padding: 0px 15px;
|
|
19
|
+
}
|
|
20
|
+
.ul-list {
|
|
21
|
+
list-style: none;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
width: 435px !important;
|
|
24
|
+
text-align: center;
|
|
25
|
+
padding: 0;
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
.ul-list .li_item {
|
|
29
|
+
float: left;
|
|
30
|
+
width: 85px;
|
|
31
|
+
height: 90px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
margin: 13px 0;
|
|
34
|
+
position: relative;
|
|
35
|
+
}
|
|
36
|
+
.ul-list .li_item .icon-logo .svg-icon {
|
|
37
|
+
width: 4em;
|
|
38
|
+
height: 3.5em;
|
|
39
|
+
}
|
|
40
|
+
.ul-list .li_item:hover {
|
|
41
|
+
background: rgba(0, 0, 0, 0.05);
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
}
|
|
45
|
+
.ul-list .li_item:hover .icon-gengduo {
|
|
46
|
+
display: block;
|
|
47
|
+
}
|
|
48
|
+
.ul-list .li_item .wrap_icon {
|
|
49
|
+
width: 70px;
|
|
50
|
+
display: inline-block;
|
|
51
|
+
margin-top: 6px;
|
|
52
|
+
}
|
|
53
|
+
.ul-list .li_item .wrap_icon .wrap_ .icon-logo {
|
|
54
|
+
width: 70px;
|
|
55
|
+
height: 50px;
|
|
56
|
+
margin-bottom: 4px;
|
|
57
|
+
}
|
|
58
|
+
.ul-list .li_item .wrap_icon .wrap_ .icon-logo img {
|
|
59
|
+
max-width: 100%;
|
|
60
|
+
max-height: 100%;
|
|
61
|
+
}
|
|
62
|
+
.ul-list .li_item .wrap_icon .wrap_ .shortcut-logo {
|
|
63
|
+
line-height: 77px;
|
|
64
|
+
}
|
|
65
|
+
.ul-list .li_item .wrap_icon .wrap_ .shortcut-logo img {
|
|
66
|
+
width: 35px;
|
|
67
|
+
height: 35px;
|
|
68
|
+
}
|
|
69
|
+
.ul-list .li_item .wrap_icon .wrap_ .icon_title {
|
|
70
|
+
width: 73px;
|
|
71
|
+
height: 20px;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
text-overflow: ellipsis;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
}
|
|
76
|
+
.ul-list .li_item .wrap_icon .quick-add .icon-logo {
|
|
77
|
+
width: 40px;
|
|
78
|
+
height: 40px;
|
|
79
|
+
margin: 5px auto 9px;
|
|
80
|
+
text-align: center;
|
|
81
|
+
background-color: rgba(0, 0, 0, 0.12);
|
|
82
|
+
border-radius: 50%;
|
|
83
|
+
}
|
|
84
|
+
.ul-list .li_item .wrap_icon .quick-add .icon-logo i {
|
|
85
|
+
line-height: 40px;
|
|
86
|
+
color: rgba(0, 0, 0, 0.85);
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
}
|
|
89
|
+
.ul-list .li_item .icon-gengduo {
|
|
90
|
+
display: none;
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 2px;
|
|
93
|
+
right: 4px;
|
|
94
|
+
}
|
package/dist/index.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.tooltip-button{height:auto;padding:20px}
|
|
1
|
+
.tooltip-button{height:auto;padding:20px}.reference-btn{border:none;padding:12px 16px;border-radius:4px;color:#5f5f5f}.app-list-wrap{position:relative;padding:10px}.app-title{font-size:16px;font-weight:700;padding:0 15px}.ul-list{list-style:none;overflow:hidden;width:435px!important;text-align:center;padding:0;margin:0}.ul-list .li_item{float:left;width:85px;height:90px;text-align:center;margin:13px 0;position:relative}.ul-list .li_item .icon-logo .svg-icon{width:4em;height:3.5em}.ul-list .li_item:hover{background:rgba(0,0,0,.05);border-radius:4px;cursor:pointer}.ul-list .li_item:hover .icon-gengduo{display:block}.ul-list .li_item .wrap_icon{width:70px;display:inline-block;margin-top:6px}.ul-list .li_item .wrap_icon .wrap_ .icon-logo{width:70px;height:50px;margin-bottom:4px}.ul-list .li_item .wrap_icon .wrap_ .icon-logo img{max-width:100%;max-height:100%}.ul-list .li_item .wrap_icon .wrap_ .shortcut-logo{line-height:77px}.ul-list .li_item .wrap_icon .wrap_ .shortcut-logo img{width:35px;height:35px}.ul-list .li_item .wrap_icon .wrap_ .icon_title{width:73px;height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ul-list .li_item .wrap_icon .quick-add .icon-logo{width:40px;height:40px;margin:5px auto 9px;text-align:center;background-color:rgba(0,0,0,.12);border-radius:50%}.ul-list .li_item .wrap_icon .quick-add .icon-logo i{line-height:40px;color:rgba(0,0,0,.85);font-size:14px}.ul-list .li_item .icon-gengduo{display:none;position:absolute;top:2px;right:4px}
|
|
File without changes
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { defineComponent, ref, useSlots, computed, onMounted, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, createCommentVNode, Fragment, renderList, toDisplayString, renderSlot } from "vue";
|
|
2
|
+
import { Popover, Message } from "@arco-design/web-vue";
|
|
3
|
+
import routeMap from "./script/routeMap.js";
|
|
4
|
+
import permissionMap from "./script/permissionMap.js";
|
|
5
|
+
import appList from "./script/apps.js";
|
|
6
|
+
import { setResentApp, getPubApps, getUserRepoActs, getResentApp } from "./script/api.js";
|
|
7
|
+
import { getRID } from "../utils/auth.js";
|
|
8
|
+
const _hoisted_1 = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "reference-btn"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_2 = { class: "app-list-wrap apps-popover" };
|
|
13
|
+
const _hoisted_3 = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "app-title"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_4 = { class: "ul-list" };
|
|
18
|
+
const _hoisted_5 = ["onClick"];
|
|
19
|
+
const _hoisted_6 = { class: "wrap_icon" };
|
|
20
|
+
const _hoisted_7 = { class: "wrap_" };
|
|
21
|
+
const _hoisted_8 = { class: "icon-logo" };
|
|
22
|
+
const _hoisted_9 = ["src"];
|
|
23
|
+
const _hoisted_10 = { class: "icon_title" };
|
|
24
|
+
const _hoisted_11 = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "app-title"
|
|
27
|
+
};
|
|
28
|
+
const _hoisted_12 = { class: "ul-list" };
|
|
29
|
+
const _hoisted_13 = ["onClick"];
|
|
30
|
+
const _hoisted_14 = { class: "wrap_icon" };
|
|
31
|
+
const _hoisted_15 = { class: "wrap_" };
|
|
32
|
+
const _hoisted_16 = { class: "icon-logo" };
|
|
33
|
+
const _hoisted_17 = ["src"];
|
|
34
|
+
const _hoisted_18 = { class: "icon_title" };
|
|
35
|
+
const _sfc_main = defineComponent({
|
|
36
|
+
...{ name: "appCenter" },
|
|
37
|
+
__name: "component",
|
|
38
|
+
props: {
|
|
39
|
+
BASE_API: {}
|
|
40
|
+
},
|
|
41
|
+
setup(__props) {
|
|
42
|
+
const props = __props;
|
|
43
|
+
const StorePubApplication = ref([]);
|
|
44
|
+
const resentApp = ref([]);
|
|
45
|
+
const permissions = ref([]);
|
|
46
|
+
const slotTest = !!useSlots().reference;
|
|
47
|
+
const rid = getRID() || "4";
|
|
48
|
+
const BASE_API = props.BASE_API || "https://site.cmstop.xyz";
|
|
49
|
+
const navList = computed(() => {
|
|
50
|
+
const appList2 = [];
|
|
51
|
+
StorePubApplication.value.map((item) => {
|
|
52
|
+
item.actions.map((app) => {
|
|
53
|
+
if (!app.icon.includes("http") && !app.icon.includes("data:image") && !app.icon.includes(".svg")) {
|
|
54
|
+
app.icon = `${BASE_API}/static/icon/${app.icon}.svg`;
|
|
55
|
+
}
|
|
56
|
+
const hide = [];
|
|
57
|
+
if (!hide.includes(app.key) && (app.type === 3 || app.subscribed) && hasRight(app)) {
|
|
58
|
+
appList2.push(app);
|
|
59
|
+
}
|
|
60
|
+
return app;
|
|
61
|
+
});
|
|
62
|
+
return item;
|
|
63
|
+
});
|
|
64
|
+
return appList2;
|
|
65
|
+
});
|
|
66
|
+
const resentList = computed(() => {
|
|
67
|
+
return navList.value.filter((item) => {
|
|
68
|
+
return resentApp.value.includes(item.id);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
const remainList = computed(() => {
|
|
72
|
+
return navList.value.filter((item) => {
|
|
73
|
+
return !resentApp.value.includes(item.id);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
const routeRedirect = (item) => {
|
|
77
|
+
if (hasRight(item)) {
|
|
78
|
+
setResent(item);
|
|
79
|
+
routeMap(BASE_API, rid, item.key, item);
|
|
80
|
+
} else {
|
|
81
|
+
Message.warning({ content: "\u6682\u65E0\u6743\u9650\uFF0C\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458" });
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const hasRight = (item) => {
|
|
85
|
+
return permissionMap(permissions.value, item);
|
|
86
|
+
};
|
|
87
|
+
const getUserActs = async () => {
|
|
88
|
+
const { code, message } = await getUserRepoActs(BASE_API);
|
|
89
|
+
if (code === 0 && message) {
|
|
90
|
+
permissions.value = message || [];
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const getResent = async () => {
|
|
94
|
+
const { code, message } = await getResentApp(BASE_API, { repo_id: rid });
|
|
95
|
+
if (code === 0 && message) {
|
|
96
|
+
resentApp.value = message.map((item) => parseInt(item, 10));
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const setResent = async (item) => {
|
|
100
|
+
await setResentApp(BASE_API, { repo_id: rid, app_id: item.id });
|
|
101
|
+
};
|
|
102
|
+
const load = async () => {
|
|
103
|
+
const result = await getPubApps(BASE_API, { rid, type: "2,3" });
|
|
104
|
+
if (result.code === 0) {
|
|
105
|
+
StorePubApplication.value = result.data.concat(appList);
|
|
106
|
+
setTimeout(() => {
|
|
107
|
+
getResent();
|
|
108
|
+
getUserActs();
|
|
109
|
+
}, 500);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
onMounted(() => {
|
|
113
|
+
load();
|
|
114
|
+
});
|
|
115
|
+
return (_ctx, _cache) => {
|
|
116
|
+
return openBlock(), createElementBlock("div", null, [
|
|
117
|
+
createVNode(unref(Popover), {
|
|
118
|
+
trigger: "hover",
|
|
119
|
+
"arrow-style": { display: "none" },
|
|
120
|
+
"content-style": { padding: 0, minWidth: "400px" }
|
|
121
|
+
}, {
|
|
122
|
+
content: withCtx(() => [
|
|
123
|
+
createElementVNode("div", _hoisted_2, [
|
|
124
|
+
resentList.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, "\u6700\u8FD1\u4F7F\u7528")) : createCommentVNode("v-if", true),
|
|
125
|
+
createElementVNode("ul", _hoisted_4, [
|
|
126
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(resentList.value, (item, index) => {
|
|
127
|
+
return openBlock(), createElementBlock("li", {
|
|
128
|
+
key: index,
|
|
129
|
+
class: "li_item"
|
|
130
|
+
}, [
|
|
131
|
+
createElementVNode("div", {
|
|
132
|
+
onClick: ($event) => routeRedirect(item)
|
|
133
|
+
}, [
|
|
134
|
+
createElementVNode("div", _hoisted_6, [
|
|
135
|
+
createElementVNode("div", _hoisted_7, [
|
|
136
|
+
createElementVNode("div", _hoisted_8, [
|
|
137
|
+
createElementVNode("img", {
|
|
138
|
+
src: item.icon,
|
|
139
|
+
class: "icon"
|
|
140
|
+
}, null, 8, _hoisted_9)
|
|
141
|
+
]),
|
|
142
|
+
createElementVNode("div", _hoisted_10, toDisplayString(item.alias), 1)
|
|
143
|
+
])
|
|
144
|
+
])
|
|
145
|
+
], 8, _hoisted_5)
|
|
146
|
+
]);
|
|
147
|
+
}), 128))
|
|
148
|
+
]),
|
|
149
|
+
resentList.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_11, "\u76F8\u5173\u5E94\u7528")) : createCommentVNode("v-if", true),
|
|
150
|
+
createElementVNode("ul", _hoisted_12, [
|
|
151
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(remainList.value, (item, index) => {
|
|
152
|
+
return openBlock(), createElementBlock("li", {
|
|
153
|
+
key: index,
|
|
154
|
+
class: "li_item"
|
|
155
|
+
}, [
|
|
156
|
+
createElementVNode("div", {
|
|
157
|
+
onClick: ($event) => routeRedirect(item)
|
|
158
|
+
}, [
|
|
159
|
+
createElementVNode("div", _hoisted_14, [
|
|
160
|
+
createElementVNode("div", _hoisted_15, [
|
|
161
|
+
createElementVNode("div", _hoisted_16, [
|
|
162
|
+
createElementVNode("img", {
|
|
163
|
+
src: item.icon,
|
|
164
|
+
class: "icon"
|
|
165
|
+
}, null, 8, _hoisted_17)
|
|
166
|
+
]),
|
|
167
|
+
createElementVNode("div", _hoisted_18, toDisplayString(item.alias), 1)
|
|
168
|
+
])
|
|
169
|
+
])
|
|
170
|
+
], 8, _hoisted_13)
|
|
171
|
+
]);
|
|
172
|
+
}), 128))
|
|
173
|
+
])
|
|
174
|
+
])
|
|
175
|
+
]),
|
|
176
|
+
default: withCtx(() => [
|
|
177
|
+
slotTest ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : (openBlock(), createElementBlock("button", _hoisted_1, "\u5E94\u7528\u4E2D\u5FC3"))
|
|
178
|
+
]),
|
|
179
|
+
_: 3
|
|
180
|
+
})
|
|
181
|
+
]);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
export { _sfc_main as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Params {
|
|
2
|
+
repo_id?: string;
|
|
3
|
+
app_id?: number;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export declare function getUserRepoActs(BASE_API: string): import("axios").AxiosPromise<any>;
|
|
7
|
+
export declare function getPubApps(BASE_API: string, params: Params): import("axios").AxiosPromise<any>;
|
|
8
|
+
export declare function getResentApp(BASE_API: string, params: Params): import("axios").AxiosPromise<any>;
|
|
9
|
+
export declare function setResentApp(BASE_API: string, params: Params): import("axios").AxiosPromise<any>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import request from "../../utils/request.js";
|
|
2
|
+
function getUserRepoActs(BASE_API) {
|
|
3
|
+
return request(BASE_API, {
|
|
4
|
+
url: `/poplar/v3/ac/account/rules`,
|
|
5
|
+
method: "get"
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
function getPubApps(BASE_API, params) {
|
|
9
|
+
return request(BASE_API, {
|
|
10
|
+
url: "/leaf/v1/market/apps",
|
|
11
|
+
method: "get",
|
|
12
|
+
params
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function getResentApp(BASE_API, params) {
|
|
16
|
+
return request(BASE_API, {
|
|
17
|
+
url: `/poplar/v2/repo/${params.repo_id}/common/apps`,
|
|
18
|
+
method: "get"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function setResentApp(BASE_API, params) {
|
|
22
|
+
return request(BASE_API, {
|
|
23
|
+
url: `/poplar/v2/repo/${params.repo_id}/app/${params.app_id}/access`,
|
|
24
|
+
method: "post"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export { getPubApps, getResentApp, getUserRepoActs, setResentApp };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
alias: string;
|
|
3
|
+
actions: ({
|
|
4
|
+
id: number;
|
|
5
|
+
key: string;
|
|
6
|
+
alias: string;
|
|
7
|
+
brief: string;
|
|
8
|
+
type: number;
|
|
9
|
+
icon: string;
|
|
10
|
+
target_url: string;
|
|
11
|
+
real?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
id: number;
|
|
14
|
+
key: string;
|
|
15
|
+
alias: string;
|
|
16
|
+
brief: string;
|
|
17
|
+
real: string;
|
|
18
|
+
type: number;
|
|
19
|
+
icon: string;
|
|
20
|
+
target_url: string;
|
|
21
|
+
})[];
|
|
22
|
+
}[];
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var appList = [
|
|
2
|
+
{
|
|
3
|
+
alias: "\u8FD0\u8425\u7BA1\u7406",
|
|
4
|
+
actions: [
|
|
5
|
+
{
|
|
6
|
+
id: 13,
|
|
7
|
+
key: "push",
|
|
8
|
+
alias: "\u63A8\u9001\u7BA1\u7406",
|
|
9
|
+
brief: "\u63A8\u9001\u7BA1\u7406",
|
|
10
|
+
type: 3,
|
|
11
|
+
icon: "tuisongguanli",
|
|
12
|
+
target_url: ""
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 14,
|
|
16
|
+
key: "pop",
|
|
17
|
+
alias: "\u63A8\u5E7F\u7BA1\u7406",
|
|
18
|
+
brief: "\u63A8\u5E7F\u7BA1\u7406",
|
|
19
|
+
real: "appcenter/app-promote:entry",
|
|
20
|
+
type: 3,
|
|
21
|
+
icon: "tuiguang",
|
|
22
|
+
target_url: ""
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
alias: "\u4FE1\u606F\u7BA1\u7406",
|
|
28
|
+
actions: [
|
|
29
|
+
{
|
|
30
|
+
id: 18,
|
|
31
|
+
key: "systemNotice",
|
|
32
|
+
alias: "\u7CFB\u7EDF\u516C\u544A",
|
|
33
|
+
brief: "\u7CFB\u7EDF\u516C\u544A",
|
|
34
|
+
real: "appcenter/app-notify:entry",
|
|
35
|
+
type: 3,
|
|
36
|
+
icon: "xitonggonggao",
|
|
37
|
+
target_url: ""
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 19,
|
|
41
|
+
key: "hotsearch",
|
|
42
|
+
alias: "\u70ED\u8BCD\u641C\u7D22",
|
|
43
|
+
brief: "\u70ED\u8BCD\u641C\u7D22",
|
|
44
|
+
real: "appcenter/app-hotword:entry",
|
|
45
|
+
type: 3,
|
|
46
|
+
icon: "recisousuo",
|
|
47
|
+
target_url: ""
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 20,
|
|
51
|
+
key: "usertags",
|
|
52
|
+
alias: "\u7528\u6237\u6807\u7B7E",
|
|
53
|
+
brief: "\u7528\u6237\u6807\u7B7E",
|
|
54
|
+
real: "appcenter/app-userlabel:entry",
|
|
55
|
+
type: 3,
|
|
56
|
+
icon: "yonghubiaoqian",
|
|
57
|
+
target_url: ""
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
alias: "\u8BC4\u8BBA\u7BA1\u7406",
|
|
63
|
+
actions: [
|
|
64
|
+
{
|
|
65
|
+
id: 23,
|
|
66
|
+
key: "commentList",
|
|
67
|
+
alias: "\u8BC4\u8BBA\u5217\u8868",
|
|
68
|
+
brief: "\u8BC4\u8BBA\u5217\u8868",
|
|
69
|
+
real: "appcenter/app-comment:entry",
|
|
70
|
+
type: 3,
|
|
71
|
+
icon: "app_commentList",
|
|
72
|
+
target_url: ""
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 24,
|
|
76
|
+
key: "operatingRecord",
|
|
77
|
+
alias: "\u64CD\u4F5C\u8BB0\u5F55",
|
|
78
|
+
brief: "\u64CD\u4F5C\u8BB0\u5F55",
|
|
79
|
+
real: "appcenter/app-comment:entry",
|
|
80
|
+
type: 3,
|
|
81
|
+
icon: "app_operatingRecord",
|
|
82
|
+
target_url: ""
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
alias: "\u4E3E\u62A5\u7BA1\u7406",
|
|
88
|
+
actions: [
|
|
89
|
+
{
|
|
90
|
+
id: 25,
|
|
91
|
+
key: "warningList",
|
|
92
|
+
alias: "\u4E3E\u62A5\u5217\u8868",
|
|
93
|
+
brief: "\u4E3E\u62A5\u5217\u8868",
|
|
94
|
+
real: "appcenter/app-report:entry",
|
|
95
|
+
type: 3,
|
|
96
|
+
icon: "app_warningList",
|
|
97
|
+
target_url: ""
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 26,
|
|
101
|
+
key: "reportRecord",
|
|
102
|
+
alias: "\u4E3E\u62A5\u64CD\u4F5C\u8BB0\u5F55",
|
|
103
|
+
brief: "\u4E3E\u62A5\u64CD\u4F5C\u8BB0\u5F55",
|
|
104
|
+
real: "appcenter/app-report:entry",
|
|
105
|
+
type: 3,
|
|
106
|
+
icon: "app_reportRecord",
|
|
107
|
+
target_url: ""
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 27,
|
|
111
|
+
key: "feedbackList",
|
|
112
|
+
alias: "\u53CD\u9988\u7BA1\u7406",
|
|
113
|
+
brief: "\u53CD\u9988\u7BA1\u7406",
|
|
114
|
+
real: "appcenter/app-feedback:entry",
|
|
115
|
+
type: 3,
|
|
116
|
+
icon: "app_feedbackList",
|
|
117
|
+
target_url: ""
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
];
|
|
122
|
+
export { appList as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function permissionMap(permissions, item, hideList = []) {
|
|
2
|
+
if (hideList.includes(item.key)) {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
if (item.real === "publice") {
|
|
6
|
+
return true;
|
|
7
|
+
}
|
|
8
|
+
if (typeof item.real === "string") {
|
|
9
|
+
return permissions.includes(item.real);
|
|
10
|
+
}
|
|
11
|
+
if (item.real instanceof Array) {
|
|
12
|
+
const join = permissions.filter(function(v) {
|
|
13
|
+
return item.real.indexOf(v) > -1;
|
|
14
|
+
});
|
|
15
|
+
return join.length > 0;
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
export { permissionMap as default };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { getRID } from "../../utils/auth.js";
|
|
2
|
+
async function routeMap(BASE_API, rid = getRID(), listType, app = null) {
|
|
3
|
+
const origin = BASE_API;
|
|
4
|
+
if (listType === "activityList") {
|
|
5
|
+
window.open(`/poplar/v2/activity?rid=${rid}`, "_blank");
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (listType === "statistics") {
|
|
9
|
+
window.open(`/#/operation/statistics?repoID=${rid}`, "_blank");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (listType === "point") {
|
|
13
|
+
window.open(`/#/operation/point?repoID=${rid}`, "_blank");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (listType === "systemNotice") {
|
|
17
|
+
window.open(`${origin}/foowz/#/systemNotice/${rid}`, "_blank");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (listType === "push") {
|
|
21
|
+
window.open(`${origin}/foowz/#/pushManagement/${rid}`, "_blank");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (listType === "pop") {
|
|
25
|
+
window.open(`${origin}/foowz/#/popManagement/${rid}`, "_blank");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (listType === "hotsearch") {
|
|
29
|
+
window.open(`${origin}/foowz/#/hotsearch/${rid}`, "_blank");
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (listType === "usertags") {
|
|
33
|
+
window.open(`${origin}/foowz/#/newUserSetting/${rid}`, "_blank");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (listType === "commentList") {
|
|
37
|
+
window.open(`${origin}/foowz/#/commentList/${rid}`, "_blank");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (listType === "operatingRecord") {
|
|
41
|
+
window.open(`${origin}/foowz/#/operatingRecord/${rid}`, "_blank");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (listType === "warningList") {
|
|
45
|
+
window.open(`${origin}/foowz/#/warningList/${rid}`, "_blank");
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (listType === "reportRecord") {
|
|
49
|
+
window.open(`${origin}/foowz/#/reportRecord/${rid}`, "_blank");
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (listType === "feedbackList") {
|
|
53
|
+
window.open(`${origin}/foowz/#/feedbackList/${rid}`, "_blank");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (listType === "feedbackRecord") {
|
|
57
|
+
window.open(`${origin}/foowz/#/feedbackRecord/${rid}`, "_blank");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (app && app.type === 2) {
|
|
61
|
+
if (listType === "liveList") {
|
|
62
|
+
window.open(
|
|
63
|
+
`/poplar/v2/microservice/redirect?rid=${rid}&module=live`,
|
|
64
|
+
"_blank"
|
|
65
|
+
);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (listType === "formList") {
|
|
69
|
+
window.open(
|
|
70
|
+
`/poplar/v2/microservice/redirect?rid=${rid}&module=form`,
|
|
71
|
+
"_blank"
|
|
72
|
+
);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (listType === "lotteryList") {
|
|
76
|
+
window.open(
|
|
77
|
+
`/poplar/v2/microservice/redirect?rid=${rid}&module=lottery`,
|
|
78
|
+
"_blank"
|
|
79
|
+
);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (listType === "wzList") {
|
|
83
|
+
window.open(
|
|
84
|
+
`/poplar/v2/microservice/redirect?rid=${rid}&module=wz`,
|
|
85
|
+
"_blank"
|
|
86
|
+
);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (app.setting) {
|
|
90
|
+
window.open(
|
|
91
|
+
`/#/microservice/redirect?rid=${rid}&module=${listType}`,
|
|
92
|
+
"_blank"
|
|
93
|
+
);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
window.open(
|
|
97
|
+
`/poplar/v2/microservice/redirect?rid=${rid}&module=${listType}`,
|
|
98
|
+
"_blank"
|
|
99
|
+
);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (listType === "pop") {
|
|
103
|
+
window.open(`${origin}/#/popManagement/${rid}`, "_blank");
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
console.log(`/media/enterprisepublish/${rid}`);
|
|
107
|
+
window.open(`${origin}/#/media/enterprisepublish/${rid}`, "_blank");
|
|
108
|
+
}
|
|
109
|
+
export { routeMap as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./index.css";
|