Merge remote-tracking branch 'origin/master'

This commit is contained in:
付民康
2025-03-21 11:01:23 +08:00
2 changed files with 47 additions and 9 deletions

View File

@@ -147,6 +147,22 @@ const { isLogin } = useDiscussGetUserInfo();
const homeSearch = ref(null);
const dropdownWidth = ref(0);
const tagMap = {
critical: {
text: '致命',
color: '#c7000b'
},
high: {
text: '高',
color: '#f66f6a'
},
medium: {
text: '中',
color: '#fac20a'
},
low: {
text: '低',
color: '#5e7ce0'
},
Critical: {
text: '致命',
color: '#c7000b'
@@ -187,9 +203,11 @@ const closeOutside = () => {
};
const submit = (formData) => {
debugger
debugger;
isOpen.value = false;
router.push({ name: 'Search', query: {
router.push({
name: 'Search',
query: {
softwareName: searchStr.value ? searchStr.value : '',
searchType: getIndustryValue(searchType.value),
softwareVersion: formData.softwareVersion || '',
@@ -199,8 +217,9 @@ const submit = (formData) => {
licenseName: formData.licenseName || '',
dependentSoftware: formData.dependentSoftware || '',
releaseDateStart: formData.dateRange && formData.dateRange.length > 0 ? formData.dateRange[0] : '',
releaseDateEnd: formData.dateRange&&formData.dateRange.length>0?formData.dateRange[1]:'',
} });
releaseDateEnd: formData.dateRange && formData.dateRange.length > 0 ? formData.dateRange[1] : ''
}
});
};
const inputFocus = () => {
@@ -219,15 +238,19 @@ const updateDropdownWidth = () => {
const globalInfo = useGlobalInfoStore();
const industryList = globalInfo.industryList;
const getIndustryValue = (name) => {
const industry = industryList.find(item => item.name === name);
const industry = industryList.find((item) => item.name === name);
return industry ? industry.value : ''; // 如果找不到,返回默认值
};
const search = () => {
// updateHeaderSearch({ searchWord: searchStr.value, searchType: selectedCate.value });
router.push({ name: 'Search', query: {
router.push({
name: 'Search',
query: {
softwareName: searchStr.value ? searchStr.value : '',
searchType: getIndustryValue(searchType.value)} });
searchType: getIndustryValue(searchType.value)
}
});
// window.open(`${import.meta.env.VITE_BASE_URL}repoList?softwareName=${searchStr.value ? searchStr.value : ''}&searchType=${getIndustryValue(searchType.value)}`, '_blank')
};
@@ -287,7 +310,6 @@ onBeforeUnmount(() => {
const getNoticeList = async () => {
const res: any = await getHomeNoticeList();
debugger
if (!res.error) {
infoList.value = res.data.data || [];
}

View File

@@ -78,6 +78,22 @@ const tagMap = {
low: {
text: '低',
color: '#5e7ce0'
},
Critical: {
text: '致命',
color: '#c7000b'
},
High: {
text: '高',
color: '#f66f6a'
},
Medium: {
text: '中',
color: '#fac20a'
},
Low: {
text: '低',
color: '#5e7ce0'
}
};
const mode = ref('readonly');