bug修改
This commit is contained in:
@@ -257,64 +257,70 @@
|
||||
},
|
||||
//保存
|
||||
hideModal(){
|
||||
if(this.dictVal=='list') {
|
||||
let params = {
|
||||
...this.form,
|
||||
dictId: this.record.id
|
||||
}
|
||||
if (this.isEdit) {
|
||||
putAction(`sys/dictItem/edit`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.form={}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
if(this.dictVal=='list') {
|
||||
let params = {
|
||||
...this.form,
|
||||
dictId: this.record.id
|
||||
}
|
||||
if (this.isEdit) {
|
||||
putAction(`sys/dictItem/edit`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.form = {}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
postAction(`sys/dictItem/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.form = {}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
postAction(`sys/dictItem/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.form={}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
} else if (this.dictVal == 'tree') {
|
||||
console.log('tree1111')
|
||||
let params = {
|
||||
...this.form,
|
||||
sysDictId: this.record.id
|
||||
}
|
||||
if (this.isEdit) {
|
||||
putAction(`sys/category/edit`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.form = {}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
//新增
|
||||
postAction(`sys/category/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.form = {}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}else if(this.dictVal=='tree'){
|
||||
let params = {
|
||||
...this.form,
|
||||
sysDictId: this.record.id
|
||||
}
|
||||
if (this.isEdit) {
|
||||
putAction(`sys/category/edit`,params).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.form={}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
}else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}else{
|
||||
//新增
|
||||
postAction(`sys/category/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.form={}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//取消
|
||||
cancelModel(){
|
||||
@@ -355,7 +361,7 @@
|
||||
deleteAction(`sys/dictItem/delete`, params).then(res => {
|
||||
if(res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'));
|
||||
if(this.tableData&&this.tableData.length==1){
|
||||
if(this.tableData&&this.tableData.length==1&&this.queryParams.pageNo!=1){
|
||||
this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
}
|
||||
this.loadData()
|
||||
@@ -385,9 +391,11 @@
|
||||
onOk:
|
||||
async () => {
|
||||
if(this.dictVal=='list'){
|
||||
deleteAction(`sys/dictItem/logicdeleteBatch`, params).then(res => {
|
||||
deleteAction(`sys/dictItem/logicDeleteBatch`, params).then(res => {
|
||||
if(res.success){
|
||||
this.queryParams.pageNo=1
|
||||
if(this.ids.length==this.tableData.length&&this.queryParams.pageNo!=1){
|
||||
this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
}
|
||||
this.loadData()
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
}else{
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
pageNo:1,
|
||||
pageSize:10
|
||||
},
|
||||
ids:[],
|
||||
selectedRowKeys: [],
|
||||
contentVisible:false,
|
||||
tableData:[],
|
||||
@@ -263,7 +264,7 @@
|
||||
deleteAction(`sys/dict/logicDelete`, param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
if(this.tableData&&this.tableData.length==1){
|
||||
if(this.tableData&&this.tableData.length==1&&this.queryParams.pageNo!=1){
|
||||
this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
}
|
||||
this.loadData()
|
||||
@@ -275,25 +276,28 @@
|
||||
})
|
||||
},
|
||||
onSelectChange(selectedRowKeys) {
|
||||
console.log('selectedRowKeys changed: ', selectedRowKeys);
|
||||
// console.log('selectedRowKeys changed: ', selectedRowKeys);
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
this.ids = this.selectedRowKeys;
|
||||
|
||||
},
|
||||
//批量删除
|
||||
batDelete(){
|
||||
let params={
|
||||
ids:this.selectedRowKeys.join(',')
|
||||
ids:this.ids.join(',')
|
||||
}
|
||||
if(this.selectedRowKeys){
|
||||
if(this.ids&&this.ids.length>0){
|
||||
this.$confirm({
|
||||
title: this.$t('ConfirmDelete'),
|
||||
content: '',
|
||||
onOk:
|
||||
async () => {
|
||||
deleteAction(`sys/dict/logicdeleteBatch`, params).then(res => {
|
||||
deleteAction(`sys/dict/logicDeleteBatch`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
|
||||
if(this.ids.length==this.tableData.length&&this.queryParams.pageNo!=1){
|
||||
this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
}
|
||||
this.loadData()
|
||||
postAction(`online/cgform/api/doDbSynch/48308196e7b04761b533dc31bc899707/normal
|
||||
`,{}).then(res=>{
|
||||
|
||||
Reference in New Issue
Block a user