Commit ce4b5716 authored by mhw's avatar mhw

提示词修改

parent 9cac7cc5
...@@ -21,11 +21,13 @@ ...@@ -21,11 +21,13 @@
</el-form-item> </el-form-item>
<template v-if="form.scenarioType === 0 "> <template v-if="form.scenarioType === 0 ">
<el-form-item label="模板框架:" class="templateFramework" v-if=" !isEdit"> <el-form-item label="模板框架:" class="templateFramework" v-if=" !isEdit">
<el-tooltip class="item" effect="dark" :content="item.name" placement="top" v-for="item in TemplateFrameworkDict.getList()" :label="item.id" :size="defaultFormItemSize" :key="item.id"> <el-tooltip class="item" effect="dark" :content="item.name" placement="top" v-for="item in TemplateFrameworkDict.getList()" :label="item.id" :size="defaultFormItemSize" :key="item.id">
<el-radio v-model="form.templateFramework" @input="$refs.promptInput.init()" :label="item.id">{{ item.symbol }}</el-radio> <el-radio v-model="form.templateFramework" @input="$refs.promptInput.init()" :label="item.id">{{ item.symbol }}</el-radio>
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
<el-form-item label="Prompt:" prop="templateContent" key="templateContent1"> <el-form-item label="Prompt:" prop="templateContent" key="templateContent1">
<promptInput ref="promptInput" v-model="form.templateContent" :templateFramework="form.templateFramework" :isEdit="isEdit" /> <promptInput ref="promptInput" v-model="form.templateContent" :templateFramework="form.templateFramework" :isEdit="isEdit" />
</el-form-item> </el-form-item>
</template> </template>
...@@ -58,7 +60,7 @@ export default { ...@@ -58,7 +60,7 @@ export default {
interfaceAddress: '', interfaceAddress: '',
negativeTemplateContent: '', negativeTemplateContent: '',
negativeTemplateVariables: '', negativeTemplateVariables: '',
parameterFormat: '', parameterFormat: '{}',
scenarioType: 0, scenarioType: 0,
templateContent: '', templateContent: '',
templateFramework: 0, templateFramework: 0,
...@@ -131,8 +133,7 @@ export default { ...@@ -131,8 +133,7 @@ export default {
}); });
}); });
}, },
changeScenarioType () { changeScenarioType (data) {
console.log(this.$refs.promptInput);
if (this.$refs.promptInput) { if (this.$refs.promptInput) {
this.$refs.promptInput.init() this.$refs.promptInput.init()
} }
......
<!--prompt输入 --> <!--prompt输入 -->
<template> <template>
<div > <div >
<el-input v-if="[1,2,3].indexOf(templateFramework)===-1||isEdit" type="textarea" :rows="5" placeholder="请输入内容" :value="prompt" class="inputWidth" @input="changeInput"></el-input> <el-input v-if="[1,2,3].indexOf(templateFramework)===-1||isEdit" type="textarea" :rows="5" placeholder="请输入内容" :value="prompt" class="inputWidth" @input="changeInput2"></el-input>
<el-card class="box-card" style="width:600px" v-else> <el-card class="box-card" style="width:600px" v-else>
<div class="inputBox" v-for="(item,index) in myPrompts" :key="index"> <div class="inputBox" v-for="(item,index) in myPrompts" :key="index">
...@@ -128,9 +128,13 @@ export default { ...@@ -128,9 +128,13 @@ export default {
return item.label + ':' + item.value + '\n' return item.label + ':' + item.value + '\n'
} }
}).join('') }).join('')
console.log(promptsString); console.log(this.templateFramework);
this.$emit('input', [1, 2, 3].indexOf(this.templateFramework) === -1 ? this.prompt : promptsString) this.$emit('input', [1, 2, 3].indexOf(this.templateFramework) === -1 ? this.prompt : promptsString)
}, },
changeInput2 (data) {
this.prompt = data
this.$emit('input', this.prompt)
},
add (item) { add (item) {
if (item.tableData.length === 20) return if (item.tableData.length === 20) return
item.tableData.push({ item.tableData.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment