fix:修改体彩报告页面

This commit is contained in:
lz-ui 2025-10-21 14:38:02 +08:00
parent 938c737e60
commit 2e50fff323

View File

@ -16,7 +16,7 @@
<span>赛事分析 {{ data && data.matchCode }}</span>
</div>
</template>
<div class="body">
<div class="body" v-if="isCustom">
<h3>1.比赛基础信息</h3>
<el-table v-loading="loading" :data="basicList" :show-header="false" border>
<el-table-column label="比赛编号" prop="name" :show-overflow-tooltip="true" />
@ -38,7 +38,14 @@
<el-table-column label="预测结果" width="220" prop="prediction" :show-overflow-tooltip="true" />
<el-table-column label="分析依据" prop="analysis" :show-overflow-tooltip="true" />
</el-table>
</div>
<div v-else class="body">
<MdPreview
ref="editorRef"
editorId="preview-only"
:modelValue="data.report"
class="maxkb-md"
/>
</div>
</el-card>
</el-col>
@ -52,6 +59,7 @@
<script setup name="EventAnalysisReportDetail">
import { detail } from '@/api/tc/eventAnalysisReport'
import MdPreview from '@/components/Markdown/MdPreview'
import { timerToStr } from '@/utils/timer'
import { computed } from 'vue'
const route = useRoute()
@ -72,6 +80,8 @@ const loading = ref(false)
const basicList = ref([])
const influencingList = ref([])
const coreList = ref([])
const skipType = ['HONG_F', 'HONG_B'] // md
const isCustom = computed(() => !skipType.includes(route.query.modelType)) // false: md true:
function getDetail() {
loading.value = true
@ -79,70 +89,76 @@ function getDetail() {
data.value = res.data
if (res.data.report) {
try {
const matchDateTime = timerToStr(res.data.matchInfo.matchDateTime, 'YYYY-MM-DD HH:mm')
const matchCode = res.data.matchCode
const report = JSON.parse(res.data.report)
const { keyFactors, matchInfo, predictions } = report
// 1.
basicList.value = [
{
name: "比赛编号",
value: matchCode
},
{
name: "主队",
value: matchInfo.homeTeam
},
{
name: "客队",
value: matchInfo.awayTeam
},
{
name: "时间",
value: matchDateTime
}
]
// 2.
influencingList.value = keyFactors
// 3.
coreList.value = [
{
"name": "最终赛果",
"key": "result_final",
"prediction": predictions.result_final.prediction,
"analysis": predictions.result_final.analysis
},
{
"name": "让球结果",
"key": "result_handicap",
"prediction": predictions.result_handicap.prediction,
"analysis": predictions.result_handicap.analysis
},
{
"name": "比分预测",
"key": "score_prediction",
"prediction": predictions.score_prediction.prediction,
"analysis": predictions.score_prediction.analysis
},
{
"name": "总进球数",
"key": "total_goals",
"prediction": predictions.total_goals.prediction,
"analysis": predictions.total_goals.analysis
},
{
"name": "半全场赛果",
"key": "half_full_time",
"prediction": predictions.half_full_time.prediction,
"analysis": predictions.half_full_time.analysis
},
{
"name": "亚洲盘口",
"key": "asian_handicap",
"prediction": predictions.asian_handicap.prediction,
"analysis": predictions.asian_handicap.analysis
},
]
if(isCustom.value) {
//
const matchDateTime = timerToStr(res.data.matchInfo.matchDateTime, 'YYYY-MM-DD HH:mm')
const matchCode = res.data.matchCode
const report = JSON.parse(res.data.report)
const { keyFactors, matchInfo, predictions } = report
// 1.
basicList.value = [
{
name: "比赛编号",
value: matchCode
},
{
name: "主队",
value: matchInfo.homeTeam
},
{
name: "客队",
value: matchInfo.awayTeam
},
{
name: "时间",
value: matchDateTime
}
]
// 2.
influencingList.value = keyFactors
// 3.
coreList.value = [
{
"name": "最终赛果",
"key": "result_final",
"prediction": predictions.result_final.prediction,
"analysis": predictions.result_final.analysis
},
{
"name": "让球结果",
"key": "result_handicap",
"prediction": predictions.result_handicap.prediction,
"analysis": predictions.result_handicap.analysis
},
{
"name": "比分预测",
"key": "score_prediction",
"prediction": predictions.score_prediction.prediction,
"analysis": predictions.score_prediction.analysis
},
{
"name": "总进球数",
"key": "total_goals",
"prediction": predictions.total_goals.prediction,
"analysis": predictions.total_goals.analysis
},
{
"name": "半全场赛果",
"key": "half_full_time",
"prediction": predictions.half_full_time.prediction,
"analysis": predictions.half_full_time.analysis
},
{
"name": "亚洲盘口",
"key": "asian_handicap",
"prediction": predictions.asian_handicap.prediction,
"analysis": predictions.asian_handicap.analysis
},
]
} else {
// md
}
} catch (error) {
console.log(error)
}