Commit 7e22d874 by liimin

1

1 parent 02bcb7bc
......@@ -91,7 +91,7 @@
</span>
<span v-else>解析结果</span>
</template>
<el-input type="textarea" v-model="orderform.result" rows="3"></el-input>
<el-input type="textarea" v-model="orderform.result" rows="4"></el-input>
</el-form-item>
</div>
</el-form>
......@@ -637,7 +637,8 @@ export default {
async handleOrder() {
this.disabled = true
this.gptRequest = true
//await this.handleResetOrder()
this.searchForm = {}
// this.resetTable()
// const tagsAll = this.tableParams.reduce((tags, next) => {
// tags += next.labelUnitList.map(({ labelName }) => labelName).join(',')
// return tags + ','
......@@ -663,7 +664,7 @@ export default {
Object.assign(this.keys, { subject: '', festival: '' })
const order = this.orderform.order
// const content = '帮我查询从2023-3-29日至2023-04-05日期间西安飞广州或者深圳的机票,从上面一句话中提取出发日期,命名为date,出发地,命名为start,目的地,命名为end,输出json格式。'
const content = `${order},忽略之前的上下文,今年是2023年,针对上面这段文字,
const content = `${order},今年是2023年,针对上面这段文字,
提取出营销文案关键字,命名为subject;
提取出节日,命名为festival,如果是数字,转化成大写,例如:五一节;
提取出车主归属地或者车牌号,命名为carNumber,如广东的车主,则取值为"粤";
......@@ -713,7 +714,7 @@ export default {
return element
})
// let content = '我有一批客户,资料(id,customerName,customerSex,customerPhone,buyDate,carVin,carNumber) 分别是:'
let content = `忽略之前的上下文,现在是2023年,我有${list.length}个客户资料分别是:`
let content = `现在是2023年,我有${list.length}个客户资料分别是:`
let cutomerInfo = []
for (let index = 0; index < list.length; index++) {
let { customerName, customerSex, customerPhone, buyDate, carVin, carNumber } = list[index]
......@@ -725,16 +726,26 @@ export default {
this.$apis.crowdManage.gpt(content).then(result => {
const { code, success, message, data } = result
if (code == '000000' && success) {
if (!result.data) {
this.$message.error('生成文案异常,请重试!')
return
}
// if (!result.data) {
// this.$message.error('生成文案异常,请重试!')
// return
// }
// console.log(result)
// let _obj = result.data
// this.$refs.clientManage.data[index].test = _obj.content
// this.$refs.clientManage.data = this.$refs.clientManage.data
list.map((k, i) => {
k.test = result.data.customers[i].content
k.test = result?.data?.customers[i]?.content || '生成文案异常,请重试!'
const { customerName, customerSex, customerPhone } = k
k.test &&
k.test != '生成文案异常,请重试!' &&
setTimeout(() => {
this.$notify({
title: '发送成功',
message: `${customerName}${{ 1: '先生', 2: '女士' }[customerSex] || '先生/女士'},手机号:${customerPhone} 发送成功.`,
type: 'success'
})
}, i * 1000)
return k
})
this.$forceUpdate()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!