HW il y a 4 ans
Parent
commit
45acc65d0c
1 fichiers modifiés avec 5 ajouts et 4 suppressions
  1. 5 4
      js/component/administration/business/advertisementList.jsx

+ 5 - 4
js/component/administration/business/advertisementList.jsx

@@ -42,9 +42,6 @@ const PicturesWall = React.createClass({
       previewVisible: false,
       previewImage: "",
       fileList: [],
-      locations: [],
-      locationSearch:'',
-      indeterminate:false,
     };
   },
   getDefaultProps() {
@@ -161,6 +158,9 @@ const AdvertisementList = Form.create()(
         purchaseImg: [],
         maximg: "",
         timesArr: [],
+        locations: [],
+        locationSearch:'',
+        indeterminate:false,
         pagination: {
           defaultCurrent: 1,
           defaultPageSize: 10,
@@ -486,7 +486,7 @@ const AdvertisementList = Form.create()(
           id: record ? record.id : this.state.id,
           sort: this.state.sortNumber,
           display: display || this.state.display,
-          locations: this.state.locations.join(','),
+          locations: this.state.locations.length === 0 ? undefined : this.state.locations.join(','),
           position: this.state.position,
           bannerUrl: this.state.bannerUrl
             ? this.state.bannerUrl[0].response.data
@@ -500,6 +500,7 @@ const AdvertisementList = Form.create()(
               message.warning(data.error[0].message);
             }
           } else {
+            message.success('操作成功')
             this.cancelAdd();
           }
         }.bind(this)