NEZ-717 fix: 修复param没回显的问题
This commit is contained in:
@@ -150,6 +150,7 @@ export default {
|
|||||||
components: { assetTagEx },
|
components: { assetTagEx },
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
ready: false,
|
||||||
editAssetMeta: {},
|
editAssetMeta: {},
|
||||||
rightBox: { // 面板弹出框相关
|
rightBox: { // 面板弹出框相关
|
||||||
show: false
|
show: false
|
||||||
@@ -253,6 +254,9 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.getGroupData()
|
this.getGroupData()
|
||||||
|
setTimeout(() => {
|
||||||
|
this.ready = true
|
||||||
|
}, 500)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
switchSearch (value) {
|
switchSearch (value) {
|
||||||
@@ -369,39 +373,42 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
selectType (val, init) {
|
selectType (val, init) {
|
||||||
switch (val) {
|
if (init) {
|
||||||
case 'RADIO' :
|
this.showParam = true
|
||||||
case 'CHECKBOX' :
|
} else {
|
||||||
case 'SELECT' :
|
if (this.ready) {
|
||||||
this.showParam = true
|
switch (val) {
|
||||||
if (init) return
|
case 'RADIO' :
|
||||||
this.editAssetMeta.param = {}
|
case 'CHECKBOX' :
|
||||||
this.editAssetMeta.param.items = [{
|
case 'SELECT' :
|
||||||
name: 'Option 1',
|
this.showParam = true
|
||||||
check: false
|
this.editAssetMeta.param = {}
|
||||||
}, {
|
this.editAssetMeta.param.items = [{
|
||||||
name: 'Option 2',
|
name: 'Option 1',
|
||||||
check: false
|
check: false
|
||||||
}]
|
}, {
|
||||||
break
|
name: 'Option 2',
|
||||||
case 'DATETIME' :
|
check: false
|
||||||
this.showParam = true
|
}]
|
||||||
if (init) return
|
break
|
||||||
this.editAssetMeta.param = {
|
case 'DATETIME' :
|
||||||
subType: 'date',
|
this.showParam = true
|
||||||
interval: false
|
this.editAssetMeta.param = {
|
||||||
|
subType: 'date',
|
||||||
|
interval: false
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case 'DOUBLE' :
|
||||||
|
this.showParam = true
|
||||||
|
this.editAssetMeta.param = {
|
||||||
|
decimals: 2
|
||||||
|
}
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
this.showParam = false
|
||||||
|
break
|
||||||
}
|
}
|
||||||
break
|
}
|
||||||
case 'DOUBLE' :
|
|
||||||
this.showParam = true
|
|
||||||
if (init) return
|
|
||||||
this.editAssetMeta.param = {
|
|
||||||
decimals: 2
|
|
||||||
}
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
this.showParam = false
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inputChange (index, val) {
|
inputChange (index, val) {
|
||||||
|
|||||||
@@ -210,13 +210,13 @@ export default {
|
|||||||
let str = ''
|
let str = ''
|
||||||
arr.forEach((item, index) => {
|
arr.forEach((item, index) => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
str += `<div>DC <div class="active-icon inline-block ${item == '0' ? 'gray-bg' : 'green-bg'}"></div></div>`
|
str += `<div><div class="active-icon inline-block ${item == '0' ? 'gray-bg' : 'green-bg'}"></div> DC</div>`
|
||||||
}
|
}
|
||||||
if (index === 1) {
|
if (index === 1) {
|
||||||
str += `<div>ASSET <div class="active-icon inline-block ${item == '0' ? 'gray-bg' : 'green-bg'}"></div></div>`
|
str += `<div><div class="active-icon inline-block ${item == '0' ? 'gray-bg' : 'green-bg'}"></div> ASSET</div>`
|
||||||
}
|
}
|
||||||
if (index === 2) {
|
if (index === 2) {
|
||||||
str += `<div>ENDPOINT <div class="active-icon inline-block ${item == '0' ? 'gray-bg' : 'green-bg'}"></div></div>`
|
str += `<div><div class="active-icon inline-block ${item == '0' ? 'gray-bg' : 'green-bg'}"></div> ENDPOINT</div>`
|
||||||
}
|
}
|
||||||
// if (index === 3) {
|
// if (index === 3) {
|
||||||
// str += `<div>PROMETHEUS <div class="active-icon inline-block ${item == '0' ? 'red-bg' : 'green-bg'}"></div></div>`
|
// str += `<div>PROMETHEUS <div class="active-icon inline-block ${item == '0' ? 'red-bg' : 'green-bg'}"></div></div>`
|
||||||
|
|||||||
@@ -239,8 +239,12 @@ export default {
|
|||||||
this.rightBox.metaShow = true
|
this.rightBox.metaShow = true
|
||||||
},
|
},
|
||||||
edit (row) {
|
edit (row) {
|
||||||
this.object = JSON.parse(JSON.stringify(row))
|
this.$get(`${this.url}/${row.id}`).then(response => {
|
||||||
this.rightBox.metaShow = true
|
if (response.code === 200) {
|
||||||
|
this.object = response.data
|
||||||
|
this.rightBox.metaShow = true
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
closeRightBox (refresh) {
|
closeRightBox (refresh) {
|
||||||
this.rightBox.metaShow = false
|
this.rightBox.metaShow = false
|
||||||
|
|||||||
Reference in New Issue
Block a user