fix: bugs

This commit is contained in:
汪少伟
2025-03-20 16:30:06 +08:00
parent 32e05115c2
commit 25f7823cd4
7 changed files with 101 additions and 99 deletions

View File

@@ -1,6 +1,6 @@
<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">
@@ -27,7 +27,12 @@
</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">
@@ -48,7 +53,7 @@
</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>

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

@@ -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

@@ -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>