|
@@ -494,22 +494,26 @@ export default {
|
494
|
494
|
};
|
495
|
495
|
},
|
496
|
496
|
toSaveAdd() {
|
497
|
|
- n_save({
|
498
|
|
- newstitle: this.addForm.newstitle,
|
499
|
|
- newscontent: this.addForm.newscontent,
|
500
|
|
- newssummary: this.addForm.newssummary,
|
501
|
|
- newspic: this.addForm.newspic,
|
502
|
|
- ltype: this.addForm.ltype,
|
503
|
|
- newsorder: this.addForm.newsorder,
|
504
|
|
- newsup: this.addForm.newsup,
|
505
|
|
- createid: this.userInfo.userid
|
506
|
|
- }).then((res) => {
|
507
|
|
- this.addForm.show = false;
|
508
|
|
- if (res.code === 0) {
|
509
|
|
- this.$Message.success(res.msg);
|
510
|
|
- this.searchList();
|
511
|
|
- } else {
|
512
|
|
- this.$Message.error(res.msg);
|
|
497
|
+ this.$refs.addForm.validate((valid) => {
|
|
498
|
+ if (valid) {
|
|
499
|
+ n_save({
|
|
500
|
+ newstitle: this.addForm.newstitle,
|
|
501
|
+ newscontent: this.addForm.newscontent,
|
|
502
|
+ newssummary: this.addForm.newssummary,
|
|
503
|
+ newspic: this.addForm.newspic,
|
|
504
|
+ ltype: this.addForm.ltype,
|
|
505
|
+ newsorder: this.addForm.newsorder,
|
|
506
|
+ newsup: this.addForm.newsup,
|
|
507
|
+ createid: this.userInfo.userid
|
|
508
|
+ }).then((res) => {
|
|
509
|
+ this.addForm.show = false;
|
|
510
|
+ if (res.code === 0) {
|
|
511
|
+ this.$Message.success(res.msg);
|
|
512
|
+ this.searchList();
|
|
513
|
+ } else {
|
|
514
|
+ this.$Message.error(res.msg);
|
|
515
|
+ }
|
|
516
|
+ });
|
513
|
517
|
}
|
514
|
518
|
});
|
515
|
519
|
},
|
|
@@ -526,21 +530,25 @@ export default {
|
526
|
530
|
};
|
527
|
531
|
},
|
528
|
532
|
toSaveModify() {
|
529
|
|
- n_update({
|
530
|
|
- newstitle: this.modifyForm.newstitle,
|
531
|
|
- newscontent: this.modifyForm.newscontent,
|
532
|
|
- newssummary: this.modifyForm.newssummary,
|
533
|
|
- newspic: this.modifyForm.newspic,
|
534
|
|
- newsorder: this.modifyForm.newsorder,
|
535
|
|
- newsup: this.modifyForm.newsup,
|
536
|
|
- newsid: this.modifyForm.newsid
|
537
|
|
- }).then((res) => {
|
538
|
|
- this.modifyForm.show = false;
|
539
|
|
- if (res.code === 0) {
|
540
|
|
- this.$Message.success(res.msg);
|
541
|
|
- this.searchList();
|
542
|
|
- } else {
|
543
|
|
- this.$Message.error(res.msg);
|
|
533
|
+ this.$refs.modifyForm.validate((valid) => {
|
|
534
|
+ if (valid) {
|
|
535
|
+ n_update({
|
|
536
|
+ newstitle: this.modifyForm.newstitle,
|
|
537
|
+ newscontent: this.modifyForm.newscontent,
|
|
538
|
+ newssummary: this.modifyForm.newssummary,
|
|
539
|
+ newspic: this.modifyForm.newspic,
|
|
540
|
+ newsorder: this.modifyForm.newsorder,
|
|
541
|
+ newsup: this.modifyForm.newsup,
|
|
542
|
+ newsid: this.modifyForm.newsid
|
|
543
|
+ }).then((res) => {
|
|
544
|
+ this.modifyForm.show = false;
|
|
545
|
+ if (res.code === 0) {
|
|
546
|
+ this.$Message.success(res.msg);
|
|
547
|
+ this.searchList();
|
|
548
|
+ } else {
|
|
549
|
+ this.$Message.error(res.msg);
|
|
550
|
+ }
|
|
551
|
+ });
|
544
|
552
|
}
|
545
|
553
|
});
|
546
|
554
|
},
|