mirror of https://github.com/veops/cmdb.git
fix:icon/filter/router...and some bugs (#451)
This commit is contained in:
parent
8fc19d8b7c
commit
2a861250eb
|
@ -17,25 +17,29 @@ export default {
|
|||
getPropertyIcon(attr) {
|
||||
switch (attr.value_type) {
|
||||
case '0':
|
||||
return 'icon-xianxing-shishu'
|
||||
return 'duose-shishu'
|
||||
case '1':
|
||||
return 'icon-xianxing-fudianshu'
|
||||
return 'duose-fudianshu'
|
||||
case '2':
|
||||
if (attr.is_password) {
|
||||
return 'icon-xianxing-password'
|
||||
return 'duose-password'
|
||||
}
|
||||
if (attr.is_link) {
|
||||
return 'icon-xianxing-link'
|
||||
return 'duose-link'
|
||||
}
|
||||
return 'icon-xianxing-wenben'
|
||||
return 'duose-wenben'
|
||||
case '3':
|
||||
return 'icon-xianxing-datetime'
|
||||
return 'duose-datetime'
|
||||
case '4':
|
||||
return 'icon-xianxing-date'
|
||||
return 'duose-date'
|
||||
case '5':
|
||||
return 'icon-xianxing-time'
|
||||
return 'duose-time'
|
||||
case '6':
|
||||
return 'icon-xianxing-json'
|
||||
return 'duose-json'
|
||||
case '7':
|
||||
return 'duose-password'
|
||||
case '8':
|
||||
return 'duose-link'
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
:key="route.name"
|
||||
@click="() => handleClick(route)"
|
||||
>
|
||||
{{ $t(route.meta.title) }}
|
||||
{{ route.meta.title }}
|
||||
</span>
|
||||
<a-popover v-model="visible" placement="bottom" trigger="click" overlayClassName="top-menu-dropdown">
|
||||
<!-- <a-popover v-model="visible" placement="bottom" trigger="click" overlayClassName="top-menu-dropdown">
|
||||
<template slot="content">
|
||||
<div class="title">
|
||||
更多应用
|
||||
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<span class="top-menu-icon"><gridSvg /></span>
|
||||
</a-popover>
|
||||
</a-popover> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -49,18 +49,8 @@ export default {
|
|||
components: { gridSvg, top_agent, top_acl },
|
||||
data() {
|
||||
return {
|
||||
defaultShowRouteName: [
|
||||
'dag',
|
||||
'cmdb',
|
||||
'itsm',
|
||||
'ticket',
|
||||
'monitor',
|
||||
'calendar',
|
||||
'datainsight',
|
||||
'fullscreen',
|
||||
'oneterm',
|
||||
],
|
||||
defaultUnShowRouteName: ['acl', 'agent'],
|
||||
defaultShowRouteName: ['cmdb', 'acl'],
|
||||
defaultUnShowRouteName: [],
|
||||
routes: store.getters.appRoutes.filter((i) => !(i.meta || {}).hiddenInTopMenu),
|
||||
current: store.getters.appRoutes[0].name,
|
||||
visible: false,
|
||||
|
|
|
@ -271,7 +271,7 @@ const cmdb_en = {
|
|||
tips1: 'Kind Reminder :',
|
||||
tips2: '1. Click to download the template, and users can customize the header of the template file, including model properties and model associations',
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
tips3: '2. The red color in the template file represents the model relationship, such as the $Product. Product Name (${Model Name}. {Attribute Name}) column, which establishes the relationship between the physical machine and the product.',
|
||||
tips3: '2. The red color in the template file represents the model relationship, such as the $Product. Product Name (${Model Name}. {Attribute Name}) column, which establishes the relationship with the product.',
|
||||
tips4: '3. In the download template Excel file, the predefined values of attributes will be set as dropdown options. Please note that due to the limitations of Excel itself, a single dropdown box is limited to a maximum of 255 characters. If it exceeds 255 characters, we will not set the dropdown options for this attribute',
|
||||
tips5: '4. When using Excel templates, please ensure that a single file does not exceed 5000 lines.',
|
||||
},
|
||||
|
|
|
@ -270,7 +270,7 @@ const cmdb_zh = {
|
|||
tips1: '温馨提示:',
|
||||
tips2: '1. 点击下载模板,用户可以自定义模板文件的表头,包括模型属性、模型关联',
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
tips3: '2. 模板文件中红色为模型关系,如$产品.产品名(${模型名}.{属性名})这一列就可建立物理机和产品之间的关系',
|
||||
tips3: '2. 模板文件中红色为模型关系,如$产品.产品名(${模型名}.{属性名})这一列就可建立和产品之间的关系',
|
||||
tips4: '3. 下载模板excel文件中会将属性的预定义值置为下拉选项,请注意,受excel本身的限制,单个下拉框限制了最多255个字符,如果超过255个字符,我们不会设置该属性的下拉选项',
|
||||
tips5: '4. 在使用excel模板时,请确保单个文件不超过5000行',
|
||||
},
|
||||
|
|
|
@ -156,8 +156,8 @@ const genCmdbRoutes = async () => {
|
|||
const lastTypeId = window.localStorage.getItem('ops_ci_typeid') || undefined
|
||||
if (lastTypeId && preference.some(item => item.id === Number(lastTypeId))) {
|
||||
routes.redirect = `/cmdb/instances/types/${lastTypeId}`
|
||||
} else if (routes.children[3]?.children?.length > 0) {
|
||||
routes.redirect = routes.children[3]?.children.find(item => !item.hidden)?.path
|
||||
} else if (routes.children[2]?.children?.length > 0) {
|
||||
routes.redirect = routes.children[2].children.find(item => !item.hidden)?.path
|
||||
} else {
|
||||
routes.redirect = '/cmdb/dashboard'
|
||||
}
|
||||
|
|
|
@ -108,9 +108,7 @@
|
|||
handle=".handle"
|
||||
>
|
||||
<AttributeCard
|
||||
v-for="item in CITypeGroup.attributes.filter(
|
||||
(attr) => !attrTypeFilter.length || (attrTypeFilter.length && attrTypeFilter.includes(attr.value_type))
|
||||
)"
|
||||
v-for="item in filterValueType(CITypeGroup.attributes)"
|
||||
:key="item.id"
|
||||
@edit="handleEditProperty(item)"
|
||||
:property="item"
|
||||
|
@ -152,9 +150,7 @@
|
|||
handle=".handle"
|
||||
>
|
||||
<AttributeCard
|
||||
v-for="item in otherGroupAttributes.filter(
|
||||
(attr) => !attrTypeFilter.length || (attrTypeFilter.length && attrTypeFilter.includes(attr.value_type))
|
||||
)"
|
||||
v-for="item in filterValueType(otherGroupAttributes)"
|
||||
:key="item.id"
|
||||
@edit="handleEditProperty(item)"
|
||||
:property="item"
|
||||
|
@ -564,6 +560,32 @@ export default {
|
|||
this.attrTypeFilter.push(type)
|
||||
}
|
||||
},
|
||||
filterValueType(array) {
|
||||
const { attrTypeFilter } = this
|
||||
return array.filter((attr) => {
|
||||
if (!attrTypeFilter.length) {
|
||||
return true
|
||||
} else {
|
||||
if (attrTypeFilter.includes('7') && attr.is_password) {
|
||||
return true
|
||||
}
|
||||
if (attrTypeFilter.includes('8') && attr.is_link) {
|
||||
return true
|
||||
}
|
||||
if (
|
||||
attrTypeFilter.includes(attr.value_type) &&
|
||||
attr.value_type === '2' &&
|
||||
(attr.is_password || attr.is_link)
|
||||
) {
|
||||
return false
|
||||
}
|
||||
if (attrTypeFilter.includes(attr.value_type)) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1143,7 +1143,7 @@ body {
|
|||
border-bottom: 1px solid @border-color-base;
|
||||
}
|
||||
.ant-tabs-tab {
|
||||
color: @text-color_4;
|
||||
color: @text-color_2;
|
||||
}
|
||||
.ant-tabs-tab-active {
|
||||
color: @primary-color;
|
||||
|
|
Loading…
Reference in New Issue