fix: 指标规则,原子指标开发

ocr_2.0
xiangcongshuai 6 months ago
parent 94491696e0
commit 24ffa40e81

@ -30,3 +30,11 @@ export function addOrUpdIndex(data) {
data
})
}
export function listAtomicIndexAttributeScope(data) {
return request({
url: `/modelIndex/listAtomicIndexAttributeScope`,
method: 'post',
data
})
}

@ -0,0 +1,14 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2992_20696)">
<path d="M14.6667 10.3333C14.6667 12.1743 13.1743 13.6667 11.3333 13.6667C10.7364 13.6667 10.176 13.5097 9.69137 13.2349C8.8381 12.751 8.2193 11.9015 8.04787 10.8994C8.0164 10.7154 8 10.5263 8 10.3333C8 9.47743 8.3226 8.69687 8.85283 8.1066C9.46307 7.42727 10.3483 7 11.3333 7C13.1743 7 14.6667 8.4924 14.6667 10.3333Z" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11.334 4V6.66667V7C10.349 7 9.46372 7.42727 8.85348 8.1066C8.32325 8.69687 8.00065 9.47743 8.00065 10.3333C8.00065 10.5263 8.01705 10.7154 8.04852 10.8994C8.21995 11.9015 8.83875 12.751 9.69202 13.2349C8.80452 13.5032 7.62652 13.6667 6.33398 13.6667C3.57255 13.6667 1.33398 12.9205 1.33398 12V9.33333V6.66667V4" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M11.334 3.99967C11.334 4.92014 9.09542 5.66634 6.33398 5.66634C3.57255 5.66634 1.33398 4.92014 1.33398 3.99967C1.33398 3.0792 3.57255 2.33301 6.33398 2.33301C9.09542 2.33301 11.334 3.0792 11.334 3.99967Z" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M1.33398 7.7998C1.33398 8.72027 3.57255 9.46647 6.33398 9.46647C6.93632 9.46647 7.51375 9.43097 8.04852 9.3659" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M12.7483 10.333H11.3341M11.3341 10.333V8.91879M11.3341 10.333H9.91992M11.3341 10.333V11.7472" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_2992_20696">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -0,0 +1,15 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2986_20349)">
<path d="M2.28613 4.19049C2.28613 4.19049 5.14328 -0.190488 10.0957 1.52381C15.048 3.23811 14.8576 8.19049 14.8576 8.19049" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M8 5.71387V11.4282" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M5.33301 5.71387H7.99967H10.6663" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M14.8574 1.90527V8.00051" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M13.714 11.8095C13.714 11.8095 11.4283 16 6.28543 14.6667C1.14258 13.3333 1.14258 8 1.14258 8" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M1.14258 8V14.0952" stroke="#3763FF" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_2986_20349">
<rect width="16" height="16" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -42,7 +42,7 @@
<el-input v-model="addInfo['type']" readonly placeholder="请输入" />
</el-form-item>
<el-form-item label="文件夹名称" prop="directoryName">
<el-input v-model="addInfo['directoryName']" clearable placeholder="请输入" />
<el-input v-model="addInfo['directoryName']" maxlength="12" clearable placeholder="请输入" />
</el-form-item>
</el-form>
<!--新增用户-->

@ -12,7 +12,8 @@
<img src="@/assets/record/error.png" alt="">
<span>确认删除当前项</span>
</div>
<div class="content-text">点击确认将把文件移至未分类目录或点击取消保留文件一键删除将永久移除文件无法恢复请谨慎操作</div>
<div class="content-text">"确认"将文件移至未分类"一键删除永久移除文件
添加证据时不支持删除文件夹请谨慎操作</div>
<div class="footer-btns">
<div class="btn" @click="delItem"></div>
<div class="btn" @click="delAll"></div>

@ -146,8 +146,8 @@
</div>
</div>
<div class="footer-btns">
<div class="btn" @click="save"></div>
<div class="btn" @click="save"></div>
<div class="btn" @click="save">退</div>
<div class="btn" @click="closed">退</div>
<div class="reset_btn" @click="reset"></div>
</div>
</div>
@ -186,7 +186,7 @@ export default {
evidenceInfo: {
property: [],
title: '',
evidenceName:''
evidenceName: ''
},
ocrText: ''
}
@ -267,7 +267,7 @@ export default {
// this.selectId = data.id
this.navList = []
this.navList = this.getParentNames(data, this.treeData)
if (data.evidenceInfo) {
this.level = '3'
this.evidenceInfo = data.evidenceInfo
@ -280,6 +280,13 @@ export default {
this.navList.push(data.directoryName)
this.$refs.tree.setCurrentKey(this.selectId)
},
closed() {
this.$store.dispatch(
'tabsBar/delRoute',
this.$route
)
this.$router.push({ path: `/case-details/${this.$route.params.id}/${this.$route.query.caseName}`, query: { isEdit: 1, currentKey: '1-2', caseNo: this.$route.query.caseNo }})
},
checkEvidence(nodes) {
for (const item of nodes) {
if (item.fileInfoList.length > 0) {
@ -311,7 +318,7 @@ export default {
'tabsBar/delRoute',
this.$route
)
this.$router.push({ path: `/case-details/${this.$route.params.id}/${this.$route.query.caseName}`, query: { isEdit: 1,currentKey: '1-2', caseNo: this.$route.query.caseNo }})
this.$router.push({ path: `/case-details/${this.$route.params.id}/${this.$route.query.caseName}`, query: { isEdit: 1, currentKey: '1-2', caseNo: this.$route.query.caseNo }})
}
})
},
@ -417,7 +424,8 @@ export default {
align-items: center;
justify-content: center;
img {
height: 100%;
max-width: 500px;
max-height: calc(100vh - 420px);
}
}
.actived {

@ -50,10 +50,12 @@
import * as vuedraggable from 'vuedraggable'
import { baseURL } from '@/config'
import { commonDownloadFile } from '@/api/config/uploadApi'
import { saveRecord, deleteFile } from '@/api/caseDetails/ocr'
import { deleteFile } from '@/api/caseDetails/ocr'
import { ocrAndExtractList } from '@/api/caseDetails/evidence'
import mixin from '@/views/mixin'
export default {
name: 'EvidenceExtract',
mixins: [mixin],
components: { vuedraggable },
data() {
return {
@ -67,7 +69,9 @@ export default {
}
},
gridOptions: {
...mixin.data().gridOptions,
resizable: true,
showOverflow: true,
columns: [
{ title: '序号', type: 'seq', width: '80px' },
{ title: '证据名称', field: 'evidenceName' },
@ -85,6 +89,7 @@ export default {
}
},
mounted() {
this.tableHeight(400)
this.getDataList()
this.caseNo = this.$route.query.caseNo
this.caseName = this.$route.query.caseName
@ -164,6 +169,8 @@ export default {
.record_table {
flex: 1;
margin-left: 18px;
height: calc(100vh - 200px);
overflow-y: auto;
}
.status {
display: flex;

@ -45,6 +45,13 @@
<div class="plain-btn" @click="move"></div>
<!-- <div class="plain-btn">删除文件夹</div> -->
<div class="plain-btn" @click="del"></div>
<div class="select-all" @click="selectAll">
<div v-if="!checkAll" class="no-select" />
<img v-else src="@/assets/file/check.png" class="selected" alt="">
<span>全选</span>
<span>{{ `已选 ${selectLength}` }}</span>
</div>
<div class="case-content">
<span>{{ `案件名称:${caseName}` }}</span>
<span>{{ `案件编号:${caseNo}` }}</span>
@ -108,6 +115,7 @@ export default {
children: 'child',
label: 'directoryName'
},
isUploadFlag: false,
navList: ['未分类'],
caseNo: '',
caseName: '',
@ -117,6 +125,24 @@ export default {
loading: false
}
},
computed: {
checkAll() {
if (this.selectLength === this.selectList.length && this.selectList.length !== 0) {
return true
}
return false
},
selectLength() {
let i = 0
for (const item of this.selectList) {
if (item.check === true) {
i++
}
}
return i
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
@ -124,6 +150,7 @@ export default {
},
mounted() {
this.getTreeList()
this.isUploadFlag = false
this.caseNo = this.$route.query.caseNo
this.caseName = this.$route.query.caseName
},
@ -154,18 +181,27 @@ export default {
renderContent(h, { node, data }) {
if (data.fileInfoList.length > 0) {
return (
<span>
<span title={data.directoryName}>
{data.directoryName} <span style=''>({data.fileInfoList.length})</span>
</span>
)
} else {
return (
<span>
<span title={data.directoryName}>
{data.directoryName}
</span>
)
}
},
selectAll() {
if (this.selectList.length === 0) return
this.changeAllCheck(!this.checkAll)
},
changeAllCheck(flag) {
for (const item of this.selectList) {
item.check = flag
}
},
handleSuccess(res, file) {
const filename = file.name
const postfix = filename.substring(filename.lastIndexOf('.'))
@ -374,11 +410,28 @@ export default {
)
this.$router.push({ path: `/case-details/${this.$route.params.id}/${this.$route.query.caseName}`, query: { isEdit: 1, caseNo: this.$route.query.caseNo }})
},
//
checkUpload(nodes) {
for (const item of nodes) {
if (item.fileInfoList.length > 0) {
this.isUploadFlag = true
break
} else if (item.child) {
this.checkUpload(item.child)
}
}
},
save() {
if (this.treeData[0].fileInfoList && this.treeData[0].fileInfoList.length > 0) {
this.$baseMessage.error('请分类!')
return
}
this.checkUpload(this.treeData)
if (!this.isUploadFlag) {
this.$baseMessage.error('请上传文件')
return
}
this.loading = true
const list = JSON.parse(JSON.stringify(this.treeData))
list.splice(0, 1)
@ -489,6 +542,29 @@ export default {
margin-left: 32px;
}
}
.select-all {
display: flex;
align-items: center;
cursor: pointer;
span {
margin-left: 12px;
font-size: 16px;
}
img {
width: 22px;
height: 22px;
margin-left: 24px;
}
}
.no-select {
width: 22px;
height: 22px;
background: #FFFFFF;
border-radius: 4px 4px 4px 4px;
border: 1px solid #D9D9D9;
cursor: pointer;
margin-left: 24px;
}
}
.file-content {
flex: 1;
@ -498,6 +574,8 @@ export default {
.file-list {
display: flex;
flex-wrap: wrap;
overflow-y: auto;
max-height: calc(100vh - 500px)
}
::v-deep {
.el-input__inner {

@ -59,8 +59,9 @@
</div>
</template>
<template #opera="{row}">
<el-button v-if="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-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)" /> -->
<svg-icon class="svg-img" icon-class="reset" title="重新提取" @click="handelExtract(row)" />
<el-button type="text" icon="el-icon-delete" style="color: red" title="删除" @click="handleDel(row)" />
</template>
@ -253,11 +254,13 @@ export default {
val === '1' ? this.$refs.edit.show() : this.$router.push({ path: `/add-evidence/${this.caseId}`, query: { caseName: this.$route.params.caseName, caseNo: this.$route.query.caseNo }})
},
async handelExtract(row) {
const { code, msg } = await caseEvidenceAnalysis({
evidenceId: row.id
this.$baseConfirm('你确定要重新提取当前证据信息吗?这将替换掉之前已核实或提取的内容。', null, async() => {
const { code, msg } = await caseEvidenceAnalysis({
evidenceId: row.id
})
code === 200 ? this.$baseMessage.success(msg || '提取成功!') : this.$baseMessage.error(msg || '提取失败!')
this.fetchData()
})
code === 200 ? this.$baseMessage.success(msg || '提取成功!') : this.$baseMessage.error(msg || '提取失败!')
this.fetchData()
},
//
delAll() {
@ -300,6 +303,10 @@ export default {
<style scoped lang="scss">
.evidence-content {
display: flex;
.svg-img {
margin: 0 8px;
cursor: pointer;
}
.evidence-tree {
width: 210px;
margin-right: 16px;

@ -24,10 +24,13 @@
</div>
<vxe-grid v-bind="gridOptions" style="margin-top: 10px">
<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-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)" />
<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-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-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 #percentage="{row}">
@ -48,7 +51,7 @@
/>
</div>
<!--新增用户-->
<add-case-user ref="addUser" :case-id="caseId" @reloadData="fetchData" />
<add-case-user ref="addUser" @reloadData="fetchData" />
<!--选择三元组信息入库-->
<triplet-info ref="triplet" />
<!--选择上传方式-->

@ -167,7 +167,7 @@ export default {
}
}
},
mounted() {
activated() {
this.getTreeList()
this.caseNo = this.$route.query.caseNo
this.caseName = this.$route.query.caseName
@ -354,7 +354,8 @@ export default {
align-items: center;
justify-content: center;
img {
height: 100%;
max-width: 500px;
max-height: calc(100vh - 420px);
}
}
.svg-img {

@ -4,11 +4,22 @@
:drawer-option="drawerOption"
>
<div slot="content" class="RecordDetails">
<div v-for="(item, index) in dataList" :key="index" class="record-item">
<div>{{ item.question }}</div>
<div>{{ item.answer }}</div>
<div>{{ item.noteName }}</div>
<div class="top">
<span>以明显低于市场价格变卖取得的货物导致不能归还货款</span>
<span>是否有行为人抓获经过书证</span>
</div>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="笔录详情" name="1">
<div v-for="(item, index) in dataList" :key="index" class="record-item">
<div>{{ item.question }}</div>
<div>{{ item.answer }}</div>
<div>{{ item.noteName }}</div>
</div>
</el-tab-pane>
<el-tab-pane label="证据详情" name="2">证据详情</el-tab-pane>
</el-tabs>
</div>
</cs-drawer>
</template>
@ -21,9 +32,10 @@ export default {
return {
drawerOption: {
show: false,
title: '笔录详情',
title: '详情',
hiddenFooter: true
},
activeName: '1',
dataList: []
}
},

@ -40,13 +40,6 @@ import { addUser, updatePerson, queryUserList } from '@/api/caseDetails'
export default {
name: 'AddCaseUser',
props: {
// Id
caseId: {
type: String,
defaultValue: ''
}
},
data() {
return {
//

@ -117,7 +117,7 @@
</el-col>
</el-row>
<!--新增用户-->
<add-case-user ref="add" :case-id="caseId" @reloadData="getUserList" />
<add-case-user ref="add" @reloadData="getUserList" />
<!--图片文件预览-->
<file-viewer
v-if="showFileViewer"
@ -140,13 +140,6 @@ import { getAccessToken } from '@/utils/accessToken'
export default {
name: 'EditRecord',
components: { FileViewer, AddCaseUser },
props: {
// Id
caseId: {
type: String,
defaultValue: ''
}
},
data() {
return {
//

@ -33,33 +33,36 @@
/>
</el-form-item>
<el-form-item label="指标算法" prop="indexSource">
<el-radio-group v-model="ruleForm['indexSource']" :disabled="isView" @change="changeType">
<el-radio
<el-radio-group v-model="ruleForm['indexSource']" :disabled="isEdit" @change="changeType">
<!-- <el-radio
v-for="item in sourceOptions"
:key="item.value"
:label="item.value"
>
{{ item.label }}
</el-radio>
<!-- <el-radio label="1">人工指定</el-radio>-->
<!-- <el-radio label="2">数据库查询</el-radio>-->
<!-- <el-radio label="3">图谱生成</el-radio>-->
<!-- <el-radio label="4">大模型</el-radio>-->
</el-radio> -->
<el-radio label="1">人工指定</el-radio>
<el-radio label="2">数据库查询</el-radio>
<el-radio label="3">图谱生成</el-radio>
<el-radio label="4">大模型推理</el-radio>
<el-radio label="5">结构化查询</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="查询语句" prop="indexSource">
<el-form-item v-if="['3','5'].includes(ruleForm['indexSource'])" label="查询语句" prop="indexSource">
<div class="select-btn" @click="selectSql"></div>
<div v-if="ruleForm['indexSource'] === '3'" class="sel-name">{{ `` }}</div>
<div v-if="ruleForm['indexSource'] === '4'" class="sel-name">{{ `` }}</div>
<span v-if="ruleForm['indexSource'] === '3'" class="sel-desc">{{ `--` }}</span>
<div v-if="ruleForm['indexSource'] === '4'" class="select-model-list">
<div v-for="(item,index) in modelList" :key="index" class="model-list-item">
<span>{{ item.name }}</span>
<i class="el-icon-circle-close" />
<div v-if="selectInfo.promptName" class="sel-name">{{ `${selectInfo.promptName}` }}</div>
<!-- <div v-if="ruleForm['indexSource'] === '4'" class="sel-name">{{ `` }}</div>
<span v-if="ruleForm['indexSource'] === '3'" class="sel-desc">{{ `--` }}</span> -->
<div v-if="ruleForm['indexSource'] === '5' && selectInfo.extractAttributes.length > 0" class="select-model-list">
<div v-for="(item,index) in selectInfo.extractAttributes" :key="index" class="model-list-item">
<span>{{ item }}</span>
</div>
</div>
</el-form-item>
<el-form-item v-if="ruleForm['indexSource'] === '4'" label="prompt标签" prop="recordType">
<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-form-item>
<!-- <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-option
v-for="item in promptTagOptions"
@ -77,8 +80,8 @@
:rows="5"
placeholder="请输入prompt内容"
/>
</el-form-item>
<el-form-item v-if="ruleForm['indexSource'] === '2' || ruleForm['indexSource'] === '3'" label="查询语句" prop="queryLang">
</el-form-item> -->
<el-form-item v-if="['2'].includes(ruleForm['indexSource'])" label="查询语句" prop="queryLang">
<el-input
v-model="ruleForm['queryLang']"
:disabled="isView"
@ -109,7 +112,7 @@
</el-form-item>
</el-form>
</div>
<SelectSql ref="SelectSqlRef" />
<SelectSql ref="SelectSqlRef" @submit="selectOk" />
</template>
</cs-drawer>
@ -118,6 +121,7 @@
<script>
import { addOrUpdAtomicIndex } from '@/api/atomicIndex'
import SelectSql from './SelectSql.vue'
import { getCaseEvidenceTree } from '@/api/caseDetails/evidence'
export default {
name: 'EditAtomic',
components: {
@ -130,17 +134,12 @@ export default {
title: '指标配置',
width: '40%'
},
modelList: [
{
name: '属性1'
}, {
name: '属性2'
}, {
name: '属性3'
}, {
name: '属性4'
}
],
selectInfo: {
promptName: '',
promptId: '',
extractAttributes: []
}, //
//
caseTypeOptions: JSON.parse(sessionStorage.getItem('case_type')),
// prompt
@ -160,6 +159,12 @@ export default {
remark: ''
},
id: '',
defaultProps: {
children: 'child',
label: 'categoryName',
value: 'id',
checkStrictly: true
},
rules: {
indexSource: [{ required: true, message: '指标算法不能为空!', trigger: 'blur' }],
caseType: [{ required: true, message: '案件类型不能为空!', trigger: 'blur' }],
@ -167,8 +172,10 @@ export default {
prompt: [{ required: true, message: 'prompt内容不能为空!', trigger: 'blur' }],
queryLang: [{ required: true, message: '查询语句不能为空!', trigger: 'blur' }],
name: [{ required: true, message: '原子指标名称不能为空!', trigger: 'blur' }],
categoryIdPath: [{ required: true, message: '分类不能为空!', trigger: 'change' }],
judgeResult: [{ required: true, message: '判断结果不能为空!', trigger: 'blur' }]
},
treeData: [],
//
isEdit: false,
//
@ -181,12 +188,16 @@ export default {
this.isEdit = isEdit
this.drawerOption.show = true
this.id = isEdit ? data.id : ''
this.getTreeList()
this.$nextTick(() => {
const _this = this
const formData = data ? JSON.parse(JSON.stringify(data)) : { indexSource: '1' }
_this.isView = data && !isEdit
_this.ruleForm = data ? formData : (isEdit ? formData : { indexSource: '1' })
_this.drawerOption.hiddenFooter = _this.isView
this.selectInfo.extractAttributes = data.properties.split(',')
this.selectInfo.promptName = data.promptName
this.selectInfo.promptId = data.promptId
})
},
//
@ -195,7 +206,12 @@ export default {
// this.$refs.form.clearValidate()
},
selectSql() {
this.$refs.SelectSqlRef.show()
this.$refs.SelectSqlRef.show(this.ruleForm.indexSource, this.selectInfo)
},
selectOk(data, list) {
this.selectInfo = data
this.ruleForm.promptId = data.promptId
this.selectInfo.extractAttributes = list
},
//
handleSubmit() {
@ -204,6 +220,12 @@ export default {
if (this.isEdit) {
this.ruleForm.id = this.id
}
if (this.ruleForm.indexSource === '2') {
this.ruleForm.categoryId = this.ruleForm.categoryIdPath[this.ruleForm.categoryIdPath.length - 1 ]
} else if (this.ruleForm.indexSource === '5') {
this.ruleForm.properties = this.selectInfo.extractAttributes.join(',')
}
const { code, msg } = await addOrUpdAtomicIndex(this.ruleForm)
code === 200 ? (this.isEdit ? this.$baseMessage.success(msg || '编辑成功!') : this.$baseMessage.success(msg || '新增成功!')) : (this.isEdit ? this.$baseMessage.error(msg || '新增失败!') : this.$baseMessage.error(msg || '新增失败!'))
this.drawerOption.show = false
@ -211,6 +233,14 @@ export default {
}
})
},
//
getTreeList() {
getCaseEvidenceTree({ caseType: 1 }).then(res => {
if (res.code === 200) {
this.treeData = res.data
}
})
},
//
changeType(val) {
this.ruleForm = { indexSource: val }
@ -243,6 +273,8 @@ export default {
}
.select-model-list {
display: flex;
margin-top: 16px;
flex-wrap: wrap;
.model-list-item {
padding: 0 12px;
height: 32px;
@ -252,8 +284,9 @@ export default {
color: #333333;
display: flex;
align-items: center;
cursor: pointer;
span {
margin-right: 16px;
// margin-right: 16px;
}
}
}

@ -10,8 +10,8 @@
<el-form v-model="searchForm" label-width="120px">
<el-row :gutter="10">
<el-col :span="10">
<el-form-item label="指令名称" prop="name">
<el-input v-model="searchForm['name']" clearable placeholder="请选择原子指标名称" />
<el-form-item label="提示词名称" prop="name">
<el-input v-model="searchForm['name']" clearable placeholder="请输入提示词名称" />
</el-form-item>
</el-col>
<el-col :span="4">
@ -28,22 +28,37 @@
style="margin-top: 10px;width: 850px;"
:radio-config-config="{ labelField: '', highlight: true, trigger: 'row', reserve: true , range: true}"
@radioConfig-change="selectChangeEvent"
/>
@radio-change="radioChangeEvent"
>
<template #type="{row}">
<span>{{ getTypeName(row.type) }}</span>
</template>
</vxe-grid>
<div class="main-right">
<!-- <div class="chart-content">
<span class="title">提示词配置内容</span>
</div> -->
<div class="model-content">
<div v-if="!selectInfo.promptId" class="empty-content">
<img src="@/assets/caseManagement/empty.png" alt="">
<span>选择左侧线索可预览提示词</span>
</div>
<div v-if="modelGridOptions.data.length > 0" class="model-content">
<vxe-grid
ref="modelTable"
row-id="id"
row-id="attrName"
v-bind="modelGridOptions"
:checkbox-config-config="{ labelField: '', highlight: true, trigger: 'row', reserve: true , range: true}"
@checkbox-all="handleChangeAll"
@checkbox-change="selectChangeEvent"
/>
>
<!-- <template #type="{row}">
<span>{{ getAttrValueTypeName(row.attrValueType) }}</span>
</template> -->
</vxe-grid>
<div class="title">提示词配置内容</div>
<div class="promptText" v-html="selectInfo.promptText" />
</div>
<div v-if="selectInfo.promptId && modelGridOptions.data.length ===0" class="chart-content">
<span class="title">提示词配置内容</span>
<div class="promptText" v-html="selectInfo.promptText" />
</div>
</div>
</div>
@ -62,8 +77,7 @@
<script>
import mixin from '@/views/mixin'
import { queryAtomicIndex } from '@/api/atomicIndex'
import { queryPromptList } from '@/api/promptManagement'
export default {
name: 'SelectSql',
mixins: [mixin],
@ -73,7 +87,7 @@ export default {
show: false,
appendToBody: true,
width: '1400px',
height: '800px',
// height: '800px',
title: {
title: '选择原子指标查询语句'
}
@ -81,19 +95,20 @@ export default {
//
searchForm: {
name: '',
indexSource: ''
type: ''
},
promptType: JSON.parse(sessionStorage.getItem('prompt_type')),
//
indexAlgorithmOptions: JSON.parse(sessionStorage.getItem('index_source')),
attrValueTypeList: JSON.parse(sessionStorage.getItem('prompt_attribute_valuetype')),
//
gridOptions: {
...mixin.data().gridOptions,
columns: [
{ type: 'radio', width: '80px' },
{ title: '指令名称', field: 'name', align: 'left' },
{ title: '指令类型', field: 'indexSourceName' },
{ title: '三元组', field: 'remark' },
{ title: '属性', field: 'remark' }
{ title: '提示词名称', field: 'name', align: 'left' },
{ title: '提示词类型', slots: { default: 'type' }, field: 'type' },
{ title: '提取内容', field: 'prompt' }
],
data: [{}]
},
@ -101,10 +116,18 @@ export default {
height: '240px',
columns: [
{ type: 'checkbox', width: '80px' },
{ title: '属性名称', field: 'remark' },
{ title: '属性类型', field: 'remark' }
{ title: '属性名称', field: 'attrName' },
{ title: '属性类型', field: 'attrValueType' }
],
data: [{}]
data: []
},
//
promptTextList: JSON.parse(sessionStorage.getItem('prompt_prototype_default_text')),
selectInfo: {
promptId: '',
promptName: '',
promptText: '',
properties: undefined
},
//
selectionRows: []
@ -112,79 +135,101 @@ export default {
},
methods: {
//
show() {
show(type, info) {
this.dialogOption.show = true
if (info) {
this.selectInfo = info
}
// this.selectionRows = data
// this.searchForm['name'] = ''
// this.fetchData()
this.searchForm['name'] = ''
if (type === '3') {
this.searchForm.type = '2'
} else if (type === '5') {
this.searchForm.type = '1'
}
// this.searchForm.type = type
this.fetchData()
this.tableHeight(750)
},
getTypeName(val) {
for (const item of this.promptType) {
if (item.value === val) {
return item.label
}
}
},
getAttrValueTypeName(val) {
for (const item of this.attrValueTypeList) {
if (item.value === val) {
return item.label
}
}
},
getPromptText(val) {
for (const item of this.promptTextList) {
if (item.value === val) {
return item.label
}
}
},
//
fetchData() {
queryAtomicIndex(this.searchForm, 1, 99999).then(res => {
this.gridOptions.data = res.data.result
queryPromptList({ ...this.searchForm,
page: 1, size: 99999
}).then(res => {
this.gridOptions.data = res.data.records
this.queryForm.total = res.data.total
// this.$refs.xTable.clearCheckboxRow()
if (this.selectionRows && this.selectionRows.length > 0) {
if (this.selectInfo.promptId) {
//
const _this = this
_this.$nextTick(() => {
_this.gridOptions.data.map(column => {
_this.selectionRows.map(item => {
if (item.id === column.id) {
_this.$refs.xTable.setCheckboxRow(column, true)
}
_this.gridOptions.data.map(item => {
if (item.id === this.selectInfo.promptId) {
_this.$refs.xTable.setRadioRow(item)
_this.$set(this.modelGridOptions, 'data', item.extractAttributes)
_this.$set(this.selectInfo, 'promptText', this.getPromptText(item.type))
}
_this.$nextTick(() => {
_this.modelGridOptions.data.map(column => {
_this.selectInfo.extractAttributes.map(e => {
if (e === column.attrName) {
_this.$refs.modelTable.setCheckboxRow(column, true)
}
})
})
})
})
})
}
})
},
radioChangeEvent({ newValue, rowIndex }) {
this.selectInfo.promptId = newValue.id
this.selectInfo.promptName = newValue.name
this.$set(this.modelGridOptions, 'data', newValue.extractAttributes || [])
this.$set(this.selectInfo, 'promptText', this.getPromptText(newValue.type))
},
// ()
selectChangeEvent({ checked, records, reserves, row }) {
//
if (checked) {
//
if (reserves.length == 0) {
this.selectedRowKeys = records.map(v => v.id)
this.selectionRows = records
} else {
// id,
this.selectedRowKeys = [...reserves.map(v => v.id), ...records.map(v => v.id)]
// ,
this.selectionRows = [...reserves, ...records]
}
} else {
//
const idIndex = this.selectedRowKeys.indexOf(row.id)
if (idIndex > -1) {
// id
this.$delete(this.selectedRowKeys, idIndex)
}
let dataIndex = null
for (let i = 0; i < this.selectionRows.length; i++) {
if (this.selectionRows[i].id === row.id) {
dataIndex = i
break
}
}
//
this.$delete(this.selectionRows, dataIndex)
}
selectChangeEvent() {
this.selectionRows = this.$refs.modelTable.getCheckboxRecords().map(item => item.attrName)
console.log('111222', this.selectionRows)
},
handleChangeAll() {
this.selectionRows = this.$refs.modelTable.getCheckboxRecords().map(item => item.attrName)
console.log('111222', this.selectionRows)
},
//
handleSearch() {
this.fetchData()
},
//
handleSubmit() {
const list = this.selectionRows
if (list.length === 0) {
if (!this.selectInfo.promptId) {
this.$baseMessage.error('请至少选择一项!')
return
}
this.$emit('submit', list)
this.$emit('submit', this.selectInfo, this.selectionRows)
this.dialogOption.show = false
}
}
@ -199,14 +244,30 @@ export default {
margin-bottom: 20px;
height: 550px;
.main-right {
flex: 1;
width: 500px;
margin-left: 24px;
.empty-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 16px;
height: 100%;
color: #333333;
border: 1px solid #D9D9D9;
img {
width: 200px;
height: 200px;
}
}
.chart-content {
background: #FFFFFF;
border-radius: 6px 6px 6px 6px;
border: 1px solid #D9D9D9;
padding: 16px;
height: 100%;
display: flex;
flex-direction: column;
.title {
font-weight: bold;
font-size: 18px;
@ -220,6 +281,8 @@ export default {
border: 1px solid #D9D9D9;
padding: 16px;
height: 100%;
display: flex;
flex-direction: column;
.title {
font-weight: bold;
font-size: 18px;
@ -228,6 +291,14 @@ export default {
margin-top: 16px;
}
}
.promptText {
font-size: 14px;
color: #333333;
line-height: 24px;
overflow-y: auto;
margin-top: 16px;
white-space:pre-wrap
}
}
}

@ -8,10 +8,10 @@
<template>
<div ref="logic" class="logic-content">
<div v-for="(item, index) in logicData" :key="index">
<div v-for="(item, index) in ruleConditionGroupList" :key="index">
<div v-if="index !== 0" class="flex-row group-logic-content">
<i class="active-point" />
<el-radio-group v-model="item.groupLogic" class="group-logic">
<el-radio-group v-model="groupLogic" class="group-logic">
<el-radio-button
v-for="logic in logicSymbolOptions"
:key="logic.value"
@ -31,7 +31,7 @@
</div>
<div class="group">
<span class="group-title">影响案件指标的原子指标项目</span>
<el-radio-group v-model="item.rowLogic" :disabled="item.atomicData.length === 1" class="row-logic">
<el-radio-group v-model="item.rowLogic" :disabled="item.ruleConditionList.length === 1" class="row-logic">
<el-radio-button
v-for="logic in logicSymbolOptions"
:key="logic.value"
@ -40,21 +40,22 @@
{{ logic.label }}
</el-radio-button>
</el-radio-group>
<div v-for="(subItem, subIndex) in item.atomicData" :key="subIndex">
<div v-for="(subItem, subIndex) in item.ruleConditionList" :key="subIndex">
<div class="flex-row row-content">
<span class="row-line" />
<el-button
icon="el-icon-remove-outline"
type="text"
style="color: red"
:disabled="item.atomicData.length === 1"
:disabled="item.ruleConditionList.length === 1"
@click="handleRowClick(item, subItem)"
/>
<el-select
v-model="subItem.atomicIndex"
v-model="subItem.atomicIndexId"
placeholder="请选择"
clearable
style="width: 300px"
@change="((val)=>{selectAtomic(val, subItem)})"
>
<el-option
v-for="option in atomicIndexData"
@ -76,12 +77,29 @@
:value="option.value"
/>
</el-select>
<div v-if="subItem.relationalSymbol==='3' && subItem.indexSource ==='3'">
<el-input v-model="modelText" style="width: 80px;margin-left: 20px" readonly />
<el-select
v-model="subItem.operator"
placeholder="请选择"
clearable
style="width: 100px;margin-left: 20px"
>
<el-option
v-for="option in operatorList"
:key="option"
:label="option"
:value="option"
/>
</el-select>
<el-input v-model="subItem.value" style="width: 150px;margin-left: 20px" />
</div>
</div>
<div class="row-sku">
<div v-if="subItem.indexSource === '5'" class="row-sku">
<div class="row-sku-top">
<i class="el-icon-circle-plus-outline" style="color: #3763FF;font-size: 14px;" />
<span>添加单个条件</span>
<el-radio-group v-model="subItem.groupLogic" class="group-logic">
<span @click="addOperandUnitList(index,subIndex)"></span>
<el-radio-group v-model="subItem.logic" class="group-logic">
<el-radio-button
v-for="logic in logicSymbolOptions"
:key="logic.value"
@ -90,7 +108,121 @@
{{ logic.label }}
</el-radio-button>
</el-radio-group></div>
<div v-for="(items,i) in "></div>
<div v-for="(items,i) in subItem.operandUnitList" :key="i">
<div class="flex-row row-content">
<!-- <span class="row-line" /> -->
<el-button
icon="el-icon-remove-outline"
type="text"
style="color: red"
:disabled="subItem.operandUnitList.length === 1"
@click="delItem(subItem, items)"
/>
<el-select
v-model="items.leftOperand.propertyKey"
placeholder="请选择"
clearable
style="width: 200px"
@change="((val)=>{selectPropertyKey(val, items,subItem.atomicIndexId)})"
>
<el-option
v-for="option in atomicIndexAttributeScope[subItem.atomicIndexId]"
:key="option.value"
:label="option.value"
:value="option.value"
/>
</el-select>
<el-select
v-if="items.leftOperand.propertyKey"
v-model="items.leftOperand.aggregateType"
placeholder="请选择"
clearable
style="width: 100px;margin-left: 20px;"
>
<el-option
v-for="option in getOptionList(items.leftOperand.propertyKey,subItem.atomicIndexId,'aggregateList')"
:key="option.key"
:label="option.value"
:value="option.key"
/>
</el-select>
<el-select
v-if="items.leftOperand.propertyKey"
v-model="items.operator"
placeholder="请选择"
clearable
style="width: 100px;margin-left: 20px;"
>
<el-option
v-for="option in getOptionList(items.leftOperand.propertyKey,subItem.atomicIndexId,'operatorList')"
:key="option"
:label="option"
:value="option"
/>
</el-select>
<el-select
v-if="items.leftOperand.propertyKey"
v-model="items.rightOperand.operandType"
placeholder="请选择"
clearable
style="width: 100px;margin-left: 20px;"
>
<el-option
key="6"
label="值"
value="6"
/> <el-option
key="5"
label="原子指标"
value="5"
/>
</el-select>
<div v-if="items.rightOperand.operandType ==='6'" style="margin-left: 20px;">
<el-input v-if="getAttrValueType(items.leftOperand.propertyKey,subItem.atomicIndexId) ==='1'" v-model="items.rightOperand.value" placeholder="请输入" />
<el-input v-if="getAttrValueType(items.leftOperand.propertyKey,subItem.atomicIndexId) ==='2'" v-model="items.rightOperand.value" type="number" placeholder="请输入" />
<el-date-picker
v-if="getAttrValueType(items.leftOperand.propertyKey,subItem.atomicIndexId) ==='3'"
v-model="items.rightOperand.value"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
type="date"
placeholder="选择日期"
/>
</div>
<el-select
v-if="items.rightOperand.operandType ==='5'"
v-model="items.rightOperand.atomicIndexId"
style="margin-left: 20px;width: 200px;"
placeholder="请选择"
clearable
@change="(()=>{items.rightOperand.propertyKey = ''})"
>
<el-option
v-for="option in atomicIndexData"
:key="option.id"
:label="option.name"
:value="option.id"
/>
</el-select>
<el-select
v-if="items.rightOperand.operandType ==='5'"
v-model="items.rightOperand.propertyKey"
placeholder="请选择"
clearable
style="width: 150px;margin-left: 20px;"
>
<el-option
v-for="option in atomicIndexAttributeScope[items.rightOperand.atomicIndexId]"
:key="option.value"
:label="option.value"
:value="option.value"
/>
</el-select>
</div>
</div>
</div>
</div>
<el-button
@ -126,6 +258,7 @@
<script>
import mixin from '@/views/mixin'
// import { CirclePlus } from "@element-plus/icons-vue";
import { listAtomicIndexAttributeScope } from '@/api/indexRule'
export default {
name: 'CustomLogic',
mixins: [mixin],
@ -135,20 +268,24 @@ export default {
required: true,
defaultValue: []
},
judgeLogic: {
type: String,
indexRule: {
type: Object,
required: true,
defaultValue: ''
default: () => {
return {}
}
}
},
data() {
return {
//
logicData: [
{ groupLogic: '1', rowLogic: '1', atomicData: [{ atomicIndex: '', relationalSymbol: '', attributeList:[{
}] }] }
ruleConditionGroupList: [
{ rowLogic: '2', ruleConditionList: [{ atomicIndexId: '', indexSource: '', logic: '2', relationalSymbol: '', operator: '', value: '', operandUnitList: [] }] }
],
groupLogic: '2',
modelText: '数量',
atomicIndexAttributeScope: {},
operatorList: ['>', '>=', '<', '<=', '=', '!='],
//
logicSymbolOptions: JSON.parse(sessionStorage.getItem('logic_symbol'))
//
@ -170,24 +307,104 @@ export default {
// watch: {
// isChange(val) {
// if (val === true) {
// this.logicData = [
// { groupLogic: '1', rowLogic: '1', atomicData: [{ atomicIndex: '', relationalSymbol: '' }] }
// this.ruleConditionGroupList = [
// { groupLogic: '1', rowLogic: '1', ruleConditionList: [{ atomicIndexId: '', relationalSymbol: '' }] }
// ]
// }
// }
// },
mounted() {
if (!this.judgeLogic) return
this.logicData = JSON.parse(this.judgeLogic)
this.logicData.map((item) => {
item.atomicData.map((subItem) => {
if (!this.getListValueFlag(subItem.atomicIndex)) {
subItem.atomicIndex = ''
this.getAtomicIndexAttributeScope()
if (!this.indexRule.ruleConditionGroupList || this.indexRule.ruleConditionGroupList.length === 0) return
this.groupLogic = this.indexRule.groupLogic
this.ruleConditionGroupList = this.indexRule.ruleConditionGroupList
this.ruleConditionGroupList.map((item) => {
item.ruleConditionList.map((subItem) => {
if (!this.getListValueFlag(subItem.atomicIndexId)) {
subItem.atomicIndexId = ''
subItem.indexSource = ''
subItem.operandUnitList = []
}
})
})
},
methods: {
//
getIndexSource(val) {
for (const item of this.atomicIndexData) {
if (val === item.id) {
return item.indexSource
}
}
},
//
async getAtomicIndexAttributeScope() {
const list = []
for (const item of this.atomicIndexData) {
list.push(item.id)
}
const res = await listAtomicIndexAttributeScope(list)
if (res.code === 200) {
this.atomicIndexAttributeScope = res.data
}
},
getAttrValueType(value, atomicIndexId) {
if (value && atomicIndexId) {
const list = this.atomicIndexAttributeScope[atomicIndexId]
for (const item of list) {
if (item.value === value) {
return item.valueType
}
}
}
},
//
getOptionList(value, atomicIndexId, type) {
if (value && atomicIndexId) {
const list = this.atomicIndexAttributeScope[atomicIndexId]
for (const item of list) {
if (item.value === value) {
return item[type]
}
}
}
},
selectAtomic(val, subItem) {
this.getAtomicIndexAttributeScope(val)
subItem.indexSource = this.getIndexSource(val)
this.$set(subItem, 'relationalSymbol', '')
this.$set(subItem, 'operator', '')
this.$set(subItem, 'value', '')
},
//
selectPropertyKey(val, items, id) {
items.leftOperand.valueType = this.getAttrValueType(val, id)
this.$set(items.leftOperand, 'aggregateType', '')
this.$set(items, 'rightOperand', {
atomicIndexId: '',
value: '',
valueType: '',
operandType: '',
propertyKey: ''
})
this.$set(items, 'operator', '')
},
//
addOperandUnitList(index, subIndex) {
this.ruleConditionGroupList[index].ruleConditionList[subIndex].operandUnitList.push({
leftOperand: {
atomicIndexId: '',
operandType: '5'
},
rightOperand: {
atomicIndexId: '',
value: '',
valueType: '',
operandType: '',
propertyKey: ''
}
})
},
//
handleAdd() {
this.gridOptions.data.push({
@ -208,41 +425,43 @@ export default {
},
//
handleAddRow(val) {
val.atomicData.push({
atomicIndex: '',
relationalSymbol: ''
val.ruleConditionList.push({
atomicIndexId: '', indexSource: '', rowLogic: '', relationalSymbol: '', operator: '', value: '', operandUnitList: []
})
},
//
handleAddGroup(index) {
this.logicData.splice(index, 0, {
groupLogic: '1',
rowLogic: '&',
atomicData: [
{ atomicIndex: '', relationalSymbol: '' }
]
if (this.ruleConditionGroupList.length > 1) return
this.ruleConditionGroupList.splice(index, 0, {
rowLogic: '2', ruleConditionList: [{ atomicIndexId: '', indexSource: '', rowLogic: '', relationalSymbol: '', operator: '', value: '', operandUnitList: [] }]
})
},
//
handleDelGroup(item) {
this.logicData.splice(this.logicData.indexOf(item), 1)
this.ruleConditionGroupList.splice(this.ruleConditionGroupList.indexOf(item), 1)
},
//
handleRowClick(item, subItem) {
item.atomicData.splice(item.atomicData.indexOf(subItem), 1)
item.ruleConditionList.splice(item.ruleConditionList.indexOf(subItem), 1)
},
delItem(item, subItem) {
item.operandUnitList.splice(item.operandUnitList.indexOf(subItem), 1)
},
//
validate() {
let valid = true
this.logicData.map((item) => {
item.atomicData.map((subItem) => {
if (!subItem.atomicIndex || !subItem.relationalSymbol) {
this.ruleConditionGroupList.map((item) => {
item.ruleConditionList.map((subItem) => {
if (!subItem.atomicIndexId || !subItem.relationalSymbol) {
valid = false
}
})
})
if (valid) {
return this.logicData
return {
groupLogic: this.groupLogic,
ruleConditionGroupList: this.ruleConditionGroupList
}
} else {
this.$baseMessage.error('请选择原子指标和关系符号')
}
@ -298,8 +517,11 @@ export default {
left: 310px;
}
.row-sku {
padding-left: 50px;
background: rgba(55,99,255,0.05);
margin: 0 42px;
padding: 18px;
.row-sku-top {
// padding-left: 50px;
span {
font-size: 14px;
color: #3763FF;

@ -79,10 +79,10 @@
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="判断逻辑" prop="judgeLogic">-->
<!-- <el-form-item label="判断逻辑" prop="indexRule">-->
<!-- <template>-->
<!-- <div class="flex-row">-->
<!-- <el-select v-model="ruleForm['judgeLogic']" placeholder="请选择判断逻辑">-->
<!-- <el-select v-model="ruleForm['indexRule']" placeholder="请选择判断逻辑">-->
<!-- <el-option-->
<!-- v-for="item in judgmentLogicOptions"-->
<!-- :key="item.value"-->
@ -114,13 +114,14 @@
</el-form>
<div v-if="activeStep === 1">
<p>{{ `[${indexTypeName}] ${ruleForm['name']}` }}</p>
<custom-logic ref="custom" :atomic-index-data="ruleForm['atomicIndexList']" :judge-logic="ruleForm['judgeLogic']" />
<custom-logic ref="custom" :atomic-index-data="ruleForm['atomicIndexList']" :index-rule="ruleForm['indexRule']" />
</div>
<!--原子指标选择-->
<select-atomic ref="select" @submit="handleAtomicSubmit" />
</div>
<div slot="footer">
<el-button type="primary" plain style="width: 150px" @click="handleReset"> </el-button>
<el-button v-if="!isEdit" type="primary" plain style="width: 150px" @click="handleReset"> </el-button>
<el-button v-if="isEdit" type="primary" plain style="width: 150px" @click="closed"> </el-button>
<el-button v-if="activeStep === 0" type="primary" style="width: 150px" @click="nextStep"></el-button>
<el-button v-if="activeStep === 1" type="primary" plain style="width: 150px" @click="lastStep"></el-button>
<el-button v-if="activeStep === 1" type="primary" style="width: 150px" @click="handleSubmit"> </el-button>
@ -174,10 +175,10 @@ export default {
}],
// indexRules: [{ required: true, message: '!', trigger: 'blur' }],
atomicIndex: [{ required: true, message: '原子指标不能为空!', trigger: 'blur' }],
judgeLogic: [{ required: true, message: '指标说明不能为空!', trigger: 'blur' }]
indexRule: [{ required: true, message: '指标说明不能为空!', trigger: 'blur' }]
},
//
isEdit: false,
isEdit: false
//
}
},
@ -216,8 +217,11 @@ export default {
},
//
handleReset() {
this.$refs.form.resetFields()
this.$refs.form.clearValidate()
this.activeStep = 0
this.$nextTick(() => {
this.$refs.form.resetFields()
this.$refs.form.clearValidate()
})
},
//
nextStep() {
@ -231,12 +235,27 @@ export default {
lastStep() {
this.activeStep = 0
},
closed() {
this.drawerOption.show = false
},
//
async handleSubmit() {
//
const logicData = this.$refs.custom.validate()
if (logicData) {
this.$set(this.ruleForm, 'judgeLogic', JSON.stringify(logicData))
const params = this.$refs.custom.validate()
for (const item of params.ruleConditionGroupList) {
for (const items of item.ruleConditionList) {
for (const data of items.operandUnitList) {
data.leftOperand.atomicIndexId = items.atomicIndexId
}
}
}
// const params = {
// ruleConditionGroupList,
// groupLogic: ruleConditionGroupList[0].groupLogic
// }
console.log(params)
if (params.ruleConditionGroupList) {
this.$set(this.ruleForm, 'indexRule', params)
}
if (this.$baseLodash.isArray(this.ruleForm['caseType'])) {
this.ruleForm['caseType'] = this.ruleForm['caseType'].join(',')

Loading…
Cancel
Save