ocr删除请求方式修改
This commit is contained in:
@@ -95,6 +95,8 @@
|
|||||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import eventBUs from '../../../common/event'
|
import eventBUs from '../../../common/event'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ocr',
|
name: 'ocr',
|
||||||
components:{
|
components:{
|
||||||
@@ -156,6 +158,7 @@
|
|||||||
timer:'',
|
timer:'',
|
||||||
title:this.$t('UploadFile'),
|
title:this.$t('UploadFile'),
|
||||||
listType:'text',
|
listType:'text',
|
||||||
|
token:Vue.ls.get(ACCESS_TOKEN),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props:{
|
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(){
|
handleUpload(){
|
||||||
// if(this.timer){
|
// if(this.timer){
|
||||||
@@ -282,14 +272,43 @@
|
|||||||
content: '',
|
content: '',
|
||||||
onOk:
|
onOk:
|
||||||
async () => {
|
async () => {
|
||||||
postAction(`ocr/ocrRecord/deleteBatch`, param).then(res => {
|
axios({
|
||||||
if (res.success) {
|
url: '/jero-boot/ocr/ocrRecord/deleteBatch',
|
||||||
this.$message.success(this.$t('OperationSuccessful'))
|
method: 'post',
|
||||||
eventBUs.$emit('searchReset')
|
data: param,
|
||||||
}else{
|
transformRequest: [function (data) {
|
||||||
this.$message.warning(this.$t('operationFailed'))
|
// 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() {},
|
onCancel() {},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user