diff --git a/nezha-fronted/src/components/common/rightBox/assetBox.vue b/nezha-fronted/src/components/common/rightBox/assetBox.vue index a678ff92f..e0f310490 100644 --- a/nezha-fronted/src/components/common/rightBox/assetBox.vue +++ b/nezha-fronted/src/components/common/rightBox/assetBox.vue @@ -313,7 +313,7 @@ }, getVendorData() { return new Promise(resolve => { - this.$get('sys/dict/all?type=vendor').then(response => { + this.$get('sys/dict/all?type=vendor&pageSize=-1').then(response => { if (response.code === 200) { this.vendorData = response.data; } @@ -323,7 +323,7 @@ }, getModelData(assetType) { return new Promise(resolve => { - let url = assetType ? ('model?typeCode=' + assetType) : 'model'; + let url = assetType ? ('model?typeCode=' + assetType+'&pageSize=-1') : 'model?pageSize=-1'; this.$get(url).then(response => { if (response.code === 200) { this.modelData = response.data.list; @@ -501,7 +501,7 @@ }, getAssetTypeData() { return new Promise(resolve => { - this.$get('sys/dict/all?type=assetType').then(response => { + this.$get('sys/dict/all?type=assetType&pageSize=-1').then(response => { if (response.code === 200) { this.assetTypeData = response.data; } diff --git a/nezha-fronted/src/components/common/rightBox/modelBox.vue b/nezha-fronted/src/components/common/rightBox/modelBox.vue index 8f41b88b3..8be734647 100644 --- a/nezha-fronted/src/components/common/rightBox/modelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/modelBox.vue @@ -238,7 +238,7 @@ }, saveType(item) { return new Promise(resolve => { - if (this.editingType) { + if (this.editingType) { //下拉选中的编辑 let temp = Object.assign({}, item); temp.value = this.editingType; this.$post('sys/dict/update', temp).then(response => { @@ -254,6 +254,17 @@ this.$message.error(response.msg); } }); + }else{ + this.$post('sys/dict/save', item).then(response => { + if (response.code === 200) { + this.editModel.typeCode=response.data.dictEntity.code; + this.$emit("reload"); + this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); + resolve(); + } else { + this.$message.error(response.msg); + } + }); } }); }, @@ -283,11 +294,7 @@ } else { this.$post('sys/dict/save', item).then(response => { if (response.code === 200) { - item.value = this.editingVendor; - item.isEdit = false; - if (this.editModel.vendor.id == item.id) { - this.editModel.vendor.value = item.value; - } + this.editModel.vendorCode=response.data.dictEntity.code; this.$emit("reload"); this.$message({duration: 1000, type: 'success', message: this.$t("tip.saveSuccess")}); resolve(); @@ -316,7 +323,7 @@ }); }, getVendorData() { - this.$get('sys/dict/all?type=vendor').then(response => { + this.$get('sys/dict/all?type=vendor&pageSize=-1').then(response => { if (response.code === 200) { this.vendorData = response.data.map((item) => { item.isEdit = false; @@ -326,7 +333,7 @@ }); }, getTypeData() { - this.$get('sys/dict/all?type=assetType').then(response => { + this.$get('sys/dict/all?type=assetType&pageSize=-1').then(response => { if (response.code === 200) { this.typeData = response.data.map((item) => { item.isEdit = false;