fix:测试bug修改

dev_2.3
xiangcongshuai 1 week ago
parent e978ad69ce
commit 1580ce2797

@ -239,6 +239,7 @@ export default {
// down icon
isShowDownIcon: false,
indexList: [],
caseType: '',
showIndexList: [], //
intentTypeList: [
{
@ -330,7 +331,8 @@ export default {
//
getIndexData(val) {
queryIndexData({
indexType: val
indexType: val,
caseType: this.caseType
}, 1, 9999).then(res => {
this.indexList = res.data.result
this.showIndexList = res.data.result
@ -344,7 +346,9 @@ export default {
},
selectCase(val) {
const obj = this.caseOptions.find(item => item.id === val)
this.caseType = obj.caseType
this.caseActorName = obj.caseActorName
this.indexFlag = false
},
selectCaseType(item) {
if (this.loading) return

@ -289,7 +289,7 @@ export default {
if (item['isAnalysing']) {
statusName = '正在分析...'
} else {
if (score) {
if (score || score === 0) {
statusName = '已分析'
} else {
statusName = '未分析'

@ -15,7 +15,7 @@
<template slot="content">
<div class="add-atomic">
<el-form ref="form" :model="ruleForm" :rules="rules" label-width="120px">
<el-form-item label="案件类型" prop="caseType">
<!-- <el-form-item label="案件类型" prop="caseType">
<el-select v-model="ruleForm.caseType" :disabled="isView" placeholder="请选择案件类型" style="width: 100%">
<el-option
v-for="item in caseTypeOptions"
@ -24,7 +24,7 @@
:value="item.id"
/>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="原子指标名称" prop="name">
<el-input
v-model="ruleForm.name"

@ -9,27 +9,64 @@
<template>
<div class="content">
<cs-search title="原子指标" :data="searchData" :span="8" direction="row" @onSearch="onSearch" @getData="onSearch" />
<div class="index-content">
<div class="header">
<el-button type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd"></el-button>
<div class="main-content">
<div :class="[detailFlag?'table-content-open':'table-content-closed']">
<div class="header">
<el-button style="margin: 16px 16px 0 0;" type="primary" icon="el-icon-circle-plus-outline" @click="handleAdd"></el-button>
</div>
<vxe-grid v-bind="gridOptions" style="margin-top: 20px;padding: 0 16px;">
<template #operate="{row}">
<el-button type="text" icon="el-icon-edit" @click="handleEdit(row)" />
<!-- <el-button type="text" icon="el-icon-view" title="查看明细" @click="handleView(row)" /> -->
<el-button type="text" style="color: red" icon="el-icon-delete" @click="handleDel(row)" />
</template>
<template #name="{row}">
<el-link type="primary" @click="opendetails(row)">{{ row.name }}</el-link>
</template>
</vxe-grid>
<div style="text-align: center">
<cs-page
:page.sync="queryForm.page"
:limit.sync="queryForm.size"
:total="queryForm.total"
@pagination="fetchData"
/>
</div>
</div>
<vxe-grid v-bind="gridOptions" style="margin-top: 20px">
<template #operate="{row}">
<div v-if="detailFlag" class="details">
<div class="title">原子指标详情</div>
<div class="details-item">
<span class="circle" />
{{ datailsInfo.name }}</div>
<div class="details-item">
<div class="label">指标算法:</div>
<div class="value">{{ datailsInfo.indexSourceName }}</div>
</div>
<el-button type="text" icon="el-icon-edit" @click="handleEdit(row)" />
<el-button type="text" icon="el-icon-view" title="查看明细" @click="handleView(row)" />
<el-button type="text" style="color: red" icon="el-icon-delete" @click="handleDel(row)" />
</template>
</vxe-grid>
<div style="text-align: center">
<cs-page
:page.sync="queryForm.page"
:limit.sync="queryForm.size"
:total="queryForm.total"
@pagination="fetchData"
/>
<div v-if="datailsInfo['indexSource'] !=='1'" class="details-item">
<div class="label">查询语句:</div>
<div v-if="['2','3'].includes(datailsInfo['indexSource'])" class="value">{{ datailsInfo.queryLang }}</div>
<div v-if="datailsInfo['indexSource'] ==='5'" class="value">
<div v-if="datailsInfo.promptName" class="sel-name">{{ `${datailsInfo.promptName}` }}</div>
<div v-if="datailsInfo['indexSource'] === '5' && datailsInfo.extractAttributes.length > 0" class="select-model-list">
<div v-for="(item,index) in datailsInfo.extractAttributes" :key="index" class="model-list-item">
<span>{{ item }}</span>
</div>
</div>
</div>
</div>
<div class="contract" @click="detailFlag=false">
<i class="el-icon-d-arrow-right contract-icon" />
</div>
<div class="details-item">
<div class="label">指标说明:</div>
<div class="value">{{ datailsInfo.remark }}</div>
</div>
</div>
</div>
<el-dialog
:visible.sync="dialogVisible"
width="500px"
@ -62,7 +99,7 @@
<!--编辑弹窗-->
<edit-atomic ref="edit" @reloadData="fetchData" />
</div>
</template>
</div></template>
<script>
import ChangeRules from '@/views/ruleEngine/indexRule/components/ChangeRules.vue'
@ -85,8 +122,13 @@ export default {
{ label: '指标来源', model: 'indexSource', type: 'select', option: JSON.parse(sessionStorage.getItem('index_source')) },
{ label: '最新时间', model: 'updateTime', type: 'datetimerange' }
],
detailFlag: false,
dialogVisible: false,
atomicList: [],
datailsInfo: {
name: '',
remark: ''
},
selectAtomic: '',
//
gridOptions: {
@ -100,7 +142,7 @@ export default {
},
columns: [
{ title: '序号', type: 'seq', width: '50px' },
{ title: '原子指标', field: 'name' },
{ title: '原子指标', field: 'name', slots: { default: 'name' }},
// { title: '', field: 'caseTypeName', sortable: true },
{ title: '指标来源', field: 'indexSourceName', sortable: true },
// { title: '', field: 'connectStatus' },
@ -171,6 +213,11 @@ export default {
// this.fetchData()
// })
},
opendetails(item) {
this.datailsInfo = { ...item }
this.datailsInfo.extractAttributes = item.properties ? item.properties.split(',') : []
this.detailFlag = true
},
//
onSearch(data, callback) {
this.searchFormData = Object.assign({}, data)
@ -185,14 +232,119 @@ export default {
<style scoped lang="scss">
.content {
height: 100%;
.index-content {
.main-content {
border-radius: 8px;
background: white;
padding: 20px;
box-sizing: border-box;
margin-top: 10px;
height: calc(100% - 123px);
display: flex;
.table-content-open {
width: calc(100% - 480px);
background: #FFFFFF;
}
.table-content-closed {
width: 100%;
background: #FFFFFF;
}
.details {
width: 408px;
background: #FFFFFF;
border-radius: 6px 6px 6px 6px;
margin-left: 16px;
padding: 24px;
// margin-top: 10px;
position: relative;
.contract {
position: absolute;
top: 50%;
left: -18px;
cursor: pointer;
width: 20px;
border-bottom: 10px solid #fff;
border-left: 3px solid transparent;
border-right: 3px solid transparent;
height: 0;
transform: rotate(-90deg);
/* 向左旋转 90 度 */
transform-origin: center center;
.contract-icon {
transform: rotate(90deg);
cursor: pointer;
padding-left:5px ;
}
}
.title {
font-size: 16px;
color: #333333;
margin-bottom: 16px;
}
.circle {
width: 8px;
height: 8px;
background: #666666;
border-radius: 50%;
margin-top: 2px;
margin-right: 8px;
}
.details-item {
display: flex;
font-size: 16px;
color: #666666;
margin-bottom: 16px;
// align-items: center;
.label {
margin-right: 8px;
width: 90px;
}
.value {
flex: 1;
}
}
.sel-name {
font-size: 16px;
color: #3763FF;
}
.sel-desc {
margin-top: 8px;font-size: 16px;
color: #333333
}
.sql_btn {
position: absolute;
right: 16px;
bottom: 16px;width: 112px;
height: 42px;
background: #FFFFFF;
border-radius: 6px 6px 6px 6px;
border: 1px solid #3763FF;
font-size: 16px;
color: #3763FF;
text-align: center;
line-height: 42px;
cursor: pointer;
}
.select-model-list {
display: flex;
margin-top: 16px;
flex-wrap: wrap;
.model-list-item {
padding: 0 12px;
height: 32px;
margin:0 8px 8px 0;
background: #F0F0F0;
border-radius: 6px 6px 6px 6px;font-size: 14px;
color: #333333;
display: flex;
align-items: center;
cursor: pointer;
span {
// margin-right: 16px;
}
}
}
}
}
.expand-details {
background: #F6F6F6;
padding: 8px 20px;
@ -201,6 +353,7 @@ export default {
.header {
display: flex;
flex-direction: row-reverse;
align-items: center;
}
}
::v-deep {
@ -226,6 +379,7 @@ export default {
}
::v-deep .el-dialog {
// background: linear-gradient(to bottom, #E1ECFE, #FFFFFF);
margin-top: 30vh !important
}
.del-folder {
padding: 24px;
@ -260,6 +414,7 @@ export default {
margin-top: 4px;
}
}
.footer-btns {
padding-top: 24px;
display: flex;

@ -289,6 +289,7 @@ export default {
}
}
}
const loading = this.$baseLoading(1, '保存中...')
// const params = {
// ruleConditionGroupList,
// groupLogic: ruleConditionGroupList[0].groupLogic
@ -302,6 +303,7 @@ export default {
// }
this.ruleForm['caseType'] = this.modelId
const { code, msg } = await addOrUpdIndex(this.ruleForm)
loading.close()
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
this.$emit('reloadData')

@ -32,7 +32,7 @@ export default {
return {
drawerOption: {
show: false,
title: '案件模型',
title: '赋分模型',
isClosed: true,
width: '40%'
},

@ -219,7 +219,7 @@ export default {
hiddenFooter: true,
title: '详情',
isClosed: true,
width: '40%'
width: '1000px'
},
atomicIndexData: [],
indexRule: undefined,

@ -33,7 +33,7 @@ export default {
drawerOption: {
show: false,
isClosed: true,
title: '案件模型',
title: '赋分模型',
width: '40%'
},
ruleForm: {
@ -58,10 +58,10 @@ export default {
}
if (type === 'copy') {
this.isCopy = true
this.ruleForm.modelName += '2'
} else {
this.isCopy = false
}
this.ruleForm.modelName += '2'
},
//
handleReset() {

@ -1,43 +1,46 @@
<template>
<div class="scoringModel">
<div class="case_list">
<div v-for="(item,index) in caseList" :key="index" class="case_item" :class="[selectId === item.id ?'actived':'']" @click="selectCase(item)">
<span :title="item.modelName" style="width: 180px;">{{ item.modelName.slice(0,8) }}</span>
<el-popover
:ref="`popover-${index}`"
append-to-body
placement="bottom"
width="80"
trigger="click"
>
<template #reference>
<div :id="'popover-btn-' + index" class="circle_list">
<span class="circle" />
<span class="circle" />
<span class="circle" />
</div>
</template>
<div class="scoringModel-operate">
<div class="operate-item" @click="editModel(item)">
<img src="../../../assets/common/edit.png" alt="">
<span>编辑</span>
</div>
<div class="operate-item" @click="copyModel(item)">
<img src="../../../assets/common/copy.png" alt="">
<span>复制</span>
</div>
<div class="operate-item" @click="delModel(item)">
<img src="../../../assets/common/del.png" alt="">
<span>删除</span>
</div>
</div>
</el-popover>
</div>
<div class="left">
<div class="add_btn" @click="addModel">
<i class="el-icon-circle-plus-outline" style="margin-right: 8px;" />
<span>新增</span>
</div>
<div class="case_list">
<div v-for="(item,index) in caseList" :key="index" class="case_item" :class="[selectId === item.id ?'actived':'']" @click="selectCase(item)">
<span :title="item.modelName" style="width: 180px;">{{ item.modelName.slice(0,8) }}</span>
<el-popover
:ref="`popover-${index}`"
append-to-body
placement="bottom"
width="80"
trigger="click"
>
<template #reference>
<div :id="'popover-btn-' + index" class="circle_list">
<span class="circle" />
<span class="circle" />
<span class="circle" />
</div>
</template>
<div class="scoringModel-operate">
<div class="operate-item" @click="editModel(item)">
<img src="../../../assets/common/edit.png" alt="">
<span>编辑</span>
</div>
<div class="operate-item" @click="copyModel(item)">
<img src="../../../assets/common/copy.png" alt="">
<span>复制</span>
</div>
<div class="operate-item" @click="delModel(item)">
<img src="../../../assets/common/del.png" alt="">
<span>删除</span>
</div>
</div>
</el-popover>
</div>
</div>
</div>
<div ref="htmlContent" class="content">
<cs-search title="赋分模型" :data="searchData" :span="6" direction="row" @onSearch="onSearch" @getData="onSearch" />
@ -183,6 +186,7 @@ export default {
},
//
fetchData() {
if (!this.selectId) return
queryIndexData({ ...this.searchFormData, caseType: this.selectId, indexType: this.indexType }, this.queryForm.page, this.queryForm.size).then(res => {
this.gridOptions.data = res.data.result
this.queryForm.total = res.data.total
@ -245,8 +249,8 @@ export default {
.scoringModel {
display: flex;
height: 100%;
.case_list {
width: 216px;
.left {
width: 216px;
height: 894px;
background: #FFFFFF;
border-radius: 8px 8px 8px 8px;
@ -256,7 +260,25 @@ export default {
align-items: center;
padding: 24px;
height: calc(100vh - 200px);
.add_btn {
width: 168px;
// height: 53px;
background: #FFFFFF;
border-radius: 6px 6px 6px 6px;
border: 1px solid #3763FF;
padding: 16px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
font-size: 16px;
color: #3763FF;
margin-bottom: 12px;
}
}
.case_list {
overflow: auto;
.case_item {
width: 168px;
// height: 53px;
@ -299,20 +321,6 @@ export default {
background: #FFFFFF !important;
}
}
.add_btn {
width: 168px;
// height: 53px;
background: #FFFFFF;
border-radius: 6px 6px 6px 6px;
border: 1px solid #3763FF;
padding: 16px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
font-size: 16px;
color: #3763FF;
}
}

Loading…
Cancel
Save