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