fix:修改标记
This commit is contained in:
parent
66e9a60548
commit
938c737e60
@ -65,3 +65,14 @@ export function reportUpdate(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/** 报告更新 */
|
||||
export function reportResultUpdate(data) {
|
||||
return request({
|
||||
url: '/tc/reportResult/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
123
src/views/operation/report/components/Prediction.vue
Normal file
123
src/views/operation/report/components/Prediction.vue
Normal 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>
|
||||
@ -8,12 +8,12 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="联赛类型" prop="leagueAbbName">
|
||||
<el-select v-model="queryParams.leagueAbbName" @change="handleQuery" style="width: 240px" clearable placeholder="请选择联赛类型">
|
||||
<el-option
|
||||
v-for="item in dataScopeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
<el-option
|
||||
v-for="item in dataScopeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@ -88,23 +88,17 @@
|
||||
</template>
|
||||
<template #default>
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="finyx-AI" name="a"><EditHad :data="scope.row" /></el-tab-pane>
|
||||
<el-tab-pane label="D3-index" name="b"><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="D3_F"><Prediction :data="rowPrediction(scope.row, 'D3_F')" /></el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
</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">
|
||||
<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="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, 'FINYX_F')" link type="primary" icon="Edit" @click="openDialog(scope.row, 'FINYX_F')">finyx-AI</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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -124,7 +118,7 @@
|
||||
|
||||
<!-- 修改对话框 -->
|
||||
<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>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
@ -136,11 +130,11 @@
|
||||
</template>
|
||||
|
||||
<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 { 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"
|
||||
|
||||
@ -152,7 +146,7 @@ const showSearch = ref(true)
|
||||
const total = ref(0)
|
||||
const dateRange = ref([])
|
||||
const editHadRef = ref(null)
|
||||
const activeName = ref('a')
|
||||
const activeName = ref('FINYX_F')
|
||||
|
||||
const dialogOpen = ref(false)
|
||||
const dialogTitle = ref('标记')
|
||||
@ -175,18 +169,33 @@ const data = reactive({
|
||||
const { queryParams } = toRefs(data)
|
||||
|
||||
|
||||
function rowPrediction(row, modelType) {
|
||||
return row.reportResults && row.reportResults.find(el => el.modelType === modelType) || {}
|
||||
}
|
||||
|
||||
function showBtn(row, type) {
|
||||
// 判断reportResults是否存在,不存在则返回false
|
||||
if(!row.reportResults) {
|
||||
return false
|
||||
}
|
||||
if(row.reportResults.find(el => el.modelType === type)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
|
||||
// proxy.download("system/user/export", {
|
||||
// ...queryParams.value,
|
||||
// },`user_${new Date().getTime()}.xlsx`)
|
||||
// ...queryParams.value,
|
||||
// },`user_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
function submitForm() {
|
||||
const data = editHadRef.value.getFormData()
|
||||
reportUpdate(data).then(response => {
|
||||
reportResultUpdate(data).then(response => {
|
||||
proxy.$message.success(response.msg)
|
||||
getList()
|
||||
}).finally(() => {
|
||||
@ -201,9 +210,11 @@ function cancel() {
|
||||
}
|
||||
|
||||
function openDialog(row, type='') {
|
||||
dialogForm.value = row
|
||||
dialogOpen.value = true
|
||||
dialogTitle.value = '标记' + type
|
||||
if(row && row.reportResults && type){
|
||||
dialogForm.value = row.reportResults.find(el => el.modelType === type)
|
||||
dialogOpen.value = true
|
||||
dialogTitle.value = '标记' + type
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取联赛类型 */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user