diff --git a/jero-web/src/views/documentManage/ocr/index.vue b/jero-web/src/views/documentManage/ocr/index.vue index 773c121a5..bae155bbf 100644 --- a/jero-web/src/views/documentManage/ocr/index.vue +++ b/jero-web/src/views/documentManage/ocr/index.vue @@ -95,6 +95,8 @@ import { ACCESS_TOKEN } from '@/store/mutation-types' import Vue from 'vue' import eventBUs from '../../../common/event' + import axios from 'axios' + export default { name: 'ocr', components:{ @@ -156,6 +158,7 @@ timer:'', title:this.$t('UploadFile'), listType:'text', + token:Vue.ls.get(ACCESS_TOKEN), } }, props:{ @@ -243,20 +246,7 @@ }, - // 定时刷新页面 - // refresh(){ - // const date = new Date(), - // year = date.getFullYear(), - // month = date.getMonth()+1, - // myDate = date.getDate() - // this.today = `${year}/${month < 10 ? '0'+month : month}/${myDate < 10 ? '0'+myDate : myDate}` - // if(this.timer){ - // clearInterval(this.timer) - // }else{ - // eventBUs.$emit('searchReset') - // this.initSetTimeout(this.today)//调用每隔10秒刷新数据 - // } - // }, + //上传 handleUpload(){ // if(this.timer){ @@ -282,14 +272,43 @@ content: '', onOk: async () => { - postAction(`ocr/ocrRecord/deleteBatch`, param).then(res => { - if (res.success) { - this.$message.success(this.$t('OperationSuccessful')) - eventBUs.$emit('searchReset') - }else{ - this.$message.warning(this.$t('operationFailed')) + axios({ + url: '/jero-boot/ocr/ocrRecord/deleteBatch', + method: 'post', + data: param, + transformRequest: [function (data) { + // Do whatever you want to transform the data + let ret = '' + for (let it in data) { + ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + } + return ret + }], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'X-Access-Token':this.token } }) + .then( (res) =>{ + if (res.data.success) { + this.$message.success(this.$t('OperationSuccessful')) + eventBUs.$emit('searchReset') + }else{ + this.$message.warning(this.$t('operationFailed')) + } + }) + .catch( (error) =>{ + console.log(error); + }); + + // postAction(`ocr/ocrRecord/deleteBatch`, param).then(res => { + // if (res.success) { + // this.$message.success(this.$t('OperationSuccessful')) + // eventBUs.$emit('searchReset') + // }else{ + // this.$message.warning(this.$t('operationFailed')) + // } + // }) }, onCancel() {}, });