fix:修改详情页面

This commit is contained in:
lz-ui 2025-10-16 14:08:27 +08:00
parent bfc669d3e2
commit c00bca445a
3 changed files with 149 additions and 84 deletions

View File

@ -17,7 +17,7 @@
},
"dependencies": {
"@element-plus/icons-vue": "2.3.1",
"@lzui/lzui-lib": "0.1.0-alpha5",
"@lzui/lzui-lib": "0.1.0-alpha7",
"@vavt/cm-extension": "^1.11.0",
"@vueup/vue-quill": "1.2.0",
"@vueuse/core": "13.3.0",

10
pnpm-lock.yaml generated
View File

@ -12,8 +12,8 @@ importers:
specifier: 2.3.1
version: 2.3.1(vue@3.5.16)
'@lzui/lzui-lib':
specifier: 0.1.0-alpha5
version: 0.1.0-alpha5
specifier: 0.1.0-alpha7
version: 0.1.0-alpha7
'@vavt/cm-extension':
specifier: ^1.11.0
version: 1.11.0
@ -508,8 +508,8 @@ packages:
'@lezer/yaml@1.0.3':
resolution: {integrity: sha512-GuBLekbw9jDBDhGur82nuwkxKQ+a3W5H0GfaAthDXcAu+XdpS43VlnxA9E9hllkpSP5ellRDKjLLj7Lu9Wr6xA==}
'@lzui/lzui-lib@0.1.0-alpha5':
resolution: {integrity: sha512-UYzSZfAodaS0p+1C3LSaPbRdig28N6KnLMaXh1hAmBuo4Am/l1qh1xKbR5l3Rfmq47nG+m1IsSVq4ArxZNQ6Cg==}
'@lzui/lzui-lib@0.1.0-alpha7':
resolution: {integrity: sha512-/7lysNASteH/SnUb1n4ZQUuWqFrgGVhu8Wj2wF2+jClriuKViD2s9Fo24uHMErF2DG3FKrVpEayiFDth79WV5Q==}
'@marijn/find-cluster-break@1.0.2':
resolution: {integrity: sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==}
@ -3595,7 +3595,7 @@ snapshots:
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
'@lzui/lzui-lib@0.1.0-alpha5':
'@lzui/lzui-lib@0.1.0-alpha7':
dependencies:
vue: 3.5.16
transitivePeerDependencies:

View File

@ -7,23 +7,16 @@
</el-icon>
{{ data && data.reportTime && timerToStr(data.reportTime, 'YYYY-MM-DD HH:mm:ss') }}
</div>
<el-row :gutter="20" v-if="!loading && data && data.report" >
<el-row :gutter="20" v-if="!loading && data && data.report && isJson">
<el-col :xs="24" :sm="24" :md="24" :lg="24">
<el-card class="update-log" >
<el-card class="update-log">
<template v-slot:header>
<div class="clearfix">
<span>赛事分析 {{ data && data.matchCode }}</span>
</div>
</template>
<div class="body">
<!-- <MdPreview
ref="editorRef"
editorId="preview-only"
:modelValue="data.report"
class="maxkb-md"
/> -->
<h3>1.比赛基础信息</h3>
<el-table v-loading="loading" :data="basicList" :show-header="false" border>
<el-table-column label="比赛编号" prop="name" :show-overflow-tooltip="true" />
@ -32,8 +25,8 @@
<h3 class="mt-20">2.关键影响因素</h3>
<el-table v-loading="loading" :data="influencingList" :show-header="false" border>
<el-table-column :show-overflow-tooltip="true" >
<template v-slot="{row}">
<el-table-column :show-overflow-tooltip="true">
<template v-slot="{ row }">
{{ row }}
</template>
</el-table-column>
@ -45,18 +38,13 @@
<el-table-column label="预测结果" prop="prediction" :show-overflow-tooltip="true" />
<el-table-column label="分析依据" prop="analysis" :show-overflow-tooltip="true" />
</el-table>
</div>
</el-card>
</el-col>
</el-row>
<lz-page-empty
v-else
:type="'4'"
text1="暂无赛事分析报告"
text2="请稍后再试..."
>
<lz-svg-icon icon-class="empty1" style="font-size: 312px;"/>
<lz-page-empty v-else :type="'4'" text1="暂无赛事分析报告" text2="请稍后再试...">
<lz-svg-icon icon-class="empty1" style="font-size: 312px;" />
</lz-page-empty>
</div>
@ -64,83 +52,160 @@
<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()
const isJson = computed(() => {
try {
return JSON.parse(data.value.report)
} catch (error) {
return false
}
})
let { proxy } = getCurrentInstance()
const editorRef = ref(null)
const id = ref(0)
const modelType = ref('')
const data = ref({})
const loading = ref(false)
const basicList = ref([
{
name: "比赛编号",
value: "周三001"
},
{
name: "主队",
value: "北马其顿"
},
{
name: "客队",
value: "哈萨克斯坦"
},
{
name: "时间",
value: "2022-03-01 19:00"
}
// {
// name: "",
// value: "001"
// },
// {
// name: "",
// value: ""
// },
// {
// name: "",
// value: ""
// },
// {
// name: "",
// value: "2022-03-01 19:00"
// }
])
const influencingList = ref([
"北马其顿联赛排名领先且状态稳定防守坚固近10场仅1负同主客胜率60%",
"历史交锋北马其顿占优近2场全胜心理优势明显",
"哈萨克斯坦客场表现差同主客负率60%,失球多)"
// "10160%",
// "2",
// "60%"
])
const coreList = ref([
{
"name": "最终赛果",
"key": "result_final",
"prediction": "北马其顿胜",
"analysis": "北马其顿积分排名第一近10场胜率60%且不败率高哈萨克斯坦客场负率60%,历史交锋北马其顿全胜,优势明显。"
},
{
"name": "让球结果",
"key": "result_handicap",
"prediction": "北马其顿让球胜",
"analysis": "北马其顿实力占优历史交锋让盘时均赢盘哈萨克斯坦客场赢盘率仅28.5%,支持北马其顿覆盖盘口。"
},
{
"name": "比分预测",
"key": "score_prediction",
"prediction": "2-0",
"analysis": "北马其顿场均进1.6球且防守稳固场均失0.4球),哈萨克斯坦客场场均失球多,可能零封小胜。"
},
{
"name": "总进球数",
"key": "total_goals",
"prediction": "小于2.5球",
"analysis": "北马其顿近10场大球率仅30%,防守强;哈萨克斯坦客场进攻乏力,总进球倾向小球。"
},
{
"name": "半全场赛果",
"key": "half_full_time",
"prediction": "胜胜",
"analysis": "北马其顿近场半全场多领先如对列支敦士登半场1-0全场5-0哈萨克斯坦客场半场易落后。"
},
{
"name": "亚洲盘口",
"key": "asian_handicap",
"prediction": "北马其顿-0.75",
"analysis": "基于实力差距和历史盘口(如上次交锋北马其顿受让半球赢盘),北马其顿有望让球获胜。"
},
// {
// "name": "",
// "key": "result_final",
// "prediction": "",
// "analysis": "1060%60%"
// },
// {
// "name": "",
// "key": "result_handicap",
// "prediction": "",
// "analysis": "28.5%"
// },
// {
// "name": "",
// "key": "score_prediction",
// "prediction": "2-0",
// "analysis": "1.60.4"
// },
// {
// "name": "",
// "key": "total_goals",
// "prediction": "2.5",
// "analysis": "1030%"
// },
// {
// "name": "",
// "key": "half_full_time",
// "prediction": "",
// "analysis": "1-05-0"
// },
// {
// "name": "",
// "key": "asian_handicap",
// "prediction": "-0.75",
// "analysis": ""
// },
])
function getDetail() {
loading.value = true
detail({id: id.value, modelType: modelType.value}).then(res => {
detail({ matchId: id.value, modelType: modelType.value }).then(res => {
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
},
]
} catch (error) {
console.log(error)
}
}
}).finally(() => {
loading.value = false
})