fix:添加D3预测结果
This commit is contained in:
parent
a0799da57f
commit
1a456b2b51
@ -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)
|
||||
|
||||
// 根据key值获取对应字段的值并判断是否应该添加active类
|
||||
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) || {}
|
||||
@ -382,3 +453,42 @@ onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</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>
|
||||
Loading…
x
Reference in New Issue
Block a user