mirror of
https://github.com/veops/cmdb.git
synced 2025-08-07 22:51:33 +08:00
feat(ui): dcim - update rack list filter
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
<a-select
|
<a-select
|
||||||
class="dcim-main-row-select"
|
class="dcim-main-row-select"
|
||||||
|
:getPopupContainer="(trigger) => trigger.parentElement"
|
||||||
v-model="currentRackType"
|
v-model="currentRackType"
|
||||||
>
|
>
|
||||||
<a-icon slot="suffixIcon" type="caret-down" />
|
<a-icon slot="suffixIcon" type="caret-down" />
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
v-for="(item) in rackTypeSelectOption"
|
v-for="(item) in rackTypeSelectOption"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
|
:class="item.value === 'unitAbnormal' ? 'dcim-main-row-select-unitAbnormal' : ''"
|
||||||
>
|
>
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@@ -142,7 +144,7 @@ export default {
|
|||||||
value: 'table',
|
value: 'table',
|
||||||
icon: 'monitor-list_view'
|
icon: 'monitor-list_view'
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -164,6 +166,11 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectOption.push({
|
||||||
|
value: 'unitAbnormal',
|
||||||
|
label: this.$t('cmdb.dcim.unitAbnormal')
|
||||||
|
})
|
||||||
|
|
||||||
return selectOption
|
return selectOption
|
||||||
},
|
},
|
||||||
filterRackList() {
|
filterRackList() {
|
||||||
@@ -174,7 +181,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.currentRackType !== 'all') {
|
if (this.currentRackType !== 'all') {
|
||||||
rackList = rackList.filter((item) => item.rack_type === this.currentRackType)
|
if (this.currentRackType === 'unitAbnormal') {
|
||||||
|
rackList = rackList.filter((item) => item.u_slot_abnormal)
|
||||||
|
} else {
|
||||||
|
rackList = rackList.filter((item) => item.rack_type === this.currentRackType)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rackList
|
return rackList
|
||||||
@@ -312,6 +323,10 @@ export default {
|
|||||||
width: 120px;
|
width: 120px;
|
||||||
margin-left: 22px;
|
margin-left: 22px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
/deep/ &-unitAbnormal {
|
||||||
|
border-top: dashed 1px #e8e8e8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-right {
|
&-right {
|
||||||
|
@@ -198,7 +198,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getRackData() {
|
async getRackData() {
|
||||||
await this.getAttrList(DCIM_CITYPE_NAME.RACK, DCIM_CITYPE_NAME.RACK)
|
await this.getAttrList(DCIM_CITYPE_NAME.RACK, DCIM_TYPE.RACK)
|
||||||
|
|
||||||
const CITypeRes = await getCIType(DCIM_CITYPE_NAME.RACK)
|
const CITypeRes = await getCIType(DCIM_CITYPE_NAME.RACK)
|
||||||
this.rackCITYpe = CITypeRes?.ci_types?.[0] || {}
|
this.rackCITYpe = CITypeRes?.ci_types?.[0] || {}
|
||||||
|
Reference in New Issue
Block a user