<template>
|
<div style="display: flex;justify-content: center">
|
<div class="knowledge-body">
|
<el-select v-model="value" size="medium" placeholder="请选择知识库">
|
<el-option
|
v-for="item in options"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value">
|
</el-option>
|
</el-select>
|
<div class="normal-text" style="margin-top: 15px;margin-bottom: 5px">选择知识文件(单个文件不超过200M)</div>
|
<el-alert
|
description="HTML,MD,JSON,CSV,PDF,PNG,JPG,JPEG,BMP,EML,MSG,RST,RIF,TXT,XML,DOCX,EPUB,ODT,PPT,PPTX,TSV,HTM"
|
type="info"
|
:closable="false"
|
show-icon>
|
</el-alert>
|
<el-upload
|
class="upload"
|
drag
|
:on-change="handleChange"
|
:before-upload="handleUpload"
|
:file-list="fileList"
|
multiple>
|
<i class="el-icon-upload"></i>
|
<div class="el-upload__text">
|
<div>将文件拖到此处,或<em>点击上传</em></div>
|
</div>
|
</el-upload>
|
<div class="file-setting">
|
<div class="file-setting-content">
|
<div class="normal-text file-setting-title">文件处理配置</div>
|
<el-form :inline="true" :model="form" size="mini" label-position="top" class="form-inline">
|
<el-form-item label="单段文本最大长度:">
|
<el-input v-model="form.user" type="number"></el-input>
|
</el-form-item>
|
<el-form-item label="相邻文本重合长度:">
|
<el-input v-model="form.user" type="number"></el-input>
|
</el-form-item>
|
<el-form-item label="其它:">
|
<el-checkbox v-model="form.checked">开启中文标题加强</el-checkbox>
|
</el-form-item>
|
</el-form>
|
</div>
|
</div>
|
<div style="margin-top: 15px">
|
<el-button type="primary" size="small">添加文件到知识库</el-button>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
name: "KnowledgeBase",
|
data() {
|
return {
|
fileList: [],
|
form: {
|
|
},
|
options: [{
|
value: '选项1',
|
label: '黄金糕'
|
}, {
|
value: '选项2',
|
label: '双皮奶'
|
}, {
|
value: '选项3',
|
label: '蚵仔煎'
|
}, {
|
value: '选项4',
|
label: '龙须面'
|
}, {
|
value: '选项5',
|
label: '北京烤鸭'
|
}],
|
value: ''
|
}
|
},
|
methods: {
|
handleUpload(file) {
|
if (this.fileList.indexOf(file) === -1) {
|
this.fileList.push(file)
|
}
|
return false
|
},
|
handleChange(file, fileList) {
|
this.fileList = fileList;
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.knowledge-body {
|
width: 650px;
|
margin-top: 70px;
|
}
|
.upload {
|
margin-top: 5px;
|
}
|
.normal-text {
|
color: #606266;
|
font-size: 14px;
|
}
|
.file-setting {
|
width: 100%;
|
height: 100px;
|
border: 1px solid lightgray;
|
border-radius: 6px;
|
position: relative;
|
}
|
.file-setting-title {
|
margin-bottom: 10px;
|
}
|
.file-setting-content {
|
width: 100%;
|
height: 100%;
|
padding: 8px;
|
}
|
.form-inline {
|
padding-left: 10px;
|
}
|
.el-select {
|
width: 100%;
|
}
|
.el-upload__tip {
|
word-wrap: break-word; /* 长单词或URL换行 */
|
overflow-wrap: break-word; /* 更现代的属性,效果类似 */
|
white-space: normal; /* 默认值,允许换行 */
|
}
|
::v-deep .el-upload-dragger {
|
width: 650px !important;
|
}
|
|
::v-deep .el-upload-list {
|
max-height: 100px;
|
overflow-y: scroll;
|
}
|
::v-deep .el-form-item__label {
|
padding-bottom: 0px;
|
}
|
|
::v-deep .el-form-item {
|
margin-right: 20px;
|
}
|
</style>
|