diff --git a/src/components/mycomponent/dialog/productDetailDialog.vue b/src/components/mycomponent/dialog/productDetailDialog.vue index 7b19a76..bd6ab97 100644 --- a/src/components/mycomponent/dialog/productDetailDialog.vue +++ b/src/components/mycomponent/dialog/productDetailDialog.vue @@ -1,133 +1,56 @@ @@ -137,11 +60,23 @@ import { infoDialog } from '../../../utils/myUtils/mixins/infoDialog' // 抽离porp 和 methods export default { mixins: [infoDialog], - mounted() { - const id = this.dataInfo.id - productDetail({ id: id }).then(res => { - console.log(res, '----') - }) + data() { + return { + dialogShow: false, + loading: false, + form: null, + imageUrl: this.baseConfig.baseUrl + '/static/' + } + }, + methods: { + initDialog(id) { + this.dialogShow = true + this.loading = true + productDetail({ id: id }).then(res => { + this.form = res + this.loading = false + }) + } } } @@ -149,3 +84,8 @@ + diff --git a/src/components/mycomponent/dialog/productDetailDialog.vue b/src/components/mycomponent/dialog/productDetailDialog.vue index 7b19a76..bd6ab97 100644 --- a/src/components/mycomponent/dialog/productDetailDialog.vue +++ b/src/components/mycomponent/dialog/productDetailDialog.vue @@ -1,133 +1,56 @@ @@ -137,11 +60,23 @@ import { infoDialog } from '../../../utils/myUtils/mixins/infoDialog' // 抽离porp 和 methods export default { mixins: [infoDialog], - mounted() { - const id = this.dataInfo.id - productDetail({ id: id }).then(res => { - console.log(res, '----') - }) + data() { + return { + dialogShow: false, + loading: false, + form: null, + imageUrl: this.baseConfig.baseUrl + '/static/' + } + }, + methods: { + initDialog(id) { + this.dialogShow = true + this.loading = true + productDetail({ id: id }).then(res => { + this.form = res + this.loading = false + }) + } } } @@ -149,3 +84,8 @@ + diff --git a/src/views/product/productList.vue b/src/views/product/productList.vue index 1e62903..309ce79 100644 --- a/src/views/product/productList.vue +++ b/src/views/product/productList.vue @@ -78,7 +78,7 @@ @setLimit="setLimit" /> - + @@ -181,9 +181,9 @@ }, // 详情 handleDetail(row) { - console.log(row) this.isShowDetail = true this.dataInfo = row + this.$refs.detailDialog.initDialog(row.id) }, DetailDialogClose() { this.isShowDetail = false @@ -226,6 +226,9 @@ this.refresh() }) }, + addDialogClose() { + this.refresh() + }, handleBind(row) { console.log(row) this.isBindShow = true