diff --git a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue
index b6d4cc072..c7908126a 100644
--- a/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue
+++ b/nezha-fronted/src/components/common/rightBox/asset/assetBox.vue
@@ -51,7 +51,11 @@
-
+
+
@@ -327,6 +332,7 @@ export default {
const vm = this
return {
assetConstants,
+ judgeTypes: true,
showAllTalonOption: false,
showAddressOption: true,
talonShowTow: true,
@@ -546,6 +552,17 @@ export default {
this.getFieldGroupData()
},
methods: {
+ judgeType () {
+ if (!this.editAsset.type.name) {
+ this.$message({
+ type: 'error',
+ message: '请先选择Type值'
+ })
+ return false
+ } else {
+ this.judgeTypes = false
+ }
+ },
clickOutside () {
this.esc(false)
},
@@ -629,6 +646,10 @@ export default {
})
},
selectType (type) {
+ this.$refs.cascader.$refs.panel.clearCheckedNodes()
+ this.$refs.cascader.$refs.panel.activePath = []
+ this.editAsset.brandAndModel = ''
+ this.lockModelInputValue = ''
this.editAsset.type = { ...type }
this.editAsset.typeId = type.id ? type.id : ''
this.editAsset.authType = ''
@@ -639,6 +660,7 @@ export default {
this.editAsset.snmpCredentialId = ''
this.editAsset.authProtocolPort = ''
this.editAsset.pid = ''
+ this.getModelData()
},
addLabel ([groupId, metaId]) {
const label = this.options.metaOptions.find(m => m.id === metaId)
@@ -798,7 +820,7 @@ export default {
},
getModelData () {
return new Promise(resolve => {
- this.$get('asset/model?pageSize=-1').then(response => {
+ this.$get('asset/model?pageSize=-1&typeIds=' + this.editAsset.typeId).then(response => {
if (response.code === 200) {
this.options.modelOptions = response.data.list
const titleSearchData = {}
@@ -810,6 +832,11 @@ export default {
}
})
this.options.brandAndModelOptions = Object.keys(titleSearchData).map(b => titleSearchData[b])
+ if (!this.editAsset.type.name) {
+ this.judgeTypes = true
+ } else {
+ this.judgeTypes = false
+ }
}
resolve()
})