fix: 修复变量名过长问题

This commit is contained in:
wangdan-fit2cloud 2024-08-19 18:47:13 +08:00
parent cb141a368a
commit d1a142e658
3 changed files with 25 additions and 11 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog <el-dialog
title="导入文档" :title="title"
v-model="dialogVisible" v-model="dialogVisible"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
@ -94,6 +94,10 @@ const {
params: { id } params: { id }
} = route as any } = route as any
const props = defineProps({
title: String
})
const emit = defineEmits(['refresh']) const emit = defineEmits(['refresh'])
const webFormRef = ref() const webFormRef = ref()
const loading = ref<boolean>(false) const loading = ref<boolean>(false)
@ -173,7 +177,9 @@ const submit = async (formEl: FormInstance | undefined) => {
if (documentId.value) { if (documentId.value) {
const obj = { const obj = {
hit_handling_method: form.value.hit_handling_method, hit_handling_method: form.value.hit_handling_method,
directly_return_similarity: form.value.directly_return_similarity || 0.9, directly_return_similarity: Number(form.value.directly_return_similarity)
? form.value.directly_return_similarity
: 0.9,
meta: { meta: {
source_url: form.value.source_url, source_url: form.value.source_url,
selector: form.value.selector selector: form.value.selector
@ -188,7 +194,9 @@ const submit = async (formEl: FormInstance | undefined) => {
// //
const obj = { const obj = {
hit_handling_method: form.value.hit_handling_method, hit_handling_method: form.value.hit_handling_method,
directly_return_similarity: form.value.directly_return_similarity || 0.9, directly_return_similarity: Number(form.value.directly_return_similarity)
? form.value.directly_return_similarity
: 0.9,
id_list: documentList.value id_list: documentList.value
} }
documentApi.batchEditHitHandling(id, obj, loading).then(() => { documentApi.batchEditHitHandling(id, obj, loading).then(() => {

View File

@ -29,8 +29,11 @@
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<div> <div>
<span <span>
>{{ item.name }} <span class="danger" v-if="item.is_required">*</span></span <auto-tooltip :content="item.name">
{{ item.name }}
</auto-tooltip>
<span class="danger" v-if="item.is_required">*</span></span
> >
<el-tag type="info" class="info-tag ml-4">{{ item.type }}</el-tag> <el-tag type="info" class="info-tag ml-4">{{ item.type }}</el-tag>
</div> </div>

View File

@ -33,10 +33,13 @@
> >
<template #label> <template #label>
<div class="flex-between"> <div class="flex-between">
<div> <div class="flex">
<span <span class="flex">
>{{ item.name }} <span class="danger" v-if="item.is_required">*</span></span <auto-tooltip :content="item.name" style="max-width: 130px">
> {{ item.name }}
</auto-tooltip>
<span class="danger" v-if="item.is_required">*</span>
</span>
<el-tag type="info" class="info-tag ml-4">{{ item.type }}</el-tag> <el-tag type="info" class="info-tag ml-4">{{ item.type }}</el-tag>
</div> </div>
<div> <div>
@ -197,7 +200,7 @@ function openAddDialog(data?: any, index?: any) {
} }
function deleteField(index: any) { function deleteField(index: any) {
const list = cloneDeep(props.nodeModel.properties.node_data.input_field_list) const list: any = cloneDeep(props.nodeModel.properties.node_data.input_field_list)
list.splice(index, 1) list.splice(index, 1)
set(props.nodeModel.properties.node_data, 'input_field_list', list) set(props.nodeModel.properties.node_data, 'input_field_list', list)
} }
@ -205,7 +208,7 @@ function deleteField(index: any) {
function refreshFieldList(data: any) { function refreshFieldList(data: any) {
const list = cloneDeep(props.nodeModel.properties.node_data.input_field_list) const list = cloneDeep(props.nodeModel.properties.node_data.input_field_list)
const obj = { const obj = {
value: '', value: data.source === 'reference' ? [] : '',
...data ...data
} }
if (currentIndex.value !== null) { if (currentIndex.value !== null) {