|
|
@@ -233,18 +233,11 @@ export default {
|
|
|
if (valid) {
|
|
|
this.$api.sysMenu.add(this.temp).then(res => {
|
|
|
this.dialogVisible = false
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message({
|
|
|
- message: 'Created successfully',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.$refs.qtable.getData()
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: 'Failed to create',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- }
|
|
|
+ this.$message({
|
|
|
+ message: 'Created successfully',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.$refs.qtable.getData()
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -255,18 +248,11 @@ export default {
|
|
|
const postData = Object.assign({}, this.temp)
|
|
|
this.$api.sysMenu.update(postData).then(res => {
|
|
|
this.dialogVisible = false
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message({
|
|
|
- message: 'modify successfully',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.$refs.qtable.getData()
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: 'change failed',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- }
|
|
|
+ this.$message({
|
|
|
+ message: 'modify successfully',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.$refs.qtable.getData()
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
@@ -282,18 +268,11 @@ export default {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.$api.sysMenu.del({ id: row.id }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message({
|
|
|
- message: 'successfully deleted',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.$refs.qtable.getData()
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: 'failed to delete',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- }
|
|
|
+ this.$message({
|
|
|
+ message: 'successfully deleted',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.$refs.qtable.getData()
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
@@ -306,18 +285,11 @@ export default {
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
this.$api.sysMenu.batchDel(ids).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$refs.qtable.getData()
|
|
|
- this.$message({
|
|
|
- message: 'successfully deleted',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: 'failed to delete',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- }
|
|
|
+ this.$refs.qtable.getData()
|
|
|
+ this.$message({
|
|
|
+ message: 'successfully deleted',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
})
|
|
|
})
|
|
|
},
|