From d2ffb055591bb1a8e4b3687ebd750fb8b63b8236 Mon Sep 17 00:00:00 2001 From: cl Date: Thu, 13 May 2021 17:38:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=83=AD=E6=90=9C=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/shop/hotSearch-add-or-update.vue | 22 ++++++++++++------- mall4v/src/views/modules/shop/hotSearch.vue | 2 +- .../admin/controller/HotSearchController.java | 1 - 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mall4v/src/views/modules/shop/hotSearch-add-or-update.vue b/mall4v/src/views/modules/shop/hotSearch-add-or-update.vue index 9796c28..59c98d3 100644 --- a/mall4v/src/views/modules/shop/hotSearch-add-or-update.vue +++ b/mall4v/src/views/modules/shop/hotSearch-add-or-update.vue @@ -84,15 +84,21 @@ export default { }, components: {}, methods: { - init (data) { + init (id) { + this.dataForm.hotSearchId = id || 0 this.visible = true - if (data) { - this.dataForm = Object.assign({}, data) - } else { - this.$nextTick(() => { - this.$refs['dataForm'].resetFields() - }) - } + this.$nextTick(() => { + this.$refs['dataForm'].resetFields() + if (this.dataForm.hotSearchId) { + this.$http({ + url: this.$http.adornUrl('/admin/hotSearch/info/' + this.dataForm.hotSearchId), + method: 'get', + params: this.$http.adornParams() + }).then(({data}) => { + this.dataForm = data + }) + } + }) }, // 表单提交 dataFormSubmit () { diff --git a/mall4v/src/views/modules/shop/hotSearch.vue b/mall4v/src/views/modules/shop/hotSearch.vue index 88d35ae..c70e38d 100644 --- a/mall4v/src/views/modules/shop/hotSearch.vue +++ b/mall4v/src/views/modules/shop/hotSearch.vue @@ -38,7 +38,7 @@ type="primary" size="small" icon="el-icon-edit" - @click="addOrUpdateHandle(scope.row)">修改 + @click="addOrUpdateHandle(scope.row.hotSearchId)">修改 info(@PathVariable("id") Long id){ HotSearch hotSearch = hotSearchService.getById(id); return ResponseEntity.ok(hotSearch);