merge junjie_dev into master
fix: fix issue Created-by: user8949 Commit-by: @user8949 Merged-by: user8949 Description: fix: fix issue See merge request: hk_openRepo/OpenRepo_Portal!30
This commit is contained in:
@@ -72,9 +72,13 @@ export function getHomeNoticeList() {
|
||||
// 获取依赖关系列表
|
||||
export function getDepencyList(softwareId: string) {
|
||||
return request({
|
||||
url: '/api/v1/repo/release/info',
|
||||
method: 'get',
|
||||
params: { softwareId: 2 }
|
||||
url: '/api/v1/repo/dependency/info',
|
||||
method: 'POST',
|
||||
data: {
|
||||
softwareId: 47,
|
||||
current: 1,
|
||||
size: 20
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -82,7 +86,24 @@ export function getDepencyList(softwareId: string) {
|
||||
export function getRepairInfo() {
|
||||
return request({
|
||||
url: '/api/v1/repo/repair/info',
|
||||
method: 'get',
|
||||
params: {}
|
||||
method: 'POST',
|
||||
data: {
|
||||
"current": 1,
|
||||
"size": 10,
|
||||
"softwareId": 47
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取许可证列表
|
||||
export function getLicenseList() {
|
||||
return request({
|
||||
url: '/api/v1/repo/license/list',
|
||||
method: 'GET',
|
||||
params: {
|
||||
"current": 1,
|
||||
"size": 10,
|
||||
"softwareId": 47
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, defineEmits, defineProps, watch } from 'vue';
|
||||
import { searchLanguageList } from '@/api/jyh';
|
||||
const props = defineProps({
|
||||
layout: {
|
||||
type: String,
|
||||
@@ -100,32 +101,11 @@ const cancel = () => {
|
||||
emit('update:modelValue', formData.value);
|
||||
}
|
||||
|
||||
const getLanguageList = () => {
|
||||
const mockData = [
|
||||
{
|
||||
"key": "c++",
|
||||
"name": "C++"
|
||||
},
|
||||
{
|
||||
"key": "C",
|
||||
"name": "C"
|
||||
},
|
||||
{
|
||||
"key": "PYTHON",
|
||||
"name": "PYTHON"
|
||||
},
|
||||
{
|
||||
"key": "JAVA",
|
||||
"name": "JAVA"
|
||||
}
|
||||
]
|
||||
|
||||
languageList.value = mockData.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
value: item.key
|
||||
}
|
||||
})
|
||||
const getLanguageList = async() => {
|
||||
const res:any = await searchLanguageList();
|
||||
if (!res.error) {
|
||||
languageList.value = res.data.data;
|
||||
}
|
||||
}
|
||||
getLanguageList();
|
||||
</script>
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
import { ref } from 'vue';
|
||||
import Panel from '@/components/AIRepair/Panel.vue';
|
||||
import Table from '@/components/AIRepair/Table.vue';
|
||||
import { getRepairInfo } from '@/api/jyh';
|
||||
|
||||
const infoList = ref([
|
||||
'当前代码主要风险为易受常见的注入攻击,包括命令注入、SQL注入、表达式注入,针对每种攻击,应提供相应的防范措施,如数据校验、使用安全函数和限制程序权限。',
|
||||
@@ -200,6 +201,10 @@ const list = ref([
|
||||
}
|
||||
])
|
||||
|
||||
const getInfo = async() => {
|
||||
const res = await getRepairInfo();
|
||||
}
|
||||
getInfo();
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import SidePanel from '@/components/LicenseInfo/SidePanel.vue';
|
||||
import { getLicenseList } from '@/api/jyh';
|
||||
const pager = ref({
|
||||
pageIndex: 1,
|
||||
pageSize: 30,
|
||||
@@ -108,6 +109,11 @@ const list = ref([
|
||||
version: '4.4',
|
||||
}
|
||||
])
|
||||
|
||||
const getList = async() => {
|
||||
const res = await getLicenseList()
|
||||
}
|
||||
getList();
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
</div>
|
||||
<d-tabs class="jyh-tabs jyh-tabs-2" type="wrapped" v-model="selectTab">
|
||||
<d-tab id="bbxx" title="版本信息"></d-tab>
|
||||
<d-tab id="ylgx" title="依赖关系"></d-tab>
|
||||
<d-tab id="SBOM" title="SBOM"></d-tab>
|
||||
<d-tab id="ldxx" title="漏洞信息"></d-tab>
|
||||
<d-tab id="ai" title="AI修复建议"></d-tab>
|
||||
|
||||
Reference in New Issue
Block a user