作者 RuoYi

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

@@ -448,13 +448,13 @@ export default { @@ -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,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 }
@@ -503,13 +503,13 @@ export default { @@ -503,13 +503,13 @@ export default {
503 #end 503 #end
504 if (this.form.${pkColumn.javaField} != null) { 504 if (this.form.${pkColumn.javaField} != null) {
505 update${BusinessName}(this.form).then(response => { 505 update${BusinessName}(this.form).then(response => {
506 - this.$modal.msgSuccess("修改成功"); 506 + this.#[[$modal]]#.msgSuccess("修改成功");
507 this.open = false; 507 this.open = false;
508 this.getList(); 508 this.getList();
509 }); 509 });
510 } else { 510 } else {
511 add${BusinessName}(this.form).then(response => { 511 add${BusinessName}(this.form).then(response => {
512 - this.$modal.msgSuccess("新增成功"); 512 + this.#[[$modal]]#.msgSuccess("新增成功");
513 this.open = false; 513 this.open = false;
514 this.getList(); 514 this.getList();
515 }); 515 });
@@ -520,11 +520,11 @@ export default { @@ -520,11 +520,11 @@ export default {
520 /** 删除按钮操作 */ 520 /** 删除按钮操作 */
521 handleDelete(row) { 521 handleDelete(row) {
522 const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids; 522 const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids;
523 - this.$modal.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() { 523 + this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
524 return del${BusinessName}(${pkColumn.javaField}s); 524 return del${BusinessName}(${pkColumn.javaField}s);
525 }).then(() => { 525 }).then(() => {
526 this.getList(); 526 this.getList();
527 - this.$modal.msgSuccess("删除成功"); 527 + this.#[[$modal]]#.msgSuccess("删除成功");
528 }).catch(() => {}); 528 }).catch(() => {});
529 }, 529 },
530 #if($table.sub) 530 #if($table.sub)
@@ -563,7 +563,7 @@ export default { @@ -563,7 +563,7 @@ export default {
563 /** 导出按钮操作 */ 563 /** 导出按钮操作 */
564 handleExport() { 564 handleExport() {
565 const queryParams = this.queryParams; 565 const queryParams = this.queryParams;
566 - this.$modal.confirm('是否确认导出所有${functionName}数据项?').then(() => { 566 + this.#[[$modal]]#.confirm('是否确认导出所有${functionName}数据项?').then(() => {
567 this.exportLoading = true; 567 this.exportLoading = true;
568 return export${BusinessName}(queryParams); 568 return export${BusinessName}(queryParams);
569 }).then(response => { 569 }).then(response => {