|
@@ -38,8 +38,7 @@ export default {
|
|
|
this.promptData.title = nval.Title;
|
|
|
this.$refs.editorRef&&this.$refs.editorRef.initData(nval.PromptContent)
|
|
|
}else {
|
|
|
- this.promptData.title=''
|
|
|
- this.$refs.editorRef&&this.$refs.editorRef.initData('')
|
|
|
+ this.reset()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -57,13 +56,17 @@ export default {
|
|
|
this.$refs.editorRef&&this.$refs.editorRef.initData(this.item.PromptContent)
|
|
|
})
|
|
|
}else {
|
|
|
+ this.reset()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ reset() {
|
|
|
this.promptData.title=''
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.editorRef&&this.$refs.editorRef.initData('')
|
|
|
})
|
|
|
- }
|
|
|
- },
|
|
|
- methods:{
|
|
|
+ },
|
|
|
+
|
|
|
async handleSavePrompt() {
|
|
|
if(!this.promptData.title) return this.$message.warning('请输入提示词名称')
|
|
|
|
|
@@ -79,6 +82,7 @@ export default {
|
|
|
if(res.Ret !== 200) return
|
|
|
this.$message.success(res.Msg)
|
|
|
|
|
|
+ !this.item.AiPromptId&&this.reset()
|
|
|
this.$emit('success')
|
|
|
}
|
|
|
},
|