fix: 指标规则,原子指标bug

ocr_2.0
xiangcongshuai 8 months ago
parent 24ffa40e81
commit f515468995

@ -141,20 +141,20 @@ export const asyncRoutes = [
meta: { title: '提示词配置', affix: false } meta: { title: '提示词配置', affix: false }
}, },
{ // {
path: '/prompt-management', // path: '/prompt-management',
name: 'PromptManagement', // name: 'PromptManagement',
permission: 'p_promptManagement', // permission: 'p_promptManagement',
component: () => import('@/views/promptManagement/index.vue'), // component: () => import('@/views/promptManagement/index.vue'),
meta: { title: '提示词模板', affix: false } // meta: { title: '提示词模板', affix: false }
}, // },
{ // {
path: '/prompt-test', // path: '/prompt-test',
name: 'PromptTest', // name: 'PromptTest',
permission: 'p_promptTest', // permission: 'p_promptTest',
component: () => import('@/views/promptManagement/PromptTest.vue'), // component: () => import('@/views/promptManagement/PromptTest.vue'),
meta: { title: '提示词调试', affix: false } // meta: { title: '提示词调试', affix: false }
} // }
] ]
}, },
{ {

@ -89,6 +89,8 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.move-tree { .move-tree {
background: #F9FAFB; background: #F9FAFB;
height: 500px;
overflow: auto;
::v-deep { ::v-deep {
.el-tree { .el-tree {
background: #F9FAFB; background: #F9FAFB;

@ -180,9 +180,15 @@ export default {
}, },
renderContent(h, { node, data }) { renderContent(h, { node, data }) {
if (data.fileInfoList.length > 0) { if (data.fileInfoList.length > 0) {
let i = 0
for (const item of data.fileInfoList) {
if (item.type !== 1) {
i++
}
}
return ( return (
<span title={data.directoryName}> <span title={data.directoryName}>
{data.directoryName} <span style=''>({data.fileInfoList.length})</span> {data.directoryName} <span style=''>({i})</span>
</span> </span>
) )
} else { } else {
@ -453,9 +459,15 @@ export default {
this.$refs.AddFolderRef.show() this.$refs.AddFolderRef.show()
}, },
changeTreeData(nodes, id) { changeTreeData(nodes, id) {
const list = []
for (const node of nodes) { for (const node of nodes) {
if (node.id === id) { if (node.id === id) {
node.fileInfoList = this.selectList for (const item of this.selectList) {
if (item.type !== 1) {
list.push(item)
}
}
node.fileInfoList = JSON.parse(JSON.stringify(list))
} else if (node.child) { } else if (node.child) {
this.changeTreeData(node.child, id) this.changeTreeData(node.child, id)
} }
@ -480,6 +492,8 @@ export default {
width: 210px; width: 210px;
margin-right: 16px; margin-right: 16px;
background: #F9FAFB; background: #F9FAFB;
overflow-y: auto;
height: calc(100vh - 350px);
::v-deep { ::v-deep {
.el-tree { .el-tree {
background: #F9FAFB; background: #F9FAFB;

@ -59,9 +59,14 @@
</div> </div>
</template> </template>
<template #opera="{row}"> <template #opera="{row}">
<el-tooltip class="item" effect="dark" content="编辑" placement="top-start">
<el-button v-if="row.fileList && row.fileList.length > 0" type="text" icon="el-icon-edit" title="编辑" @click="handelEdit(row)" /> <el-button v-if="row.fileList && row.fileList.length > 0" type="text" icon="el-icon-edit" title="编辑" @click="handelEdit(row)" />
<!-- <el-button icon="el-icon-collection" title="重新提取" type="text" @click="handelExtract(row)" /> --> </el-tooltip>
<el-tooltip class="item" effect="dark" content="重新提取" placement="top-start">
<svg-icon class="svg-img" icon-class="reset" title="重新提取" @click="handelExtract(row)" /> <svg-icon class="svg-img" icon-class="reset" title="重新提取" @click="handelExtract(row)" />
</el-tooltip>
<!-- <el-button icon="el-icon-collection" title="重新提取" type="text" @click="handelExtract(row)" /> -->
<el-button type="text" icon="el-icon-delete" style="color: red" title="删除" @click="handleDel(row)" /> <el-button type="text" icon="el-icon-delete" style="color: red" title="删除" @click="handleDel(row)" />
</template> </template>
@ -75,7 +80,7 @@
/> />
</div> </div>
</div> </div>
<AddFolder ref="AddFolderRef" @addOk="getTreeList" /> <AddFolder ref="AddFolderRef" @addOk="addOk" />
<!--编辑/新增证据--> <!--编辑/新增证据-->
<!-- <edit-evidence ref="edit" @onClose="fetchData" /> --> <!-- <edit-evidence ref="edit" @onClose="fetchData" /> -->
<!--选择上传笔录方式--> <!--选择上传笔录方式-->
@ -165,6 +170,10 @@ export default {
debounceSearch: debounce((_this) => { debounceSearch: debounce((_this) => {
_this.fetchData() _this.fetchData()
}), }),
addOk() {
this.getTreeList()
this.fetchData()
},
filterNode(value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
return data.directoryName.indexOf(value) !== -1 return data.directoryName.indexOf(value) !== -1
@ -307,10 +316,15 @@ export default {
margin: 0 8px; margin: 0 8px;
cursor: pointer; cursor: pointer;
} }
.svg-img:focus {
outline: none;
border: none !important
}
.evidence-tree { .evidence-tree {
width: 210px; width: 210px;
margin-right: 16px; margin-right: 16px;
background: #F9FAFB; background: #F9FAFB;
overflow: auto;
::v-deep { ::v-deep {
.el-tree { .el-tree {
background: #F9FAFB; background: #F9FAFB;

@ -26,10 +26,20 @@
<template #opera="{row}"> <template #opera="{row}">
<!-- <el-button v-if="row.children.length === 0" type="text" icon="el-icon-video-play" :disabled="!isEdit" title="笔录分析" @click="handleCreateAtlas(row)" /> --> <!-- <el-button v-if="row.children.length === 0" type="text" icon="el-icon-video-play" :disabled="!isEdit" title="笔录分析" @click="handleCreateAtlas(row)" /> -->
<el-tooltip class="item" effect="dark" content="编辑" placement="top-start">
<el-button type="text" icon="el-icon-edit" title="编辑" :disabled="!isEdit" @click="handelEdit(row)" /> <el-button type="text" icon="el-icon-edit" title="编辑" :disabled="!isEdit" @click="handelEdit(row)" />
<svg-icon v-if="row.children.length === 0 && isEdit" style="margin-left: 8px;cursor: pointer;" icon-class="recordAnalysis" title="笔录分析" @click="handleCreateAtlas(row)" /> </el-tooltip>
<svg-icon v-if="row.children.length === 0 && isEdit" style="margin-left: 8px;margin-right: 8px; cursor: pointer;" icon-class="reset" title="笔录提取" @click="handleExtract(row)" />
<el-tooltip class="item" effect="dark" content="笔录分析" placement="top-start">
<svg-icon class="svg-img" v-if="row.children.length === 0 && isEdit" style="margin-left: 8px;cursor: pointer;" icon-class="recordAnalysis" title="笔录分析" @click="handleCreateAtlas(row)" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="笔录提取" placement="top-start">
<svg-icon class="svg-img" v-if="row.children.length === 0 && isEdit" style="margin-left: 8px;margin-right: 8px; cursor: pointer;" icon-class="reset" title="笔录提取" @click="handleExtract(row)" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start">
<el-button v-if="row.children.length === 0" type="text" icon="el-icon-delete" :disabled="!isEdit" style="color: red" title="删除" @click="handleDel(row)" /> <el-button v-if="row.children.length === 0" type="text" icon="el-icon-delete" :disabled="!isEdit" style="color: red" title="删除" @click="handleDel(row)" />
</el-tooltip>
<!-- <el-button v-if="row.children.length === 0" type="text" icon="el-icon-collection" :disabled="!isEdit" title="笔录提取" @click="handleExtract(row)" /> --> <!-- <el-button v-if="row.children.length === 0" type="text" icon="el-icon-collection" :disabled="!isEdit" title="笔录提取" @click="handleExtract(row)" /> -->
</template> </template>
@ -53,7 +63,7 @@
<!--新增用户--> <!--新增用户-->
<add-case-user ref="addUser" @reloadData="fetchData" /> <add-case-user ref="addUser" @reloadData="fetchData" />
<!--选择三元组信息入库--> <!--选择三元组信息入库-->
<triplet-info ref="triplet" /> <triplet-info ref="triplet" @save="fetchData"/>
<!--选择上传方式--> <!--选择上传方式-->
<select-upload ref="type" @select="handleSelect" /> <select-upload ref="type" @select="handleSelect" />
<!--新增/编辑笔录--> <!--新增/编辑笔录-->
@ -222,4 +232,8 @@ export default {
.record-content { .record-content {
} }
.svg-img:focus {
outline: none;
border: none !important
}
</style> </style>

@ -27,6 +27,10 @@
<span v-if="row.recordSegmentationList && row.recordSegmentationList.length > 0">【<el-button type="text" @click="handleDetails(row)"></el-button></span> <span v-if="row.recordSegmentationList && row.recordSegmentationList.length > 0">【<el-button type="text" @click="handleDetails(row)"></el-button></span>
</div> </div>
</template> </template>
<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-else>{{ row.indexName }}</span>
</template>
<template #result="{row}"> <template #result="{row}">
<div v-if="row.newFlag" style="padding: 10px 0;"> <div v-if="row.newFlag" style="padding: 10px 0;">
<el-badge value="new" class="item"> <el-badge value="new" class="item">
@ -91,12 +95,12 @@ export default {
{ title: '序号', type: 'seq', width: '80px' }, { title: '序号', type: 'seq', width: '80px' },
{ title: '分析结果', width: '200px', field: 'indexResult', slots: { default: 'result' }}, { title: '分析结果', width: '200px', field: 'indexResult', slots: { default: 'result' }},
{ title: '笔录结果', width: '200px', slots: { default: 'operate' }, align: 'center' }, // { title: '', width: '200px', slots: { default: 'operate' }, align: 'center' },
{ title: '指标名称', field: 'indexName', align: 'left' }, { title: '指标名称', field: 'indexName', slots: { default: 'detail' }, align: 'left' },
{ title: '分值', field: 'score', width: '50px' }, { title: '分值', field: 'score', width: '50px' }
{ title: '数据来源', field: 'indexSource', width: '200px', formatter: ({ cellValue }) => { // { title: '', field: 'indexSource', width: '200px', formatter: ({ cellValue }) => {
return cellValue ? this.indexSourceList.find(item => item.value === cellValue).label : '' // return cellValue ? this.indexSourceList.find(item => item.value === cellValue).label : ''
} } // } }
// { title: '', field: 'atomicIndex' } // { title: '', field: 'atomicIndex' }
// { title: '', field: 'questioner' }, // { title: '', field: 'questioner' },
// { title: '', field: 'startTime' }, // { title: '', field: 'startTime' },
@ -161,7 +165,8 @@ export default {
}) })
}, },
handleDetails(row) { handleDetails(row) {
this.$refs.details.show(row.recordSegmentationList) this.$set(row, 'isRead', true)
this.$refs.details.show(row)
}, },
// //
handelStart(row) { handelStart(row) {

@ -27,6 +27,10 @@
<span v-if="row.recordSegmentationList && row.recordSegmentationList.length > 0">【<el-button type="text" @click="handleDetails(row)"></el-button></span> <span v-if="row.recordSegmentationList && row.recordSegmentationList.length > 0">【<el-button type="text" @click="handleDetails(row)"></el-button></span>
</div> </div>
</template> </template>
<template #detail="{row}">
<span v-if="row.parentIndexName"><el-button type="text" @click="handleDetails(row)">{{ row.indexName }}</el-button></span>
<span v-else>{{ row.indexName }}</span>
</template>
<template #result="{row}"> <template #result="{row}">
<div v-if="row.newFlag" style="padding: 10px 0;"> <div v-if="row.newFlag" style="padding: 10px 0;">
<el-badge value="new" class="item"> <el-badge value="new" class="item">
@ -94,12 +98,12 @@ export default {
{ title: '', width: '50px', treeNode: true }, { title: '', width: '50px', treeNode: true },
{ title: '序号', type: 'seq', width: '80px' }, { title: '序号', type: 'seq', width: '80px' },
{ title: '分析结果', width: '200px', field: 'indexResult', slots: { default: 'result' }}, { title: '分析结果', width: '200px', field: 'indexResult', slots: { default: 'result' }},
{ title: '笔录结果', width: '200px', slots: { default: 'operate' }, align: 'center' }, // { title: '', width: '200px', slots: { default: 'operate' }, align: 'center' },
{ title: '指标名称', field: 'indexName', align: 'left' }, { title: '指标名称', field: 'indexName',slots: { default: 'detail' }, align: 'left' },
{ title: '分值', width: '200px', field: 'score' }, { title: '分值', width: '200px', field: 'score' },
{ title: '数据来源', field: 'indexSource', width: '200px', formatter: ({ cellValue }) => { // { title: '', field: 'indexSource', width: '200px', formatter: ({ cellValue }) => {
return cellValue ? this.indexSourceList.find(item => item.value === cellValue).label : '' // return cellValue ? this.indexSourceList.find(item => item.value === cellValue).label : ''
} } // } }
// { title: '', field: 'atomicIndex' } // { title: '', field: 'atomicIndex' }
// { title: '', field: 'questioner' }, // { title: '', field: 'questioner' },
// { title: '', field: 'startTime' }, // { title: '', field: 'startTime' },
@ -164,7 +168,7 @@ export default {
}) })
}, },
handleDetails(row) { handleDetails(row) {
this.$refs.details.show(row.recordSegmentationList) this.$refs.details.show(row)
}, },
// //
handelStart(row) { handelStart(row) {

@ -27,6 +27,10 @@
<span v-if="row.recordSegmentationList && row.recordSegmentationList.length > 0">【<el-button type="text" @click="handleDetails(row)"></el-button></span> <span v-if="row.recordSegmentationList && row.recordSegmentationList.length > 0">【<el-button type="text" @click="handleDetails(row)"></el-button></span>
</div> </div>
</template> </template>
<template #detail="{row}">
<span v-if="row.parentIndexName"><el-button type="text" @click="handleDetails(row)">{{ row.indexName }}</el-button></span>
<span v-else>{{ row.indexName }}</span>
</template>
<template #result="{row}"> <template #result="{row}">
<div v-if="row.newFlag" style="padding: 10px 0;"> <div v-if="row.newFlag" style="padding: 10px 0;">
<el-badge value="new" class="item"> <el-badge value="new" class="item">
@ -90,12 +94,12 @@ export default {
{ title: '', width: '50px', treeNode: true }, { title: '', width: '50px', treeNode: true },
{ title: '序号', type: 'seq', width: '80px' }, { title: '序号', type: 'seq', width: '80px' },
{ title: '分析结果', width: '200px', field: 'indexResult', slots: { default: 'result' }}, { title: '分析结果', width: '200px', field: 'indexResult', slots: { default: 'result' }},
{ title: '笔录结果', width: '200px', slots: { default: 'operate' }, align: 'center' }, // { title: '', width: '200px', slots: { default: 'operate' }, align: 'center' },
{ title: '指标名称', field: 'indexName', align: 'left' }, { title: '指标名称', field: 'indexName',slots: { default: 'detail' }, align: 'left' },
{ title: '分值', width: '200px', field: 'score' }, { title: '分值', width: '200px', field: 'score' },
{ title: '数据来源', width: '200px', field: 'indexSource', formatter: ({ cellValue }) => { // { title: '', width: '200px', field: 'indexSource', formatter: ({ cellValue }) => {
return cellValue ? this.indexSourceList.find(item => item.value === cellValue).label : '' // return cellValue ? this.indexSourceList.find(item => item.value === cellValue).label : ''
} } // } }
// { title: '', field: 'atomicIndex' } // { title: '', field: 'atomicIndex' }
// { title: '', field: 'questioner' }, // { title: '', field: 'questioner' },
// { title: '', field: 'startTime' }, // { title: '', field: 'startTime' },
@ -161,7 +165,7 @@ export default {
}) })
}, },
handleDetails(row) { handleDetails(row) {
this.$refs.details.show(row.recordSegmentationList) this.$refs.details.show(row)
}, },
// //
handelStart(row) { handelStart(row) {

@ -5,21 +5,47 @@
> >
<div slot="content" class="RecordDetails"> <div slot="content" class="RecordDetails">
<div class="top"> <div class="top">
<span>以明显低于市场价格变卖取得的货物导致不能归还货款</span> <span>{{ detailsInfo.parentIndexName }}</span>
<span>是否有行为人抓获经过书证</span> <span style="margin-top: 16px;">
<span v-if="detailsInfo.indexResult ==='true'" class="success"></span>
<span v-if="detailsInfo.indexResult ==='false'" class="error"></span>
<span>{{ detailsInfo.indexName }}</span>
</span>
</div> </div>
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-radio-group v-model="activeName" class="btn-list">
<el-tab-pane label="笔录详情" name="1"> <el-radio-button label="1">笔录详情</el-radio-button>
<div v-for="(item, index) in dataList" :key="index" class="record-item"> <el-radio-button label="2">证据详情</el-radio-button>
</el-radio-group>
<div v-if="activeName === '1'" class="content">
<div v-for="(item, index) in detailsInfo.recordSegmentationList" :key="index" class="record-item">
<div>{{ item.question }}</div> <div>{{ item.question }}</div>
<div>{{ item.answer }}</div> <div>{{ item.answer }}</div>
<div>{{ item.noteName }}</div> <div>{{ item.noteName }}</div>
</div> </div>
</el-tab-pane> <div v-if="detailsInfo.recordSegmentationList.length === 0">
<el-tab-pane label="证据详情" name="2">证据详情</el-tab-pane> 暂无数据建议补充
</div>
</el-tabs> </div>
<div v-if="activeName === '2'" class="content">
<div v-for="(item, index) in detailsInfo.evidentResultList" :key="index" class="evident-item">
<div class="item-row">
<span class="label">证据名称</span>
<span class="value">{{ item.evidenceName }}</span>
</div>
<div class="item-row">
<span class="label">提供人</span>
<span class="value">{{ item.provider }}</span>
</div>
<div class="item-row">
<span class="label">所在目录</span>
<span class="value">{{ item.directoryName }}</span>
</div>
</div>
<div v-if="detailsInfo.evidentResultList.length === 0">
不存在出境记录证据建议补充
</div>
</div>
</div> </div>
</cs-drawer> </cs-drawer>
</template> </template>
@ -35,14 +61,20 @@ export default {
title: '详情', title: '详情',
hiddenFooter: true hiddenFooter: true
}, },
activeName: '1', detailsInfo: {
dataList: [] indexName: '',
parentIndexName:"",
recordSegmentationList: [],
evidentResultList: []
},
activeName: '1'
} }
}, },
methods: { methods: {
show(data) { show(data) {
this.drawerOption.show = true this.drawerOption.show = true
this.dataList = data this.detailsInfo = JSON.parse(JSON.stringify(data))
// this.recordSegmentationList = data.recordSegmentationList
} }
} }
} }
@ -54,7 +86,34 @@ export default {
flex-direction: column; flex-direction: column;
padding: 16px; padding: 16px;
overflow: auto; overflow: auto;
.top {
margin-bottom: 24px;background: #F6F8F9;
border-radius: 8px 8px 8px 8px;
padding: 16px;
display: flex;
flex-direction: column;
font-size: 16px;
.success {
font-weight: 400;
font-size: 16px;
color: #00975E;
}
.error {
font-weight: 400;
font-size: 16px;
color: red;
}
}
.btn-list {
margin-bottom: 24px;
}
.content {
height: calc(100vh - 300px);
overflow-y: auto;
}
.record-item { .record-item {
margin-bottom: 16px; margin-bottom: 16px;
border-bottom: 1px solid #DBE9FE; border-bottom: 1px solid #DBE9FE;
div { div {
@ -62,5 +121,25 @@ export default {
line-height: 24px; line-height: 24px;
} }
} }
.evident-item {
display: flex;
flex-direction: column;
border-bottom: 1px solid #DBE9FE;
margin-top: 16px;
.item-row {
display: flex;
margin-bottom: 16px;
.label {
width: 70px;
text-align: right;font-size: 16px;
color: #666666;
}
.value {
font-size: 16px;
color: #333333;
margin-left: 24px;
}
}
}
} }
</style> </style>

@ -225,6 +225,7 @@ export default {
const { code, msg } = res const { code, msg } = res
code === 200 ? this.$baseMessage.success(msg || '保存成功!') : this.$baseMessage.error(msg || '保存失败!') code === 200 ? this.$baseMessage.success(msg || '保存成功!') : this.$baseMessage.error(msg || '保存失败!')
this.dialogOptions.show = false this.dialogOptions.show = false
this.$emit('save')
}).catch(() => { loading.close() }) }).catch(() => { loading.close() })
} }
} }

@ -186,7 +186,7 @@ export default {
children: 'child', children: 'child',
label: 'categoryName', label: 'categoryName',
value: 'id', value: 'id',
disabled:'hasPrompt' disabled: 'hasPrompt'
}, },
treeData: [], treeData: [],
id: '', id: '',
@ -308,6 +308,7 @@ export default {
}, },
reset() { reset() {
this.dataInfo = { this.dataInfo = {
rules: '(问[:](.*?))\s*答[:](.*?)(?=(问[:]|$))', rules: '(问[:](.*?))\s*答[:](.*?)(?=(问[:]|$))',
caseType: '', caseType: '',
type: '1', type: '1',
@ -322,6 +323,12 @@ export default {
submit() { submit() {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
for (const item of this.dataInfo.extractAttributes) {
if (item.attrName === '' || item.attrValueType === '') {
this.$baseMessage.error('请填写完整属性')
return
}
}
const params = { const params = {
id: this.$route.params.id, id: this.$route.params.id,
...this.dataInfo, ...this.dataInfo,

@ -33,7 +33,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="指标算法" prop="indexSource"> <el-form-item label="指标算法" prop="indexSource">
<el-radio-group v-model="ruleForm['indexSource']" :disabled="isEdit" @change="changeType"> <el-radio-group v-model="ruleForm['indexSource']" :disabled="isEdit|| isView" @change="changeType">
<!-- <el-radio <!-- <el-radio
v-for="item in sourceOptions" v-for="item in sourceOptions"
:key="item.value" :key="item.value"
@ -48,8 +48,8 @@
<el-radio label="5">结构化查询</el-radio> <el-radio label="5">结构化查询</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="indexSource"> <el-form-item v-if="['3','5'].includes(ruleForm['indexSource'])" label="查询语句" prop="promptId">
<div class="select-btn" @click="selectSql"></div> <div v-if="!isView" class="select-btn" @click="selectSql"></div>
<div v-if="selectInfo.promptName" class="sel-name">{{ `${selectInfo.promptName}` }}</div> <div v-if="selectInfo.promptName" class="sel-name">{{ `${selectInfo.promptName}` }}</div>
<!-- <div v-if="ruleForm['indexSource'] === '4'" class="sel-name">{{ `` }}</div> <!-- <div v-if="ruleForm['indexSource'] === '4'" class="sel-name">{{ `` }}</div>
<span v-if="ruleForm['indexSource'] === '3'" class="sel-desc">{{ `--` }}</span> --> <span v-if="ruleForm['indexSource'] === '3'" class="sel-desc">{{ `--` }}</span> -->
@ -60,7 +60,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item v-if="ruleForm.indexSource ==='2'" label="关联分类" prop="categoryIdPath"> <el-form-item v-if="ruleForm.indexSource ==='2'" label="关联分类" prop="categoryIdPath">
<el-cascader v-model="ruleForm.categoryIdPath" style="width: 100%;" :props="defaultProps" :options="treeData" /> <el-cascader v-model="ruleForm.categoryIdPath" :disabled="isView" style="width: 100%;" :props="defaultProps" :options="treeData" />
</el-form-item> </el-form-item>
<!-- <el-form-item v-if="ruleForm['indexSource'] === '4'" label="prompt标签" prop="recordType"> <!-- <el-form-item v-if="ruleForm['indexSource'] === '4'" label="prompt标签" prop="recordType">
<el-select v-model="ruleForm['recordType']" :disabled="isView" placeholder="请选择prompt标签" style="width: 100%"> <el-select v-model="ruleForm['recordType']" :disabled="isView" placeholder="请选择prompt标签" style="width: 100%">
@ -173,7 +173,7 @@ export default {
queryLang: [{ required: true, message: '查询语句不能为空!', trigger: 'blur' }], queryLang: [{ required: true, message: '查询语句不能为空!', trigger: 'blur' }],
name: [{ required: true, message: '原子指标名称不能为空!', trigger: 'blur' }], name: [{ required: true, message: '原子指标名称不能为空!', trigger: 'blur' }],
categoryIdPath: [{ required: true, message: '分类不能为空!', trigger: 'change' }], categoryIdPath: [{ required: true, message: '分类不能为空!', trigger: 'change' }],
judgeResult: [{ required: true, message: '判断结果不能为空!', trigger: 'blur' }] promptId: [{ required: true, message: '查询语句不能为空!', trigger: 'change' }]
}, },
treeData: [], treeData: [],
// //
@ -188,6 +188,11 @@ export default {
this.isEdit = isEdit this.isEdit = isEdit
this.drawerOption.show = true this.drawerOption.show = true
this.id = isEdit ? data.id : '' this.id = isEdit ? data.id : ''
this.selectInfo = {
promptName: '',
promptId: '',
extractAttributes: []
}
this.getTreeList() this.getTreeList()
this.$nextTick(() => { this.$nextTick(() => {
const _this = this const _this = this
@ -202,7 +207,19 @@ export default {
}, },
// //
handleReset() { handleReset() {
this.selectInfo = {
promptName: '',
promptId: '',
extractAttributes: []
}
this.$set(this.ruleForm, 'promptId', '')
if (this.isEdit) {
this.$set(this.ruleForm, 'name', '')
this.$set(this.ruleForm, 'remark', '')
} else {
this.ruleForm = { indexSource: '1' } this.ruleForm = { indexSource: '1' }
}
// this.$refs.form.clearValidate() // this.$refs.form.clearValidate()
}, },
selectSql() { selectSql() {
@ -210,7 +227,8 @@ export default {
}, },
selectOk(data, list) { selectOk(data, list) {
this.selectInfo = data this.selectInfo = data
this.ruleForm.promptId = data.promptId this.$set(this.ruleForm, 'promptId', data.promptId)
// this.ruleForm.promptId = data.promptId
this.selectInfo.extractAttributes = list this.selectInfo.extractAttributes = list
}, },
// //
@ -243,7 +261,7 @@ export default {
}, },
// //
changeType(val) { changeType(val) {
this.ruleForm = { indexSource: val } this.ruleForm = { indexSource: val, caseType: this.ruleForm.caseType, name: this.ruleForm.name }
// this.ruleForm['indexSource'] = val // this.ruleForm['indexSource'] = val
} }
} }
@ -262,9 +280,10 @@ export default {
text-align: center;font-size: 16px; text-align: center;font-size: 16px;
color: #3763FF; color: #3763FF;
cursor: pointer; cursor: pointer;
margin-bottom: 8px;
} }
.sel-name { .sel-name {
margin-top: 8px;font-size: 16px; font-size: 16px;
color: #3763FF; color: #3763FF;
} }
.sel-desc { .sel-desc {

@ -49,9 +49,9 @@
@checkbox-all="handleChangeAll" @checkbox-all="handleChangeAll"
@checkbox-change="selectChangeEvent" @checkbox-change="selectChangeEvent"
> >
<!-- <template #type="{row}"> <template #type="{row}">
<span>{{ getAttrValueTypeName(row.attrValueType) }}</span> <span>{{ getAttrValueTypeName(row.attrValueType) }}</span>
</template> --> </template>
</vxe-grid> </vxe-grid>
<div class="title">提示词配置内容</div> <div class="title">提示词配置内容</div>
<div class="promptText" v-html="selectInfo.promptText" /> <div class="promptText" v-html="selectInfo.promptText" />
@ -103,7 +103,7 @@ export default {
attrValueTypeList: JSON.parse(sessionStorage.getItem('prompt_attribute_valuetype')), attrValueTypeList: JSON.parse(sessionStorage.getItem('prompt_attribute_valuetype')),
// //
gridOptions: { gridOptions: {
...mixin.data().gridOptions, height: '550px',
columns: [ columns: [
{ type: 'radio', width: '80px' }, { type: 'radio', width: '80px' },
{ title: '提示词名称', field: 'name', align: 'left' }, { title: '提示词名称', field: 'name', align: 'left' },
@ -117,7 +117,7 @@ export default {
columns: [ columns: [
{ type: 'checkbox', width: '80px' }, { type: 'checkbox', width: '80px' },
{ title: '属性名称', field: 'attrName' }, { title: '属性名称', field: 'attrName' },
{ title: '属性类型', field: 'attrValueType' } { title: '属性类型', slots: { default: 'type' }, field: 'attrValueType' }
], ],
data: [] data: []
}, },
@ -150,7 +150,6 @@ export default {
} }
// this.searchForm.type = type // this.searchForm.type = type
this.fetchData() this.fetchData()
this.tableHeight(750)
}, },
getTypeName(val) { getTypeName(val) {
for (const item of this.promptType) { for (const item of this.promptType) {
@ -188,7 +187,7 @@ export default {
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', this.getPromptText(item.type)) _this.$set(this.selectInfo, 'promptText', item.prompt)
} }
_this.$nextTick(() => { _this.$nextTick(() => {
_this.modelGridOptions.data.map(column => { _this.modelGridOptions.data.map(column => {
@ -208,7 +207,7 @@ export default {
this.selectInfo.promptId = newValue.id this.selectInfo.promptId = newValue.id
this.selectInfo.promptName = newValue.name this.selectInfo.promptName = newValue.name
this.$set(this.modelGridOptions, 'data', newValue.extractAttributes || []) this.$set(this.modelGridOptions, 'data', newValue.extractAttributes || [])
this.$set(this.selectInfo, 'promptText', this.getPromptText(newValue.type)) this.$set(this.selectInfo, 'promptText', newValue.prompt)
}, },
// () // ()
selectChangeEvent() { selectChangeEvent() {

@ -8,7 +8,7 @@
<template> <template>
<div class="content"> <div class="content">
<cs-search title="原子指标" :data="searchData" :span="6" direction="row" @onSearch="onSearch" @getData="onSearch" /> <cs-search title="原子指标" :data="searchData" :span="8" 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-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd"></el-button>

@ -92,7 +92,8 @@
:value="option" :value="option"
/> />
</el-select> </el-select>
<el-input v-model="subItem.value" style="width: 150px;margin-left: 20px" /> <el-input-number v-model="subItem.value" style="width: 150px;margin-left: 20px" :min="1" />
<!-- <el-input v-model="subItem.value" type="number" /> -->
</div> </div>
</div> </div>
<div v-if="subItem.indexSource === '5'" class="row-sku"> <div v-if="subItem.indexSource === '5'" class="row-sku">
@ -168,7 +169,6 @@
style="width: 100px;margin-left: 20px;" style="width: 100px;margin-left: 20px;"
> >
<el-option <el-option
key="6" key="6"
label="值" label="值"
value="6" value="6"
@ -242,7 +242,6 @@
添加条件组 添加条件组
</el-button> </el-button>
<el-button <el-button
v-if="index !== 0"
icon="el-icon-remove-outline" icon="el-icon-remove-outline"
plain plain
class="group-del" class="group-del"
@ -438,6 +437,10 @@ export default {
}, },
// //
handleDelGroup(item) { handleDelGroup(item) {
if (this.ruleConditionGroupList.length === 1) {
this.$baseMessage.error('至少保留一条数据!')
return
}
this.ruleConditionGroupList.splice(this.ruleConditionGroupList.indexOf(item), 1) this.ruleConditionGroupList.splice(this.ruleConditionGroupList.indexOf(item), 1)
}, },
// //

@ -141,7 +141,7 @@ export default {
return { return {
drawerOption: { drawerOption: {
show: false, show: false,
width: '45%', width: '1000px',
title: '指标配置' title: '指标配置'
}, },
// //

Loading…
Cancel
Save