diff --git a/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue b/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue index 4a89967dc..56c63ac36 100644 --- a/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/software/softwareAssetBox.vue @@ -57,6 +57,92 @@
{{$t('softwareAsset.Connector')}}
+ + + + +
+ + + + +
+
@@ -100,6 +186,7 @@ export default { const vm = this return { assetConstants, + disabled: false, editSoftwareAsset: { id: '', name: '', @@ -157,7 +244,7 @@ export default { return row.dc ? row.dc.name : '' } } - ], + ] } }, watch: { @@ -167,9 +254,16 @@ export default { handler (n) { this.isEdit = true const editSoftwareAsset = JSON.parse(JSON.stringify(n)) + editSoftwareAsset.paramObj = [] + // if (editSoftwareAsset.params) { + // Object.keys(editSoftwareAsset.params).forEach(key => { + // editSoftwareAsset.paramObj.push(editSoftwareAsset.params[key]) + // }) + // } + editSoftwareAsset.assetId = editSoftwareAsset.assetId + '' this.editSoftwareAsset = editSoftwareAsset } - }, + } }, created () { this.getProjectList() @@ -203,11 +297,11 @@ export default { const params = { ...this.editSoftwareAsset } - params.icon = this.imageUrl params.params = {} params.paramObj.forEach(item => { - params.params[item.name] = item + params.params[item.name] = item.value }) + params.icon = this.imageUrl if (this.editSoftwareAsset.id) { this.$put(this.url, params).then(res => { this.prevent_opt.save = false @@ -254,6 +348,9 @@ export default { this.$get('asset/software/type', { pageSize: -1, pageNo: 1 }).then(response => { if (response.code === 200) { this.softwareTypeArr = response.data.list + if (this.editSoftwareAsset.typeId) { + this.renderParams() + } } }) }, @@ -266,7 +363,15 @@ export default { } }, renderParams () { - this.editSoftwareAsset.params = {} + this.editSoftwareAsset.paramObj = [] + const findItem = this.softwareTypeArr.find(item => item.id == this.editSoftwareAsset.typeId) + if (findItem.params) { + Object.keys(findItem.params).forEach(key => { + findItem.params[key].value = this.editSoftwareAsset.params[key] ? this.editSoftwareAsset.params[key].value : findItem.params[key].value + this.editSoftwareAsset.paramObj.push(findItem.params[key]) + }) + console.log(this.editSoftwareAsset.paramObj) + } } } } diff --git a/nezha-fronted/src/components/common/table/settings/softwareTypeTable.vue b/nezha-fronted/src/components/common/table/settings/softwareTypeTable.vue index 68e06ffda..c3aa3e0dd 100644 --- a/nezha-fronted/src/components/common/table/settings/softwareTypeTable.vue +++ b/nezha-fronted/src/components/common/table/settings/softwareTypeTable.vue @@ -52,10 +52,10 @@