vue-layout-gitcode 1.12.53-yunxin-im → 1.12.54-multiple-account
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-BDNhph93.js +202 -0
- package/{MenuItem-Fu7SS3Tz.js → MenuItem-BPWpzVf_.js} +4 -4
- package/{ProjectMenuList-DPscVNRR.js → ProjectMenuList-_Q_qB-mQ.js} +11 -11
- package/{ProjectMenuListV2-nSkrRa6K.js → ProjectMenuListV2-BcWPp3mC.js} +8 -8
- package/ProjectSearch-BR2Zu_zU.js +87 -0
- package/{SearchHistoryList-CpJYD474.js → SearchHistoryList-iGL9LbMG.js} +8 -11
- package/{SearchRecommed-BMi4fhX2.js → SearchRecommed-DPla4Bfu.js} +13 -20
- package/{SearchScopeList-cN4MRz7O.js → SearchScopeList-Cl3Mjaa2.js} +4 -4
- package/{UserSearch-BDv9VoKV.js → UserSearch-BjXMgkLa.js} +16 -19
- package/{index-Ds8UDIgP.js → index-Bv5SHa4l.js} +1 -1
- package/{search-suggestion-CvlmOcjt.js → index-BwIAQssk.js} +140 -191
- package/{index-BVtkY7Om.js → index-DFn-iMIL.js} +1 -1
- package/{index-DdlJC00I.js → index-DYOYbfLQ.js} +8257 -9845
- package/index.d.ts +375 -47
- package/index.js +14 -22
- package/{notice-BCsRECZ7.js → notice-Y6bk2JPj.js} +5 -6
- package/package.json +1 -1
- package/style.css +1 -1
- package/{transWebUrl-BIRrBeEN.js → transWebUrl-yyTGj_5G.js} +3 -3
- package/GloabarSearch-CyqYE-oU.js +0 -127
- package/ProjectSearch-DzbH-bqt.js +0 -121
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { defineComponent, inject, openBlock, createElementBlock, Fragment, createElementVNode, toDisplayString, unref, createVNode, renderList, withDirectives, createBlock, ref, watch, onMounted, createCommentVNode } from "vue";
|
|
2
|
+
import "vue-devui-lal/icon";
|
|
3
|
+
import "vue-devui-lal/icon/style.css";
|
|
4
|
+
import { h as headRequest, R as REPO_MODULE, a as i18n, G as GIcon, v as vElementExposure, b as REPO_EVENT, _ as _export_sfc, c as REPO_TYPE, e as extractRepoInfoWithURL } from "./index-DYOYbfLQ.js";
|
|
5
|
+
import "lodash/debounce";
|
|
6
|
+
import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-BwIAQssk.js";
|
|
7
|
+
import "./transWebUrl-yyTGj_5G.js";
|
|
8
|
+
import "vue-devui-lal/tooltip";
|
|
9
|
+
import "vue-devui-lal/tooltip/style.css";
|
|
10
|
+
import "vue-router";
|
|
11
|
+
import "vue-devui-lal/grid";
|
|
12
|
+
import "vue-devui-lal/skeleton";
|
|
13
|
+
import "vue-devui-lal/grid/style.css";
|
|
14
|
+
import "vue-devui-lal/skeleton/style.css";
|
|
15
|
+
import "vue-devui-lal/popover";
|
|
16
|
+
import "vue-devui-lal/popover/style.css";
|
|
17
|
+
const _hoisted_1$1 = { class: "mb-[4px] mt-[16px] flex justify-between" };
|
|
18
|
+
const _hoisted_2$1 = { class: "title" };
|
|
19
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
20
|
+
__name: "SearchRepoCardList",
|
|
21
|
+
props: {
|
|
22
|
+
dataList: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default: () => []
|
|
25
|
+
},
|
|
26
|
+
searchStr: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
type: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
},
|
|
34
|
+
name: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
emits: ["report"],
|
|
40
|
+
setup(__props, { emit: __emit }) {
|
|
41
|
+
const API = headRequest(inject("request"));
|
|
42
|
+
const { triggerReport } = useReportRepo({ moduleName: REPO_MODULE.SEARCH_SUGGESTION_CARD }, API.viewReport);
|
|
43
|
+
const { t: $t } = i18n.global;
|
|
44
|
+
const useReport = inject("useReport");
|
|
45
|
+
const emits = __emit;
|
|
46
|
+
const handleReport = (item) => {
|
|
47
|
+
useReport(REPO_EVENT.CLICK, { module_name: REPO_MODULE.SEARCH_SUGGESTION_CARD, repo_id: item.id });
|
|
48
|
+
};
|
|
49
|
+
const handleMore = () => {
|
|
50
|
+
emits("more");
|
|
51
|
+
};
|
|
52
|
+
return (_ctx, _cache) => {
|
|
53
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
54
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
55
|
+
createElementVNode("p", _hoisted_2$1, toDisplayString(__props.name), 1),
|
|
56
|
+
createElementVNode("a", {
|
|
57
|
+
class: "more-btn",
|
|
58
|
+
onClick: handleMore
|
|
59
|
+
}, [
|
|
60
|
+
createElementVNode("span", null, toDisplayString(unref($t)("gitCodeLayout.common.more")), 1),
|
|
61
|
+
createVNode(GIcon, {
|
|
62
|
+
name: "gt-line-right",
|
|
63
|
+
color: "var(--theme-placeholder)"
|
|
64
|
+
})
|
|
65
|
+
])
|
|
66
|
+
]),
|
|
67
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.dataList, (item, index) => {
|
|
68
|
+
return withDirectives((openBlock(), createBlock(SearchRepoCard, {
|
|
69
|
+
key: item.id,
|
|
70
|
+
class: "mb-[8px]",
|
|
71
|
+
info: { ...item, index },
|
|
72
|
+
keyword: __props.searchStr,
|
|
73
|
+
hover: "",
|
|
74
|
+
hideTopicTags: "",
|
|
75
|
+
hideStarBtn: "",
|
|
76
|
+
hideFooter: "",
|
|
77
|
+
hideDescription: "",
|
|
78
|
+
onReport: () => handleReport(item),
|
|
79
|
+
cardType: __props.type,
|
|
80
|
+
"url-params": { source_module: "search_project" }
|
|
81
|
+
}, null, 8, ["info", "keyword", "onReport", "cardType"])), [
|
|
82
|
+
[unref(vElementExposure), { trigger: (type) => unref(triggerReport)(type, item) }]
|
|
83
|
+
]);
|
|
84
|
+
}), 128))
|
|
85
|
+
], 64);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const SearchRepoCardList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
90
|
+
const _hoisted_1 = {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: "px-[8px] history-list-project pl-[8px]"
|
|
93
|
+
};
|
|
94
|
+
const _hoisted_2 = {
|
|
95
|
+
key: 1,
|
|
96
|
+
class: "px-[8px] history-list-project pl-[8px]"
|
|
97
|
+
};
|
|
98
|
+
const _hoisted_3 = {
|
|
99
|
+
key: 2,
|
|
100
|
+
class: "px-[8px] history-list-project pl-[8px]"
|
|
101
|
+
};
|
|
102
|
+
const _sfc_main = {
|
|
103
|
+
__name: "GloabarSearch",
|
|
104
|
+
props: ["searchStr"],
|
|
105
|
+
emits: ["searchMore"],
|
|
106
|
+
setup(__props, { emit: __emit }) {
|
|
107
|
+
const emits = __emit;
|
|
108
|
+
const { t: $t } = i18n.global;
|
|
109
|
+
const API = headRequest(inject("request"));
|
|
110
|
+
const useReport = inject("useReport");
|
|
111
|
+
const projectList = ref([]);
|
|
112
|
+
const datasetList = ref([]);
|
|
113
|
+
const modelList = ref([]);
|
|
114
|
+
const origin = window.location.origin;
|
|
115
|
+
const props = __props;
|
|
116
|
+
let timer = null;
|
|
117
|
+
const convertDataList = (dataList) => {
|
|
118
|
+
return dataList == null ? void 0 : dataList.slice(0, 5).map((item) => {
|
|
119
|
+
const isGitcodeRepo = REPO_TYPE.GITCODE === item.is_mirrors;
|
|
120
|
+
const repoName = (!isGitcodeRepo ? extractRepoInfoWithURL(item.import_url) : item.name_with_namespace) || item.name_with_namespace;
|
|
121
|
+
const displayName = formatNameSpace(repoName).join("/");
|
|
122
|
+
return {
|
|
123
|
+
...item,
|
|
124
|
+
path: `${origin}/${item.path_with_namespace}`,
|
|
125
|
+
displayName,
|
|
126
|
+
web_url: `${origin}/${item.path_with_namespace}`
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
const handleMore = (type) => {
|
|
131
|
+
emits("searchMore", type);
|
|
132
|
+
};
|
|
133
|
+
const getData = async () => {
|
|
134
|
+
if (!props.searchStr) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
useReport("search-project", {});
|
|
139
|
+
const res = await API.getGloabarSearchKeyLink({ q: props.searchStr });
|
|
140
|
+
const { recommend_project = [], recommend_model = [], recommend_dataset = [] } = res.data || {};
|
|
141
|
+
projectList.value = convertDataList(recommend_project);
|
|
142
|
+
modelList.value = convertDataList(recommend_model);
|
|
143
|
+
datasetList.value = convertDataList(recommend_dataset);
|
|
144
|
+
} catch (error) {
|
|
145
|
+
console.error("Failed to fetch search results:", error);
|
|
146
|
+
projectList.value = [];
|
|
147
|
+
modelList.value = [];
|
|
148
|
+
datasetList.value = [];
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
if (props.searchStr) {
|
|
152
|
+
getData();
|
|
153
|
+
}
|
|
154
|
+
watch(
|
|
155
|
+
() => props.searchStr,
|
|
156
|
+
() => {
|
|
157
|
+
if (timer) {
|
|
158
|
+
clearTimeout(timer);
|
|
159
|
+
}
|
|
160
|
+
timer = setTimeout(() => {
|
|
161
|
+
getData();
|
|
162
|
+
}, 300);
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
onMounted(() => {
|
|
166
|
+
});
|
|
167
|
+
return (_ctx, _cache) => {
|
|
168
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
169
|
+
projectList.value.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
170
|
+
createVNode(SearchRepoCardList, {
|
|
171
|
+
"data-list": projectList.value,
|
|
172
|
+
"search-str": __props.searchStr,
|
|
173
|
+
name: unref($t)("gitCodeLayout.header.repo"),
|
|
174
|
+
type: "repo",
|
|
175
|
+
onMore: _cache[0] || (_cache[0] = () => handleMore("repo"))
|
|
176
|
+
}, null, 8, ["data-list", "search-str", "name"])
|
|
177
|
+
])) : createCommentVNode("", true),
|
|
178
|
+
modelList.value.length ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
179
|
+
createVNode(SearchRepoCardList, {
|
|
180
|
+
"data-list": modelList.value,
|
|
181
|
+
"search-str": __props.searchStr,
|
|
182
|
+
name: unref($t)("gitCodeLayout.aihub.model"),
|
|
183
|
+
type: "model",
|
|
184
|
+
onMore: _cache[1] || (_cache[1] = () => handleMore("model"))
|
|
185
|
+
}, null, 8, ["data-list", "search-str", "name"])
|
|
186
|
+
])) : createCommentVNode("", true),
|
|
187
|
+
datasetList.value.length ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
188
|
+
createVNode(SearchRepoCardList, {
|
|
189
|
+
"data-list": datasetList.value,
|
|
190
|
+
"search-str": __props.searchStr,
|
|
191
|
+
name: unref($t)("gitCodeLayout.aihub.dataSet"),
|
|
192
|
+
type: "dataset",
|
|
193
|
+
onMore: _cache[2] || (_cache[2] = () => handleMore("dataset"))
|
|
194
|
+
}, null, 8, ["data-list", "search-str", "name"])
|
|
195
|
+
])) : createCommentVNode("", true)
|
|
196
|
+
], 64);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
export {
|
|
201
|
+
_sfc_main as default
|
|
202
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, inject, useSlots, computed, ref, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, createTextVNode, toDisplayString, renderSlot } from "vue";
|
|
2
|
-
import { a as i18n,
|
|
2
|
+
import { a as i18n, y as useLayoutConfig, A as ThemeType, B as currentTheme, L as LANG_ZH, C as LANG_EN, D as getLocaleLang, G as GIcon, F as emitEvent, b as REPO_EVENT, H as ASIDE_MENU_REPO, I as isHttps, J as navigateWithMigrationGuard, _ as _export_sfc } from "./index-DYOYbfLQ.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
4
|
import { Popover } from "vue-devui-lal/popover";
|
|
5
5
|
import "vue-devui-lal/popover/style.css";
|
|
@@ -8,10 +8,10 @@ const _hoisted_2 = {
|
|
|
8
8
|
key: 2,
|
|
9
9
|
class: "menu-item__badge"
|
|
10
10
|
};
|
|
11
|
-
const _hoisted_3 = { class: "
|
|
11
|
+
const _hoisted_3 = { class: "relative" };
|
|
12
12
|
const _hoisted_4 = {
|
|
13
13
|
key: 1,
|
|
14
|
-
class: "token-free-text"
|
|
14
|
+
class: "token-free-text bg-[#DBE2FA] text-[#2951E0] text-[12px] rounded-[4px] px-[4px] py-[2px]"
|
|
15
15
|
};
|
|
16
16
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
17
|
__name: "MenuItem",
|
|
@@ -76,7 +76,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
76
76
|
return nameMap[getLocaleLang()] || props.item.left_menu_name_cn;
|
|
77
77
|
});
|
|
78
78
|
const isShowPopover = computed(() => {
|
|
79
|
-
return
|
|
79
|
+
return props.item.is_show_popup && props.slotKeys.includes(props.item.popup_key) && slots[props.item.popup_key] && asideSetShow.value;
|
|
80
80
|
});
|
|
81
81
|
const handleMouseEnter = () => {
|
|
82
82
|
isHover.value = true;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, reactive, watch, computed, openBlock, createElementBlock, Fragment, createElementVNode, toDisplayString, unref, createVNode, withModifiers, normalizeClass, withCtx, renderList, createBlock, createCommentVNode, createTextVNode, withDirectives, vShow } from "vue";
|
|
2
|
-
import { a as i18n,
|
|
2
|
+
import { a as i18n, y as useLayoutConfig, G as GIcon, t as transformUrl, M as _sfc_main$1, N as loadAsideData, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, K as asideRequest, _ as _export_sfc } from "./index-DYOYbfLQ.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
|
-
import { t as transWebUrl } from "./transWebUrl-
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-yyTGj_5G.js";
|
|
5
5
|
import { Select, Option } from "vue-devui-lal/select";
|
|
6
6
|
import { Input } from "vue-devui-lal/input";
|
|
7
7
|
import { Skeleton } from "vue-devui-lal/skeleton";
|
|
@@ -12,25 +12,25 @@ import "vue-devui-lal/input/style.css";
|
|
|
12
12
|
import "vue-devui-lal/skeleton/style.css";
|
|
13
13
|
import "vue-devui-lal/menu/style.css";
|
|
14
14
|
import "vue-devui-lal/button/style.css";
|
|
15
|
-
const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item
|
|
15
|
+
const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item relative" };
|
|
16
16
|
const _hoisted_2 = {
|
|
17
17
|
class: "devui-submenu-title layer_2",
|
|
18
18
|
style: { "padding": "0px 24px" }
|
|
19
19
|
};
|
|
20
|
-
const _hoisted_3 = { class: "devui-submenu-title-content
|
|
20
|
+
const _hoisted_3 = { class: "devui-submenu-title-content cursor-auto" };
|
|
21
21
|
const _hoisted_4 = {
|
|
22
22
|
class: "devui-submenu-title layer_2",
|
|
23
23
|
style: { "padding": "0px 24px" }
|
|
24
24
|
};
|
|
25
|
-
const _hoisted_5 = { class: "devui-submenu-title-content
|
|
25
|
+
const _hoisted_5 = { class: "devui-submenu-title-content cursor-auto" };
|
|
26
26
|
const _hoisted_6 = {
|
|
27
27
|
class: "devui-submenu-title layer_2",
|
|
28
28
|
style: { "padding": "0px 24px" }
|
|
29
29
|
};
|
|
30
|
-
const _hoisted_7 = { class: "devui-submenu-title-content
|
|
30
|
+
const _hoisted_7 = { class: "devui-submenu-title-content cursor-auto" };
|
|
31
31
|
const _hoisted_8 = { key: 0 };
|
|
32
32
|
const _hoisted_9 = { class: "project-label" };
|
|
33
|
-
const _hoisted_10 = { class: "project-label
|
|
33
|
+
const _hoisted_10 = { class: "project-label flex-1 min-w-0 ellipsis" };
|
|
34
34
|
const _hoisted_11 = {
|
|
35
35
|
key: 1,
|
|
36
36
|
class: "project-label"
|
|
@@ -267,7 +267,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
267
267
|
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => showSearch.value = !showSearch.value, ["stop"]))
|
|
268
268
|
}),
|
|
269
269
|
createElementVNode("div", {
|
|
270
|
-
class: normalizeClass(["
|
|
270
|
+
class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
|
|
271
271
|
onClick: _cache[6] || (_cache[6] = withModifiers(() => {
|
|
272
272
|
}, ["stop"]))
|
|
273
273
|
}, [
|
|
@@ -275,7 +275,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
275
275
|
"menu-class": "my-work-platform-select",
|
|
276
276
|
modelValue: nameSpace.value,
|
|
277
277
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => nameSpace.value = $event),
|
|
278
|
-
class: "
|
|
278
|
+
class: "mb-[8px]",
|
|
279
279
|
placeholder: "",
|
|
280
280
|
filter: true,
|
|
281
281
|
onLoadMore: loadTeam,
|
|
@@ -328,7 +328,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
328
328
|
color: "var(--theme-menu-icon-fill)"
|
|
329
329
|
}),
|
|
330
330
|
createElementVNode("div", {
|
|
331
|
-
class: normalizeClass(["
|
|
331
|
+
class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
|
|
332
332
|
onClick: _cache[11] || (_cache[11] = withModifiers(() => {
|
|
333
333
|
}, ["stop"]))
|
|
334
334
|
}, [
|
|
@@ -367,7 +367,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
367
367
|
color: "var(--theme-menu-icon-fill)"
|
|
368
368
|
}),
|
|
369
369
|
createElementVNode("div", {
|
|
370
|
-
class: normalizeClass(["
|
|
370
|
+
class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
|
|
371
371
|
onClick: _cache[16] || (_cache[16] = withModifiers(() => {
|
|
372
372
|
}, ["stop"]))
|
|
373
373
|
}, [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, reactive, computed, watch, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, createVNode, withModifiers, normalizeClass, withCtx, createBlock, createCommentVNode, Fragment, renderList, createTextVNode, withDirectives, vShow } from "vue";
|
|
2
|
-
import { a as i18n,
|
|
2
|
+
import { a as i18n, y as useLayoutConfig, t as transformUrl, G as GIcon, K as asideRequest, J as navigateWithMigrationGuard, F as emitEvent, s as setLoginTriggerSource, f as useRequestReport, _ as _export_sfc } from "./index-DYOYbfLQ.js";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
|
-
import { t as transWebUrl } from "./transWebUrl-
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-yyTGj_5G.js";
|
|
5
5
|
import { Input } from "vue-devui-lal/input";
|
|
6
6
|
import { Skeleton } from "vue-devui-lal/skeleton";
|
|
7
7
|
import { MenuItem } from "vue-devui-lal/menu";
|
|
@@ -10,14 +10,14 @@ import "vue-devui-lal/input/style.css";
|
|
|
10
10
|
import "vue-devui-lal/skeleton/style.css";
|
|
11
11
|
import "vue-devui-lal/menu/style.css";
|
|
12
12
|
import "vue-devui-lal/button/style.css";
|
|
13
|
-
const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item
|
|
13
|
+
const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item relative" };
|
|
14
14
|
const _hoisted_2 = {
|
|
15
15
|
class: "devui-submenu-title layer_2",
|
|
16
16
|
style: { "padding": "0px 24px" }
|
|
17
17
|
};
|
|
18
|
-
const _hoisted_3 = { class: "devui-submenu-title-content
|
|
18
|
+
const _hoisted_3 = { class: "devui-submenu-title-content cursor-auto" };
|
|
19
19
|
const _hoisted_4 = { class: "project-label" };
|
|
20
|
-
const _hoisted_5 = { class: "project-label
|
|
20
|
+
const _hoisted_5 = { class: "project-label flex-1 min-w-0 ellipsis" };
|
|
21
21
|
const _hoisted_6 = ["href"];
|
|
22
22
|
const INIT_SHOW_COUNT = 4;
|
|
23
23
|
const LOAD_MORE_COUNT = 10;
|
|
@@ -26,7 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
26
26
|
props: {
|
|
27
27
|
buttonText: { default: "" },
|
|
28
28
|
subShow: { type: Boolean, default: false },
|
|
29
|
-
defaultData: {
|
|
29
|
+
defaultData: {},
|
|
30
30
|
isLogin: { type: Boolean, default: false },
|
|
31
31
|
username: { default: "" }
|
|
32
32
|
},
|
|
@@ -165,7 +165,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
165
165
|
onClick: withModifiers(handleOpenSearch, ["stop"])
|
|
166
166
|
}),
|
|
167
167
|
createElementVNode("div", {
|
|
168
|
-
class: normalizeClass(["
|
|
168
|
+
class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
|
|
169
169
|
onClick: _cache[4] || (_cache[4] = withModifiers(() => {
|
|
170
170
|
}, ["stop"]))
|
|
171
171
|
}, [
|
|
@@ -241,7 +241,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
241
241
|
showTianqiRepo.value ? (openBlock(), createElementBlock("a", {
|
|
242
242
|
key: 2,
|
|
243
243
|
href: tianqiRepoUrl.value,
|
|
244
|
-
class: "
|
|
244
|
+
class: "flex-1 min-w-0 cursor-pointer more-btn"
|
|
245
245
|
}, toDisplayString(unref(t)("gitCodeLayout.org.tianqiRepo")) + " >", 9, _hoisted_6)) : createCommentVNode("", true)
|
|
246
246
|
]);
|
|
247
247
|
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ref, inject, computed, withDirectives, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, createVNode, vShow } from "vue";
|
|
2
|
+
import { a as i18n, h as headRequest, G as GIcon, r as reqCatch } from "./index-DYOYbfLQ.js";
|
|
3
|
+
import { useRoute, useRouter } from "vue-router";
|
|
4
|
+
import "vue-devui-lal/icon";
|
|
5
|
+
import "vue-devui-lal/icon/style.css";
|
|
6
|
+
const _hoisted_1 = { class: "px-[8px] history-list-project pl-[8px]" };
|
|
7
|
+
const _hoisted_2 = { class: "history-list-project-globartitle mb-[4px] mt-[16px]" };
|
|
8
|
+
const _hoisted_3 = ["href"];
|
|
9
|
+
const _hoisted_4 = { class: "flex history-list-project-globarbox" };
|
|
10
|
+
const _hoisted_5 = { class: "ml-[8px] ellipsis" };
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ Object.assign({ name: "SearchFileList" }, {
|
|
12
|
+
__name: "ProjectSearch",
|
|
13
|
+
props: ["searchStr", "searchInfo", "isSearchPage"],
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const { t: $t } = i18n.global;
|
|
16
|
+
const props = __props;
|
|
17
|
+
const filedList = ref([]);
|
|
18
|
+
const route = useRoute();
|
|
19
|
+
const router = useRouter();
|
|
20
|
+
const API = headRequest(inject("request"));
|
|
21
|
+
const loadFileList = async () => {
|
|
22
|
+
var _a, _b, _c;
|
|
23
|
+
if (!((_a = props == null ? void 0 : props.searchInfo) == null ? void 0 : _a.searchScopeName)) return;
|
|
24
|
+
const params = {
|
|
25
|
+
repoId: encodeURIComponent(props.searchInfo.searchScopeName),
|
|
26
|
+
ref_name: ((_b = props.searchInfo) == null ? void 0 : _b.branch) || ""
|
|
27
|
+
};
|
|
28
|
+
const res = await reqCatch(API.getRepoFileList, params);
|
|
29
|
+
filedList.value = ((_c = res == null ? void 0 : res.data) == null ? void 0 : _c.data) || [];
|
|
30
|
+
};
|
|
31
|
+
loadFileList();
|
|
32
|
+
const searchFileList = computed(() => {
|
|
33
|
+
return filedList.value.filter((item) => {
|
|
34
|
+
var _a;
|
|
35
|
+
return (_a = item == null ? void 0 : item.toLowerCase()) == null ? void 0 : _a.includes(props.searchStr);
|
|
36
|
+
}).splice(0, 5);
|
|
37
|
+
});
|
|
38
|
+
const getRoutePath = (filePath) => {
|
|
39
|
+
let params = {};
|
|
40
|
+
if (props.isSearchPage) {
|
|
41
|
+
const [namespace, repoName] = decodeURIComponent(props.searchInfo.repo).split("/");
|
|
42
|
+
params.namespace = namespace;
|
|
43
|
+
params.repoName = repoName;
|
|
44
|
+
} else {
|
|
45
|
+
params = route == null ? void 0 : route.params;
|
|
46
|
+
}
|
|
47
|
+
const defaultBranch = props.searchInfo.branch;
|
|
48
|
+
const branchName = Array.isArray(defaultBranch) ? defaultBranch : defaultBranch == null ? void 0 : defaultBranch.split("/");
|
|
49
|
+
const routerPath = router.resolve({
|
|
50
|
+
name: "repoFile",
|
|
51
|
+
params: {
|
|
52
|
+
...params,
|
|
53
|
+
branchName,
|
|
54
|
+
filePath: filePath.split("/")
|
|
55
|
+
},
|
|
56
|
+
query: {
|
|
57
|
+
init: "initTree"
|
|
58
|
+
}
|
|
59
|
+
}).href;
|
|
60
|
+
return routerPath;
|
|
61
|
+
};
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
|
|
64
|
+
createElementVNode("p", _hoisted_2, toDisplayString(unref($t)("gitCodeLayout.header.file")), 1),
|
|
65
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(searchFileList.value, (item, index) => {
|
|
66
|
+
return openBlock(), createElementBlock("a", {
|
|
67
|
+
key: index,
|
|
68
|
+
href: getRoutePath(item)
|
|
69
|
+
}, [
|
|
70
|
+
createElementVNode("p", _hoisted_4, [
|
|
71
|
+
createVNode(GIcon, {
|
|
72
|
+
name: "gt-file-c",
|
|
73
|
+
style: { "flex-shrink": "0" }
|
|
74
|
+
}),
|
|
75
|
+
createElementVNode("span", _hoisted_5, toDisplayString(item), 1)
|
|
76
|
+
])
|
|
77
|
+
], 8, _hoisted_3);
|
|
78
|
+
}), 128))
|
|
79
|
+
], 512)), [
|
|
80
|
+
[vShow, searchFileList.value.length]
|
|
81
|
+
]);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
_sfc_main as default
|
|
87
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, createVNode, toDisplayString, withModifiers, createCommentVNode } from "vue";
|
|
2
|
-
import { a as i18n,
|
|
2
|
+
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-DYOYbfLQ.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = { class: "history-list" };
|
|
@@ -42,11 +42,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
icon: "gt-plane-project",
|
|
43
43
|
hoverIcon: "gt-plane-project-red"
|
|
44
44
|
},
|
|
45
|
-
all: {
|
|
46
|
-
text: t("gitCodeLayout.common.all"),
|
|
47
|
-
icon: "gt-plane-column1",
|
|
48
|
-
hoverIcon: "gt-plane-column-red"
|
|
49
|
-
},
|
|
50
45
|
model: {
|
|
51
46
|
text: t("gitCodeLayout.aihub.model"),
|
|
52
47
|
icon: "gt-plane-Models",
|
|
@@ -88,12 +83,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
88
83
|
hoverIcon: "gt-plane-topic-red"
|
|
89
84
|
}
|
|
90
85
|
};
|
|
91
|
-
|
|
92
|
-
return typeMap[type] || typeMap["repo"];
|
|
86
|
+
return typeMap[item.type] || typeMap["repo"];
|
|
93
87
|
};
|
|
94
88
|
const historyList = computed(() => {
|
|
95
89
|
var _a;
|
|
96
|
-
return (_a = props.searchHistoryList) == null ? void 0 : _a.map((raw) =>
|
|
90
|
+
return (_a = props.searchHistoryList) == null ? void 0 : _a.map((raw) => typeof raw === "string" ? { q: raw } : raw).filter((item) => item == null ? void 0 : item.q).map((item) => {
|
|
97
91
|
const repoTitle = item.repo ? `${t("gitCodeLayout.header.repo")} ${decodeURIComponent(item.repo)}:` : "";
|
|
98
92
|
const userVal = item.user || (item.scope === "user" ? item.namespace : "");
|
|
99
93
|
const orgVal = item.org || (item.scope === "user" ? "" : item.namespace);
|
|
@@ -106,6 +100,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
106
100
|
return { ...item, repoTitle, namespaceTitle };
|
|
107
101
|
});
|
|
108
102
|
});
|
|
103
|
+
computed(() => {
|
|
104
|
+
return props.visitHistoryList;
|
|
105
|
+
});
|
|
109
106
|
const resetIndex = () => {
|
|
110
107
|
emits("resetIndex");
|
|
111
108
|
};
|
|
@@ -122,12 +119,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
122
119
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
123
120
|
__props.searchHistoryList.length ? (openBlock(), createElementBlock("ul", {
|
|
124
121
|
key: 0,
|
|
125
|
-
class: "history-list-box
|
|
122
|
+
class: "history-list-box mt-[16px]",
|
|
126
123
|
onMouseleave: resetIndex
|
|
127
124
|
}, [
|
|
128
125
|
(openBlock(true), createElementBlock(Fragment, null, renderList(historyList.value, (item, index) => {
|
|
129
126
|
return openBlock(), createElementBlock("li", {
|
|
130
|
-
key:
|
|
127
|
+
key: item,
|
|
131
128
|
class: normalizeClass(__props.activeIndex === index ? "hoverbg" : ""),
|
|
132
129
|
onClick: ($event) => toSearch(item),
|
|
133
130
|
onMouseenter: ($event) => onSearchEnter(index)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, onMounted, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, Fragment, renderList, renderSlot, createBlock, createVNode, withCtx } from "vue";
|
|
2
|
-
import { u as useReportRepo, S as SearchRepoCard
|
|
3
|
-
import { a as i18n, h as headRequest,
|
|
2
|
+
import { u as useReportRepo, S as SearchRepoCard } from "./index-BwIAQssk.js";
|
|
3
|
+
import { a as i18n, h as headRequest, R as REPO_MODULE, b as REPO_EVENT, l as localStorage, _ as _export_sfc } from "./index-DYOYbfLQ.js";
|
|
4
4
|
import { Row, Col } from "vue-devui-lal/grid";
|
|
5
5
|
import { SkeletonItem } from "vue-devui-lal/skeleton";
|
|
6
6
|
import "vue-devui-lal/grid/style.css";
|
|
@@ -14,11 +14,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
14
14
|
setup(__props) {
|
|
15
15
|
const { t: $t } = i18n.global;
|
|
16
16
|
const API = headRequest(inject("request"));
|
|
17
|
-
const layoutConfig = useLayoutConfig();
|
|
18
17
|
const useReport = inject("useReport");
|
|
19
18
|
const { triggerReport } = useReportRepo({ moduleName: REPO_MODULE.SEARCH_RECOMMEND_CARD }, API.viewReport);
|
|
20
19
|
const recommendRepoList = ref([]);
|
|
21
|
-
const getCardType = (repoType) => repoType ? String(repoType) : "repo";
|
|
22
20
|
const handleReport = (repo, index, evt) => {
|
|
23
21
|
const params = evt === "starReport" ? {
|
|
24
22
|
module_name: REPO_MODULE.SEARCH_RECOMMEND_CARD,
|
|
@@ -40,14 +38,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
40
38
|
}
|
|
41
39
|
const params = { history: JSON.stringify(localSearchText) };
|
|
42
40
|
const res = await API.openSourceProject(params);
|
|
43
|
-
const data = (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.content) || []).map((item) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
...isProject && item.web_url ? { web_url: normalizeProjectUrlForMainSite(item.web_url, layoutConfig.VITE_HOST, window.location.origin) } : {},
|
|
48
|
-
tags: item.tags || item.topic_names
|
|
49
|
-
};
|
|
50
|
-
});
|
|
41
|
+
const data = (((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.content) || []).map((item) => ({
|
|
42
|
+
...item,
|
|
43
|
+
tags: item.tags || item.topic_names
|
|
44
|
+
}));
|
|
51
45
|
data.forEach((item, index) => {
|
|
52
46
|
triggerReport("expo", { ...item, index });
|
|
53
47
|
});
|
|
@@ -68,22 +62,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
68
62
|
}, () => [
|
|
69
63
|
(openBlock(), createBlock(SearchRepoCard, {
|
|
70
64
|
key: item.id,
|
|
71
|
-
class: "
|
|
65
|
+
class: "mb-[8px]",
|
|
72
66
|
info: { ...item, index },
|
|
73
67
|
keyword: "",
|
|
74
68
|
hover: "",
|
|
75
69
|
hideTopicTags: "",
|
|
76
70
|
onReport: (evt) => handleReport(item, index, evt),
|
|
77
|
-
cardType:
|
|
78
|
-
"url-params": { source_module: "search_box_discovery" }
|
|
79
|
-
|
|
80
|
-
}, null, 8, ["info", "onReport", "cardType", "preserve-url-origin"]))
|
|
71
|
+
cardType: (item == null ? void 0 : item.repo_type) || "repo",
|
|
72
|
+
"url-params": { source_module: "search_box_discovery" }
|
|
73
|
+
}, null, 8, ["info", "onReport", "cardType"]))
|
|
81
74
|
], true, item.id);
|
|
82
75
|
}), 128))
|
|
83
76
|
])) : (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
84
77
|
(openBlock(), createElementBlock(Fragment, null, renderList(5, (item) => {
|
|
85
78
|
return createElementVNode("div", {
|
|
86
|
-
class: "
|
|
79
|
+
class: "pt-[8px] pb-[16px]",
|
|
87
80
|
key: item
|
|
88
81
|
}, [
|
|
89
82
|
createVNode(unref(Row), {
|
|
@@ -107,7 +100,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
107
100
|
_: 1
|
|
108
101
|
}),
|
|
109
102
|
createVNode(unref(Row), {
|
|
110
|
-
class: "
|
|
103
|
+
class: "mt-[12px]",
|
|
111
104
|
align: "middle",
|
|
112
105
|
gutter: 16
|
|
113
106
|
}, {
|
|
@@ -122,7 +115,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
122
115
|
_: 1
|
|
123
116
|
}),
|
|
124
117
|
createVNode(unref(Row), {
|
|
125
|
-
class: "
|
|
118
|
+
class: "mt-[12px]",
|
|
126
119
|
align: "middle",
|
|
127
120
|
gutter: 16
|
|
128
121
|
}, {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent, openBlock, createElementBlock, Fragment, renderList, createElementVNode, createVNode, toDisplayString, createCommentVNode, unref } from "vue";
|
|
2
|
-
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-
|
|
2
|
+
import { a as i18n, G as GIcon, _ as _export_sfc } from "./index-DYOYbfLQ.js";
|
|
3
3
|
import "vue-devui-lal/icon";
|
|
4
4
|
import "vue-devui-lal/icon/style.css";
|
|
5
5
|
const _hoisted_1 = ["onClick"];
|
|
6
|
-
const _hoisted_2 = { class: "linkItem" };
|
|
6
|
+
const _hoisted_2 = { class: "flex linkItem pl-[9px] pr-[19px]" };
|
|
7
7
|
const _hoisted_3 = { class: "leftTx ellipsis" };
|
|
8
8
|
const _hoisted_4 = {
|
|
9
9
|
key: 0,
|
|
10
|
-
class: "
|
|
10
|
+
class: "ml-[4px]"
|
|
11
11
|
};
|
|
12
12
|
const _hoisted_5 = { key: 1 };
|
|
13
13
|
const _hoisted_6 = { class: "right-text" };
|
|
@@ -28,7 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
28
28
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.searchScopeList, (item, index) => {
|
|
29
29
|
return openBlock(), createElementBlock("li", {
|
|
30
30
|
key: index,
|
|
31
|
-
class: "g-header-search-scopechoose",
|
|
31
|
+
class: "g-header-search-scopechoose pt-[16px] px-[8px]",
|
|
32
32
|
onClick: ($event) => onScopeSearch(item)
|
|
33
33
|
}, [
|
|
34
34
|
createElementVNode("div", _hoisted_2, [
|