zsk 10 months ago
parent 7034509e16
commit a2ca9ce719

@ -52,7 +52,7 @@ const router = createRouter({
path: "/merchantManagement/message",
name: "message",
meta: {
title: '中奖管理',
title: '轮播管理',
},
component: () => import("../views/message/index.vue")
},

@ -63,7 +63,7 @@ export let mockMenuList = {
"createTime": "",
"updateTime": "",
"deleted": 0,
"title": "中奖管理",
"title": "轮播管理",
"menuName": "message",
"parentName": "",
"path": "message",

@ -2,7 +2,7 @@
<div class="today-notes">
<a-tabs v-model:activeKey="activeTab" @change="handleTabChange">
<a-tab-pane v-for="type in noteTypes" :key="type.key" :tab="type.label">
<a-table :columns="columns" :data-source="filteredData" :rowKey="record => record.recordId">
<a-table :columns="getColumns(type.key)" :data-source="filteredData" :rowKey="record => record.recordId">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'scheduleJson'">
<span v-if="record.classify !== 8 && record.classify !== 9">
@ -54,14 +54,14 @@
<a-form-item label="球队2" name="team2" :rules="[{ required: true, message: '请输入球队2' }]">
<a-input v-model:value="formState.team2" />
</a-form-item>
<a-form-item label="结果" name="result" :rules="[{ required: true, message: '请输入结果' }]">
<a-form-item label="比分结果" name="result" :rules="[{ required: true, message: '请输入结果' }]">
<a-input v-model:value="formState.result" />
</a-form-item>
</template>
<a-form-item label="赔率" name="odds">
<a-input v-model:value="formState.odds" />
</a-form-item>
<a-form-item label="结果" name="fruit">
<a-form-item label="中否" name="fruit">
<a-input v-model:value="formState.fruit" />
</a-form-item>
<a-form-item v-if="formState.classify === 9" label="开奖号" name="winNo">
@ -97,16 +97,6 @@ const activeTab = ref(noteTypes[0].key);
const modalVisible = ref(false);
const modalMode = ref('add');
const columns = [
{ title: '日期', dataIndex: 'today', key: 'today' },
{ title: '比赛内容', key: 'scheduleJson' },
{ title: '赔率', dataIndex: 'odds', key: 'odds' },
{ title: '结果', dataIndex: 'fruit', key: 'fruit' },
{ title: '开奖号', dataIndex: 'winNo', key: 'winNo' },
{ title: '推荐号', dataIndex: 'recommendNo', key: 'recommendNo' },
{ title: '操作', key: 'action' },
];
const data = reactive([]);
const formState = reactive({
@ -187,7 +177,7 @@ const editItem = (record) => {
const deleteItem = async (record) => {
try {
await deleteScheduleApi(record.recordId);
await deleteScheduleApi(record.id);
message.success('删除成功');
fetchData();
} catch (error) {
@ -199,6 +189,7 @@ const handleModalOk = async () => {
try {
let payload = {
...formState,
recordId: formState.id,
todayStr: formState.todayStr.format('YYYY-MM-DD'),
};
@ -209,12 +200,13 @@ const handleModalOk = async () => {
team2: payload.team2,
result: payload.result,
});
}
//
delete payload.match;
delete payload.team1;
delete payload.team2;
delete payload.result;
}
if (modalMode.value === 'add') {
await saveScheduleApi(payload);
@ -248,6 +240,26 @@ const handleTabChange = (newActiveKey) => {
fetchData();
};
const getColumns = (classify) => {
const baseColumns = [
{ title: '日期', dataIndex: 'today', key: 'today' },
{ title: '赔率', dataIndex: 'odds', key: 'odds' },
{ title: '结果', dataIndex: 'fruit', key: 'fruit' },
{ title: '操作', key: 'action' },
];
if (classify === 8) {
baseColumns.splice(1, 0, { title: '开奖号', dataIndex: 'winNo', key: 'winNo' });
baseColumns.splice(2, 0, { title: '推荐号', dataIndex: 'recommendNo', key: 'recommendNo' });
} else if (classify === 9) {
baseColumns.splice(1, 0, { title: '推荐号', dataIndex: 'recommendNo', key: 'recommendNo' });
} else {
baseColumns.splice(1, 0, { title: '比赛内容', key: 'scheduleJson' });
}
return baseColumns;
};
onMounted(() => {
fetchData();
});

Loading…
Cancel
Save