|
|
|
@ -12,12 +12,18 @@
|
|
|
|
|
<img src="@/assets/common/file_empty.png" alt="">
|
|
|
|
|
<span>暂无结果,请在右侧输入调试内容或上传文档</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="dataList.length > 0" class="data-list">
|
|
|
|
|
<div v-if="dataList.length > 0 && dataInfo.type === '1'" class="data-list">
|
|
|
|
|
<div v-for="(item,index) in dataList" :key="index" class="data-item">
|
|
|
|
|
<div class="left">{{ item.attrName }}</div>
|
|
|
|
|
<div class="right">{{ item.attrValue }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="dataList.length > 0 && dataInfo.type === '2'" class="data-list">
|
|
|
|
|
<vxe-grid
|
|
|
|
|
ref="entityTable"
|
|
|
|
|
v-bind="entityOptions"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
@ -77,6 +83,16 @@ export default {
|
|
|
|
|
action: `${baseURL}/minio/uploadFile`,
|
|
|
|
|
accept: '.txt,.doc,.docx'
|
|
|
|
|
},
|
|
|
|
|
// 实体关系配置
|
|
|
|
|
entityOptions: {
|
|
|
|
|
columns: [
|
|
|
|
|
{ title: '头节点', field: 'headEntityName' },
|
|
|
|
|
{ title: '关系', field: 'relation' },
|
|
|
|
|
{ title: '尾节点', field: 'tailEntityName' }
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
data: []
|
|
|
|
|
},
|
|
|
|
|
token: getAccessToken(),
|
|
|
|
|
fileId: '',
|
|
|
|
|
fileList: [],
|
|
|
|
@ -121,20 +137,32 @@ export default {
|
|
|
|
|
this.$message.error('请上传文件或者输入调试内容!')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const loading = this.$baseLoading(1, '调试中...')
|
|
|
|
|
const params = {
|
|
|
|
|
text: this.text,
|
|
|
|
|
type: this.dataInfo.type,
|
|
|
|
|
prompt: this.dataInfo.prompt,
|
|
|
|
|
extractAttributes: this.dataInfo.extractAttributes,
|
|
|
|
|
fileId: this.fileId
|
|
|
|
|
...this.dataInfo,
|
|
|
|
|
// type: this.dataInfo.type,
|
|
|
|
|
// prompt: this.dataInfo.prompt,
|
|
|
|
|
// extractAttributes: this.dataInfo.extractAttributes,
|
|
|
|
|
fileId: this.fileId,
|
|
|
|
|
text: this.text
|
|
|
|
|
}
|
|
|
|
|
if (params.type === '2') {
|
|
|
|
|
params.tripleList = this.list
|
|
|
|
|
}
|
|
|
|
|
promptDebugging(params).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
loading.close()
|
|
|
|
|
if (res.code === 200 && res.data) {
|
|
|
|
|
this.dataList = res.data
|
|
|
|
|
if (this.dataInfo.type === '2') {
|
|
|
|
|
this.entityOptions.data = res.data
|
|
|
|
|
for (const item of this.entityOptions.data) {
|
|
|
|
|
item.headEntityName = item.headEntity.name
|
|
|
|
|
item.tailEntityName = item.tailEntity.name
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
loading.close()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|