feat:bug修改

dev_1.0.0
xiangcongshuai 10 months ago
parent 904a772533
commit 7dcd713568

@ -50,20 +50,25 @@ export function addUser(data) {
}) })
} }
/** 上传笔录 */ /** 上传笔录 */
export function addOrUpdRecords(formData) { // export function addOrUpdRecords(formData) {
return axios.request({ // return axios.request({
baseURL, // baseURL,
timeout: requestTimeout, // timeout: requestTimeout,
// url: `${routes.record}/addOrUpdRecords`,
// method: 'post',
// data: formData
// }).then(response => {
// return Promise.resolve(response.data)
// }).catch(error => {
// return Promise.reject(error)
// })
// }
export function addOrUpdRecords(data) {
return request({
url: `${routes.record}/addOrUpdRecords`, url: `${routes.record}/addOrUpdRecords`,
method: 'post', method: 'post',
headers: { data
'Content-Type': 'multipart/form-data'
},
data: formData
}).then(response => {
return Promise.resolve(response.data)
}).catch(error => {
return Promise.reject(error)
}) })
} }
/** 删除笔录 */ /** 删除笔录 */

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

@ -73,7 +73,7 @@ export default {
isExpand: { isExpand: {
handler: function(newVal, oldVal) { handler: function(newVal, oldVal) {
if (newVal !== oldVal) { if (newVal !== oldVal) {
this.tableHeight(this.isExpand ? this.isEdit ? 550 : 500 : this.isEdit ? 380 : 330) this.tableHeight(this.isExpand ? this.isEdit ? 580 : 530 : this.isEdit ? 400 : 350)
} }
}, },
immediate: true immediate: true
@ -82,7 +82,7 @@ export default {
mounted() { mounted() {
this.caseId = this.$route.params.id this.caseId = this.$route.params.id
this.$nextTick(() => { this.$nextTick(() => {
this.tableHeight(this.isExpand ? (this.isEdit ? 550 : 500) : (this.isEdit ? 380 : 330)) this.tableHeight(this.isExpand ? (this.isEdit ? 580 : 530) : (this.isEdit ? 400 : 350))
}) })
this.fetchData() this.fetchData()
}, },

@ -21,8 +21,8 @@
<vxe-grid v-bind="gridOptions" style="margin-top: 10px"> <vxe-grid v-bind="gridOptions" style="margin-top: 10px">
<template #opera="{row}"> <template #opera="{row}">
<el-button type="text" icon="el-icon-video-play" :disabled="!isEdit" title="笔录分析" @click="handleCreateAtlas(row)" /> <el-button type="text" icon="el-icon-video-play" :disabled="!isEdit" title="笔录分析" @click="handleCreateAtlas(row)" />
<el-button v-if="!row.children" type="text" icon="el-icon-edit" title="编辑" :disabled="!isEdit" @click="handelEdit(row)" /> <el-button v-if="row.children.length === 0" type="text" icon="el-icon-edit" title="编辑" :disabled="!isEdit" @click="handelEdit(row)" />
<el-button v-if="!row.children" 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)" />
</template> </template>
</vxe-grid> </vxe-grid>
<div style="text-align: center"> <div style="text-align: center">
@ -98,7 +98,7 @@ export default {
isExpand: { isExpand: {
handler: function(newVal, oldVal) { handler: function(newVal, oldVal) {
if (newVal !== oldVal) { if (newVal !== oldVal) {
this.tableHeight(this.isExpand ? (this.isEdit ? 550 : 500) : (this.isEdit ? 380 : 330)) this.tableHeight(this.isExpand ? (this.isEdit ? 580 : 530) : (this.isEdit ? 400 : 350))
} }
} }
}, },
@ -109,7 +109,7 @@ export default {
mounted() { mounted() {
this.caseId = this.$route.params.id this.caseId = this.$route.params.id
this.$nextTick(() => { this.$nextTick(() => {
this.tableHeight(this.isExpand ? (this.isEdit ? 550 : 500) : (this.isEdit ? 380 : 330)) this.tableHeight(this.isExpand ? (this.isEdit ? 580 : 530) : (this.isEdit ? 400 : 350))
}) })
this.fetchData() this.fetchData()
}, },

@ -14,7 +14,7 @@
<el-button type="text" icon="el-icon-close" @click="handleDel(row)" /> <el-button type="text" icon="el-icon-close" @click="handleDel(row)" />
</template> </template>
<template #result="{row}"> <template #result="{row}">
<el-tag :type="row.indexResult === 'true' ? 'success' : 'error'">{{ row.indexResult === 'true' ? '符合' : '不符合' }}</el-tag> <el-tag :type="row.indexResult === 'true' ? 'success' : 'error'">{{ row.indexResult?row.indexResult=== 'true' ? '符合' : '不符合': '未评估' }}</el-tag>
</template> </template>
</vxe-grid> </vxe-grid>
<div style="text-align: center"> <div style="text-align: center">
@ -72,7 +72,7 @@ export default {
isExpand: { isExpand: {
handler: function(newVal, oldVal) { handler: function(newVal, oldVal) {
if (newVal !== oldVal) { if (newVal !== oldVal) {
this.tableHeight(this.isExpand ? 500 : 330) this.tableHeight(this.isExpand ? 530 : 360)
} }
}, },
immediate: true immediate: true

@ -74,7 +74,7 @@ export default {
isExpand: { isExpand: {
handler: function(newVal, oldVal) { handler: function(newVal, oldVal) {
if (newVal !== oldVal) { if (newVal !== oldVal) {
this.tableHeight(this.isExpand ? 500 : 330) this.tableHeight(this.isExpand ? 530 : 360)
} }
}, },
immediate: true immediate: true

@ -72,7 +72,7 @@ export default {
isExpand: { isExpand: {
handler: function(newVal, oldVal) { handler: function(newVal, oldVal) {
if (newVal !== oldVal) { if (newVal !== oldVal) {
this.tableHeight(this.isExpand ? 500 : 330) this.tableHeight(this.isExpand ? 530 : 360)
} }
}, },
immediate: true immediate: true

@ -9,10 +9,13 @@
<template> <template>
<cs-dialog <cs-dialog
:dialog="dialogOptions" :dialog="dialogOptions"
@onSubmit="handleSubmit"
> >
<template slot="content"> <template slot="content">
<vxe-grid ref="xTable" v-bind="gridOptions" /> <vxe-grid ref="xTable" v-bind="gridOptions" />
<div style="text-align: center;margin-top: 10px">
<el-button type="primary" plain style="width: 80px" @click="() => { dialogOptions.show = false }">取消</el-button>
<el-button type="primary" style="width: 80px" @click="handleSubmit"></el-button>
</div>
</template> </template>
</cs-dialog> </cs-dialog>
</template> </template>
@ -30,6 +33,8 @@ export default {
title: { title: {
title: '选择三元组信息入库' title: '选择三元组信息入库'
}, },
top: '50px',
hiddenFooter: true,
appendToBody: true appendToBody: true
}, },
gridOptions: { gridOptions: {
@ -48,7 +53,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.tableHeight(330) // this.tableHeight(330)
}, },
methods: { methods: {
// //

@ -79,7 +79,7 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.userForm.validate(async valid => { this.$refs.userForm.validate(async valid => {
if (valid) { if (valid) {
const { code, msg } = await addUser(this.userForm) const { code, msg } = await addUser({ ...this.userForm, caseId: this.$route.params['id'] })
code === 200 ? this.$baseMessage.success(msg || '新增成功!') : this.$baseMessage.error(msg || '新增失败!') code === 200 ? this.$baseMessage.success(msg || '新增成功!') : this.$baseMessage.error(msg || '新增失败!')
this.dialogOption.show = false this.dialogOption.show = false
this.$emit('reloadData') this.$emit('reloadData')

@ -78,15 +78,10 @@
style="width: 100%" style="width: 100%"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="isEdit" label="供述材料" prop="confessionMaterial"> <!-- <el-form-item v-if="isEdit" label="供述材料" prop="confessionMaterial">
<el-row :gutter="10" type="flex" style="flex-wrap:wrap"> <el-row :gutter="10" type="flex" style="flex-wrap:wrap">
<el-col v-for="(item, index) in fileIdList" :key="index" :span="8"> <el-col v-for="(item, index) in fileIdList" :key="index" :span="8">
<div class="file-item"> <div class="file-item">
<!-- <el-image-->
<!-- src="~@/assets/caseDetails/doc.png"-->
<!-- fit="contain"-->
<!-- -->
<!-- />-->
<img <img
src="~@/assets/caseDetails/doc.png" src="~@/assets/caseDetails/doc.png"
style="width: 50px;height: 50px" style="width: 50px;height: 50px"
@ -96,16 +91,16 @@
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item> -->
<el-form-item label="上传材料" prop="file"> <el-form-item label="上传材料" prop="fileIdList">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="uploadOption.action" :action="uploadOption.action"
:accept="uploadOption.accept" :accept="uploadOption.accept"
:on-preview="handlePreview" :on-preview="handlePreview"
:on-remove="handleRemove" :on-remove="handleRemove"
:on-change="handleFileChange" :before-remove="beforeRemove"
:auto-upload="false" :on-success="handleSuccess"
multiple multiple
:on-exceed="handleExceed" :on-exceed="handleExceed"
:file-list="fileList" :file-list="fileList"
@ -157,7 +152,9 @@ export default {
// //
showFileViewer: false, showFileViewer: false,
// //
recordForm: {}, recordForm: {
fileIdList: []
},
rules: { rules: {
name: [{ required: true, message: '姓名不能为空!', trigger: 'blur' }], name: [{ required: true, message: '姓名不能为空!', trigger: 'blur' }],
indexNum: [{ required: true, message: '次数不能为空!', trigger: 'blur' }], indexNum: [{ required: true, message: '次数不能为空!', trigger: 'blur' }],
@ -165,7 +162,7 @@ export default {
lawAsker: [{ required: true, message: '询问人不能为空!', trigger: 'blur' }], lawAsker: [{ required: true, message: '询问人不能为空!', trigger: 'blur' }],
confessionTime: [{ required: true, message: '供述时间不能为空!', trigger: 'blur' }], confessionTime: [{ required: true, message: '供述时间不能为空!', trigger: 'blur' }],
confessionMaterial: [{ required: true, message: '供述材料不能为空!', trigger: 'blur' }], confessionMaterial: [{ required: true, message: '供述材料不能为空!', trigger: 'blur' }],
file: [{ required: true, message: '上传材料不能为空!', trigger: 'blur' }] fileIdList: [{ required: true, message: '上传材料不能为空!', trigger: 'blur' }]
}, },
// //
userList: [], userList: [],
@ -173,39 +170,24 @@ export default {
roleList: JSON.parse(sessionStorage.getItem('case_role')), roleList: JSON.parse(sessionStorage.getItem('case_role')),
// //
fileList: [], fileList: [],
//
fileIdList: [],
// //
uploadOption: { uploadOption: {
action: '', action: `${baseURL}/minio/uploadFile`,
accept: '.docx,.doc' accept: '.docx,.bmp,.jpg,.png'
}, },
// //
initialIndex: 0, initialIndex: 0,
// 线
// activities: [
// {
// content: '',
// timestamp: '2018-04-15'
// }, {
// content: '',
// timestamp: '2018-04-13'
// }, {
// content: '',
// timestamp: '2018-04-11'
// }
// ],
isEdit: false isEdit: false
} }
}, },
watch: { // watch: {
// // //
fileList: { // fileList: {
handler: function(val) { // handler: function(val) {
this.$set(this.recordForm, 'file', val.length > 0 ? '12' : '') // this.$set(this.recordForm, 'file', val.length > 0 ? '12' : '')
} // }
} // }
}, // },
mounted() { mounted() {
this.caseId = this.$route.params.id this.caseId = this.$route.params.id
this.getUserList() this.getUserList()
@ -215,18 +197,21 @@ export default {
this.isEdit = isEdit this.isEdit = isEdit
// //
// this.drawerOption.width = isEdit ? '50%' : '35%' // this.drawerOption.width = isEdit ? '50%' : '35%'
this.recordForm = isEdit ? data : {} this.recordForm = isEdit ? data : { fileIdList: [] }
// //
if (isEdit && data['confessionStartTime'] && data['confessionEndTime']) { if (isEdit && data['confessionStartTime'] && data['confessionEndTime']) {
this.$set(this.recordForm, 'confessionTime', [data['confessionStartTime'], data['confessionEndTime']]) this.$set(this.recordForm, 'confessionTime', [data['confessionStartTime'], data['confessionEndTime']])
} }
this.fileList = [] this.fileList = []
// id if (isEdit) {
if (isEdit && data['fileIds']) { const list = []
this.fileIdList = data['fileIds'].split(',') data.fileList.forEach(e => {
// files.map(item => { list.push(e.fileId)
// this.fileIdList.push(`${baseURL}${commonDownloadFile}${item}`) this.fileList.push({
// }) name: e.fileName
})
})
this.recordForm.fileIdList = list
} }
this.drawerOption.title = isEdit ? '编辑笔录' : '添加笔录' this.drawerOption.title = isEdit ? '编辑笔录' : '添加笔录'
this.drawerOption.show = true this.drawerOption.show = true
@ -254,32 +239,26 @@ export default {
}) })
return list return list
}, },
// handleRemove(file, uploadFiles) {
handlePreviewItem(index) { const list = []
this.showFileViewer = true for (const item of uploadFiles) {
this.initialIndex = index list.push(item.response.data)
}
this.recordForm.fileIdList = list
}, },
// handlePreview(file) {
handleDelete(item) { console.log(file)
this.$baseConfirm('确定删除该笔录材料吗?', null, async() => { },
const { code } = await deleteFile(item) handleExceed(files, fileList) {
if (code === 200) { this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
this.fileIdList.splice(this.fileIdList.indexOf(item), 1) },
const params = this.$baseLodash.cloneDeep(this.recordForm) beforeRemove(file, fileList) {
params['fileIds'] = this.fileIdList.join(',') return this.$confirm(`确定移除 ${file.name}`)
if (this.$baseLodash.isArray(params['confessionTime'])) { },
this.$set(params, 'confessionStartTime', params['confessionTime'][0]) handleSuccess(response) {
this.$set(params, 'confessionEndTime', params['confessionTime'][1]) if (response.code === 200) {
} this.recordForm.fileIdList.push(response.data)
delete params['file'] }
delete params['confessionTime']
const formData = new FormData()
this.$baseLodash.keys(params).forEach(key => {
formData.append(key, params[key])
})
addOrUpdRecords(formData)
}
})
}, },
// //
handleReset() { handleReset() {
@ -291,26 +270,32 @@ export default {
this.$refs.form.validate(async valid => { this.$refs.form.validate(async valid => {
if (valid) { if (valid) {
// //
const params = this.$baseLodash.cloneDeep(this.recordForm) // const params = this.$baseLodash.cloneDeep(this.recordForm)
if (this.isEdit) { // const formData = new FormData()
params['fileIds'] = this.fileIdList.join(',') // if (this.isEdit) {
// params['fileIds'] = this.fileIdList.join(',')
// } else {
// formData.append('caseId', this.caseId)
// }
// delete params['file']
// delete params['confessionTime']
// this.$baseLodash.keys(params).forEach(key => {
// formData.append(key, params[key])
// })
// for (let i = 0; i < this.fileList.length; i++) {
// formData.append('file', this.fileList[i])
// }
const params = {
...this.recordForm,
caseId: this.$route.params.id
} }
if (this.$baseLodash.isArray(params['confessionTime'])) { if (this.$baseLodash.isArray(params['confessionTime'])) {
this.$set(params, 'confessionStartTime', params['confessionTime'][0]) this.$set(params, 'confessionStartTime', params['confessionTime'][0])
this.$set(params, 'confessionEndTime', params['confessionTime'][1]) this.$set(params, 'confessionEndTime', params['confessionTime'][1])
} }
delete params['file']
delete params['confessionTime']
const formData = new FormData()
this.$baseLodash.keys(params).forEach(key => {
formData.append(key, params[key])
})
for (let i = 0; i < this.fileList.length; i++) {
formData.append('file', this.fileList[i])
}
formData.append('caseId', this.caseId)
const loading = this.$baseLoading(0, '笔录上传中,请勿刷新界面..') const loading = this.$baseLoading(0, '笔录上传中,请勿刷新界面..')
addOrUpdRecords(formData).then(res => { addOrUpdRecords(params).then(res => {
loading.close() loading.close()
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 || '上传失败')
@ -335,15 +320,6 @@ export default {
this.fileList.push(x.raw) this.fileList.push(x.raw)
} }
} }
},
handleRemove(file, fileList) {
console.log(file, fileList)
},
handlePreview(file) {
console.log(file)
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
} }
} }
} }

@ -11,7 +11,7 @@
<div class="details-header"> <div class="details-header">
<div v-if="expand" class="flex-row expand-info"> <div v-if="expand" class="flex-row expand-info">
<div class="left-score"> <div class="left-score">
<vue-chart autoresize :option="scoreOption" :style="{ width: '100%', height: '220px' }" /> <vue-chart autoresize :option="scoreOption" :style="{ width: '100%', height: '260px' }" />
<div <div
v-if="caseData['totalScore'] && caseData['totalScore'] > 0" v-if="caseData['totalScore'] && caseData['totalScore'] > 0"
class="flex-column circle-info" class="flex-column circle-info"
@ -21,15 +21,18 @@
<span :style="commonStyle">{{ caseData['totalScore'] }}</span> <span :style="commonStyle">{{ caseData['totalScore'] }}</span>
<span :style="commonStyle">{{ caseData['identifyResultName'] }}</span> <span :style="commonStyle">{{ caseData['identifyResultName'] }}</span>
<span>{{ `最新时间:${caseData['updateTime']}` }}</span> <span>{{ `最新时间:${caseData['updateTime']}` }}</span>
<span v-if="isEdit" class="model" @click="handleAnalysis"></span> <!-- <span v-if="isEdit" class="model" @click="handleAnalysis"></span> -->
</div> </div>
<div <div
v-else v-else
class="flex-column circle-info empty-score" class="flex-column circle-info empty-score"
> >
<span>待分析</span> <span>待分析</span>
<span>暂无结果</span> <span>暂无结果</span>
</div> </div>
<div v-if="isEdit" class="model" @click="handleAnalysis"></div>
</div> </div>
<div class="base-info"> <div class="base-info">
<div class="flex-row" style="align-items: center; justify-content: space-between"> <div class="flex-row" style="align-items: center; justify-content: space-between">
@ -77,7 +80,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="flex-row details-info" :style="{ height: expand ? 'calc(100% - 250px)' : 'calc(100% - 80px)' }"> <div class="flex-row details-info" :style="{ height: expand ? 'calc(100% - 270px)' : 'calc(100% - 100px)' }">
<div class="info-left"> <div class="info-left">
<el-tree <el-tree
:data="leftTabs" :data="leftTabs"
@ -257,15 +260,30 @@ export default {
border-radius: 8px; border-radius: 8px;
background: #FFFFFF; background: #FFFFFF;
.expand-info { .expand-info {
height: 220px; height: 260px;
align-items: center; align-items: center;
.left-score { .left-score {
position: relative; position: relative;
width: 300px; width: 340px;
.model {
width: 200px;
height: 52px;
background: #3763FF;
border-radius: 26px 26px 26px 26px;
text-align: center;
font-size: 18px !important;
color: #FFFFFF;
line-height: 52px;
cursor: pointer;
position: absolute;
top: 180px;
left: 70px;
}
.circle-info { .circle-info {
position: absolute; position: absolute;
width: 180px; width: 220px;
height: 180px; height: 220px;
top: 30px; top: 30px;
left: 60px; left: 60px;
box-shadow: 0 1px 30px 0 rgba(255,169,66,0.2); box-shadow: 0 1px 30px 0 rgba(255,169,66,0.2);
@ -286,23 +304,14 @@ export default {
span:nth-last-child(1) { span:nth-last-child(1) {
font-size: 12px; font-size: 12px;
} }
.model {
width: 200px;
height: 52px;
background: #3763FF;
border-radius: 26px 26px 26px 26px;
text-align: center;
font-size: 18px !important;
color: #FFFFFF;
line-height: 52px;
cursor: pointer;
}
} }
.empty-score { .empty-score {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 16px;
// position: relative;
span:nth-child(1) { span:nth-child(1) {
margin-top: 0; margin-top: 0;
} }

@ -11,7 +11,7 @@
<template slot="content"> <template slot="content">
<el-form ref="form" :model="caseForm" :rules="rules" label-width="90px"> <el-form ref="form" :model="caseForm" :rules="rules" label-width="90px">
<el-form-item label="案件编号" prop="caseNo"> <el-form-item label="案件编号" prop="caseNo">
<el-input v-model="caseForm['caseNo']" placeholder="请输入案件编号" /> <el-input :disabled="isEdit" v-model="caseForm['caseNo']" placeholder="请输入案件编号" />
</el-form-item> </el-form-item>
<el-form-item label="案件名称" prop="caseName"> <el-form-item label="案件名称" prop="caseName">
<el-input v-model="caseForm['caseName']" placeholder="请输入案件名称" /> <el-input v-model="caseForm['caseName']" placeholder="请输入案件名称" />
@ -46,6 +46,7 @@ export default {
name: 'EditCaseInfo', name: 'EditCaseInfo',
data() { data() {
const validatorCaseNo = (rule, value, callback) => { const validatorCaseNo = (rule, value, callback) => {
if (this.isEdit) return
checkCaseNo({ caseNo: value }).then(res => { checkCaseNo({ caseNo: value }).then(res => {
const { code, msg } = res const { code, msg } = res
if (code === 200 && msg) { if (code === 200 && msg) {

@ -79,7 +79,7 @@ export default {
// //
victimEdit: false, victimEdit: false,
caseData: {}, caseData: {},
caseId:"", caseId: '',
// //
gridOptions: { gridOptions: {
...mixin.data().gridOptions, ...mixin.data().gridOptions,
@ -88,7 +88,7 @@ export default {
mode: 'cell' mode: 'cell'
}, },
editRules: { editRules: {
result: [{ required: true, message: '判断结果不能为空!' }] atomicResult: [{ required: true, message: '判断结果不能为空!' }]
}, },
columns: [ columns: [
{ title: '序号', type: 'seq', width: '50px' }, { title: '序号', type: 'seq', width: '50px' },
@ -109,7 +109,6 @@ export default {
methods: { methods: {
// //
show(data) { show(data) {
debugger
this.caseId = data.id this.caseId = data.id
this.dialogOption.show = true this.dialogOption.show = true
this.caseData = data this.caseData = data
@ -130,6 +129,7 @@ export default {
this.save() this.save()
}, },
async save() { async save() {
const res = await saveCaseAtomicResult({ const res = await saveCaseAtomicResult({
caseAtomicIndexList: this.gridOptions.data, caseAtomicIndexList: this.gridOptions.data,
caseId: this.caseId caseId: this.caseId
@ -141,6 +141,12 @@ export default {
}, },
// //
async handleExecute() { async handleExecute() {
for (const item of this.gridOptions.data) {
if (!item.atomicResult) {
this.$baseMessage.error('判断结果不能为空')
return
}
}
await this.save() await this.save()
this.$emit('confirm', this.caseData) this.$emit('confirm', this.caseData)
this.dialogOption.show = false this.dialogOption.show = false

@ -26,7 +26,7 @@
<div class="flex-row item-header"> <div class="flex-row item-header">
<div class="flex-row" style="align-items: center;flex: 1"> <div class="flex-row" style="align-items: center;flex: 1">
<el-tag <el-tag
v-if="item.caseStatus" v-if="item.caseStatus && item.identifyResultName "
:type="item.caseStatus === '1' ? 'success' : 'warning'" :type="item.caseStatus === '1' ? 'success' : 'warning'"
style="margin-right: 5px" style="margin-right: 5px"
> >
@ -146,7 +146,7 @@ export default {
for (const item of e.lawPartyList) { for (const item of e.lawPartyList) {
list.push(item.name) list.push(item.name)
} }
e.lawParty = list.join(',') e.lawParty = list.length > 0 ? list.join(','): '无'
}) })
this.queryForm.total = res.data.total this.queryForm.total = res.data.total
}) })

@ -17,7 +17,7 @@
@click="handleNodeClick(item)" @click="handleNodeClick(item)"
> >
<span>{{ item['recordType'] }}</span> <span>{{ item['recordType'] }}</span>
<el-tag :type="item.prompts.length > 0 ? 'success' : 'error'">{{ item.prompts.length > 0 ? '已添加' : '未添加' }}</el-tag> <el-tag :type="item.prompts? 'success' : 'error'">{{ item.prompts ? '已添加' : '未添加' }}</el-tag>
</p> </p>
</div> </div>
</div> </div>
@ -55,20 +55,38 @@
> >
<template slot="content"> <template slot="content">
<el-form ref="form" :model="promptForm" :rules="promptRules" label-width="80px"> <el-form ref="form" :model="promptForm" :rules="promptRules" label-width="80px">
<el-form-item label="类型" prop="typeList">
<el-select v-model="promptForm['typeList']" multiple placeholder="请选择类型" style="width: 100%">
<el-option
v-for="item in typeData"
:key="item.id"
:value="item.id"
:label="item.recordType"
/>
</el-select>
</el-form-item>
<el-form-item label="提示词" prop="prompt"> <el-form-item label="提示词" prop="prompt">
<el-input <el-input
v-model="promptForm['prompt']" v-model="promptForm['prompt']"
type="textarea" type="textarea"
:rows="8"
placeholder="请输入提示词模板" placeholder="请输入提示词模板"
/> />
</el-form-item> </el-form-item>
<el-form-item label="实体关系" prop="entity" > <el-form-item label="模版配置" prop="entity">
<vxe-grid <vxe-grid
ref="entityTable" ref="entityTable"
v-bind="entityOptions" v-bind="entityOptions"
@checkbox-all="handleChangeAll" @checkbox-all="handleChangeAll"
@checkbox-change="handleChange" @checkbox-change="handleChange"
/> > <template #templateName_edit="{row}">
<el-input v-model="row['templateName']" placeholder="请输入" />
</template>
<template #value_edit="{row}">
<el-input v-model="row['value']" placeholder="请输入" />
</template>
</vxe-grid>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
@ -91,6 +109,9 @@ export default {
height: '200px', height: '200px',
columns: [ columns: [
{ type: 'seq', width: '50px' }, { type: 'seq', width: '50px' },
{ title: '头节点类型', field: 'startEntityType', width: '150px' },
{ title: '关系', field: 'relType', width: '150px' },
{ title: '尾节点类型', field: 'endEntityType', width: '150px' },
{ title: '提示词', field: 'prompt' }, { title: '提示词', field: 'prompt' },
{ title: '操作', slots: { default: 'opera' }, fixed: 'right', width: '150px' } { title: '操作', slots: { default: 'opera' }, fixed: 'right', width: '150px' }
], ],
@ -124,15 +145,24 @@ export default {
entityOptions: { entityOptions: {
...mixin.data().gridOptions, ...mixin.data().gridOptions,
height: '300px', height: '300px',
editConfig: {
trigger: 'click',
mode: 'cell'
},
editRules: {
result: [{ required: true, message: '不能为空!' }]
},
columns: [ columns: [
{ type: 'checkbox', width: '50px' }, // { type: 'checkbox', width: '50px' },
{ title: '实体', field: 'startNode' }, { title: '类型', field: 'type' },
{ title: '属性', field: 'relation' }, { title: '占位符', field: 'templateName', editRender: { placeholder: '请点击输入...' }, slots: { edit: 'templateName_edit' }},
{ title: '属性值', field: 'endNode' } { title: '实体类型', field: 'value', editRender: { placeholder: '请点击输入...' }, slots: { edit: 'value_edit' }}
], ],
data: [] data: []
}, },
promptRules: { promptRules: {
typeList: [{ required: true, message: '请选择类型!', trigger: 'blur' }],
prompt: [{ required: true, message: '提示词不能为空!', trigger: 'blur' }], prompt: [{ required: true, message: '提示词不能为空!', trigger: 'blur' }],
entity: [{ required: false, message: '实体关系不能为空!', trigger: 'blur' }] entity: [{ required: false, message: '实体关系不能为空!', trigger: 'blur' }]
}, },
@ -173,6 +203,7 @@ export default {
this.dialogOption.show = true this.dialogOption.show = true
this.promptForm = row this.promptForm = row
this.isEdit = true this.isEdit = true
this.entityOptions.data = row.tripleList
}, },
// //
handleDel(row) { handleDel(row) {
@ -207,7 +238,7 @@ export default {
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
let params = {} let params = {}
params = this.isEdit ? this.promptForm : { typeId: this.currentNode['id'], prompt: this.promptForm['prompt'] } params = this.isEdit ? this.promptForm : { typeId: this.currentNode['id'], prompt: this.promptForm['prompt'], tripleList: this.entityOptions.data, typeList: this.promptForm['typeList'] }
addOrUpdPrompt(params).then(res => { addOrUpdPrompt(params).then(res => {
const { code, msg } = res const { code, msg } = res
code === 200 ? (this.isEdit ? this.$baseMessage.success(msg || '编辑成功!') : this.$baseMessage.success(msg || '新增成功!')) : (this.isEdit ? this.$baseMessage.error(msg || '编辑失败!') : this.$baseMessage.error(msg || '新增失败!')) code === 200 ? (this.isEdit ? this.$baseMessage.success(msg || '编辑成功!') : this.$baseMessage.success(msg || '新增成功!')) : (this.isEdit ? this.$baseMessage.error(msg || '编辑失败!') : this.$baseMessage.error(msg || '新增失败!'))
@ -220,7 +251,25 @@ export default {
// //
handleAdd() { handleAdd() {
this.dialogOption.show = true this.dialogOption.show = true
this.promptForm = {} this.promptForm = {
typeList: [this.currentNode['id']]
}
this.entityOptions.data = [
{
type: '头节点',
templateName: '',
value: ''
},
{
type: '关系',
templateName: '',
value: ''
}, {
type: '尾节点',
templateName: '',
value: ''
}
]
this.isEdit = false this.isEdit = false
} }
} }

@ -150,15 +150,15 @@ export default {
this.drawerOption.show = true this.drawerOption.show = true
this.$nextTick(() => { this.$nextTick(() => {
const _this = this const _this = this
const formData = JSON.parse(JSON.stringify(data)) const formData = data ? JSON.parse(JSON.stringify(data)) : { indexSource: '1' }
_this.isView = formData && !isEdit _this.isView = data && !isEdit
_this.ruleForm = _this.isView ? formData : (isEdit ? formData : { indexSource: '1' }) _this.ruleForm = data ? formData : (isEdit ? formData : { indexSource: '1' })
_this.drawerOption.hiddenFooter = _this.isView _this.drawerOption.hiddenFooter = _this.isView
}) })
}, },
// //
handleReset() { handleReset() {
this.$refs['form'].resetFields() this.ruleForm = { indexSource: '1' }
// this.$refs.form.clearValidate() // this.$refs.form.clearValidate()
}, },
// //
@ -174,8 +174,8 @@ export default {
}, },
// //
changeType(val) { changeType(val) {
this.$refs['form'].resetFields() this.ruleForm = { indexSource: val }
this.ruleForm['indexSource'] = val // this.ruleForm['indexSource'] = val
} }
} }
} }

@ -65,7 +65,7 @@ export default {
return null return null
}, },
columns: [ columns: [
{ title: 'ID', field: 'id' }, { title: '序号', type: 'seq', width: '50px' },
{ title: '原子指标', field: 'name' }, { title: '原子指标', field: 'name' },
{ title: '案件类型', field: 'caseTypeName', sortable: true }, { title: '案件类型', field: 'caseTypeName', sortable: true },
{ title: '指标来源', field: 'indexSourceName', sortable: true }, { title: '指标来源', field: 'indexSourceName', sortable: true },

@ -36,7 +36,15 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<vxe-grid ref="xTable" v-bind="gridOptions" style="margin-top: 10px" /> <vxe-grid
ref="xTable"
row-id="id"
v-bind="gridOptions"
style="margin-top: 10px"
:checkbox-config="{ labelField: '', highlight: true, trigger: 'row', reserve: true , range: true}"
@checkbox-change="selectChangeEvent"
/>
<!-- <div style="text-align: center"> <!-- <div style="text-align: center">
<cs-page <cs-page
:page.sync="queryForm.page" :page.sync="queryForm.page"
@ -66,7 +74,10 @@ export default {
} }
}, },
// //
searchForm: {}, searchForm: {
name:"",
indexSource:''
},
// //
indexAlgorithmOptions: JSON.parse(sessionStorage.getItem('index_source')), indexAlgorithmOptions: JSON.parse(sessionStorage.getItem('index_source')),
// //
@ -82,28 +93,33 @@ export default {
data: [] data: []
}, },
// //
selectedData: [] selectionRows: []
} }
}, },
methods: { methods: {
// //
show(data) { show(data) {
this.dialogOption.show = true this.dialogOption.show = true
this.selectedData = data this.selectionRows = data
this.searchForm['name'] = ""
this.fetchData() this.fetchData()
}, },
// //
fetchData() { fetchData() {
queryAtomicIndex(this.searchForm, 1, 99999).then(res => { queryAtomicIndex(this.searchForm, 1, 99999).then(res => {
this.gridOptions.data = res.data.result this.gridOptions.data = res.data.result
this.queryForm.total = res.data.total this.queryForm.total = res.data.total
if (this.selectedData && this.selectedData.length > 0) { // this.$refs.xTable.clearCheckboxRow()
if (this.selectionRows && this.selectionRows.length > 0) {
// //
this.$nextTick(() => { const _this = this
this.gridOptions.data.map(column => { _this.$nextTick(() => {
this.selectedData.map(item => { _this.gridOptions.data.map(column => {
_this.selectionRows.map(item => {
if (item.id === column.id) { if (item.id === column.id) {
this.$refs.xTable.toggleCheckboxRow(column, true) console.log('4444444444444444444')
_this.$refs.xTable.toggleCheckboxRow(column, true)
} }
}) })
}) })
@ -111,13 +127,47 @@ export default {
} }
}) })
}, },
// ()
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)
}
},
// //
handleSearch() { handleSearch() {
this.fetchData() this.fetchData()
}, },
// //
handleSubmit() { handleSubmit() {
const list = this.$refs.xTable.getCheckboxRecords() const list = this.selectionRows
if (list.length === 0) { if (list.length === 0) {
this.$baseMessage.error('请至少选择一项!') this.$baseMessage.error('请至少选择一项!')
return return

@ -71,7 +71,6 @@ export default {
return { return {
// //
searchData: [ searchData: [
{ label: '指标ID', model: 'id', type: 'input' },
{ label: '指标名称', model: 'name', type: 'input' }, { label: '指标名称', model: 'name', type: 'input' },
{ label: '指标类别', model: 'indexType', type: 'select', option: JSON.parse(sessionStorage.getItem('index_type')) }, { label: '指标类别', model: 'indexType', type: 'select', option: JSON.parse(sessionStorage.getItem('index_type')) },
// { label: '', model: 'doer', type: 'input' }, // { label: '', model: 'doer', type: 'input' },
@ -94,7 +93,7 @@ export default {
}, },
columns: [ columns: [
{ type: 'expand', width: '40px', slots: { content: 'content' }}, { type: 'expand', width: '40px', slots: { content: 'content' }},
{ title: '指标ID', field: 'id', width: '80px' }, { title: '序号', type: 'seq', width: '50px' },
{ title: '指标名称', field: 'name' }, { title: '指标名称', field: 'name' },
{ title: '指标类别', field: 'indexTypeName', width: '150px' }, { title: '指标类别', field: 'indexTypeName', width: '150px' },
{ title: '指标分数', field: 'indexScore', width: '150px', sortable: true }, { title: '指标分数', field: 'indexScore', width: '150px', sortable: true },

Loading…
Cancel
Save