From 03b31652a2179f812a63af77077d826fdf05bc12 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期四, 23 九月 2021 18:53:17 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev --- ruoyi-ui/src/views/monitor/online/index.vue | 16 ruoyi-ui/src/views/monitor/job/log.vue | 32 - ruoyi-ui/src/views/tool/gen/index.vue | 26 - ruoyi-ui/src/views/monitor/cache/index.vue | 11 ruoyi-ui/src/views/system/role/index.vue | 40 +- ruoyi-ui/src/layout/components/Settings/index.vue | 24 - ruoyi-ui/src/views/system/menu/index.vue | 20 ruoyi-ui/src/views/system/user/index.vue | 40 +- ruoyi-ui/src/views/system/user/authRole.vue | 6 ruoyi-ui/src/views/system/dict/index.vue | 22 - ruoyi-ui/src/views/tool/gen/editTable.vue | 4 ruoyi-ui/src/main.js | 17 - ruoyi-ui/src/plugins/index.js | 11 ruoyi-ui/src/views/system/user/profile/userAvatar.vue | 6 ruoyi-ui/src/views/monitor/logininfor/index.vue | 32 - ruoyi-ui/src/views/system/user/profile/userInfo.vue | 4 ruoyi-ui/src/plugins/cache.js | 77 +++++ ruoyi-ui/src/views/system/post/index.vue | 20 ruoyi-ui/src/views/system/dict/data.vue | 20 ruoyi-ui/src/views/system/role/selectUser.vue | 2 ruoyi-ui/src/views/tool/gen/importTable.vue | 9 ruoyi-ui/src/views/system/role/authUser.vue | 18 - ruoyi-ui/src/views/system/user/profile/resetPwd.vue | 2 ruoyi-ui/src/views/system/notice/index.vue | 20 ruoyi-generator/src/main/resources/vm/vue/index.vue.vm | 24 - ruoyi-ui/src/views/system/dept/index.vue | 20 ruoyi-ui/src/views/monitor/job/index.vue | 54 +-- ruoyi-ui/src/views/monitor/operlog/index.vue | 32 - ruoyi-ui/src/views/system/config/index.vue | 14 ruoyi-ui/src/plugins/modal.js | 75 +++++ ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm | 24 - 31 files changed, 377 insertions(+), 345 deletions(-) diff --git a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm index 0d83a3c..c159016 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index-tree.vue.vm @@ -451,7 +451,7 @@ #end if (this.form.${pkColumn.javaField} != null) { update${BusinessName}(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.#[[$modal]]#.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }).finally(() => { @@ -459,7 +459,7 @@ }); } else { add${BusinessName}(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.#[[$modal]]#.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }).finally(() => { @@ -471,19 +471,15 @@ }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { - this.$confirm('鏄惁纭鍒犻櫎${functionName}缂栧彿涓�"' + row.${pkColumn.javaField} + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(() => { - this.loading = true; - return del${BusinessName}(row.${pkColumn.javaField}); - }).then(() => { - this.loading = false; - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); + this.#[[$modal]]#.confirm('鏄惁纭鍒犻櫎${functionName}缂栧彿涓�"' + row.${pkColumn.javaField} + '"鐨勬暟鎹」锛�').then(() => { + this.loading = true; + return del${BusinessName}(row.${pkColumn.javaField}); + }).then(() => { + this.loading = false; + this.getList(); + this.#[[$modal]]#.msgSuccess("鍒犻櫎鎴愬姛"); }).finally(() => { - this.loading = false; + this.loading = false; }); } } diff --git a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm index 7e67021..1644929 100644 --- a/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm +++ b/ruoyi-generator/src/main/resources/vm/vue/index.vue.vm @@ -506,7 +506,7 @@ #end if (this.form.${pkColumn.javaField} != null) { update${BusinessName}(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.#[[$modal]]#.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }).finally(() => { @@ -514,7 +514,7 @@ }); } else { add${BusinessName}(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.#[[$modal]]#.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }).finally(() => { @@ -527,19 +527,15 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids; - this.$confirm('鏄惁纭鍒犻櫎${functionName}缂栧彿涓�"' + ${pkColumn.javaField}s + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(() => { - this.loading = true; - return del${BusinessName}(${pkColumn.javaField}s); - }).then(() => { - this.loading = false; - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); + this.#[[$modal]]#.confirm('鏄惁纭鍒犻櫎${functionName}缂栧彿涓�"' + ${pkColumn.javaField}s + '"鐨勬暟鎹」锛�').then(() => { + this.loading = true; + return del${BusinessName}(${pkColumn.javaField}s); + }).then(() => { + this.loading = false; + this.getList(); + this.#[[$modal]]#.msgSuccess("鍒犻櫎鎴愬姛"); }).finally(() => { - this.loading = false; + this.loading = false; }); }, #if($table.sub) diff --git a/ruoyi-ui/src/layout/components/Settings/index.vue b/ruoyi-ui/src/layout/components/Settings/index.vue index a96b73f..ffdedb4 100644 --- a/ruoyi-ui/src/layout/components/Settings/index.vue +++ b/ruoyi-ui/src/layout/components/Settings/index.vue @@ -41,7 +41,7 @@ <el-divider/> <h3 class="drawer-title">绯荤粺甯冨眬閰嶇疆</h3> - + <div class="drawer-item"> <span>寮�鍚� TopNav</span> <el-switch v-model="topNav" class="drawer-switch" /> @@ -162,14 +162,8 @@ this.sideTheme = val; }, saveSetting() { - const loading = this.$loading({ - lock: true, - fullscreen: false, - text: "姝e湪淇濆瓨鍒版湰鍦帮紝璇风◢鍚�...", - spinner: "el-icon-loading", - background: "rgba(0, 0, 0, 0.7)" - }); - localStorage.setItem( + this.$modal.loading("姝e湪淇濆瓨鍒版湰鍦帮紝璇风◢鍚�..."); + this.$cache.local.set( "layout-setting", `{ "topNav":${this.topNav}, @@ -181,17 +175,11 @@ "theme":"${this.theme}" }` ); - setTimeout(loading.close(), 1000) + setTimeout(this.$modal.closeLoading(), 1000) }, resetSetting() { - this.$loading({ - lock: true, - fullscreen: false, - text: "姝e湪娓呴櫎璁剧疆缂撳瓨骞跺埛鏂帮紝璇风◢鍚�...", - spinner: "el-icon-loading", - background: "rgba(0, 0, 0, 0.7)" - }); - localStorage.removeItem("layout-setting") + this.$modal.loading("姝e湪娓呴櫎璁剧疆缂撳瓨骞跺埛鏂帮紝璇风◢鍚�..."); + this.$cache.local.remove("layout-setting") setTimeout("window.location.reload()", 1000) } } diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index b1862cf..6024266 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -11,6 +11,7 @@ import store from './store' import router from './router' import directive from './directive' //directive +import plugins from './plugins' // plugins import './assets/icons' // icon import './permission' // permission control @@ -18,6 +19,7 @@ import { getConfigKey } from "@/api/system/config"; import { downLoadExcel } from "@/utils/download"; import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; +// 鍒嗛〉缁勪欢 import Pagination from "@/components/Pagination"; // 鑷畾涔夎〃鏍煎伐鍏风粍浠� import RightToolbar from "@/components/RightToolbar" @@ -42,20 +44,8 @@ Vue.prototype.addDateRange = addDateRange Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabels = selectDictLabels -Vue.prototype.handleTree = handleTree Vue.prototype.downLoadExcel = downLoadExcel - -Vue.prototype.msgSuccess = function (msg) { - this.$message({ showClose: true, message: msg, type: "success" }); -} - -Vue.prototype.msgError = function (msg) { - this.$message({ showClose: true, message: msg, type: "error" }); -} - -Vue.prototype.msgInfo = function (msg) { - this.$message.info(msg); -} +Vue.prototype.handleTree = handleTree // 鍏ㄥ眬缁勪欢鎸傝浇 Vue.component('DictTag', DictTag) @@ -66,6 +56,7 @@ Vue.component('ImageUpload', ImageUpload) Vue.use(directive) +Vue.use(plugins) Vue.use(VueMeta) DictData.install() diff --git a/ruoyi-ui/src/plugins/cache.js b/ruoyi-ui/src/plugins/cache.js new file mode 100644 index 0000000..6f71b8e --- /dev/null +++ b/ruoyi-ui/src/plugins/cache.js @@ -0,0 +1,77 @@ +const sessionCache = { + set (key, value) { + if (!sessionStorage) { + return + } + if (key != null && value != null) { + sessionStorage.setItem(key, value) + } + }, + get (key) { + if (!sessionStorage) { + return null + } + if (key == null) { + return null + } + return sessionStorage.getItem(key) + }, + setJSON (key, jsonValue) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)) + } + }, + getJSON (key) { + const value = this.get(key) + if (value != null) { + return JSON.parse(value) + } + }, + remove (key) { + sessionStorage.removeItem(key); + } +} +const localCache = { + set (key, value) { + if (!localStorage) { + return + } + if (key != null && value != null) { + localStorage.setItem(key, value) + } + }, + get (key) { + if (!localStorage) { + return null + } + if (key == null) { + return null + } + return localStorage.getItem(key) + }, + setJSON (key, jsonValue) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)) + } + }, + getJSON (key) { + const value = this.get(key) + if (value != null) { + return JSON.parse(value) + } + }, + remove (key) { + localStorage.removeItem(key); + } +} + +export default { + /** + * 浼氳瘽绾х紦瀛� + */ + session: sessionCache, + /** + * 鏈湴缂撳瓨 + */ + local: localCache +} diff --git a/ruoyi-ui/src/plugins/index.js b/ruoyi-ui/src/plugins/index.js new file mode 100644 index 0000000..15d829b --- /dev/null +++ b/ruoyi-ui/src/plugins/index.js @@ -0,0 +1,11 @@ +import cache from './cache' +import modal from './modal' + +export default { + install(Vue) { + // 缂撳瓨瀵硅薄 + Vue.prototype.$cache = cache + // 妯℃�佹瀵硅薄 + Vue.prototype.$modal = modal + } +} diff --git a/ruoyi-ui/src/plugins/modal.js b/ruoyi-ui/src/plugins/modal.js new file mode 100644 index 0000000..7df61a8 --- /dev/null +++ b/ruoyi-ui/src/plugins/modal.js @@ -0,0 +1,75 @@ +import { Message, MessageBox, Notification, Loading } from 'element-ui' + +let loadingInstance; + +export default { + // 娑堟伅鎻愮ず + msg(content) { + Message.info(content) + }, + // 閿欒娑堟伅 + msgError(content) { + Message.error(content) + }, + // 鎴愬姛娑堟伅 + msgSuccess(content) { + Message.success(content) + }, + // 璀﹀憡娑堟伅 + msgWarning(content) { + Message.warning(content) + }, + // 寮瑰嚭鎻愮ず + alert(content) { + MessageBox.alert(content, "绯荤粺鎻愮ず") + }, + // 閿欒鎻愮ず + alertError(content) { + MessageBox.alert(content, "绯荤粺鎻愮ず", { type: 'error' }) + }, + // 鎴愬姛鎻愮ず + alertSuccess(content) { + MessageBox.alert(content, "绯荤粺鎻愮ず", { type: 'success' }) + }, + // 璀﹀憡鎻愮ず + alertWarning(content) { + MessageBox.alert(content, "绯荤粺鎻愮ず", { type: 'warning' }) + }, + // 閫氱煡鎻愮ず + notify(content) { + Notification.info(content) + }, + // 閿欒閫氱煡 + notifyError(content) { + Notification.error(content); + }, + // 鎴愬姛閫氱煡 + notifySuccess(content) { + Notification.success(content) + }, + // 璀﹀憡閫氱煡 + notifyWarning(content) { + Notification.warning(content) + }, + // 纭绐椾綋 + confirm(content) { + return MessageBox.confirm(content, "绯荤粺鎻愮ず", { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: "warning", + }) + }, + // 鎵撳紑閬僵灞� + loading(content) { + loadingInstance = Loading.service({ + lock: true, + text: content, + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }) + }, + // 鍏抽棴閬僵灞� + closeLoading() { + loadingInstance.close(); + } +} diff --git a/ruoyi-ui/src/views/monitor/cache/index.vue b/ruoyi-ui/src/views/monitor/cache/index.vue index 98eed22..36957ed 100644 --- a/ruoyi-ui/src/views/monitor/cache/index.vue +++ b/ruoyi-ui/src/views/monitor/cache/index.vue @@ -74,8 +74,6 @@ name: "Server", data() { return { - // 鍔犺浇灞備俊鎭� - loading: [], // 缁熻鍛戒护淇℃伅 commandstats: null, // 浣跨敤鍐呭瓨 @@ -93,7 +91,7 @@ getList() { getCache().then((response) => { this.cache = response.data; - this.loading.close(); + this.$modal.closeLoading(); this.commandstats = echarts.init(this.$refs.commandstats, "macarons"); this.commandstats.setOption({ @@ -141,12 +139,7 @@ }, // 鎵撳紑鍔犺浇灞� openLoading() { - this.loading = this.$loading({ - lock: true, - text: "鎷煎懡璇诲彇涓�", - spinner: "el-icon-loading", - background: "rgba(0, 0, 0, 0.7)", - }); + this.$modal.loading("姝e湪鍔犺浇缂撳瓨鐩戞帶鏁版嵁锛岃绋嶅悗锛�"); }, }, }; diff --git a/ruoyi-ui/src/views/monitor/job/index.vue b/ruoyi-ui/src/views/monitor/job/index.vue index a3738d6..33d416e 100644 --- a/ruoyi-ui/src/views/monitor/job/index.vue +++ b/ruoyi-ui/src/views/monitor/job/index.vue @@ -240,7 +240,7 @@ </div> </el-dialog> - <el-dialog title="Cron琛ㄨ揪寮忕敓鎴愬櫒" :visible.sync="openCron" append-to-body class="scrollbar" destroy-on-close > + <el-dialog title="Cron琛ㄨ揪寮忕敓鎴愬櫒" :visible.sync="openCron" append-to-body destroy-on-close class="scrollbar"> <crontab @hide="openCron=false" @fill="crontabFill" :expression="expression"></crontab> </el-dialog> @@ -425,29 +425,21 @@ // 浠诲姟鐘舵�佷慨鏀� handleStatusChange(row) { let text = row.status === "0" ? "鍚敤" : "鍋滅敤"; - this.$confirm('纭瑕�"' + text + '""' + row.jobName + '"浠诲姟鍚�?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return changeJobStatus(row.jobId, row.status); - }).then(() => { - this.msgSuccess(text + "鎴愬姛"); - }).catch(function() { - row.status = row.status === "0" ? "1" : "0"; - }); + this.$modal.confirm('纭瑕�"' + text + '""' + row.jobName + '"浠诲姟鍚楋紵').then(function() { + return changeJobStatus(row.jobId, row.status); + }).then(() => { + this.$modal.msgSuccess(text + "鎴愬姛"); + }).catch(function() { + row.status = row.status === "0" ? "1" : "0"; + }); }, /* 绔嬪嵆鎵ц涓�娆� */ handleRun(row) { - this.$confirm('纭瑕佺珛鍗虫墽琛屼竴娆�"' + row.jobName + '"浠诲姟鍚�?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return runJob(row.jobId, row.jobGroup); - }).then(() => { - this.msgSuccess("鎵ц鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('纭瑕佺珛鍗虫墽琛屼竴娆�"' + row.jobName + '"浠诲姟鍚楋紵').then(function() { + return runJob(row.jobId, row.jobGroup); + }).then(() => { + this.$modal.msgSuccess("鎵ц鎴愬姛"); + }).catch(() => {}); }, /** 浠诲姟璇︾粏淇℃伅 */ handleView(row) { @@ -492,13 +484,13 @@ if (valid) { if (this.form.jobId != undefined) { updateJob(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addJob(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -509,16 +501,12 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const jobIds = row.jobId || this.ids; - this.$confirm('鏄惁纭鍒犻櫎瀹氭椂浠诲姟缂栧彿涓�"' + jobIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delJob(jobIds); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎瀹氭椂浠诲姟缂栧彿涓�"' + jobIds + '"鐨勬暟鎹」锛�').then(function() { + return delJob(jobIds); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { diff --git a/ruoyi-ui/src/views/monitor/job/log.vue b/ruoyi-ui/src/views/monitor/job/log.vue index db943d1..7f2e72e 100644 --- a/ruoyi-ui/src/views/monitor/job/log.vue +++ b/ruoyi-ui/src/views/monitor/job/log.vue @@ -275,29 +275,21 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const jobLogIds = this.ids; - this.$confirm('鏄惁纭鍒犻櫎璋冨害鏃ュ織缂栧彿涓�"' + jobLogIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delJobLog(jobLogIds); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎璋冨害鏃ュ織缂栧彿涓�"' + jobLogIds + '"鐨勬暟鎹」锛�').then(function() { + return delJobLog(jobLogIds); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); }, /** 娓呯┖鎸夐挳鎿嶄綔 */ handleClean() { - this.$confirm("鏄惁纭娓呯┖鎵�鏈夎皟搴︽棩蹇楁暟鎹」?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return cleanJobLog(); - }).then(() => { - this.getList(); - this.msgSuccess("娓呯┖鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭娓呯┖鎵�鏈夎皟搴︽棩蹇楁暟鎹」锛�').then(function() { + return cleanJobLog(); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("娓呯┖鎴愬姛"); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { diff --git a/ruoyi-ui/src/views/monitor/logininfor/index.vue b/ruoyi-ui/src/views/monitor/logininfor/index.vue index 576cef2..2b83181 100644 --- a/ruoyi-ui/src/views/monitor/logininfor/index.vue +++ b/ruoyi-ui/src/views/monitor/logininfor/index.vue @@ -198,29 +198,21 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const infoIds = row.infoId || this.ids; - this.$confirm('鏄惁纭鍒犻櫎璁块棶缂栧彿涓�"' + infoIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delLogininfor(infoIds); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎璁块棶缂栧彿涓�"' + infoIds + '"鐨勬暟鎹」锛�').then(function() { + return delLogininfor(infoIds); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); }, /** 娓呯┖鎸夐挳鎿嶄綔 */ handleClean() { - this.$confirm('鏄惁纭娓呯┖鎵�鏈夌櫥褰曟棩蹇楁暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return cleanLogininfor(); - }).then(() => { - this.getList(); - this.msgSuccess("娓呯┖鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭娓呯┖鎵�鏈夌櫥褰曟棩蹇楁暟鎹」锛�').then(function() { + return cleanLogininfor(); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("娓呯┖鎴愬姛"); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { diff --git a/ruoyi-ui/src/views/monitor/online/index.vue b/ruoyi-ui/src/views/monitor/online/index.vue index 64aa25c..509fbe5 100644 --- a/ruoyi-ui/src/views/monitor/online/index.vue +++ b/ruoyi-ui/src/views/monitor/online/index.vue @@ -111,16 +111,12 @@ }, /** 寮洪��鎸夐挳鎿嶄綔 */ handleForceLogout(row) { - this.$confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return forceLogout(row.tokenId); - }).then(() => { - this.getList(); - this.msgSuccess("寮洪��鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勬暟鎹」锛�').then(function() { + return forceLogout(row.tokenId); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("寮洪��鎴愬姛"); + }).catch(() => {}); } } }; diff --git a/ruoyi-ui/src/views/monitor/operlog/index.vue b/ruoyi-ui/src/views/monitor/operlog/index.vue index b4d7a0f..fafaf60 100644 --- a/ruoyi-ui/src/views/monitor/operlog/index.vue +++ b/ruoyi-ui/src/views/monitor/operlog/index.vue @@ -285,29 +285,21 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const operIds = row.operId || this.ids; - this.$confirm('鏄惁纭鍒犻櫎鏃ュ織缂栧彿涓�"' + operIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delOperlog(operIds); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎鏃ュ織缂栧彿涓�"' + operIds + '"鐨勬暟鎹」锛�').then(function() { + return delOperlog(operIds); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); }, /** 娓呯┖鎸夐挳鎿嶄綔 */ handleClean() { - this.$confirm('鏄惁纭娓呯┖鎵�鏈夋搷浣滄棩蹇楁暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return cleanOperlog(); - }).then(() => { - this.getList(); - this.msgSuccess("娓呯┖鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭娓呯┖鎵�鏈夋搷浣滄棩蹇楁暟鎹」锛�').then(function() { + return cleanOperlog(); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("娓呯┖鎴愬姛"); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { diff --git a/ruoyi-ui/src/views/system/config/index.vue b/ruoyi-ui/src/views/system/config/index.vue index e2cfb1a..c4029c3 100644 --- a/ruoyi-ui/src/views/system/config/index.vue +++ b/ruoyi-ui/src/views/system/config/index.vue @@ -308,13 +308,13 @@ if (valid) { if (this.form.configId != undefined) { updateConfig(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addConfig(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -325,15 +325,11 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const configIds = row.configId || this.ids; - this.$confirm('鏄惁纭鍒犻櫎鍙傛暟缂栧彿涓�"' + configIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { + this.$modal.confirm('鏄惁纭鍒犻櫎鍙傛暟缂栧彿涓�"' + configIds + '"鐨勬暟鎹」锛�').then(function() { return delConfig(configIds); }).then(() => { this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ @@ -343,7 +339,7 @@ /** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */ handleRefreshCache() { refreshCache().then(() => { - this.msgSuccess("鍒锋柊鎴愬姛"); + this.$modal.msgSuccess("鍒锋柊鎴愬姛"); }); } } diff --git a/ruoyi-ui/src/views/system/dept/index.vue b/ruoyi-ui/src/views/system/dept/index.vue index 591ba75..f9c7741 100644 --- a/ruoyi-ui/src/views/system/dept/index.vue +++ b/ruoyi-ui/src/views/system/dept/index.vue @@ -305,13 +305,13 @@ if (valid) { if (this.form.deptId != undefined) { updateDept(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addDept(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -321,16 +321,12 @@ }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { - this.$confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.deptName + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delDept(row.deptId); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.deptName + '"鐨勬暟鎹」锛�').then(function() { + return delDept(row.deptId); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); } } }; diff --git a/ruoyi-ui/src/views/system/dict/data.vue b/ruoyi-ui/src/views/system/dict/data.vue index 6b17756..3f0b5e0 100644 --- a/ruoyi-ui/src/views/system/dict/data.vue +++ b/ruoyi-ui/src/views/system/dict/data.vue @@ -354,13 +354,13 @@ if (valid) { if (this.form.dictCode != undefined) { updateData(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addData(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -371,16 +371,12 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const dictCodes = row.dictCode || this.ids; - this.$confirm('鏄惁纭鍒犻櫎瀛楀吀缂栫爜涓�"' + dictCodes + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delData(dictCodes); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎瀛楀吀缂栫爜涓�"' + dictCodes + '"鐨勬暟鎹」锛�').then(function() { + return delData(dictCodes); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { diff --git a/ruoyi-ui/src/views/system/dict/index.vue b/ruoyi-ui/src/views/system/dict/index.vue index a8dd1e6..c1c6649 100644 --- a/ruoyi-ui/src/views/system/dict/index.vue +++ b/ruoyi-ui/src/views/system/dict/index.vue @@ -312,13 +312,13 @@ if (valid) { if (this.form.dictId != undefined) { updateType(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addType(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -329,16 +329,12 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const dictIds = row.dictId || this.ids; - this.$confirm('鏄惁纭鍒犻櫎瀛楀吀缂栧彿涓�"' + dictIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delType(dictIds); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎瀛楀吀缂栧彿涓�"' + dictIds + '"鐨勬暟鎹」锛�').then(function() { + return delType(dictIds); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { @@ -347,7 +343,7 @@ /** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */ handleRefreshCache() { refreshCache().then(() => { - this.msgSuccess("鍒锋柊鎴愬姛"); + this.$modal.msgSuccess("鍒锋柊鎴愬姛"); }); } } diff --git a/ruoyi-ui/src/views/system/menu/index.vue b/ruoyi-ui/src/views/system/menu/index.vue index d7d4c0f..a89e1ee 100644 --- a/ruoyi-ui/src/views/system/menu/index.vue +++ b/ruoyi-ui/src/views/system/menu/index.vue @@ -425,13 +425,13 @@ if (valid) { if (this.form.menuId != undefined) { updateMenu(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addMenu(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -441,16 +441,12 @@ }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { - this.$confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.menuName + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delMenu(row.menuId); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.menuName + '"鐨勬暟鎹」锛�').then(function() { + return delMenu(row.menuId); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); } } }; diff --git a/ruoyi-ui/src/views/system/notice/index.vue b/ruoyi-ui/src/views/system/notice/index.vue index 7b65e9e..9c793f5 100644 --- a/ruoyi-ui/src/views/system/notice/index.vue +++ b/ruoyi-ui/src/views/system/notice/index.vue @@ -285,13 +285,13 @@ if (valid) { if (this.form.noticeId != undefined) { updateNotice(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addNotice(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -302,16 +302,12 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const noticeIds = row.noticeId || this.ids - this.$confirm('鏄惁纭鍒犻櫎鍏憡缂栧彿涓�"' + noticeIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delNotice(noticeIds); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎鍏憡缂栧彿涓�"' + noticeIds + '"鐨勬暟鎹」锛�').then(function() { + return delNotice(noticeIds); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); } } }; diff --git a/ruoyi-ui/src/views/system/post/index.vue b/ruoyi-ui/src/views/system/post/index.vue index 3f6874b..66fa209 100644 --- a/ruoyi-ui/src/views/system/post/index.vue +++ b/ruoyi-ui/src/views/system/post/index.vue @@ -279,13 +279,13 @@ if (valid) { if (this.form.postId != undefined) { updatePost(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addPost(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -296,16 +296,12 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const postIds = row.postId || this.ids; - this.$confirm('鏄惁纭鍒犻櫎宀椾綅缂栧彿涓�"' + postIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delPost(postIds); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎宀椾綅缂栧彿涓�"' + postIds + '"鐨勬暟鎹」锛�').then(function() { + return delPost(postIds); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { diff --git a/ruoyi-ui/src/views/system/role/authUser.vue b/ruoyi-ui/src/views/system/role/authUser.vue index 661c369..e18ea8b 100644 --- a/ruoyi-ui/src/views/system/role/authUser.vue +++ b/ruoyi-ui/src/views/system/role/authUser.vue @@ -178,30 +178,22 @@ /** 鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */ cancelAuthUser(row) { const roleId = this.queryParams.roleId; - this.$confirm('纭瑕佸彇娑堣鐢ㄦ埛"' + row.userName + '"瑙掕壊鍚楋紵', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { + this.$modal.confirm('纭瑕佸彇娑堣鐢ㄦ埛"' + row.userName + '"瑙掕壊鍚楋紵').then(function() { return authUserCancel({ userId: row.userId, roleId: roleId }); }).then(() => { this.getList(); - this.msgSuccess("鍙栨秷鎺堟潈鎴愬姛"); + this.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛"); }).catch(() => {}); }, /** 鎵归噺鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */ cancelAuthUserAll(row) { const roleId = this.queryParams.roleId; const userIds = this.userIds.join(","); - this.$confirm('鏄惁鍙栨秷閫変腑鐢ㄦ埛鎺堟潈鏁版嵁椤�?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(() => { - return authUserCancelAll({ roleId: roleId, userIds: userIds }); + this.$modal.confirm('鏄惁鍙栨秷閫変腑鐢ㄦ埛鎺堟潈鏁版嵁椤癸紵').then(function() { + return authUserCancelAll({ roleId: roleId, userIds: userIds }); }).then(() => { this.getList(); - this.msgSuccess("鍙栨秷鎺堟潈鎴愬姛"); + this.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛"); }).catch(() => {}); } } diff --git a/ruoyi-ui/src/views/system/role/index.vue b/ruoyi-ui/src/views/system/role/index.vue index 1aee567..2ad1cdb 100644 --- a/ruoyi-ui/src/views/system/role/index.vue +++ b/ruoyi-ui/src/views/system/role/index.vue @@ -413,17 +413,13 @@ // 瑙掕壊鐘舵�佷慨鏀� handleStatusChange(row) { let text = row.status === "0" ? "鍚敤" : "鍋滅敤"; - this.$confirm('纭瑕�"' + text + '""' + row.roleName + '"瑙掕壊鍚�?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return changeRoleStatus(row.roleId, row.status); - }).then(() => { - this.msgSuccess(text + "鎴愬姛"); - }).catch(function() { - row.status = row.status === "0" ? "1" : "0"; - }); + this.$modal.confirm('纭瑕�"' + text + '""' + row.roleName + '"瑙掕壊鍚楋紵').then(function() { + return changeRoleStatus(row.roleId, row.status); + }).then(() => { + this.$modal.msgSuccess(text + "鎴愬姛"); + }).catch(function() { + row.status = row.status === "0" ? "1" : "0"; + }); }, // 鍙栨秷鎸夐挳 cancel() { @@ -579,14 +575,14 @@ if (this.form.roleId != undefined) { this.form.menuIds = this.getMenuAllCheckedKeys(); updateRole(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { this.form.menuIds = this.getMenuAllCheckedKeys(); addRole(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -599,7 +595,7 @@ if (this.form.roleId != undefined) { this.form.deptIds = this.getDeptAllCheckedKeys(); dataScope(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.openDataScope = false; this.getList(); }); @@ -608,16 +604,12 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const roleIds = row.roleId || this.ids; - this.$confirm('鏄惁纭鍒犻櫎瑙掕壊缂栧彿涓�"' + roleIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delRole(roleIds); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎瑙掕壊缂栧彿涓�"' + roleIds + '"鐨勬暟鎹」锛�').then(function() { + return delRole(roleIds); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { diff --git a/ruoyi-ui/src/views/system/role/selectUser.vue b/ruoyi-ui/src/views/system/role/selectUser.vue index 3229462..a9e2ce0 100644 --- a/ruoyi-ui/src/views/system/role/selectUser.vue +++ b/ruoyi-ui/src/views/system/role/selectUser.vue @@ -124,7 +124,7 @@ const roleId = this.queryParams.roleId; const userIds = this.userIds.join(","); authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => { - this.msgSuccess(res.msg); + this.$modal.msgSuccess(res.msg); if (res.code === 200) { this.visible = false; this.$emit("ok"); diff --git a/ruoyi-ui/src/views/system/user/authRole.vue b/ruoyi-ui/src/views/system/user/authRole.vue index 8e7f82a..dabdc27 100644 --- a/ruoyi-ui/src/views/system/user/authRole.vue +++ b/ruoyi-ui/src/views/system/user/authRole.vue @@ -33,7 +33,7 @@ </template> </el-table-column> </el-table> - + <pagination v-show="total>0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" /> <el-form label-width="100px"> @@ -103,7 +103,7 @@ const userId = this.form.userId; const roleIds = this.roleIds.join(","); updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => { - this.msgSuccess("鎺堟潈鎴愬姛"); + this.$modal.msgSuccess("鎺堟潈鎴愬姛"); this.close(); }); }, @@ -114,4 +114,4 @@ }, }, }; -</script> +</script> \ No newline at end of file diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index eb63770..aaa202d 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -503,17 +503,13 @@ // 鐢ㄦ埛鐘舵�佷慨鏀� handleStatusChange(row) { let text = row.status === "0" ? "鍚敤" : "鍋滅敤"; - this.$confirm('纭瑕�"' + text + '""' + row.userName + '"鐢ㄦ埛鍚�?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return changeUserStatus(row.userId, row.status); - }).then(() => { - this.msgSuccess(text + "鎴愬姛"); - }).catch(function() { - row.status = row.status === "0" ? "1" : "0"; - }); + this.$modal.confirm('纭瑕�"' + text + '""' + row.userName + '"鐢ㄦ埛鍚楋紵').then(function() { + return changeUserStatus(row.userId, row.status); + }).then(() => { + this.$modal.msgSuccess(text + "鎴愬姛"); + }).catch(function() { + row.status = row.status === "0" ? "1" : "0"; + }); }, // 鍙栨秷鎸夐挳 cancel() { @@ -606,7 +602,7 @@ inputErrorMessage: "鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿", }).then(({ value }) => { resetUserPwd(row.userId, value).then(response => { - this.msgSuccess("淇敼鎴愬姛锛屾柊瀵嗙爜鏄細" + value); + this.$modal.msgSuccess("淇敼鎴愬姛锛屾柊瀵嗙爜鏄細" + value); }); }).catch(() => {}); }, @@ -621,13 +617,13 @@ if (valid) { if (this.form.userId != undefined) { updateUser(this.form).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { addUser(this.form).then(response => { - this.msgSuccess("鏂板鎴愬姛"); + this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); @@ -638,16 +634,12 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const userIds = row.userId || this.ids; - this.$confirm('鏄惁纭鍒犻櫎鐢ㄦ埛缂栧彿涓�"' + userIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delUser(userIds); - }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal.confirm('鏄惁纭鍒犻櫎鐢ㄦ埛缂栧彿涓�"' + userIds + '"鐨勬暟鎹」锛�').then(function() { + return delUser(userIds); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { diff --git a/ruoyi-ui/src/views/system/user/profile/resetPwd.vue b/ruoyi-ui/src/views/system/user/profile/resetPwd.vue index d567d6d..119f103 100644 --- a/ruoyi-ui/src/views/system/user/profile/resetPwd.vue +++ b/ruoyi-ui/src/views/system/user/profile/resetPwd.vue @@ -57,7 +57,7 @@ if (valid) { updateUserPwd(this.user.oldPassword, this.user.newPassword).then( response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); } ); } diff --git a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue index 3d1b9ef..08652c2 100644 --- a/ruoyi-ui/src/views/system/user/profile/userAvatar.vue +++ b/ruoyi-ui/src/views/system/user/profile/userAvatar.vue @@ -111,7 +111,7 @@ // 涓婁紶棰勫鐞� beforeUpload(file) { if (file.type.indexOf("image/") == -1) { - this.msgError("鏂囦欢鏍煎紡閿欒锛岃涓婁紶鍥剧墖绫诲瀷,濡傦細JPG锛孭NG鍚庣紑鐨勬枃浠躲��"); + this.$modal.msgError("鏂囦欢鏍煎紡閿欒锛岃涓婁紶鍥剧墖绫诲瀷,濡傦細JPG锛孭NG鍚庣紑鐨勬枃浠躲��"); } else { const reader = new FileReader(); reader.readAsDataURL(file); @@ -131,7 +131,7 @@ this.open = false; this.options.img = response.data.imgUrl; store.commit('SET_AVATAR', this.options.img); - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); this.visible = false; }); }); @@ -172,4 +172,4 @@ line-height: 110px; border-radius: 50%; } -</style> +</style> \ No newline at end of file diff --git a/ruoyi-ui/src/views/system/user/profile/userInfo.vue b/ruoyi-ui/src/views/system/user/profile/userInfo.vue index bde2423..854b819 100644 --- a/ruoyi-ui/src/views/system/user/profile/userInfo.vue +++ b/ruoyi-ui/src/views/system/user/profile/userInfo.vue @@ -2,7 +2,7 @@ <el-form ref="form" :model="user" :rules="rules" label-width="80px"> <el-form-item label="鐢ㄦ埛鏄电О" prop="nickName"> <el-input v-model="user.nickName" maxlength="30" /> - </el-form-item> + </el-form-item> <el-form-item label="鎵嬫満鍙风爜" prop="phonenumber"> <el-input v-model="user.phonenumber" maxlength="11" /> </el-form-item> @@ -62,7 +62,7 @@ this.$refs["form"].validate(valid => { if (valid) { updateUserProfile(this.user).then(response => { - this.msgSuccess("淇敼鎴愬姛"); + this.$modal.msgSuccess("淇敼鎴愬姛"); }); } }); diff --git a/ruoyi-ui/src/views/tool/gen/editTable.vue b/ruoyi-ui/src/views/tool/gen/editTable.vue index b76f5ba..b9ad258 100644 --- a/ruoyi-ui/src/views/tool/gen/editTable.vue +++ b/ruoyi-ui/src/views/tool/gen/editTable.vue @@ -192,13 +192,13 @@ parentMenuId: genTable.parentMenuId }; updateGenTable(genTable).then(res => { - this.msgSuccess(res.msg); + this.$modal.msgSuccess(res.msg); if (res.code === 200) { this.close(); } }); } else { - this.msgError("琛ㄥ崟鏍¢獙鏈�氳繃锛岃閲嶆柊妫�鏌ユ彁浜ゅ唴瀹�"); + this.$modal.msgError("琛ㄥ崟鏍¢獙鏈�氳繃锛岃閲嶆柊妫�鏌ユ彁浜ゅ唴瀹�"); } }); }, diff --git a/ruoyi-ui/src/views/tool/gen/importTable.vue b/ruoyi-ui/src/views/tool/gen/importTable.vue index 56b2c0c..068755f 100644 --- a/ruoyi-ui/src/views/tool/gen/importTable.vue +++ b/ruoyi-ui/src/views/tool/gen/importTable.vue @@ -104,8 +104,13 @@ }, /** 瀵煎叆鎸夐挳鎿嶄綔 */ handleImportTable() { - importTable({ tables: this.tables.join(",") }).then(res => { - this.msgSuccess(res.msg); + const tableNames = this.tables.join(","); + if (tableNames == "") { + this.$modal.msgError("璇烽�夋嫨瑕佸鍏ョ殑琛�"); + return; + } + importTable({ tables: tableNames }).then(res => { + this.$modal.msgSuccess(res.msg); if (res.code === 200) { this.visible = false; this.$emit("ok"); diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue index 0c9f0c2..5f4e65b 100644 --- a/ruoyi-ui/src/views/tool/gen/index.vue +++ b/ruoyi-ui/src/views/tool/gen/index.vue @@ -262,12 +262,12 @@ handleGenTable(row) { const tableNames = row.tableName || this.tableNames; if (tableNames == "") { - this.msgError("璇烽�夋嫨瑕佺敓鎴愮殑鏁版嵁"); + this.$modal.msgError("璇烽�夋嫨瑕佺敓鎴愮殑鏁版嵁"); return; } if(row.genType === "1") { genCode(row.tableName).then(response => { - this.msgSuccess("鎴愬姛鐢熸垚鍒拌嚜瀹氫箟璺緞锛�" + row.genPath); + this.$modal.msgSuccess("鎴愬姛鐢熸垚鍒拌嚜瀹氫箟璺緞锛�" + row.genPath); }); } else { downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); @@ -276,14 +276,10 @@ /** 鍚屾鏁版嵁搴撴搷浣� */ handleSynchDb(row) { const tableName = row.tableName; - this.$confirm('纭瑕佸己鍒跺悓姝�"' + tableName + '"琛ㄧ粨鏋勫悧锛�', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return synchDb(tableName); + this.$modal.confirm('纭瑕佸己鍒跺悓姝�"' + tableName + '"琛ㄧ粨鏋勫悧锛�').then(function() { + return synchDb(tableName); }).then(() => { - this.msgSuccess("鍚屾鎴愬姛"); + this.$modal.msgSuccess("鍚屾鎴愬姛"); }).catch(() => {}); }, /** 鎵撳紑瀵煎叆琛ㄥ脊绐� */ @@ -326,15 +322,11 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const tableIds = row.tableId || this.ids; - this.$confirm('鏄惁纭鍒犻櫎琛ㄧ紪鍙蜂负"' + tableIds + '"鐨勬暟鎹」?', "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }).then(function() { - return delTable(tableIds); + this.$modal.confirm('鏄惁纭鍒犻櫎琛ㄧ紪鍙蜂负"' + tableIds + '"鐨勬暟鎹」锛�').then(function() { + return delTable(tableIds); }).then(() => { - this.getList(); - this.msgSuccess("鍒犻櫎鎴愬姛"); + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }).catch(() => {}); } } -- Gitblit v1.9.3