mirror of
http://112.124.100.131/ebiz-ai/ebiz-ai-knowledge-manage.git
synced 2025-12-10 19:36:50 +08:00
refactor(track): 重构知识信息页面
- 引入 TextModel 和 QAModel 组件用于展示不同类型的文档内容 - 修改 _getSplitResultPreview 方法,根据文档类型动态渲染内容 - 优化文档内容展示布局,移除不必要的 prop 属性
This commit is contained in:
@@ -54,15 +54,7 @@ export default {
|
|||||||
visible: Boolean,
|
visible: Boolean,
|
||||||
descriptions: {
|
descriptions: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({ data: [{}] })
|
default: () => ({ data: [] })
|
||||||
},
|
|
||||||
documentDetail: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({})
|
|
||||||
},
|
|
||||||
activeSegment: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,14 +43,11 @@ export default {
|
|||||||
descriptions: {
|
descriptions: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({ data: [] })
|
default: () => ({ data: [] })
|
||||||
},
|
}
|
||||||
documentDetail: {
|
},
|
||||||
type: Object,
|
data() {
|
||||||
default: () => ({})
|
return {
|
||||||
},
|
activeSegment: 0
|
||||||
activeSegment: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
<script>
|
<script>
|
||||||
import { datasetQuerySegments, getPdfUrl, queryTask } from '@/api/generatedApi'
|
import { datasetQuerySegments, getPdfUrl, queryTask } from '@/api/generatedApi'
|
||||||
|
import TextModel from '@/views/knowledge/detail/components/documentDetail/TextModel.vue'
|
||||||
|
import QAModel from '@/views/knowledge/detail/components/documentDetail/QAModel.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'index',
|
name: 'index',
|
||||||
|
components: { QAModel, TextModel },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
iframeSrc: window.location.origin,
|
iframeSrc: window.location.origin,
|
||||||
newForm: {}
|
newForm: {},
|
||||||
|
descriptions: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -62,10 +66,10 @@ export default {
|
|||||||
_getSplitResultPreview() {
|
_getSplitResultPreview() {
|
||||||
console.log(this.form)
|
console.log(this.form)
|
||||||
|
|
||||||
datasetQuerySegments({ documentId: '1361713754874679296' }).then(res => {
|
datasetQuerySegments({ documentId: this.form.id }).then(res => {
|
||||||
const { content } = res.content
|
const descriptions = res.content.content
|
||||||
console.log(`datasetQuerySegments`, res)
|
console.log(`datasetQuerySegments`, res)
|
||||||
|
this.descriptions = descriptions
|
||||||
// this.form.knowledgeContent = content
|
// this.form.knowledgeContent = content
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -142,15 +146,24 @@ export default {
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="24">
|
||||||
<el-form-item label="知识内容"> </el-form-item>
|
<el-form-item label="知识内容">
|
||||||
|
<div class="is-always-shadow" v-if="descriptions">
|
||||||
|
<text-model v-if="descriptions.doc_form === 'text_model'" :descriptions="descriptions" />
|
||||||
|
<q-a-model v-else-if="descriptions.doc_form === 'qa_model'" :descriptions="descriptions" />
|
||||||
|
</div>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="原文内容" />
|
<el-form-item label="原文内容" />
|
||||||
<iframe id="iframe"
|
<iframe
|
||||||
|
id="iframe"
|
||||||
:src="`${iframeSrc}/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(getPdfUrl({ documentId: newForm.id }))}`"
|
:src="`${iframeSrc}/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(getPdfUrl({ documentId: newForm.id }))}`"
|
||||||
class="miner-u el-card is-always-shadow ml20" style="width: 98%; height: 800px;"></iframe>
|
class="miner-u el-card is-always-shadow ml20"
|
||||||
|
style="width: 98%; height: 800px;"
|
||||||
|
></iframe>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
Reference in New Issue
Block a user