From b90802beee0f37692221f4f423bb45794ea827c4 Mon Sep 17 00:00:00 2001 From: wangwenrui Date: Fri, 14 Aug 2020 11:55:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:asset=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2vendor=E5=92=8CassetType=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E9=99=90=E5=88=B6=20&=20model=E4=BF=9D?= =?UTF-8?q?=E5=AD=98bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/rightBox/assetBox.vue | 6 ++--- .../components/common/rightBox/modelBox.vue | 23 ++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) 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;