fix:添加D3预测结果

This commit is contained in:
lz-ui 2025-10-28 14:36:46 +08:00
parent a0799da57f
commit 1a456b2b51

View File

@ -135,7 +135,7 @@
</el-popover>
</template>
</el-table-column>
<el-table-column label="结果标记" align="center" class-name="small-padding fixed-width">
<el-table-column label="结果标记" align="center" class-name="small-padding fixed-width" width="280">
<template #default="scope">
<el-button
v-if="showBtn(scope.row, 'FINYX_F')"
@ -155,6 +155,38 @@
>D3-index</el-button>
</template>
</el-table-column>
<el-table-column label="D3预测结果" width="300" align="center">
<el-table-column label="常" width="50" align="center">
<template #default="scope">
<span :class="['icon-d3', tableColumnActive(scope.row, 'D3_F', 'resultFlag')]"></span>
</template>
</el-table-column>
<el-table-column label="让" width="50" align="center">
<template #default="scope">
<span :class="['icon-d3', tableColumnActive(scope.row, 'D3_F', 'hhadResultFlag')]"></span>
</template>
</el-table-column>
<el-table-column label="分" width="50" align="center">
<template #default="scope">
<span :class="['icon-d3', tableColumnActive(scope.row, 'D3_F', 'scoreResultFlag')]"></span>
</template>
</el-table-column>
<el-table-column label="总" width="50" align="center">
<template #default="scope">
<span :class="['icon-d3', tableColumnActive(scope.row, 'D3_F', 'goalsResultFlag')]"></span>
</template>
</el-table-column>
<el-table-column label="半" width="50" align="center">
<template #default="scope">
<span :class="['icon-d3', tableColumnActive(scope.row, 'D3_F', 'halfFullResultFlag')]"></span>
</template>
</el-table-column>
<el-table-column label="亚" width="50" align="center">
<template #default="scope">
<span :class="['icon-d3', tableColumnActive(scope.row, 'D3_F', 'asianHandicapFlag')]"></span>
</template>
</el-table-column>
</el-table-column>
</el-table>
<!-- 分页区域 -->
@ -228,6 +260,45 @@ const data = reactive({
const { queryParams } = toRefs(data)
function tableColumnActive(row, modelType, key) {
// row
if (!row || Object.keys(row).length === 0) {
return '';
}
// reportResults
if (!row.reportResults || !Array.isArray(row.reportResults)) {
return '';
}
// modelType
const reportData = row.reportResults.find(item => item.modelType === modelType);
//
if (!reportData) {
return '';
}
console.log(reportData)
// keyactive
const value = reportData[key];
if (value && value === '1') {
return 'table-column-active-1';
}
if (value && value === '0.5') {
return 'table-column-active-11';
}
if (value && value === '-1') {
return 'table-column-active-2';
}
if (value && value === '-0.5') {
return 'table-column-active-22';
}
return '4';
}
function rowPrediction(row, modelType) {
return row.reportResults && row.reportResults.find(el => el.modelType === modelType) || {}
@ -381,4 +452,43 @@ onMounted(() => {
//
getList()
})
</script>
</script>
<style scoped lang="scss">
.icon-d3 {
display: inline-block;
width: 20px;
height: 20px;
border-radius: 50%;
background-color: #fff;
border: 2px solid #3067EF;
box-sizing: border-box;
}
.table-column-active-1 {
background-color: #f56c6c;
border-color: #f56c6c;
}
.table-column-active-11 {
background-color: #f56c6c;
border-color: #f56c6c;
position: relative;
}
.table-column-active-11::after {
content: '';
display: block;
width: 20px;
height: 10px;
background-color: #fff;
position: absolute;
top: 50%;
left: -2px;
}
.table-column-active-2 {
background-color: #333;
border-color: #333;
}
.table-column-active-22 {
background-color: #333;
border-color: #333;
}
</style>