vue-layout-gitcode 1.5.71 → 1.5.72
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-BVc018QM.js → GloabarSearch-BGHVFOpy.js} +5 -3
- package/MenuItem-DgySN0tc.js +156 -0
- package/ProjectMenuList-poL8mpQl.js +402 -0
- package/ProjectMenuListV2-CoEGuG7M.js +221 -0
- package/{ProjectSearch-OYQR1jQ1.js → ProjectSearch-DVREBWeh.js} +1 -1
- package/SearchHistoryList-WPti_fKV.js +161 -0
- package/{SearchPrefixTag-BFhDidRA.js → SearchPrefixTag-C8vz2Bsp.js} +2 -2
- package/{SearchRecommed-c-THl16l.js → SearchRecommed-DJnpxtaq.js} +5 -5
- package/{SearchScopeList-BypAkGfx.js → SearchScopeList-B8t89QHm.js} +2 -2
- package/{UserSearch-Dtgpli89.js → UserSearch-BQwvWAYp.js} +1 -1
- package/{index-Ba99LRw5.js → index-B66_WJIL.js} +2028 -3509
- package/{index-Cqo1SLWx.js → index-CN1Ye7W1.js} +11 -9
- package/{index-B5WuOGOg.js → index-CNRcityj.js} +2 -2
- package/index.d.ts +45 -4
- package/index.js +11 -11
- package/{notice-BUVKdd9a.js → notice-BqfzMtaO.js} +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/transWebUrl-CdGkJDeO.js +21 -0
- package/SearchHistoryList-DcJLzYiO.js +0 -99
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { defineComponent, inject, createElementBlock, openBlock, Fragment, createElementVNode, toDisplayString, createVNode, unref, renderList, withDirectives, createBlock, ref, watch, onMounted, createCommentVNode } from "vue";
|
|
2
2
|
import "vue-devui-lal/icon";
|
|
3
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-
|
|
5
|
-
import
|
|
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-B66_WJIL.js";
|
|
5
|
+
import "lodash/debounce";
|
|
6
|
+
import { u as useReportRepo, S as SearchRepoCard, f as formatNameSpace } from "./index-CN1Ye7W1.js";
|
|
7
|
+
import "./transWebUrl-CdGkJDeO.js";
|
|
6
8
|
import "vue-devui-lal/tooltip";
|
|
7
9
|
import "vue-devui-lal/tooltip/style.css";
|
|
8
10
|
import "vue-router";
|
|
@@ -85,7 +87,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
85
87
|
};
|
|
86
88
|
}
|
|
87
89
|
});
|
|
88
|
-
const SearchRepoCardList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
90
|
+
const SearchRepoCardList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
89
91
|
const _hoisted_1 = {
|
|
90
92
|
key: 0,
|
|
91
93
|
class: "px-[8px] history-list-project pl-[8px]"
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { defineComponent, inject, useSlots, ref, computed, createBlock, openBlock, unref, withCtx, createElementVNode, normalizeClass, createElementBlock, createTextVNode, createCommentVNode, toDisplayString, renderSlot } from "vue";
|
|
2
|
+
import { q as useLayoutConfig, w as ThemeType, x as currentTheme, g as LANG_ZH, y as LANG_EN, z as getLocaleLang, G as GIcon, A as emitEvent, B as isHttps, b as REPO_EVENT, _ as _export_sfc } from "./index-B66_WJIL.js";
|
|
3
|
+
import { useRouter } from "vue-router";
|
|
4
|
+
import { Popover } from "vue-devui-lal/popover";
|
|
5
|
+
import "vue-devui-lal/popover/style.css";
|
|
6
|
+
const _hoisted_1 = ["src"];
|
|
7
|
+
const _hoisted_2 = { class: "relative" };
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "MenuItem",
|
|
10
|
+
props: {
|
|
11
|
+
item: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: () => {
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
active: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
isLogin: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
slotKeys: {
|
|
25
|
+
type: Array,
|
|
26
|
+
default: () => []
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const layoutConfig = useLayoutConfig();
|
|
31
|
+
const asideSetShow = inject("asideSetShow");
|
|
32
|
+
const slots = useSlots();
|
|
33
|
+
const useReport = inject("useReport");
|
|
34
|
+
const independence = inject("independence");
|
|
35
|
+
const router = useRouter();
|
|
36
|
+
const props = __props;
|
|
37
|
+
const isHover = ref(false);
|
|
38
|
+
const isSelected = computed(() => {
|
|
39
|
+
return props.active || isHover.value;
|
|
40
|
+
});
|
|
41
|
+
const currentImg = computed(() => {
|
|
42
|
+
const imgMap = {
|
|
43
|
+
[ThemeType.WHITE]: {
|
|
44
|
+
selected: props.item.left_menu_logo_hover,
|
|
45
|
+
unselected: props.item.left_menu_logo
|
|
46
|
+
},
|
|
47
|
+
[ThemeType.BLACK]: {
|
|
48
|
+
selected: props.item.left_menu_logo_hover_black,
|
|
49
|
+
unselected: props.item.left_menu_logo_black
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
if (isSelected.value) {
|
|
53
|
+
return imgMap[currentTheme.value].selected;
|
|
54
|
+
} else {
|
|
55
|
+
return imgMap[currentTheme.value].unselected;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const currentName = computed(() => {
|
|
59
|
+
const nameMap = {
|
|
60
|
+
[LANG_EN]: props.item.left_menu_name_en,
|
|
61
|
+
[LANG_ZH]: props.item.left_menu_name_cn
|
|
62
|
+
};
|
|
63
|
+
return nameMap[getLocaleLang()] || props.item.left_menu_name_cn;
|
|
64
|
+
});
|
|
65
|
+
const isShowPopover = computed(() => {
|
|
66
|
+
return props.item.is_show_popup && props.slotKeys.includes(props.item.popup_key) && slots[props.item.popup_key] && asideSetShow.value;
|
|
67
|
+
});
|
|
68
|
+
const handleMouseEnter = () => {
|
|
69
|
+
isHover.value = true;
|
|
70
|
+
};
|
|
71
|
+
const handleMouseLeave = () => {
|
|
72
|
+
isHover.value = false;
|
|
73
|
+
};
|
|
74
|
+
const clickMenuReport = () => {
|
|
75
|
+
if (!useReport) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const reportName = props.item.left_menu_name_cn;
|
|
79
|
+
if (reportName) {
|
|
80
|
+
useReport(REPO_EVENT.CLICK, { module_name: `侧边栏_${reportName}` });
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const handleMenuClick = () => {
|
|
84
|
+
const currentHref = window.location.href;
|
|
85
|
+
if (props.item.left_menu_url === currentHref) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (props.item.is_need_login && !props.isLogin) {
|
|
89
|
+
emitEvent("login", { loginTriggerSource: `aside_${props.item.left_menu_url}` });
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (props.item.is_open_new_tab) {
|
|
93
|
+
window.open(props.item.left_menu_url, "_blank");
|
|
94
|
+
} else if (isHttps(props.item.left_menu_url)) {
|
|
95
|
+
window.open(props.item.left_menu_url, "_self");
|
|
96
|
+
} else {
|
|
97
|
+
if (independence) {
|
|
98
|
+
window.open(layoutConfig.VITE_HOST + props.item.left_menu_url, "_self");
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
router.push({
|
|
102
|
+
path: props.item.left_menu_url
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
clickMenuReport();
|
|
106
|
+
};
|
|
107
|
+
return (_ctx, _cache) => {
|
|
108
|
+
return openBlock(), createBlock(unref(Popover), {
|
|
109
|
+
class: "menu-item-popover",
|
|
110
|
+
trigger: "hover",
|
|
111
|
+
position: ["right-start"],
|
|
112
|
+
disabled: !isShowPopover.value
|
|
113
|
+
}, {
|
|
114
|
+
content: withCtx(() => [
|
|
115
|
+
renderSlot(_ctx.$slots, __props.item.popup_key, {}, void 0, true)
|
|
116
|
+
]),
|
|
117
|
+
default: withCtx(() => [
|
|
118
|
+
createElementVNode("div", {
|
|
119
|
+
class: normalizeClass(["menu-item", { "menu-item__selected": isSelected.value }]),
|
|
120
|
+
onMouseenter: handleMouseEnter,
|
|
121
|
+
onMouseleave: handleMouseLeave,
|
|
122
|
+
onClick: handleMenuClick
|
|
123
|
+
}, [
|
|
124
|
+
props.item.isIcon ? (openBlock(), createBlock(GIcon, {
|
|
125
|
+
key: 0,
|
|
126
|
+
name: currentImg.value,
|
|
127
|
+
class: "default-icon",
|
|
128
|
+
size: "16",
|
|
129
|
+
color: "var(--theme-menu-icon-fill)"
|
|
130
|
+
}, null, 8, ["name"])) : (openBlock(), createElementBlock("img", {
|
|
131
|
+
key: 1,
|
|
132
|
+
class: "menu-item__icon",
|
|
133
|
+
src: currentImg.value,
|
|
134
|
+
alt: ""
|
|
135
|
+
}, null, 8, _hoisted_1)),
|
|
136
|
+
createElementVNode("span", _hoisted_2, [
|
|
137
|
+
createTextVNode(toDisplayString(currentName.value) + " ", 1),
|
|
138
|
+
isShowPopover.value ? (openBlock(), createBlock(GIcon, {
|
|
139
|
+
key: 0,
|
|
140
|
+
class: "side-bar-icon",
|
|
141
|
+
size: "12",
|
|
142
|
+
name: "gt-line-right-tianqi",
|
|
143
|
+
color: "var(--theme-text)"
|
|
144
|
+
})) : createCommentVNode("", true)
|
|
145
|
+
])
|
|
146
|
+
], 34)
|
|
147
|
+
]),
|
|
148
|
+
_: 3
|
|
149
|
+
}, 8, ["disabled"]);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
const MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
154
|
+
export {
|
|
155
|
+
MenuItem as default
|
|
156
|
+
};
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { defineComponent, inject, ref, reactive, watch, computed, createElementBlock, openBlock, createCommentVNode, createBlock, withDirectives, Fragment, createElementVNode, createVNode, toDisplayString, unref, withModifiers, normalizeClass, withCtx, renderList, createTextVNode, vShow } from "vue";
|
|
2
|
+
import { a as i18n, q as useLayoutConfig, G as GIcon, C as _sfc_main$1, D as loadAsideData, A as emitEvent, s as setLoginTriggerSource, d as useRequestReport, F as asideRequest, _ as _export_sfc } from "./index-B66_WJIL.js";
|
|
3
|
+
import { useRouter } from "vue-router";
|
|
4
|
+
import { t as transWebUrl } from "./transWebUrl-CdGkJDeO.js";
|
|
5
|
+
import { Select, Option } from "vue-devui-lal/select";
|
|
6
|
+
import { Input } from "vue-devui-lal/input";
|
|
7
|
+
import { Skeleton } from "vue-devui-lal/skeleton";
|
|
8
|
+
import { MenuItem } from "vue-devui-lal/menu";
|
|
9
|
+
import { Button } from "vue-devui-lal/button";
|
|
10
|
+
import "vue-devui-lal/select/style.css";
|
|
11
|
+
import "vue-devui-lal/input/style.css";
|
|
12
|
+
import "vue-devui-lal/skeleton/style.css";
|
|
13
|
+
import "vue-devui-lal/menu/style.css";
|
|
14
|
+
import "vue-devui-lal/button/style.css";
|
|
15
|
+
const _hoisted_1 = { class: "devui-submenu layer_2 my-work-platform submenu-item relative" };
|
|
16
|
+
const _hoisted_2 = {
|
|
17
|
+
class: "devui-submenu-title layer_2",
|
|
18
|
+
style: { "padding": "0px 24px" }
|
|
19
|
+
};
|
|
20
|
+
const _hoisted_3 = { class: "devui-submenu-title-content cursor-auto" };
|
|
21
|
+
const _hoisted_4 = {
|
|
22
|
+
class: "devui-submenu-title layer_2",
|
|
23
|
+
style: { "padding": "0px 24px" }
|
|
24
|
+
};
|
|
25
|
+
const _hoisted_5 = { class: "devui-submenu-title-content cursor-auto" };
|
|
26
|
+
const _hoisted_6 = { key: 0 };
|
|
27
|
+
const _hoisted_7 = { class: "project-label" };
|
|
28
|
+
const _hoisted_8 = { class: "project-label flex-1 min-w-0 ellipsis" };
|
|
29
|
+
const _hoisted_9 = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "project-label"
|
|
32
|
+
};
|
|
33
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
34
|
+
__name: "ProjectMenuList",
|
|
35
|
+
props: {
|
|
36
|
+
type: { default: "project" },
|
|
37
|
+
buttonText: { default: "" },
|
|
38
|
+
subShow: { type: Boolean, default: false },
|
|
39
|
+
query: { default: {} },
|
|
40
|
+
defaultData: { default: {} },
|
|
41
|
+
isLogin: { type: Boolean, default: false },
|
|
42
|
+
defaultOrg: { default: {} },
|
|
43
|
+
username: { default: "" }
|
|
44
|
+
},
|
|
45
|
+
setup(__props) {
|
|
46
|
+
const { t } = i18n.global;
|
|
47
|
+
const request = inject("request");
|
|
48
|
+
const API = asideRequest(request);
|
|
49
|
+
const globalStore = inject("globalStore");
|
|
50
|
+
const { useReport } = useRequestReport(request, globalStore);
|
|
51
|
+
const layoutConfig = useLayoutConfig();
|
|
52
|
+
const props = __props;
|
|
53
|
+
const projectList = ref([]);
|
|
54
|
+
const loading = ref(false);
|
|
55
|
+
const pageQuery = reactive({
|
|
56
|
+
page: 1,
|
|
57
|
+
size: 10
|
|
58
|
+
});
|
|
59
|
+
const firstLoading = ref(false);
|
|
60
|
+
const showSearch = ref(false);
|
|
61
|
+
const extendQuery = {};
|
|
62
|
+
const searchKey = ref("");
|
|
63
|
+
const nameSpace = ref(0);
|
|
64
|
+
let storeData = [];
|
|
65
|
+
const totalNum = ref(0);
|
|
66
|
+
const router = useRouter();
|
|
67
|
+
const inputIng = ref(false);
|
|
68
|
+
const projectRoute = {
|
|
69
|
+
name: "newRepo",
|
|
70
|
+
query: { position: "nav_top" }
|
|
71
|
+
};
|
|
72
|
+
const teamRoute = {
|
|
73
|
+
name: "newOrg"
|
|
74
|
+
};
|
|
75
|
+
let scTimer = null;
|
|
76
|
+
let loadMoreTotal = 0;
|
|
77
|
+
watch(
|
|
78
|
+
() => props.defaultData,
|
|
79
|
+
() => {
|
|
80
|
+
firstLoading.value = !!props.defaultData.loading;
|
|
81
|
+
if (props.defaultData && props.defaultData.list) {
|
|
82
|
+
projectList.value = [...props.defaultData.list];
|
|
83
|
+
if (props.defaultData.storeData) {
|
|
84
|
+
storeData = [...props.defaultData.storeData];
|
|
85
|
+
}
|
|
86
|
+
totalNum.value = props.defaultData.totalNum || 0;
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{ immediate: true, deep: true }
|
|
90
|
+
);
|
|
91
|
+
const customRequest = (params, type) => {
|
|
92
|
+
if (type === "project" && params.namespace_id === "my-repo") {
|
|
93
|
+
const temp = { ...params };
|
|
94
|
+
delete temp.namespace_id;
|
|
95
|
+
return {
|
|
96
|
+
params: {
|
|
97
|
+
...temp,
|
|
98
|
+
repo_query_type: "created",
|
|
99
|
+
repo_type: "0,1,2"
|
|
100
|
+
},
|
|
101
|
+
requestFn: (params2) => API.getMyCreatedProjects(params2)
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
params,
|
|
106
|
+
requestFn: type === "project" ? (params2) => API.getMyProjects(params2) : (params2) => API.getMyGroups(params2)
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const loadMoreData = (loadType) => {
|
|
110
|
+
const data = [...storeData];
|
|
111
|
+
if (totalNum.value > pageQuery.size * pageQuery.page || loadType === "search") {
|
|
112
|
+
pageQuery.page = pageQuery.page + 1;
|
|
113
|
+
loading.value = true;
|
|
114
|
+
const params = {
|
|
115
|
+
page: pageQuery.page,
|
|
116
|
+
per_page: pageQuery.size,
|
|
117
|
+
...props.query,
|
|
118
|
+
...extendQuery
|
|
119
|
+
};
|
|
120
|
+
const { params: newParams, requestFn } = customRequest(params, props.type);
|
|
121
|
+
loadAsideData(requestFn, newParams, props.type).then(
|
|
122
|
+
(res) => {
|
|
123
|
+
if (params.search !== searchKey.value && loadType === "search") {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (res.list) {
|
|
127
|
+
data.push(...res.list);
|
|
128
|
+
}
|
|
129
|
+
if (loadType === "search" && res.storeData) {
|
|
130
|
+
storeData = [...res.storeData];
|
|
131
|
+
}
|
|
132
|
+
totalNum.value = res.totalNum || 0;
|
|
133
|
+
projectList.value.push(...data);
|
|
134
|
+
loading.value = false;
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
} else {
|
|
138
|
+
projectList.value.push(...data);
|
|
139
|
+
}
|
|
140
|
+
storeData = [];
|
|
141
|
+
};
|
|
142
|
+
const selectQuery = {
|
|
143
|
+
page: 1,
|
|
144
|
+
size: 10
|
|
145
|
+
};
|
|
146
|
+
const moreOrgData = ref([]);
|
|
147
|
+
const DEFAULT_ORG_FILTER_OPTIONS = [{ id: 0, label: t("gitCodeLayout.common.all") }, { id: "my-repo", label: props.username || t("gitCodeLayout.common.iCreated") }];
|
|
148
|
+
const teamList = computed(() => {
|
|
149
|
+
var _a;
|
|
150
|
+
if (props.defaultOrg.list) {
|
|
151
|
+
loadMoreTotal = props.defaultOrg.totalNum;
|
|
152
|
+
const propStoreData = ((_a = props.defaultOrg) == null ? void 0 : _a.storeData) || [];
|
|
153
|
+
return [...DEFAULT_ORG_FILTER_OPTIONS, ...props.defaultOrg.list, ...propStoreData, ...moreOrgData.value];
|
|
154
|
+
}
|
|
155
|
+
return [...DEFAULT_ORG_FILTER_OPTIONS, ...moreOrgData.value];
|
|
156
|
+
});
|
|
157
|
+
const fastToLink = (type) => {
|
|
158
|
+
if (type === "project") {
|
|
159
|
+
router.push({ name: "userRepos", params: { namespace: props.username } });
|
|
160
|
+
} else {
|
|
161
|
+
router.push({ name: "settingOrganization" });
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const loadMoreTeams = () => {
|
|
165
|
+
loadAsideData(
|
|
166
|
+
(params) => API.getMyProjects(params),
|
|
167
|
+
{
|
|
168
|
+
page: selectQuery.page,
|
|
169
|
+
per_page: selectQuery.size
|
|
170
|
+
},
|
|
171
|
+
"team"
|
|
172
|
+
).then((res) => {
|
|
173
|
+
loadMoreTotal = res.totalNum || 0;
|
|
174
|
+
if (res.list) {
|
|
175
|
+
moreOrgData.value.push(...res.list, ...res.storeData || []);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
const loadTeam = () => {
|
|
180
|
+
if (loadMoreTotal > selectQuery.size * selectQuery.page) {
|
|
181
|
+
selectQuery.page++;
|
|
182
|
+
loadMoreTeams();
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
const searchProject = () => {
|
|
186
|
+
extendQuery.search = searchKey.value;
|
|
187
|
+
extendQuery.namespace_id = nameSpace.value !== 0 ? nameSpace.value : void 0;
|
|
188
|
+
pageQuery.page = 0;
|
|
189
|
+
projectList.value = [];
|
|
190
|
+
storeData = [];
|
|
191
|
+
loadMoreData("search");
|
|
192
|
+
};
|
|
193
|
+
const searchTeam = () => {
|
|
194
|
+
extendQuery.search = searchKey.value;
|
|
195
|
+
pageQuery.page = 0;
|
|
196
|
+
projectList.value = [];
|
|
197
|
+
storeData = [];
|
|
198
|
+
loadMoreData("search");
|
|
199
|
+
};
|
|
200
|
+
const valChange = () => {
|
|
201
|
+
if (inputIng.value) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (scTimer) clearTimeout(scTimer);
|
|
205
|
+
scTimer = setTimeout(() => {
|
|
206
|
+
if (props.type === "project") {
|
|
207
|
+
searchProject();
|
|
208
|
+
} else {
|
|
209
|
+
searchTeam();
|
|
210
|
+
}
|
|
211
|
+
}, 200);
|
|
212
|
+
};
|
|
213
|
+
const handleOpenSearch = () => {
|
|
214
|
+
if (!props.isLogin) {
|
|
215
|
+
emitEvent("login", { loginTriggerSource: "org_search" });
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
showSearch.value = !showSearch.value;
|
|
219
|
+
};
|
|
220
|
+
const createRepoOrOrg = () => {
|
|
221
|
+
if (!props.isLogin) {
|
|
222
|
+
setLoginTriggerSource(props.type === "project" ? "aside_createRepo" : "aside_createOrg");
|
|
223
|
+
useReport("login_exposure", { source: props.type === "project" ? "aside_createRepo" : "aside_createOrg" });
|
|
224
|
+
}
|
|
225
|
+
const targetRoute = props.type === "project" ? projectRoute : teamRoute;
|
|
226
|
+
if (router.hasRoute(targetRoute.name)) {
|
|
227
|
+
router.push(targetRoute);
|
|
228
|
+
} else {
|
|
229
|
+
window.location.href = `${layoutConfig.VITE_HOST}/${props.type !== "project" ? "org/" : ""}create?position=nav_top`;
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
return (_ctx, _cache) => {
|
|
233
|
+
return openBlock(), createElementBlock("ul", _hoisted_1, [
|
|
234
|
+
_ctx.type === "project" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
235
|
+
createElementVNode("div", _hoisted_2, [
|
|
236
|
+
_cache[12] || (_cache[12] = createElementVNode("span", { class: "devui-menu-icon" }, null, -1)),
|
|
237
|
+
createElementVNode("span", _hoisted_3, [
|
|
238
|
+
createElementVNode("div", {
|
|
239
|
+
class: "fast-click-button",
|
|
240
|
+
onClick: _cache[0] || (_cache[0] = ($event) => fastToLink("project"))
|
|
241
|
+
}, toDisplayString(unref(t)("gitCodeLayout.org.project")), 1)
|
|
242
|
+
])
|
|
243
|
+
]),
|
|
244
|
+
createVNode(GIcon, {
|
|
245
|
+
class: "my-work-platform-searchicon",
|
|
246
|
+
color: "var(--theme-menu-icon-fill)",
|
|
247
|
+
name: "gt-search",
|
|
248
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => showSearch.value = !showSearch.value, ["stop"]))
|
|
249
|
+
}),
|
|
250
|
+
createElementVNode("div", {
|
|
251
|
+
class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
|
|
252
|
+
onClick: _cache[6] || (_cache[6] = withModifiers(() => {
|
|
253
|
+
}, ["stop"]))
|
|
254
|
+
}, [
|
|
255
|
+
createVNode(unref(Select), {
|
|
256
|
+
"menu-class": "my-work-platform-select",
|
|
257
|
+
modelValue: nameSpace.value,
|
|
258
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => nameSpace.value = $event),
|
|
259
|
+
class: "mb-[8px]",
|
|
260
|
+
placeholder: "",
|
|
261
|
+
filter: true,
|
|
262
|
+
onLoadMore: loadTeam,
|
|
263
|
+
onValueChange: searchProject
|
|
264
|
+
}, {
|
|
265
|
+
default: withCtx(() => [
|
|
266
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(teamList.value, (item, index) => {
|
|
267
|
+
return openBlock(), createBlock(unref(Option), {
|
|
268
|
+
key: index,
|
|
269
|
+
value: item.id,
|
|
270
|
+
name: item.label,
|
|
271
|
+
title: item.label
|
|
272
|
+
}, null, 8, ["value", "name", "title"]);
|
|
273
|
+
}), 128))
|
|
274
|
+
]),
|
|
275
|
+
_: 1
|
|
276
|
+
}, 8, ["modelValue"]),
|
|
277
|
+
createVNode(unref(Input), {
|
|
278
|
+
modelValue: searchKey.value,
|
|
279
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => searchKey.value = $event),
|
|
280
|
+
placeholder: unref(t)("gitCodeLayout.common.search"),
|
|
281
|
+
onInput: valChange,
|
|
282
|
+
onCompositionstart: _cache[4] || (_cache[4] = ($event) => inputIng.value = true),
|
|
283
|
+
onCompositionend: _cache[5] || (_cache[5] = ($event) => inputIng.value = false)
|
|
284
|
+
}, {
|
|
285
|
+
prefix: withCtx(() => [
|
|
286
|
+
createVNode(GIcon, {
|
|
287
|
+
name: "gt-search",
|
|
288
|
+
color: "var(--theme-menu-icon-fill)"
|
|
289
|
+
})
|
|
290
|
+
]),
|
|
291
|
+
_: 1
|
|
292
|
+
}, 8, ["modelValue", "placeholder"])
|
|
293
|
+
], 2)
|
|
294
|
+
], 64)) : createCommentVNode("", true),
|
|
295
|
+
_ctx.type === "team" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
296
|
+
createElementVNode("div", _hoisted_4, [
|
|
297
|
+
_cache[13] || (_cache[13] = createElementVNode("span", { class: "devui-menu-icon" }, null, -1)),
|
|
298
|
+
createElementVNode("span", _hoisted_5, [
|
|
299
|
+
createElementVNode("div", {
|
|
300
|
+
class: "fast-click-button",
|
|
301
|
+
onClick: _cache[7] || (_cache[7] = ($event) => fastToLink("team"))
|
|
302
|
+
}, toDisplayString(unref(t)("gitCodeLayout.common.organize")), 1)
|
|
303
|
+
])
|
|
304
|
+
]),
|
|
305
|
+
createVNode(GIcon, {
|
|
306
|
+
class: "my-work-platform-searchicon",
|
|
307
|
+
name: "gt-search",
|
|
308
|
+
onClick: withModifiers(handleOpenSearch, ["stop"]),
|
|
309
|
+
color: "var(--theme-menu-icon-fill)"
|
|
310
|
+
}),
|
|
311
|
+
createElementVNode("div", {
|
|
312
|
+
class: normalizeClass(["flex flex-col pl-[0] my-work-platform-inputbox", showSearch.value ? "" : "my-work-platform-hideInputBox"]),
|
|
313
|
+
onClick: _cache[11] || (_cache[11] = withModifiers(() => {
|
|
314
|
+
}, ["stop"]))
|
|
315
|
+
}, [
|
|
316
|
+
createVNode(unref(Input), {
|
|
317
|
+
modelValue: searchKey.value,
|
|
318
|
+
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => searchKey.value = $event),
|
|
319
|
+
placeholder: unref(t)("gitCodeLayout.common.search"),
|
|
320
|
+
onInput: valChange,
|
|
321
|
+
onCompositionstart: _cache[9] || (_cache[9] = ($event) => inputIng.value = true),
|
|
322
|
+
onCompositionend: _cache[10] || (_cache[10] = ($event) => inputIng.value = false)
|
|
323
|
+
}, {
|
|
324
|
+
prefix: withCtx(() => [
|
|
325
|
+
createVNode(GIcon, {
|
|
326
|
+
name: "gt-search",
|
|
327
|
+
color: "var(--theme-menu-icon-fill)"
|
|
328
|
+
})
|
|
329
|
+
]),
|
|
330
|
+
_: 1
|
|
331
|
+
}, 8, ["modelValue", "placeholder"])
|
|
332
|
+
], 2)
|
|
333
|
+
], 64)) : createCommentVNode("", true),
|
|
334
|
+
firstLoading.value ? (openBlock(), createBlock(unref(Skeleton), {
|
|
335
|
+
key: 2,
|
|
336
|
+
rows: 1
|
|
337
|
+
})) : createCommentVNode("", true),
|
|
338
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(projectList.value, (item) => {
|
|
339
|
+
return openBlock(), createBlock(unref(MenuItem), {
|
|
340
|
+
key: item.key,
|
|
341
|
+
"data-openBlank": true,
|
|
342
|
+
"data-href": unref(transWebUrl)(item.web_url),
|
|
343
|
+
class: "text",
|
|
344
|
+
title: _ctx.type === "project" ? `${item.namespace}/${item.label}` : item.label
|
|
345
|
+
}, {
|
|
346
|
+
icon: withCtx(() => [
|
|
347
|
+
_ctx.type === "project" ? (openBlock(), createBlock(GIcon, {
|
|
348
|
+
key: 0,
|
|
349
|
+
name: "gt-line-project",
|
|
350
|
+
color: "var(--theme-menu-icon-fill)",
|
|
351
|
+
size: "16"
|
|
352
|
+
})) : (openBlock(), createBlock(_sfc_main$1, {
|
|
353
|
+
key: 1,
|
|
354
|
+
src: item.avatar,
|
|
355
|
+
name: item.key,
|
|
356
|
+
width: 16,
|
|
357
|
+
height: 16,
|
|
358
|
+
class: normalizeClass(!item.avatar ? "avatar" : "avatar1")
|
|
359
|
+
}, null, 8, ["src", "name", "class"]))
|
|
360
|
+
]),
|
|
361
|
+
default: withCtx(() => [
|
|
362
|
+
_ctx.type === "project" ? (openBlock(), createElementBlock("span", _hoisted_6, [
|
|
363
|
+
createElementVNode("span", _hoisted_7, toDisplayString((item.namespace || "").slice(0, 10)) + toDisplayString((item.namespace || "").length > 10 ? "..." : ""), 1),
|
|
364
|
+
createElementVNode("span", _hoisted_8, "/" + toDisplayString(item.label), 1)
|
|
365
|
+
])) : (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(item.label), 1))
|
|
366
|
+
]),
|
|
367
|
+
_: 2
|
|
368
|
+
}, 1032, ["data-href", "title"]);
|
|
369
|
+
}), 128)),
|
|
370
|
+
!totalNum.value && !firstLoading.value ? (openBlock(), createBlock(unref(Button), {
|
|
371
|
+
key: 3,
|
|
372
|
+
variant: "text",
|
|
373
|
+
class: "more-btn",
|
|
374
|
+
onClick: withModifiers(createRepoOrOrg, ["stop"])
|
|
375
|
+
}, {
|
|
376
|
+
default: withCtx(() => [
|
|
377
|
+
createTextVNode(toDisplayString(_ctx.buttonText), 1)
|
|
378
|
+
]),
|
|
379
|
+
_: 1
|
|
380
|
+
})) : createCommentVNode("", true),
|
|
381
|
+
withDirectives(createVNode(unref(Button), {
|
|
382
|
+
variant: "text",
|
|
383
|
+
class: "more-btn",
|
|
384
|
+
onClick: withModifiers(loadMoreData, ["stop"]),
|
|
385
|
+
loading: loading.value,
|
|
386
|
+
disabled: loading.value
|
|
387
|
+
}, {
|
|
388
|
+
default: withCtx(() => [
|
|
389
|
+
createTextVNode(toDisplayString(unref(t)("gitCodeLayout.org.expand_more")), 1)
|
|
390
|
+
]),
|
|
391
|
+
_: 1
|
|
392
|
+
}, 8, ["loading", "disabled"]), [
|
|
393
|
+
[vShow, (totalNum.value > pageQuery.size * pageQuery.page || unref(storeData).length) && props.subShow]
|
|
394
|
+
])
|
|
395
|
+
]);
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
const ProjectMenuList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-vue-layout-gitcode"]]);
|
|
400
|
+
export {
|
|
401
|
+
ProjectMenuList as default
|
|
402
|
+
};
|