vue-layout-gitcode 1.0.0

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.
@@ -0,0 +1,105 @@
1
+ import { defineComponent, openBlock, createElementBlock, Fragment, renderList, createElementVNode, createVNode, toDisplayString, createCommentVNode } from "vue";
2
+ import { I as Icon, _ as _export_sfc } from "./index-36595f17.js";
3
+ import "vue-devui-lal/icon";
4
+ import "vue-devui-lal/icon/style.css";
5
+ import "vue-devui-lal/button";
6
+ import "vue-devui-lal/popover";
7
+ import "vue-devui-lal/tooltip";
8
+ import "vue-devui-lal/textarea";
9
+ import "vue-devui-lal/button/style.css";
10
+ import "vue-devui-lal/popover/style.css";
11
+ import "vue-devui-lal/tooltip/style.css";
12
+ import "vue-devui-lal/textarea/style.css";
13
+ import "vue-i18n";
14
+ import "vue-router";
15
+ import "@vueuse/core";
16
+ import "vue-devui-lal/avatar";
17
+ import "vue-devui-lal/avatar/style.css";
18
+ import "vue-devui-lal/select";
19
+ import "vue-devui-lal/input";
20
+ import "vue-devui-lal/skeleton";
21
+ import "vue-devui-lal/menu";
22
+ import "vue-devui-lal/select/style.css";
23
+ import "vue-devui-lal/input/style.css";
24
+ import "vue-devui-lal/skeleton/style.css";
25
+ import "vue-devui-lal/menu/style.css";
26
+ import "vue-devui-lal/dropdown";
27
+ import "vue-devui-lal/dropdown/style.css";
28
+ import "vue-devui-lal/drawer";
29
+ import "vue-devui-lal/layout";
30
+ import "vue-devui-lal/drawer/style.css";
31
+ import "vue-devui-lal/layout/style.css";
32
+ import "dayjs";
33
+ import "vue-devui-lal/message";
34
+ import "vue-devui-lal/message/style.css";
35
+ import "vue-devui-lal/badge";
36
+ import "vue-devui-lal/badge/style.css";
37
+ import "vue-devui-lal/tabs";
38
+ import "vue-devui-lal/tabs/style.css";
39
+ import "vue-devui-lal/radio";
40
+ import "vue-devui-lal/radio/style.css";
41
+ import "vue-devui-lal/form";
42
+ import "vue-devui-lal/form/style.css";
43
+ import "vue-devui-lal/checkbox";
44
+ import "vue-devui-lal/checkbox/style.css";
45
+ import "vue-devui-lal/modal";
46
+ import "vue-devui-lal/modal/style.css";
47
+ import "vue-devui-lal/notification";
48
+ import "vue-devui-lal/notification/style.css";
49
+ const _hoisted_1 = ["onClick"];
50
+ const _hoisted_2 = { class: "flex linkItem pl-[9px] pr-[19px]" };
51
+ const _hoisted_3 = { class: "leftTx ellipsis" };
52
+ const _hoisted_4 = {
53
+ key: 0,
54
+ class: "ml-[4px]"
55
+ };
56
+ const _hoisted_5 = { key: 1 };
57
+ const _hoisted_6 = { class: "ml-[4px]" };
58
+ const _hoisted_7 = { class: "right-text" };
59
+ const _sfc_main = /* @__PURE__ */ defineComponent({
60
+ __name: "SearchScopeList",
61
+ props: {
62
+ searchScopeList: {},
63
+ searchStr: {}
64
+ },
65
+ emits: ["scopeSearch"],
66
+ setup(__props, { emit: __emit }) {
67
+ const emit = __emit;
68
+ const onScopeSearch = (item) => {
69
+ emit("scopeSearch", item);
70
+ };
71
+ return (_ctx, _cache) => {
72
+ return openBlock(), createElementBlock("ul", null, [
73
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.searchScopeList, (item, index) => {
74
+ return openBlock(), createElementBlock("li", {
75
+ key: index,
76
+ class: "g-header-search-scopechoose pt-[16px] px-[8px]",
77
+ onClick: ($event) => onScopeSearch(item)
78
+ }, [
79
+ createElementVNode("div", _hoisted_2, [
80
+ createElementVNode("p", _hoisted_3, [
81
+ createVNode(Icon, {
82
+ name: "gt-search",
83
+ class: "g-header-search-icon"
84
+ }),
85
+ item.label ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(item.label) + ":", 1)) : createCommentVNode("", true),
86
+ item.value ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(item.value), 1)) : createCommentVNode("", true),
87
+ createElementVNode("span", _hoisted_6, toDisplayString(_ctx.searchStr), 1)
88
+ ]),
89
+ createElementVNode("p", _hoisted_7, [
90
+ createElementVNode("span", null, toDisplayString(item.label ? `${item.label}${_ctx.$t("header.underSearch")}` : item.title), 1),
91
+ createVNode(Icon, { name: "gt-line-right" })
92
+ ])
93
+ ]),
94
+ _cache[0] || (_cache[0] = createElementVNode("hr", { class: "line" }, null, -1))
95
+ ], 8, _hoisted_1);
96
+ }), 128))
97
+ ]);
98
+ };
99
+ }
100
+ });
101
+ const SearchScopeList_vue_vue_type_style_index_0_scoped_5ade5a9f_lang = "";
102
+ const SearchScopeList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5ade5a9f"]]);
103
+ export {
104
+ SearchScopeList as default
105
+ };
@@ -0,0 +1,129 @@
1
+ import { ref, watch, withDirectives, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, renderList, createVNode, vShow } from "vue";
2
+ import { h as headRequest, I as Icon } from "./index-36595f17.js";
3
+ import "vue-devui-lal/icon";
4
+ import "vue-devui-lal/icon/style.css";
5
+ import "vue-devui-lal/button";
6
+ import "vue-devui-lal/popover";
7
+ import "vue-devui-lal/tooltip";
8
+ import "vue-devui-lal/textarea";
9
+ import "vue-devui-lal/button/style.css";
10
+ import "vue-devui-lal/popover/style.css";
11
+ import "vue-devui-lal/tooltip/style.css";
12
+ import "vue-devui-lal/textarea/style.css";
13
+ import "vue-i18n";
14
+ import "vue-router";
15
+ import "@vueuse/core";
16
+ import "vue-devui-lal/avatar";
17
+ import "vue-devui-lal/avatar/style.css";
18
+ import "vue-devui-lal/select";
19
+ import "vue-devui-lal/input";
20
+ import "vue-devui-lal/skeleton";
21
+ import "vue-devui-lal/menu";
22
+ import "vue-devui-lal/select/style.css";
23
+ import "vue-devui-lal/input/style.css";
24
+ import "vue-devui-lal/skeleton/style.css";
25
+ import "vue-devui-lal/menu/style.css";
26
+ import "vue-devui-lal/dropdown";
27
+ import "vue-devui-lal/dropdown/style.css";
28
+ import "vue-devui-lal/drawer";
29
+ import "vue-devui-lal/layout";
30
+ import "vue-devui-lal/drawer/style.css";
31
+ import "vue-devui-lal/layout/style.css";
32
+ import "dayjs";
33
+ import "vue-devui-lal/message";
34
+ import "vue-devui-lal/message/style.css";
35
+ import "vue-devui-lal/badge";
36
+ import "vue-devui-lal/badge/style.css";
37
+ import "vue-devui-lal/tabs";
38
+ import "vue-devui-lal/tabs/style.css";
39
+ import "vue-devui-lal/radio";
40
+ import "vue-devui-lal/radio/style.css";
41
+ import "vue-devui-lal/form";
42
+ import "vue-devui-lal/form/style.css";
43
+ import "vue-devui-lal/checkbox";
44
+ import "vue-devui-lal/checkbox/style.css";
45
+ import "vue-devui-lal/modal";
46
+ import "vue-devui-lal/modal/style.css";
47
+ import "vue-devui-lal/notification";
48
+ import "vue-devui-lal/notification/style.css";
49
+ const UserSearch_vue_vue_type_style_index_0_lang = "";
50
+ const _hoisted_1 = { class: "px-[8px] history-list-project pl-[8px]" };
51
+ const _hoisted_2 = { class: "history-list-project-globartitle mb-[4px] mt-[16px]" };
52
+ const _hoisted_3 = ["href"];
53
+ const _hoisted_4 = { class: "flex history-list-project-globarbox" };
54
+ const _hoisted_5 = { class: "ml-[8px] ellipsis" };
55
+ const _sfc_main = {
56
+ __name: "UserSearch",
57
+ props: ["searchStr", "searchInfo"],
58
+ setup(__props) {
59
+ const API = headRequest(inject("request"));
60
+ const props = __props;
61
+ const loading = ref(false);
62
+ const searchFileList = ref([]);
63
+ let timer = null;
64
+ let dataApi = API.getOrgProjectList;
65
+ let otherParams = {
66
+ orgId: props.searchInfo.searchScopeName,
67
+ include_subgroups: true,
68
+ simple: false
69
+ };
70
+ if (props.searchInfo.searchScope === "user") {
71
+ dataApi = API.queryUserCreateRepos;
72
+ otherParams = {
73
+ user_name: props.searchInfo.searchScopeName
74
+ };
75
+ }
76
+ const getCreatedProfileData = () => {
77
+ if (!props.searchStr) {
78
+ return;
79
+ }
80
+ loading.value = true;
81
+ dataApi({
82
+ ...otherParams,
83
+ page: 1,
84
+ per_page: 5,
85
+ search: props.searchStr
86
+ }).then((res) => {
87
+ const data = res.data || {};
88
+ searchFileList.value = data.content || [];
89
+ }).finally(() => {
90
+ loading.value = false;
91
+ });
92
+ };
93
+ if (props.searchStr) {
94
+ getCreatedProfileData();
95
+ }
96
+ watch(() => props.searchStr, () => {
97
+ if (timer) {
98
+ clearTimeout(timer);
99
+ }
100
+ timer = setTimeout(() => {
101
+ getCreatedProfileData();
102
+ }, 300);
103
+ });
104
+ return (_ctx, _cache) => {
105
+ return withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
106
+ createElementVNode("p", _hoisted_2, toDisplayString(_ctx.$t("header.repo")), 1),
107
+ (openBlock(true), createElementBlock(Fragment, null, renderList(searchFileList.value, (item, index) => {
108
+ return openBlock(), createElementBlock("a", {
109
+ key: index,
110
+ href: item.web_url
111
+ }, [
112
+ createElementVNode("p", _hoisted_4, [
113
+ createVNode(Icon, {
114
+ name: "icon-folder-2",
115
+ style: { "flex-shrink": "0" }
116
+ }),
117
+ createElementVNode("span", _hoisted_5, toDisplayString(item.name), 1)
118
+ ])
119
+ ], 8, _hoisted_3);
120
+ }), 128))
121
+ ], 512)), [
122
+ [vShow, searchFileList.value.length]
123
+ ]);
124
+ };
125
+ }
126
+ };
127
+ export {
128
+ _sfc_main as default
129
+ };
@@ -0,0 +1,75 @@
1
+ import { ref, watchEffect } from "vue";
2
+ import { l as debounce } from "./index-36595f17.js";
3
+ const useReportRepo = (reportParams, viewReport) => {
4
+ const list = ref([]);
5
+ const pageRef = ref((window == null ? void 0 : window.page_ref) || "");
6
+ const locationHref = ref((window == null ? void 0 : window.location.href) || "");
7
+ const keyword = ref(reportParams == null ? void 0 : reportParams.keyword);
8
+ const moduleName = ref(reportParams == null ? void 0 : reportParams.moduleName);
9
+ const triggerReport = (type, data) => {
10
+ if (type === "click") {
11
+ const params = {
12
+ chat_title: "",
13
+ related: {
14
+ list: [formatItem(data)],
15
+ type: "repo"
16
+ }
17
+ };
18
+ viewReport(pageRef.value, locationHref.value, "click", params);
19
+ } else if (type === "expo") {
20
+ list.value.push(data);
21
+ }
22
+ };
23
+ const formatItem = (data) => {
24
+ const channelNames = [];
25
+ if (data.channelName)
26
+ channelNames.push(data.channelName);
27
+ if (data.subChannelName)
28
+ channelNames.push(data.subChannelName);
29
+ return {
30
+ type: "gitcode",
31
+ repo_id: data.id,
32
+ dest_url: data.web_url,
33
+ strategy: channelNames.join("、") || "",
34
+ // 官方项目
35
+ repo_index: data.index,
36
+ page: data.pageIndex || data.p || 0,
37
+ per_page: data.pageSize || data.pp || 0,
38
+ q: data.keyword || ""
39
+ };
40
+ };
41
+ const doReport = debounce(() => {
42
+ if (list.value.length >= 1) {
43
+ const reportList = list.value.splice(0).map((item) => {
44
+ return formatItem(item);
45
+ });
46
+ const params = {
47
+ chat_title: "",
48
+ extend_json: {
49
+ key_words: keyword.value,
50
+ module_name: moduleName.value
51
+ },
52
+ related: {
53
+ list: reportList,
54
+ type: "repo"
55
+ }
56
+ };
57
+ viewReport(pageRef.value, locationHref.value, "expo", params);
58
+ }
59
+ }, 500, { leading: false });
60
+ watchEffect(() => {
61
+ if (list.value.length) {
62
+ doReport();
63
+ }
64
+ });
65
+ return {
66
+ triggerReport
67
+ };
68
+ };
69
+ const formatNameSpace = (content) => {
70
+ return content.trim().replace(/\s+/g, "").replace(/^(GitHub加速计划\/|HuggingFace镜像\/)/, "").split("/").filter(Boolean);
71
+ };
72
+ export {
73
+ formatNameSpace as f,
74
+ useReportRepo as u
75
+ };