vue-layout-gitcode 1.5.40 → 1.5.41
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/{GloabarSearch-D__e3zw1.js → GloabarSearch-B3WaMuKu.js} +3 -2
- package/MenuItem-sYOAucPZ.js +156 -0
- package/ProjectMenuList-CzFBTOgQ.js +389 -0
- package/ProjectMenuListV2-jgMBlbf8.js +209 -0
- package/{ProjectSearch-Dk7fNm1o.js → ProjectSearch-uKBHewSu.js} +1 -1
- package/{SearchHistoryList-CMwsyUtO.js → SearchHistoryList-OoymGUmE.js} +80 -18
- package/{SearchPrefixTag-C__8boi7.js → SearchPrefixTag-CbAlojt8.js} +1 -1
- package/{SearchRecommed-CC4IKY86.js → SearchRecommed-CsB3ABLV.js} +4 -4
- package/{SearchScopeList-CchityQU.js → SearchScopeList-hV2eEbg3.js} +1 -1
- package/{UserSearch-BQPcYFsF.js → UserSearch-BeOxRcVD.js} +1 -1
- package/{index-B811122P.js → index-B0UuQjML.js} +898 -1997
- package/{index-C63Fujt-.js → index-Bwvj8boi.js} +1 -1
- package/{index-CRLLxvwN.js → index-CJ6wg13B.js} +2 -1
- package/index.js +10 -10
- package/{notice-CJ_zldUJ.js → notice-BuO9POoD.js} +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/transWebUrl-C4ZsGLzN.js +21 -0
- package/MenuItem-DnSLaxJH.js +0 -118
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { q as useLayoutConfig } from "./index-B0UuQjML.js";
|
|
2
|
+
const layoutConfig = useLayoutConfig();
|
|
3
|
+
const transWebUrl = (url, params) => {
|
|
4
|
+
if (!url) return url;
|
|
5
|
+
let processedUrl = url;
|
|
6
|
+
if (layoutConfig.VITE_ENV !== "production") {
|
|
7
|
+
const regex = /^(?:https?:\/\/)?(?:www\.)?([^\/]+)(\/.*)$/;
|
|
8
|
+
const match = url.match(regex);
|
|
9
|
+
processedUrl = match ? match[2] : url || "/";
|
|
10
|
+
}
|
|
11
|
+
if (!params) return processedUrl;
|
|
12
|
+
const separator = processedUrl.includes("?") ? "&" : "?";
|
|
13
|
+
if (typeof params === "string") {
|
|
14
|
+
return `${processedUrl}${separator}${params}`;
|
|
15
|
+
}
|
|
16
|
+
const queryString = Object.entries(params).filter(([_, value]) => value !== void 0 && value !== null).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`).join("&");
|
|
17
|
+
return queryString ? `${processedUrl}${separator}${queryString}` : processedUrl;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
transWebUrl as t
|
|
21
|
+
};
|
package/MenuItem-DnSLaxJH.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, computed, createElementBlock, openBlock, normalizeClass, createBlock, createElementVNode, toDisplayString } from "vue";
|
|
2
|
-
import { x as currentTheme, y as ThemeType, g as LANG_ZH, z as LANG_EN, A as getLocaleLang, G as GIcon, B as isHttps, C as emitEvent, b as REPO_EVENT, _ as _export_sfc } from "./index-B811122P.js";
|
|
3
|
-
import { useRouter } from "vue-router";
|
|
4
|
-
const _hoisted_1 = ["src"];
|
|
5
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
-
__name: "MenuItem",
|
|
7
|
-
props: {
|
|
8
|
-
item: {
|
|
9
|
-
type: Object,
|
|
10
|
-
default: () => {
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
active: {
|
|
14
|
-
type: Boolean,
|
|
15
|
-
default: false
|
|
16
|
-
},
|
|
17
|
-
isLogin: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
default: false
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
setup(__props) {
|
|
23
|
-
const useReport = inject("useReport");
|
|
24
|
-
const router = useRouter();
|
|
25
|
-
const props = __props;
|
|
26
|
-
const isHover = ref(false);
|
|
27
|
-
const isSelected = computed(() => {
|
|
28
|
-
return props.active || isHover.value;
|
|
29
|
-
});
|
|
30
|
-
const currentImg = computed(() => {
|
|
31
|
-
console.log("currentTheme", currentTheme.value, "left_menu_logo_black", props.item.left_menu_logo_black);
|
|
32
|
-
const imgMap = {
|
|
33
|
-
[ThemeType.WHITE]: {
|
|
34
|
-
selected: props.item.left_menu_logo_hover,
|
|
35
|
-
unselected: props.item.left_menu_logo
|
|
36
|
-
},
|
|
37
|
-
[ThemeType.BLACK]: {
|
|
38
|
-
selected: props.item.left_menu_logo_hover_black,
|
|
39
|
-
unselected: props.item.left_menu_logo_black
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
if (isSelected.value) {
|
|
43
|
-
return imgMap[currentTheme.value].selected;
|
|
44
|
-
} else {
|
|
45
|
-
return imgMap[currentTheme.value].unselected;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
console.log("currentImg", currentImg.value);
|
|
49
|
-
const currentName = computed(() => {
|
|
50
|
-
const nameMap = {
|
|
51
|
-
[LANG_EN]: props.item.left_menu_name_en,
|
|
52
|
-
[LANG_ZH]: props.item.left_menu_name_cn
|
|
53
|
-
};
|
|
54
|
-
return nameMap[getLocaleLang()] || props.item.left_menu_name_cn;
|
|
55
|
-
});
|
|
56
|
-
const handleMouseEnter = () => {
|
|
57
|
-
isHover.value = true;
|
|
58
|
-
};
|
|
59
|
-
const handleMouseLeave = () => {
|
|
60
|
-
isHover.value = false;
|
|
61
|
-
};
|
|
62
|
-
const clickMenuReport = () => {
|
|
63
|
-
if (!useReport) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const reportName = props.item.left_menu_name_cn;
|
|
67
|
-
if (reportName) {
|
|
68
|
-
useReport(REPO_EVENT.CLICK, { module_name: `侧边栏_${reportName}` });
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const handleMenuClick = () => {
|
|
72
|
-
const currentHref = window.location.href;
|
|
73
|
-
if (props.item.left_menu_url === currentHref) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (props.item.is_open_new_tab) {
|
|
77
|
-
window.open(props.item.left_menu_url, "_blank");
|
|
78
|
-
} else if (isHttps(props.item.left_menu_url)) {
|
|
79
|
-
window.location.href = props.item.left_menu_url;
|
|
80
|
-
} else {
|
|
81
|
-
if (props.item.left_menu_url != "/" && !props.isLogin) {
|
|
82
|
-
emitEvent("login", { loginTriggerSource: `aside_${props.item.left_menu_url}` });
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
router.push({
|
|
86
|
-
path: props.item.left_menu_url
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
clickMenuReport();
|
|
90
|
-
};
|
|
91
|
-
return (_ctx, _cache) => {
|
|
92
|
-
return openBlock(), createElementBlock("div", {
|
|
93
|
-
class: normalizeClass(["menu-item", { "menu-item__selected": isSelected.value }]),
|
|
94
|
-
onMouseenter: handleMouseEnter,
|
|
95
|
-
onMouseleave: handleMouseLeave,
|
|
96
|
-
onClick: handleMenuClick
|
|
97
|
-
}, [
|
|
98
|
-
props.item.isIcon ? (openBlock(), createBlock(GIcon, {
|
|
99
|
-
key: 0,
|
|
100
|
-
name: currentImg.value,
|
|
101
|
-
class: "default-icon",
|
|
102
|
-
size: "16",
|
|
103
|
-
color: "var(--theme-menu-icon-fill)"
|
|
104
|
-
}, null, 8, ["name"])) : (openBlock(), createElementBlock("img", {
|
|
105
|
-
key: 1,
|
|
106
|
-
class: "menu-item__icon",
|
|
107
|
-
src: currentImg.value,
|
|
108
|
-
alt: ""
|
|
109
|
-
}, null, 8, _hoisted_1)),
|
|
110
|
-
createElementVNode("span", null, toDisplayString(currentName.value), 1)
|
|
111
|
-
], 34);
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
const MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-gitcode-layout-lib"]]);
|
|
116
|
-
export {
|
|
117
|
-
MenuItem as default
|
|
118
|
-
};
|