|
@@ -23,7 +23,6 @@ const formatList = ref([])
|
|
|
const promptValue = ref([])
|
|
const promptValue = ref([])
|
|
|
const PromptdialogVisible = ref(false)
|
|
const PromptdialogVisible = ref(false)
|
|
|
const PromptdialogInnerVisible = ref(false)
|
|
const PromptdialogInnerVisible = ref(false)
|
|
|
-const testquestion = ref(false)
|
|
|
|
|
const UnableSaveVisible = ref(false)
|
|
const UnableSaveVisible = ref(false)
|
|
|
const SaveedVisible = ref(false)
|
|
const SaveedVisible = ref(false)
|
|
|
const ChangeLogList = ref([])
|
|
const ChangeLogList = ref([])
|
|
@@ -37,6 +36,16 @@ const addstepdata = () => {
|
|
|
RespnseConfigurationref.value.addstepdata()
|
|
RespnseConfigurationref.value.addstepdata()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 计算属性
|
|
|
|
|
+const testquestiontEmpty = computed(() => {
|
|
|
|
|
+ // 去除首尾空格后检查长度
|
|
|
|
|
+ if(rolename.value.trim().length == 0 || professionalfield.value.trim().length == 0 || maintasks.value.trim().length == 0 || tablename.value.trim().length == 0 || tableDataList.value.length == 0 || stepData.value.length == 0 || formatList.value.length == 0) {
|
|
|
|
|
+ return true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const getPromptConfiguration = () => {
|
|
const getPromptConfiguration = () => {
|
|
|
$api.getPromptConfiguration().then((res) => {
|
|
$api.getPromptConfiguration().then((res) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -53,11 +62,6 @@ const getPromptConfiguration = () => {
|
|
|
promptValue.value = res.data.prompt_summary
|
|
promptValue.value = res.data.prompt_summary
|
|
|
editid.value = res.data.id
|
|
editid.value = res.data.id
|
|
|
ChangeLogList.value = res.data.prompt_log_record
|
|
ChangeLogList.value = res.data.prompt_log_record
|
|
|
- if(rolename.value != '' && professionalfield.value != '' && maintasks.value != '' && professionalfield.value != '' && tableDataList.value.length != 0 && stepData.value.length != 0 && formatList.value.length != 0 && outputvalue.value != '' && prompttextvalue.value != '') {
|
|
|
|
|
- testquestion.value = false
|
|
|
|
|
- } else {
|
|
|
|
|
- testquestion.value = true
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -221,7 +225,7 @@ onMounted(() => {
|
|
|
<div class="flex">
|
|
<div class="flex">
|
|
|
<div style="width: 50%; margin-right: 8px;">
|
|
<div style="width: 50%; margin-right: 8px;">
|
|
|
<div class="little-title">角色名称</div>
|
|
<div class="little-title">角色名称</div>
|
|
|
- <el-input v-model="rolename" placeholder="为AI Robot创建一个角色名称" class="input-name"></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="rolename" placeholder="为AI Robot创建一个角色名称" class="input-name" @change="EditPrompt"></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
<div style="width: 50%;">
|
|
<div style="width: 50%;">
|
|
|
<div class="little-title">专业领域</div>
|
|
<div class="little-title">专业领域</div>
|
|
@@ -239,7 +243,7 @@ onMounted(() => {
|
|
|
<div class="flex">
|
|
<div class="flex">
|
|
|
<div style="width: 50%; margin-right: 8px;">
|
|
<div style="width: 50%; margin-right: 8px;">
|
|
|
<div class="little-title"><span class="stars_red">*</span>表名</div>
|
|
<div class="little-title"><span class="stars_red">*</span>表名</div>
|
|
|
- <el-input v-model="tablename" placeholder="创建一个表名" class="input-name"></el-input>
|
|
|
|
|
|
|
+ <el-input v-model="tablename" placeholder="创建一个表名" class="input-name" @change="EditPrompt"></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
<div style="width: 50%;">
|
|
<div style="width: 50%;">
|
|
|
<div class="little-title">表描述</div>
|
|
<div class="little-title">表描述</div>
|
|
@@ -270,7 +274,7 @@ onMounted(() => {
|
|
|
<div class="propmt-border-colorful">
|
|
<div class="propmt-border-colorful">
|
|
|
<div class="prompt-title" style="padding: 0 14px;">预览与测试</div>
|
|
<div class="prompt-title" style="padding: 0 14px;">预览与测试</div>
|
|
|
<div style="margin-top: 16px;">
|
|
<div style="margin-top: 16px;">
|
|
|
- <PreviewTesting ref="PreviewTestingref" :prompttext="prompttextvalue" :testquestion="testquestion" :promptValue="promptValue" @handleprompt="EditPrompt"></PreviewTesting>
|
|
|
|
|
|
|
+ <PreviewTesting ref="PreviewTestingref" :prompttext="prompttextvalue" :testquestion="testquestiontEmpty" :promptValue="promptValue" @handleprompt="EditPrompt"></PreviewTesting>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="propmt-save"><el-button class="el-button--main" @click="SavePromptConfiguration"><span class="font_family icon-icon_save_b icon_dark" style="margin-right: 5px;"></span>保存生效</el-button></div>
|
|
<div class="propmt-save"><el-button class="el-button--main" @click="SavePromptConfiguration"><span class="font_family icon-icon_save_b icon_dark" style="margin-right: 5px;"></span>保存生效</el-button></div>
|
|
@@ -335,7 +339,7 @@ onMounted(() => {
|
|
|
border-radius: 12px;
|
|
border-radius: 12px;
|
|
|
background-clip: padding-box, border-box;
|
|
background-clip: padding-box, border-box;
|
|
|
background-origin: padding-box, border-box;
|
|
background-origin: padding-box, border-box;
|
|
|
- background-image: linear-gradient(to bottom, #FFF, #FFF), linear-gradient(to bottom, #FF7500, #8112FF);
|
|
|
|
|
|
|
+ background-image: linear-gradient(to bottom, var(--color-mode), var(--color-mode)), linear-gradient(to bottom, #FF7500, #8112FF);
|
|
|
margin-bottom: 8px;
|
|
margin-bottom: 8px;
|
|
|
padding: 13px 0;
|
|
padding: 13px 0;
|
|
|
}
|
|
}
|
|
@@ -397,7 +401,7 @@ onMounted(() => {
|
|
|
overflow-y: scroll;
|
|
overflow-y: scroll;
|
|
|
}
|
|
}
|
|
|
.diaolog-content {
|
|
.diaolog-content {
|
|
|
- background-color: #F8F9FD;
|
|
|
|
|
|
|
+ background-color: var(--color-prompt-diaolog-bg);
|
|
|
padding: 16px;
|
|
padding: 16px;
|
|
|
margin-bottom: 8px;
|
|
margin-bottom: 8px;
|
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|