增加测试数据展示

main
rogersun 6 days ago
parent 5a93574554
commit a4ec79fc9d
  1. 16
      src/apis/ai_show.js
  2. 2
      src/env_config.js
  3. 43
      src/views/ai_show/index.vue

@ -1,6 +1,6 @@
import {request} from '@/request/index.js'
export const get_ai_show_data = (cinema_code, show_date, force) => {
export const get_ai_show_data = (cinema_code, show_date, force, test_date) => {
let force_string = '0'
if (force) {
force_string = '1'
@ -11,7 +11,8 @@ export const get_ai_show_data = (cinema_code, show_date, force) => {
params: {
cinema_code: cinema_code,
show_date: show_date,
force: force_string
force: force_string,
test: test_date,
}
})
}
@ -21,4 +22,15 @@ export const get_report_date = () => {
url: 'ai/report_date',
method: 'get'
})
}
export const get_test_date_api = (cinema_code, show_date) => {
return request({
url: 'ai/test_date',
method: 'get',
params: {
cinema_code: cinema_code,
show_date: show_date,
}
})
}

@ -1,3 +1,3 @@
export default function env_config() {
return 'local'
return 'dev'
}

@ -1,12 +1,14 @@
<script setup>
import {onBeforeMount, ref, reactive, computed} from 'vue';
import {ElMessage} from 'element-plus'
import {get_ai_show_data, get_report_date} from "@/apis/ai_show.js";
import {get_ai_show_data, get_report_date, get_test_date_api} from "@/apis/ai_show.js";
// region
const tableData = ref([])
const hallData = ref([])
const hallArray = ref([])
const test_date = ref()
const test_date_option = ref([])
//
const showData = ref([])
@ -84,7 +86,11 @@ async function get_data() {
think.value = ''
aiModel.value = ''
force.value = compareSwitch.value === 'new'
await get_ai_show_data(cinema_code.value, show_date.value, force.value).then(res => {
if (compareSwitch.value !== 'new') {
test_date.value = ''
}
test_date_option.value = []
await get_ai_show_data(cinema_code.value, show_date.value, force.value, test_date.value).then(res => {
if (res.status === 'success') {
console.log(res)
result.value = false
@ -117,6 +123,7 @@ async function get_data() {
console.log(showData.value, prompt.value, tokens.value, takeTimes.value, realSales.value, aiSales.value, showResult.value)
formatTableData()
loading.value = false
get_test_date()
} else {
result.value = true
show_alter()
@ -165,6 +172,18 @@ function formatTableData() {
}
//
const get_test_date = () => {
get_test_date_api(cinema_code.value, show_date.value).then(res => {
if (res.status === 'success') {
res.date.forEach((item) => {
test_date_option.value.push({'value': item, label: item})
})
}
})
}
//
const objectSpanMethod = ({row, column, rowIndex, columnIndex}) => {
if (column.property === 'hall') {
@ -278,8 +297,22 @@ onBeforeMount(
<el-radio value="target" label="target">目标日期排片数据</el-radio>
</el-radio-group>
</el-col>
<el-col :span="4">
<el-text v-if="compareSwitch==='template'">模板日期{{ templateDate }}</el-text>
<el-col :span="4" v-if="compareSwitch==='template'">
<el-text>模板日期{{ templateDate }}</el-text>
</el-col>
<el-col :span="3" v-if="compareSwitch==='new'" align="right">
<el-text>手动测试数据</el-text>
</el-col>
<el-col :span="4" v-if="compareSwitch==='new'">
<el-select v-model="test_date" placeholder="请选择" v-if="compareSwitch==='new'" :clearable="true"
@change="get_data" style="width: 240px">
<el-option
v-for="item in test_date_option"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
@ -363,7 +396,7 @@ onBeforeMount(
<el-text>{{ aiTotal }}</el-text>
</el-col>
<el-col :span="9" align="left">
<el-text>{{ compareTotal}}</el-text>
<el-text>{{ compareTotal }}</el-text>
</el-col>
</el-row>
<el-row>

Loading…
Cancel
Save