forked from yjx010902/heterogeneous-retrieval
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfine_grainedAnalysis.vue
89 lines (79 loc) · 2.5 KB
/
fine_grainedAnalysis.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<template>
<div class="main fine_page">
<div class="head ">
<a href="javascript:void(0);" @click="returnMain" class="return">
<i class="el-icon-arrow-left"></i> <p>返回</p>
</a>
<h1>面向大规模复杂文档数据的细粒度检索</h1>
<el-input placeholder="请输入内容" v-model="searchValue">
<el-button slot="append" @click="startSearch">搜索</el-button>
</el-input>
</div>
<div class="margin">
<div class="title">检索结果</div>
<div class="text">
<ul>
<li v-for="(item,index) in searchResult" :key="index">
<a href="javascript:void(0);" @click="showMain(item)">
<h2 class="color_3">No{{index+1}}.</h2><span>{{item.name}}</span>
</a>
</li>
</ul>
</div>
</div>
<el-dialog
title="文件预览"
:visible.sync="fileDialogVisible"
width="50%"
center>
<el-scrollbar style="height:60vh;">
<!-- <span>需要注意的是内容是默认不居中的</span>-->
<!-- <iframe frameborder="0" width="100%" height="410" :src="fileUrl"></iframe>-->
<span v-html="file_text"></span>
</el-scrollbar>
</el-dialog>
</div>
</template>
<script>
export default {
name: "fine_grainedAnalysis",
data(){
return{
file_text:'',
fileDialogVisible:false,
searchResult:[],
searchValue:'',
};
},
methods:{
returnMain(){
this.$router.push({path:'/mainPage'})
},
startSearch(){
this.axios.post(
// "https://mock.apifox.cn/m1/3018081-0-default/fine_grained",
"http://192.168.13.26:5003/fine_grainedAnalysis/getResult",
{searchValue:this.searchValue},
{headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
).then(res=>{
console.log(res);
if(res.status==200) {
this.searchResult = res.data.fileResult;
console.log(this.searchResult)
}
})
},
showMain(item){
this.fileDialogVisible=true;
this.file_text=item.content;
}
}
}
</script>
<style scoped>
</style>
<style>
</style>