|
|
@@ -49,6 +49,7 @@
|
|
|
<a-form-item label="智能体图标">
|
|
|
<a-space direction="vertical" :style="{ width: '100%' }">
|
|
|
<Upload
|
|
|
+ v-if="avatarShow"
|
|
|
:action="uploadAction"
|
|
|
:limit="1"
|
|
|
:url="form.icon ? httpUrl + form.icon : ''"
|
|
|
@@ -162,8 +163,8 @@
|
|
|
:data="form.prompt_config.parameters"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
- <template #key="{ record, rowIndex }">
|
|
|
- <a-input v-model="record.key" placeholder="" />
|
|
|
+ <template #name="{ record, rowIndex }">
|
|
|
+ <a-input v-model="record.name" placeholder="" />
|
|
|
<!-- <a-input v-model="form.prompt_config.parameters[rowIndex].key" />-->
|
|
|
</template>
|
|
|
<template #optional="{ record }">
|
|
|
@@ -259,7 +260,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { onMounted, onBeforeMount, reactive, ref, nextTick, onUnmounted } from "vue";
|
|
|
+import { onMounted, onBeforeMount, reactive, ref, nextTick, onUnmounted, onBeforeUnmount } from "vue";
|
|
|
import { kbdocumentupload, queryKbList, queryModelList } from "@/api/kbList";
|
|
|
import useLoading from "@/hooks/loading";
|
|
|
import { Message } from "@arco-design/web-vue";
|
|
|
@@ -289,6 +290,7 @@ const form = reactive({
|
|
|
parameters: [
|
|
|
{
|
|
|
index: 0,
|
|
|
+ name: "knowledge",
|
|
|
key: "knowledge",
|
|
|
optional: false
|
|
|
}
|
|
|
@@ -315,7 +317,7 @@ let presence_penalty = ref(true);
|
|
|
let frequency_penalty = ref(true);
|
|
|
let max_tokens = ref(true);
|
|
|
const httpUrl = localStorage.getItem('httpUrl');
|
|
|
-let avatarShow = ref(false);
|
|
|
+let avatarShow = ref(true);
|
|
|
|
|
|
const height = ref('calc(500px)');
|
|
|
const props = defineProps(['typeAngint', 'formData']);
|
|
|
@@ -323,8 +325,8 @@ const emit = defineEmits(['queryList']);
|
|
|
const columns = [
|
|
|
{
|
|
|
title: '关键字',
|
|
|
- dataIndex: 'key',
|
|
|
- slotName: 'key',
|
|
|
+ dataIndex: 'name',
|
|
|
+ slotName: 'name',
|
|
|
},
|
|
|
{
|
|
|
title: '可选',
|
|
|
@@ -431,7 +433,6 @@ const handleOpened = (el) => {
|
|
|
avatarShow.value = true;
|
|
|
},100);
|
|
|
})
|
|
|
-
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -456,6 +457,15 @@ const handleBeforeOk = async (done) => {
|
|
|
delete formNew.top_k;
|
|
|
}
|
|
|
|
|
|
+ formNew.prompt_config.parameters = form.prompt_config.parameters.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ key: item.name
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log(formNew,'formNew');
|
|
|
+
|
|
|
if (props.typeAngint == 'edit') {
|
|
|
formNew.dialog_id = form.id;
|
|
|
delete formNew.id;
|
|
|
@@ -498,6 +508,7 @@ const addVariable = () => {
|
|
|
form.prompt_config.parameters.push({
|
|
|
index: form.prompt_config.parameters.length,
|
|
|
key: "",
|
|
|
+ name: "",
|
|
|
optional: true
|
|
|
});
|
|
|
nextTick(() => {
|
|
|
@@ -514,7 +525,6 @@ const deleteParameters = (record) => {
|
|
|
|
|
|
function handleTabChange(key) {
|
|
|
// 处理标签改变事件
|
|
|
- console.log('Changed to tab:', key);
|
|
|
activeKey.value=key;
|
|
|
}
|
|
|
|
|
|
@@ -558,7 +568,7 @@ onBeforeMount(() => {
|
|
|
onMounted(() => {});
|
|
|
|
|
|
|
|
|
-onUnmounted(()=>{
|
|
|
+onBeforeUnmount(()=>{
|
|
|
|
|
|
})
|
|
|
|