Skip to content

Commit

Permalink
fix(ui):some fix (#370)
Browse files Browse the repository at this point in the history
* pref(ui):some bugfix & some style

* fix(ui):some fix
  • Loading branch information
wang-liang0615 authored Jan 10, 2024
1 parent c2ba819 commit 996151f
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion cmdb-ui/config/plugin.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const getAntdSerials = (color) => {

const themePluginOption = {
fileName: 'css/theme-colors-[contenthash:8].css',
matchColors: getAntdSerials('#1890ff'), // 主色系列
matchColors: getAntdSerials('#2f54eb'), // 主色系列
// 改变样式选择器,解决样式覆盖问题
changeSelector (selector) {
switch (selector) {
Expand Down
2 changes: 1 addition & 1 deletion cmdb-ui/src/config/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

export default {
primaryColor: '#1890ff', // primary color of ant design
primaryColor: '#2f54eb', // primary color of ant design
navTheme: 'dark', // theme for nav menu
layout: 'sidemenu', // nav menu position: sidemenu or topmenu
contentWidth: 'Fixed', // layout of content: Fluid or Fixed, only works when layout is topmenu
Expand Down
2 changes: 1 addition & 1 deletion cmdb-ui/src/modules/acl/views/module/resourcePermForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
</a-tag>
</template>
</vxe-column>
<vxe-column field="operate" :title="$t('batchOperate')">
<vxe-column field="operate" :title="$t('acl.batchOperate')">
<template #default="{row}">
<a-button size="small" type="danger" @click="handleClearAll(row)">
{{ $t('clear') }}
Expand Down
8 changes: 4 additions & 4 deletions cmdb-ui/src/modules/cmdb/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,12 @@ const cmdb_en = {
ad: {
upload: 'Import',
download: 'Export',
accpet: 'Accept',
accpetBy: 'Accept By',
accept: 'Accept',
acceptBy: 'Accept By',
acceptTime: 'Accept Time',
confirmAccept: 'Confirm Accept?',
accpetSuccess: 'Accept successfully',
isAccpet: 'Is accept',
acceptSuccess: 'Accept successfully',
isAccept: 'Is accept',
deleteADC: 'Confirm to delete this data?',
batchDelete: 'Confirm to delete this data?',
agent: 'Built-in & Plug-ins',
Expand Down
8 changes: 4 additions & 4 deletions cmdb-ui/src/modules/cmdb/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,12 @@ const cmdb_zh = {
ad: {
upload: '规则导入',
download: '规则导出',
accpet: '入库',
accpetBy: '入库人',
accept: '入库',
acceptBy: '入库人',
acceptTime: '入库时间',
confirmAccept: '确认入库?',
accpetSuccess: '入库成功',
isAccpet: '是否入库',
acceptSuccess: '入库成功',
isAccept: '是否入库',
deleteADC: '确认删除该条数据?',
batchDelete: '确认删除这些数据?',
agent: '内置 & 插件',
Expand Down
10 changes: 5 additions & 5 deletions cmdb-ui/src/modules/cmdb/views/discoveryCI/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<vxe-column
align="center"
field="is_accept"
:title="$t('cmdb.ad.isAccpet')"
:title="$t('cmdb.ad.isAccept')"
v-bind="columns.length ? { width: '100px' } : { minWidth: '100px' }"
:filters="[
{ label: $t('yes'), value: true },
Expand All @@ -92,7 +92,7 @@
</vxe-column>
<vxe-column
field="accept_by"
:title="$t('cmdb.ad.accpetBy')"
:title="$t('cmdb.ad.acceptBy')"
v-bind="columns.length ? { width: '80px' } : { minWidth: '80px' }"
:filters="[]"
></vxe-column>
Expand Down Expand Up @@ -186,8 +186,8 @@ export default {
this.clickSidebar(Number(_currentType))
return
}
if (res && res.length) {
this.clickSidebar(res[0].id)
if (res && res.length && res[0].ci_types && res[0].ci_types.length) {
this.clickSidebar(res[0].ci_types[0].id)
}
})
},
Expand Down Expand Up @@ -246,7 +246,7 @@ export default {
content: that.$t('cmdb.ad.confirmAccept'),
onOk() {
updateADCAccept(row.id).then(() => {
that.$message.success(that.$t('cmdb.ad.accpetSuccess'))
that.$message.success(that.$t('cmdb.ad.acceptSuccess'))
that.getAdc(false)
})
},
Expand Down
5 changes: 3 additions & 2 deletions cmdb-ui/src/utils/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ const AppDeviceEnquire = {
const mixinPermissions = {
computed: {
...mapState({
detailPermissions: state => state.user.detailPermissions
detailPermissions: state => state.user.detailPermissions,
roles: state => state.user.roles
})
},
methods: {
Expand All @@ -85,7 +86,7 @@ const mixinPermissions = {
hasDetailPermission(appName, resourceName, perms = []) {
const appNamePer = this.detailPermissions[`${appName}`]
const _findResourcePermissions = appNamePer.find(item => item.name === resourceName)
return _findResourcePermissions.permissions.some(item => perms.includes(item))
return this.roles?.permissions.includes('acl_admin') || this.roles?.permissions.includes('backend_admin') || _findResourcePermissions?.permissions.some(item => perms.includes(item))
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions cmdb-ui/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
// TODO 需要增加根据环境不开启主题需求
new ThemeColorReplacer({
fileName: 'css/theme-colors-[contenthash:8].css',
matchColors: getAntdSerials('#1890ff'), // 主色系列
matchColors: getAntdSerials('#2f54eb'), // 主色系列
// 改变样式选择器,解决样式覆盖问题
changeSelector(selector) {
switch (selector) {
Expand Down Expand Up @@ -83,11 +83,9 @@ module.exports = {
less: {
modifyVars: {
/* less 变量覆盖,用于自定义 ant design 主题 */
/*
'primary-color': '#F5222D',
'link-color': '#F5222D',
'border-radius-base': '4px',
*/
'primary-color': '#2f54eb',
// 'link-color': '#F5222D',
// 'border-radius-base': '4px',
},
javascriptEnabled: true,
},
Expand Down

0 comments on commit 996151f

Please sign in to comment.