From 350ed839d554c6219ffd57443faa13b638c16b45 Mon Sep 17 00:00:00 2001 From: caoyang Date: Tue, 12 Apr 2022 13:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=88=86=E8=AF=A6=E6=83=85=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/common/lang/en-us.js | 4 + jero-web/src/common/lang/zh-cn.js | 4 + jero-web/src/components/SplitImport/index.vue | 2 - .../components/importSplitUpload/index.vue | 10 +- .../src/views/documentManage/ocr/OcrSplit.vue | 3 +- .../splitting/modules/ImportResult.vue | 28 +++- .../splitting/modules/SplitAddForm.vue | 145 ++++++++++++------ .../splitting/modules/SplitText.vue | 16 +- 8 files changed, 143 insertions(+), 69 deletions(-) diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index ab5cd15f3..b21fcc4a4 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -642,4 +642,8 @@ module.exports = { confirmWithdraw:'confirm Withdraw', OperationDetails:'Operation details', OperationTime:'Operation time', + oneTableAdded:'only one table can be added', + addATable:'please add a table', + pleaseUploadSplitFile:'please upload split file', + } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 499fe9598..b3359a562 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -646,4 +646,8 @@ module.exports = { confirmWithdraw:'确认撤回?', OperationDetails:'操作详情', OperationTime:'操作时间', + oneTableAdded:'只能添加一个表格', + addATable:'请添加一个表格', + pleaseUploadSplitFile:'请上传拆分文件', + } \ No newline at end of file diff --git a/jero-web/src/components/SplitImport/index.vue b/jero-web/src/components/SplitImport/index.vue index e746afa7b..f9c26dbb4 100644 --- a/jero-web/src/components/SplitImport/index.vue +++ b/jero-web/src/components/SplitImport/index.vue @@ -124,8 +124,6 @@ this.preErrVisible=true this.errValue=val.response.message } - - } info.fileList.splice(index,1) diff --git a/jero-web/src/components/importSplitUpload/index.vue b/jero-web/src/components/importSplitUpload/index.vue index c3d11e8fd..c12ac174a 100644 --- a/jero-web/src/components/importSplitUpload/index.vue +++ b/jero-web/src/components/importSplitUpload/index.vue @@ -54,7 +54,7 @@ this.fileTypeSatus=false if(this.myfileList&&this.myfileList.length>=1){ // console.log() - this.$message.warning('只能上传一个文件') + this.$message.warning(this.$t('onlyOnefileUploaded')) return false }else{ // let thisFileType = this.thisFileType.replace(/\s+/g, ""); @@ -102,7 +102,7 @@ if (status === 'error') { this.$emit('uploadSuccess', this.fileList) this.$message.destroy() - this.$message.error(`${info.file.name} 文件上传失败。`); + this.$message.error(`${info.file.name}`+this.$t('fileUploadFailed')); } else if (status === 'removed') { this.myfileList = info.fileList; this.fileList = [] @@ -116,7 +116,7 @@ // console.log('remove',this.fileList) this.$emit('uploadSuccess', this.fileList) this.$message.destroy() - this.$message.success(`${info.file.name} 删除成功。`); + this.$message.success(`${info.file.name}`+this.$t('deletedSuccessfully')); } else if (status === 'done') { this.fileList = [] this.myfileList = info.fileList; @@ -152,7 +152,7 @@ if(this.myfileList.length > 0){ this.$emit('uploadSuccess', this.fileList) this.$message.destroy() - this.$message.success(`${info.file.name} 文件上传成功。`); + this.$message.success(`${info.file.name}`+this.$t('fileUploadFailed')); // console.log('fileList111',file,this.fileList,fileList1) } } else if (status === 'uploading') { @@ -162,7 +162,7 @@ } } }else if( !this.fileTypeSatus&&this.myfileList.length<1){ - this.$message.warning('不支持上传该类型的文件!') + this.$message.warning(this.$t('typeCannotUploaded')) } }, } diff --git a/jero-web/src/views/documentManage/ocr/OcrSplit.vue b/jero-web/src/views/documentManage/ocr/OcrSplit.vue index af01f8ca9..936a83dd4 100644 --- a/jero-web/src/views/documentManage/ocr/OcrSplit.vue +++ b/jero-web/src/views/documentManage/ocr/OcrSplit.vue @@ -40,7 +40,8 @@ methods:{ populateIframe(iframe, headers) { var xhr = new XMLHttpRequest(); - xhr.open("GET", 'http://10.0.1.31:8080/jero-boot/ocr/pageOffice/word'); + // xhr.open("GET", 'http://10.0.1.31:8080/jero-boot/ocr/pageOffice/word'); + xhr.open("GET", 'http://10.0.1.25:8080/jero-boot/ocr/ocrCheck/editorFile'); xhr.responseType = "blob"; headers.forEach((header) => { xhr.setRequestHeader(header[0], header[1]); diff --git a/jero-web/src/views/documentManage/splitting/modules/ImportResult.vue b/jero-web/src/views/documentManage/splitting/modules/ImportResult.vue index a7a540918..0bbdb6179 100644 --- a/jero-web/src/views/documentManage/splitting/modules/ImportResult.vue +++ b/jero-web/src/views/documentManage/splitting/modules/ImportResult.vue @@ -43,6 +43,15 @@ {{$t('cancel')}} + + {{errValue}} + @@ -130,7 +139,9 @@ rows:[], token:Vue.ls.get(ACCESS_TOKEN), flag:false, //提交表单标识 - cut:'' + cut:'', + preErrVisible:false, + errValue:'' } }, props:{ @@ -176,7 +187,7 @@ this.$emit('visible',false) }, onSelectChange(keys,rows){ - console.log('keys',keys,rows) + // console.log('keys',keys,rows) this.selectedRowKeys=keys this.rows=rows }, @@ -235,7 +246,7 @@ }else if(this.rows&&this.rows.length>1){ this.$message.warning(this.$t('OnlyOneSelected')) }else if(!this.form.file) { - this.$message.warning('请上传拆分文件') + this.$message.warning(this.$t('pleaseUploadSplitFile')) }else if(this.rows&&this.rows.length===1){ let params={ connectId:this.rows[0].connect_id, @@ -276,6 +287,12 @@ this.$emit('visible',false) }else{ this.$message.warning(res.data.message) + if(res.data.code==1){ + this.$message.error(res.data.message); + }else{ + this.preErrVisible=true + this.errValue=res.data.message + } } }).finally(() => [ this.flag = false @@ -311,7 +328,10 @@ // } // } } - } + }, + handleErrCancel(){ + this.preErrVisible=false + }, } } diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue index e0e9a460c..89fafe0ae 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue @@ -321,12 +321,23 @@ @cancel="handleColCancel" > - - - - - - + + + + + + + + + + + + @@ -533,8 +544,18 @@ ] }, numberFlag:false, + rowColForm:{}, + validatorRowColRules:{ + colCount:[ + { required: true, message: this.$t('pleaseEnter')+this.$t('numberRows'),trigger: 'blur'}, + ], + rowCount:[ + { required: true, message: this.$t('pleaseEnter')+this.$t('numberColumns'),trigger: 'blur'}, + ] + }, itemVal:{}, contentTrees:'', + isTableEdit:false, } }, @@ -634,7 +655,11 @@ }, //编辑按钮 splitEdit(index,item){ + console.log('item',item) + this.addIndex=index this.tableVisible=true + this.isTableEdit=true + this.ueContent=item.itemContent this.$nextTick(() => { this.$refs.ueditor.setContent(item.itemContent) }) @@ -810,68 +835,90 @@ }, //表格确认按钮 handleOkTable(){ - this.tableVisible=false - this.contentList[this.addIndex+1]= { - id:'', - type:'TABLE', - itemContent:this.ueContent + let ueContent=[] + ueContent = this.ueContent.match(/{0,}?<\/table>/g)||[]; + // console.log('uuuuuu',ueContent) + if(ueContent&&ueContent.length>1){ + this.$message.warning(this.$t('oneTableAdded')) + }else if(!ueContent||ueContent.length<1){ + this.$message.warning(this.$t('addATable')) + } if(ueContent&&ueContent.length==1){ + this.tableVisible=false + if(this.isTableEdit){ + this.contentList[this.addIndex]= { + id:'', + type:'TABLE', + itemContent:ueContent[0] + } + + }else{ + for(let i = this.contentList.length;i>this.addIndex;i--){ + this.contentList[i+ueContent.length-1]=this.contentList[i-1] + } + this.contentList[++this.addIndex]= { + id:'', + type:'TABLE', + itemContent:ueContent[0] + } + + } + this.isTableEdit=false } - // this.uEditorChange() - // console.log('this.contentList',this.contentList) }, //表格取消按钮 handleCancelTable(){ this.tableVisible=false + this.isTableEdit=false }, //获取表格内容 uEditorChange (val) { // this.itemContent = this.$refs.ueditor.getUEContent() - this.contentList[this.addIndex+1]= { - id:'', - type:'TABLE', - itemContent:val - } - this.ueContent=val + this.ueContent = val + // this.ueContent=val }, //取消行数列数按钮 handleColCancel(){ this.tableColVisible=false - this.rowCount='' - this.colCount='' + this.rowColForm.rowCount='' + this.rowColForm.colCount='' }, //确定行数列数按钮 handleColOk(){ - this.tableColVisible=false - this.tableVisible=true - if(this.rowCount>0&&this.colCount>0){ - let tableList=[] - let tableStr='' - tableStr='' - for(let r=0;r` - let tableItem={} - tableItem.id='' - tableItem.rowNum=r+1 - tableItem.colNum=c+1 - tableItem.content='' - rowTableList.push(tableItem) + this.$refs.numberRowColForm.validate(valid=>{ + if(valid){ + this.tableColVisible=false + this.tableVisible=true + if(this.rowColForm.rowCount>0&&this.rowColForm.colCount>0){ + let tableList=[] + let tableStr='' + tableStr='
' + for(let r=0;r` + let tableItem={} + tableItem.id='' + tableItem.rowNum=r+1 + tableItem.colNum=c+1 + tableItem.content='' + rowTableList.push(tableItem) + } + tableStr+=`` + tableList.push(rowTableList) } - tableStr+=`` - tableList.push(rowTableList) - } - tableStr+=`
` - this.ueContent=tableStr + tableStr+=`` + this.ueContent=tableStr - this.$nextTick(() => { - this.$refs.ueditor.setContent(this.ueContent) - }) - this.rowCount='' - this.colCount='' - } + this.$nextTick(() => { + this.$refs.ueditor.setContent(this.ueContent) + }) + this.rowColForm.rowCount='' + this.rowColForm.colCount='' + } + } + }) // console.log('cont1111',this.addIndex,this.contentList) }, dateChange(item) { diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitText.vue b/jero-web/src/views/documentManage/splitting/modules/SplitText.vue index d51068214..6d6bfed3f 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitText.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitText.vue @@ -22,28 +22,28 @@
{{$t('fileType')}} - + GSO - + {{$t('KMVSS_Table')}} - + {{$t('KMVSS_Article')}} - + {{$t('America')}} - + {{$t('Europe')}} - + {{$t('Japan_one')}} - + {{$t('Japan_two')}} - + {{$t('China')}}