fix: 去掉表头排序及筛选

This commit is contained in:
汪少伟
2025-03-25 09:15:17 +08:00
parent 4c5d4c7113
commit 66764e4d73
7 changed files with 239 additions and 239 deletions

View File

@@ -1,7 +1,6 @@
<template>
<d-table :data="dataSource" @sort-change="handleSortChange" :header-bg="true">
<d-column v-for="(column, index) in props.tableConfig" :field="column.field"
:header="column.header" :sortable="column.sortable" :sort-method="column.sortMethod"></d-column>
<d-column v-for="(column, index) in props.tableConfig" :field="column.field" :header="column.header"></d-column>
</d-table>
</template>
@@ -12,15 +11,14 @@ export default defineComponent({
props: {
tableConfig: {
type: Array,
default: () => [],
default: () => []
},
dataSource: {
type: Array,
default: () => [],
},
default: () => []
}
},
setup(props) {
onMounted(() => {
console.log('props', props);
});
@@ -37,10 +35,8 @@ export default defineComponent({
};
return { props, handleSortChange, sortDateMethod, sortNameMethod };
},
}
});
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>

View File

@@ -1,21 +1,20 @@
<template>
<div class="secret-container">
<div class="mt-3 px-20">
<d-table :key="tableKey" class="jyh-table" v-if="tableData.length" :striped="false" :data="tableData" table-layout="auto">
<d-table
:key="tableKey"
class="jyh-table"
v-if="tableData.length"
:striped="false"
:data="tableData"
table-layout="auto"
>
<!-- 索引列 -->
<d-column type="index" width="40"></d-column>
<!-- 动态渲染列 -->
<template v-for="column in columns" :key="column.key">
<d-column
v-if="column.visible"
:field="column.key"
:header="column.label"
:filterable="column.filterable"
:filter-list="column.filterList"
:sortable="column.sortable"
@filter-change="handleFilterChange"
>
<d-column v-if="column.visible" :field="column.key" :header="column.label">
<!-- 自定义列内容 -->
<template #default="scope">
<template v-if="column.key === 'versionName'">
@@ -55,24 +54,32 @@
</template>
</d-table>
<DataPanel v-else skeleton :card="false" :empty="true">
</DataPanel>
<DataPanel v-else skeleton :card="false" :empty="true"> </DataPanel>
</div>
<div class="mt-20 mb-20 flex justify-end">
<d-pagination size="md" :page-size-options="[10, 20, 50]" :total="pager.total"
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()" />
<d-pagination
size="md"
:page-size-options="[10, 20, 50]"
:total="pager.total"
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>
</template>
<script setup lang="ts">
import AdvanceSearch from '@/components/AdvanceSearch/index.vue'
import AdvanceSearch from '@/components/AdvanceSearch/index.vue';
import SettingTitle from '@/components/Setting/SettingTitle/index.vue';
import SettingText from '@/components/Setting/SettingText/index.vue';
import { ref,reactive, onMounted } from 'vue';
import { ref, reactive, onMounted } from 'vue';
import { getGroupClaList, setGroupClaStatus, deleteGroupCla } from '@/api/cla';
import { useRouter, useRoute } from 'vue-router';
import { GModal } from '@/components/Setting/index';
@@ -110,7 +117,7 @@ const tableData = ref([
externalVulnerabilitySource: 'CVE-2025-1234',
versionDescription: '修复了若干安全漏洞',
compatibilityRisk: '低',
communityEOL: '2028-12-31',
communityEOL: '2028-12-31'
},
{
softwareName: 'react',
@@ -133,7 +140,7 @@ const tableData = ref([
externalVulnerabilitySource: 'CVE-2025-5678',
versionDescription: '新增了并发渲染功能',
compatibilityRisk: '中',
communityEOL: '2030-12-31',
communityEOL: '2030-12-31'
},
{
softwareName: 'vue',
@@ -156,7 +163,7 @@ const tableData = ref([
externalVulnerabilitySource: 'CVE-2025-9101',
versionDescription: '优化了性能',
compatibilityRisk: '低',
communityEOL: '2029-12-31',
communityEOL: '2029-12-31'
},
{
softwareName: 'webpack',
@@ -179,7 +186,7 @@ const tableData = ref([
externalVulnerabilitySource: 'CVE-2025-1122',
versionDescription: '修复了构建性能问题',
compatibilityRisk: '高',
communityEOL: '2027-12-31',
communityEOL: '2027-12-31'
},
{
softwareName: 'babel',
@@ -202,7 +209,7 @@ const tableData = ref([
externalVulnerabilitySource: 'CVE-2025-3344',
versionDescription: '新增了对新语法的支持',
compatibilityRisk: '中',
communityEOL: '2026-12-31',
communityEOL: '2026-12-31'
},
{
softwareName: 'typescript',
@@ -225,7 +232,7 @@ const tableData = ref([
externalVulnerabilitySource: '无',
versionDescription: '新增了装饰器功能',
compatibilityRisk: '低',
communityEOL: '2035-12-31',
communityEOL: '2035-12-31'
},
{
softwareName: 'jest',
@@ -248,7 +255,7 @@ const tableData = ref([
externalVulnerabilitySource: 'CVE-2025-5566',
versionDescription: '优化了测试性能',
compatibilityRisk: '中',
communityEOL: '2032-12-31',
communityEOL: '2032-12-31'
},
{
softwareName: 'docker',
@@ -271,7 +278,7 @@ const tableData = ref([
externalVulnerabilitySource: 'CVE-2025-7788',
versionDescription: '新增了对ARM架构的支持',
compatibilityRisk: '高',
communityEOL: '2030-12-31',
communityEOL: '2030-12-31'
},
{
softwareName: 'kubernetes',
@@ -294,7 +301,7 @@ const tableData = ref([
externalVulnerabilitySource: 'CVE-2025-9900',
versionDescription: '优化了集群管理功能',
compatibilityRisk: '高',
communityEOL: '2033-12-31',
communityEOL: '2033-12-31'
},
{
softwareName: 'postgresql',
@@ -317,10 +324,20 @@ const tableData = ref([
externalVulnerabilitySource: 'CVE-2025-1122',
versionDescription: '新增了JSONB索引功能',
compatibilityRisk: '低',
communityEOL: '2035-12-31',
},
communityEOL: '2035-12-31'
}
]);
const formData = ref({ title: '',type: '', useType: '',formData:'',select: '',time1:null,name:'',versionCode:'',pulishTime:'' });
const formData = ref({
title: '',
type: '',
useType: '',
formData: '',
select: '',
time1: null,
name: '',
versionCode: '',
pulishTime: ''
});
const typeOptions = reactive(['主软件', '依赖软件']);
const riskOptions = reactive(['低', '中', '高']);
const useTypeOptions = reactive(['软件', '文档', '文档+软件']);
@@ -332,7 +349,7 @@ const newFormData = ref({
dependentSoftware: '',
programmingLanguage: '',
dateRange: ['', '']
})
});
const pager = ref({
total: 10,
@@ -369,10 +386,16 @@ const columns = ref([
{ key: 'softwareScore', label: '软件评分', visible: false, filterable: false, sortable: true },
{ key: 'sourceCodeDownload', label: '源码包下载地址', visible: true, filterable: false, sortable: false },
{ key: 'copyright', label: 'Copyright', visible: false, filterable: false, sortable: false },
{ key: 'externalVulnerabilitySource', label: '外部漏洞源的软件名称', visible: false, filterable: true, sortable: false },
{
key: 'externalVulnerabilitySource',
label: '外部漏洞源的软件名称',
visible: false,
filterable: true,
sortable: false
},
{ key: 'versionDescription', label: '版本描述', visible: false, filterable: false, sortable: false },
{ key: 'compatibilityRisk', label: '兼容性风险描述', visible: false, filterable: false, sortable: false },
{ key: 'communityEOL', label: '社区EOL时间', visible: false, filterable: true, sortable: true },
{ key: 'communityEOL', label: '社区EOL时间', visible: false, filterable: true, sortable: true }
]);
// 定义 showColumnList 状态
@@ -482,7 +505,6 @@ onMounted(() => {
right: 0;
top: 0;
}
}
.error {
@@ -501,7 +523,7 @@ onMounted(() => {
font-size: 12px;
line-height: 16px;
margin-right: 8px;
border: 1px solid #E3E3EE;
border: 1px solid #e3e3ee;
}
.one-line {
@@ -544,7 +566,6 @@ onMounted(() => {
line-height: 22px;
letter-spacing: 0px;
text-align: left;
}
}