fix:修复endpoint表格高度为动态计算
This commit is contained in:
@@ -173,17 +173,17 @@
|
||||
:z-index="1000"
|
||||
@close="closeDialog"
|
||||
>
|
||||
<el-form ref="form" :model="searchParam" :rules="rules" label-width="auto">
|
||||
<el-form ref="form" :model="setForm" :rules="rules" label-width="auto">
|
||||
<el-form-item label="OID" prop="oid">
|
||||
<el-input size="small" v-model="searchParam.oid" placeholder=""></el-input>
|
||||
<el-input size="small" v-model="setForm.oid" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('config.mib.dataType')" prop="type">
|
||||
<el-select size="small" v-model="searchParam.type" placeholder="" style="width:100%">
|
||||
<el-select size="small" v-model="setForm.type" placeholder="" style="width:100%">
|
||||
<el-option v-for="(item, index) in typeData" :key="index" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('overall.value')" prop="value">
|
||||
<el-input size="small" v-model="searchParam.value" placeholder=""></el-input>
|
||||
<el-input size="small" v-model="setForm.value" placeholder=""></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer">
|
||||
@@ -231,7 +231,10 @@ export default {
|
||||
operation: 'get',
|
||||
version: 2,
|
||||
community: 'public',
|
||||
snmpCredentialId: null,
|
||||
snmpCredentialId: null
|
||||
},
|
||||
setForm: {
|
||||
oid: '',
|
||||
type: '',
|
||||
value: ''
|
||||
},
|
||||
@@ -294,8 +297,9 @@ export default {
|
||||
methods: {
|
||||
closeDialog () {
|
||||
setTimeout(() => {
|
||||
this.searchParam.type = ''
|
||||
this.searchParam.value = ''
|
||||
this.setForm.oid = ''
|
||||
this.setForm.type = ''
|
||||
this.setForm.value = ''
|
||||
this.$nextTick(() => {
|
||||
this.$refs.form.clearValidate()
|
||||
})
|
||||
@@ -378,6 +382,7 @@ export default {
|
||||
/* 处理snmpset */
|
||||
if (!set) {
|
||||
if (this.searchParam.operation == 'set') {
|
||||
this.setForm.oid = this.searchParam.oid
|
||||
this.snmpSetFormVisible = true
|
||||
return
|
||||
}
|
||||
@@ -393,9 +398,10 @@ export default {
|
||||
|
||||
this.loading = true
|
||||
const params = this.$lodash.cloneDeep(this.searchParam)
|
||||
if (params.operation != 'set') {
|
||||
delete params.type
|
||||
delete params.value
|
||||
if (params.operation == 'set') {
|
||||
params.oid = this.setForm.oid
|
||||
params.type = this.setForm.type
|
||||
params.value = this.setForm.value
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.$post('mib/browser', params).then(response => {
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
<template v-slot:before>
|
||||
<div>
|
||||
<el-dropdown-item>
|
||||
<div id="batch-add" v-has="'monitor_endpoint_add'" @click="batchAdd"><i class="nz-icon nz-icon-batchadd"></i>{{$t('overall.batchAdd')}}</div>
|
||||
<div id="batch-add" v-has="'monitor_endpoint_add'" @click="batchAdd"><i class="nz-icon nz-icon-batchadd" style="font-size:14px;margin-right:7px;"></i>{{$t('overall.batchAdd')}}</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<div id="asset-batch-asset" v-has="'asset_edit'" @click="batchEdit"><i class="nz-icon nz-icon-batch-edit"></i>{{$t('overall.batchEdit')}}</div>
|
||||
@@ -523,7 +523,7 @@ export default {
|
||||
type: []
|
||||
},
|
||||
searchCheckBox: {},
|
||||
endpointNzTableHeightOffset: 204,
|
||||
endpointNzTableHeightOffset: 205,
|
||||
needAlertDaysData: true,
|
||||
trendKey: 'endpointId'
|
||||
}
|
||||
@@ -794,7 +794,7 @@ export default {
|
||||
},
|
||||
getSearchableStateData (data) {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
// this.$get('asset/model?pageSize=-1').then(response => {
|
||||
let states = []
|
||||
if (this.$route.query && this.$route.query.state) {
|
||||
@@ -835,6 +835,7 @@ export default {
|
||||
})
|
||||
},
|
||||
setSearchData (statistics) {
|
||||
this.endpointNzTableHeightOffset = 2 + 60 + 20
|
||||
Object.keys(this.titleSearchList).forEach(key => {
|
||||
let keys = key
|
||||
if (key === 'projectIds') {
|
||||
@@ -850,12 +851,18 @@ export default {
|
||||
this.detailSearchList.state.show = true
|
||||
this.titleSearchList[key].hide = !this.titleSearchList[key].children.length
|
||||
this.detailSearchList[key].hide = !this.detailSearchList[key].children.length
|
||||
if (this.detailSearchList[key].children) {
|
||||
this.endpointNzTableHeightOffset += 41
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.titleSearchList[key].children = statistics[keys].map(d => { return { ...d, value: d.id, key: d.name, name: d.name } })
|
||||
this.detailSearchList[key].children = statistics[keys].map(d => { return { ...d, value: d.id, key: d.name, name: d.name } })
|
||||
this.titleSearchList[key].hide = !this.titleSearchList[key].children.length
|
||||
this.detailSearchList[key].hide = !this.detailSearchList[key].children.length
|
||||
if (this.detailSearchList[key].children) {
|
||||
this.endpointNzTableHeightOffset += 41
|
||||
}
|
||||
}
|
||||
this.titleSearchList[key].show = true
|
||||
this.detailSearchList[key].show = true
|
||||
|
||||
Reference in New Issue
Block a user