update: 软件校验前端筛选

This commit is contained in:
@user8949
2025-03-18 22:27:36 +08:00
parent 9585479826
commit 7d6771cfcc

View File

@@ -20,13 +20,13 @@
<div class="tjsj">
<span style="height: 14px" class="split"></span>
<span>可使用</span>
<span class="green">3</span>
<span class="green" @click="filterVerifyResult(1)">3</span>
<span style="height: 14px" class="split"></span>
<span>有风险</span>
<span class="red">3</span>
<span class="red" @click="filterVerifyResult(2)">3</span>
<span style="height: 14px" class="split"></span>
<span>未治理</span>
<span class="yellow">3</span>
<span class="yellow" @click="filterVerifyResult(0)">3</span>
</div>
<div class="left-btn">
<a v-if="isLogin" class="cursor-pointer" href="/static/template.xlsx" download><i class="icon icon-download-2"></i>下载excel模板</a>
@@ -165,7 +165,7 @@ const userInfo = useAccountStore();
const { isLogin } = storeToRefs(userInfo);
const { namespace } = getOrgInfo();
const allTableData = ref([]);
const tableData = ref([]);
const columns = ref([
{ key: 'result', label: '校验结果', visible: true, filterable: true, sortable: false },
@@ -182,6 +182,7 @@ const typeOptions = reactive(['主软件', '依赖软件']);
const riskOptions = reactive(['低', '中', '高']);
const useTypeOptions = reactive(['软件', '文档', '文档+软件']);
const isUseOptions = reactive(['是', '否']);
const currentReusltFilter = ref(null);
// 定义 tableKey用于强制刷新表格
const tableKey = ref(0);
const pager = ref({
@@ -207,7 +208,8 @@ const getReleaseList = async() => {
const { data, error } = await releasePage({ current: pager.value.pageIndex,size: pager.value.pageSize });
if (!error && data) {
debugger
tableData.value = data.data.records;
allTableData.value = data.data.records;
tableData.value = [...allTableData.value]
pager.value.total = data.data.total;
}
};
@@ -216,6 +218,16 @@ onMounted(async() => {
getReleaseList();
});
const filterVerifyResult = (type) => {
if (currentReusltFilter.value === type) {
currentReusltFilter.value = null;
tableData.value = [...allTableData.value]
} else {
tableData.value = allTableData.value.filter(row => row.result === type);
currentReusltFilter.value = type;
}
}
const router = useRouter();