|
@@ -167,24 +167,27 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleConfirm() {
|
|
|
- this.$refs.form.validate(async valid => {
|
|
|
- if (valid) {
|
|
|
- let params = Object.assign({}, this.form);
|
|
|
- params.cover = this.form.cover[0] && this.form.cover[0].url;
|
|
|
- params.previewLogo = this.form.previewLogo[0] && this.form.previewLogo[0].url;
|
|
|
- params.hdLogo = this.form.hdLogo[0] && this.form.hdLogo[0].url;
|
|
|
- params.eventStartDate = this.form.eventTimeArr[0];
|
|
|
- params.eventEndDate = this.form.eventTimeArr[1];
|
|
|
-
|
|
|
- if (this.id) params.id = this.id;
|
|
|
-
|
|
|
- const { success, msg } = await saveItem(params);
|
|
|
-
|
|
|
- if (success) {
|
|
|
- this.$success('保存成功!');
|
|
|
- this.modal = false;
|
|
|
- this.$g_emit('activity_reload');
|
|
|
- }
|
|
|
+ let _that = this
|
|
|
+ _that.$refs.form.validate(async valid => {
|
|
|
+ if (!valid) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ let params = Object.assign({}, _that.form);
|
|
|
+ params.cover = (_that.form.cover && _that.form.cover.length > 0) && _that.form.cover[0].url;
|
|
|
+ params.previewLogo = (_that.form.previewLogo && _that.form.previewLogo.length > 0) && _that.form.previewLogo[0].url;
|
|
|
+ params.hdLogo = (_that.form.hdLogo && _that.form.hdLogo.length > 0) && _that.form.hdLogo[0].url;
|
|
|
+ params.eventStartDate = _that.form.eventTimeArr[0];
|
|
|
+ params.eventEndDate = _that.form.eventTimeArr[1];
|
|
|
+
|
|
|
+ if (_that.id) params.id = _that.id;
|
|
|
+
|
|
|
+ const { success, msg } = await saveItem(params);
|
|
|
+
|
|
|
+ if (success) {
|
|
|
+ _that.$success('保存成功!');
|
|
|
+ _that.modal = false;
|
|
|
+ _that.$g_emit('activity_reload');
|
|
|
}
|
|
|
});
|
|
|
}
|