|
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
<script setup> |
|
|
|
|
import {onBeforeMount, ref, reactive, computed} from 'vue'; |
|
|
|
|
import {ElMessage} from 'element-plus' |
|
|
|
|
import {get_ai_show_data, get_report_date, get_test_date_api, test_prompt} from "@/apis/ai_show.js"; |
|
|
|
|
import {get_ai_show_data, get_report_date, get_test_date_api, test_prompt, get_prompt_api} from "@/apis/ai_show.js"; |
|
|
|
|
|
|
|
|
|
// region 表格数据代码 |
|
|
|
|
const tableData = ref([]) |
|
|
|
|
@ -43,6 +43,7 @@ const form = reactive({ |
|
|
|
|
prompt: '', |
|
|
|
|
}) |
|
|
|
|
const testLoading = ref(false) |
|
|
|
|
const promptLoading = ref(false) |
|
|
|
|
|
|
|
|
|
// 过滤条件数据 |
|
|
|
|
// 计算日期 |
|
|
|
|
@ -228,6 +229,20 @@ async function requestTest() { |
|
|
|
|
form.prompt = '' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function generalPrompt() { |
|
|
|
|
promptLoading.value = true |
|
|
|
|
form.prompt = '' |
|
|
|
|
await get_prompt_api(form.cinema_code, form.show_date).then(res => { |
|
|
|
|
if (res.status === 'success') { |
|
|
|
|
form.prompt = res.data |
|
|
|
|
} |
|
|
|
|
promptLoading.value = false |
|
|
|
|
}).catch(err => { |
|
|
|
|
console.log(err) |
|
|
|
|
}) |
|
|
|
|
promptLoading.value = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const testButton = computed(() => { |
|
|
|
|
if (testLoading.value === true) { |
|
|
|
|
return 'AI排片中' |
|
|
|
|
@ -265,7 +280,15 @@ const objectSpanMethod = ({row, column, rowIndex, columnIndex}) => { |
|
|
|
|
// 日历禁用日期 |
|
|
|
|
const disabledDate = (time) => { |
|
|
|
|
const start = new Date(calendarStart.value) |
|
|
|
|
const end = new Date(calendarEnd.value); |
|
|
|
|
const end = new Date(calendarEnd.value) |
|
|
|
|
return time.getTime() < start || time.getTime() > end |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 日历禁用日期 |
|
|
|
|
const disabledFormDate = (time) => { |
|
|
|
|
const today = new Date() |
|
|
|
|
const start = new Date() |
|
|
|
|
const end = new Date().setDate(today.getDate() + 7) |
|
|
|
|
return time.getTime() < start || time.getTime() > end |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -357,7 +380,9 @@ onBeforeMount( |
|
|
|
|
</el-row> |
|
|
|
|
<el-row style="margin: 10px 0 20px 0" align="middle"> |
|
|
|
|
<el-col :span="2"> |
|
|
|
|
<el-button type="primary" @click="dialogFormVisible = true" :disabled="testLoading" :loading="testLoading">{{testButton}}</el-button> |
|
|
|
|
<el-button type="primary" @click="dialogFormVisible = true" :disabled="testLoading" :loading="testLoading"> |
|
|
|
|
{{ testButton }} |
|
|
|
|
</el-button> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="3" v-if="compareSwitch==='new'" align="right"> |
|
|
|
|
<el-text>手动测试数据:</el-text> |
|
|
|
|
@ -382,7 +407,7 @@ onBeforeMount( |
|
|
|
|
type="date" |
|
|
|
|
placeholder="选择排片日期" |
|
|
|
|
size="default" |
|
|
|
|
:disabled-date="disabledDate" |
|
|
|
|
:disabled-date="disabledFormDate" |
|
|
|
|
value-format="YYYY-MM-DD" |
|
|
|
|
style="width: 140px" |
|
|
|
|
/> |
|
|
|
|
@ -394,6 +419,11 @@ onBeforeMount( |
|
|
|
|
<el-option label="宁波影都(东门口店)" value="33040301"/> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="" :label-width="formLabelWidth"> |
|
|
|
|
<el-button type="primary" @click="generalPrompt" :loading="promptLoading" > |
|
|
|
|
生成提示词 |
|
|
|
|
</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="提示词" :label-width="formLabelWidth"> |
|
|
|
|
<el-input |
|
|
|
|
v-model="form.prompt" |
|
|
|
|
|