拆分列表

This commit is contained in:
caoyang
2022-03-22 12:12:05 +08:00
parent 7b12ed59fe
commit 2d4ee50631
8 changed files with 242 additions and 192 deletions
@@ -77,6 +77,9 @@
import SplitText from './modules/SplitText'
import ImportResult from './modules/ImportResult'
import { getAction, postAction, deleteAction } from '@/api/manage'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import axios from 'axios'
import Vue from 'vue'
export default {
name: 'splitting',
@@ -92,46 +95,37 @@
loading:false,
total:0,
ids:[],
tableData:[
{
dbFieldTxt_dictText:'11111',
dbFieldEnName_dictText:'aaaaa',
fieldShowType_dictText:'345435435',
dbLength_dictText:'et435344354',
orderNum_dictText:'dfgdrgd',
showAreaName:'sdfsdfsd',
}
],
tableData:[],
columns:[
{
title: this.$t('standard'),
align: "center",
dataIndex: 'dbFieldTxt_dictText',
dataIndex: 'serialNumber',
},
{
title: this.$t('title'),
align: "center",
dataIndex: 'dbFieldEnName_dictText',
dataIndex: 'title',
},
{
title: this.$t('TextStatus'),
align: "center",
dataIndex: 'fieldShowType_dictText',
dataIndex: 'fileType_dictText',
},
{
title: this.$t('fileName'),
align: "center",
dataIndex: 'dbLength_dictText'
dataIndex: 'fileName'
},
{
title: this.$t('splitTime'),
align: "center",
dataIndex: 'orderNum_dictText'
dataIndex: 'createTime'
},
{
title: this.$t('splitResult'),
align: "center",
dataIndex: 'showAreaName'
dataIndex: 'splitResult_dictText'
},
{
title: this.$t('operation'),
@@ -144,7 +138,9 @@
queryParams:{
pageNo:1,
pageSize:10
}
},
token:Vue.ls.get(ACCESS_TOKEN),
}
},
props:{
@@ -163,7 +159,7 @@
let params={
...this.queryParams
}
getAction(``,params).then(res=>{
getAction(`split/sarFileSplitInfo/page`,params).then(res=>{
if(res.success){
this.tableData=[...res.result.records]
this.loading=false
@@ -193,12 +189,28 @@
content: '',
onOk:
async () => {
deleteAction(``, params).then(res => {
if (res.success) {
axios({
url: '/jero-boot/split/sarFileSplitInfo/deleteBatch',
method: 'post',
data: params,
transformRequest: [function (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'))
if(this.selectedRowKeys&&this.selectedRowKeys.length==this.tableData.length){
this.queryParams.pageNo=this.queryParams.pageNo-1
}
this.selectedRowKeys=[]
this.loadData()
}else{
this.$message.warning(this.$t('operationFailed'))
@@ -216,19 +228,21 @@
deleteDetail(val){
this.$confirm({
content: this.$t('confirmDeletion'),
onOk() {
deleteAction(``, { id: val.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
if(this.tableData&&this.tableData.length==1&&this.queryParams.pageNo!=1){
this.queryParams.pageNo=this.queryParams.pageNo-1
onOk:
async () => {
getAction(`split/sarFileSplitInfo/delete`, { id: val.id }).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
if (this.tableData && this.tableData.length == 1 && this.queryParams.pageNo != 1) {
this.queryParams.pageNo = this.queryParams.pageNo - 1
}
this.loadData()
} else {
this.$message.warning(this.$t('operationFailed'))
}
this.loadData()
} else {
this.$message.warning(res.message)
}
})
}
})
}
})
},
sVisible(val){