@@ -36,12 +36,12 @@ Vue.component('module-editor-image401', {
data: function () {
return {
- //
+ form: null
}
},
watch: {
- module: {
+ form: {
handler: function (val) {
this.$emit('on-changed', val);
},
@@ -50,13 +50,13 @@ Vue.component('module-editor-image401', {
},
created: function () {
- //
+ this.form = JSON.parse(JSON.stringify(this.module));
},
methods: {
itemShow(index) {
- this.module.images.find((e, key) => {if (index != key) return e.show = false});
- this.module.images[index].show = !this.module.images[index].show;
+ this.form.images.find((e, key) => {if (index != key) return e.show = false});
+ this.form.images[index].show = !this.form.images[index].show;
},
}
});
diff --git a/resources/beike/admin/views/pages/design/module/product.blade.php b/resources/beike/admin/views/pages/design/module/product.blade.php
index 72cd9d9d..4e1b2659 100644
--- a/resources/beike/admin/views/pages/design/module/product.blade.php
+++ b/resources/beike/admin/views/pages/design/module/product.blade.php
@@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.text_module_title') }}
-
+
{{ __('admin/builder.modules_content') }}
@@ -59,11 +59,12 @@ Vue.component('module-editor-product', {
keyword: '',
productData: [],
loading: null,
+ form: null
}
},
watch: {
- module: {
+ form: {
handler: function (val) {
this.$emit('on-changed', val);
},
@@ -72,6 +73,7 @@ Vue.component('module-editor-product', {
},
created: function () {
+ this.form = JSON.parse(JSON.stringify(this.module));
this.tabsValueProductData();
},
@@ -86,10 +88,10 @@ Vue.component('module-editor-product', {
tabsValueProductData() {
var that = this;
- if (!this.module.products.length) return;
+ if (!this.form.products.length) return;
this.loading = true;
- $http.get('products/names?product_ids='+this.module.products.join(','), {hload: true}).then((res) => {
+ $http.get('products/names?product_ids='+this.form.products.join(','), {hload: true}).then((res) => {
this.loading = false;
that.productData = res.data;
})
@@ -102,20 +104,20 @@ Vue.component('module-editor-product', {
},
handleSelect(item) {
- if (!this.module.products.find(v => v == item.id)) {
- this.module.products.push(item.id * 1);
+ if (!this.form.products.find(v => v == item.id)) {
+ this.form.products.push(item.id * 1);
this.productData.push(item);
}
this.keyword = ""
},
itemChange(evt) {
- this.module.products = this.productData.map(e => e.id * 1);
+ this.form.products = this.productData.map(e => e.id * 1);
},
removeProduct(index) {
this.productData.splice(index, 1)
- this.module.products.splice(index, 1);
+ this.form.products.splice(index, 1);
},
}
});
diff --git a/resources/beike/admin/views/pages/design/module/rich_text.blade.php b/resources/beike/admin/views/pages/design/module/rich_text.blade.php
index 06e3eb32..e2998d7f 100644
--- a/resources/beike/admin/views/pages/design/module/rich_text.blade.php
+++ b/resources/beike/admin/views/pages/design/module/rich_text.blade.php
@@ -3,7 +3,7 @@
{{ __('admin/builder.text_set_up') }}
{{ __('admin/builder.modules_content') }}
-
+
@@ -16,12 +16,12 @@ Vue.component('module-editor-rich-text', {
data: function () {
return {
- //
+ form: null
}
},
watch: {
- module: {
+ form: {
handler: function (val) {
this.$emit('on-changed', val);
},
@@ -30,7 +30,7 @@ Vue.component('module-editor-rich-text', {
},
created: function () {
- //
+ this.form = JSON.parse(JSON.stringify(this.module));
},
methods: {
diff --git a/resources/beike/admin/views/pages/design/module/slideshow.blade.php b/resources/beike/admin/views/pages/design/module/slideshow.blade.php
index e3f86213..3dbdfb3c 100644
--- a/resources/beike/admin/views/pages/design/module/slideshow.blade.php
+++ b/resources/beike/admin/views/pages/design/module/slideshow.blade.php
@@ -3,7 +3,7 @@