feat:bug修改

dev_1.0.0
xiangcongshuai
parent 904a772533
commit 7dcd713568

@ -50,20 +50,25 @@ export function addUser(data) {
})
}
/** 上传笔录 */
export function addOrUpdRecords(formData) {
return axios.request({
baseURL,
timeout: requestTimeout,
// export function addOrUpdRecords(formData) {
// return axios.request({
// baseURL,
// 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`,
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
},
data: formData
}).then(response => {
return Promise.resolve(response.data)
}).catch(error => {
return Promise.reject(error)
data
})
}
/** 删除笔录 */
@ -146,4 +151,4 @@ export function saveCaseAtomicResult(data) {
method: 'post',
data
})
}
}

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

@ -73,7 +73,7 @@ export default {
isExpand: {
handler: function(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
@ -82,7 +82,7 @@ export default {
mounted() {
this.caseId = this.$route.params.id
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()
},

@ -21,8 +21,8 @@
<vxe-grid v-bind="gridOptions" style="margin-top: 10px">
<template #opera="{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" 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-edit" title="编辑" :disabled="!isEdit" @click="handelEdit(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>
</vxe-grid>
<div style="text-align: center">
@ -98,7 +98,7 @@ export default {
isExpand: {
handler: function(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() {
this.caseId = this.$route.params.id
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()
},

@ -14,7 +14,7 @@
<el-button type="text" icon="el-icon-close" @click="handleDel(row)" />
</template>
<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>
</vxe-grid>
<div style="text-align: center">
@ -72,7 +72,7 @@ export default {
isExpand: {
handler: function(newVal, oldVal) {
if (newVal !== oldVal) {
this.tableHeight(this.isExpand ? 500 : 330)
this.tableHeight(this.isExpand ? 530 : 360)
}
},
immediate: true

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

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

@ -9,10 +9,13 @@
<template>
<cs-dialog
:dialog="dialogOptions"
@onSubmit="handleSubmit"
>
<template slot="content">
<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>
</cs-dialog>
</template>
@ -30,6 +33,8 @@ export default {
title: {
title: '选择三元组信息入库'
},
top: '50px',
hiddenFooter: true,
appendToBody: true
},
gridOptions: {
@ -48,7 +53,7 @@ export default {
}
},
mounted() {
this.tableHeight(330)
// this.tableHeight(330)
},
methods: {
//

@ -79,7 +79,7 @@ export default {
handleSubmit() {
this.$refs.userForm.validate(async 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 || '新增失败!')
this.dialogOption.show = false
this.$emit('reloadData')

@ -78,15 +78,10 @@
style="width: 100%"
/>
</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-col v-for="(item, index) in fileIdList" :key="index" :span="8">
<div class="file-item">
<!-- <el-image-->
<!-- src="~@/assets/caseDetails/doc.png"-->
<!-- fit="contain"-->
<!-- -->
<!-- />-->
<img
src="~@/assets/caseDetails/doc.png"
style="width: 50px;height: 50px"
@ -96,16 +91,16 @@
</div>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="上传材料" prop="file">
</el-form-item> -->
<el-form-item label="上传材料" prop="fileIdList">
<el-upload
class="upload-demo"
:action="uploadOption.action"
:accept="uploadOption.accept"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-change="handleFileChange"
:auto-upload="false"
:before-remove="beforeRemove"
:on-success="handleSuccess"
multiple
:on-exceed="handleExceed"
:file-list="fileList"
@ -157,7 +152,9 @@ export default {
//
showFileViewer: false,
//
recordForm: {},
recordForm: {
fileIdList: []
},
rules: {
name: [{ required: true, message: '姓名不能为空!', trigger: 'blur' }],
indexNum: [{ required: true, message: '次数不能为空!', trigger: 'blur' }],
@ -165,7 +162,7 @@ export default {
lawAsker: [{ required: true, message: '询问人不能为空!', trigger: 'blur' }],
confessionTime: [{ required: true, message: '供述时间不能为空!', trigger: 'blur' }],
confessionMaterial: [{ required: true, message: '供述材料不能为空!', trigger: 'blur' }],
file: [{ required: true, message: '上传材料不能为空!', trigger: 'blur' }]
fileIdList: [{ required: true, message: '上传材料不能为空!', trigger: 'blur' }]
},
//
userList: [],
@ -173,39 +170,24 @@ export default {
roleList: JSON.parse(sessionStorage.getItem('case_role')),
//
fileList: [],
//
fileIdList: [],
//
uploadOption: {
action: '',
accept: '.docx,.doc'
action: `${baseURL}/minio/uploadFile`,
accept: '.docx,.bmp,.jpg,.png'
},
//
initialIndex: 0,
// 线
// activities: [
// {
// content: '',
// timestamp: '2018-04-15'
// }, {
// content: '',
// timestamp: '2018-04-13'
// }, {
// content: '',
// timestamp: '2018-04-11'
// }
// ],
isEdit: false
}
},
watch: {
//
fileList: {
handler: function(val) {
this.$set(this.recordForm, 'file', val.length > 0 ? '12' : '')
}
}
},
// watch: {
// //
// fileList: {
// handler: function(val) {
// this.$set(this.recordForm, 'file', val.length > 0 ? '12' : '')
// }
// }
// },
mounted() {
this.caseId = this.$route.params.id
this.getUserList()
@ -215,18 +197,21 @@ export default {
this.isEdit = isEdit
//
// this.drawerOption.width = isEdit ? '50%' : '35%'
this.recordForm = isEdit ? data : {}
this.recordForm = isEdit ? data : { fileIdList: [] }
//
if (isEdit && data['confessionStartTime'] && data['confessionEndTime']) {
this.$set(this.recordForm, 'confessionTime', [data['confessionStartTime'], data['confessionEndTime']])
}
this.fileList = []
// id
if (isEdit && data['fileIds']) {
this.fileIdList = data['fileIds'].split(',')
// files.map(item => {
// this.fileIdList.push(`${baseURL}${commonDownloadFile}${item}`)
// })
if (isEdit) {
const list = []
data.fileList.forEach(e => {
list.push(e.fileId)
this.fileList.push({
name: e.fileName
})
})
this.recordForm.fileIdList = list
}
this.drawerOption.title = isEdit ? '编辑笔录' : '添加笔录'
this.drawerOption.show = true
@ -254,32 +239,26 @@ export default {
})
return list
},
//
handlePreviewItem(index) {
this.showFileViewer = true
this.initialIndex = index
handleRemove(file, uploadFiles) {
const list = []
for (const item of uploadFiles) {
list.push(item.response.data)
}
this.recordForm.fileIdList = list
},
//
handleDelete(item) {
this.$baseConfirm('确定删除该笔录材料吗?', null, async() => {
const { code } = await deleteFile(item)
if (code === 200) {
this.fileIdList.splice(this.fileIdList.indexOf(item), 1)
const params = this.$baseLodash.cloneDeep(this.recordForm)
params['fileIds'] = this.fileIdList.join(',')
if (this.$baseLodash.isArray(params['confessionTime'])) {
this.$set(params, 'confessionStartTime', params['confessionTime'][0])
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])
})
addOrUpdRecords(formData)
}
})
handlePreview(file) {
console.log(file)
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`)
},
handleSuccess(response) {
if (response.code === 200) {
this.recordForm.fileIdList.push(response.data)
}
},
//
handleReset() {
@ -291,26 +270,32 @@ export default {
this.$refs.form.validate(async valid => {
if (valid) {
//
const params = this.$baseLodash.cloneDeep(this.recordForm)
if (this.isEdit) {
params['fileIds'] = this.fileIdList.join(',')
// const params = this.$baseLodash.cloneDeep(this.recordForm)
// const formData = new FormData()
// 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'])) {
this.$set(params, 'confessionStartTime', params['confessionTime'][0])
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, '笔录上传中,请勿刷新界面..')
addOrUpdRecords(formData).then(res => {
addOrUpdRecords(params).then(res => {
loading.close()
const { code, msg } = res
code === 200 ? this.$baseMessage.success(msg || '上传成功') : this.$baseMessage.error(msg || '上传失败')
@ -335,15 +320,6 @@ export default {
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 v-if="expand" class="flex-row expand-info">
<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
v-if="caseData['totalScore'] && caseData['totalScore'] > 0"
class="flex-column circle-info"
@ -21,15 +21,18 @@
<span :style="commonStyle">{{ caseData['totalScore'] }}</span>
<span :style="commonStyle">{{ caseData['identifyResultName'] }}</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
v-else
class="flex-column circle-info empty-score"
>
<span>待分析</span>
<span>暂无结果</span>
</div>
<div v-if="isEdit" class="model" @click="handleAnalysis"></div>
</div>
<div class="base-info">
<div class="flex-row" style="align-items: center; justify-content: space-between">
@ -77,7 +80,7 @@
</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">
<el-tree
:data="leftTabs"
@ -257,15 +260,30 @@ export default {
border-radius: 8px;
background: #FFFFFF;
.expand-info {
height: 220px;
height: 260px;
align-items: center;
.left-score {
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 {
position: absolute;
width: 180px;
height: 180px;
width: 220px;
height: 220px;
top: 30px;
left: 60px;
box-shadow: 0 1px 30px 0 rgba(255,169,66,0.2);
@ -286,23 +304,14 @@ export default {
span:nth-last-child(1) {
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 {
justify-content: center;
align-items: center;
font-weight: bold;
font-size: 16px;
// position: relative;
span:nth-child(1) {
margin-top: 0;
}

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

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

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

@ -17,7 +17,7 @@
@click="handleNodeClick(item)"
>
<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>
</div>
</div>
@ -55,20 +55,38 @@
>
<template slot="content">
<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-input
v-model="promptForm['prompt']"
type="textarea"
:rows="8"
placeholder="请输入提示词模板"
/>
</el-form-item>
<el-form-item label="实体关系" prop="entity" >
<el-form-item label="模版配置" prop="entity">
<vxe-grid
ref="entityTable"
v-bind="entityOptions"
@checkbox-all="handleChangeAll"
@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>
</template>
@ -91,6 +109,9 @@ export default {
height: '200px',
columns: [
{ type: 'seq', width: '50px' },
{ title: '头节点类型', field: 'startEntityType', width: '150px' },
{ title: '关系', field: 'relType', width: '150px' },
{ title: '尾节点类型', field: 'endEntityType', width: '150px' },
{ title: '提示词', field: 'prompt' },
{ title: '操作', slots: { default: 'opera' }, fixed: 'right', width: '150px' }
],
@ -124,15 +145,24 @@ export default {
entityOptions: {
...mixin.data().gridOptions,
height: '300px',
editConfig: {
trigger: 'click',
mode: 'cell'
},
editRules: {
result: [{ required: true, message: '不能为空!' }]
},
columns: [
{ type: 'checkbox', width: '50px' },
{ title: '实体', field: 'startNode' },
{ title: '属性', field: 'relation' },
{ title: '属性值', field: 'endNode' }
// { type: 'checkbox', width: '50px' },
{ title: '类型', field: 'type' },
{ title: '占位符', field: 'templateName', editRender: { placeholder: '请点击输入...' }, slots: { edit: 'templateName_edit' }},
{ title: '实体类型', field: 'value', editRender: { placeholder: '请点击输入...' }, slots: { edit: 'value_edit' }}
],
data: []
},
promptRules: {
typeList: [{ required: true, message: '请选择类型!', trigger: 'blur' }],
prompt: [{ required: true, message: '提示词不能为空!', trigger: 'blur' }],
entity: [{ required: false, message: '实体关系不能为空!', trigger: 'blur' }]
},
@ -173,6 +203,7 @@ export default {
this.dialogOption.show = true
this.promptForm = row
this.isEdit = true
this.entityOptions.data = row.tripleList
},
//
handleDel(row) {
@ -207,7 +238,7 @@ export default {
this.$refs.form.validate(valid => {
if (valid) {
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 => {
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 || '新增失败!'))
@ -220,7 +251,25 @@ export default {
//
handleAdd() {
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
}
}

@ -150,15 +150,15 @@ export default {
this.drawerOption.show = true
this.$nextTick(() => {
const _this = this
const formData = JSON.parse(JSON.stringify(data))
_this.isView = formData && !isEdit
_this.ruleForm = _this.isView ? formData : (isEdit ? formData : { indexSource: '1' })
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
})
},
//
handleReset() {
this.$refs['form'].resetFields()
this.ruleForm = { indexSource: '1' }
// this.$refs.form.clearValidate()
},
//
@ -174,8 +174,8 @@ export default {
},
//
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
},
columns: [
{ title: 'ID', field: 'id' },
{ title: '序号', type: 'seq', width: '50px' },
{ title: '原子指标', field: 'name' },
{ title: '案件类型', field: 'caseTypeName', sortable: true },
{ title: '指标来源', field: 'indexSourceName', sortable: true },

@ -36,7 +36,15 @@
</el-col>
</el-row>
</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">
<cs-page
:page.sync="queryForm.page"
@ -66,7 +74,10 @@ export default {
}
},
//
searchForm: {},
searchForm: {
name:"",
indexSource:''
},
//
indexAlgorithmOptions: JSON.parse(sessionStorage.getItem('index_source')),
//
@ -82,28 +93,33 @@ export default {
data: []
},
//
selectedData: []
selectionRows: []
}
},
methods: {
//
show(data) {
this.dialogOption.show = true
this.selectedData = data
this.selectionRows = data
this.searchForm['name'] = ""
this.fetchData()
},
//
fetchData() {
queryAtomicIndex(this.searchForm, 1, 99999).then(res => {
this.gridOptions.data = res.data.result
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(() => {
this.gridOptions.data.map(column => {
this.selectedData.map(item => {
const _this = this
_this.$nextTick(() => {
_this.gridOptions.data.map(column => {
_this.selectionRows.map(item => {
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() {
this.fetchData()
},
//
handleSubmit() {
const list = this.$refs.xTable.getCheckboxRecords()
const list = this.selectionRows
if (list.length === 0) {
this.$baseMessage.error('请至少选择一项!')
return

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

Loading…
Cancel
Save