Преглед на файлове

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

RuoYi преди 4 години
родител
ревизия
cae41a8da2
променени са 30 файла, в които са добавени 364 реда и са изтрити 325 реда
  1. 8 12
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm
  2. 8 12
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
  3. 5 17
      ruoyi-ui/src/layout/components/Settings/index.vue
  4. 3 12
      ruoyi-ui/src/main.js
  5. 77 0
      ruoyi-ui/src/plugins/cache.js
  6. 11 0
      ruoyi-ui/src/plugins/index.js
  7. 75 0
      ruoyi-ui/src/plugins/modal.js
  8. 20 32
      ruoyi-ui/src/views/monitor/job/index.vue
  9. 12 20
      ruoyi-ui/src/views/monitor/job/log.vue
  10. 6 10
      ruoyi-ui/src/views/monitor/online/index.vue
  11. 5 9
      ruoyi-ui/src/views/system/config/index.vue
  12. 8 12
      ruoyi-ui/src/views/system/dept/index.vue
  13. 8 12
      ruoyi-ui/src/views/system/dict/data.vue
  14. 9 13
      ruoyi-ui/src/views/system/dict/index.vue
  15. 12 20
      ruoyi-ui/src/views/system/logininfor/index.vue
  16. 8 12
      ruoyi-ui/src/views/system/menu/index.vue
  17. 8 12
      ruoyi-ui/src/views/system/notice/index.vue
  18. 12 20
      ruoyi-ui/src/views/system/operlog/index.vue
  19. 8 12
      ruoyi-ui/src/views/system/post/index.vue
  20. 5 13
      ruoyi-ui/src/views/system/role/authUser.vue
  21. 16 24
      ruoyi-ui/src/views/system/role/index.vue
  22. 1 1
      ruoyi-ui/src/views/system/role/selectUser.vue
  23. 1 1
      ruoyi-ui/src/views/system/user/authRole.vue
  24. 16 24
      ruoyi-ui/src/views/system/user/index.vue
  25. 1 1
      ruoyi-ui/src/views/system/user/profile/resetPwd.vue
  26. 2 2
      ruoyi-ui/src/views/system/user/profile/userAvatar.vue
  27. 1 1
      ruoyi-ui/src/views/system/user/profile/userInfo.vue
  28. 2 2
      ruoyi-ui/src/views/tool/gen/editTable.vue
  29. 7 2
      ruoyi-ui/src/views/tool/gen/importTable.vue
  30. 9 17
      ruoyi-ui/src/views/tool/gen/index.vue

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

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

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

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

+ 5 - 17
ruoyi-ui/src/layout/components/Settings/index.vue

@@ -162,14 +162,8 @@ export default {
162 162
       this.sideTheme = val;
163 163
     },
164 164
     saveSetting() {
165
-      const loading = this.$loading({
166
-        lock: true,
167
-        fullscreen: false,
168
-        text: "正在保存到本地,请稍后...",
169
-        spinner: "el-icon-loading",
170
-        background: "rgba(0, 0, 0, 0.7)"
171
-      });
172
-      localStorage.setItem(
165
+      this.$modal.loading("正在保存到本地,请稍后...");
166
+      this.$cache.local.set(
173 167
         "layout-setting",
174 168
         `{
175 169
             "topNav":${this.topNav},
@@ -181,17 +175,11 @@ export default {
181 175
             "theme":"${this.theme}"
182 176
           }`
183 177
       );
184
-      setTimeout(loading.close(), 1000)
178
+      setTimeout(this.$modal.closeLoading(), 1000)
185 179
     },
186 180
     resetSetting() {
187
-      this.$loading({
188
-        lock: true,
189
-        fullscreen: false,
190
-        text: "正在清除设置缓存并刷新,请稍后...",
191
-        spinner: "el-icon-loading",
192
-        background: "rgba(0, 0, 0, 0.7)"
193
-      });
194
-      localStorage.removeItem("layout-setting")
181
+      this.$modal.loading("正在清除设置缓存并刷新,请稍后...");
182
+      this.$cache.local.remove("layout-setting")
195 183
       setTimeout("window.location.reload()", 1000)
196 184
     }
197 185
   }

+ 3 - 12
ruoyi-ui/src/main.js

@@ -11,6 +11,7 @@ import App from './App'
11 11
 import store from './store'
12 12
 import router from './router'
13 13
 import directive from './directive' //directive
14
+import plugins from './plugins' // plugins
14 15
 import { download } from '@/utils/request'
15 16
 
16 17
 import './assets/icons' // icon
@@ -18,6 +19,7 @@ import './permission' // permission control
18 19
 import { getDicts } from "@/api/system/dict/data";
19 20
 import { getConfigKey } from "@/api/system/config";
20 21
 import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
22
+// 分页组件
21 23
 import Pagination from "@/components/Pagination";
22 24
 // 自定义表格工具组件
23 25
 import RightToolbar from "@/components/RightToolbar"
@@ -45,18 +47,6 @@ Vue.prototype.selectDictLabels = selectDictLabels
45 47
 Vue.prototype.download = download
46 48
 Vue.prototype.handleTree = handleTree
47 49
 
48
-Vue.prototype.msgSuccess = function (msg) {
49
-  this.$message({ showClose: true, message: msg, type: "success" });
50
-}
51
-
52
-Vue.prototype.msgError = function (msg) {
53
-  this.$message({ showClose: true, message: msg, type: "error" });
54
-}
55
-
56
-Vue.prototype.msgInfo = function (msg) {
57
-  this.$message.info(msg);
58
-}
59
-
60 50
 // 全局组件挂载
61 51
 Vue.component('DictTag', DictTag)
62 52
 Vue.component('Pagination', Pagination)
@@ -66,6 +56,7 @@ Vue.component('FileUpload', FileUpload)
66 56
 Vue.component('ImageUpload', ImageUpload)
67 57
 
68 58
 Vue.use(directive)
59
+Vue.use(plugins)
69 60
 Vue.use(VueMeta)
70 61
 DictData.install()
71 62
 

+ 77 - 0
ruoyi-ui/src/plugins/cache.js

@@ -0,0 +1,77 @@
1
+const sessionCache = {
2
+  set (key, value) {
3
+    if (!sessionStorage) {
4
+      return
5
+    }
6
+    if (key != null && value != null) {
7
+      sessionStorage.setItem(key, value)
8
+    }
9
+  },
10
+  get (key) {
11
+    if (!sessionStorage) {
12
+      return null
13
+    }
14
+    if (key == null) {
15
+      return null
16
+    }
17
+    return sessionStorage.getItem(key)
18
+  },
19
+  setJSON (key, jsonValue) {
20
+    if (jsonValue != null) {
21
+      this.set(key, JSON.stringify(jsonValue))
22
+    }
23
+  },
24
+  getJSON (key) {
25
+    const value = this.get(key)
26
+    if (value != null) {
27
+      return JSON.parse(value)
28
+    }
29
+  },
30
+  remove (key) {
31
+    sessionStorage.removeItem(key);
32
+  }
33
+}
34
+const localCache = {
35
+  set (key, value) {
36
+    if (!localStorage) {
37
+      return
38
+    }
39
+    if (key != null && value != null) {
40
+      localStorage.setItem(key, value)
41
+    }
42
+  },
43
+  get (key) {
44
+    if (!localStorage) {
45
+      return null
46
+    }
47
+    if (key == null) {
48
+      return null
49
+    }
50
+    return localStorage.getItem(key)
51
+  },
52
+  setJSON (key, jsonValue) {
53
+    if (jsonValue != null) {
54
+      this.set(key, JSON.stringify(jsonValue))
55
+    }
56
+  },
57
+  getJSON (key) {
58
+    const value = this.get(key)
59
+    if (value != null) {
60
+      return JSON.parse(value)
61
+    }
62
+  },
63
+  remove (key) {
64
+    localStorage.removeItem(key);
65
+  }
66
+}
67
+
68
+export default {
69
+  /**
70
+   * 会话级缓存
71
+   */
72
+  session: sessionCache,
73
+  /**
74
+   * 本地缓存
75
+   */
76
+  local: localCache
77
+}

+ 11 - 0
ruoyi-ui/src/plugins/index.js

@@ -0,0 +1,11 @@
1
+import cache from './cache'
2
+import modal from './modal'
3
+
4
+export default {
5
+  install(Vue) {
6
+    // 缓存对象
7
+    Vue.prototype.$cache = cache
8
+    // 模态框对象
9
+    Vue.prototype.$modal = modal
10
+  }
11
+}

+ 75 - 0
ruoyi-ui/src/plugins/modal.js

@@ -0,0 +1,75 @@
1
+import { Message, MessageBox, Notification, Loading } from 'element-ui'
2
+
3
+let loadingInstance;
4
+
5
+export default {
6
+  // 消息提示
7
+  msg(content) {
8
+    Message.info(content)
9
+  },
10
+  // 错误消息
11
+  msgError(content) {
12
+    Message.error(content)
13
+  },
14
+  // 成功消息
15
+  msgSuccess(content) {
16
+    Message.success(content)
17
+  },
18
+  // 警告消息
19
+  msgWarning(content) {
20
+    Message.warning(content)
21
+  },
22
+  // 弹出提示
23
+  alert(content) {
24
+    MessageBox.alert(content, "系统提示")
25
+  },
26
+  // 错误提示
27
+  alertError(content) {
28
+    MessageBox.alert(content, "系统提示", { type: 'error' })
29
+  },
30
+  // 成功提示
31
+  alertSuccess(content) {
32
+    MessageBox.alert(content, "系统提示", { type: 'success' })
33
+  },
34
+  // 警告提示
35
+  alertWarning(content) {
36
+    MessageBox.alert(content, "系统提示", { type: 'warning' })
37
+  },
38
+  // 通知提示
39
+  notify(content) {
40
+    Notification.info(content)
41
+  },
42
+  // 错误通知
43
+  notifyError(content) {
44
+    Notification.error(content);
45
+  },
46
+  // 成功通知
47
+  notifySuccess(content) {
48
+    Notification.success(content)
49
+  },
50
+  // 警告通知
51
+  notifyWarning(content) {
52
+    Notification.warning(content)
53
+  },
54
+  // 确认窗体
55
+  confirm(content) {
56
+    return MessageBox.confirm(content, "系统提示", {
57
+      confirmButtonText: '确定',
58
+      cancelButtonText: '取消',
59
+      type: "warning",
60
+    })
61
+  },
62
+  // 打开遮罩层
63
+  loading(content) {
64
+    loadingInstance = Loading.service({
65
+      lock: true,
66
+      text: content,
67
+      spinner: "el-icon-loading",
68
+      background: "rgba(0, 0, 0, 0.7)",
69
+    })
70
+  },
71
+  // 关闭遮罩层
72
+  closeLoading() {
73
+    loadingInstance.close();
74
+  }
75
+}

+ 20 - 32
ruoyi-ui/src/views/monitor/job/index.vue

@@ -422,29 +422,21 @@ export default {
422 422
     // 任务状态修改
423 423
     handleStatusChange(row) {
424 424
       let text = row.status === "0" ? "启用" : "停用";
425
-      this.$confirm('确认要"' + text + '""' + row.jobName + '"任务吗?', "警告", {
426
-          confirmButtonText: "确定",
427
-          cancelButtonText: "取消",
428
-          type: "warning"
429
-        }).then(function() {
430
-          return changeJobStatus(row.jobId, row.status);
431
-        }).then(() => {
432
-          this.msgSuccess(text + "成功");
433
-        }).catch(function() {
434
-          row.status = row.status === "0" ? "1" : "0";
435
-        });
425
+      this.$modal.confirm('确认要"' + text + '""' + row.jobName + '"任务吗?').then(function() {
426
+        return changeJobStatus(row.jobId, row.status);
427
+      }).then(() => {
428
+        this.$modal.msgSuccess(text + "成功");
429
+      }).catch(function() {
430
+        row.status = row.status === "0" ? "1" : "0";
431
+      });
436 432
     },
437 433
     /* 立即执行一次 */
438 434
     handleRun(row) {
439
-      this.$confirm('确认要立即执行一次"' + row.jobName + '"任务吗?', "警告", {
440
-          confirmButtonText: "确定",
441
-          cancelButtonText: "取消",
442
-          type: "warning"
443
-        }).then(function() {
444
-          return runJob(row.jobId, row.jobGroup);
445
-        }).then(() => {
446
-          this.msgSuccess("执行成功");
447
-        }).catch(() => {});
435
+      this.$modal.confirm('确认要立即执行一次"' + row.jobName + '"任务吗?').then(function() {
436
+        return runJob(row.jobId, row.jobGroup);
437
+      }).then(() => {
438
+        this.$modal.msgSuccess("执行成功");
439
+      }).catch(() => {});
448 440
     },
449 441
     /** 任务详细信息 */
450 442
     handleView(row) {
@@ -489,13 +481,13 @@ export default {
489 481
         if (valid) {
490 482
           if (this.form.jobId != undefined) {
491 483
             updateJob(this.form).then(response => {
492
-              this.msgSuccess("修改成功");
484
+              this.$modal.msgSuccess("修改成功");
493 485
               this.open = false;
494 486
               this.getList();
495 487
             });
496 488
           } else {
497 489
             addJob(this.form).then(response => {
498
-              this.msgSuccess("新增成功");
490
+              this.$modal.msgSuccess("新增成功");
499 491
               this.open = false;
500 492
               this.getList();
501 493
             });
@@ -506,16 +498,12 @@ export default {
506 498
     /** 删除按钮操作 */
507 499
     handleDelete(row) {
508 500
       const jobIds = row.jobId || this.ids;
509
-      this.$confirm('是否确认删除定时任务编号为"' + jobIds + '"的数据项?', "警告", {
510
-          confirmButtonText: "确定",
511
-          cancelButtonText: "取消",
512
-          type: "warning"
513
-        }).then(function() {
514
-          return delJob(jobIds);
515
-        }).then(() => {
516
-          this.getList();
517
-          this.msgSuccess("删除成功");
518
-        }).catch(() => {});
501
+      this.$modal.confirm('是否确认删除定时任务编号为"' + jobIds + '"的数据项?').then(function() {
502
+        return delJob(jobIds);
503
+      }).then(() => {
504
+        this.getList();
505
+        this.$modal.msgSuccess("删除成功");
506
+      }).catch(() => {});
519 507
     },
520 508
     /** 导出按钮操作 */
521 509
     handleExport() {

+ 12 - 20
ruoyi-ui/src/views/monitor/job/log.vue

@@ -272,29 +272,21 @@ export default {
272 272
     /** 删除按钮操作 */
273 273
     handleDelete(row) {
274 274
       const jobLogIds = this.ids;
275
-      this.$confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?', "警告", {
276
-          confirmButtonText: "确定",
277
-          cancelButtonText: "取消",
278
-          type: "warning"
279
-        }).then(function() {
280
-          return delJobLog(jobLogIds);
281
-        }).then(() => {
282
-          this.getList();
283
-          this.msgSuccess("删除成功");
284
-        }).catch(() => {});
275
+      this.$modal.confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?').then(function() {
276
+        return delJobLog(jobLogIds);
277
+      }).then(() => {
278
+        this.getList();
279
+        this.$modal.msgSuccess("删除成功");
280
+      }).catch(() => {});
285 281
     },
286 282
     /** 清空按钮操作 */
287 283
     handleClean() {
288
-      this.$confirm("是否确认清空所有调度日志数据项?", "警告", {
289
-          confirmButtonText: "确定",
290
-          cancelButtonText: "取消",
291
-          type: "warning"
292
-        }).then(function() {
293
-          return cleanJobLog();
294
-        }).then(() => {
295
-          this.getList();
296
-          this.msgSuccess("清空成功");
297
-        }).catch(() => {});
284
+      this.$modal.confirm('是否确认清空所有调度日志数据项?').then(function() {
285
+        return cleanJobLog();
286
+      }).then(() => {
287
+        this.getList();
288
+        this.$modal.msgSuccess("清空成功");
289
+      }).catch(() => {});
298 290
     },
299 291
     /** 导出按钮操作 */
300 292
     handleExport() {

+ 6 - 10
ruoyi-ui/src/views/monitor/online/index.vue

@@ -107,16 +107,12 @@ export default {
107 107
     },
108 108
     /** 强退按钮操作 */
109 109
     handleForceLogout(row) {
110
-      this.$confirm('是否确认强退名称为"' + row.userName + '"的数据项?', "警告", {
111
-          confirmButtonText: "确定",
112
-          cancelButtonText: "取消",
113
-          type: "warning"
114
-        }).then(function() {
115
-          return forceLogout(row.tokenId);
116
-        }).then(() => {
117
-          this.getList();
118
-          this.msgSuccess("强退成功");
119
-        }).catch(() => {});
110
+      this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的数据项?').then(function() {
111
+        return forceLogout(row.tokenId);
112
+      }).then(() => {
113
+        this.getList();
114
+        this.$modal.msgSuccess("强退成功");
115
+      }).catch(() => {});
120 116
     }
121 117
   }
122 118
 };

+ 5 - 9
ruoyi-ui/src/views/system/config/index.vue

@@ -305,13 +305,13 @@ export default {
305 305
         if (valid) {
306 306
           if (this.form.configId != undefined) {
307 307
             updateConfig(this.form).then(response => {
308
-              this.msgSuccess("修改成功");
308
+              this.$modal.msgSuccess("修改成功");
309 309
               this.open = false;
310 310
               this.getList();
311 311
             });
312 312
           } else {
313 313
             addConfig(this.form).then(response => {
314
-              this.msgSuccess("新增成功");
314
+              this.$modal.msgSuccess("新增成功");
315 315
               this.open = false;
316 316
               this.getList();
317 317
             });
@@ -322,15 +322,11 @@ export default {
322 322
     /** 删除按钮操作 */
323 323
     handleDelete(row) {
324 324
       const configIds = row.configId || this.ids;
325
-      this.$confirm('是否确认删除参数编号为"' + configIds + '"的数据项?', "警告", {
326
-          confirmButtonText: "确定",
327
-          cancelButtonText: "取消",
328
-          type: "warning"
329
-        }).then(function() {
325
+      this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function() {
330 326
           return delConfig(configIds);
331 327
         }).then(() => {
332 328
           this.getList();
333
-          this.msgSuccess("删除成功");
329
+          this.$modal.msgSuccess("删除成功");
334 330
         }).catch(() => {});
335 331
     },
336 332
     /** 导出按钮操作 */
@@ -342,7 +338,7 @@ export default {
342 338
     /** 刷新缓存按钮操作 */
343 339
     handleRefreshCache() {
344 340
       refreshCache().then(() => {
345
-        this.msgSuccess("刷新成功");
341
+        this.$modal.msgSuccess("刷新成功");
346 342
       });
347 343
     }
348 344
   }

+ 8 - 12
ruoyi-ui/src/views/system/dept/index.vue

@@ -305,13 +305,13 @@ export default {
305 305
         if (valid) {
306 306
           if (this.form.deptId != undefined) {
307 307
             updateDept(this.form).then(response => {
308
-              this.msgSuccess("修改成功");
308
+              this.$modal.msgSuccess("修改成功");
309 309
               this.open = false;
310 310
               this.getList();
311 311
             });
312 312
           } else {
313 313
             addDept(this.form).then(response => {
314
-              this.msgSuccess("新增成功");
314
+              this.$modal.msgSuccess("新增成功");
315 315
               this.open = false;
316 316
               this.getList();
317 317
             });
@@ -321,16 +321,12 @@ export default {
321 321
     },
322 322
     /** 删除按钮操作 */
323 323
     handleDelete(row) {
324
-      this.$confirm('是否确认删除名称为"' + row.deptName + '"的数据项?', "警告", {
325
-          confirmButtonText: "确定",
326
-          cancelButtonText: "取消",
327
-          type: "warning"
328
-        }).then(function() {
329
-          return delDept(row.deptId);
330
-        }).then(() => {
331
-          this.getList();
332
-          this.msgSuccess("删除成功");
333
-        }).catch(() => {});
324
+      this.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
325
+        return delDept(row.deptId);
326
+      }).then(() => {
327
+        this.getList();
328
+        this.$modal.msgSuccess("删除成功");
329
+      }).catch(() => {});
334 330
     }
335 331
   }
336 332
 };

+ 8 - 12
ruoyi-ui/src/views/system/dict/data.vue

@@ -351,13 +351,13 @@ export default {
351 351
         if (valid) {
352 352
           if (this.form.dictCode != undefined) {
353 353
             updateData(this.form).then(response => {
354
-              this.msgSuccess("修改成功");
354
+              this.$modal.msgSuccess("修改成功");
355 355
               this.open = false;
356 356
               this.getList();
357 357
             });
358 358
           } else {
359 359
             addData(this.form).then(response => {
360
-              this.msgSuccess("新增成功");
360
+              this.$modal.msgSuccess("新增成功");
361 361
               this.open = false;
362 362
               this.getList();
363 363
             });
@@ -368,16 +368,12 @@ export default {
368 368
     /** 删除按钮操作 */
369 369
     handleDelete(row) {
370 370
       const dictCodes = row.dictCode || this.ids;
371
-      this.$confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?', "警告", {
372
-          confirmButtonText: "确定",
373
-          cancelButtonText: "取消",
374
-          type: "warning"
375
-        }).then(function() {
376
-          return delData(dictCodes);
377
-        }).then(() => {
378
-          this.getList();
379
-          this.msgSuccess("删除成功");
380
-        }).catch(() => {});
371
+      this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
372
+        return delData(dictCodes);
373
+      }).then(() => {
374
+        this.getList();
375
+        this.$modal.msgSuccess("删除成功");
376
+      }).catch(() => {});
381 377
     },
382 378
     /** 导出按钮操作 */
383 379
     handleExport() {

+ 9 - 13
ruoyi-ui/src/views/system/dict/index.vue

@@ -309,13 +309,13 @@ export default {
309 309
         if (valid) {
310 310
           if (this.form.dictId != undefined) {
311 311
             updateType(this.form).then(response => {
312
-              this.msgSuccess("修改成功");
312
+              this.$modal.msgSuccess("修改成功");
313 313
               this.open = false;
314 314
               this.getList();
315 315
             });
316 316
           } else {
317 317
             addType(this.form).then(response => {
318
-              this.msgSuccess("新增成功");
318
+              this.$modal.msgSuccess("新增成功");
319 319
               this.open = false;
320 320
               this.getList();
321 321
             });
@@ -326,16 +326,12 @@ export default {
326 326
     /** 删除按钮操作 */
327 327
     handleDelete(row) {
328 328
       const dictIds = row.dictId || this.ids;
329
-      this.$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', "警告", {
330
-          confirmButtonText: "确定",
331
-          cancelButtonText: "取消",
332
-          type: "warning"
333
-        }).then(function() {
334
-          return delType(dictIds);
335
-        }).then(() => {
336
-          this.getList();
337
-          this.msgSuccess("删除成功");
338
-        }).catch(() => {});
329
+      this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
330
+        return delType(dictIds);
331
+      }).then(() => {
332
+        this.getList();
333
+        this.$modal.msgSuccess("删除成功");
334
+      }).catch(() => {});
339 335
     },
340 336
     /** 导出按钮操作 */
341 337
     handleExport() {
@@ -346,7 +342,7 @@ export default {
346 342
     /** 刷新缓存按钮操作 */
347 343
     handleRefreshCache() {
348 344
       refreshCache().then(() => {
349
-        this.msgSuccess("刷新成功");
345
+        this.$modal.msgSuccess("刷新成功");
350 346
       });
351 347
     }
352 348
   }

+ 12 - 20
ruoyi-ui/src/views/system/logininfor/index.vue

@@ -192,29 +192,21 @@ export default {
192 192
     /** 删除按钮操作 */
193 193
     handleDelete(row) {
194 194
       const infoIds = row.infoId || this.ids;
195
-      this.$confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?', "警告", {
196
-          confirmButtonText: "确定",
197
-          cancelButtonText: "取消",
198
-          type: "warning"
199
-        }).then(function() {
200
-          return delLogininfor(infoIds);
201
-        }).then(() => {
202
-          this.getList();
203
-          this.msgSuccess("删除成功");
204
-        }).catch(() => {});
195
+      this.$modal.confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?').then(function() {
196
+        return delLogininfor(infoIds);
197
+      }).then(() => {
198
+        this.getList();
199
+        this.$modal.msgSuccess("删除成功");
200
+      }).catch(() => {});
205 201
     },
206 202
     /** 清空按钮操作 */
207 203
     handleClean() {
208
-        this.$confirm('是否确认清空所有登录日志数据项?', "警告", {
209
-          confirmButtonText: "确定",
210
-          cancelButtonText: "取消",
211
-          type: "warning"
212
-        }).then(function() {
213
-          return cleanLogininfor();
214
-        }).then(() => {
215
-          this.getList();
216
-          this.msgSuccess("清空成功");
217
-        }).catch(() => {});
204
+      this.$modal.confirm('是否确认清空所有登录日志数据项?').then(function() {
205
+        return cleanLogininfor();
206
+      }).then(() => {
207
+        this.getList();
208
+        this.$modal.msgSuccess("清空成功");
209
+      }).catch(() => {});
218 210
     },
219 211
     /** 导出按钮操作 */
220 212
     handleExport() {

+ 8 - 12
ruoyi-ui/src/views/system/menu/index.vue

@@ -425,13 +425,13 @@ export default {
425 425
         if (valid) {
426 426
           if (this.form.menuId != undefined) {
427 427
             updateMenu(this.form).then(response => {
428
-              this.msgSuccess("修改成功");
428
+              this.$modal.msgSuccess("修改成功");
429 429
               this.open = false;
430 430
               this.getList();
431 431
             });
432 432
           } else {
433 433
             addMenu(this.form).then(response => {
434
-              this.msgSuccess("新增成功");
434
+              this.$modal.msgSuccess("新增成功");
435 435
               this.open = false;
436 436
               this.getList();
437 437
             });
@@ -441,16 +441,12 @@ export default {
441 441
     },
442 442
     /** 删除按钮操作 */
443 443
     handleDelete(row) {
444
-      this.$confirm('是否确认删除名称为"' + row.menuName + '"的数据项?', "警告", {
445
-          confirmButtonText: "确定",
446
-          cancelButtonText: "取消",
447
-          type: "warning"
448
-        }).then(function() {
449
-          return delMenu(row.menuId);
450
-        }).then(() => {
451
-          this.getList();
452
-          this.msgSuccess("删除成功");
453
-        }).catch(() => {});
444
+      this.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() {
445
+        return delMenu(row.menuId);
446
+      }).then(() => {
447
+        this.getList();
448
+        this.$modal.msgSuccess("删除成功");
449
+      }).catch(() => {});
454 450
     }
455 451
   }
456 452
 };

+ 8 - 12
ruoyi-ui/src/views/system/notice/index.vue

@@ -285,13 +285,13 @@ export default {
285 285
         if (valid) {
286 286
           if (this.form.noticeId != undefined) {
287 287
             updateNotice(this.form).then(response => {
288
-              this.msgSuccess("修改成功");
288
+              this.$modal.msgSuccess("修改成功");
289 289
               this.open = false;
290 290
               this.getList();
291 291
             });
292 292
           } else {
293 293
             addNotice(this.form).then(response => {
294
-              this.msgSuccess("新增成功");
294
+              this.$modal.msgSuccess("新增成功");
295 295
               this.open = false;
296 296
               this.getList();
297 297
             });
@@ -302,16 +302,12 @@ export default {
302 302
     /** 删除按钮操作 */
303 303
     handleDelete(row) {
304 304
       const noticeIds = row.noticeId || this.ids
305
-      this.$confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?', "警告", {
306
-          confirmButtonText: "确定",
307
-          cancelButtonText: "取消",
308
-          type: "warning"
309
-        }).then(function() {
310
-          return delNotice(noticeIds);
311
-        }).then(() => {
312
-          this.getList();
313
-          this.msgSuccess("删除成功");
314
-        }).catch(() => {});
305
+      this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
306
+        return delNotice(noticeIds);
307
+      }).then(() => {
308
+        this.getList();
309
+        this.$modal.msgSuccess("删除成功");
310
+      }).catch(() => {});
315 311
     }
316 312
   }
317 313
 };

+ 12 - 20
ruoyi-ui/src/views/system/operlog/index.vue

@@ -281,29 +281,21 @@ export default {
281 281
     /** 删除按钮操作 */
282 282
     handleDelete(row) {
283 283
       const operIds = row.operId || this.ids;
284
-      this.$confirm('是否确认删除日志编号为"' + operIds + '"的数据项?', "警告", {
285
-          confirmButtonText: "确定",
286
-          cancelButtonText: "取消",
287
-          type: "warning"
288
-        }).then(function() {
289
-          return delOperlog(operIds);
290
-        }).then(() => {
291
-          this.getList();
292
-          this.msgSuccess("删除成功");
293
-        }).catch(() => {});
284
+      this.$modal.confirm('是否确认删除日志编号为"' + operIds + '"的数据项?').then(function() {
285
+        return delOperlog(operIds);
286
+      }).then(() => {
287
+        this.getList();
288
+        this.$modal.msgSuccess("删除成功");
289
+      }).catch(() => {});
294 290
     },
295 291
     /** 清空按钮操作 */
296 292
     handleClean() {
297
-        this.$confirm('是否确认清空所有操作日志数据项?', "警告", {
298
-          confirmButtonText: "确定",
299
-          cancelButtonText: "取消",
300
-          type: "warning"
301
-        }).then(function() {
302
-          return cleanOperlog();
303
-        }).then(() => {
304
-          this.getList();
305
-          this.msgSuccess("清空成功");
306
-        }).catch(() => {});
293
+      this.$modal.confirm('是否确认清空所有操作日志数据项?').then(function() {
294
+        return cleanOperlog();
295
+      }).then(() => {
296
+        this.getList();
297
+        this.$modal.msgSuccess("清空成功");
298
+      }).catch(() => {});
307 299
     },
308 300
     /** 导出按钮操作 */
309 301
     handleExport() {

+ 8 - 12
ruoyi-ui/src/views/system/post/index.vue

@@ -276,13 +276,13 @@ export default {
276 276
         if (valid) {
277 277
           if (this.form.postId != undefined) {
278 278
             updatePost(this.form).then(response => {
279
-              this.msgSuccess("修改成功");
279
+              this.$modal.msgSuccess("修改成功");
280 280
               this.open = false;
281 281
               this.getList();
282 282
             });
283 283
           } else {
284 284
             addPost(this.form).then(response => {
285
-              this.msgSuccess("新增成功");
285
+              this.$modal.msgSuccess("新增成功");
286 286
               this.open = false;
287 287
               this.getList();
288 288
             });
@@ -293,16 +293,12 @@ export default {
293 293
     /** 删除按钮操作 */
294 294
     handleDelete(row) {
295 295
       const postIds = row.postId || this.ids;
296
-      this.$confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?', "警告", {
297
-          confirmButtonText: "确定",
298
-          cancelButtonText: "取消",
299
-          type: "warning"
300
-        }).then(function() {
301
-          return delPost(postIds);
302
-        }).then(() => {
303
-          this.getList();
304
-          this.msgSuccess("删除成功");
305
-        }).catch(() => {});
296
+      this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function() {
297
+        return delPost(postIds);
298
+      }).then(() => {
299
+        this.getList();
300
+        this.$modal.msgSuccess("删除成功");
301
+      }).catch(() => {});
306 302
     },
307 303
     /** 导出按钮操作 */
308 304
     handleExport() {

+ 5 - 13
ruoyi-ui/src/views/system/role/authUser.vue

@@ -178,30 +178,22 @@ export default {
178 178
     /** 取消授权按钮操作 */
179 179
     cancelAuthUser(row) {
180 180
       const roleId = this.queryParams.roleId;
181
-      this.$confirm('确认要取消该用户"' + row.userName + '"角色吗?', "警告", {
182
-        confirmButtonText: "确定",
183
-        cancelButtonText: "取消",
184
-        type: "warning"
185
-      }).then(function() {
181
+      this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function() {
186 182
         return authUserCancel({ userId: row.userId, roleId: roleId });
187 183
       }).then(() => {
188 184
         this.getList();
189
-        this.msgSuccess("取消授权成功");
185
+        this.$modal.msgSuccess("取消授权成功");
190 186
       }).catch(() => {});
191 187
     },
192 188
     /** 批量取消授权按钮操作 */
193 189
     cancelAuthUserAll(row) {
194 190
       const roleId = this.queryParams.roleId;
195 191
       const userIds = this.userIds.join(",");
196
-      this.$confirm('是否取消选中用户授权数据项?', "警告", {
197
-          confirmButtonText: "确定",
198
-          cancelButtonText: "取消",
199
-          type: "warning"
200
-      }).then(() => {
201
-          return authUserCancelAll({ roleId: roleId, userIds: userIds });
192
+      this.$modal.confirm('是否取消选中用户授权数据项?').then(function() {
193
+        return authUserCancelAll({ roleId: roleId, userIds: userIds });
202 194
       }).then(() => {
203 195
         this.getList();
204
-        this.msgSuccess("取消授权成功");
196
+        this.$modal.msgSuccess("取消授权成功");
205 197
       }).catch(() => {});
206 198
     }
207 199
   }

+ 16 - 24
ruoyi-ui/src/views/system/role/index.vue

@@ -410,17 +410,13 @@ export default {
410 410
     // 角色状态修改
411 411
     handleStatusChange(row) {
412 412
       let text = row.status === "0" ? "启用" : "停用";
413
-      this.$confirm('确认要"' + text + '""' + row.roleName + '"角色吗?', "警告", {
414
-          confirmButtonText: "确定",
415
-          cancelButtonText: "取消",
416
-          type: "warning"
417
-        }).then(function() {
418
-          return changeRoleStatus(row.roleId, row.status);
419
-        }).then(() => {
420
-          this.msgSuccess(text + "成功");
421
-        }).catch(function() {
422
-          row.status = row.status === "0" ? "1" : "0";
423
-        });
413
+      this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
414
+        return changeRoleStatus(row.roleId, row.status);
415
+      }).then(() => {
416
+        this.$modal.msgSuccess(text + "成功");
417
+      }).catch(function() {
418
+        row.status = row.status === "0" ? "1" : "0";
419
+      });
424 420
     },
425 421
     // 取消按钮
426 422
     cancel() {
@@ -576,14 +572,14 @@ export default {
576 572
           if (this.form.roleId != undefined) {
577 573
             this.form.menuIds = this.getMenuAllCheckedKeys();
578 574
             updateRole(this.form).then(response => {
579
-              this.msgSuccess("修改成功");
575
+              this.$modal.msgSuccess("修改成功");
580 576
               this.open = false;
581 577
               this.getList();
582 578
             });
583 579
           } else {
584 580
             this.form.menuIds = this.getMenuAllCheckedKeys();
585 581
             addRole(this.form).then(response => {
586
-              this.msgSuccess("新增成功");
582
+              this.$modal.msgSuccess("新增成功");
587 583
               this.open = false;
588 584
               this.getList();
589 585
             });
@@ -596,7 +592,7 @@ export default {
596 592
       if (this.form.roleId != undefined) {
597 593
         this.form.deptIds = this.getDeptAllCheckedKeys();
598 594
         dataScope(this.form).then(response => {
599
-          this.msgSuccess("修改成功");
595
+          this.$modal.msgSuccess("修改成功");
600 596
           this.openDataScope = false;
601 597
           this.getList();
602 598
         });
@@ -605,16 +601,12 @@ export default {
605 601
     /** 删除按钮操作 */
606 602
     handleDelete(row) {
607 603
       const roleIds = row.roleId || this.ids;
608
-      this.$confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?', "警告", {
609
-          confirmButtonText: "确定",
610
-          cancelButtonText: "取消",
611
-          type: "warning"
612
-        }).then(function() {
613
-          return delRole(roleIds);
614
-        }).then(() => {
615
-          this.getList();
616
-          this.msgSuccess("删除成功");
617
-        }).catch(() => {});
604
+      this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
605
+        return delRole(roleIds);
606
+      }).then(() => {
607
+        this.getList();
608
+        this.$modal.msgSuccess("删除成功");
609
+      }).catch(() => {});
618 610
     },
619 611
     /** 导出按钮操作 */
620 612
     handleExport() {

+ 1 - 1
ruoyi-ui/src/views/system/role/selectUser.vue

@@ -124,7 +124,7 @@ export default {
124 124
       const roleId = this.queryParams.roleId;
125 125
       const userIds = this.userIds.join(",");
126 126
       authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => {
127
-        this.msgSuccess(res.msg);
127
+        this.$modal.msgSuccess(res.msg);
128 128
         if (res.code === 200) {
129 129
           this.visible = false;
130 130
           this.$emit("ok");

+ 1 - 1
ruoyi-ui/src/views/system/user/authRole.vue

@@ -103,7 +103,7 @@ export default {
103 103
       const userId = this.form.userId;
104 104
       const roleIds = this.roleIds.join(",");
105 105
       updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
106
-        this.msgSuccess("授权成功");
106
+        this.$modal.msgSuccess("授权成功");
107 107
         this.close();
108 108
       });
109 109
     },

+ 16 - 24
ruoyi-ui/src/views/system/user/index.vue

@@ -500,17 +500,13 @@ export default {
500 500
     // 用户状态修改
501 501
     handleStatusChange(row) {
502 502
       let text = row.status === "0" ? "启用" : "停用";
503
-      this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', "警告", {
504
-          confirmButtonText: "确定",
505
-          cancelButtonText: "取消",
506
-          type: "warning"
507
-        }).then(function() {
508
-          return changeUserStatus(row.userId, row.status);
509
-        }).then(() => {
510
-          this.msgSuccess(text + "成功");
511
-        }).catch(function() {
512
-          row.status = row.status === "0" ? "1" : "0";
513
-        });
503
+      this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
504
+        return changeUserStatus(row.userId, row.status);
505
+      }).then(() => {
506
+        this.$modal.msgSuccess(text + "成功");
507
+      }).catch(function() {
508
+        row.status = row.status === "0" ? "1" : "0";
509
+      });
514 510
     },
515 511
     // 取消按钮
516 512
     cancel() {
@@ -603,7 +599,7 @@ export default {
603 599
         inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
604 600
       }).then(({ value }) => {
605 601
           resetUserPwd(row.userId, value).then(response => {
606
-            this.msgSuccess("修改成功,新密码是:" + value);
602
+            this.$modal.msgSuccess("修改成功,新密码是:" + value);
607 603
           });
608 604
         }).catch(() => {});
609 605
     },
@@ -618,13 +614,13 @@ export default {
618 614
         if (valid) {
619 615
           if (this.form.userId != undefined) {
620 616
             updateUser(this.form).then(response => {
621
-              this.msgSuccess("修改成功");
617
+              this.$modal.msgSuccess("修改成功");
622 618
               this.open = false;
623 619
               this.getList();
624 620
             });
625 621
           } else {
626 622
             addUser(this.form).then(response => {
627
-              this.msgSuccess("新增成功");
623
+              this.$modal.msgSuccess("新增成功");
628 624
               this.open = false;
629 625
               this.getList();
630 626
             });
@@ -635,16 +631,12 @@ export default {
635 631
     /** 删除按钮操作 */
636 632
     handleDelete(row) {
637 633
       const userIds = row.userId || this.ids;
638
-      this.$confirm('是否确认删除用户编号为"' + userIds + '"的数据项?', "警告", {
639
-          confirmButtonText: "确定",
640
-          cancelButtonText: "取消",
641
-          type: "warning"
642
-        }).then(function() {
643
-          return delUser(userIds);
644
-        }).then(() => {
645
-          this.getList();
646
-          this.msgSuccess("删除成功");
647
-        }).catch(() => {});
634
+      this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
635
+        return delUser(userIds);
636
+      }).then(() => {
637
+        this.getList();
638
+        this.$modal.msgSuccess("删除成功");
639
+      }).catch(() => {});
648 640
     },
649 641
     /** 导出按钮操作 */
650 642
     handleExport() {

+ 1 - 1
ruoyi-ui/src/views/system/user/profile/resetPwd.vue

@@ -57,7 +57,7 @@ export default {
57 57
         if (valid) {
58 58
           updateUserPwd(this.user.oldPassword, this.user.newPassword).then(
59 59
             response => {
60
-              this.msgSuccess("修改成功");
60
+              this.$modal.msgSuccess("修改成功");
61 61
             }
62 62
           );
63 63
         }

+ 2 - 2
ruoyi-ui/src/views/system/user/profile/userAvatar.vue

@@ -110,7 +110,7 @@ export default {
110 110
     // 上传预处理
111 111
     beforeUpload(file) {
112 112
       if (file.type.indexOf("image/") == -1) {
113
-        this.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
113
+        this.$modal.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
114 114
       } else {
115 115
         const reader = new FileReader();
116 116
         reader.readAsDataURL(file);
@@ -128,7 +128,7 @@ export default {
128 128
           this.open = false;
129 129
           this.options.img = response.imgUrl;
130 130
           store.commit('SET_AVATAR', this.options.img);
131
-          this.msgSuccess("修改成功");
131
+          this.$modal.msgSuccess("修改成功");
132 132
           this.visible = false;
133 133
         });
134 134
       });

+ 1 - 1
ruoyi-ui/src/views/system/user/profile/userInfo.vue

@@ -62,7 +62,7 @@ export default {
62 62
       this.$refs["form"].validate(valid => {
63 63
         if (valid) {
64 64
           updateUserProfile(this.user).then(response => {
65
-            this.msgSuccess("修改成功");
65
+            this.$modal.msgSuccess("修改成功");
66 66
           });
67 67
         }
68 68
       });

+ 2 - 2
ruoyi-ui/src/views/tool/gen/editTable.vue

@@ -192,13 +192,13 @@ export default {
192 192
             parentMenuId: genTable.parentMenuId
193 193
           };
194 194
           updateGenTable(genTable).then(res => {
195
-            this.msgSuccess(res.msg);
195
+            this.$modal.msgSuccess(res.msg);
196 196
             if (res.code === 200) {
197 197
               this.close();
198 198
             }
199 199
           });
200 200
         } else {
201
-          this.msgError("表单校验未通过,请重新检查提交内容");
201
+          this.$modal.msgError("表单校验未通过,请重新检查提交内容");
202 202
         }
203 203
       });
204 204
     },

+ 7 - 2
ruoyi-ui/src/views/tool/gen/importTable.vue

@@ -104,8 +104,13 @@ export default {
104 104
     },
105 105
     /** 导入按钮操作 */
106 106
     handleImportTable() {
107
-      importTable({ tables: this.tables.join(",") }).then(res => {
108
-        this.msgSuccess(res.msg);
107
+      const tableNames = this.tables.join(",");
108
+      if (tableNames == "") {
109
+        this.$modal.msgError("请选择要导入的表");
110
+        return;
111
+      }
112
+      importTable({ tables: tableNames }).then(res => {
113
+        this.$modal.msgSuccess(res.msg);
109 114
         if (res.code === 200) {
110 115
           this.visible = false;
111 116
           this.$emit("ok");

+ 9 - 17
ruoyi-ui/src/views/tool/gen/index.vue

@@ -262,12 +262,12 @@ export default {
262 262
     handleGenTable(row) {
263 263
       const tableNames = row.tableName || this.tableNames;
264 264
       if (tableNames == "") {
265
-        this.msgError("请选择要生成的数据");
265
+        this.$modal.msgError("请选择要生成的数据");
266 266
         return;
267 267
       }
268 268
       if(row.genType === "1") {
269 269
         genCode(row.tableName).then(response => {
270
-          this.msgSuccess("成功生成到自定义路径:" + row.genPath);
270
+          this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath);
271 271
         });
272 272
       } else {
273 273
         downLoadZip("/code/gen/batchGenCode?tables=" + tableNames, "ruoyi");
@@ -276,14 +276,10 @@ export default {
276 276
     /** 同步数据库操作 */
277 277
     handleSynchDb(row) {
278 278
       const tableName = row.tableName;
279
-      this.$confirm('确认要强制同步"' + tableName + '"表结构吗?', "警告", {
280
-        confirmButtonText: "确定",
281
-        cancelButtonText: "取消",
282
-        type: "warning"
283
-      }).then(function() {
284
-          return synchDb(tableName);
279
+      this.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function() {
280
+        return synchDb(tableName);
285 281
       }).then(() => {
286
-          this.msgSuccess("同步成功");
282
+        this.$modal.msgSuccess("同步成功");
287 283
       }).catch(() => {});
288 284
     },
289 285
     /** 打开导入表弹窗 */
@@ -326,15 +322,11 @@ export default {
326 322
     /** 删除按钮操作 */
327 323
     handleDelete(row) {
328 324
       const tableIds = row.tableId || this.ids;
329
-      this.$confirm('是否确认删除表编号为"' + tableIds + '"的数据项?', "警告", {
330
-        confirmButtonText: "确定",
331
-        cancelButtonText: "取消",
332
-        type: "warning"
333
-      }).then(function() {
334
-          return delTable(tableIds);
325
+      this.$modal.confirm('是否确认删除表编号为"' + tableIds + '"的数据项?').then(function() {
326
+        return delTable(tableIds);
335 327
       }).then(() => {
336
-          this.getList();
337
-          this.msgSuccess("删除成功");
328
+        this.getList();
329
+        this.$modal.msgSuccess("删除成功");
338 330
       }).catch(() => {});
339 331
     }
340 332
   }