ocr_2.0
xiangcongshuai 6 months ago
parent f515468995
commit 9d8efd20a0

@ -5,7 +5,7 @@ const network = {
// 默认的接口地址 如果是开发环境和生产环境走vab-mock-server当然你也可以选择自己配置成需要的接口地址 // 默认的接口地址 如果是开发环境和生产环境走vab-mock-server当然你也可以选择自己配置成需要的接口地址
baseURL: baseURL:
process.env.NODE_ENV === 'development' process.env.NODE_ENV === 'development'
? 'http://192.168.10.25:8097/fu-hsi-server' ? 'http://192.168.10.138:8097/fu-hsi-server'
: '/fuHsiApi', : '/fuHsiApi',
// 配后端数据的接收方式application/json;charset=UTF-8或者application/x-www-form-urlencoded;charset=UTF-8 // 配后端数据的接收方式application/json;charset=UTF-8或者application/x-www-form-urlencoded;charset=UTF-8
contentType: 'application/json;charset=UTF-8', contentType: 'application/json;charset=UTF-8',

@ -28,7 +28,7 @@
<el-button type="primary" @click="delAll"></el-button> <el-button type="primary" @click="delAll"></el-button>
</div> </div>
<!-- <el-input v-model="searchName" placeholder="搜索名称" style="width: 300px" /> --> <el-input v-model="searchName" placeholder="搜索名称" style="width: 300px" />
</div> </div>
<div class="nav-list"> <div class="nav-list">
<div v-for="(item,index) in navList" :key="index" class="nav-item"> <div v-for="(item,index) in navList" :key="index" class="nav-item">
@ -172,7 +172,7 @@ export default {
}), }),
addOk() { addOk() {
this.getTreeList() this.getTreeList()
this.fetchData() this.fetchData()
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true

@ -28,7 +28,7 @@
</div> </div>
</template> </template>
<template #detail="{row}"> <template #detail="{row}">
<span v-if="row.parentIndexName"><el-button v-if="!row.isRead" type="text" @click="handleDetails(row)">{{ row.indexName }}</el-button><span v-else @click="handleDetails(row)">{{ row.indexName }}</span></span> <span v-if="row.parentIndexName"><a v-if="!row.isRead" style="text-decoration: underline;" @click="handleDetails(row)">{{ row.indexName }}</a><span style="text-decoration: underline;cursor: pointer;" v-else @click="handleDetails(row)">{{ row.indexName }}</span></span>
<span v-else>{{ row.indexName }}</span> <span v-else>{{ row.indexName }}</span>
</template> </template>
<template #result="{row}"> <template #result="{row}">

@ -28,7 +28,7 @@
</div> </div>
</template> </template>
<template #detail="{row}"> <template #detail="{row}">
<span v-if="row.parentIndexName"><el-button type="text" @click="handleDetails(row)">{{ row.indexName }}</el-button></span> <span v-if="row.parentIndexName"><a v-if="!row.isRead" style="text-decoration: underline;" @click="handleDetails(row)">{{ row.indexName }}</a><span style="text-decoration: underline;cursor: pointer;" v-else @click="handleDetails(row)">{{ row.indexName }}</span></span>
<span v-else>{{ row.indexName }}</span> <span v-else>{{ row.indexName }}</span>
</template> </template>
<template #result="{row}"> <template #result="{row}">
@ -168,6 +168,7 @@ export default {
}) })
}, },
handleDetails(row) { handleDetails(row) {
this.$set(row, 'isRead', true)
this.$refs.details.show(row) this.$refs.details.show(row)
}, },
// //

@ -28,7 +28,7 @@
</div> </div>
</template> </template>
<template #detail="{row}"> <template #detail="{row}">
<span v-if="row.parentIndexName"><el-button type="text" @click="handleDetails(row)">{{ row.indexName }}</el-button></span> <span v-if="row.parentIndexName"><a v-if="!row.isRead" style="text-decoration: underline;" @click="handleDetails(row)">{{ row.indexName }}</a><span style="text-decoration: underline;cursor: pointer;" v-else @click="handleDetails(row)">{{ row.indexName }}</span></span>
<span v-else>{{ row.indexName }}</span> <span v-else>{{ row.indexName }}</span>
</template> </template>
<template #result="{row}"> <template #result="{row}">
@ -165,6 +165,7 @@ export default {
}) })
}, },
handleDetails(row) { handleDetails(row) {
this.$set(row, 'isRead', true)
this.$refs.details.show(row) this.$refs.details.show(row)
}, },
// //

@ -102,7 +102,7 @@ export default {
.error { .error {
font-weight: 400; font-weight: 400;
font-size: 16px; font-size: 16px;
color: red; color: #3763FF;
} }
} }
.btn-list { .btn-list {

@ -96,12 +96,12 @@
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</div> </div>
<div class="info-right"> <div v-loading="!showFlag" class="info-right">
<h4 style="margin: 0"> <h4 style="margin: 0">
<span>{{ selectTitle }}</span> <span>{{ selectTitle }}</span>
<span v-if="score!==''">{{ ` ${score}` }}</span> <span v-if="score!==''">{{ ` ${score}` }}</span>
</h4> </h4>
<component :is="selectCom" :is-edit="isEdit" :is-expand="expand" @reloadData="fetchData" /> <component :is="selectCom" v-if="showFlag" :is-edit="isEdit" :is-expand="expand" @reloadData="fetchData" />
</div> </div>
</div> </div>
<!--编辑/新增弹窗--> <!--编辑/新增弹窗-->
@ -158,6 +158,7 @@ export default {
alignItems: 'center', alignItems: 'center',
boxShadow: '0px 1px 30px 0px rgba(255,169,66,0.2)' boxShadow: '0px 1px 30px 0px rgba(255,169,66,0.2)'
}, },
showFlag: true,
score: '', score: '',
// //
leftTabs: [ leftTabs: [
@ -282,6 +283,7 @@ export default {
}, },
// //
handleAnalysis() { handleAnalysis() {
this.showFlag = false
this.handleConfirmAnalysis() this.handleConfirmAnalysis()
let value = 80 let value = 80
if (this.timer) return if (this.timer) return
@ -290,6 +292,7 @@ export default {
value = value === 20 ? 80 : 20 value = value === 20 ? 80 : 20
}, 500) }, 500)
setTimeout(() => { setTimeout(() => {
this.showFlag = true
this.fetchData() this.fetchData()
}, 5000) }, 5000)
@ -306,7 +309,7 @@ export default {
const { code, msg } = res const { code, msg } = res
this.$set(this.caseData, 'isAnalysing', false) this.$set(this.caseData, 'isAnalysing', false)
code === 200 ? this.$baseMessage.success(msg || '模型分析成功!') : this.$baseMessage.error(msg || '模型分析失败!') code === 200 ? this.$baseMessage.success(msg || '模型分析成功!') : this.$baseMessage.error(msg || '模型分析失败!')
// this.fetchData() this.fetchData()
}) })
}, },
// //

@ -459,7 +459,6 @@ export default {
// //
const cleanText = text.replace(/\s/g, '') const cleanText = text.replace(/\s/g, '')
// div HTML // div HTML
const tempDiv = document.createElement('div') const tempDiv = document.createElement('div')
tempDiv.innerHTML = html tempDiv.innerHTML = html

@ -89,7 +89,7 @@
</div> </div>
</div> </div>
<div v-if="dataInfo.prompt" class="content"> <div v-if="showFlag" class="content">
<!-- <el-input <!-- <el-input
v-model="dataInfo['prompt']" v-model="dataInfo['prompt']"
type="textarea" type="textarea"
@ -155,6 +155,7 @@ export default {
'1': ['source_text', 'attr_define'], '1': ['source_text', 'attr_define'],
'2': ['headEntityType', 'tailEntityType', 'relation'] '2': ['headEntityType', 'tailEntityType', 'relation']
}, },
showFlag: true,
// //
entityOptions: { entityOptions: {
...mixin.data().gridOptions, ...mixin.data().gridOptions,
@ -175,9 +176,9 @@ export default {
data: [] data: []
}, },
rules: { rules: {
caseType: [{ required: true, message: '案件类型不能为空!', trigger: 'blur' }], caseType: [{ required: true, message: '案件类型不能为空!', trigger: 'change' }],
type: [{ required: true, message: '提示词类型不能为空!', trigger: 'blur' }], type: [{ required: true, message: '提示词类型不能为空!', trigger: 'change' }],
name: [{ required: true, message: '提示词名称不能为空!', trigger: 'blur' }], name: [{ required: true, message: '提示词名称不能为空!', trigger: 'change' }],
typeList: [{ required: true, message: '分类不能为空!', trigger: 'change' }], typeList: [{ required: true, message: '分类不能为空!', trigger: 'change' }],
evidenceCategoryIdList: [{ required: true, message: '所属目录不能为空!', trigger: 'change' }], evidenceCategoryIdList: [{ required: true, message: '所属目录不能为空!', trigger: 'change' }],
extractAttributes: [{ required: true, message: '提取属性不能为空!', trigger: 'change' }] extractAttributes: [{ required: true, message: '提取属性不能为空!', trigger: 'change' }]
@ -223,17 +224,20 @@ export default {
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.dataInfo = res.data this.dataInfo = res.data
this.dataInfo.extractAttributes = res.data.extractAttributes || []
this.entityOptions.data = res.data.tripleList || [] this.entityOptions.data = res.data.tripleList || []
this.data.rules = '(问[:](.*?))\s*答[:](.*?)(?=(问[:]|$))' this.data.rules = '(问[:](.*?))\s*答[:](.*?)(?=(问[:]|$))'
} }
}) })
}, },
selectType(val) { selectType(val) {
this.$refs.form.clearValidate()
this.$set(this.dataInfo, 'prompt', null) this.$set(this.dataInfo, 'prompt', null)
this.showFlag = false
this.$nextTick(() => { this.$nextTick(() => {
const text = this.getPromptText(val) const text = this.getPromptText(val)
this.$set(this.dataInfo, 'prompt', text || ' ') this.$set(this.dataInfo, 'prompt', text || ' ')
console.log('text', this.dataInfo) this.showFlag = true
}) })
if (val === '2') { if (val === '2') {
this.entityOptions.data = [ this.entityOptions.data = [
@ -308,7 +312,7 @@ export default {
}, },
reset() { reset() {
this.dataInfo = { this.dataInfo = {
rules: '(问[:](.*?))\s*答[:](.*?)(?=(问[:]|$))', rules: '(问[:](.*?))\s*答[:](.*?)(?=(问[:]|$))',
caseType: '', caseType: '',
type: '1', type: '1',
@ -339,7 +343,7 @@ export default {
} }
addOrUpdPrompt(params).then(res => { addOrUpdPrompt(params).then(res => {
const { code, msg } = res const { code, msg } = res
code === 200 ? (this.id ? this.$baseMessage.success(msg || '编辑成功!') : this.$baseMessage.success(msg || '新增成功!')) : (this.id ? this.$baseMessage.error(msg || '编辑失败!') : this.$baseMessage.error(msg || '新增失败!')) code === 200 ? (this.$route.params.id ? this.$baseMessage.success(msg || '编辑成功!') : this.$baseMessage.success(msg || '新增成功!')) : (this.$route.params.id ? this.$baseMessage.error(msg || '编辑失败!') : this.$baseMessage.error(msg || '新增失败!'))
this.$store.dispatch( this.$store.dispatch(
'tabsBar/delRoute', 'tabsBar/delRoute',
this.$route this.$route

@ -200,7 +200,7 @@ export default {
_this.isView = data && !isEdit _this.isView = data && !isEdit
_this.ruleForm = data ? formData : (isEdit ? formData : { indexSource: '1' }) _this.ruleForm = data ? formData : (isEdit ? formData : { indexSource: '1' })
_this.drawerOption.hiddenFooter = _this.isView _this.drawerOption.hiddenFooter = _this.isView
this.selectInfo.extractAttributes = data.properties.split(',') this.selectInfo.extractAttributes = data.properties ? data.properties.split(',') : []
this.selectInfo.promptName = data.promptName this.selectInfo.promptName = data.promptName
this.selectInfo.promptId = data.promptId this.selectInfo.promptId = data.promptId
}) })

@ -69,6 +69,7 @@
placeholder="请选择" placeholder="请选择"
clearable clearable
style="width: 150px;margin-left: 20px" style="width: 150px;margin-left: 20px"
@change="((val)=>{selectRelational(val, subItem)})"
> >
<el-option <el-option
v-for="option in symbolOptions" v-for="option in symbolOptions"
@ -82,7 +83,6 @@
<el-select <el-select
v-model="subItem.operator" v-model="subItem.operator"
placeholder="请选择" placeholder="请选择"
clearable
style="width: 100px;margin-left: 20px" style="width: 100px;margin-left: 20px"
> >
<el-option <el-option
@ -279,7 +279,7 @@ export default {
return { return {
// //
ruleConditionGroupList: [ ruleConditionGroupList: [
{ rowLogic: '2', ruleConditionList: [{ atomicIndexId: '', indexSource: '', logic: '2', relationalSymbol: '', operator: '', value: '', operandUnitList: [] }] } { rowLogic: '2', ruleConditionList: [{ atomicIndexId: '', indexSource: '', logic: '2', relationalSymbol: '', operator: '>', value: '', operandUnitList: [] }] }
], ],
groupLogic: '2', groupLogic: '2',
modelText: '数量', modelText: '数量',
@ -375,6 +375,11 @@ export default {
this.$set(subItem, 'operator', '') this.$set(subItem, 'operator', '')
this.$set(subItem, 'value', '') this.$set(subItem, 'value', '')
}, },
selectRelational(val, subItem) {
if (val === '3' && subItem.indexSource === '3') {
this.$set(subItem, 'operator', '>')
}
},
// //
selectPropertyKey(val, items, id) { selectPropertyKey(val, items, id) {
items.leftOperand.valueType = this.getAttrValueType(val, id) items.leftOperand.valueType = this.getAttrValueType(val, id)
@ -425,14 +430,14 @@ export default {
// //
handleAddRow(val) { handleAddRow(val) {
val.ruleConditionList.push({ val.ruleConditionList.push({
atomicIndexId: '', indexSource: '', rowLogic: '', relationalSymbol: '', operator: '', value: '', operandUnitList: [] atomicIndexId: '', indexSource: '', rowLogic: '', relationalSymbol: '', operator: '>', value: '', operandUnitList: []
}) })
}, },
// //
handleAddGroup(index) { handleAddGroup(index) {
if (this.ruleConditionGroupList.length > 1) return if (this.ruleConditionGroupList.length > 1) return
this.ruleConditionGroupList.splice(index, 0, { this.ruleConditionGroupList.splice(index, 0, {
rowLogic: '2', ruleConditionList: [{ atomicIndexId: '', indexSource: '', rowLogic: '', relationalSymbol: '', operator: '', value: '', operandUnitList: [] }] rowLogic: '2', ruleConditionList: [{ atomicIndexId: '', indexSource: '', rowLogic: '', relationalSymbol: '', operator: '>', value: '', operandUnitList: [] }]
}) })
}, },
// //

Loading…
Cancel
Save