diff --git a/src/api/caseDetails/index.js b/src/api/caseDetails/index.js index 406d5a4..86a550e 100644 --- a/src/api/caseDetails/index.js +++ b/src/api/caseDetails/index.js @@ -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 }) -} \ No newline at end of file +} diff --git a/src/config/net.config.js b/src/config/net.config.js index 023ad03..f8258a8 100644 --- a/src/config/net.config.js +++ b/src/config/net.config.js @@ -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', diff --git a/src/views/caseDetails/components/CaseEvidence.vue b/src/views/caseDetails/components/CaseEvidence.vue index 304638f..787a8c7 100644 --- a/src/views/caseDetails/components/CaseEvidence.vue +++ b/src/views/caseDetails/components/CaseEvidence.vue @@ -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() }, diff --git a/src/views/caseDetails/components/CaseRecord.vue b/src/views/caseDetails/components/CaseRecord.vue index 866158b..5bac1d9 100644 --- a/src/views/caseDetails/components/CaseRecord.vue +++ b/src/views/caseDetails/components/CaseRecord.vue @@ -21,8 +21,8 @@
@@ -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() }, diff --git a/src/views/caseDetails/components/CommonIndex.vue b/src/views/caseDetails/components/CommonIndex.vue index aeaaf36..0459a8f 100644 --- a/src/views/caseDetails/components/CommonIndex.vue +++ b/src/views/caseDetails/components/CommonIndex.vue @@ -14,7 +14,7 @@
@@ -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 diff --git a/src/views/caseDetails/components/IncriminateIndex.vue b/src/views/caseDetails/components/IncriminateIndex.vue index 068bb6c..cadbb82 100644 --- a/src/views/caseDetails/components/IncriminateIndex.vue +++ b/src/views/caseDetails/components/IncriminateIndex.vue @@ -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 diff --git a/src/views/caseDetails/components/InnocentIndex.vue b/src/views/caseDetails/components/InnocentIndex.vue index a75a464..f84a090 100644 --- a/src/views/caseDetails/components/InnocentIndex.vue +++ b/src/views/caseDetails/components/InnocentIndex.vue @@ -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 diff --git a/src/views/caseDetails/components/TripletInfo.vue b/src/views/caseDetails/components/TripletInfo.vue index 5f0a9d8..8c01456 100644 --- a/src/views/caseDetails/components/TripletInfo.vue +++ b/src/views/caseDetails/components/TripletInfo.vue @@ -9,10 +9,13 @@ @@ -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: { // 显示弹窗 diff --git a/src/views/caseDetails/components/edit/AddCaseUser.vue b/src/views/caseDetails/components/edit/AddCaseUser.vue index ae858ab..5e75abd 100644 --- a/src/views/caseDetails/components/edit/AddCaseUser.vue +++ b/src/views/caseDetails/components/edit/AddCaseUser.vue @@ -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') diff --git a/src/views/caseDetails/components/edit/EditRecord.vue b/src/views/caseDetails/components/edit/EditRecord.vue index ad8e8b6..c299ecc 100644 --- a/src/views/caseDetails/components/edit/EditRecord.vue +++ b/src/views/caseDetails/components/edit/EditRecord.vue @@ -78,15 +78,10 @@ style="width: 100%" /> - + - - - - - - + --> + 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} 个文件`) } } } diff --git a/src/views/caseDetails/index.vue b/src/views/caseDetails/index.vue index cccdddf..d7822b1 100644 --- a/src/views/caseDetails/index.vue +++ b/src/views/caseDetails/index.vue @@ -11,7 +11,7 @@
- +
{{ caseData['totalScore'] }} {{ caseData['identifyResultName'] }} {{ `最新时间:${caseData['updateTime']}` }} - 模型分析 +
+
待分析 暂无结果 +
+
模型分析
@@ -77,7 +80,7 @@
-
+
- + @@ -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) { diff --git a/src/views/caseManagement/components/ModelAnalysis.vue b/src/views/caseManagement/components/ModelAnalysis.vue index b8815a4..960c079 100644 --- a/src/views/caseManagement/components/ModelAnalysis.vue +++ b/src/views/caseManagement/components/ModelAnalysis.vue @@ -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 diff --git a/src/views/caseManagement/index.vue b/src/views/caseManagement/index.vue index 6f3be54..93cbf80 100644 --- a/src/views/caseManagement/index.vue +++ b/src/views/caseManagement/index.vue @@ -26,7 +26,7 @@
@@ -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 }) diff --git a/src/views/promptManagement/index.vue b/src/views/promptManagement/index.vue index b6347c1..177461f 100644 --- a/src/views/promptManagement/index.vue +++ b/src/views/promptManagement/index.vue @@ -17,7 +17,7 @@ @click="handleNodeClick(item)" > {{ item['recordType'] }} - {{ item.prompts.length > 0 ? '已添加' : '未添加' }} + {{ item.prompts ? '已添加' : '未添加' }}

@@ -55,20 +55,38 @@ > @@ -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 } } diff --git a/src/views/ruleEngine/atomicIndex/components/EditAtomic.vue b/src/views/ruleEngine/atomicIndex/components/EditAtomic.vue index dc63849..f9f8fb7 100644 --- a/src/views/ruleEngine/atomicIndex/components/EditAtomic.vue +++ b/src/views/ruleEngine/atomicIndex/components/EditAtomic.vue @@ -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 } } } diff --git a/src/views/ruleEngine/atomicIndex/index.vue b/src/views/ruleEngine/atomicIndex/index.vue index 878be24..9d9ef94 100644 --- a/src/views/ruleEngine/atomicIndex/index.vue +++ b/src/views/ruleEngine/atomicIndex/index.vue @@ -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 }, diff --git a/src/views/ruleEngine/indexRule/components/SelectAtomic.vue b/src/views/ruleEngine/indexRule/components/SelectAtomic.vue index 696b6e1..0582aa1 100644 --- a/src/views/ruleEngine/indexRule/components/SelectAtomic.vue +++ b/src/views/ruleEngine/indexRule/components/SelectAtomic.vue @@ -36,7 +36,15 @@
- +