project: bugfix, show projects and its details

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Rohit Yadav 2019-10-10 13:26:03 +05:30
parent 0182a95ac6
commit 014d708e28
3 changed files with 26 additions and 2 deletions

View File

@ -80,11 +80,21 @@ export function generateRouterMap (section) {
map.children.push(route)
}
} else {
map.component = section.component ? section.component : AutogenView
map.hideChildrenInMenu = true
map.children = [{
path: '/' + section.name + '/:id',
actions: section.actions ? section.actions : [],
component: section.viewComponent ? section.viewComponent : section.component
meta: {
title: section.title,
keepAlive: true,
icon: section.icon,
permission: section.permission,
params: section.params ? section.params : {},
actions: section.actions ? section.actions : [],
viewComponent: section.viewComponent
},
component: section.viewComponent ? section.viewComponent : AutogenView
}]
}

View File

@ -30,6 +30,10 @@ const err = (error) => {
})
}
}
if (error.response.status === 404) {
notification.error({ message: 'Not Found', description: 'Resource not found' })
this.$router.push({ path: '/exception/404' })
}
}
return Promise.reject(error)
}

View File

@ -335,7 +335,6 @@ export default {
params['page'] = this.page
params['pagesize'] = this.pageSize
api(this.apiName, params).then(json => {
this.loading = false
var responseName
var objectName
for (const key in json) {
@ -364,6 +363,17 @@ export default {
} else {
this.resource = {}
}
}).catch(error => {
// handle error
this.$notification['error']({
message: 'Request Failed',
description: error.response.headers['x-description']
})
if (error.response.status === 431) {
this.$router.push({ path: '/exception/404' })
}
}).finally(f => {
this.loading = false
})
},
onSearch (value) {