增加容错性

main
rogersun 6 days ago
parent a4ec79fc9d
commit 424b0e8257
  1. 10
      src/views/ai_show/index.vue

@ -46,8 +46,10 @@ const getDefaultDate = () => {
return `${year}-${month}-${day}` return `${year}-${month}-${day}`
} }
const show_date = ref(`2026-06-12`) const show_date = ref(`2026-06-12`)
const show_date_old = ref(`2026-06-12`)
show_date.value = getDefaultDate() show_date.value = getDefaultDate()
const cinema_code = ref('11078801') const cinema_code = ref('11078801')
const cinema_code_old = ref('11078801')
const force = ref(true) const force = ref(true)
const templateSwitch = ref(false) const templateSwitch = ref(false)
const compareSwitch = ref('new') // template target new const compareSwitch = ref('new') // template target new
@ -89,6 +91,12 @@ async function get_data() {
if (compareSwitch.value !== 'new') { if (compareSwitch.value !== 'new') {
test_date.value = '' test_date.value = ''
} }
if (show_date.value !== show_date_old.value) {
test_date.value = ''
}
if (cinema_code.value !== cinema_code_old.value) {
test_date.value = ''
}
test_date_option.value = [] test_date_option.value = []
await get_ai_show_data(cinema_code.value, show_date.value, force.value, test_date.value).then(res => { await get_ai_show_data(cinema_code.value, show_date.value, force.value, test_date.value).then(res => {
if (res.status === 'success') { if (res.status === 'success') {
@ -123,6 +131,8 @@ async function get_data() {
console.log(showData.value, prompt.value, tokens.value, takeTimes.value, realSales.value, aiSales.value, showResult.value) console.log(showData.value, prompt.value, tokens.value, takeTimes.value, realSales.value, aiSales.value, showResult.value)
formatTableData() formatTableData()
loading.value = false loading.value = false
cinema_code_old.value = cinema_code.value
show_date_old.value = show_date.value
get_test_date() get_test_date()
} else { } else {
result.value = true result.value = true

Loading…
Cancel
Save