Просмотр исходного кода

新增通用方法简化模态/缓存使用

RuoYi лет назад: 4
Родитель
Сommit
829451f05e

+ 4 - 4
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm

@@ -448,13 +448,13 @@ export default {
448
 #end
448
 #end
449
           if (this.form.${pkColumn.javaField} != null) {
449
           if (this.form.${pkColumn.javaField} != null) {
450
             update${BusinessName}(this.form).then(response => {
450
             update${BusinessName}(this.form).then(response => {
451
-              this.$modal.msgSuccess("修改成功");
451
+              this.#[[$modal]]#.msgSuccess("修改成功");
452
               this.open = false;
452
               this.open = false;
453
               this.getList();
453
               this.getList();
454
             });
454
             });
455
           } else {
455
           } else {
456
             add${BusinessName}(this.form).then(response => {
456
             add${BusinessName}(this.form).then(response => {
457
-              this.$modal.msgSuccess("新增成功");
457
+              this.#[[$modal]]#.msgSuccess("新增成功");
458
               this.open = false;
458
               this.open = false;
459
               this.getList();
459
               this.getList();
460
             });
460
             });
@@ -464,11 +464,11 @@ export default {
464
     },
464
     },
465
     /** 删除按钮操作 */
465
     /** 删除按钮操作 */
466
     handleDelete(row) {
466
     handleDelete(row) {
467
-      this.$modal.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
467
+      this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
468
         return del${BusinessName}(row.${pkColumn.javaField});
468
         return del${BusinessName}(row.${pkColumn.javaField});
469
       }).then(() => {
469
       }).then(() => {
470
         this.getList();
470
         this.getList();
471
-        this.$modal.msgSuccess("删除成功");
471
+        this.#[[$modal]]#.msgSuccess("删除成功");
472
       }).catch(() => {});
472
       }).catch(() => {});
473
     }
473
     }
474
   }
474
   }

+ 4 - 4
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm

@@ -500,13 +500,13 @@ export default {
500
 #end
500
 #end
501
           if (this.form.${pkColumn.javaField} != null) {
501
           if (this.form.${pkColumn.javaField} != null) {
502
             update${BusinessName}(this.form).then(response => {
502
             update${BusinessName}(this.form).then(response => {
503
-              this.$modal.msgSuccess("修改成功");
503
+              this.#[[$modal]]#.msgSuccess("修改成功");
504
               this.open = false;
504
               this.open = false;
505
               this.getList();
505
               this.getList();
506
             });
506
             });
507
           } else {
507
           } else {
508
             add${BusinessName}(this.form).then(response => {
508
             add${BusinessName}(this.form).then(response => {
509
-              this.$modal.msgSuccess("新增成功");
509
+              this.#[[$modal]]#.msgSuccess("新增成功");
510
               this.open = false;
510
               this.open = false;
511
               this.getList();
511
               this.getList();
512
             });
512
             });
@@ -517,11 +517,11 @@ export default {
517
     /** 删除按钮操作 */
517
     /** 删除按钮操作 */
518
     handleDelete(row) {
518
     handleDelete(row) {
519
       const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids;
519
       const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids;
520
-      this.$modal.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
520
+      this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
521
         return del${BusinessName}(${pkColumn.javaField}s);
521
         return del${BusinessName}(${pkColumn.javaField}s);
522
       }).then(() => {
522
       }).then(() => {
523
         this.getList();
523
         this.getList();
524
-        this.$modal.msgSuccess("删除成功");
524
+        this.#[[$modal]]#.msgSuccess("删除成功");
525
       }).catch(() => {});
525
       }).catch(() => {});
526
     },
526
     },
527
 #if($table.sub)
527
 #if($table.sub)