|
|
|
@ -29,6 +29,7 @@ const result = ref(false) |
|
|
|
const loading = ref(false) |
|
|
|
const loading = ref(false) |
|
|
|
const think = ref('') |
|
|
|
const think = ref('') |
|
|
|
const aiModel = ref('') |
|
|
|
const aiModel = ref('') |
|
|
|
|
|
|
|
const promptVersion = ref('') |
|
|
|
|
|
|
|
|
|
|
|
// 日期控件参数 |
|
|
|
// 日期控件参数 |
|
|
|
const calendarStart = ref('') |
|
|
|
const calendarStart = ref('') |
|
|
|
@ -57,14 +58,17 @@ 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`) |
|
|
|
// const show_date_old = ref(`2026-06-12`) |
|
|
|
show_date.value = getDefaultDate() |
|
|
|
show_date.value = getDefaultDate() |
|
|
|
|
|
|
|
// show_date_old.value = getDefaultDate() |
|
|
|
const cinema_code = ref('11078801') |
|
|
|
const cinema_code = ref('11078801') |
|
|
|
const cinema_code_old = 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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 逻辑变量 |
|
|
|
|
|
|
|
const set_default = ['mount', 'cinema', 'date'] |
|
|
|
|
|
|
|
|
|
|
|
const show_alter = () => { |
|
|
|
const show_alter = () => { |
|
|
|
ElMessage.error('没有查询到有效的智能排片数据,请调整日期和影院后再试!') |
|
|
|
ElMessage.error('没有查询到有效的智能排片数据,请调整日期和影院后再试!') |
|
|
|
@ -82,7 +86,7 @@ async function get_calendar_date() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 通过异步请求获取影院列表数据 |
|
|
|
// 通过异步请求获取影院列表数据 |
|
|
|
async function get_data() { |
|
|
|
async function get_data(type) { |
|
|
|
showData.value = [] |
|
|
|
showData.value = [] |
|
|
|
loading.value = true |
|
|
|
loading.value = true |
|
|
|
prompt.value = '' |
|
|
|
prompt.value = '' |
|
|
|
@ -93,22 +97,19 @@ async function get_data() { |
|
|
|
showResult.value = '' |
|
|
|
showResult.value = '' |
|
|
|
aiCount.value = '' |
|
|
|
aiCount.value = '' |
|
|
|
aiTotal.value = '' |
|
|
|
aiTotal.value = '' |
|
|
|
|
|
|
|
compareTotal.value = '' |
|
|
|
compareCount.value = '' |
|
|
|
compareCount.value = '' |
|
|
|
result.value = false |
|
|
|
result.value = false |
|
|
|
createTime.value = '' |
|
|
|
createTime.value = '' |
|
|
|
think.value = '' |
|
|
|
think.value = '' |
|
|
|
aiModel.value = '' |
|
|
|
aiModel.value = '' |
|
|
|
force.value = compareSwitch.value === 'new' |
|
|
|
force.value = compareSwitch.value === 'new' |
|
|
|
if (compareSwitch.value !== 'new') { |
|
|
|
test_date_option.value = [] |
|
|
|
test_date.value = '' |
|
|
|
promptVersion.value = '' |
|
|
|
} |
|
|
|
console.log('get_test_date-type', type) |
|
|
|
if (show_date.value !== show_date_old.value) { |
|
|
|
if (set_default.includes(type)) { |
|
|
|
test_date.value = '' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (cinema_code.value !== cinema_code_old.value) { |
|
|
|
|
|
|
|
test_date.value = '' |
|
|
|
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 => { |
|
|
|
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') { |
|
|
|
console.log(res) |
|
|
|
console.log(res) |
|
|
|
@ -126,6 +127,7 @@ async function get_data() { |
|
|
|
createTime.value = res.data.create_time |
|
|
|
createTime.value = res.data.create_time |
|
|
|
think.value = res.data.think |
|
|
|
think.value = res.data.think |
|
|
|
aiModel.value = res.data.ai_model |
|
|
|
aiModel.value = res.data.ai_model |
|
|
|
|
|
|
|
promptVersion.value = res.data.prompt_version |
|
|
|
if (compareSwitch.value === 'template') { |
|
|
|
if (compareSwitch.value === 'template') { |
|
|
|
showData.value = res.data.template_obj |
|
|
|
showData.value = res.data.template_obj |
|
|
|
compareCount.value = res.data.template_count |
|
|
|
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) |
|
|
|
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 |
|
|
|
// cinema_code_old.value = cinema_code.value |
|
|
|
show_date_old.value = show_date.value |
|
|
|
// show_date_old.value = show_date.value |
|
|
|
get_test_date() |
|
|
|
get_test_date(type) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
tableData.value = [] |
|
|
|
result.value = true |
|
|
|
result.value = true |
|
|
|
show_alter() |
|
|
|
show_alter() |
|
|
|
loading.value = false |
|
|
|
loading.value = false |
|
|
|
get_test_date() |
|
|
|
get_test_date(type) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
console.log(err) |
|
|
|
@ -194,13 +197,19 @@ function formatTableData() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 通过接口获取测试数据的下拉列表数据 |
|
|
|
// 通过接口获取测试数据的下拉列表数据 type mount,date,cinema,test, compare |
|
|
|
const get_test_date = () => { |
|
|
|
const get_test_date = (type) => { |
|
|
|
get_test_date_api(cinema_code.value, show_date.value).then(res => { |
|
|
|
get_test_date_api(cinema_code.value, show_date.value).then(res => { |
|
|
|
if (res.status === 'success') { |
|
|
|
if (res.status === 'success') { |
|
|
|
res.date.forEach((item) => { |
|
|
|
test_date_option.value = [] |
|
|
|
test_date_option.value.push({'value': item, label: item}) |
|
|
|
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 |
|
|
|
dialogFormVisible.value = false |
|
|
|
await test_prompt(form.cinema_code, form.show_date, form.prompt).then(res => { |
|
|
|
await test_prompt(form.cinema_code, form.show_date, form.prompt).then(res => { |
|
|
|
if (res.status === 'success') { |
|
|
|
if (res.status === 'success') { |
|
|
|
get_test_date_api(form.cinema_code, form.show_date).then(res => { |
|
|
|
get_test_date() |
|
|
|
if (res.status === 'success') { |
|
|
|
|
|
|
|
test_date_option.value = [] |
|
|
|
|
|
|
|
res.date.forEach((item) => { |
|
|
|
|
|
|
|
test_date_option.value.push({'value': item, label: item}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
console.log(res) |
|
|
|
console.log(res) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
@ -316,8 +318,8 @@ const compareDesc = computed(() => { |
|
|
|
// 定义生命周期,在加载时获取一次表格数据 |
|
|
|
// 定义生命周期,在加载时获取一次表格数据 |
|
|
|
onBeforeMount( |
|
|
|
onBeforeMount( |
|
|
|
async () => { |
|
|
|
async () => { |
|
|
|
await get_data() |
|
|
|
|
|
|
|
await get_calendar_date() |
|
|
|
await get_calendar_date() |
|
|
|
|
|
|
|
await get_data('mount') |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
@ -339,12 +341,12 @@ onBeforeMount( |
|
|
|
size="default" |
|
|
|
size="default" |
|
|
|
:disabled-date="disabledDate" |
|
|
|
:disabled-date="disabledDate" |
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
@change="get_data" |
|
|
|
@change="get_data('date')" |
|
|
|
style="width: 140px" |
|
|
|
style="width: 140px" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-radio-group v-model="cinema_code" @change="get_data"> |
|
|
|
<el-radio-group v-model="cinema_code" @change="get_data('cinema')"> |
|
|
|
<el-radio-button value="11078801" label="11078801">保利国际影城北京凯德大峡谷店</el-radio-button> |
|
|
|
<el-radio-button value="11078801" label="11078801">保利国际影城北京凯德大峡谷店</el-radio-button> |
|
|
|
<el-radio-button value="31073101" label="31073101">SFC上影(永华店)</el-radio-button> |
|
|
|
<el-radio-button value="31073101" label="31073101">SFC上影(永华店)</el-radio-button> |
|
|
|
<el-radio-button value="33040301" label="33040301">宁波影都(东门口店)</el-radio-button> |
|
|
|
<el-radio-button value="33040301" label="33040301">宁波影都(东门口店)</el-radio-button> |
|
|
|
@ -369,12 +371,26 @@ onBeforeMount( |
|
|
|
</el-tooltip> |
|
|
|
</el-tooltip> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-radio-group v-model="compareSwitch" @change="get_data"> |
|
|
|
<el-radio-group v-model="compareSwitch" @change="get_data('compare')"> |
|
|
|
<el-radio value="new" label="new">最新排片数据</el-radio> |
|
|
|
<el-radio value="new" label="new">最新排片数据</el-radio> |
|
|
|
<el-radio value="template" label="template">模板日期排片数据</el-radio> |
|
|
|
<el-radio value="template" label="template">模板日期排片数据</el-radio> |
|
|
|
<el-radio value="target" label="target">目标日期排片数据</el-radio> |
|
|
|
<el-radio value="target" label="target">目标日期排片数据</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="2" align="right"> |
|
|
|
|
|
|
|
<el-text>选择数据:</el-text> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="4"> |
|
|
|
|
|
|
|
<el-select v-model="test_date" placeholder="请选择" :clearable="true" |
|
|
|
|
|
|
|
@change="get_data('test')" 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-col :span="4" v-if="compareSwitch==='template'"> |
|
|
|
<el-col :span="4" v-if="compareSwitch==='template'"> |
|
|
|
<el-text>模板日期:{{ templateDate }}</el-text> |
|
|
|
<el-text>模板日期:{{ templateDate }}</el-text> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
@ -385,20 +401,6 @@ onBeforeMount( |
|
|
|
{{ testButton }} |
|
|
|
{{ testButton }} |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
</el-col> |
|
|
|
</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> |
|
|
|
</el-row> |
|
|
|
<el-dialog v-model="dialogFormVisible" title="测试提示词" width="800" style="max-height: 800px"> |
|
|
|
<el-dialog v-model="dialogFormVisible" title="测试提示词" width="800" style="max-height: 800px"> |
|
|
|
<el-form :model="form"> |
|
|
|
<el-form :model="form"> |
|
|
|
@ -421,7 +423,7 @@ onBeforeMount( |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="" :label-width="formLabelWidth"> |
|
|
|
<el-form-item label="" :label-width="formLabelWidth"> |
|
|
|
<el-button type="primary" @click="generalPrompt" :loading="promptLoading" > |
|
|
|
<el-button type="primary" @click="generalPrompt" :loading="promptLoading"> |
|
|
|
生成提示词 |
|
|
|
生成提示词 |
|
|
|
</el-button> |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
@ -538,6 +540,14 @@ onBeforeMount( |
|
|
|
<el-text>{{ showResult }}</el-text> |
|
|
|
<el-text>{{ showResult }}</el-text> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
|
|
|
|
<el-col :span="3" align="right"> |
|
|
|
|
|
|
|
<el-text style="font-weight: bold">提示词版本:</el-text> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="21" align="left"> |
|
|
|
|
|
|
|
<el-text>{{ promptVersion }}</el-text> |
|
|
|
|
|
|
|
</el-col> |
|
|
|
|
|
|
|
</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> |
|
|
|
|