|
|
|
@ -33,12 +33,25 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="rightContent"> |
|
|
|
|
|
|
|
<div style="color: white; margin:1vw 2vw 0vw 2vw;"> |
|
|
|
关键字: |
|
|
|
<input style="background-color: transparent; border: none; border-bottom: 1px solid white; color: white; outline: none;" placeholder="请输入关键字" v-model="keywords"/> |
|
|
|
<div style="float: right;"> |
|
|
|
<el-button type="primary" plain icon="el-icon-upload2" size="mini" @click="openFileInput" >导入</el-button> |
|
|
|
|
|
|
|
<input |
|
|
|
ref="fileInput" |
|
|
|
type="file" |
|
|
|
accept=".doc, .docx" |
|
|
|
style="display: none;" |
|
|
|
@change="handleFileChange" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div @click="getInfo1" style="width: 3vw;height: 1.5vw;background-color: #001c3a;float: right;text-align: center;border-radius:1vw;"> |
|
|
|
查询 |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="rightList"> |
|
|
|
|
|
|
|
@ -111,7 +124,7 @@ import {getgraphInfo, test} from "@/api/login"; |
|
|
|
import VisGraph from '@/assets/js/graphvis.min.20241008.js' |
|
|
|
import LayoutFactory from '@/assets/js/graphvis.layout.min.js' |
|
|
|
import {config} from '@/assets/defaultConfig.js' |
|
|
|
import {addNode, getFileIdByDocId} from "@/api/file"; |
|
|
|
import {addFile, addNode, getFileIdByDocId} from "@/api/file"; |
|
|
|
|
|
|
|
export default { |
|
|
|
// eslint-disable-next-line vue/multi-word-component-names |
|
|
|
@ -164,6 +177,35 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
openFileInput() { |
|
|
|
// 触发隐藏的文件输入框点击事件 |
|
|
|
this.$refs.fileInput.click(); |
|
|
|
}, |
|
|
|
handleFileChange(event) { |
|
|
|
const file = event.target.files[0]; |
|
|
|
if (file) { |
|
|
|
this.uploadFile(file); |
|
|
|
} |
|
|
|
}, |
|
|
|
uploadFile(file) { |
|
|
|
// 调用API函数进行文件上传 |
|
|
|
addFile(file) |
|
|
|
.then(response => { |
|
|
|
if (response.code === 200) { |
|
|
|
this.$message.success('文件上传成功'); |
|
|
|
} else { |
|
|
|
this.$message.error('文件上传失败'); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
console.error('文件上传错误:', error); |
|
|
|
this.$message.error('文件上传失败'); |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
// 清除文件选择框的内容以便下次使用 |
|
|
|
this.$refs.fileInput.value = null; |
|
|
|
}); |
|
|
|
}, |
|
|
|
goInfo(info) { |
|
|
|
console.log(info) |
|
|
|
this.$router.push('/' + info) |
|
|
|
|