Merge branch 'master' of https://gitcode.com/hk_openRepo/OpenRepo_Portal into dev-shenjianbin

This commit is contained in:
MaxShen
2025-03-20 17:09:34 +08:00
12 changed files with 210 additions and 161 deletions

View File

@@ -20,6 +20,11 @@ export function releasePage(data): Promise<any> {
}); });
} }
// 导出校验结果
export function exportVerifyResult() {
}
// 获取邀请列表 // 获取邀请列表
export function getInviteListData(): catchRt<any> { export function getInviteListData(): catchRt<any> {
return reqCatchV2(() => return reqCatchV2(() =>

View File

@@ -1,58 +1,66 @@
<template> <template>
<div> <div>
<slot name="title"></slot> <!-- <slot name="title"></slot> -->
<d-form :layout="props.layout" :label-align="'end'"> <d-form :layout="props.layout" :label-align="'end'">
<d-row :gutter="16"> <d-row :gutter="16">
<d-col :span="8"> <d-col :span="8">
<d-form-item field="name" label="软件名称"> <d-form-item field="name" label="软件名称">
<d-input placeholder="请输入软件名称" v-model="formData.softwareName"/> <d-input placeholder="请输入软件名称" v-model="formData.softwareName" />
</d-form-item> </d-form-item>
</d-col> </d-col>
<d-col :span="8"> <d-col :span="8">
<d-form-item field="version" label="软件版本"> <d-form-item field="version" label="软件版本">
<d-input v-model="formData.softwareVersion"/> <d-input placeholder="请输入软件版本" v-model="formData.softwareVersion" />
</d-form-item> </d-form-item>
</d-col> </d-col>
<d-col :span="8"> <d-col :span="8">
<d-form-item field="license" label="license"> <d-form-item field="license" label="license">
<d-input placeholder="请输入license名称" v-model="formData.licenseName"/> <d-input placeholder="请输入license名称" v-model="formData.licenseName" />
</d-form-item> </d-form-item>
</d-col> </d-col>
</d-row> </d-row>
<d-row :gutter="16"> <d-row :gutter="16">
<d-col :span="8"> <d-col :span="8">
<d-form-item field="dependency" label="依赖软件名称"> <d-form-item field="dependency" label="依赖软件名称">
<d-input v-model="formData.dependentSoftware"/> <d-input placeholder="请输入依赖软件名称" v-model="formData.dependentSoftware" />
</d-form-item> </d-form-item>
</d-col> </d-col>
<d-col :span="8"> <d-col :span="8">
<d-form-item field="language" label="编程语言"> <d-form-item field="language" label="编程语言">
<d-select :options="languageList" v-model="formData.programmingLanguage"></d-select> <d-select
:options="languageList"
:allow-clear="true"
v-model="formData.programmingLanguage"
placeholder="请选择编程语言"
></d-select>
</d-form-item> </d-form-item>
</d-col> </d-col>
<d-col :span="8"> <d-col :span="8">
<d-form-item field="date" label="版本发布日期"> <d-form-item field="date" label="版本发布日期">
<d-range-date-picker-pro v-model="formData.dateRange" style="width: 100%;" <d-range-date-picker-pro
:placeholder="['开始日期', '结束日期']"/> v-model="formData.dateRange"
style="width: 100%"
:placeholder="['开始日期', '结束日期']"
/>
</d-form-item> </d-form-item>
</d-col> </d-col>
</d-row> </d-row>
<d-row :gutter="16"> <d-row :gutter="16">
<d-col :span="8"> <d-col :span="8">
<d-form-item field="interestTag" label="兴趣标签"> <d-form-item field="interestTag" label="兴趣标签">
<d-input v-model="formData.interestTag"/> <d-input placeholder="请输入兴趣标签" v-model="formData.interestTag" />
</d-form-item> </d-form-item>
</d-col> </d-col>
<d-col :span="8"> <d-col :span="8">
<d-form-item field="industry" label="行业"> <d-form-item field="industry" label="行业">
<d-input v-model="formData.industry"/> <d-input v-model="formData.industry" placeholder="请输入行业" />
</d-form-item> </d-form-item>
</d-col> </d-col>
</d-row> </d-row>
<slot name="operation"> <slot name="operation">
<gc-form-operation style="display: flex; justify-content: center; gap: 8px;"> <gc-form-operation style="display: flex; justify-content: center; gap: 8px">
<d-button style="width: 96px; height: 32px;" variant="solid" @click="submitForm">搜索</d-button> <d-button style="width: 96px; height: 32px" variant="solid" @click="submitForm">搜索</d-button>
<d-button style="width: 96px; height: 32px;" @click="cancel">取消</d-button> <d-button style="width: 96px; height: 32px" @click="cancel">取消</d-button>
</gc-form-operation> </gc-form-operation>
</slot> </slot>
</d-form> </d-form>
@@ -60,7 +68,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, defineEmits, defineProps, watch } from 'vue'; import { ref, defineEmits, defineProps, watch, onMounted } from 'vue';
import { searchLanguageList } from '@/api/jyh'; import { searchLanguageList } from '@/api/jyh';
const props = defineProps({ const props = defineProps({
layout: { layout: {
@@ -80,27 +88,36 @@ const props = defineProps({
dateRange: ['', ''] dateRange: ['', '']
}) })
} }
}) });
const emit = defineEmits(['submit', 'cancel', 'update:modelValue']); const emit = defineEmits(['submit', 'cancel', 'update:modelValue']);
const languageList = ref([]); const languageList = ref([]);
const formData = ref({...props.modelValue}); const formData = ref({ ...props.modelValue });
watch(() => props.modelValue, (newVal) => { watch(
if (JSON.stringify(newVal) !== JSON.stringify(formData.value)) { () => props.modelValue,
formData.value = {...newVal}; (newVal) => {
} if (JSON.stringify(newVal) !== JSON.stringify(formData.value)) {
}, { deep: true }); formData.value = { ...newVal };
}
},
{ deep: true }
);
watch(formData, (newVal) => { watch(
if (JSON.stringify(newVal) !== JSON.stringify(props.modelValue)) { formData,
emit('update:modelValue', {...newVal}); (newVal) => {
} if (JSON.stringify(newVal) !== JSON.stringify(props.modelValue)) {
}, { deep: true }); emit('update:modelValue', { ...newVal });
localStorage.setItem('searchForm', JSON.stringify(newVal));
}
},
{ deep: true }
);
const submitForm = () => { const submitForm = () => {
emit('submit', formData.value); emit('submit', formData.value);
} };
const cancel = () => { const cancel = () => {
formData.value = { formData.value = {
@@ -112,20 +129,25 @@ const cancel = () => {
interestTag: '', interestTag: '',
industry: '', industry: '',
dateRange: ['', ''] dateRange: ['', '']
} };
emit('cancel'); emit('cancel');
emit('update:modelValue', formData.value); emit('update:modelValue', formData.value);
} };
const getLanguageList = async() => { const getLanguageList = async () => {
const res:any = await searchLanguageList(); const res: any = await searchLanguageList();
if (!res.error) { if (!res.error) {
languageList.value = res.data.data; languageList.value = res.data.data;
} }
} };
getLanguageList(); getLanguageList();
onMounted(() => {
const _searchForm = localStorage.getItem('searchForm');
if (_searchForm) {
formData.value = JSON.parse(_searchForm);
}
});
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss"></style>
</style>

View File

@@ -60,7 +60,7 @@ const onCategoryChange = (event) => {
} }
const search = () => { const search = () => {
window.open(`/repoList?softwareName=${softwareName.value ? softwareName.value : ''}&searchType=${searchType.value}`, '_blank') window.open(`${import.meta.env.VITE_BASE_URL}repoList?softwareName=${softwareName.value ? softwareName.value : ''}&searchType=${searchType.value}`, '_blank')
}; };
const handleClear = () => { const handleClear = () => {

View File

@@ -807,7 +807,7 @@ $active-panel: var(--color-G800);
.login-modal { .login-modal {
box-sizing: border-box; box-sizing: border-box;
padding: 24px 28px 24px; padding: 24px 28px 24px;
width: 410px !important; width: 550px !important;
border-radius: 3px !important; border-radius: 3px !important;
.btn-close { .btn-close {
width: 12px !important; width: 12px !important;

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="bg-white w-full flex flex-col items-center py-[20px]"> <div class="bg-white w-full flex flex-col items-center py-[30px]">
<slot name="img"> <slot name="img">
<img <img
v-if="!hideImg && imgSrc" v-if="!hideImg && imgSrc"
@@ -8,23 +8,23 @@
:src="imgSrc" :src="imgSrc"
alt="NoData" alt="NoData"
/> />
<img <!-- <img
v-if="!hideImg && !small" v-if="!hideImg && !small"
class="block mb-[20px]" class="block mb-[20px]"
:width="imgWidth" :width="imgWidth"
src="/src/assets/imgs/jyh/nodata.svg" src="/src/assets/imgs/jyh/nodata.svg"
alt="NoData" alt="NoData"
/> /> -->
<img <img
v-if="!hideImg && small" v-if="!hideImg"
class="block mb-[20px]" class="block mb-[5px] w-[120px]"
:width="imgWidth" :width="imgWidth"
src="/src/assets/imgs/jyh/nodata_small.svg" src="/src/assets/imgs/jyh/nodata_small.svg"
alt="NoData" alt="NoData"
/> />
</slot> </slot>
<slot> <slot>
<div>没有查询到数据</div> <div class="text-gray-500">没有查询到数据</div>
</slot> </slot>
</div> </div>
</template> </template>

View File

@@ -41,14 +41,14 @@
</d-dropdown> </d-dropdown>
</template> </template>
<template #append> <template #append>
<div class="advanced-search" @click="openAdvancedSearch"> <div id="advancedSearch close-isopen" class="advanced-search" @click="openAdvancedSearch">
<span>高级筛选</span> <span class="close-isopen">高级筛选</span>
<d-badge :count="6" :bg-color="'#f0f0f0'"></d-badge> <d-badge :count="6" :bg-color="'#f0f0f0'" class="close-isopen"></d-badge>
<d-icon :rotate="rotate" name="icon-chevron-down-2"></d-icon> <d-icon class="close-isopen" :rotate="rotate" name="icon-chevron-down-2"></d-icon>
</div> </div>
</template> </template>
</d-input> </d-input>
<d-dropdown-menu v-model="isOpen" :origin="searchInput?.$el" :offset="offset"> <d-dropdown-menu v-model="isOpen" :origin="searchInput?.$el" :offset="offset" :clickOutside="closeOutside">
<div class="advanced-search-menu" :style="{ width: dropdownWidth + 'px' }"> <div class="advanced-search-menu" :style="{ width: dropdownWidth + 'px' }">
<AdvanceSearch @submit="submit($event)" @cancel="isOpen = false" class="p-20" :layout="'vertical'"> <AdvanceSearch @submit="submit($event)" @cancel="isOpen = false" class="p-20" :layout="'vertical'">
<template #title> <template #title>
@@ -59,7 +59,7 @@
</d-dropdown-menu> </d-dropdown-menu>
<d-button color="primary" variant="solid" @click="search">搜索</d-button> <d-button color="primary" variant="solid" @click="search">搜索</d-button>
</div> </div>
<d-button @click="check" ref="origin" icon="share" class="batch-btn">批量校验</d-button> <d-button v-if="isLogin" @click="check" ref="origin" icon="share" class="batch-btn">批量校验</d-button>
<div class="home-information"> <div class="home-information">
<div class="info-title"> <div class="info-title">
<div class="sub-title"> <div class="sub-title">
@@ -87,7 +87,9 @@
@click="openWarningDetail(item, index)" @click="openWarningDetail(item, index)"
> >
<span>{{ item.subject }}</span> <span>{{ item.subject }}</span>
<d-tag v-if="item.importance" :color="tagMap[item.importance].color" size="sm">{{ tagMap[item.importance].text }}</d-tag> <d-tag v-if="item.importance" :color="tagMap[item.importance].color" size="sm">{{
tagMap[item.importance].text
}}</d-tag>
</div> </div>
<div class="time-container"> <div class="time-container">
<d-icon name="icon-time"></d-icon> <d-icon name="icon-time"></d-icon>
@@ -111,7 +113,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, onBeforeUnmount } from 'vue'; import { ref, onMounted, onBeforeUnmount, computed } from 'vue';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { useAccount } from '@/utils/hooks/useAccount'; import { useAccount } from '@/utils/hooks/useAccount';
import AdvanceSearch from '@/components/AdvanceSearch/index.vue'; import AdvanceSearch from '@/components/AdvanceSearch/index.vue';
@@ -120,6 +122,7 @@ import EarlyWarningDetail from '@/views/Jyh/PersonalCenter/Detail/EarlyWarningDe
import { useGlobalInfoStore } from '@/stores/Global'; import { useGlobalInfoStore } from '@/stores/Global';
const { updateHeaderSearch } = useGlobalInfoStore(); const { updateHeaderSearch } = useGlobalInfoStore();
const { accountInfo } = useAccount(); const { accountInfo } = useAccount();
import { useDiscussGetUserInfo } from '@/api/discussion/hook';
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
@@ -132,38 +135,41 @@ const searchOptions = ref(['软件']);
const offset = ref({ mainAxis: 7, crossAxis: -10 }); const offset = ref({ mainAxis: 7, crossAxis: -10 });
const isKeepOpen = ref(true); const isKeepOpen = ref(true);
const isOpen = ref(false); const isOpen = ref(false);
const rotate = ref(0);
const cateRotate = ref(0); const cateRotate = ref(0);
const infoList = ref([]); const infoList = ref([]);
const warningModalVisable = ref(false); const warningModalVisable = ref(false);
const currentWarning = ref(); const currentWarning = ref();
const { isLogin } = useDiscussGetUserInfo()
const homeSearch = ref(null); const homeSearch = ref(null);
const dropdownWidth = ref(0); const dropdownWidth = ref(0);
const selectedCate = ref('软件'); const selectedCate = ref('软件');
const tagMap = { const tagMap = {
'Critical': { Critical: {
text: '致命', text: '致命',
color: '#c7000b' color: '#c7000b'
}, },
'High': { High: {
text: '高', text: '高',
color: '#f66f6a' color: '#f66f6a'
}, },
'Medium': { Medium: {
text: '中', text: '中',
color: '#fac20a' color: '#fac20a'
}, },
'Low': { Low: {
text: '低', text: '低',
color: '#5e7ce0' color: '#5e7ce0'
} }
} };
const rotate = computed(() => {
return isOpen.value ? 180 : 0;
});
const searchInput = ref(null); const searchInput = ref(null);
const openAdvancedSearch = () => { const openAdvancedSearch = () => {
isOpen.value = !isOpen.value; isOpen.value = !isOpen.value;
rotate.value = isOpen.value ? 180 : 0;
inputGlow.value = isOpen.value; inputGlow.value = isOpen.value;
}; };
@@ -198,7 +204,7 @@ const updateDropdownWidth = () => {
}; };
const search = () => { const search = () => {
updateHeaderSearch({ searchWord: searchStr.value, searchType: selectedCate.value }) updateHeaderSearch({ searchWord: searchStr.value, searchType: selectedCate.value });
router.push({ name: 'Search' }); router.push({ name: 'Search' });
}; };
@@ -236,6 +242,17 @@ onMounted(() => {
} }
updateDropdownWidth(); updateDropdownWidth();
document.querySelector('body').onclick = (e) => {
const className = e.target.className;
if (
!className.includes('close-isopen') &&
!className.includes('devui-badge__content') &&
!className.includes('advanced-search')
) {
isOpen.value = false;
}
};
}); });
onBeforeUnmount(() => { onBeforeUnmount(() => {

View File

@@ -3,13 +3,18 @@
<div class="license-info-content"> <div class="license-info-content">
<d-layout> <d-layout>
<d-content class="dcontent"> <d-content class="dcontent">
<d-table class="jyh-table" v-if="list.length>0" :data="list" style="width: 100%;"> <d-table class="jyh-table" v-if="list.length > 0" :data="list" style="width: 100%">
<template #empty> <template #empty>
<NoData></NoData> <NoData></NoData>
</template> </template>
<d-column type="index" width="40"></d-column> <d-column type="index" width="40"></d-column>
<d-column v-for="(column, index) in tableConfig" :field="column.field" <d-column
:header="column.header" :sortable="column.sortable" :sort-method="column.sortMethod"></d-column> v-for="(column, index) in tableConfig"
:field="column.field"
:header="column.header"
:sortable="column.sortable"
:sort-method="column.sortMethod"
></d-column>
<d-column header="详情" width="100px"> <d-column header="详情" width="100px">
<template #default="scope"> <template #default="scope">
<a class="devui-link" @click="openPanel(scope.row)">查看</a> <a class="devui-link" @click="openPanel(scope.row)">查看</a>
@@ -20,7 +25,7 @@
</d-content> </d-content>
</d-layout> </d-layout>
</div> </div>
<div class="license-info-container-page"> <div class="license-info-container-page" v-if="list.length > 0">
<d-pagination <d-pagination
size="sm" size="sm"
:total="pager.total" :total="pager.total"
@@ -33,8 +38,8 @@
/> />
</div> </div>
</div> </div>
<d-drawer v-model="showDetail" style="width: 800px; padding: 20px" > <d-drawer v-model="showDetail" style="width: 800px; padding: 20px">
<SidePanel :data="currentData" @close="close"/> <SidePanel :data="currentData" @close="close" />
</d-drawer> </d-drawer>
</template> </template>
@@ -48,20 +53,18 @@ const pager = ref({
pageIndex: 1, pageIndex: 1,
pageSize: 30, pageSize: 30,
total: 10 total: 10
}) });
const pageOptions = ref({ const pageOptions = ref({});
})
const showDetail = ref(false); const showDetail = ref(false);
const close = () => { const close = () => {
showDetail.value = false; showDetail.value = false;
} };
const openPanel = (row) => { const openPanel = (row) => {
currentData.value = row currentData.value = row;
showDetail.value = true; showDetail.value = true;
} };
const tableConfig = ref([ const tableConfig = ref([
{ {
@@ -88,7 +91,7 @@ const tableConfig = ref([
sortable: true, sortable: true,
sortMethod: null sortMethod: null
} }
]) ]);
const list = ref([ const list = ref([
// { // {
@@ -115,9 +118,9 @@ const list = ref([
// affectedComponent: 'org.apache.commons:commons-collections4', // affectedComponent: 'org.apache.commons:commons-collections4',
// version: '4.4', // version: '4.4',
// } // }
]) ]);
const getList = async() => { const getList = async () => {
const res: any = await getLicenseList(); const res: any = await getLicenseList();
if (!res.error) { if (!res.error) {
console.log(res); console.log(res);
@@ -126,12 +129,11 @@ const getList = async() => {
} else { } else {
list.value = []; list.value = [];
} }
} };
getList(); getList();
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.license-info-container { .license-info-container {
display: flex; display: flex;
gap: 12px; gap: 12px;
@@ -159,7 +161,7 @@ getList();
.dfooter { .dfooter {
display: flex; display: flex;
justify-content: end; justify-content: end;
margin-top: 20px margin-top: 20px;
} }
.operation { .operation {

View File

@@ -1,7 +1,7 @@
<template> <template>
<Card simple class="jyh-card mt-3"> <Card simple class="jyh-card mt-3">
<div class="mb-3"> <div class="mb-3">
<d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData"> <d-table v-if="tableData.length > 0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="updateTime" header="时间"> <d-column field="updateTime" header="时间">
<template #default="scope"> <template #default="scope">
<span>{{ formatTime(scope.row.updateTime, 'YYYY-MM-DD') }}</span> <span>{{ formatTime(scope.row.updateTime, 'YYYY-MM-DD') }}</span>
@@ -14,19 +14,19 @@
</d-column> </d-column>
<d-column field="alertMsg" header="详情"> <d-column field="alertMsg" header="详情">
<template #default="scope"> <template #default="scope">
<span>{{ JSON.parse(scope.row.alertMsg)?.overview || ''}}</span> <span>{{ JSON.parse(scope.row.alertMsg)?.overview || '' }}</span>
</template> </template>
</d-column> </d-column>
<d-column field="level" header="级别"> <d-column field="level" header="级别">
<template #default="scope"> <template #default="scope">
<d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '高'" type="error"> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '高'" type="error">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}} {{ JSON.parse(scope.row.alertMsg)?.importance || '' }}
</d-status> </d-status>
<d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '中'" type="warning"> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '中'" type="warning">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}} {{ JSON.parse(scope.row.alertMsg)?.importance || '' }}
</d-status> </d-status>
<d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '低'" class="yellow-status"> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '低'" class="yellow-status">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}} {{ JSON.parse(scope.row.alertMsg)?.importance || '' }}
</d-status> </d-status>
<!-- <d-status v-if="scope.row.importance === 1" type="running">提示</d-status>--> <!-- <d-status v-if="scope.row.importance === 1" type="running">提示</d-status>-->
</template> </template>
@@ -41,14 +41,21 @@
<NoData v-else :small="false"></NoData> <NoData v-else :small="false"></NoData>
</div> </div>
<div class="mt-20 mb-20 flex justify-end" v-if="tableData.length > 0">
<div class="mt-20 mb-20 flex justify-end"> <d-pagination
<d-pagination size="md" :page-size-options="[10, 20, 50]" :total="pager.total" size="md"
v-model:pageSize="pager.pageSize" v-model:pageIndex="pager.pageIndex" :max-items="5" :page-size-options="[10, 20, 50]"
:can-change-page-size="true" :can-view-total="true" total-item-text="总计" @page-index-change="changeIndex()" :total="pager.total"
@page-size-change="changeSize()" /> v-model:pageSize="pager.pageSize"
v-model:pageIndex="pager.pageIndex"
:max-items="5"
:can-change-page-size="true"
:can-view-total="true"
total-item-text="总计"
@page-index-change="changeIndex()"
@page-size-change="changeSize()"
/>
</div> </div>
</Card> </Card>
<d-modal class="warning-modal" v-model="warningModalVisable" title=""> <d-modal class="warning-modal" v-model="warningModalVisable" title="">
@@ -59,7 +66,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import EarlyWarningDetail from '@/views/Jyh/PersonalCenter/Detail/EarlyWarningDetail.vue'; import EarlyWarningDetail from '@/views/Jyh/PersonalCenter/Detail/EarlyWarningDetail.vue';
import NoData from "@/components/NoData/NoData.vue"; import NoData from '@/components/NoData/NoData.vue';
import { getgroupNoticeList, getNoticeList } from '@/api/jyh'; import { getgroupNoticeList, getNoticeList } from '@/api/jyh';
const tableData = ref([ const tableData = ref([
@@ -83,19 +90,17 @@ const colseWarningDetail = () => {
warningModalVisable.value = false; warningModalVisable.value = false;
}; };
const getList = async() => { const getList = async () => {
const { data, error } = await getgroupNoticeList({ current: 1,size: pager.value.pageSize }); const { data, error } = await getgroupNoticeList({ current: 1, size: pager.value.pageSize });
if (!error && data) { if (!error && data) {
tableData.value = data.data.data.records; tableData.value = data.data.data.records;
pager.value.total = data.data.data.total; pager.value.total = data.data.data.total;
} }
}; };
onMounted(async() => { onMounted(async () => {
getList(); getList();
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -1,7 +1,7 @@
<template> <template>
<Card simple class="jyh-card mt-3"> <Card simple class="jyh-card mt-3">
<div class="mb-3"> <div class="mb-3">
<d-table v-if="tableData.length>0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData"> <d-table v-if="tableData.length > 0" class="jyh-table jyh-table-2" :header-bg="true" :data="tableData">
<d-column field="updateTime" header="时间"></d-column> <d-column field="updateTime" header="时间"></d-column>
<d-column field="name" header="标题"> <d-column field="name" header="标题">
<template #default="scope"> <template #default="scope">
@@ -10,21 +10,21 @@
</d-column> </d-column>
<d-column field="alertMsg" header="详情"> <d-column field="alertMsg" header="详情">
<template #default="scope"> <template #default="scope">
<span>{{ JSON.parse(scope.row.alertMsg)?.overview || ''}}</span> <span>{{ JSON.parse(scope.row.alertMsg)?.overview || '' }}</span>
</template> </template>
</d-column> </d-column>
<d-column field="level" header="级别"> <d-column field="level" header="级别">
<template #default="scope"> <template #default="scope">
<d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '高'" type="error"> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '高'" type="error">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}} {{ JSON.parse(scope.row.alertMsg)?.importance || '' }}
</d-status> </d-status>
<d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '中'" type="warning"> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '中'" type="warning">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}} {{ JSON.parse(scope.row.alertMsg)?.importance || '' }}
</d-status> </d-status>
<d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '低'" class="yellow-status"> <d-status v-if="JSON.parse(scope.row.alertMsg)?.importance === '低'" class="yellow-status">
{{ JSON.parse(scope.row.alertMsg)?.importance || ''}} {{ JSON.parse(scope.row.alertMsg)?.importance || '' }}
</d-status> </d-status>
<!-- <d-status v-if="scope.row.importance === 1" type="running">提示</d-status>--> <!-- <d-status v-if="scope.row.importance === 1" type="running">提示</d-status>-->
</template> </template>
</d-column> </d-column>
<d-column field="status" header="状态"> <d-column field="status" header="状态">
@@ -37,14 +37,21 @@
<NoData v-else :small="false"></NoData> <NoData v-else :small="false"></NoData>
</div> </div>
<div class="mt-20 mb-20 flex justify-end" v-if="tableData.length > 0">
<div class="mt-20 mb-20 flex justify-end"> <d-pagination
<d-pagination size="md" :page-size-options="[10, 20, 50]" :total="pager.total" size="md"
v-model:pageSize="pager.pageSize" v-model:pageIndex="pager.pageIndex" :max-items="5" :page-size-options="[10, 20, 50]"
:can-change-page-size="true" :can-view-total="true" total-item-text="总计" @page-index-change="changeIndex()" :total="pager.total"
@page-size-change="changeSize()" /> v-model:pageSize="pager.pageSize"
v-model:pageIndex="pager.pageIndex"
:max-items="5"
:can-change-page-size="true"
:can-view-total="true"
total-item-text="总计"
@page-index-change="changeIndex()"
@page-size-change="changeSize()"
/>
</div> </div>
</Card> </Card>
<d-modal class="warning-modal" v-model="warningModalVisable" title=""> <d-modal class="warning-modal" v-model="warningModalVisable" title="">
@@ -55,7 +62,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import EarlyWarningDetail from '@/views/Jyh/PersonalCenter/Detail/EarlyWarningDetail.vue'; import EarlyWarningDetail from '@/views/Jyh/PersonalCenter/Detail/EarlyWarningDetail.vue';
import NoData from "@/components/NoData/NoData.vue"; import NoData from '@/components/NoData/NoData.vue';
import { getNoticeList } from '@/api/jyh'; import { getNoticeList } from '@/api/jyh';
const tableData = ref([ const tableData = ref([
@@ -79,19 +86,17 @@ const colseWarningDetail = () => {
warningModalVisable.value = false; warningModalVisable.value = false;
}; };
const getList = async() => { const getList = async () => {
const { data, error } = await getNoticeList({ current: 1,size: pager.value.pageSize }); const { data, error } = await getNoticeList({ current: 1, size: pager.value.pageSize });
if (!error && data) { if (!error && data) {
tableData.value = data.data.data.records; tableData.value = data.data.data.records;
pager.value.total = data.data.data.total; pager.value.total = data.data.data.total;
} }
}; };
onMounted(async() => { onMounted(async () => {
getList(); getList();
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -2,40 +2,25 @@
<div class="invitation-notice-container"> <div class="invitation-notice-container">
<Card simple class="jyh-card mt-3"> <Card simple class="jyh-card mt-3">
<div class="mt-3"> <div class="mt-3">
<d-table <d-table class="jyh-table jyh-table-2" :header-bg="true" :data="noticeTableData">
class="jyh-table jyh-table-2"
:header-bg="true"
:data="noticeTableData"
>
<d-column field="content" header="邀请内容" show-overflow-tooltip></d-column> <d-column field="content" header="邀请内容" show-overflow-tooltip></d-column>
<d-column field="createTime" header="邀请时间" width="200" show-overflow-tooltip></d-column> <d-column field="createTime" header="邀请时间" width="200" show-overflow-tooltip></d-column>
<d-column field="createUser" header="邀请人" width="180" show-overflow-tooltip></d-column> <d-column field="createUser" header="邀请人" width="180" show-overflow-tooltip></d-column>
<d-column header="操作" width="150"> <d-column header="操作" width="150">
<template #default="scope"> <template #default="scope">
<d-button <d-button variant="text" color="primary" class="mr-2" @click="handleAccept(scope.row, 1)">
variant="text"
color="primary"
class="mr-2"
@click="handleAccept(scope.row, 1)"
>
接收 接收
</d-button> </d-button>
<d-button <d-button variant="text" color="primary" @click="handleAccept(scope.row, -1)"> 拒绝 </d-button>
variant="text"
color="primary"
@click="handleAccept(scope.row, -1)"
>
拒绝
</d-button>
</template> </template>
</d-column> </d-column>
<template #empty> <template #empty>
<NoData /> <NoData />
</template> </template>
</d-table> </d-table>
<div class="invitation-pagination"> <div class="invitation-pagination" v-if="noticeTableData.length > 0">
<d-pagination <d-pagination
style="display: inline-flex;" style="display: inline-flex"
:total="pager.total" :total="pager.total"
v-model:pageSize="pager.pageSize" v-model:pageSize="pager.pageSize"
v-model:pageIndex="pager.pageIndex" v-model:pageIndex="pager.pageIndex"
@@ -53,30 +38,30 @@
<script setup lang="ts"> <script setup lang="ts">
import { acceptInvite, getInviteListData } from '@/api/jyh'; import { acceptInvite, getInviteListData } from '@/api/jyh';
import { ref, shallowReactive } from 'vue'; import { ref, shallowReactive } from 'vue';
import NoData from "@/components/NoData/NoData.vue"; import NoData from '@/components/NoData/NoData.vue';
import { Message } from 'vue-devui'; import { Message } from 'vue-devui';
import dayjs from "dayjs"; import dayjs from 'dayjs';
const noticeTableData = ref([]); const noticeTableData = ref([]);
const pager = shallowReactive({ const pager = shallowReactive({
total: 0, total: 0,
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
pageSizeOptions: [10, 20, 30, 40, 50], pageSizeOptions: [10, 20, 30, 40, 50]
}); });
const queryInviteListData = async () => { const queryInviteListData = async () => {
const data = await getInviteListData(); const data = await getInviteListData();
console.log(data) console.log(data);
if (!data?.data?.data?.data) { if (!data?.data?.data?.data) {
pager.total = 0; pager.total = 0;
return; return;
} }
noticeTableData.value = data.data.data.data.map(item => { noticeTableData.value = data.data.data.data.map((item) => {
return { return {
...item, ...item,
content: `尊敬的用户,您好!为更好地整合资源、协同开发,现诚邀您加入组织【${item.name}】。`, content: `尊敬的用户,您好!为更好地整合资源、协同开发,现诚邀您加入组织【${item.name}】。`,
createTime: dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss'), createTime: dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss')
} };
}); });
pager.total = data.data.data.data.length; pager.total = data.data.data.data.length;
}; };
@@ -84,18 +69,18 @@ queryInviteListData();
const handleAccept = async (row, type) => { const handleAccept = async (row, type) => {
const data = await acceptInvite({ const data = await acceptInvite({
groupId: row.groupId, groupId: row.groupId,
status: type, status: type
}); });
if (data?.data?.data?.data) { if (data?.data?.data?.data) {
Message({ Message({
type: 'success', type: 'success',
message: '成功接受', message: '成功接受'
}); });
queryInviteListData(); queryInviteListData();
} else { } else {
Message({ Message({
type: 'error', type: 'error',
message: '接受失败', message: '接受失败'
}); });
} }
}; };

View File

@@ -31,13 +31,13 @@
<div class="left-btn"> <div class="left-btn">
<a v-if="isLogin" class="cursor-pointer" href="/static/软件存在及可信校验模版.xlsx" download><i class="icon icon-download-2"></i>下载excel模板</a> <a v-if="isLogin" class="cursor-pointer" href="/static/软件存在及可信校验模版.xlsx" download><i class="icon icon-download-2"></i>下载excel模板</a>
<span v-if="isLogin" style="height: 14px" class="split"></span> <span v-if="isLogin" style="height: 14px" class="split"></span>
<d-button v-if="isLogin" class="output-btn" icon="icon-share" variant="text">导出</d-button> <d-button v-if="isLogin" class="output-btn" icon="icon-share" variant="text" @click="exportResult">导出</d-button>
<span v-if="isLogin" style="height: 14px" class="split"></span> <span v-if="isLogin" style="height: 14px" class="split"></span>
<TableSetting :columns="columns" :show-column-list="showColumnList" @update:show-column-list="updateShowColumnList"/> <TableSetting :columns="columns" :show-column-list="showColumnList" @update:show-column-list="updateShowColumnList"/>
</div> </div>
</div> </div>
<div class="mt-3 px-20"> <div class="mt-3 px-20">
<d-table class="jyh-table" v-if="tableData.length" :striped="false" :data="tableData" table-layout="auto"> <d-table class="jyh-table" v-if="tableData.length" :striped="false" :data="tableData" table-layout="auto" :show-loading="loading">
<!-- 索引列 --> <!-- 索引列 -->
<d-column type="index" width="40"></d-column> <d-column type="index" width="40"></d-column>
@@ -150,7 +150,7 @@ import { useAccountStore } from '@/stores/user';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import TableSetting from '@/components/TableSetting/index.vue'; import TableSetting from '@/components/TableSetting/index.vue';
import FileUploadButton from '@/components/FileUploadButton/index.vue'; import FileUploadButton from '@/components/FileUploadButton/index.vue';
import { releasePage, repoImport } from '@/api/jyh'; import { releasePage, repoImport, exportVerifyResult } from '@/api/jyh';
import NoData from "@/components/NoData/NoData.vue"; import NoData from "@/components/NoData/NoData.vue";
const useNum = computed(() => { const useNum = computed(() => {
@@ -201,6 +201,7 @@ const { isLogin } = storeToRefs(userInfo);
const { namespace } = getOrgInfo(); const { namespace } = getOrgInfo();
const allTableData = ref([]); const allTableData = ref([]);
const tableData = ref([]); const tableData = ref([]);
const loading = ref(false);
const columns = ref([ const columns = ref([
{ key: 'validStatus', label: '校验结果', visible: true, filterable: true, sortable: false }, { key: 'validStatus', label: '校验结果', visible: true, filterable: true, sortable: false },
{ key: 'softwareName', label: '软件名称', visible: true, filterable: true, sortable: false }, { key: 'softwareName', label: '软件名称', visible: true, filterable: true, sortable: false },
@@ -242,17 +243,20 @@ const getReleaseList = async() => {
if (!isLogin.value) { if (!isLogin.value) {
return; return;
} }
loading.value = true;
const { data, error } = await releasePage({ current: pager.value.pageIndex,size: pager.value.pageSize }); const { data, error } = await releasePage({ current: pager.value.pageIndex,size: pager.value.pageSize });
if (!error && data) { if (!error && data) {
debugger loading.value = false;
allTableData.value = data.data.records; allTableData.value = data.data.records;
tableData.value = [...allTableData.value] tableData.value = [...allTableData.value]
pager.value.total = data.data.total; pager.value.total = data.data.total;
} else {
loading.value = false;
} }
}; };
onMounted(async() => { onMounted(async() => {
getReleaseList(); // getReleaseList();
}); });
const filterVerifyResult = (type) => { const filterVerifyResult = (type) => {
@@ -285,6 +289,10 @@ const handleBatchImport = async() => { // 多个项目导入
loadingStatus.batchMigrating = false; loadingStatus.batchMigrating = false;
}; };
const exportResult = async() => {
}
// 跳转 // 跳转
const gotoDetail = (row) => { const gotoDetail = (row) => {
/*TODO:如果是可使用、有风险的,点击软件版本,可跳转到软件详情页面;如果是未治理的,无法跳转*/ /*TODO:如果是可使用、有风险的,点击软件版本,可跳转到软件详情页面;如果是未治理的,无法跳转*/
@@ -297,12 +305,12 @@ const gotoDetail = (row) => {
}; };
// 分页 // 分页
const changeIndex = () => { const changeIndex = () => {
// getGroupClaListData(); getReleaseList();
}; };
const changeSize = () => { const changeSize = () => {
pager.value.pageIndex = 1; pager.value.pageIndex = 1;
// getGroupClaListData(); getReleaseList();
}; };
const repoFun = (arr: any) => { const repoFun = (arr: any) => {

View File

@@ -1,7 +1,7 @@
<template> <template>
<div class="soft-detail-container"> <div class="soft-detail-container">
<div class="mt-3"> <div class="mt-3">
<d-table class="jyh-table" v-if="tableData.length>0" :striped="false" :data="tableData" table-layout="auto"> <d-table class="jyh-table" v-if="tableData.length > 0" :striped="false" :data="tableData" table-layout="auto">
<d-column type="index" width="40"></d-column> <d-column type="index" width="40"></d-column>
<d-column field="vulnId" header="编码" filterable :filter-list="filterList" @filter-change="handleFilterChange"> <d-column field="vulnId" header="编码" filterable :filter-list="filterList" @filter-change="handleFilterChange">
<template #default="scope"> <template #default="scope">
@@ -69,7 +69,7 @@
<NoData v-else :small="false"></NoData> <NoData v-else :small="false"></NoData>
</div> </div>
<div class="mt-20 mb-20 flex justify-end"> <div class="mt-20 mb-20 flex justify-end" v-if="tableData.length > 0">
<d-pagination <d-pagination
size="md" size="md"
:page-size-options="[10, 20, 50]" :page-size-options="[10, 20, 50]"
@@ -95,7 +95,7 @@
confirmColor="danger" confirmColor="danger"
> >
<span class="inline-block text-G900 text-sm font-normal leading-[20px] break-all" <span class="inline-block text-G900 text-sm font-normal leading-[20px] break-all"
>你确认删除此项{{ item.cla_name }} </span >你确认删除此项{{ item.cla_name }} </span
> >
</GModal> </GModal>
@@ -110,7 +110,7 @@
import * as dayjs from 'dayjs'; import * as dayjs from 'dayjs';
import SettingTitle from '@/components/Setting/SettingTitle/index.vue'; import SettingTitle from '@/components/Setting/SettingTitle/index.vue';
import SettingText from '@/components/Setting/SettingText/index.vue'; import SettingText from '@/components/Setting/SettingText/index.vue';
import { ref, reactive, onMounted,defineProps } from 'vue'; import { ref, reactive, onMounted, defineProps } from 'vue';
import { getGroupClaList, setGroupClaStatus, deleteGroupCla } from '@/api/cla'; import { getGroupClaList, setGroupClaStatus, deleteGroupCla } from '@/api/cla';
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { GModal } from '@/components/Setting/index'; import { GModal } from '@/components/Setting/index';
@@ -238,17 +238,17 @@ const fetchVulnList = async () => {
softwareId: propsData.versionId, softwareId: propsData.versionId,
componentId: '', componentId: '',
current: pager.value.pageIndex, current: pager.value.pageIndex,
size: pager.value.pageSize, size: pager.value.pageSize
}); });
if(data.data.code===200) { if (data.data.code === 200) {
tableData.value = data?.data?.data?.records || []; tableData.value = data?.data?.data?.records || [];
pager.value.total = data?.data?.data?.total || []; pager.value.total = data?.data?.data?.total || [];
} }
} };
const valLists = ref([]); const valLists = ref([]);
onMounted( () => { onMounted(() => {
fetchVulnList() fetchVulnList();
}); });
</script> </script>