作者 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.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.msgSuccess("新增成功"); 457 + this.$modal.msgSuccess("新增成功");
458 this.open = false; 458 this.open = false;
459 this.getList(); 459 this.getList();
460 }); 460 });
@@ -464,16 +464,12 @@ export default { @@ -464,16 +464,12 @@ export default {
464 }, 464 },
465 /** 删除按钮操作 */ 465 /** 删除按钮操作 */
466 handleDelete(row) { 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 };
@@ -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.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.msgSuccess("新增成功"); 512 + this.$modal.msgSuccess("新增成功");
513 this.open = false; 513 this.open = false;
514 this.getList(); 514 this.getList();
515 }); 515 });
@@ -520,16 +520,12 @@ export default { @@ -520,16 +520,12 @@ 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.$confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?', "警告", {  
524 - confirmButtonText: "确定",  
525 - cancelButtonText: "取消",  
526 - type: "warning"  
527 - }).then(function() {  
528 - return del${BusinessName}(${pkColumn.javaField}s);  
529 - }).then(() => {  
530 - this.getList();  
531 - this.msgSuccess("删除成功");  
532 - }).catch(() => {}); 523 + this.$modal.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(function() {
  524 + return del${BusinessName}(${pkColumn.javaField}s);
  525 + }).then(() => {
  526 + this.getList();
  527 + this.$modal.msgSuccess("删除成功");
  528 + }).catch(() => {});
533 }, 529 },
534 #if($table.sub) 530 #if($table.sub)
535 /** ${subTable.functionName}序号 */ 531 /** ${subTable.functionName}序号 */
@@ -567,17 +563,13 @@ export default { @@ -567,17 +563,13 @@ export default {
567 /** 导出按钮操作 */ 563 /** 导出按钮操作 */
568 handleExport() { 564 handleExport() {
569 const queryParams = this.queryParams; 565 const queryParams = this.queryParams;
570 - this.$confirm('是否确认导出所有${functionName}数据项?', "警告", {  
571 - confirmButtonText: "确定",  
572 - cancelButtonText: "取消",  
573 - type: "warning"  
574 - }).then(() => {  
575 - this.exportLoading = true;  
576 - return export${BusinessName}(queryParams);  
577 - }).then(response => {  
578 - this.download(response.msg);  
579 - this.exportLoading = false;  
580 - }).catch(() => {}); 566 + this.$modal.confirm('是否确认导出所有${functionName}数据项?').then(() => {
  567 + this.exportLoading = true;
  568 + return export${BusinessName}(queryParams);
  569 + }).then(response => {
  570 + this.download(response.msg);
  571 + this.exportLoading = false;
  572 + }).catch(() => {});
581 } 573 }
582 } 574 }
583 }; 575 };
@@ -162,14 +162,8 @@ export default { @@ -162,14 +162,8 @@ export default {
162 this.sideTheme = val; 162 this.sideTheme = val;
163 }, 163 },
164 saveSetting() { 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 "layout-setting", 167 "layout-setting",
174 `{ 168 `{
175 "topNav":${this.topNav}, 169 "topNav":${this.topNav},
@@ -181,17 +175,11 @@ export default { @@ -181,17 +175,11 @@ export default {
181 "theme":"${this.theme}" 175 "theme":"${this.theme}"
182 }` 176 }`
183 ); 177 );
184 - setTimeout(loading.close(), 1000) 178 + setTimeout(this.$modal.closeLoading(), 1000)
185 }, 179 },
186 resetSetting() { 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 setTimeout("window.location.reload()", 1000) 183 setTimeout("window.location.reload()", 1000)
196 } 184 }
197 } 185 }
@@ -11,12 +11,14 @@ import App from './App' @@ -11,12 +11,14 @@ import App from './App'
11 import store from './store' 11 import store from './store'
12 import router from './router' 12 import router from './router'
13 import directive from './directive' //directive 13 import directive from './directive' //directive
  14 +import plugins from './plugins' // plugins
14 15
15 import './assets/icons' // icon 16 import './assets/icons' // icon
16 import './permission' // permission control 17 import './permission' // permission control
17 import { getDicts } from "@/api/system/dict/data"; 18 import { getDicts } from "@/api/system/dict/data";
18 import { getConfigKey } from "@/api/system/config"; 19 import { getConfigKey } from "@/api/system/config";
19 import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi"; 20 import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
  21 +// 分页组件
20 import Pagination from "@/components/Pagination"; 22 import Pagination from "@/components/Pagination";
21 // 自定义表格工具组件 23 // 自定义表格工具组件
22 import RightToolbar from "@/components/RightToolbar" 24 import RightToolbar from "@/components/RightToolbar"
@@ -44,18 +46,6 @@ Vue.prototype.selectDictLabels = selectDictLabels @@ -44,18 +46,6 @@ Vue.prototype.selectDictLabels = selectDictLabels
44 Vue.prototype.download = download 46 Vue.prototype.download = download
45 Vue.prototype.handleTree = handleTree 47 Vue.prototype.handleTree = handleTree
46 48
47 -Vue.prototype.msgSuccess = function (msg) {  
48 - this.$message({ showClose: true, message: msg, type: "success" });  
49 -}  
50 -  
51 -Vue.prototype.msgError = function (msg) {  
52 - this.$message({ showClose: true, message: msg, type: "error" });  
53 -}  
54 -  
55 -Vue.prototype.msgInfo = function (msg) {  
56 - this.$message.info(msg);  
57 -}  
58 -  
59 // 全局组件挂载 49 // 全局组件挂载
60 Vue.component('DictTag', DictTag) 50 Vue.component('DictTag', DictTag)
61 Vue.component('Pagination', Pagination) 51 Vue.component('Pagination', Pagination)
@@ -65,6 +55,7 @@ Vue.component('FileUpload', FileUpload) @@ -65,6 +55,7 @@ Vue.component('FileUpload', FileUpload)
65 Vue.component('ImageUpload', ImageUpload) 55 Vue.component('ImageUpload', ImageUpload)
66 56
67 Vue.use(directive) 57 Vue.use(directive)
  58 +Vue.use(plugins)
68 Vue.use(VueMeta) 59 Vue.use(VueMeta)
69 DictData.install() 60 DictData.install()
70 61
  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 +}
  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 +}
  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 +}
@@ -74,8 +74,6 @@ export default { @@ -74,8 +74,6 @@ export default {
74 name: "Server", 74 name: "Server",
75 data() { 75 data() {
76 return { 76 return {
77 - // 加载层信息  
78 - loading: [],  
79 // 统计命令信息 77 // 统计命令信息
80 commandstats: null, 78 commandstats: null,
81 // 使用内存 79 // 使用内存
@@ -93,7 +91,7 @@ export default { @@ -93,7 +91,7 @@ export default {
93 getList() { 91 getList() {
94 getCache().then((response) => { 92 getCache().then((response) => {
95 this.cache = response.data; 93 this.cache = response.data;
96 - this.loading.close(); 94 + this.$modal.closeLoading();
97 95
98 this.commandstats = echarts.init(this.$refs.commandstats, "macarons"); 96 this.commandstats = echarts.init(this.$refs.commandstats, "macarons");
99 this.commandstats.setOption({ 97 this.commandstats.setOption({
@@ -141,12 +139,7 @@ export default { @@ -141,12 +139,7 @@ export default {
141 }, 139 },
142 // 打开加载层 140 // 打开加载层
143 openLoading() { 141 openLoading() {
144 - this.loading = this.$loading({  
145 - lock: true,  
146 - text: "拼命读取中",  
147 - spinner: "el-icon-loading",  
148 - background: "rgba(0, 0, 0, 0.7)",  
149 - }); 142 + this.$modal.loading("正在加载缓存监控数据,请稍后!");
150 }, 143 },
151 }, 144 },
152 }; 145 };
@@ -240,7 +240,7 @@ @@ -240,7 +240,7 @@
240 </div> 240 </div>
241 </el-dialog> 241 </el-dialog>
242 242
243 - <el-dialog title="Cron表达式生成器" :visible.sync="openCron" append-to-body class="scrollbar" destroy-on-close > 243 + <el-dialog title="Cron表达式生成器" :visible.sync="openCron" append-to-body destroy-on-close class="scrollbar">
244 <crontab @hide="openCron=false" @fill="crontabFill" :expression="expression"></crontab> 244 <crontab @hide="openCron=false" @fill="crontabFill" :expression="expression"></crontab>
245 </el-dialog> 245 </el-dialog>
246 246
@@ -425,29 +425,21 @@ export default { @@ -425,29 +425,21 @@ export default {
425 // 任务状态修改 425 // 任务状态修改
426 handleStatusChange(row) { 426 handleStatusChange(row) {
427 let text = row.status === "0" ? "启用" : "停用"; 427 let text = row.status === "0" ? "启用" : "停用";
428 - this.$confirm('确认要"' + text + '""' + row.jobName + '"任务吗?', "警告", {  
429 - confirmButtonText: "确定",  
430 - cancelButtonText: "取消",  
431 - type: "warning"  
432 - }).then(function() {  
433 - return changeJobStatus(row.jobId, row.status);  
434 - }).then(() => {  
435 - this.msgSuccess(text + "成功");  
436 - }).catch(function() {  
437 - row.status = row.status === "0" ? "1" : "0";  
438 - }); 428 + this.$modal.confirm('确认要"' + text + '""' + row.jobName + '"任务吗?').then(function() {
  429 + return changeJobStatus(row.jobId, row.status);
  430 + }).then(() => {
  431 + this.$modal.msgSuccess(text + "成功");
  432 + }).catch(function() {
  433 + row.status = row.status === "0" ? "1" : "0";
  434 + });
439 }, 435 },
440 /* 立即执行一次 */ 436 /* 立即执行一次 */
441 handleRun(row) { 437 handleRun(row) {
442 - this.$confirm('确认要立即执行一次"' + row.jobName + '"任务吗?', "警告", {  
443 - confirmButtonText: "确定",  
444 - cancelButtonText: "取消",  
445 - type: "warning"  
446 - }).then(function() {  
447 - return runJob(row.jobId, row.jobGroup);  
448 - }).then(() => {  
449 - this.msgSuccess("执行成功");  
450 - }).catch(() => {}); 438 + this.$modal.confirm('确认要立即执行一次"' + row.jobName + '"任务吗?').then(function() {
  439 + return runJob(row.jobId, row.jobGroup);
  440 + }).then(() => {
  441 + this.$modal.msgSuccess("执行成功");
  442 + }).catch(() => {});
451 }, 443 },
452 /** 任务详细信息 */ 444 /** 任务详细信息 */
453 handleView(row) { 445 handleView(row) {
@@ -492,13 +484,13 @@ export default { @@ -492,13 +484,13 @@ export default {
492 if (valid) { 484 if (valid) {
493 if (this.form.jobId != undefined) { 485 if (this.form.jobId != undefined) {
494 updateJob(this.form).then(response => { 486 updateJob(this.form).then(response => {
495 - this.msgSuccess("修改成功"); 487 + this.$modal.msgSuccess("修改成功");
496 this.open = false; 488 this.open = false;
497 this.getList(); 489 this.getList();
498 }); 490 });
499 } else { 491 } else {
500 addJob(this.form).then(response => { 492 addJob(this.form).then(response => {
501 - this.msgSuccess("新增成功"); 493 + this.$modal.msgSuccess("新增成功");
502 this.open = false; 494 this.open = false;
503 this.getList(); 495 this.getList();
504 }); 496 });
@@ -509,31 +501,23 @@ export default { @@ -509,31 +501,23 @@ export default {
509 /** 删除按钮操作 */ 501 /** 删除按钮操作 */
510 handleDelete(row) { 502 handleDelete(row) {
511 const jobIds = row.jobId || this.ids; 503 const jobIds = row.jobId || this.ids;
512 - this.$confirm('是否确认删除定时任务编号为"' + jobIds + '"的数据项?', "警告", {  
513 - confirmButtonText: "确定",  
514 - cancelButtonText: "取消",  
515 - type: "warning"  
516 - }).then(function() {  
517 - return delJob(jobIds);  
518 - }).then(() => {  
519 - this.getList();  
520 - this.msgSuccess("删除成功");  
521 - }).catch(() => {}); 504 + this.$modal.confirm('是否确认删除定时任务编号为"' + jobIds + '"的数据项?').then(function() {
  505 + return delJob(jobIds);
  506 + }).then(() => {
  507 + this.getList();
  508 + this.$modal.msgSuccess("删除成功");
  509 + }).catch(() => {});
522 }, 510 },
523 /** 导出按钮操作 */ 511 /** 导出按钮操作 */
524 handleExport() { 512 handleExport() {
525 const queryParams = this.queryParams; 513 const queryParams = this.queryParams;
526 - this.$confirm("是否确认导出所有定时任务数据项?", "警告", {  
527 - confirmButtonText: "确定",  
528 - cancelButtonText: "取消",  
529 - type: "warning"  
530 - }).then(() => {  
531 - this.exportLoading = true;  
532 - return exportJob(queryParams);  
533 - }).then(response => {  
534 - this.download(response.msg);  
535 - this.exportLoading = false;  
536 - }).catch(() => {}); 514 + this.$modal.confirm('是否确认导出所有定时任务数据项?').then(() => {
  515 + this.exportLoading = true;
  516 + return exportJob(queryParams);
  517 + }).then(response => {
  518 + this.download(response.msg);
  519 + this.exportLoading = false;
  520 + }).catch(() => {});
537 } 521 }
538 } 522 }
539 }; 523 };
@@ -275,44 +275,32 @@ export default { @@ -275,44 +275,32 @@ export default {
275 /** 删除按钮操作 */ 275 /** 删除按钮操作 */
276 handleDelete(row) { 276 handleDelete(row) {
277 const jobLogIds = this.ids; 277 const jobLogIds = this.ids;
278 - this.$confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?', "警告", {  
279 - confirmButtonText: "确定",  
280 - cancelButtonText: "取消",  
281 - type: "warning"  
282 - }).then(function() {  
283 - return delJobLog(jobLogIds);  
284 - }).then(() => {  
285 - this.getList();  
286 - this.msgSuccess("删除成功");  
287 - }).catch(() => {}); 278 + this.$modal.confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?').then(function() {
  279 + return delJobLog(jobLogIds);
  280 + }).then(() => {
  281 + this.getList();
  282 + this.$modal.msgSuccess("删除成功");
  283 + }).catch(() => {});
288 }, 284 },
289 /** 清空按钮操作 */ 285 /** 清空按钮操作 */
290 handleClean() { 286 handleClean() {
291 - this.$confirm("是否确认清空所有调度日志数据项?", "警告", {  
292 - confirmButtonText: "确定",  
293 - cancelButtonText: "取消",  
294 - type: "warning"  
295 - }).then(function() {  
296 - return cleanJobLog();  
297 - }).then(() => {  
298 - this.getList();  
299 - this.msgSuccess("清空成功");  
300 - }).catch(() => {}); 287 + this.$modal.confirm('是否确认清空所有调度日志数据项?').then(function() {
  288 + return cleanJobLog();
  289 + }).then(() => {
  290 + this.getList();
  291 + this.$modal.msgSuccess("清空成功");
  292 + }).catch(() => {});
301 }, 293 },
302 /** 导出按钮操作 */ 294 /** 导出按钮操作 */
303 handleExport() { 295 handleExport() {
304 const queryParams = this.queryParams; 296 const queryParams = this.queryParams;
305 - this.$confirm("是否确认导出所有调度日志数据项?", "警告", {  
306 - confirmButtonText: "确定",  
307 - cancelButtonText: "取消",  
308 - type: "warning"  
309 - }).then(() => {  
310 - this.exportLoading = true;  
311 - return exportJobLog(queryParams);  
312 - }).then(response => {  
313 - this.download(response.msg);  
314 - this.exportLoading = false;  
315 - }).catch(() => {}); 297 + this.$modal.confirm('是否确认导出所有调度日志数据项?').then(() => {
  298 + this.exportLoading = true;
  299 + return exportJobLog(queryParams);
  300 + }).then(response => {
  301 + this.download(response.msg);
  302 + this.exportLoading = false;
  303 + }).catch(() => {});
316 } 304 }
317 } 305 }
318 }; 306 };
@@ -198,44 +198,32 @@ export default { @@ -198,44 +198,32 @@ export default {
198 /** 删除按钮操作 */ 198 /** 删除按钮操作 */
199 handleDelete(row) { 199 handleDelete(row) {
200 const infoIds = row.infoId || this.ids; 200 const infoIds = row.infoId || this.ids;
201 - this.$confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?', "警告", {  
202 - confirmButtonText: "确定",  
203 - cancelButtonText: "取消",  
204 - type: "warning"  
205 - }).then(function() {  
206 - return delLogininfor(infoIds);  
207 - }).then(() => {  
208 - this.getList();  
209 - this.msgSuccess("删除成功");  
210 - }).catch(() => {}); 201 + this.$modal.confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?').then(function() {
  202 + return delLogininfor(infoIds);
  203 + }).then(() => {
  204 + this.getList();
  205 + this.$modal.msgSuccess("删除成功");
  206 + }).catch(() => {});
211 }, 207 },
212 /** 清空按钮操作 */ 208 /** 清空按钮操作 */
213 handleClean() { 209 handleClean() {
214 - this.$confirm('是否确认清空所有登录日志数据项?', "警告", {  
215 - confirmButtonText: "确定",  
216 - cancelButtonText: "取消",  
217 - type: "warning"  
218 - }).then(function() {  
219 - return cleanLogininfor();  
220 - }).then(() => {  
221 - this.getList();  
222 - this.msgSuccess("清空成功");  
223 - }).catch(() => {}); 210 + this.$modal.confirm('是否确认清空所有登录日志数据项?').then(function() {
  211 + return cleanLogininfor();
  212 + }).then(() => {
  213 + this.getList();
  214 + this.$modal.msgSuccess("清空成功");
  215 + }).catch(() => {});
224 }, 216 },
225 /** 导出按钮操作 */ 217 /** 导出按钮操作 */
226 handleExport() { 218 handleExport() {
227 const queryParams = this.queryParams; 219 const queryParams = this.queryParams;
228 - this.$confirm('是否确认导出所有操作日志数据项?', "警告", {  
229 - confirmButtonText: "确定",  
230 - cancelButtonText: "取消",  
231 - type: "warning"  
232 - }).then(() => {  
233 - this.exportLoading = true;  
234 - return exportLogininfor(queryParams);  
235 - }).then(response => {  
236 - this.download(response.msg);  
237 - this.exportLoading = false;  
238 - }).catch(() => {}); 220 + this.$modal.confirm('是否确认导出所有操作日志数据项?').then(() => {
  221 + this.exportLoading = true;
  222 + return exportLogininfor(queryParams);
  223 + }).then(response => {
  224 + this.download(response.msg);
  225 + this.exportLoading = false;
  226 + }).catch(() => {});
239 } 227 }
240 } 228 }
241 }; 229 };
@@ -111,16 +111,12 @@ export default { @@ -111,16 +111,12 @@ export default {
111 }, 111 },
112 /** 强退按钮操作 */ 112 /** 强退按钮操作 */
113 handleForceLogout(row) { 113 handleForceLogout(row) {
114 - this.$confirm('是否确认强退名称为"' + row.userName + '"的数据项?', "警告", {  
115 - confirmButtonText: "确定",  
116 - cancelButtonText: "取消",  
117 - type: "warning"  
118 - }).then(function() {  
119 - return forceLogout(row.tokenId);  
120 - }).then(() => {  
121 - this.getList();  
122 - this.msgSuccess("强退成功");  
123 - }).catch(() => {}); 114 + this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的数据项?').then(function() {
  115 + return forceLogout(row.tokenId);
  116 + }).then(() => {
  117 + this.getList();
  118 + this.$modal.msgSuccess("强退成功");
  119 + }).catch(() => {});
124 } 120 }
125 } 121 }
126 }; 122 };
@@ -285,44 +285,32 @@ export default { @@ -285,44 +285,32 @@ export default {
285 /** 删除按钮操作 */ 285 /** 删除按钮操作 */
286 handleDelete(row) { 286 handleDelete(row) {
287 const operIds = row.operId || this.ids; 287 const operIds = row.operId || this.ids;
288 - this.$confirm('是否确认删除日志编号为"' + operIds + '"的数据项?', "警告", {  
289 - confirmButtonText: "确定",  
290 - cancelButtonText: "取消",  
291 - type: "warning"  
292 - }).then(function() {  
293 - return delOperlog(operIds);  
294 - }).then(() => {  
295 - this.getList();  
296 - this.msgSuccess("删除成功");  
297 - }).catch(() => {}); 288 + this.$modal.confirm('是否确认删除日志编号为"' + operIds + '"的数据项?').then(function() {
  289 + return delOperlog(operIds);
  290 + }).then(() => {
  291 + this.getList();
  292 + this.$modal.msgSuccess("删除成功");
  293 + }).catch(() => {});
298 }, 294 },
299 /** 清空按钮操作 */ 295 /** 清空按钮操作 */
300 handleClean() { 296 handleClean() {
301 - this.$confirm('是否确认清空所有操作日志数据项?', "警告", {  
302 - confirmButtonText: "确定",  
303 - cancelButtonText: "取消",  
304 - type: "warning"  
305 - }).then(function() {  
306 - return cleanOperlog();  
307 - }).then(() => {  
308 - this.getList();  
309 - this.msgSuccess("清空成功");  
310 - }).catch(() => {}); 297 + this.$modal.confirm('是否确认清空所有操作日志数据项?').then(function() {
  298 + return cleanOperlog();
  299 + }).then(() => {
  300 + this.getList();
  301 + this.$modal.msgSuccess("清空成功");
  302 + }).catch(() => {});
311 }, 303 },
312 /** 导出按钮操作 */ 304 /** 导出按钮操作 */
313 handleExport() { 305 handleExport() {
314 const queryParams = this.queryParams; 306 const queryParams = this.queryParams;
315 - this.$confirm('是否确认导出所有操作日志数据项?', "警告", {  
316 - confirmButtonText: "确定",  
317 - cancelButtonText: "取消",  
318 - type: "warning"  
319 - }).then(() => {  
320 - this.exportLoading = true;  
321 - return exportOperlog(queryParams);  
322 - }).then(response => {  
323 - this.download(response.msg);  
324 - this.exportLoading = false;  
325 - }).catch(() => {}); 307 + this.$modal.confirm('是否确认导出所有操作日志数据项?').then(() => {
  308 + this.exportLoading = true;
  309 + return exportOperlog(queryParams);
  310 + }).then(response => {
  311 + this.download(response.msg);
  312 + this.exportLoading = false;
  313 + }).catch(() => {});
326 } 314 }
327 } 315 }
328 }; 316 };
@@ -153,7 +153,7 @@ @@ -153,7 +153,7 @@
153 </tr> 153 </tr>
154 </thead> 154 </thead>
155 <tbody v-if="server.sysFiles"> 155 <tbody v-if="server.sysFiles">
156 - <tr v-for="sysFile in server.sysFiles"> 156 + <tr v-for="(sysFile, index) in sysFiles" :key="index">
157 <td><div class="cell">{{ sysFile.dirName }}</div></td> 157 <td><div class="cell">{{ sysFile.dirName }}</div></td>
158 <td><div class="cell">{{ sysFile.sysTypeName }}</div></td> 158 <td><div class="cell">{{ sysFile.sysTypeName }}</div></td>
159 <td><div class="cell">{{ sysFile.typeName }}</div></td> 159 <td><div class="cell">{{ sysFile.typeName }}</div></td>
@@ -178,8 +178,6 @@ export default { @@ -178,8 +178,6 @@ export default {
178 name: "Server", 178 name: "Server",
179 data() { 179 data() {
180 return { 180 return {
181 - // 加载层信息  
182 - loading: [],  
183 // 服务器信息 181 // 服务器信息
184 server: [] 182 server: []
185 }; 183 };
@@ -193,17 +191,12 @@ export default { @@ -193,17 +191,12 @@ export default {
193 getList() { 191 getList() {
194 getServer().then(response => { 192 getServer().then(response => {
195 this.server = response.data; 193 this.server = response.data;
196 - this.loading.close(); 194 + this.$modal.closeLoading();
197 }); 195 });
198 }, 196 },
199 // 打开加载层 197 // 打开加载层
200 openLoading() { 198 openLoading() {
201 - this.loading = this.$loading({  
202 - lock: true,  
203 - text: "拼命读取中",  
204 - spinner: "el-icon-loading",  
205 - background: "rgba(0, 0, 0, 0.7)"  
206 - }); 199 + this.$modal.loading("正在加载服务监控数据,请稍后!");
207 } 200 }
208 } 201 }
209 }; 202 };
@@ -308,13 +308,13 @@ export default { @@ -308,13 +308,13 @@ export default {
308 if (valid) { 308 if (valid) {
309 if (this.form.configId != undefined) { 309 if (this.form.configId != undefined) {
310 updateConfig(this.form).then(response => { 310 updateConfig(this.form).then(response => {
311 - this.msgSuccess("修改成功"); 311 + this.$modal.msgSuccess("修改成功");
312 this.open = false; 312 this.open = false;
313 this.getList(); 313 this.getList();
314 }); 314 });
315 } else { 315 } else {
316 addConfig(this.form).then(response => { 316 addConfig(this.form).then(response => {
317 - this.msgSuccess("新增成功"); 317 + this.$modal.msgSuccess("新增成功");
318 this.open = false; 318 this.open = false;
319 this.getList(); 319 this.getList();
320 }); 320 });
@@ -325,36 +325,28 @@ export default { @@ -325,36 +325,28 @@ export default {
325 /** 删除按钮操作 */ 325 /** 删除按钮操作 */
326 handleDelete(row) { 326 handleDelete(row) {
327 const configIds = row.configId || this.ids; 327 const configIds = row.configId || this.ids;
328 - this.$confirm('是否确认删除参数编号为"' + configIds + '"的数据项?', "警告", {  
329 - confirmButtonText: "确定",  
330 - cancelButtonText: "取消",  
331 - type: "warning"  
332 - }).then(function() { 328 + this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function() {
333 return delConfig(configIds); 329 return delConfig(configIds);
334 }).then(() => { 330 }).then(() => {
335 this.getList(); 331 this.getList();
336 - this.msgSuccess("删除成功"); 332 + this.$modal.msgSuccess("删除成功");
337 }).catch(() => {}); 333 }).catch(() => {});
338 }, 334 },
339 /** 导出按钮操作 */ 335 /** 导出按钮操作 */
340 handleExport() { 336 handleExport() {
341 const queryParams = this.queryParams; 337 const queryParams = this.queryParams;
342 - this.$confirm('是否确认导出所有参数数据项?', "警告", {  
343 - confirmButtonText: "确定",  
344 - cancelButtonText: "取消",  
345 - type: "warning"  
346 - }).then(() => {  
347 - this.exportLoading = true;  
348 - return exportConfig(queryParams);  
349 - }).then(response => {  
350 - this.download(response.msg);  
351 - this.exportLoading = false;  
352 - }).catch(() => {}); 338 + this.$modal.confirm('是否确认导出所有参数数据项?').then(() => {
  339 + this.exportLoading = true;
  340 + return exportConfig(queryParams);
  341 + }).then(response => {
  342 + this.download(response.msg);
  343 + this.exportLoading = false;
  344 + }).catch(() => {});
353 }, 345 },
354 /** 刷新缓存按钮操作 */ 346 /** 刷新缓存按钮操作 */
355 handleRefreshCache() { 347 handleRefreshCache() {
356 refreshCache().then(() => { 348 refreshCache().then(() => {
357 - this.msgSuccess("刷新成功"); 349 + this.$modal.msgSuccess("刷新成功");
358 }); 350 });
359 } 351 }
360 } 352 }
@@ -305,13 +305,13 @@ export default { @@ -305,13 +305,13 @@ export default {
305 if (valid) { 305 if (valid) {
306 if (this.form.deptId != undefined) { 306 if (this.form.deptId != undefined) {
307 updateDept(this.form).then(response => { 307 updateDept(this.form).then(response => {
308 - this.msgSuccess("修改成功"); 308 + this.$modal.msgSuccess("修改成功");
309 this.open = false; 309 this.open = false;
310 this.getList(); 310 this.getList();
311 }); 311 });
312 } else { 312 } else {
313 addDept(this.form).then(response => { 313 addDept(this.form).then(response => {
314 - this.msgSuccess("新增成功"); 314 + this.$modal.msgSuccess("新增成功");
315 this.open = false; 315 this.open = false;
316 this.getList(); 316 this.getList();
317 }); 317 });
@@ -321,16 +321,12 @@ export default { @@ -321,16 +321,12 @@ export default {
321 }, 321 },
322 /** 删除按钮操作 */ 322 /** 删除按钮操作 */
323 handleDelete(row) { 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 };
@@ -354,13 +354,13 @@ export default { @@ -354,13 +354,13 @@ export default {
354 if (valid) { 354 if (valid) {
355 if (this.form.dictCode != undefined) { 355 if (this.form.dictCode != undefined) {
356 updateData(this.form).then(response => { 356 updateData(this.form).then(response => {
357 - this.msgSuccess("修改成功"); 357 + this.$modal.msgSuccess("修改成功");
358 this.open = false; 358 this.open = false;
359 this.getList(); 359 this.getList();
360 }); 360 });
361 } else { 361 } else {
362 addData(this.form).then(response => { 362 addData(this.form).then(response => {
363 - this.msgSuccess("新增成功"); 363 + this.$modal.msgSuccess("新增成功");
364 this.open = false; 364 this.open = false;
365 this.getList(); 365 this.getList();
366 }); 366 });
@@ -371,31 +371,23 @@ export default { @@ -371,31 +371,23 @@ export default {
371 /** 删除按钮操作 */ 371 /** 删除按钮操作 */
372 handleDelete(row) { 372 handleDelete(row) {
373 const dictCodes = row.dictCode || this.ids; 373 const dictCodes = row.dictCode || this.ids;
374 - this.$confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?', "警告", {  
375 - confirmButtonText: "确定",  
376 - cancelButtonText: "取消",  
377 - type: "warning"  
378 - }).then(function() {  
379 - return delData(dictCodes);  
380 - }).then(() => {  
381 - this.getList();  
382 - this.msgSuccess("删除成功");  
383 - }).catch(() => {}); 374 + this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
  375 + return delData(dictCodes);
  376 + }).then(() => {
  377 + this.getList();
  378 + this.$modal.msgSuccess("删除成功");
  379 + }).catch(() => {});
384 }, 380 },
385 /** 导出按钮操作 */ 381 /** 导出按钮操作 */
386 handleExport() { 382 handleExport() {
387 const queryParams = this.queryParams; 383 const queryParams = this.queryParams;
388 - this.$confirm('是否确认导出所有数据项?', "警告", {  
389 - confirmButtonText: "确定",  
390 - cancelButtonText: "取消",  
391 - type: "warning"  
392 - }).then(() => {  
393 - this.exportLoading = true;  
394 - return exportData(queryParams);  
395 - }).then(response => {  
396 - this.download(response.msg);  
397 - this.exportLoading = false;  
398 - }).catch(() => {}); 384 + this.$modal.confirm('是否确认导出所有数据项?').then(() => {
  385 + this.exportLoading = true;
  386 + return exportData(queryParams);
  387 + }).then(response => {
  388 + this.download(response.msg);
  389 + this.exportLoading = false;
  390 + }).catch(() => {});
399 } 391 }
400 } 392 }
401 }; 393 };
@@ -312,13 +312,13 @@ export default { @@ -312,13 +312,13 @@ export default {
312 if (valid) { 312 if (valid) {
313 if (this.form.dictId != undefined) { 313 if (this.form.dictId != undefined) {
314 updateType(this.form).then(response => { 314 updateType(this.form).then(response => {
315 - this.msgSuccess("修改成功"); 315 + this.$modal.msgSuccess("修改成功");
316 this.open = false; 316 this.open = false;
317 this.getList(); 317 this.getList();
318 }); 318 });
319 } else { 319 } else {
320 addType(this.form).then(response => { 320 addType(this.form).then(response => {
321 - this.msgSuccess("新增成功"); 321 + this.$modal.msgSuccess("新增成功");
322 this.open = false; 322 this.open = false;
323 this.getList(); 323 this.getList();
324 }); 324 });
@@ -329,36 +329,28 @@ export default { @@ -329,36 +329,28 @@ export default {
329 /** 删除按钮操作 */ 329 /** 删除按钮操作 */
330 handleDelete(row) { 330 handleDelete(row) {
331 const dictIds = row.dictId || this.ids; 331 const dictIds = row.dictId || this.ids;
332 - this.$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', "警告", {  
333 - confirmButtonText: "确定",  
334 - cancelButtonText: "取消",  
335 - type: "warning"  
336 - }).then(function() {  
337 - return delType(dictIds);  
338 - }).then(() => {  
339 - this.getList();  
340 - this.msgSuccess("删除成功");  
341 - }).catch(() => {}); 332 + this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
  333 + return delType(dictIds);
  334 + }).then(() => {
  335 + this.getList();
  336 + this.$modal.msgSuccess("删除成功");
  337 + }).catch(() => {});
342 }, 338 },
343 /** 导出按钮操作 */ 339 /** 导出按钮操作 */
344 handleExport() { 340 handleExport() {
345 const queryParams = this.queryParams; 341 const queryParams = this.queryParams;
346 - this.$confirm('是否确认导出所有类型数据项?', "警告", {  
347 - confirmButtonText: "确定",  
348 - cancelButtonText: "取消",  
349 - type: "warning"  
350 - }).then(() => {  
351 - this.exportLoading = true;  
352 - return exportType(queryParams);  
353 - }).then(response => {  
354 - this.download(response.msg);  
355 - this.exportLoading = false;  
356 - }).catch(() => {}); 342 + this.$modal.confirm('是否确认导出所有类型数据项?').then(() => {
  343 + this.exportLoading = true;
  344 + return exportType(queryParams);
  345 + }).then(response => {
  346 + this.download(response.msg);
  347 + this.exportLoading = false;
  348 + }).catch(() => {});
357 }, 349 },
358 /** 刷新缓存按钮操作 */ 350 /** 刷新缓存按钮操作 */
359 handleRefreshCache() { 351 handleRefreshCache() {
360 refreshCache().then(() => { 352 refreshCache().then(() => {
361 - this.msgSuccess("刷新成功"); 353 + this.$modal.msgSuccess("刷新成功");
362 }); 354 });
363 } 355 }
364 } 356 }
@@ -425,13 +425,13 @@ export default { @@ -425,13 +425,13 @@ export default {
425 if (valid) { 425 if (valid) {
426 if (this.form.menuId != undefined) { 426 if (this.form.menuId != undefined) {
427 updateMenu(this.form).then(response => { 427 updateMenu(this.form).then(response => {
428 - this.msgSuccess("修改成功"); 428 + this.$modal.msgSuccess("修改成功");
429 this.open = false; 429 this.open = false;
430 this.getList(); 430 this.getList();
431 }); 431 });
432 } else { 432 } else {
433 addMenu(this.form).then(response => { 433 addMenu(this.form).then(response => {
434 - this.msgSuccess("新增成功"); 434 + this.$modal.msgSuccess("新增成功");
435 this.open = false; 435 this.open = false;
436 this.getList(); 436 this.getList();
437 }); 437 });
@@ -441,16 +441,12 @@ export default { @@ -441,16 +441,12 @@ export default {
441 }, 441 },
442 /** 删除按钮操作 */ 442 /** 删除按钮操作 */
443 handleDelete(row) { 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 };
@@ -285,13 +285,13 @@ export default { @@ -285,13 +285,13 @@ export default {
285 if (valid) { 285 if (valid) {
286 if (this.form.noticeId != undefined) { 286 if (this.form.noticeId != undefined) {
287 updateNotice(this.form).then(response => { 287 updateNotice(this.form).then(response => {
288 - this.msgSuccess("修改成功"); 288 + this.$modal.msgSuccess("修改成功");
289 this.open = false; 289 this.open = false;
290 this.getList(); 290 this.getList();
291 }); 291 });
292 } else { 292 } else {
293 addNotice(this.form).then(response => { 293 addNotice(this.form).then(response => {
294 - this.msgSuccess("新增成功"); 294 + this.$modal.msgSuccess("新增成功");
295 this.open = false; 295 this.open = false;
296 this.getList(); 296 this.getList();
297 }); 297 });
@@ -302,16 +302,12 @@ export default { @@ -302,16 +302,12 @@ export default {
302 /** 删除按钮操作 */ 302 /** 删除按钮操作 */
303 handleDelete(row) { 303 handleDelete(row) {
304 const noticeIds = row.noticeId || this.ids 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 };
@@ -279,13 +279,13 @@ export default { @@ -279,13 +279,13 @@ export default {
279 if (valid) { 279 if (valid) {
280 if (this.form.postId != undefined) { 280 if (this.form.postId != undefined) {
281 updatePost(this.form).then(response => { 281 updatePost(this.form).then(response => {
282 - this.msgSuccess("修改成功"); 282 + this.$modal.msgSuccess("修改成功");
283 this.open = false; 283 this.open = false;
284 this.getList(); 284 this.getList();
285 }); 285 });
286 } else { 286 } else {
287 addPost(this.form).then(response => { 287 addPost(this.form).then(response => {
288 - this.msgSuccess("新增成功"); 288 + this.$modal.msgSuccess("新增成功");
289 this.open = false; 289 this.open = false;
290 this.getList(); 290 this.getList();
291 }); 291 });
@@ -296,31 +296,23 @@ export default { @@ -296,31 +296,23 @@ export default {
296 /** 删除按钮操作 */ 296 /** 删除按钮操作 */
297 handleDelete(row) { 297 handleDelete(row) {
298 const postIds = row.postId || this.ids; 298 const postIds = row.postId || this.ids;
299 - this.$confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?', "警告", {  
300 - confirmButtonText: "确定",  
301 - cancelButtonText: "取消",  
302 - type: "warning"  
303 - }).then(function() {  
304 - return delPost(postIds);  
305 - }).then(() => {  
306 - this.getList();  
307 - this.msgSuccess("删除成功");  
308 - }).catch(() => {}); 299 + this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function() {
  300 + return delPost(postIds);
  301 + }).then(() => {
  302 + this.getList();
  303 + this.$modal.msgSuccess("删除成功");
  304 + }).catch(() => {});
309 }, 305 },
310 /** 导出按钮操作 */ 306 /** 导出按钮操作 */
311 handleExport() { 307 handleExport() {
312 const queryParams = this.queryParams; 308 const queryParams = this.queryParams;
313 - this.$confirm('是否确认导出所有岗位数据项?', "警告", {  
314 - confirmButtonText: "确定",  
315 - cancelButtonText: "取消",  
316 - type: "warning"  
317 - }).then(() => {  
318 - this.exportLoading = true;  
319 - return exportPost(queryParams);  
320 - }).then(response => {  
321 - this.download(response.msg);  
322 - this.exportLoading = false;  
323 - }).catch(() => {}); 309 + this.$modal.confirm('是否确认导出所有岗位数据项?').then(() => {
  310 + this.exportLoading = true;
  311 + return exportPost(queryParams);
  312 + }).then(response => {
  313 + this.download(response.msg);
  314 + this.exportLoading = false;
  315 + }).catch(() => {});
324 } 316 }
325 } 317 }
326 }; 318 };
@@ -178,30 +178,22 @@ export default { @@ -178,30 +178,22 @@ export default {
178 /** 取消授权按钮操作 */ 178 /** 取消授权按钮操作 */
179 cancelAuthUser(row) { 179 cancelAuthUser(row) {
180 const roleId = this.queryParams.roleId; 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 return authUserCancel({ userId: row.userId, roleId: roleId }); 182 return authUserCancel({ userId: row.userId, roleId: roleId });
187 }).then(() => { 183 }).then(() => {
188 this.getList(); 184 this.getList();
189 - this.msgSuccess("取消授权成功"); 185 + this.$modal.msgSuccess("取消授权成功");
190 }).catch(() => {}); 186 }).catch(() => {});
191 }, 187 },
192 /** 批量取消授权按钮操作 */ 188 /** 批量取消授权按钮操作 */
193 cancelAuthUserAll(row) { 189 cancelAuthUserAll(row) {
194 const roleId = this.queryParams.roleId; 190 const roleId = this.queryParams.roleId;
195 const userIds = this.userIds.join(","); 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 }).then(() => { 194 }).then(() => {
203 this.getList(); 195 this.getList();
204 - this.msgSuccess("取消授权成功"); 196 + this.$modal.msgSuccess("取消授权成功");
205 }).catch(() => {}); 197 }).catch(() => {});
206 } 198 }
207 } 199 }
@@ -413,17 +413,13 @@ export default { @@ -413,17 +413,13 @@ export default {
413 // 角色状态修改 413 // 角色状态修改
414 handleStatusChange(row) { 414 handleStatusChange(row) {
415 let text = row.status === "0" ? "启用" : "停用"; 415 let text = row.status === "0" ? "启用" : "停用";
416 - this.$confirm('确认要"' + text + '""' + row.roleName + '"角色吗?', "警告", {  
417 - confirmButtonText: "确定",  
418 - cancelButtonText: "取消",  
419 - type: "warning"  
420 - }).then(function() {  
421 - return changeRoleStatus(row.roleId, row.status);  
422 - }).then(() => {  
423 - this.msgSuccess(text + "成功");  
424 - }).catch(function() {  
425 - row.status = row.status === "0" ? "1" : "0";  
426 - }); 416 + this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
  417 + return changeRoleStatus(row.roleId, row.status);
  418 + }).then(() => {
  419 + this.$modal.msgSuccess(text + "成功");
  420 + }).catch(function() {
  421 + row.status = row.status === "0" ? "1" : "0";
  422 + });
427 }, 423 },
428 // 取消按钮 424 // 取消按钮
429 cancel() { 425 cancel() {
@@ -579,14 +575,14 @@ export default { @@ -579,14 +575,14 @@ export default {
579 if (this.form.roleId != undefined) { 575 if (this.form.roleId != undefined) {
580 this.form.menuIds = this.getMenuAllCheckedKeys(); 576 this.form.menuIds = this.getMenuAllCheckedKeys();
581 updateRole(this.form).then(response => { 577 updateRole(this.form).then(response => {
582 - this.msgSuccess("修改成功"); 578 + this.$modal.msgSuccess("修改成功");
583 this.open = false; 579 this.open = false;
584 this.getList(); 580 this.getList();
585 }); 581 });
586 } else { 582 } else {
587 this.form.menuIds = this.getMenuAllCheckedKeys(); 583 this.form.menuIds = this.getMenuAllCheckedKeys();
588 addRole(this.form).then(response => { 584 addRole(this.form).then(response => {
589 - this.msgSuccess("新增成功"); 585 + this.$modal.msgSuccess("新增成功");
590 this.open = false; 586 this.open = false;
591 this.getList(); 587 this.getList();
592 }); 588 });
@@ -599,7 +595,7 @@ export default { @@ -599,7 +595,7 @@ export default {
599 if (this.form.roleId != undefined) { 595 if (this.form.roleId != undefined) {
600 this.form.deptIds = this.getDeptAllCheckedKeys(); 596 this.form.deptIds = this.getDeptAllCheckedKeys();
601 dataScope(this.form).then(response => { 597 dataScope(this.form).then(response => {
602 - this.msgSuccess("修改成功"); 598 + this.$modal.msgSuccess("修改成功");
603 this.openDataScope = false; 599 this.openDataScope = false;
604 this.getList(); 600 this.getList();
605 }); 601 });
@@ -608,31 +604,23 @@ export default { @@ -608,31 +604,23 @@ export default {
608 /** 删除按钮操作 */ 604 /** 删除按钮操作 */
609 handleDelete(row) { 605 handleDelete(row) {
610 const roleIds = row.roleId || this.ids; 606 const roleIds = row.roleId || this.ids;
611 - this.$confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?', "警告", {  
612 - confirmButtonText: "确定",  
613 - cancelButtonText: "取消",  
614 - type: "warning"  
615 - }).then(function() {  
616 - return delRole(roleIds);  
617 - }).then(() => {  
618 - this.getList();  
619 - this.msgSuccess("删除成功");  
620 - }).catch(() => {}); 607 + this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
  608 + return delRole(roleIds);
  609 + }).then(() => {
  610 + this.getList();
  611 + this.$modal.msgSuccess("删除成功");
  612 + }).catch(() => {});
621 }, 613 },
622 /** 导出按钮操作 */ 614 /** 导出按钮操作 */
623 handleExport() { 615 handleExport() {
624 const queryParams = this.queryParams; 616 const queryParams = this.queryParams;
625 - this.$confirm('是否确认导出所有角色数据项?', "警告", {  
626 - confirmButtonText: "确定",  
627 - cancelButtonText: "取消",  
628 - type: "warning"  
629 - }).then(() => {  
630 - this.exportLoading = true;  
631 - return exportRole(queryParams);  
632 - }).then(response => {  
633 - this.download(response.msg);  
634 - this.exportLoading = false;  
635 - }).catch(() => {}); 617 + this.$modal.confirm('是否确认导出所有用户数据项?').then(() => {
  618 + this.exportLoading = true;
  619 + return exportRole(queryParams);
  620 + }).then(response => {
  621 + this.download(response.msg);
  622 + this.exportLoading = false;
  623 + }).catch(() => {});
636 } 624 }
637 } 625 }
638 }; 626 };
@@ -124,7 +124,7 @@ export default { @@ -124,7 +124,7 @@ export default {
124 const roleId = this.queryParams.roleId; 124 const roleId = this.queryParams.roleId;
125 const userIds = this.userIds.join(","); 125 const userIds = this.userIds.join(",");
126 authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => { 126 authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => {
127 - this.msgSuccess(res.msg); 127 + this.$modal.msgSuccess(res.msg);
128 if (res.code === 200) { 128 if (res.code === 200) {
129 this.visible = false; 129 this.visible = false;
130 this.$emit("ok"); 130 this.$emit("ok");
@@ -103,7 +103,7 @@ export default { @@ -103,7 +103,7 @@ export default {
103 const userId = this.form.userId; 103 const userId = this.form.userId;
104 const roleIds = this.roleIds.join(","); 104 const roleIds = this.roleIds.join(",");
105 updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => { 105 updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
106 - this.msgSuccess("授权成功"); 106 + this.$modal.msgSuccess("授权成功");
107 this.close(); 107 this.close();
108 }); 108 });
109 }, 109 },
@@ -503,17 +503,13 @@ export default { @@ -503,17 +503,13 @@ export default {
503 // 用户状态修改 503 // 用户状态修改
504 handleStatusChange(row) { 504 handleStatusChange(row) {
505 let text = row.status === "0" ? "启用" : "停用"; 505 let text = row.status === "0" ? "启用" : "停用";
506 - this.$confirm('确认要"' + text + '""' + row.userName + '"用户吗?', "警告", {  
507 - confirmButtonText: "确定",  
508 - cancelButtonText: "取消",  
509 - type: "warning"  
510 - }).then(function() {  
511 - return changeUserStatus(row.userId, row.status);  
512 - }).then(() => {  
513 - this.msgSuccess(text + "成功");  
514 - }).catch(function() {  
515 - row.status = row.status === "0" ? "1" : "0";  
516 - }); 506 + this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
  507 + return changeUserStatus(row.userId, row.status);
  508 + }).then(() => {
  509 + this.$modal.msgSuccess(text + "成功");
  510 + }).catch(function() {
  511 + row.status = row.status === "0" ? "1" : "0";
  512 + });
517 }, 513 },
518 // 取消按钮 514 // 取消按钮
519 cancel() { 515 cancel() {
@@ -606,7 +602,7 @@ export default { @@ -606,7 +602,7 @@ export default {
606 inputErrorMessage: "用户密码长度必须介于 5 和 20 之间", 602 inputErrorMessage: "用户密码长度必须介于 5 和 20 之间",
607 }).then(({ value }) => { 603 }).then(({ value }) => {
608 resetUserPwd(row.userId, value).then(response => { 604 resetUserPwd(row.userId, value).then(response => {
609 - this.msgSuccess("修改成功,新密码是:" + value); 605 + this.$modal.msgSuccess("修改成功,新密码是:" + value);
610 }); 606 });
611 }).catch(() => {}); 607 }).catch(() => {});
612 }, 608 },
@@ -621,13 +617,13 @@ export default { @@ -621,13 +617,13 @@ export default {
621 if (valid) { 617 if (valid) {
622 if (this.form.userId != undefined) { 618 if (this.form.userId != undefined) {
623 updateUser(this.form).then(response => { 619 updateUser(this.form).then(response => {
624 - this.msgSuccess("修改成功"); 620 + this.$modal.msgSuccess("修改成功");
625 this.open = false; 621 this.open = false;
626 this.getList(); 622 this.getList();
627 }); 623 });
628 } else { 624 } else {
629 addUser(this.form).then(response => { 625 addUser(this.form).then(response => {
630 - this.msgSuccess("新增成功"); 626 + this.$modal.msgSuccess("新增成功");
631 this.open = false; 627 this.open = false;
632 this.getList(); 628 this.getList();
633 }); 629 });
@@ -638,31 +634,23 @@ export default { @@ -638,31 +634,23 @@ export default {
638 /** 删除按钮操作 */ 634 /** 删除按钮操作 */
639 handleDelete(row) { 635 handleDelete(row) {
640 const userIds = row.userId || this.ids; 636 const userIds = row.userId || this.ids;
641 - this.$confirm('是否确认删除用户编号为"' + userIds + '"的数据项?', "警告", {  
642 - confirmButtonText: "确定",  
643 - cancelButtonText: "取消",  
644 - type: "warning"  
645 - }).then(function() {  
646 - return delUser(userIds);  
647 - }).then(() => {  
648 - this.getList();  
649 - this.msgSuccess("删除成功");  
650 - }).catch(() => {}); 637 + this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
  638 + return delUser(userIds);
  639 + }).then(() => {
  640 + this.getList();
  641 + this.$modal.msgSuccess("删除成功");
  642 + }).catch(() => {});
651 }, 643 },
652 /** 导出按钮操作 */ 644 /** 导出按钮操作 */
653 handleExport() { 645 handleExport() {
654 const queryParams = this.queryParams; 646 const queryParams = this.queryParams;
655 - this.$confirm('是否确认导出所有用户数据项?', "警告", {  
656 - confirmButtonText: "确定",  
657 - cancelButtonText: "取消",  
658 - type: "warning"  
659 - }).then(() => {  
660 - this.exportLoading = true;  
661 - return exportUser(queryParams);  
662 - }).then(response => {  
663 - this.download(response.msg);  
664 - this.exportLoading = false;  
665 - }).catch(() => {}); 647 + this.$modal.confirm('是否确认导出所有用户数据项?').then(() => {
  648 + this.exportLoading = true;
  649 + return exportUser(queryParams);
  650 + }).then(response => {
  651 + this.download(response.msg);
  652 + this.exportLoading = false;
  653 + }).catch(() => {});
666 }, 654 },
667 /** 导入按钮操作 */ 655 /** 导入按钮操作 */
668 handleImport() { 656 handleImport() {
@@ -57,7 +57,7 @@ export default { @@ -57,7 +57,7 @@ export default {
57 if (valid) { 57 if (valid) {
58 updateUserPwd(this.user.oldPassword, this.user.newPassword).then( 58 updateUserPwd(this.user.oldPassword, this.user.newPassword).then(
59 response => { 59 response => {
60 - this.msgSuccess("修改成功"); 60 + this.$modal.msgSuccess("修改成功");
61 } 61 }
62 ); 62 );
63 } 63 }
@@ -110,7 +110,7 @@ export default { @@ -110,7 +110,7 @@ export default {
110 // 上传预处理 110 // 上传预处理
111 beforeUpload(file) { 111 beforeUpload(file) {
112 if (file.type.indexOf("image/") == -1) { 112 if (file.type.indexOf("image/") == -1) {
113 - this.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。"); 113 + this.$modal.msgError("文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。");
114 } else { 114 } else {
115 const reader = new FileReader(); 115 const reader = new FileReader();
116 reader.readAsDataURL(file); 116 reader.readAsDataURL(file);
@@ -128,7 +128,7 @@ export default { @@ -128,7 +128,7 @@ export default {
128 this.open = false; 128 this.open = false;
129 this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl; 129 this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
130 store.commit('SET_AVATAR', this.options.img); 130 store.commit('SET_AVATAR', this.options.img);
131 - this.msgSuccess("修改成功"); 131 + this.$modal.msgSuccess("修改成功");
132 this.visible = false; 132 this.visible = false;
133 }); 133 });
134 }); 134 });
@@ -62,7 +62,7 @@ export default { @@ -62,7 +62,7 @@ export default {
62 this.$refs["form"].validate(valid => { 62 this.$refs["form"].validate(valid => {
63 if (valid) { 63 if (valid) {
64 updateUserProfile(this.user).then(response => { 64 updateUserProfile(this.user).then(response => {
65 - this.msgSuccess("修改成功"); 65 + this.$modal.msgSuccess("修改成功");
66 }); 66 });
67 } 67 }
68 }); 68 });
@@ -192,13 +192,13 @@ export default { @@ -192,13 +192,13 @@ export default {
192 parentMenuId: genTable.parentMenuId 192 parentMenuId: genTable.parentMenuId
193 }; 193 };
194 updateGenTable(genTable).then(res => { 194 updateGenTable(genTable).then(res => {
195 - this.msgSuccess(res.msg); 195 + this.$modal.msgSuccess(res.msg);
196 if (res.code === 200) { 196 if (res.code === 200) {
197 this.close(); 197 this.close();
198 } 198 }
199 }); 199 });
200 } else { 200 } else {
201 - this.msgError("表单校验未通过,请重新检查提交内容"); 201 + this.$modal.msgError("表单校验未通过,请重新检查提交内容");
202 } 202 }
203 }); 203 });
204 }, 204 },
@@ -104,8 +104,13 @@ export default { @@ -104,8 +104,13 @@ export default {
104 }, 104 },
105 /** 导入按钮操作 */ 105 /** 导入按钮操作 */
106 handleImportTable() { 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 if (res.code === 200) { 114 if (res.code === 200) {
110 this.visible = false; 115 this.visible = false;
111 this.$emit("ok"); 116 this.$emit("ok");
@@ -262,12 +262,12 @@ export default { @@ -262,12 +262,12 @@ export default {
262 handleGenTable(row) { 262 handleGenTable(row) {
263 const tableNames = row.tableName || this.tableNames; 263 const tableNames = row.tableName || this.tableNames;
264 if (tableNames == "") { 264 if (tableNames == "") {
265 - this.msgError("请选择要生成的数据"); 265 + this.$modal.msgError("请选择要生成的数据");
266 return; 266 return;
267 } 267 }
268 if(row.genType === "1") { 268 if(row.genType === "1") {
269 genCode(row.tableName).then(response => { 269 genCode(row.tableName).then(response => {
270 - this.msgSuccess("成功生成到自定义路径:" + row.genPath); 270 + this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath);
271 }); 271 });
272 } else { 272 } else {
273 downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); 273 downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi");
@@ -276,14 +276,10 @@ export default { @@ -276,14 +276,10 @@ export default {
276 /** 同步数据库操作 */ 276 /** 同步数据库操作 */
277 handleSynchDb(row) { 277 handleSynchDb(row) {
278 const tableName = row.tableName; 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 }).then(() => { 281 }).then(() => {
286 - this.msgSuccess("同步成功"); 282 + this.$modal.msgSuccess("同步成功");
287 }).catch(() => {}); 283 }).catch(() => {});
288 }, 284 },
289 /** 打开导入表弹窗 */ 285 /** 打开导入表弹窗 */
@@ -326,15 +322,11 @@ export default { @@ -326,15 +322,11 @@ export default {
326 /** 删除按钮操作 */ 322 /** 删除按钮操作 */
327 handleDelete(row) { 323 handleDelete(row) {
328 const tableIds = row.tableId || this.ids; 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 }).then(() => { 327 }).then(() => {
336 - this.getList();  
337 - this.msgSuccess("删除成功"); 328 + this.getList();
  329 + this.$modal.msgSuccess("删除成功");
338 }).catch(() => {}); 330 }).catch(() => {});
339 } 331 }
340 } 332 }