This commit is contained in:
pycook 2020-02-23 18:41:23 +08:00
parent 9c47d9c733
commit c3b5b30b1f
7 changed files with 32 additions and 29 deletions

View File

@ -44,13 +44,11 @@ export function writeExcel (columns, name) {
// Determines whether an array element is empty
export function any (ArrayList) {
let flag = false
ArrayList.forEach(item => {
if (item) {
flag = true
return flag
for (let i = 0; i < ArrayList.length; i++) {
if (ArrayList[i]) {
return true
}
}
})
return false
}

View File

@ -28,16 +28,15 @@ router.beforeEach((to, from, next) => {
.then(res => {
const roles = res.result && res.result.role
store.dispatch('GenerateRoutes', { roles }).then(() => {
// 根据roles权限生成可访问的路由表
// 动态添加可访问路由表
// Generate an accessible routing table based on the roles permissions
// Dynamically add accessible routing tables
router.addRoutes(store.getters.addRouters)
const redirect = decodeURIComponent(from.query.redirect || to.path)
if (to.path === redirect) {
// hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record
// set the replace: true so the navigation will not leave a history record
next({ ...to, replace: true })
} else {
// 跳转到目的路由
// Jump to destination route
next({ path: redirect })
}
})
@ -45,8 +44,8 @@ router.beforeEach((to, from, next) => {
.catch((e) => {
console.log(e)
notification.error({
message: '错误',
description: '请求用户信息失败,请重试'
message: this.$t('tip.error'),
description: 'Failed to request user information. Please try again!'
})
setTimeout(() => {
store.dispatch('Logout')

View File

@ -44,7 +44,7 @@ export default {
this.upload2Server()
},
computed: {
mpercent () {
mPercent () {
return Math.round(this.complete / this.total * 10000) / 100
},
progressStatus () {

View File

@ -389,7 +389,7 @@ export default {
columns.push({
title: this.$t('tip.operate'),
key: 'operation',
width: 100,
width: 115,
fixed: 'right',
scopedSlots: { customRender: 'action' }
})

View File

@ -79,6 +79,7 @@
</template>
<script>
import i18n from '@/locales'
import DescriptionList from '@/components/DescriptionList'
import { getCITypeGroupById } from '@/api/cmdb/CIType'
@ -184,9 +185,9 @@ export default {
filters: {
operateTypeFilter (operateType) {
const operateTypeMap = {
'0': this.$t('button.add'),
'1': this.$t('button.delete'),
'2': this.$t('button.update')
'0': i18n.t('button.add'),
'1': i18n.t('button.delete'),
'2': i18n.t('button.update')
}
return operateTypeMap[operateType]
}

View File

@ -346,7 +346,6 @@ export default {
scrollX += columns[i].width
}
this.columns = columns
this.scrollX = scrollX
this.scrollY = window.innerHeight - this.$refs.table.$el.offsetTop - 300
},
@ -424,14 +423,17 @@ export default {
}
</script>
<style lang='less'>
.ant-menu-horizontal {
<style lang='less' scoped>
/deep/ .ant-table-thead > tr > th,
/deep/ .ant-table-tbody > tr > td {
white-space: nowrap;
overflow: hidden;
}
/deep/ .ant-menu-horizontal {
border-bottom: 1px solid #ebedf0 !important;
}
.ant-menu-horizontal {
border-bottom: 1px solid #ebedf0 !important;
}
.relation-card > .ant-card-body {
/deep/ .relation-card > .ant-card-body {
padding-top: 0 !important;
}
</style>

View File

@ -244,11 +244,14 @@ export default {
}
</script>
<style scoped>
.ant-menu-horizontal {
border-bottom: 1px solid #ebedf0 !important;
<style lang='less' scoped>
/deep/ .ant-table-thead > tr > th,
/deep/ .ant-table-tbody > tr > td {
white-space: nowrap;
overflow: hidden;
}
.ant-menu-horizontal {
/deep/ .ant-menu-horizontal {
border-bottom: 1px solid #ebedf0 !important;
}
</style>