aops-hermes/0001-Fix-the-issues-under-rpms.patch
wkl505997900 f03e4ff34d reslove repo and rpm set issues
(cherry picked from commit de30d8a9b543fc2af900c3b40c31cca91923dd07)
2023-09-19 20:46:39 +08:00

136 lines
4.6 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 75b27ec87339cb2b7d91a1d28fff8a1600825bf2 Mon Sep 17 00:00:00 2001
From: wkl505997900 <2313665567@qq.com>
Date: Tue, 19 Sep 2023 16:37:48 +0800
Subject: [PATCH] fix issue
---
src/views/leaks/components/CvesTable.vue | 78 ++++++++++++++----------
1 file changed, 47 insertions(+), 31 deletions(-)
diff --git a/src/views/leaks/components/CvesTable.vue b/src/views/leaks/components/CvesTable.vue
index d48c2fb..581ddd2 100644
--- a/src/views/leaks/components/CvesTable.vue
+++ b/src/views/leaks/components/CvesTable.vue
@@ -525,7 +525,9 @@ export default {
// 控制获取的cve是否被修复的变量默认为未修复
affected: true,
// 控制获取的cve是否受影响的变量默认为受影响
- rollback: false
+ rollback: false,
+ // 判断rpm二级列表是否有空值的变量
+ nullkey: 0
};
},
methods: {
@@ -727,6 +729,7 @@ export default {
} else {
this.selectedRowKeys = [];
this.innerselectedRowKeys = [];
+ this.innerCveList = [];
}
function setVal(list, arr) {
list.forEach(v => {
@@ -740,35 +743,46 @@ export default {
}
},
getChildCheck(id, val) {
- this.innerselectedRowKeys.push(this.fixed ? id + val.installed_rpm : id + val.available_rpm + val.installed_rpm)
- if (this.innerCveList.length !== 0) {
- const result = this.innerCveList.some(item => item.cve_id === id)
- if (result) {
- const target = this.innerCveList.find(item => item.cve_id === id)
- target.rpms.push({
- installed_rpm: val.installed_rpm,
- available_rpm: val.available_rpm,
- fix_way: val.support_way
- })
- } else {
- this.innerCveList.push({
- cve_id: id,
- rpms: [{
- installed_rpm: val.installed_rpm,
- available_rpm: val.available_rpm,
- fix_way: val.support_way
- }]
- })
- }
- } else {
- this.innerCveList.push({
- cve_id: id,
- rpms: [{
- installed_rpm: val.installed_rpm,
- available_rpm: val.available_rpm,
- fix_way: val.support_way
- }]
- })
+ // 重置nullkey
+ this.nullkey = 0
+ const _this = this
+ Object.keys(val).forEach(function(key) {
+ if (!val[key]) {
+ _this.nullkey++
+ }
+ });
+ if (this.nullkey === 0) {
+ // 若该行所有属性都不为null再执行添加勾选及判断操作
+ this.innerselectedRowKeys.push(this.fixed ? id + val.installed_rpm : id + val.available_rpm + val.installed_rpm)
+ if (this.innerCveList.length !== 0) {
+ const result = this.innerCveList.some(item => item.cve_id === id)
+ if (result) {
+ const target = this.innerCveList.find(item => item.cve_id === id)
+ target.rpms.push({
+ installed_rpm: val.installed_rpm,
+ available_rpm: val.available_rpm,
+ fix_way: val.support_way
+ })
+ } else {
+ this.innerCveList.push({
+ cve_id: id,
+ rpms: [{
+ installed_rpm: val.installed_rpm,
+ available_rpm: val.available_rpm,
+ fix_way: val.support_way
+ }]
+ })
+ }
+ } else {
+ this.innerCveList.push({
+ cve_id: id,
+ rpms: [{
+ installed_rpm: val.installed_rpm,
+ available_rpm: val.available_rpm,
+ fix_way: val.support_way
+ }]
+ })
+ }
}
},
getUncheck(id, val) {
@@ -990,12 +1004,14 @@ export default {
this.selectedRowsAll = [];
this.innerselectedRowKeys = [];
this.expandedRowKeys = [];
+ this.innerCveList = []
},
handleRefresh() {
this.selectedRowKeys = [];
this.selectedRowsAll = [];
this.innerselectedRowKeys = [];
this.expandedRowKeys = [];
+ this.innerCveList = []
// 重新请求界面, 收起展开状态
// this.innerCveList = [];
this.getCves();
@@ -1114,7 +1130,7 @@ export default {
}
this.getCves();
// 重新请求数据后重置列表
- this.expandedRowKeys = []
+ this.resetSelection()
},
handleTaskCreateSuccess() {
this.handleRefresh();
--
Gitee