修复列合并错误的问题

main
rogersun 2 weeks ago
parent 92ce2eb0f4
commit ec8aa046f4
  1. 46
      src/views/ai_show/index.vue

@ -4,8 +4,8 @@ import {get_ai_show_data} from "@/apis/ai_show.js";
// region // region
const tableData = ref([]) const tableData = ref([])
const hallData = ref({}) const hallData = ref([])
const hallArray = ref(['']) const hallArray = ref([])
// //
const showData = ref([]) const showData = ref([])
@ -22,6 +22,13 @@ const cinema_code = ref('11078801')
// //
async function get_data() { async function get_data() {
showData.value = []
prompt.value = ''
tokens.value = 0
takeTimes.value = 0
realSales.value = ''
aiSales.value = ''
result.value = false
await get_ai_show_data(cinema_code.value, show_date.value).then(res => { await get_ai_show_data(cinema_code.value, show_date.value).then(res => {
if (res.status === 'success') { if (res.status === 'success') {
result.value = false result.value = false
@ -45,6 +52,7 @@ async function get_data() {
// //
function formatTableData() { function formatTableData() {
hallArray.value = [] hallArray.value = []
hallData.value = []
tableData.value = [] tableData.value = []
let temp = 0; let temp = 0;
showData.value.forEach((item, index) => { showData.value.forEach((item, index) => {
@ -64,29 +72,38 @@ function formatTableData() {
real_duration: item[15], real_duration: item[15],
}) })
if (hallArray.value.indexOf(item[0]) >= 0) { if (hallArray.value.indexOf(item[0]) >= 0) {
hallData[temp] += 1 hallData.value[temp] += 1
hallData.value.push(0)
} else { } else {
temp = index
hallArray.value.push(item[0]) hallArray.value.push(item[0])
hallData[temp] = 1 temp = index
hallData.value.push(1)
} }
}) })
console.log('hallArray.value', hallArray.value)
console.log('hallData.value', hallData.value)
} }
// //
const objectSpanMethod = ({row, column, rowIndex, columnIndex}) => { const objectSpanMethod = ({row, column, rowIndex, columnIndex}) => {
if (columnIndex === 0) { if (column.property === 'hall') {
if (!isNaN(hallData[rowIndex])) { const rowSpan = hallData.value[rowIndex]
if (hallData.value[rowIndex] === 0) {
return { return {
rowspan: hallData[rowIndex], rowspan: rowSpan,
colspan: 1, colspan: 0,
} }
} else { } else {
return { return {
rowspan: 0, rowspan: rowSpan,
colspan: 0, colspan: 1,
}
} }
} else {
return {
rowspan: 1,
colspan: 1,
} }
} }
} }
@ -128,7 +145,8 @@ onBeforeMount(
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-radio-group v-model="cinema_code" aria-label="cinema control" class="mb-4" @change="get_data"> <el-radio-group v-model="cinema_code" aria-label="cinema control" class="mb-4" default='11078801'
@change="get_data">
<el-radio-button value="11078801">保利国际影城北京凯德大峡谷店</el-radio-button> <el-radio-button value="11078801">保利国际影城北京凯德大峡谷店</el-radio-button>
<el-radio-button value="31073101">SFC上影(永华店)</el-radio-button> <el-radio-button value="31073101">SFC上影(永华店)</el-radio-button>
<el-radio-button value="33040301">宁波影都东门口店</el-radio-button> <el-radio-button value="33040301">宁波影都东门口店</el-radio-button>
@ -156,7 +174,9 @@ onBeforeMount(
<el-table-column prop="real_duration" label="场间" min-width="60"></el-table-column> <el-table-column prop="real_duration" label="场间" min-width="60"></el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-row style="margin-top: 30px"><el-text style="font-weight: bold" size="large">相关数据</el-text></el-row> <el-row style="margin-top: 30px">
<el-text style="font-weight: bold" size="large">相关数据</el-text>
</el-row>
<el-row> <el-row>
<el-col :span="3" align="right"> <el-col :span="3" align="right">
<el-text style="font-weight: bold">智能排片预估销售额</el-text> <el-text style="font-weight: bold">智能排片预估销售额</el-text>

Loading…
Cancel
Save