|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <el-dialog :title="title" v-model="dialogFormVisible">
|
|
|
+ <el-dialog :title="title" v-model="dialogFormVisible" @closed="handleClosed">
|
|
|
<el-form :model="form">
|
|
|
<el-form-item label="任务名称" :label-width="formLabelWidth">
|
|
|
<el-input v-model="form.name" autocomplete="off"></el-input>
|
|
@@ -57,8 +57,9 @@
|
|
|
<el-input v-model="knowledgeBase.querySearch" size="large" placeholder="搜索"
|
|
|
@keydown.enter="debounceGetKBfileList" :prefix-icon="Search" />
|
|
|
</span>
|
|
|
- <span class="add-file" @click="true && handleImportFiles(toRaw(knowledgeBase.filesList))"><span
|
|
|
- class="text">全部导入</span></span>
|
|
|
+ <span class="add-file" @click="handleImportFiles(toRaw(knowledgeBase.filesList))">
|
|
|
+ <span class="text">全部导入</span>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
<el-scrollbar class="management-content-middle">
|
|
|
<el-table :data="knowledgeBase.filesList">
|
|
@@ -94,7 +95,7 @@
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column fixed="right" label="操作" width="120">
|
|
|
+ <el-table-column fixed="right" label="操作" min-width="55">
|
|
|
<template #default="{ row }">
|
|
|
<div class="operation">
|
|
|
<el-button link type="primary" @click="handleImportFiles([toRaw(row)])">导入</el-button>
|
|
@@ -257,7 +258,7 @@ function fetchFile(fileName: string, fileUrl: string) {
|
|
|
file.uid = genFileId()
|
|
|
// file = file as UploadRawFile
|
|
|
upload.value!.handleStart(file)
|
|
|
- knowledgeBase.value.visible = false
|
|
|
+ // knowledgeBase.value.visible = false
|
|
|
ElMessage({
|
|
|
message: `文件“${fileName}”导入成功`,
|
|
|
type: 'success'
|
|
@@ -318,6 +319,10 @@ const handleConfirm = () => {
|
|
|
}
|
|
|
defineExpose({ showDialog })
|
|
|
|
|
|
+function handleClosed() {
|
|
|
+ knowledgeBase.value.visible = false
|
|
|
+}
|
|
|
+
|
|
|
watch(() => knowledgeBase.value.activeId, (newValue) => {
|
|
|
debounceGetKBfileList()
|
|
|
// console.log('activeId', newValue)
|
|
@@ -345,21 +350,24 @@ onMounted(() => {
|
|
|
<style lang="less" scoped>
|
|
|
.knowledge-base {
|
|
|
position: fixed;
|
|
|
- top: 0;
|
|
|
- left: 0;
|
|
|
- width: 100vw;
|
|
|
- height: 100vh;
|
|
|
+ top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ width: 80vw;
|
|
|
+ height: 90vh;
|
|
|
background-color: white;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
// overflow: auto;
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
+ border-radius: 5px;
|
|
|
+ min-width: 800px;
|
|
|
|
|
|
.topbar {
|
|
|
padding: 5px;
|
|
|
flex: 0 0 auto;
|
|
|
|
|
|
.close-knowledge-base {
|
|
|
- margin-left: calc(100vw - 30px);
|
|
|
+ margin-left: calc(100% - 24px);
|
|
|
cursor: pointer;
|
|
|
|
|
|
}
|