From 52450e15463f8227fa35bdc1eec48b42316c98f7 Mon Sep 17 00:00:00 2001 From: rogersun Date: Thu, 16 Jul 2026 13:52:01 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=99=BA=E8=83=BD=E6=8E=92=E7=89=87?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8F=AA=E5=B1=95=E7=A4=BA=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1+=E6=89=8B=E5=8A=A8=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ai_show/index.vue | 102 ++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 46 deletions(-) diff --git a/src/views/ai_show/index.vue b/src/views/ai_show/index.vue index eb473ea..9b8e0a8 100644 --- a/src/views/ai_show/index.vue +++ b/src/views/ai_show/index.vue @@ -29,6 +29,7 @@ const result = ref(false) const loading = ref(false) const think = ref('') const aiModel = ref('') +const promptVersion = ref('') // 日期控件参数 const calendarStart = ref('') @@ -57,14 +58,17 @@ const getDefaultDate = () => { return `${year}-${month}-${day}` } const show_date = ref(`2026-06-12`) -const show_date_old = ref(`2026-06-12`) +// const show_date_old = ref(`2026-06-12`) show_date.value = getDefaultDate() +// show_date_old.value = getDefaultDate() const cinema_code = ref('11078801') -const cinema_code_old = ref('11078801') +// const cinema_code_old = ref('11078801') const force = ref(true) const templateSwitch = ref(false) const compareSwitch = ref('new') // template target new +// 逻辑变量 +const set_default = ['mount', 'cinema', 'date'] const show_alter = () => { ElMessage.error('没有查询到有效的智能排片数据,请调整日期和影院后再试!') @@ -82,7 +86,7 @@ async function get_calendar_date() { } // 通过异步请求获取影院列表数据 -async function get_data() { +async function get_data(type) { showData.value = [] loading.value = true prompt.value = '' @@ -93,22 +97,19 @@ async function get_data() { showResult.value = '' aiCount.value = '' aiTotal.value = '' + compareTotal.value = '' compareCount.value = '' result.value = false createTime.value = '' think.value = '' aiModel.value = '' force.value = compareSwitch.value === 'new' - if (compareSwitch.value !== 'new') { - test_date.value = '' - } - if (show_date.value !== show_date_old.value) { - test_date.value = '' - } - if (cinema_code.value !== cinema_code_old.value) { + test_date_option.value = [] + promptVersion.value = '' + console.log('get_test_date-type', type) + if (set_default.includes(type)) { 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) @@ -126,6 +127,7 @@ async function get_data() { createTime.value = res.data.create_time think.value = res.data.think aiModel.value = res.data.ai_model + promptVersion.value = res.data.prompt_version if (compareSwitch.value === 'template') { showData.value = res.data.template_obj compareCount.value = res.data.template_count @@ -142,14 +144,15 @@ async function get_data() { console.log(showData.value, prompt.value, tokens.value, takeTimes.value, realSales.value, aiSales.value, showResult.value) formatTableData() loading.value = false - cinema_code_old.value = cinema_code.value - show_date_old.value = show_date.value - get_test_date() + // cinema_code_old.value = cinema_code.value + // show_date_old.value = show_date.value + get_test_date(type) } else { + tableData.value = [] result.value = true show_alter() loading.value = false - get_test_date() + get_test_date(type) } }).catch(err => { console.log(err) @@ -194,13 +197,19 @@ function formatTableData() { } -// 通过接口获取测试数据的下拉列表数据 -const get_test_date = () => { +// 通过接口获取测试数据的下拉列表数据 type mount,date,cinema,test, compare +const get_test_date = (type) => { 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}) + test_date_option.value = [] + res.date.forEach((item, index) => { + const test_label = item[1] === true?item[0]+'-手工测试':item[0] + test_date_option.value.push({'value': item[0], label: test_label}) }) + console.log('get_test_date-type', type) + if (set_default.includes(type)) { + test_date.value = test_date_option.value[0]['value'] + } } }) } @@ -211,14 +220,7 @@ async function requestTest() { dialogFormVisible.value = false await test_prompt(form.cinema_code, form.show_date, form.prompt).then(res => { if (res.status === 'success') { - get_test_date_api(form.cinema_code, form.show_date).then(res => { - if (res.status === 'success') { - test_date_option.value = [] - res.date.forEach((item) => { - test_date_option.value.push({'value': item, label: item}) - }) - } - }) + get_test_date() console.log(res) } }).catch(err => { @@ -316,8 +318,8 @@ const compareDesc = computed(() => { // 定义生命周期,在加载时获取一次表格数据 onBeforeMount( async () => { - await get_data() await get_calendar_date() + await get_data('mount') } ) @@ -339,12 +341,12 @@ onBeforeMount( size="default" :disabled-date="disabledDate" value-format="YYYY-MM-DD" - @change="get_data" + @change="get_data('date')" style="width: 140px" /> - + 保利国际影城北京凯德大峡谷店 SFC上影(永华店) 宁波影都(东门口店) @@ -369,12 +371,26 @@ onBeforeMount( - + 最新排片数据 模板日期排片数据 目标日期排片数据 + + 选择数据: + + + + + + 模板日期:{{ templateDate }} @@ -385,20 +401,6 @@ onBeforeMount( {{ testButton }} - - 手动测试数据: - - - - - - @@ -421,7 +423,7 @@ onBeforeMount( - + 生成提示词 @@ -538,6 +540,14 @@ onBeforeMount( {{ showResult }} + + + 提示词版本: + + + {{ promptVersion }} + + 提示词: