fix: bug修改

ocr_2.0
xiangcongshuai 6 months ago
parent b383cff06a
commit a361268438

@ -41,6 +41,7 @@
"vxe-table": "3.6.13", "vxe-table": "3.6.13",
"vxe-table-plugin-element": "3.0.6", "vxe-table-plugin-element": "3.0.6",
"vxe-table-plugin-export-xlsx": "2.2.2", "vxe-table-plugin-export-xlsx": "2.2.2",
"webpack-merge": "^6.0.1",
"xe-utils": "3.5.7", "xe-utils": "3.5.7",
"xgplayer": "^3.0.18", "xgplayer": "^3.0.18",
"xlsx": "^0.18.5" "xlsx": "^0.18.5"

@ -104,6 +104,9 @@ dependencies:
vxe-table-plugin-export-xlsx: vxe-table-plugin-export-xlsx:
specifier: 2.2.2 specifier: 2.2.2
version: 2.2.2(vxe-table@3.6.13) version: 2.2.2(vxe-table@3.6.13)
webpack-merge:
specifier: ^6.0.1
version: 6.0.1
xe-utils: xe-utils:
specifier: 3.5.7 specifier: 3.5.7
version: 3.5.7 version: 3.5.7
@ -11663,6 +11666,15 @@ packages:
flat: 5.0.2 flat: 5.0.2
wildcard: 2.0.1 wildcard: 2.0.1
/webpack-merge@6.0.1:
resolution: {integrity: sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg==}
engines: {node: '>=18.0.0'}
dependencies:
clone-deep: 4.0.1
flat: 5.0.2
wildcard: 2.0.1
dev: false
/webpack-sources@3.2.3: /webpack-sources@3.2.3:
resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==} resolution: {integrity: sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==}
engines: {node: '>=10.13.0'} engines: {node: '>=10.13.0'}

@ -127,8 +127,8 @@
:disabled="item.disabled" :disabled="item.disabled"
clearable clearable
style="width: 100%" style="width: 100%"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:MM:ss"
format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:MM:ss"
type="datetimerange" type="datetimerange"
range-separator="至" range-separator="至"
start-placeholder="开始" start-placeholder="开始"

@ -103,7 +103,7 @@ export default {
} }
} }
.el-menu-item:not(.is-disabled):hover, .el-menu-item:not(.is-disabled):focus { .el-menu-item:not(.is-disabled):hover, .el-menu-item:not(.is-disabled):focus {
background: rgba(55, 99, 255, .2) !important; // background: rgba(55, 99, 255, .2) !important;
color: $base-color-default !important; color: $base-color-default !important;
.title { .title {
font-weight: 700; font-weight: 700;
@ -112,7 +112,7 @@ export default {
.el-menu--horizontal > .el-menu-item.is-active { .el-menu--horizontal > .el-menu-item.is-active {
border-bottom: none; border-bottom: none;
color: $base-color-default !important; color: $base-color-default !important;
background: rgba(55, 99, 255, .2) !important; // background: rgba(55, 99, 255, .2) !important;
.title { .title {
font-weight: 700; font-weight: 700;
} }

@ -62,13 +62,14 @@ export default {
margin-right: 16px; margin-right: 16px;
border-bottom: none !important; border-bottom: none !important;
&:hover { &:hover {
background: rgba(55, 99, 255, .2) !important; // background: rgba(55, 99, 255, .2) !important;
color: $base-color-default !important; color: $base-color-default !important;
font-weight: 700; font-weight: 700;
} }
} }
.el-menu--popup { .el-menu--popup {
background: #FFFFFF !important; background: #FFFFFF !important;
// padding: 0 !important;
.el-menu-item { .el-menu-item {
border-radius: 0; border-radius: 0;
height: $base-submenu-item-height !important; height: $base-submenu-item-height !important;
@ -76,7 +77,7 @@ export default {
&.is-active { &.is-active {
font-weight: 700; font-weight: 700;
color: $base-color-default !important; color: $base-color-default !important;
background: rgba(55, 99, 255, .2) !important; // background: rgba(55, 99, 255, .2) !important;
} }
div { div {
line-height: normal; line-height: normal;
@ -87,7 +88,7 @@ export default {
::v-deep.el-menu--horizontal > .el-submenu.is-active .el-submenu__title { ::v-deep.el-menu--horizontal > .el-submenu.is-active .el-submenu__title {
font-weight: 700 !important; font-weight: 700 !important;
border-bottom: none !important; border-bottom: none !important;
background: rgba(55, 99, 255, .2) !important; // background: rgba(55, 99, 255, .2) !important;
color: $base-color-default !important; color: $base-color-default !important;
} }
</style> </style>

@ -238,6 +238,7 @@ html {
.el-menu.el-menu--popup.el-menu--popup-bottom-start { .el-menu.el-menu--popup.el-menu--popup-bottom-start {
@include scrollbar; @include scrollbar;
margin-top: 12px !important;
} }
// el-tabs // el-tabs
.el-tabs__item.is-active { .el-tabs__item.is-active {

@ -246,11 +246,14 @@ export default {
this.delFiles() this.delFiles()
}, },
// //
delFiles() { delFiles(val) {
const node = this.findNodeById(this.treeData, this.selectId) const node = this.findNodeById(this.treeData, this.selectId)
for (let i = this.selectList.length - 1; i >= 0; i--) { for (let i = this.selectList.length - 1; i >= 0; i--) {
if (this.selectList[i].check === true) { if (this.selectList[i].check === true) {
if (!val) {
this.treeData[0].fileInfoList.push(this.selectList[i]) this.treeData[0].fileInfoList.push(this.selectList[i])
}
this.selectList.splice(i, 1) this.selectList.splice(i, 1)
} }
} }
@ -289,7 +292,7 @@ export default {
} }
const list = this.getSelectList() const list = this.getSelectList()
this.moveNodeFileList(val, list) this.moveNodeFileList(val, list)
this.delFiles() this.delFiles('1')
}, },
moveNodeFileList(toId, list) { moveNodeFileList(toId, list) {
const node = this.findNodeById(this.treeData, toId) const node = this.findNodeById(this.treeData, toId)

@ -48,9 +48,11 @@ import FormInfo from './FormInfo.vue'
import { baseURL } from '@/config' import { baseURL } from '@/config'
import { commonDownloadFile } from '@/api/config/uploadApi' import { commonDownloadFile } from '@/api/config/uploadApi'
import { saveRecord, deleteFile } from '@/api/caseDetails/ocr' import { saveRecord, deleteFile } from '@/api/caseDetails/ocr'
import mixin from '@/views/mixin'
export default { export default {
name: 'RecordIdentify', name: 'RecordIdentify',
components: { vuedraggable, FormInfo }, components: { vuedraggable, FormInfo },
mixins: [mixin],
data() { data() {
return { return {
detailImg: require('@/assets/record/view_detail.png'), detailImg: require('@/assets/record/view_detail.png'),
@ -61,7 +63,7 @@ export default {
} }
}, },
gridOptions: { gridOptions: {
...mixin.data().gridOptions,
columns: [ columns: [
{ title: '序号', type: 'seq', width: '80px' }, { title: '序号', type: 'seq', width: '80px' },
{ title: '附件名称', field: 'fileName' }, { title: '附件名称', field: 'fileName' },
@ -83,7 +85,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.tableHeight(400)
}, },
methods: { methods: {
getImgUrlList(row) { getImgUrlList(row) {

@ -277,6 +277,8 @@ export default {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
padding: 24px 0 0 24px; padding: 24px 0 0 24px;
height: calc(100vh - 480px);
overflow: auto;
.img_item { .img_item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

@ -138,7 +138,7 @@ export default {
.card_desc { .card_desc {
font-size: 16px; font-size: 16px;
color: #666666; color: #666666;
line-height: 24px; line-height: 28px;
} }
.card_header { .card_header {
font-weight: 400; font-weight: 400;

@ -40,7 +40,7 @@
<vxe-grid <vxe-grid
ref="entityTable" ref="entityTable"
v-bind="gridOptions" v-bind="gridOptions"
style="margin-top: 10px;width: calc(100vw - 630px);" style="margin-top: 10px;width: calc(100vw - 618px);"
> >
<template #status="{row}"> <template #status="{row}">
<div v-if="row.processStatus === '2'" class="status"> <div v-if="row.processStatus === '2'" class="status">
@ -123,14 +123,14 @@ export default {
...mixin.data().gridOptions, ...mixin.data().gridOptions,
columns: [ columns: [
{ type: 'checkbox', width: '50px' }, { type: 'checkbox', width: '50px' },
{ title: '序号', type: 'seq', width: 80 }, { title: '序号', type: 'seq', width: 60 },
{ title: '证据名称', field: 'evidenceName' }, { title: '证据名称', field: 'evidenceName' },
{ title: '所属目录', field: 'directoryNamePath', width: 300 }, { title: '所属目录', field: 'directoryNamePath' },
{ title: '格式', field: 'evidenceFormat', width: 150 }, { title: '格式', field: 'evidenceFormat', width: 70 },
{ title: '提供人', field: 'provider', width: 200 }, { title: '提供人', field: 'provider', width: 200 },
{ title: '状态', slots: { default: 'status' }, align: 'center', width: 200 }, { title: '状态', slots: { default: 'status' }, align: 'center', width: 100 },
// { title: '', field: 'confessionMaterial' }, // { title: '', field: 'confessionMaterial' },
{ title: '最新时间', field: 'updateTime', width: 200 }, { title: '最新时间', field: 'updateTime', width: 150 },
{ title: '操作', slots: { default: 'opera' }, fixed: 'right', width: '150px' } { title: '操作', slots: { default: 'opera' }, fixed: 'right', width: '150px' }
], ],
data: [] data: []
@ -215,6 +215,14 @@ export default {
queryEvidenceList(params).then(res => { queryEvidenceList(params).then(res => {
this.gridOptions.data = res.data.records this.gridOptions.data = res.data.records
this.queryForm.total = res.data.total this.queryForm.total = res.data.total
for (const item of res.data.records) {
if (item.processStatus === '1' || item.processStatus === '0') {
setTimeout(() => {
this.fetchData()
}, 8000)
return
}
}
}) })
}, },
filterTree(nodes) { filterTree(nodes) {
@ -313,7 +321,7 @@ export default {
}, },
// //
handleDel(row) { handleDel(row) {
this.$baseConfirm('你确定要删除当前项吗', null, async() => { this.$baseConfirm(`你确定要删除${row.evidenceName}吗?`, null, async() => {
const { code, msg } = await deleteEvidence({ const { code, msg } = await deleteEvidence({
evidenceId: row.id, evidenceId: row.id,
fileId: row.fileId fileId: row.fileId

@ -55,6 +55,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10" class="form-content"> <el-row :gutter="10" class="form-content">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="标题" prop="title"> <el-form-item label="标题" prop="title">
@ -62,6 +63,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10" class="form-content">
<el-col :span="24">
<el-form-item label="所属目录" prop="directoryNamePath">
<el-input v-model="selectInfo.evidenceInfo.directoryNamePath" readonly placeholder="所属目录" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="form-content"> <el-row :gutter="10" class="form-content">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="提供人" prop="provider"> <el-form-item label="提供人" prop="provider">
@ -101,6 +109,13 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10" class="form-content">
<el-col :span="24">
<el-form-item label="所属目录" prop="directoryNamePath">
<el-input v-model="evidenceInfo.directoryNamePath" readonly placeholder="所属目录" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="10" class="form-content"> <el-row :gutter="10" class="form-content">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="提供人" prop="provider"> <el-form-item label="提供人" prop="provider">
@ -129,7 +144,7 @@
</div> </div>
<div class="footer-btns"> <div class="footer-btns">
<div class="btn" @click="save"></div> <div class="btn" @click="save"></div>
<div class="reset_btn" @click="reset"></div> <div class="reset_btn" @click="closed"></div>
</div> </div>
</div> </div>
@ -258,6 +273,13 @@ export default {
} }
} }
}, },
closed() {
this.$store.dispatch(
'tabsBar/delRoute',
this.$route
)
this.$router.push({ path: `/case-details/${this.$route.params.id}/${this.$route.query.caseName}`, query: { currentKey: '1-2', isEdit: 1, caseNo: this.$route.query.caseNo }})
},
submit() { submit() {
caseEvidenceVerify({ caseEvidenceVerify({
evidenceId: this.$route.query.evidenceId, evidenceId: this.$route.query.evidenceId,
@ -266,11 +288,7 @@ export default {
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$baseMessage.success(res.msg || '保存成功!') this.$baseMessage.success(res.msg || '保存成功!')
this.$store.dispatch( this.closed()
'tabsBar/delRoute',
this.$route
)
this.$router.push({ path: `/case-details/${this.$route.params.id}/${this.$route.query.caseName}`, query: { currentKey: '1-2', isEdit: 1, caseNo: this.$route.query.caseNo }})
} }
}) })
}, },

@ -8,7 +8,7 @@
<div class="word_list" @click="handleSelect('1')"> <div class="word_list" @click="handleSelect('1')">
<img class="bg_img" src="../../../assets/record/word_bg.png" alt=""> <img class="bg_img" src="../../../assets/record/word_bg.png" alt="">
<span class="title">普通文档</span> <span class="title">普通文档</span>
<span class="desc">文档为有效的 docdocxtxtrtfwpd格式文件</span> <span class="desc">文档为有效的 docdocx格式文件</span>
<div class="up-btn"> <div class="up-btn">
<img src="@/assets/record/upload_btn.png" alt=""> <img src="@/assets/record/upload_btn.png" alt="">
<span>选择上传</span> <span>选择上传</span>
@ -17,7 +17,7 @@
<div class="word_list" @click="handleSelect('2')"> <div class="word_list" @click="handleSelect('2')">
<img class="bg_img" src="../../../assets/record/ocr_bg.png" alt=""> <img class="bg_img" src="../../../assets/record/ocr_bg.png" alt="">
<span class="title">OCR识别</span> <span class="title">OCR识别</span>
<span class="desc">图片为有效的 PNGJPGJPEGBMPWEBP图片格式</span> <span class="desc">图片为有效的 PNGJPGJPEG图片格式</span>
<div class="up-btn"> <div class="up-btn">
<img src="@/assets/record/upload_btn.png" alt=""> <img src="@/assets/record/upload_btn.png" alt="">
<span>选择上传</span> <span>选择上传</span>

@ -9,7 +9,7 @@
<template> <template>
<cs-drawer <cs-drawer
:drawer-option="drawerOption" :drawer-option="drawerOption"
@onClean="handleReset" @onReset="handleReset"
@onSubmit="handleSubmit" @onSubmit="handleSubmit"
> >
<div slot="content"> <div slot="content">
@ -273,8 +273,12 @@ export default {
}, },
// //
handleReset() { handleReset() {
if (this.isEdit) {
this.recordForm.confessionTime = []
this.recordForm.lawAsker = []
} else {
this.$refs.form.resetFields() this.$refs.form.resetFields()
this.$refs.form.clearValidate() }
}, },
// //
handleSubmit() { handleSubmit() {

@ -16,7 +16,7 @@
<div class="flex-column flex-center upload-item"> <div class="flex-column flex-center upload-item">
<img src="~@/assets/caseManagement/putong@2x.png"> <img src="~@/assets/caseManagement/putong@2x.png">
<span>普通笔录文档</span> <span>普通笔录文档</span>
<span>笔录为有效的 docdocxtxtrtfwpd格式文件</span> <span>笔录为有效的 docdocx格式文件</span>
<el-button type="primary" icon="el-icon-upload2" @click="handleUpload('1')"></el-button> <el-button type="primary" icon="el-icon-upload2" @click="handleUpload('1')"></el-button>
</div> </div>
</el-col> </el-col>

@ -77,7 +77,8 @@
<div v-else class="flex-row pick-up-info"> <div v-else class="flex-row pick-up-info">
<div class="flex-row left-title" style="align-items: center"> <div class="flex-row left-title" style="align-items: center">
<span>综合得分</span> <span>综合得分</span>
<span :style="commonStyle">{{ caseData.totalScore }}</span> <span :style="commonStyle" style="font-size: 30px;">{{ caseData.totalScore }}</span>
<div v-if="isEdit" class="model" @click="handleAnalysis"></div>
</div> </div>
<div class="base-info flex-row" style="align-items: center; justify-content: space-between"> <div class="base-info flex-row" style="align-items: center; justify-content: space-between">
<div class="flex-row"> <div class="flex-row">
@ -87,6 +88,18 @@
<span>{{ caseData.caseName }}</span> <span>{{ caseData.caseName }}</span>
<span style="margin-left: 30px">案件状态</span> <span style="margin-left: 30px">案件状态</span>
<span>{{ caseData.caseStatusName }}</span> <span>{{ caseData.caseStatusName }}</span>
<div class="btn-list">
<div v-if="isEdit" class="btns" @click="handleEdit">
<img src="@/assets/caseManagement/edit.png" alt="">
<span>编辑</span>
</div>
<!-- <el-button v-if="isEdit" type="primary" plain icon="el-icon-edit" @click="handleEdit"></el-button> -->
<div v-if="caseData['totalScore'] != null" class="btns" @click="openDeatil">
<img src="@/assets/caseManagement/analysis.png" alt="">
<span>案件分析结果</span>
</div>
</div>
</div> </div>
<el-button type="text" icon="el-icon-arrow-down" style="color: #666666" @click="expand = true">展开</el-button> <el-button type="text" icon="el-icon-arrow-down" style="color: #666666" @click="expand = true">展开</el-button>
</div> </div>
@ -135,6 +148,7 @@ import ModelAnalysis from '@/views/caseManagement/components/ModelAnalysis.vue'
import CaseAnalysis from './components/CaseAnalysis.vue' import CaseAnalysis from './components/CaseAnalysis.vue'
import ManuallyDefined from './components/ManuallyDefined.vue' import ManuallyDefined from './components/ManuallyDefined.vue'
import { executeModelAnalyse, queryCaseList, getCaseScore } from '@/api/caseManagement' import { executeModelAnalyse, queryCaseList, getCaseScore } from '@/api/caseManagement'
import merge from 'webpack-merge'
export default { export default {
name: 'Index', name: 'Index',
components: { components: {
@ -204,20 +218,45 @@ export default {
this.isEdit = this.$route.query.isEdit === '1' this.isEdit = this.$route.query.isEdit === '1'
this.fetchData() this.fetchData()
this.queryCaseScore() this.queryCaseScore()
if (this.$route.query.currentKey) {
this.currentKey = '1-2'
this.selectTitle = '案件证据-证据'
this.selectCom = 'CaseEvidence'
} else {
this.currentKey = '1-1'
}
}, },
methods: { methods: {
// node
getSelectNode(val) {
for (const item of this.leftTabs) {
for (const items of item.children) {
if (items.value === val) {
return {
component: items.component,
selectTitle: `${item['label']}-${items['label']}`,
label: `${items['label']}`
}
}
}
}
},
// //
queryCaseScore() { queryCaseScore() {
getCaseScore({ caseId: this.$route.params['id'] }).then(res => { getCaseScore({ caseId: this.$route.params['id'] }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.scoreInfo = res.data this.scoreInfo = res.data
if (this.$route.query.currentKey) {
this.currentKey = this.$route.query.currentKey
const node = this.getSelectNode(this.$route.query.currentKey)
this.selectTitle = node.selectTitle
if (node.label === '共性指标') {
this.score = this.scoreInfo.commonScore
} else if (node.label === '入罪指标') {
this.score = this.scoreInfo.crimeScore
} else if (node.label === '出罪指标') {
this.score = this.scoreInfo.crimeOutScore
} else {
this.score = ''
}
this.selectCom = node.component
} else {
this.currentKey = '1-1'
}
} }
}) })
}, },
@ -303,7 +342,6 @@ export default {
this.showFlag = true this.showFlag = true
this.fetchData() this.fetchData()
}, 5000) }, 5000)
// this.$refs.analysis.show(this.caseData) // this.$refs.analysis.show(this.caseData)
}, },
handleConfirmAnalysis(data) { handleConfirmAnalysis(data) {
@ -316,12 +354,24 @@ export default {
executeModelAnalyse(params).then(res => { executeModelAnalyse(params).then(res => {
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 || '模型分析失败!') if (code === 200) {
this.$baseMessage.success(msg || '模型分析成功!')
}
this.fetchData() this.fetchData()
}).catch(() => {
this.showFlag = true
}) })
}, },
// //
handleNodeClick(node, data) { handleNodeClick(node, data) {
const currentQuery = this.$route.query
currentQuery.currentKey = node.value
// this.$set(this.$route.query, 'currentKey', node.value)
this.$router.push({
query: merge(this.$route.query, currentQuery)
})
// this.$route.query.currentKey = node.value
// console.log(data, 666) // console.log(data, 666)
if (data.level === 1) return if (data.level === 1) return
this.selectTitle = `${data.parent.data['label']}-${data.data['label']}` this.selectTitle = `${data.parent.data['label']}-${data.data['label']}`
@ -482,6 +532,18 @@ export default {
height: 50px; height: 50px;
color: #333333; color: #333333;
line-height: 50px; line-height: 50px;
.model {
width: 112px;
height: 42px;
background: #3763FF;
border-radius: 6px 6px 6px 6px;
text-align: center;
line-height: 42px;font-size: 16px;
color: #FFFFFF;
margin: 0 24px;
cursor: pointer;
}
.left-title { .left-title {
font-weight: 500; font-weight: 500;
margin-right: 10px; margin-right: 10px;
@ -498,12 +560,43 @@ export default {
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
border-radius: 8px; border-radius: 8px;
position: relative;
// height: 240px; // height: 240px;
h4 { h4 {
font-weight: bold; font-weight: bold;
font-size: 18px; font-size: 18px;
color: #333333; color: #333333;
} }
.btn-list {
display: flex;
position: absolute;
right: 48px;
top: 4px;
}
.btns {
padding: 0 20px;
// height: 42px;
// line-height: 42px;
border-radius: 6px 6px 6px 6px;
border: 1px solid #3763FF;
display: flex;
font-size: 16px;
color: #3763FF;
justify-content: center;
align-items: center;
margin-right: 24px;
height: 38px;
line-height: 38px;
cursor: pointer;
span {
line-height: unset !important;
}
img {
width: 16px;
height: 16px;
margin-right: 8px;
}
}
} }
.case-summarize { .case-summarize {
max-height: 55px; max-height: 55px;

@ -119,8 +119,22 @@ export default {
}, },
// //
handleReset() { handleReset() {
if (this.isEdit) return if (this.isEdit) {
const { caseNo, caseActorName, caseActorIdCard, id } = this.caseForm
this.caseForm = {
caseName: '',
caseType: '',
caseStatus: '',
crimeMode: '',
caseDetail: '',
caseNo,
caseActorName,
caseActorIdCard,
id
}
} else {
this.$refs.form.resetFields() this.$refs.form.resetFields()
}
}, },
handleSubmit: debounce(function() { handleSubmit: debounce(function() {
this.$refs['form'].validate(async valid => { this.$refs['form'].validate(async valid => {

@ -357,6 +357,7 @@ export default {
border-radius: 8px; border-radius: 8px;
margin-bottom: 20px; margin-bottom: 20px;
cursor: pointer; cursor: pointer;
height: 230px;
.item-header { .item-header {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;

@ -205,9 +205,10 @@ export default {
this.getTreeList() this.getTreeList()
this.queryChunkClassify() this.queryChunkClassify()
this.selectType('1')
if (this.$route.params.id) { if (this.$route.params.id) {
this.getDetails() this.getDetails()
} else {
this.selectType('1')
} }
}, },
methods: { methods: {
@ -219,14 +220,19 @@ export default {
}, },
// //
getDetails() { getDetails() {
this.showFlag = false
queryPromptDetails({ queryPromptDetails({
id: this.$route.params.id id: this.$route.params.id
}).then(res => { }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.dataInfo = res.data this.dataInfo = res.data
this.$nextTick(() => {
this.$set(this.dataInfo, 'prompt', res.data.prompt || ' ')
})
this.showFlag = true
this.dataInfo.extractAttributes = res.data.extractAttributes || [] this.dataInfo.extractAttributes = res.data.extractAttributes || []
this.entityOptions.data = res.data.tripleList || [] this.entityOptions.data = res.data.tripleList || []
this.data.rules = '(问[:](.*?))\s*答[:](.*?)(?=(问[:]|$))' this.dataInfo.rules = '(问[:](.*?))\s*答[:](.*?)(?=(问[:]|$))'
} }
}) })
}, },
@ -323,6 +329,17 @@ export default {
} }
this.selectType('1') this.selectType('1')
}, },
hasDuplicateValue(arr, key) {
const values = arr.map(obj => obj[key])
const uniqueValues = new Set()
for (const value of values) {
if (uniqueValues.has(value)) {
return true
}
uniqueValues.add(value)
}
return false
},
submit() { submit() {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
@ -333,6 +350,10 @@ export default {
return return
} }
} }
if (this.hasDuplicateValue(this.dataInfo.extractAttributes, 'attrName')) {
this.$baseMessage.error('属性键值重复')
return
}
} }
const params = { const params = {
id: this.$route.params.id, id: this.$route.params.id,

@ -4,7 +4,12 @@
<cs-search title="提示词检索" :data="searchData" :span="6" direction="row" @onSearch="onSearch" @getData="onSearch" /> <cs-search title="提示词检索" :data="searchData" :span="6" direction="row" @onSearch="onSearch" @getData="onSearch" />
<div class="index-content"> <div class="index-content">
<div class="header"> <div class="header">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd"></el-button> <el-radio-group v-model="type" size="large" @change="handleChange">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button v-for="(item,index) in promptType" :key="index" :label="item.value">{{ item.label }}</el-radio-button>
<!-- <el-radio-button label="2">已分析</el-radio-button> -->
</el-radio-group>
<el-button type="primary" icon="el-icon-circle-plus-outline" style="position: absolute;right: 24px;top: 12px;" @click="handleAdd"></el-button>
<vxe-grid v-bind="gridOptions" style="margin-top: 20px"> <vxe-grid v-bind="gridOptions" style="margin-top: 20px">
<template #operate="{row}"> <template #operate="{row}">
<el-button type="text" @click="handleEdit(row)"></el-button> <el-button type="text" @click="handleEdit(row)"></el-button>
@ -29,7 +34,7 @@
<script> <script>
import mixin from '@/views/mixin' import mixin from '@/views/mixin'
import { queryPromptList,delPrompt } from '@/api/promptManagement' import { queryPromptList, delPrompt } from '@/api/promptManagement'
export default { export default {
name: 'PromptConfig', name: 'PromptConfig',
@ -38,10 +43,11 @@ export default {
return { return {
// //
searchData: [ searchData: [
{ label: '提示词名称', model: 'name', type: 'input' }, { label: '提示词名称', model: 'name', type: 'input' }
{ label: '提示词类型', model: 'type', type: 'select', option: JSON.parse(sessionStorage.getItem('prompt_type')) } // { label: '', model: 'type', type: 'select', option: JSON.parse(sessionStorage.getItem('prompt_type')) }
], ],
promptType: JSON.parse(sessionStorage.getItem('prompt_type')), promptType: JSON.parse(sessionStorage.getItem('prompt_type')),
type: '',
// //
gridOptions: { gridOptions: {
...mixin.data().gridOptions, ...mixin.data().gridOptions,
@ -66,11 +72,17 @@ export default {
methods: { methods: {
// //
fetchData() { fetchData() {
queryPromptList({ ...this.searchFormData, page: this.queryForm.page, size: this.queryForm.size }).then(res => { queryPromptList({ ...this.searchFormData, type: this.type, page: this.queryForm.page, size: this.queryForm.size }).then(res => {
this.gridOptions.data = res.data.records this.gridOptions.data = res.data.records
this.queryForm.total = res.data.total this.queryForm.total = res.data.total
}) })
}, },
// tab
handleChange(val) {
this.type = val
this.queryForm.page = 1
this.fetchData()
},
getTypeName(val) { getTypeName(val) {
for (const item of this.promptType) { for (const item of this.promptType) {
if (item.value === val) { if (item.value === val) {
@ -123,6 +135,9 @@ export default {
padding: 8px 20px; padding: 8px 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.header {
position: relative;
}
} }
::v-deep { ::v-deep {
.text-blue { .text-blue {
@ -130,6 +145,7 @@ export default {
} }
.header-blue { .header-blue {
background: #F2F6FA; background: #F2F6FA;
} }
} }
</style> </style>

@ -41,11 +41,11 @@
> >
{{ item.label }} {{ item.label }}
</el-radio> --> </el-radio> -->
<el-radio label="1">人工指定</el-radio>
<el-radio label="2">数据库查询</el-radio> <el-radio label="2">数据库查询</el-radio>
<el-radio label="5">结构化查询</el-radio>
<el-radio label="3">图谱生成</el-radio> <el-radio label="3">图谱生成</el-radio>
<el-radio label="4">大模型推理</el-radio> <el-radio label="4">大模型推理</el-radio>
<el-radio label="5">结构化查询</el-radio> <el-radio label="1">人工指定</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="['3','5'].includes(ruleForm['indexSource'])" label="查询语句" prop="promptId"> <el-form-item v-if="['3','5'].includes(ruleForm['indexSource'])" label="查询语句" prop="promptId">
@ -150,7 +150,7 @@ export default {
resultOptions: JSON.parse(sessionStorage.getItem('judge_result')), resultOptions: JSON.parse(sessionStorage.getItem('judge_result')),
// //
ruleForm: { ruleForm: {
indexSource: '1', indexSource: '2',
caseType: '', caseType: '',
recordType: '', recordType: '',
prompt: '', prompt: '',
@ -196,9 +196,9 @@ export default {
this.getTreeList() this.getTreeList()
this.$nextTick(() => { this.$nextTick(() => {
const _this = this const _this = this
const formData = data ? JSON.parse(JSON.stringify(data)) : { indexSource: '1' } const formData = data ? JSON.parse(JSON.stringify(data)) : { indexSource: '2' }
_this.isView = data && !isEdit _this.isView = data && !isEdit
_this.ruleForm = data ? formData : (isEdit ? formData : { indexSource: '1' }) _this.ruleForm = data ? formData : (isEdit ? formData : { indexSource: '2' })
_this.drawerOption.hiddenFooter = _this.isView _this.drawerOption.hiddenFooter = _this.isView
this.selectInfo.extractAttributes = data.properties ? data.properties.split(',') : [] this.selectInfo.extractAttributes = data.properties ? data.properties.split(',') : []
this.selectInfo.promptName = data.promptName this.selectInfo.promptName = data.promptName
@ -217,7 +217,7 @@ export default {
this.$set(this.ruleForm, 'name', '') this.$set(this.ruleForm, 'name', '')
this.$set(this.ruleForm, 'remark', '') this.$set(this.ruleForm, 'remark', '')
} else { } else {
this.ruleForm = { indexSource: '1' } this.ruleForm = { indexSource: '2' }
} }
// this.$refs.form.clearValidate() // this.$refs.form.clearValidate()

@ -186,10 +186,12 @@ export default {
_this.gridOptions.data.map(item => { _this.gridOptions.data.map(item => {
if (item.id === this.selectInfo.promptId) { if (item.id === this.selectInfo.promptId) {
_this.$refs.xTable.setRadioRow(item) _this.$refs.xTable.setRadioRow(item)
_this.$set(this.modelGridOptions, 'data', item.extractAttributes) _this.$set(this.modelGridOptions, 'data', item.extractAttributes || [])
_this.$set(this.selectInfo, 'promptText', item.prompt) _this.$set(this.selectInfo, 'promptText', item.prompt)
} }
_this.$nextTick(() => { _this.$nextTick(() => {
if (_this.modelGridOptions.data && _this.selectInfo.extractAttributes && _this.selectInfo.extractAttributes.length > 0) {
_this.modelGridOptions.data.map(column => { _this.modelGridOptions.data.map(column => {
_this.selectInfo.extractAttributes.map(e => { _this.selectInfo.extractAttributes.map(e => {
if (e === column.attrName) { if (e === column.attrName) {
@ -197,6 +199,7 @@ export default {
} }
}) })
}) })
}
}) })
}) })
}) })

@ -145,6 +145,10 @@ export default {
padding: 8px 20px; padding: 8px 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.header {
display: flex;
flex-direction: row-reverse;
}
} }
::v-deep { ::v-deep {
.text-blue { .text-blue {

@ -116,7 +116,6 @@
icon="el-icon-remove-outline" icon="el-icon-remove-outline"
type="text" type="text"
style="color: red" style="color: red"
:disabled="subItem.operandUnitList.length === 1"
@click="delItem(subItem, items)" @click="delItem(subItem, items)"
/> />
<el-select <el-select

@ -168,6 +168,10 @@ export default {
padding: 8px 20px; padding: 8px 20px;
box-sizing: border-box; box-sizing: border-box;
} }
.header {
display: flex;
flex-direction: row-reverse;
}
} }
::v-deep { ::v-deep {
.text-blue { .text-blue {

@ -10,7 +10,10 @@
<div class="account-content"> <div class="account-content">
<cs-search :data="searchData" :span="8" direction="row" @getData="onSearch" /> <cs-search :data="searchData" :span="8" direction="row" @getData="onSearch" />
<div class="content-info"> <div class="content-info">
<div class="header">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd"></el-button> <el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd"></el-button>
</div>
<vxe-grid v-bind="gridOptions" style="margin-top: 20px"> <vxe-grid v-bind="gridOptions" style="margin-top: 20px">
<template #operate="{row}"> <template #operate="{row}">
<!-- <el-button type="text" @click="handleDetails(row)"></el-button> --> <!-- <el-button type="text" @click="handleDetails(row)"></el-button> -->
@ -255,6 +258,10 @@ export default {
border-radius: 8px; border-radius: 8px;
padding: 15px; padding: 15px;
box-sizing: border-box; box-sizing: border-box;
.header {
display: flex;
flex-direction: row-reverse;
}
} }
} }
::v-deep { ::v-deep {

@ -10,7 +10,9 @@
<div class="auth-content"> <div class="auth-content">
<cs-search :data="searchData" :span="8" direction="row" @getData="onSearch" /> <cs-search :data="searchData" :span="8" direction="row" @getData="onSearch" />
<div class="content-info"> <div class="content-info">
<div class="header">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd"></el-button> <el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd"></el-button>
</div>
<vxe-grid v-bind="gridOptions" style="margin-top: 20px"> <vxe-grid v-bind="gridOptions" style="margin-top: 20px">
<template #operate="{row}"> <template #operate="{row}">
<!-- <el-button type="text" @click="handleDetails(row)"></el-button> --> <!-- <el-button type="text" @click="handleDetails(row)"></el-button> -->
@ -117,6 +119,10 @@ export default {
border-radius: 8px; border-radius: 8px;
padding: 15px; padding: 15px;
box-sizing: border-box; box-sizing: border-box;
.header {
display: flex;
flex-direction: row-reverse;
}
} }
} }
::v-deep { ::v-deep {

@ -176,6 +176,10 @@ export default {
padding: 10px; padding: 10px;
box-sizing: border-box; box-sizing: border-box;
border-radius: 8px; border-radius: 8px;
.header {
display: flex;
flex-direction: row-reverse;
}
.left-title { .left-title {
font-weight: bold; font-weight: bold;
margin-bottom: 10px; margin-bottom: 10px;

Loading…
Cancel
Save