fix:修改标记

This commit is contained in:
lz-ui 2025-10-21 12:28:52 +08:00
parent 66e9a60548
commit 938c737e60
3 changed files with 172 additions and 27 deletions

View File

@ -65,3 +65,14 @@ export function reportUpdate(data) {
data: data data: data
}) })
} }
/** 报告更新 */
export function reportResultUpdate(data) {
return request({
url: '/tc/reportResult/update',
method: 'post',
data: data
})
}

View File

@ -0,0 +1,123 @@
<template>
<div class="had">
<div class="had-content flex" v-for="(item,index) in enumsPredictionList" :key="item.value">
<div class="had-content-item-left">
{{ item.label || '' }}
</div>
<div class="had-content-table flex">
<div :class="['had-content-table-item', {'is-active': isActiveClass(item, data, '1')}]" @click="handleClick(item, data, '1')">
</div>
<div v-if="item.value === 'asianHandicapFlag'" :class="['had-content-table-item', {'is-active': isActiveClass(item, data, '0.5')}]" @click="handleClick(item, data, '0.5')">
红半
</div>
<div :class="['had-content-table-item', {'is-active': isActiveClass(item, data, '-1')}]" @click="handleClick(item, data, '-1')">
</div>
<div v-if="item.value === 'asianHandicapFlag'" :class="['had-content-table-item', {'is-active': isActiveClass(item, data, '-0.5')}]" @click="handleClick(item, data, '-0.5')">
黑半
</div>
</div>
</div>
</div>
</template>
<script setup>
import { onMounted } from 'vue';
//
const props = defineProps({
data: {
type: Object,
default: () => ({})
},
type: {
type: String,
default: 'view' // edit:,view:
}
});
//
const { data } = toRefs(props);
const enumsPredictionList = [
{ label: '胜平负:', value: 'resultFlag'},
{ label: '让分胜平负:', value: 'hhadResultFlag'},
{ label: '比分:', value: 'scoreResultFlag' },
{ label: '进球数:', value: 'goalsResultFlag' },
{ label: '半全场:', value: 'halfFullResultFlag' },
{ label: '亚盘:', value: 'asianHandicapFlag' },
];
function isActiveClass (item, data, activeValue) {
// console.log(item, data, activeValue)
if (!data || !data[item.value]) return false;
return data[item.value] === activeValue;
}
function handleClick (item,data, value) {
data[item.value] = value
}
function getFormData () {
const formData = props.data
return formData;
}
onMounted(() => {
// if(data.value.reportDetail && data.value.matchSpfDetails){
// const reportDetail = data.value.reportDetail;
// data.value.matchSpfDetails.forEach(el => {
// if(el.goalType === 'HAD') {
// el.isActive = reportDetail.hadFlag || '';
// }
// if(el.goalType === 'HHAD') {
// el.isActive = reportDetail.hhadFlag || '';
// }
// });
// }
})
defineExpose({
getFormData
});
</script>
<style lang="scss" scoped>
.had-content-item-left{
width: 120px;
text-align: right;
line-height: 45px;
padding-right: 6px;
}
.had-content-table{
display: flex;
justify-content: space-between;
width: 100%;
}
.had-content-table-item {
padding: 12px;
// border: 1px solid #ccc;
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
width: 50%;
cursor: pointer;
display: flex;
justify-content: space-between;
background-color: #F4F8FF;
}
.had-content-table .had-content-table-item:last-child {
border-right: 1px solid #ccc;
}
.had-content:last-child .had-content-table-item {
border-bottom: 1px solid #ccc;
}
.is-active {
background-color: #f56c6c;
color: #fff;
}
</style>

View File

@ -88,23 +88,17 @@
</template> </template>
<template #default> <template #default>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="finyx-AI" name="a"><EditHad :data="scope.row" /></el-tab-pane> <el-tab-pane label="finyx-AI" name="FINYX_F"><Prediction :data="rowPrediction(scope.row, 'FINYX_F')" /></el-tab-pane>
<el-tab-pane label="D3-index" name="b"><EditHad :data="scope.row" /></el-tab-pane> <el-tab-pane label="D3-index" name="D3_F"><Prediction :data="rowPrediction(scope.row, 'D3_F')" /></el-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
</el-popover> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="报告信息" prop="reportSatus">
<template #default="scope">
{{ scope.row.reportSatus === 1 ? scope.row.reportDetail.reportFlag : '' }}
</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">
<template #default="scope"> <template #default="scope">
<el-button v-if="scope.row.reportSatus === 1" link type="primary" icon="Edit" @click="openDialog(scope.row, 'finyx-AI')">finyx-AI</el-button> <el-button v-if="showBtn(scope.row, 'FINYX_F')" link type="primary" icon="Edit" @click="openDialog(scope.row, 'FINYX_F')">finyx-AI</el-button>
<el-button v-if="scope.row.reportSatus === 1" link type="primary" icon="Edit" @click="openDialog(scope.row, 'D3-index')">D3-index</el-button> <el-button v-if="showBtn(scope.row, 'D3_F')" link type="primary" icon="Edit" @click="openDialog(scope.row, 'D3_F')">D3-index</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -124,7 +118,7 @@
<!-- 修改对话框 --> <!-- 修改对话框 -->
<el-dialog :title="dialogTitle" v-model="dialogOpen" width="600px" append-to-body> <el-dialog :title="dialogTitle" v-model="dialogOpen" width="600px" append-to-body>
<EditHad :data="dialogForm" type="edit" v-if="dialogOpen" @submit="submitForm" ref="editHadRef"/> <Prediction :data="dialogForm" type="edit" v-if="dialogOpen" @submit="submitForm" ref="editHadRef"/>
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -136,11 +130,11 @@
</template> </template>
<script setup name="OperationReport"> <script setup name="OperationReport">
import { Info, infoSelectDistinctLeagueAbbNames, reportUpdate } from "@/api/tc/eventAnalysisReport" import { Info, infoSelectDistinctLeagueAbbNames, reportResultUpdate } from "@/api/tc/eventAnalysisReport"
import { jumpLink } from "@/utils/tc" import { jumpLink } from "@/utils/tc"
import { processMatchResults } from "@/utils/tc" import { processMatchResults } from "@/utils/tc"
import EditHad from "@/views/tc/eventAnalysisReport/components/EditHad.vue" import Prediction from "@/views/operation/report/components/Prediction.vue"
import { ref } from "vue" import { ref } from "vue"
@ -152,7 +146,7 @@ const showSearch = ref(true)
const total = ref(0) const total = ref(0)
const dateRange = ref([]) const dateRange = ref([])
const editHadRef = ref(null) const editHadRef = ref(null)
const activeName = ref('a') const activeName = ref('FINYX_F')
const dialogOpen = ref(false) const dialogOpen = ref(false)
const dialogTitle = ref('标记') const dialogTitle = ref('标记')
@ -175,9 +169,24 @@ const data = reactive({
const { queryParams } = toRefs(data) const { queryParams } = toRefs(data)
function rowPrediction(row, modelType) {
return row.reportResults && row.reportResults.find(el => el.modelType === modelType) || {}
}
function showBtn(row, type) {
// reportResultsfalse
if(!row.reportResults) {
return false
}
if(row.reportResults.find(el => el.modelType === type)) {
return true
}
return false
}
/** 导出按钮操作 */ /** 导出按钮操作 */
function handleExport() { function handleExport() {
// proxy.download("system/user/export", { // proxy.download("system/user/export", {
// ...queryParams.value, // ...queryParams.value,
// },`user_${new Date().getTime()}.xlsx`) // },`user_${new Date().getTime()}.xlsx`)
@ -186,7 +195,7 @@ function handleExport() {
/** 提交表单 */ /** 提交表单 */
function submitForm() { function submitForm() {
const data = editHadRef.value.getFormData() const data = editHadRef.value.getFormData()
reportUpdate(data).then(response => { reportResultUpdate(data).then(response => {
proxy.$message.success(response.msg) proxy.$message.success(response.msg)
getList() getList()
}).finally(() => { }).finally(() => {
@ -201,10 +210,12 @@ function cancel() {
} }
function openDialog(row, type='') { function openDialog(row, type='') {
dialogForm.value = row if(row && row.reportResults && type){
dialogForm.value = row.reportResults.find(el => el.modelType === type)
dialogOpen.value = true dialogOpen.value = true
dialogTitle.value = '标记' + type dialogTitle.value = '标记' + type
} }
}
/** 获取联赛类型 */ /** 获取联赛类型 */
function getLeagueAbbNames() { function getLeagueAbbNames() {