@opendesign-plus-test/components 0.0.1-rc.129 → 0.0.1-rc.131
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/chunk-OElCookieNotice.cjs.js +1 -1
- package/dist/chunk-OElCookieNotice.es.js +306 -149
- package/dist/components/empty/OEmpty.vue.d.ts +24 -0
- package/dist/components/empty/index.d.ts +39 -0
- package/dist/components/header/components/HeaderContent.vue.d.ts +0 -3
- package/dist/components/icon/index.d.ts +9 -0
- package/dist/components/meeting/OMeetingSigCalendar.vue.d.ts +0 -1
- package/dist/components/meeting/index.d.ts +0 -3
- package/dist/components/search/internal/SearchPanel.vue.d.ts +1 -1
- package/dist/components/sig/OSigDetail.vue.d.ts +30 -0
- package/dist/components/sig/OSigList.vue.d.ts +12 -0
- package/dist/components/sig/components/OSigDetailInfoCard.vue.d.ts +13 -0
- package/dist/components/sig/components/OSigItem.vue.d.ts +14 -0
- package/dist/components/sig/components/OSigMember.vue.d.ts +10 -0
- package/dist/components/sig/components/OSigRepo.vue.d.ts +8 -0
- package/dist/components/sig/components/OSigUserContribute.vue.d.ts +10 -0
- package/dist/components/sig/components/config-sig.d.ts +1 -0
- package/dist/components/sig/components/utils.d.ts +6 -0
- package/dist/components/sig/types.d.ts +169 -0
- package/dist/components.cjs.js +39 -39
- package/dist/components.css +1 -1
- package/dist/components.es.js +13894 -12210
- package/dist/index.d.ts +3 -0
- package/dist/treeshaking/_virtual/icon-atomgit.mjs +25 -0
- package/dist/treeshaking/_virtual/icon-filter.mjs +5 -6
- package/dist/treeshaking/_virtual/icon-filter2.mjs +21 -0
- package/dist/treeshaking/_virtual/icon-gitee.mjs +20 -0
- package/dist/treeshaking/_virtual/icon-mail.mjs +17 -0
- package/dist/treeshaking/_virtual/icon-notice.mjs +20 -0
- package/dist/treeshaking/_virtual/icon-outlink.mjs +20 -0
- package/dist/treeshaking/_virtual/icon-search.mjs +5 -5
- package/dist/treeshaking/_virtual/icon-search2.mjs +17 -0
- package/dist/treeshaking/_virtual/icon-user.mjs +17 -0
- package/dist/treeshaking/_virtual/icon-working.mjs +17 -0
- package/dist/treeshaking/_virtual/sig-space.mjs +20 -0
- package/dist/treeshaking/components/common/ThFilter.vue.mjs +1 -1
- package/dist/treeshaking/components/common/WordAvatar.css +18 -0
- package/dist/treeshaking/components/common/WordAvatar.vue.mjs +68 -0
- package/dist/treeshaking/components/common/WordAvatar.vue3.mjs +5 -0
- package/dist/treeshaking/components/empty/404.png.mjs +4 -0
- package/dist/treeshaking/components/empty/404_dark.png.mjs +4 -0
- package/dist/treeshaking/components/empty/OEmpty.css +60 -0
- package/dist/treeshaking/components/empty/OEmpty.vue.d.ts +24 -0
- package/dist/treeshaking/components/empty/OEmpty.vue.mjs +7 -0
- package/dist/treeshaking/components/empty/OEmpty.vue2.mjs +40 -0
- package/dist/treeshaking/components/empty/index.d.ts +39 -0
- package/dist/treeshaking/components/empty/index.mjs +9 -0
- package/dist/treeshaking/components/feedback-doc/OFeedbackDocContent.css +49 -21
- package/dist/treeshaking/components/feedback-doc/OFeedbackDocContent.vue.mjs +1 -1
- package/dist/treeshaking/components/feedback-doc/OFeedbackDocContent.vue2.mjs +15 -14
- package/dist/treeshaking/components/feedback-doc/OFeedbackDocDialog.vue.mjs +1 -1
- package/dist/treeshaking/components/header/OHeader.css +15 -15
- package/dist/treeshaking/components/header/OHeader.vue.mjs +1 -1
- package/dist/treeshaking/components/header/OHeader.vue2.mjs +5 -8
- package/dist/treeshaking/components/header/components/HeaderContent.css +184 -184
- package/dist/treeshaking/components/header/components/HeaderContent.vue.d.ts +0 -3
- package/dist/treeshaking/components/header/components/HeaderContent.vue.mjs +1 -1
- package/dist/treeshaking/components/header/components/HeaderContent.vue2.mjs +9 -11
- package/dist/treeshaking/components/icon/index.d.ts +9 -0
- package/dist/treeshaking/components/icon/index.mjs +12 -0
- package/dist/treeshaking/components/meeting/OMeetingSigCalendar.css +3 -0
- package/dist/treeshaking/components/meeting/OMeetingSigCalendar.vue.d.ts +0 -1
- package/dist/treeshaking/components/meeting/OMeetingSigCalendar.vue.mjs +4 -4
- package/dist/treeshaking/components/meeting/components/OMeetingCalendarList.vue.mjs +1 -1
- package/dist/treeshaking/components/meeting/components/OMeetingDetail.vue.mjs +1 -1
- package/dist/treeshaking/components/meeting/components/OMeetingPlaybackSubtitles.vue.mjs +1 -1
- package/dist/treeshaking/components/meeting/index.d.ts +0 -3
- package/dist/treeshaking/components/search/internal/SearchPanel.vue.d.ts +1 -1
- package/dist/treeshaking/components/sig/OSigDetail.css +176 -0
- package/dist/treeshaking/components/sig/OSigDetail.vue.d.ts +30 -0
- package/dist/treeshaking/components/sig/OSigDetail.vue.mjs +218 -0
- package/dist/treeshaking/components/sig/OSigDetail.vue3.mjs +5 -0
- package/dist/treeshaking/components/sig/OSigList.css +523 -0
- package/dist/treeshaking/components/sig/OSigList.vue.d.ts +12 -0
- package/dist/treeshaking/components/sig/OSigList.vue.mjs +595 -0
- package/dist/treeshaking/components/sig/OSigList.vue3.mjs +5 -0
- package/dist/treeshaking/components/sig/components/OSigDetailInfoCard.css +126 -0
- package/dist/treeshaking/components/sig/components/OSigDetailInfoCard.vue.d.ts +13 -0
- package/dist/treeshaking/components/sig/components/OSigDetailInfoCard.vue.mjs +61 -0
- package/dist/treeshaking/components/sig/components/OSigDetailInfoCard.vue3.mjs +5 -0
- package/dist/treeshaking/components/sig/components/OSigItem.css +375 -0
- package/dist/treeshaking/components/sig/components/OSigItem.vue.d.ts +14 -0
- package/dist/treeshaking/components/sig/components/OSigItem.vue.mjs +229 -0
- package/dist/treeshaking/components/sig/components/OSigItem.vue3.mjs +5 -0
- package/dist/treeshaking/components/sig/components/OSigMember.css +374 -0
- package/dist/treeshaking/components/sig/components/OSigMember.vue.d.ts +10 -0
- package/dist/treeshaking/components/sig/components/OSigMember.vue.mjs +274 -0
- package/dist/treeshaking/components/sig/components/OSigMember.vue3.mjs +5 -0
- package/dist/treeshaking/components/sig/components/OSigRepo.css +108 -0
- package/dist/treeshaking/components/sig/components/OSigRepo.vue.d.ts +8 -0
- package/dist/treeshaking/components/sig/components/OSigRepo.vue.mjs +181 -0
- package/dist/treeshaking/components/sig/components/OSigRepo.vue3.mjs +5 -0
- package/dist/treeshaking/components/sig/components/OSigUserContribute.css +510 -0
- package/dist/treeshaking/components/sig/components/OSigUserContribute.vue.d.ts +10 -0
- package/dist/treeshaking/components/sig/components/OSigUserContribute.vue.mjs +329 -0
- package/dist/treeshaking/components/sig/components/OSigUserContribute.vue3.mjs +5 -0
- package/dist/treeshaking/components/sig/components/config-sig.d.ts +1 -0
- package/dist/treeshaking/components/sig/components/config-sig.mjs +4 -0
- package/dist/treeshaking/components/sig/components/utils.d.ts +6 -0
- package/dist/treeshaking/components/sig/components/utils.mjs +10 -0
- package/dist/treeshaking/components/sig/index.mjs +18 -0
- package/dist/treeshaking/components/sig/types.d.ts +169 -0
- package/dist/treeshaking/i18n/en.mjs +73 -1
- package/dist/treeshaking/i18n/zh.mjs +87 -2
- package/dist/treeshaking/index.d.ts +3 -0
- package/dist/treeshaking/index.mjs +8 -1
- package/package.json +4 -4
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
import { defineComponent, computed, ref, watch, onMounted, onUnmounted, openBlock, createElementBlock, Fragment, createElementVNode, normalizeClass, unref, toDisplayString, createVNode, withCtx, renderList, createBlock, createTextVNode, createCommentVNode, withModifiers, withDirectives, nextTick } from "vue";
|
|
2
|
+
import { useDebounceFn, onClickOutside, useThrottleFn } from "@vueuse/core";
|
|
3
|
+
import { useScreen } from "@opendesign-plus/composables";
|
|
4
|
+
import { useI18n } from "../../i18n/index.mjs";
|
|
5
|
+
import { ORadioGroup, ORadio, OToggle, ODivider, OSelect, OOption, OInput, OIcon, OButton, ORow, OCol, OPagination, ODialog } from "@opensig/opendesign";
|
|
6
|
+
import OEmpty from "../empty/OEmpty.vue.mjs";
|
|
7
|
+
import _sfc_main$1 from "./components/OSigItem.vue.mjs";
|
|
8
|
+
import './components/OSigItem.css';
|
|
9
|
+
import IconSearch from "../../_virtual/icon-search.mjs";
|
|
10
|
+
import IconFilter from "../../_virtual/icon-filter.mjs";
|
|
11
|
+
import { buildVueDompurifyHTMLDirective } from "vue-dompurify-html";
|
|
12
|
+
const _hoisted_1 = { class: "o-sig-list" };
|
|
13
|
+
const _hoisted_2 = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "o-sig-filter-type"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_3 = { class: "o-sig-filter-title" };
|
|
18
|
+
const _hoisted_4 = { class: "o-sig-filter-select-box" };
|
|
19
|
+
const _hoisted_5 = {
|
|
20
|
+
key: 0,
|
|
21
|
+
class: "o-sig-search-data"
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_6 = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "o-sig-search-label"
|
|
26
|
+
};
|
|
27
|
+
const _hoisted_7 = ["onClick"];
|
|
28
|
+
const _hoisted_8 = ["title"];
|
|
29
|
+
const _hoisted_9 = {
|
|
30
|
+
key: 2,
|
|
31
|
+
class: "o-sig-no-result"
|
|
32
|
+
};
|
|
33
|
+
const _hoisted_10 = {
|
|
34
|
+
key: 2,
|
|
35
|
+
class: "o-sig-filter-btn"
|
|
36
|
+
};
|
|
37
|
+
const _hoisted_11 = { class: "o-sig-filter-text" };
|
|
38
|
+
const _hoisted_12 = {
|
|
39
|
+
key: 0,
|
|
40
|
+
class: "o-sig-filter-result-tip"
|
|
41
|
+
};
|
|
42
|
+
const _hoisted_13 = { key: 0 };
|
|
43
|
+
const _hoisted_14 = { class: "o-sig-num" };
|
|
44
|
+
const _hoisted_15 = {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "o-sig-num"
|
|
47
|
+
};
|
|
48
|
+
const _hoisted_16 = { key: 1 };
|
|
49
|
+
const _hoisted_17 = { class: "o-sig-num" };
|
|
50
|
+
const _hoisted_18 = {
|
|
51
|
+
key: 3,
|
|
52
|
+
class: "o-sig-loading"
|
|
53
|
+
};
|
|
54
|
+
const _hoisted_19 = {
|
|
55
|
+
key: 4,
|
|
56
|
+
class: "o-sig-pagination"
|
|
57
|
+
};
|
|
58
|
+
const _hoisted_20 = { class: "o-sig-dialog-title" };
|
|
59
|
+
const _hoisted_21 = { class: "o-sig-dialog-body" };
|
|
60
|
+
const _hoisted_22 = { class: "o-sig-filter-title" };
|
|
61
|
+
const _hoisted_23 = { class: "o-sig-dialog-btn" };
|
|
62
|
+
const PAGE_SIZE_DEFAULT = 10;
|
|
63
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
64
|
+
__name: "OSigList",
|
|
65
|
+
props: {
|
|
66
|
+
sigLandscape: { default: () => [] },
|
|
67
|
+
sigList: { default: () => [] },
|
|
68
|
+
searchFn: {}
|
|
69
|
+
},
|
|
70
|
+
emits: ["to-sig-detail"],
|
|
71
|
+
setup(__props, { emit: __emit }) {
|
|
72
|
+
const vDompurifyHtml = buildVueDompurifyHTMLDirective();
|
|
73
|
+
const { locale: localeRef, t } = useI18n();
|
|
74
|
+
const locale = computed(() => localeRef.value);
|
|
75
|
+
const { isLaptop, isPadH, lePadV } = useScreen();
|
|
76
|
+
const COUNT_PER_PAGE = [10, 20, 30];
|
|
77
|
+
const props = __props;
|
|
78
|
+
const emit = __emit;
|
|
79
|
+
const sigQuery = ref({ pageSize: PAGE_SIZE_DEFAULT, page: 1 });
|
|
80
|
+
const resetSigQuery = () => {
|
|
81
|
+
sigQuery.value.page = 1;
|
|
82
|
+
sigQuery.value.pageSize = PAGE_SIZE_DEFAULT;
|
|
83
|
+
};
|
|
84
|
+
const allSigInfo = ref([]);
|
|
85
|
+
const activeRepo = ref("");
|
|
86
|
+
const landscapeList = ref([]);
|
|
87
|
+
const featureArr = ref([]);
|
|
88
|
+
const mergedSigList = ref([]);
|
|
89
|
+
const constructLandscapeMap = () => {
|
|
90
|
+
landscapeList.value = props.sigLandscape.map(({ created_at: _created, ...rest }) => rest);
|
|
91
|
+
const seen = /* @__PURE__ */ new Set();
|
|
92
|
+
const features = [];
|
|
93
|
+
for (const item of landscapeList.value) {
|
|
94
|
+
if (item.feature_zh && !seen.has(item.feature_zh)) {
|
|
95
|
+
seen.add(item.feature_zh);
|
|
96
|
+
features.push({
|
|
97
|
+
value: item.feature_en ?? "",
|
|
98
|
+
label: { zh: item.feature_zh, en: item.feature_en }
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
features.push({ value: "other", label: { zh: "其他", en: "Other" } });
|
|
103
|
+
features.unshift({ value: "all", label: { zh: "全部", en: "All" } });
|
|
104
|
+
featureArr.value = features;
|
|
105
|
+
};
|
|
106
|
+
const mergeSigList = () => {
|
|
107
|
+
const map = new Map(landscapeList.value.map((m) => [m.sig_name, m]));
|
|
108
|
+
mergedSigList.value = allSigInfo.value.map((item) => ({
|
|
109
|
+
...item,
|
|
110
|
+
...map.get(item.name) ?? {}
|
|
111
|
+
}));
|
|
112
|
+
};
|
|
113
|
+
const initData = () => {
|
|
114
|
+
allSigInfo.value = [...props.sigList].sort((a, b) => a.name.localeCompare(b.name));
|
|
115
|
+
constructLandscapeMap();
|
|
116
|
+
mergeSigList();
|
|
117
|
+
};
|
|
118
|
+
const searchType = ref("all");
|
|
119
|
+
const placeholderType = ref(t("sig.searchSig"));
|
|
120
|
+
const sigOptions = [
|
|
121
|
+
{ label: t("sig.all"), value: "all", placeholder: t("sig.searchSig") },
|
|
122
|
+
{ label: t("sig.sigGroup"), value: "sig", placeholder: t("sig.searchSigName") },
|
|
123
|
+
{ label: t("sig.repo"), value: "repos", placeholder: t("sig.searchSigRepo") },
|
|
124
|
+
{ label: t("sig.maintainerEn"), value: "maintainer", placeholder: t("sig.searchSigMaintainer") }
|
|
125
|
+
];
|
|
126
|
+
const getSearchType = (val) => {
|
|
127
|
+
var _a;
|
|
128
|
+
const v = String(val);
|
|
129
|
+
placeholderType.value = ((_a = sigOptions.find((e) => e.value === v)) == null ? void 0 : _a.placeholder) ?? "";
|
|
130
|
+
enterSearchType.value = v;
|
|
131
|
+
sigSearch();
|
|
132
|
+
};
|
|
133
|
+
const uniqueArray = (array) => {
|
|
134
|
+
if (!array) return [];
|
|
135
|
+
const seen = /* @__PURE__ */ new Set();
|
|
136
|
+
return array.filter((item) => seen.has(item.name) ? false : (seen.add(item.name), true));
|
|
137
|
+
};
|
|
138
|
+
const sigInput = ref("");
|
|
139
|
+
const showPanel = ref(false);
|
|
140
|
+
const hasSearchData = ref([]);
|
|
141
|
+
const buildSearchGroups = (res, type) => {
|
|
142
|
+
const top3 = (arr) => uniqueArray(arr).sort((a, b) => b.socre - a.socre).slice(0, 3);
|
|
143
|
+
const all = [
|
|
144
|
+
{ id: "sig", label: t("sig.sigGroup"), list: top3(res["name.keyword"]) },
|
|
145
|
+
{ id: "repos", label: t("sig.repo"), list: top3(res.repos) },
|
|
146
|
+
{ id: "maintainer", label: t("sig.maintainerEn"), list: top3(res.giteeIds) }
|
|
147
|
+
];
|
|
148
|
+
return type === "all" ? all : all.filter((g) => g.id === type);
|
|
149
|
+
};
|
|
150
|
+
const sigSearch = () => {
|
|
151
|
+
if (!props.searchFn) return;
|
|
152
|
+
hasSearchData.value = [];
|
|
153
|
+
const params = {
|
|
154
|
+
keyword: sigInput.value,
|
|
155
|
+
keywordType: searchType.value
|
|
156
|
+
};
|
|
157
|
+
props.searchFn(params).then((res) => {
|
|
158
|
+
hasSearchData.value = buildSearchGroups(res, searchType.value);
|
|
159
|
+
const kw = sigInput.value;
|
|
160
|
+
if (kw) {
|
|
161
|
+
const escaped = kw.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
162
|
+
const regex = new RegExp(`(${escaped})`, "gi");
|
|
163
|
+
hasSearchData.value = hasSearchData.value.map((g) => ({
|
|
164
|
+
...g,
|
|
165
|
+
list: g.list.map((item) => ({
|
|
166
|
+
...item,
|
|
167
|
+
name: item.name.replace(/<[^>]+>/g, "").replace(regex, '<span class="highlight-text">$1</span>')
|
|
168
|
+
}))
|
|
169
|
+
}));
|
|
170
|
+
}
|
|
171
|
+
}).catch(() => {
|
|
172
|
+
hasSearchData.value = buildSearchGroups({}, searchType.value);
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
const updataSig = (val) => {
|
|
176
|
+
sigInput.value = val;
|
|
177
|
+
resetSigQuery();
|
|
178
|
+
sigSearch();
|
|
179
|
+
};
|
|
180
|
+
const debounceFn = useDebounceFn(updataSig, 300);
|
|
181
|
+
const debounceSig = computed({
|
|
182
|
+
get: () => sigInput.value.trim(),
|
|
183
|
+
set: (val) => debounceFn(val)
|
|
184
|
+
});
|
|
185
|
+
const enterSearchType = ref("all");
|
|
186
|
+
const enterSearchInput = ref("");
|
|
187
|
+
const changeSearchInput = () => {
|
|
188
|
+
if (!sigInput.value) return;
|
|
189
|
+
showPanel.value = false;
|
|
190
|
+
enterSearchType.value = searchType.value;
|
|
191
|
+
enterSearchInput.value = sigInput.value;
|
|
192
|
+
};
|
|
193
|
+
const stripHtml = (val) => (val == null ? void 0 : val.replace(/<[^>]+>/g, "")) ?? "";
|
|
194
|
+
const clickItem = (val) => {
|
|
195
|
+
sigInput.value = stripHtml(val);
|
|
196
|
+
showPanel.value = false;
|
|
197
|
+
enterSearchType.value = searchType.value;
|
|
198
|
+
enterSearchInput.value = sigInput.value;
|
|
199
|
+
};
|
|
200
|
+
const clearInput = () => {
|
|
201
|
+
sigInput.value = "";
|
|
202
|
+
enterSearchInput.value = "";
|
|
203
|
+
};
|
|
204
|
+
const panelRef = ref();
|
|
205
|
+
onClickOutside(panelRef, () => {
|
|
206
|
+
showPanel.value = false;
|
|
207
|
+
});
|
|
208
|
+
const toSigDetail = (sigName) => emit("to-sig-detail", sigName);
|
|
209
|
+
watch(
|
|
210
|
+
() => sigInput.value,
|
|
211
|
+
(val) => {
|
|
212
|
+
showPanel.value = !!val;
|
|
213
|
+
if (!val) enterSearchInput.value = val;
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
const filterSigData = ref([]);
|
|
217
|
+
const filterSearchData = ref([]);
|
|
218
|
+
const filterDataMb = ref([]);
|
|
219
|
+
const filterVisible = ref(false);
|
|
220
|
+
const featureType = ref("all");
|
|
221
|
+
const featureTypeMb = ref("all");
|
|
222
|
+
const matchKw = (text, kw) => !!text && text.toLowerCase().includes(kw);
|
|
223
|
+
watch(
|
|
224
|
+
() => [
|
|
225
|
+
featureType.value,
|
|
226
|
+
enterSearchType.value,
|
|
227
|
+
enterSearchInput.value,
|
|
228
|
+
sigQuery.value.page,
|
|
229
|
+
sigQuery.value.pageSize,
|
|
230
|
+
mergedSigList.value
|
|
231
|
+
],
|
|
232
|
+
([ftype, stype, sinput, page, pageSize, merged]) => {
|
|
233
|
+
if (!merged.length) return;
|
|
234
|
+
const kw = (sinput ?? "").toLowerCase();
|
|
235
|
+
const byFeature = ftype === "all" ? merged : merged.filter(
|
|
236
|
+
(item) => ftype === "other" ? !item.feature_en : item.feature_en === ftype
|
|
237
|
+
);
|
|
238
|
+
let searched = byFeature;
|
|
239
|
+
if (kw && stype) {
|
|
240
|
+
searched = byFeature.filter((item) => {
|
|
241
|
+
var _a, _b;
|
|
242
|
+
if (stype === "sig" || stype === "all") {
|
|
243
|
+
if (matchKw(item.name, kw) || matchKw(item.description, kw)) return true;
|
|
244
|
+
}
|
|
245
|
+
if (stype === "repos" || stype === "all") {
|
|
246
|
+
if ((_a = item.repositories) == null ? void 0 : _a.some((r) => r == null ? void 0 : r.toLowerCase().includes(kw))) return true;
|
|
247
|
+
}
|
|
248
|
+
if (stype === "maintainer" || stype === "all") {
|
|
249
|
+
if ((_b = item.maintainer_info) == null ? void 0 : _b.some((m) => matchKw(m.name, kw) || matchKw(m.gitee_id, kw))) return true;
|
|
250
|
+
}
|
|
251
|
+
return false;
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
if (kw) {
|
|
255
|
+
searched = [...searched].sort((a, b) => {
|
|
256
|
+
const aHit = a.name.toLowerCase().includes(kw);
|
|
257
|
+
const bHit = b.name.toLowerCase().includes(kw);
|
|
258
|
+
return aHit === bHit ? 0 : aHit ? -1 : 1;
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
filterSearchData.value = searched;
|
|
262
|
+
filterSigData.value = lePadV.value ? searched.slice(0, page * pageSize) : searched.slice((page - 1) * pageSize, page * pageSize);
|
|
263
|
+
},
|
|
264
|
+
{ immediate: true }
|
|
265
|
+
);
|
|
266
|
+
const gap = computed(() => {
|
|
267
|
+
if (isLaptop.value) return "24px 24px";
|
|
268
|
+
if (isPadH.value) return "16px 16px";
|
|
269
|
+
if (lePadV.value) return "0 12px";
|
|
270
|
+
return "32px 32px";
|
|
271
|
+
});
|
|
272
|
+
const clearChecked = (val) => {
|
|
273
|
+
resetSigQuery();
|
|
274
|
+
filterVisible.value = false;
|
|
275
|
+
if (val) {
|
|
276
|
+
nextTick(() => {
|
|
277
|
+
featureType.value = "all";
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
const getMoreDataMo = () => {
|
|
282
|
+
filterDataMb.value = filterSearchData.value.slice(
|
|
283
|
+
0,
|
|
284
|
+
sigQuery.value.page * sigQuery.value.pageSize
|
|
285
|
+
);
|
|
286
|
+
sigQuery.value.page++;
|
|
287
|
+
};
|
|
288
|
+
const resetVersion = () => {
|
|
289
|
+
featureType.value = "all";
|
|
290
|
+
filterVisible.value = false;
|
|
291
|
+
};
|
|
292
|
+
const confirmVersion = () => {
|
|
293
|
+
resetSigQuery();
|
|
294
|
+
filterVisible.value = false;
|
|
295
|
+
featureType.value = featureTypeMb.value;
|
|
296
|
+
};
|
|
297
|
+
const footer = ref(null);
|
|
298
|
+
const listenScroll = () => {
|
|
299
|
+
if (!lePadV.value) return;
|
|
300
|
+
nextTick(() => {
|
|
301
|
+
var _a;
|
|
302
|
+
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
|
|
303
|
+
const scrollHeight = document.body.scrollHeight;
|
|
304
|
+
const clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
|
305
|
+
const footerHeight = ((_a = footer.value) == null ? void 0 : _a.clientHeight) ?? 0;
|
|
306
|
+
if (scrollTop + clientHeight + footerHeight >= scrollHeight && filterDataMb.value.length < filterSearchData.value.length) {
|
|
307
|
+
getMoreDataMo();
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
const throttleEvent = useThrottleFn(listenScroll, 300);
|
|
312
|
+
onMounted(() => {
|
|
313
|
+
initData();
|
|
314
|
+
footer.value = document.querySelector("#app > .footer");
|
|
315
|
+
window.addEventListener("scroll", throttleEvent);
|
|
316
|
+
});
|
|
317
|
+
onUnmounted(() => {
|
|
318
|
+
window.removeEventListener("scroll", throttleEvent);
|
|
319
|
+
});
|
|
320
|
+
return (_ctx, _cache) => {
|
|
321
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
322
|
+
createElementVNode("div", _hoisted_1, [
|
|
323
|
+
createElementVNode("div", {
|
|
324
|
+
class: normalizeClass(["o-sig-filter-box", `o-sig-filter-box-${locale.value}`])
|
|
325
|
+
}, [
|
|
326
|
+
!unref(lePadV) ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
327
|
+
createElementVNode("p", _hoisted_3, toDisplayString(unref(t)("sig.type")), 1),
|
|
328
|
+
createVNode(unref(ORadioGroup), {
|
|
329
|
+
modelValue: featureType.value,
|
|
330
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => featureType.value = $event)
|
|
331
|
+
}, {
|
|
332
|
+
default: withCtx(() => [
|
|
333
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(featureArr.value, (option) => {
|
|
334
|
+
return openBlock(), createBlock(unref(ORadio), {
|
|
335
|
+
key: option.value,
|
|
336
|
+
value: option.value
|
|
337
|
+
}, {
|
|
338
|
+
radio: withCtx(({ checked }) => [
|
|
339
|
+
createVNode(unref(OToggle), {
|
|
340
|
+
class: normalizeClass(["o-sig-tag-normal", { active: checked }]),
|
|
341
|
+
checked,
|
|
342
|
+
onClick: ($event) => clearChecked(checked)
|
|
343
|
+
}, {
|
|
344
|
+
default: withCtx(() => [
|
|
345
|
+
createTextVNode(toDisplayString(option.label[locale.value]), 1)
|
|
346
|
+
]),
|
|
347
|
+
_: 2
|
|
348
|
+
}, 1032, ["class", "checked", "onClick"])
|
|
349
|
+
]),
|
|
350
|
+
_: 2
|
|
351
|
+
}, 1032, ["value"]);
|
|
352
|
+
}), 128))
|
|
353
|
+
]),
|
|
354
|
+
_: 1
|
|
355
|
+
}, 8, ["modelValue"])
|
|
356
|
+
])) : createCommentVNode("", true),
|
|
357
|
+
!unref(lePadV) ? (openBlock(), createBlock(unref(ODivider), {
|
|
358
|
+
key: 1,
|
|
359
|
+
direction: "h"
|
|
360
|
+
})) : createCommentVNode("", true),
|
|
361
|
+
createElementVNode("div", _hoisted_4, [
|
|
362
|
+
createElementVNode("div", {
|
|
363
|
+
ref_key: "panelRef",
|
|
364
|
+
ref: panelRef,
|
|
365
|
+
class: normalizeClass(["o-sig-filter-select", { "o-sig-filter-select-focus": showPanel.value }])
|
|
366
|
+
}, [
|
|
367
|
+
createVNode(unref(OSelect), {
|
|
368
|
+
modelValue: searchType.value,
|
|
369
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchType.value = $event),
|
|
370
|
+
size: "large",
|
|
371
|
+
trigger: "click",
|
|
372
|
+
variant: "outline",
|
|
373
|
+
onChange: getSearchType
|
|
374
|
+
}, {
|
|
375
|
+
default: withCtx(() => [
|
|
376
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(sigOptions, (item) => {
|
|
377
|
+
return createVNode(unref(OOption), {
|
|
378
|
+
key: item.value,
|
|
379
|
+
label: item.label,
|
|
380
|
+
value: item.value
|
|
381
|
+
}, null, 8, ["label", "value"]);
|
|
382
|
+
}), 64))
|
|
383
|
+
]),
|
|
384
|
+
_: 1
|
|
385
|
+
}, 8, ["modelValue"]),
|
|
386
|
+
createVNode(unref(OInput), {
|
|
387
|
+
modelValue: debounceSig.value,
|
|
388
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => debounceSig.value = $event),
|
|
389
|
+
size: "large",
|
|
390
|
+
clearable: "",
|
|
391
|
+
placeholder: placeholderType.value,
|
|
392
|
+
onFocusCapture: _cache[3] || (_cache[3] = ($event) => showPanel.value = true),
|
|
393
|
+
onPressEnter: changeSearchInput,
|
|
394
|
+
onClear: clearInput
|
|
395
|
+
}, {
|
|
396
|
+
prefix: withCtx(() => [
|
|
397
|
+
createVNode(unref(OIcon), null, {
|
|
398
|
+
default: withCtx(() => [
|
|
399
|
+
createVNode(unref(IconSearch))
|
|
400
|
+
]),
|
|
401
|
+
_: 1
|
|
402
|
+
})
|
|
403
|
+
]),
|
|
404
|
+
_: 1
|
|
405
|
+
}, 8, ["modelValue", "placeholder"]),
|
|
406
|
+
showPanel.value && sigInput.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
407
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(hasSearchData.value, (item) => {
|
|
408
|
+
return openBlock(), createElementBlock("div", {
|
|
409
|
+
key: item.id,
|
|
410
|
+
class: "o-sig-search-group"
|
|
411
|
+
}, [
|
|
412
|
+
searchType.value === "all" ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(item.label), 1)) : createCommentVNode("", true),
|
|
413
|
+
item.list.length ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(item.list, (it) => {
|
|
414
|
+
return openBlock(), createElementBlock("div", {
|
|
415
|
+
key: it.name,
|
|
416
|
+
class: "o-sig-search-item",
|
|
417
|
+
onClick: withModifiers(($event) => clickItem(it == null ? void 0 : it.name), ["stop"])
|
|
418
|
+
}, [
|
|
419
|
+
withDirectives(createElementVNode("span", {
|
|
420
|
+
title: stripHtml(it == null ? void 0 : it.name),
|
|
421
|
+
class: "o-sig-search-title"
|
|
422
|
+
}, null, 8, _hoisted_8), [
|
|
423
|
+
[unref(vDompurifyHtml), it == null ? void 0 : it.name]
|
|
424
|
+
])
|
|
425
|
+
], 8, _hoisted_7);
|
|
426
|
+
}), 128)) : (openBlock(), createElementBlock("p", _hoisted_9, toDisplayString(unref(t)("sig.noResult")), 1))
|
|
427
|
+
]);
|
|
428
|
+
}), 128))
|
|
429
|
+
])) : createCommentVNode("", true)
|
|
430
|
+
], 2)
|
|
431
|
+
]),
|
|
432
|
+
unref(lePadV) ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
433
|
+
createVNode(unref(OButton), {
|
|
434
|
+
variant: "text",
|
|
435
|
+
color: "normal",
|
|
436
|
+
class: "o-sig-select-btn",
|
|
437
|
+
onClick: _cache[4] || (_cache[4] = ($event) => filterVisible.value = true)
|
|
438
|
+
}, {
|
|
439
|
+
default: withCtx(() => [
|
|
440
|
+
createVNode(unref(OIcon), null, {
|
|
441
|
+
default: withCtx(() => [
|
|
442
|
+
createVNode(unref(IconFilter))
|
|
443
|
+
]),
|
|
444
|
+
_: 1
|
|
445
|
+
}),
|
|
446
|
+
createElementVNode("span", _hoisted_11, toDisplayString(unref(t)("sig.filter")), 1)
|
|
447
|
+
]),
|
|
448
|
+
_: 1
|
|
449
|
+
})
|
|
450
|
+
])) : createCommentVNode("", true)
|
|
451
|
+
], 2),
|
|
452
|
+
featureType.value !== "all" || enterSearchInput.value ? (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
453
|
+
sigInput.value ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
454
|
+
createElementVNode("span", null, toDisplayString(unref(t)("sig.filterResultTip1")), 1),
|
|
455
|
+
createElementVNode("span", _hoisted_14, toDisplayString(filterSearchData.value.length), 1),
|
|
456
|
+
createElementVNode("span", null, toDisplayString(unref(t)("sig.filterResultTip2")), 1),
|
|
457
|
+
locale.value === "zh" ? (openBlock(), createElementBlock("span", _hoisted_15, toDisplayString(sigInput.value), 1)) : createCommentVNode("", true),
|
|
458
|
+
createElementVNode("span", null, toDisplayString(unref(t)("sig.filterResultTip3")), 1)
|
|
459
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_16, [
|
|
460
|
+
createElementVNode("span", null, toDisplayString(unref(t)("sig.filterResultTip4")), 1),
|
|
461
|
+
createElementVNode("span", _hoisted_17, toDisplayString(filterSearchData.value.length), 1),
|
|
462
|
+
createElementVNode("span", null, toDisplayString(unref(t)("sig.filterResultTip5")), 1)
|
|
463
|
+
]))
|
|
464
|
+
])) : createCommentVNode("", true),
|
|
465
|
+
filterSigData.value.length ? (openBlock(), createBlock(unref(ORow), {
|
|
466
|
+
key: 1,
|
|
467
|
+
gap: gap.value,
|
|
468
|
+
wrap: "wrap",
|
|
469
|
+
class: normalizeClass(["o-sig-card-list", { "o-sig-card-list-tip": featureType.value !== "all" || enterSearchInput.value }])
|
|
470
|
+
}, {
|
|
471
|
+
default: withCtx(() => [
|
|
472
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(filterSigData.value, (sig) => {
|
|
473
|
+
return openBlock(), createBlock(unref(OCol), {
|
|
474
|
+
key: sig.name,
|
|
475
|
+
flex: unref(lePadV) ? "0 0 100%" : "0 0 50%"
|
|
476
|
+
}, {
|
|
477
|
+
default: withCtx(() => [
|
|
478
|
+
createVNode(_sfc_main$1, {
|
|
479
|
+
sig,
|
|
480
|
+
locale: locale.value,
|
|
481
|
+
mobile: unref(lePadV),
|
|
482
|
+
"active-repo": activeRepo.value,
|
|
483
|
+
onToSigDetail: toSigDetail
|
|
484
|
+
}, null, 8, ["sig", "locale", "mobile", "active-repo"])
|
|
485
|
+
]),
|
|
486
|
+
_: 2
|
|
487
|
+
}, 1032, ["flex"]);
|
|
488
|
+
}), 128))
|
|
489
|
+
]),
|
|
490
|
+
_: 1
|
|
491
|
+
}, 8, ["gap", "class"])) : (openBlock(), createBlock(OEmpty, {
|
|
492
|
+
key: 2,
|
|
493
|
+
style: {
|
|
494
|
+
"margin-top": "40px",
|
|
495
|
+
"--result-image-width": "140px",
|
|
496
|
+
"--result-image-height": "170px"
|
|
497
|
+
}
|
|
498
|
+
})),
|
|
499
|
+
unref(lePadV) && filterDataMb.value.length && filterDataMb.value.length < filterSearchData.value.length ? (openBlock(), createElementBlock("p", _hoisted_18, toDisplayString(unref(t)("sig.loading")), 1)) : createCommentVNode("", true),
|
|
500
|
+
filterSearchData.value.length > COUNT_PER_PAGE[0] ? (openBlock(), createElementBlock("div", _hoisted_19, [
|
|
501
|
+
createVNode(unref(OPagination), {
|
|
502
|
+
page: sigQuery.value.page,
|
|
503
|
+
"onUpdate:page": _cache[5] || (_cache[5] = ($event) => sigQuery.value.page = $event),
|
|
504
|
+
"page-size": sigQuery.value.pageSize,
|
|
505
|
+
"onUpdate:pageSize": _cache[6] || (_cache[6] = ($event) => sigQuery.value.pageSize = $event),
|
|
506
|
+
layout: ["total", "pagesize", "pager", "jumper"],
|
|
507
|
+
total: filterSearchData.value.length,
|
|
508
|
+
"page-sizes": COUNT_PER_PAGE,
|
|
509
|
+
"show-more": true
|
|
510
|
+
}, null, 8, ["page", "page-size", "total"])
|
|
511
|
+
])) : createCommentVNode("", true)
|
|
512
|
+
]),
|
|
513
|
+
createVNode(unref(ODialog), {
|
|
514
|
+
visible: filterVisible.value,
|
|
515
|
+
"onUpdate:visible": _cache[8] || (_cache[8] = ($event) => filterVisible.value = $event),
|
|
516
|
+
"phone-half-full": unref(lePadV),
|
|
517
|
+
scrollbar: { showType: "always", size: "small" },
|
|
518
|
+
size: "medium",
|
|
519
|
+
style: { "--dlg-radius": "4px 4px 0 0" },
|
|
520
|
+
class: "o-sig-filter-dialog"
|
|
521
|
+
}, {
|
|
522
|
+
header: withCtx(() => [
|
|
523
|
+
createElementVNode("span", _hoisted_20, toDisplayString(unref(t)("sig.type")), 1)
|
|
524
|
+
]),
|
|
525
|
+
default: withCtx(() => [
|
|
526
|
+
createElementVNode("div", _hoisted_21, [
|
|
527
|
+
createElementVNode("p", _hoisted_22, toDisplayString(unref(t)("sig.type")), 1),
|
|
528
|
+
createVNode(unref(ORadioGroup), {
|
|
529
|
+
modelValue: featureTypeMb.value,
|
|
530
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => featureTypeMb.value = $event),
|
|
531
|
+
style: { gap: "8px 8px" }
|
|
532
|
+
}, {
|
|
533
|
+
default: withCtx(() => [
|
|
534
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(featureArr.value, (option) => {
|
|
535
|
+
return openBlock(), createBlock(unref(ORadio), {
|
|
536
|
+
key: option.value,
|
|
537
|
+
value: option.value
|
|
538
|
+
}, {
|
|
539
|
+
radio: withCtx(({ checked }) => [
|
|
540
|
+
createVNode(unref(OToggle), {
|
|
541
|
+
class: normalizeClass({ active: checked }),
|
|
542
|
+
checked,
|
|
543
|
+
style: { "--toggle-size": "28px", "--toggle-padding": "6px 16px", "--toggle-radius": "4px" }
|
|
544
|
+
}, {
|
|
545
|
+
default: withCtx(() => [
|
|
546
|
+
createTextVNode(toDisplayString(option.label[locale.value]), 1)
|
|
547
|
+
]),
|
|
548
|
+
_: 2
|
|
549
|
+
}, 1032, ["class", "checked"])
|
|
550
|
+
]),
|
|
551
|
+
_: 2
|
|
552
|
+
}, 1032, ["value"]);
|
|
553
|
+
}), 128))
|
|
554
|
+
]),
|
|
555
|
+
_: 1
|
|
556
|
+
}, 8, ["modelValue"])
|
|
557
|
+
]),
|
|
558
|
+
createElementVNode("div", _hoisted_23, [
|
|
559
|
+
createVNode(unref(OButton), {
|
|
560
|
+
color: "normal",
|
|
561
|
+
variant: "text",
|
|
562
|
+
size: "large",
|
|
563
|
+
onClick: resetVersion
|
|
564
|
+
}, {
|
|
565
|
+
default: withCtx(() => [
|
|
566
|
+
createTextVNode(toDisplayString(unref(t)("common.reset")), 1)
|
|
567
|
+
]),
|
|
568
|
+
_: 1
|
|
569
|
+
}),
|
|
570
|
+
createVNode(unref(ODivider), {
|
|
571
|
+
class: "o-sig-dialog-divider",
|
|
572
|
+
direction: "v"
|
|
573
|
+
}),
|
|
574
|
+
createVNode(unref(OButton), {
|
|
575
|
+
color: "normal",
|
|
576
|
+
variant: "text",
|
|
577
|
+
size: "large",
|
|
578
|
+
onClick: confirmVersion
|
|
579
|
+
}, {
|
|
580
|
+
default: withCtx(() => [
|
|
581
|
+
createTextVNode(toDisplayString(unref(t)("common.confirm2")), 1)
|
|
582
|
+
]),
|
|
583
|
+
_: 1
|
|
584
|
+
})
|
|
585
|
+
])
|
|
586
|
+
]),
|
|
587
|
+
_: 1
|
|
588
|
+
}, 8, ["visible", "phone-half-full"])
|
|
589
|
+
], 64);
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
export {
|
|
594
|
+
_sfc_main as default
|
|
595
|
+
};
|