feat: 增加AI生成之前的确认行为
This commit is contained in:
parent
7fff2833c3
commit
4ffa30e31a
|
@ -849,6 +849,18 @@ const llmAutoFunc = async (flag) =>{
|
||||||
ElMessage.error('请输入描述')
|
ElMessage.error('请输入描述')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(form.value.fields.length>0){
|
||||||
|
const res = await ElMessageBox.confirm('AI生成会清空当前数据,是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
if (res !== 'confirm') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const res = await llmAuto({prompt:flag?'结构体名称为'+form.value.structName:prompt.value})
|
const res = await llmAuto({prompt:flag?'结构体名称为'+form.value.structName:prompt.value})
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
form.value.fields = []
|
form.value.fields = []
|
||||||
|
|
Loading…
Reference in New Issue