[参数项] 删除
This commit is contained in:
@@ -94,7 +94,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
|
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
|
||||||
import addModel from './components/addModel'
|
import addModel from './components/addModel'
|
||||||
|
import axios from 'axios'
|
||||||
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||||
|
import eventBUs from '../../../common/event'
|
||||||
|
import Vue from 'vue'
|
||||||
export default {
|
export default {
|
||||||
name: 'index',
|
name: 'index',
|
||||||
components: {
|
components: {
|
||||||
@@ -102,9 +105,11 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
token:Vue.ls.get(ACCESS_TOKEN),
|
||||||
loading: false,
|
loading: false,
|
||||||
toggleSearchStatus: false,
|
toggleSearchStatus: false,
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
|
selectedRowKeysArray: '',
|
||||||
formInline: {},
|
formInline: {},
|
||||||
rules: {},
|
rules: {},
|
||||||
visible: false,
|
visible: false,
|
||||||
@@ -176,6 +181,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onSelectChange(value) {
|
onSelectChange(value) {
|
||||||
this.selectedRowKeys = value
|
this.selectedRowKeys = value
|
||||||
|
this.selectedRowKeysArray = this.selectedRowKeys.join(',')
|
||||||
},
|
},
|
||||||
//添加
|
//添加
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
@@ -187,21 +193,42 @@ export default {
|
|||||||
},
|
},
|
||||||
//批量删除
|
//批量删除
|
||||||
handleDel() {
|
handleDel() {
|
||||||
|
let param={
|
||||||
|
ids: this.selectedRowKeysArray
|
||||||
|
}
|
||||||
if (this.selectedRowKeys.length > 0) {
|
if (this.selectedRowKeys.length > 0) {
|
||||||
let _this = this
|
let _this = this
|
||||||
this.$confirm({
|
this.$confirm({
|
||||||
content: _this.$t('ConfirmBatchDeletion'),
|
content: _this.$t('ConfirmBatchDeletion'),
|
||||||
onOk() {
|
onOk() {
|
||||||
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
|
axios({
|
||||||
postAction(_this.url.deleteAll, { ids: idList.join(',') }).then((res) => {
|
url: '/jero-boot/params/template/deleteBatch',
|
||||||
if (res.success) {
|
method: 'post',
|
||||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
data: param,
|
||||||
_this.selectedRowKeys = []
|
transformRequest: [function (data) {
|
||||||
_this.getList()
|
let ret = ''
|
||||||
} else {
|
for (let it in data) {
|
||||||
_this.$message.warning(_this.$t('operationFailed'))
|
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'))
|
||||||
|
_this.selectedRowKeys = []
|
||||||
|
_this.getList()
|
||||||
|
}else{
|
||||||
|
_this.$message.warning(_this.$t('operationFailed'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch( (error) =>{
|
||||||
|
console.log(error);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user