From 9a84c3b812482468aac126f80a44de6a9d494b77 Mon Sep 17 00:00:00 2001 From: smallwei <1634566606@qq.com> Date: Fri, 15 Feb 2019 08:53:40 +0800 Subject: [PATCH] menu load --- src/api/dept/notice.js | 3 +++ src/api/system/dept.js | 3 +++ src/api/system/dict.js | 3 +++ src/api/system/menu.js | 3 +++ src/api/system/param.js | 3 +++ src/api/system/role.js | 3 +++ src/api/system/user.js | 3 +++ src/api/tool/code.js | 3 +++ src/page/index/index.vue | 6 +++--- src/views/system/dept.vue | 22 +++++++++++++++++----- src/views/system/dict.vue | 22 +++++++++++++++++----- src/views/system/menu.vue | 22 +++++++++++++++++----- src/views/system/param.vue | 21 ++++++++++++++++----- src/views/system/role.vue | 22 +++++++++++++++++----- src/views/system/user.vue | 22 +++++++++++++++++----- src/views/tool/code.vue | 23 ++++++++++++++++++----- vue.config.js | 2 +- 17 files changed, 147 insertions(+), 39 deletions(-) diff --git a/src/api/dept/notice.js b/src/api/dept/notice.js index 4a1362f..7d06f58 100644 --- a/src/api/dept/notice.js +++ b/src/api/dept/notice.js @@ -19,6 +19,9 @@ export const remove = (ids) => { method: 'post', data: { ids, + }, + meta: { + isSerialize: true, } }) } diff --git a/src/api/system/dept.js b/src/api/system/dept.js index 08705f4..d0dd928 100644 --- a/src/api/system/dept.js +++ b/src/api/system/dept.js @@ -16,6 +16,9 @@ export const remove = (ids) => { method: 'post', data: { ids, + }, + meta: { + isSerialize: true, } }) } diff --git a/src/api/system/dict.js b/src/api/system/dict.js index 36eba0c..9f09a8c 100644 --- a/src/api/system/dict.js +++ b/src/api/system/dict.js @@ -16,6 +16,9 @@ export const remove = (ids) => { method: 'post', data: { ids, + }, + meta: { + isSerialize: true, } }) } diff --git a/src/api/system/menu.js b/src/api/system/menu.js index a43e441..7b626ee 100644 --- a/src/api/system/menu.js +++ b/src/api/system/menu.js @@ -16,6 +16,9 @@ export const remove = (ids) => { method: 'post', data: { ids, + }, + meta: { + isSerialize: true, } }) } diff --git a/src/api/system/param.js b/src/api/system/param.js index 2c2eaf8..0f76e38 100644 --- a/src/api/system/param.js +++ b/src/api/system/param.js @@ -16,6 +16,9 @@ export const remove = (ids) => { method: 'post', data: { ids, + }, + meta: { + isSerialize: true, } }) } diff --git a/src/api/system/role.js b/src/api/system/role.js index c52e7e3..5f68976 100644 --- a/src/api/system/role.js +++ b/src/api/system/role.js @@ -22,6 +22,9 @@ export const remove = (ids) => { method: 'post', data: { ids, + }, + meta: { + isSerialize: true, } }) } diff --git a/src/api/system/user.js b/src/api/system/user.js index e07d1fc..bfad2dd 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -22,6 +22,9 @@ export const remove = (ids) => { method: 'post', data: { ids, + }, + meta: { + isSerialize: true, } }) } diff --git a/src/api/tool/code.js b/src/api/tool/code.js index 1c85da7..ac75b2c 100644 --- a/src/api/tool/code.js +++ b/src/api/tool/code.js @@ -25,6 +25,9 @@ export const remove = (ids) => { method: 'post', data: { ids, + }, + meta: { + isSerialize: true, } }) } diff --git a/src/page/index/index.vue b/src/page/index/index.vue index b7239a4..944835b 100644 --- a/src/page/index/index.vue +++ b/src/page/index/index.vue @@ -43,9 +43,9 @@ import tags from "./tags"; import top from "./top/"; import sidebar from "./sidebar/"; import admin from "@/util/admin"; -import { validatenull } from "@/util/validate"; -import { calcDate } from "@/util/date.js"; -import { getStore } from "@/util/store.js"; +// import { validatenull } from "@/util/validate"; +// import { calcDate } from "@/util/date.js"; +// import { getStore } from "@/util/store.js"; export default { components: { top, diff --git a/src/views/system/dept.vue b/src/views/system/dept.vue index 72eae3f..82a0391 100644 --- a/src/views/system/dept.vue +++ b/src/views/system/dept.vue @@ -92,6 +92,7 @@ export default { rowSave(row, loading) { add(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -101,6 +102,7 @@ export default { rowUpdate(row, index, loading) { update(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -108,12 +110,21 @@ export default { }); }, rowDel(row) { - remove(row.id).then(() => { - this.$message({ - type: "success", - message: "操作成功!" + this.$confirm("确定将选删除?", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + return remove(row.id); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); }); - }); }, handleDelete() { if (this.selectionList.length === 0) { @@ -129,6 +140,7 @@ export default { return remove(this.ids); }) .then(() => { + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" diff --git a/src/views/system/dict.vue b/src/views/system/dict.vue index 7ff9d0e..ebe5e92 100644 --- a/src/views/system/dict.vue +++ b/src/views/system/dict.vue @@ -95,6 +95,7 @@ export default { rowSave(row, loading) { add(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -104,6 +105,7 @@ export default { rowUpdate(row, index, loading) { update(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -111,12 +113,21 @@ export default { }); }, rowDel(row) { - remove(row.id).then(() => { - this.$message({ - type: "success", - message: "操作成功!" + this.$confirm("确定将选删除?", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + return remove(row.id); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); }); - }); }, selectionChange(list) { this.selectionList = list; @@ -135,6 +146,7 @@ export default { return remove(this.ids); }) .then(() => { + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" diff --git a/src/views/system/menu.vue b/src/views/system/menu.vue index ac7e43d..b1348af 100644 --- a/src/views/system/menu.vue +++ b/src/views/system/menu.vue @@ -118,6 +118,7 @@ export default { rowSave(row, loading) { add(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -127,6 +128,7 @@ export default { rowUpdate(row, index, loading) { update(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -134,12 +136,21 @@ export default { }); }, rowDel(row) { - remove(row.id).then(() => { - this.$message({ - type: "success", - message: "操作成功!" + this.$confirm("确定将选删除?", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + return remove(row.id); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); }); - }); }, selectionChange(list) { this.selectionList = list; @@ -158,6 +169,7 @@ export default { return remove(this.ids); }) .then(() => { + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" diff --git a/src/views/system/param.vue b/src/views/system/param.vue index 11edfad..e67ceee 100644 --- a/src/views/system/param.vue +++ b/src/views/system/param.vue @@ -79,6 +79,7 @@ export default { rowSave(row, loading) { add(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -88,6 +89,7 @@ export default { rowUpdate(row, index, loading) { update(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -95,12 +97,21 @@ export default { }); }, rowDel(row) { - remove(row.id).then(() => { - this.$message({ - type: "success", - message: "操作成功!" + this.$confirm("确定将选删除?", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + return remove(row.id); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); }); - }); }, selectionChange(list) { this.selectionList = list; diff --git a/src/views/system/role.vue b/src/views/system/role.vue index a468559..c301713 100644 --- a/src/views/system/role.vue +++ b/src/views/system/role.vue @@ -115,6 +115,7 @@ export default { rowSave(row, loading) { add(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -123,6 +124,7 @@ export default { }, rowUpdate(row, index, loading) { update(row).then(() => { + this.onLoad(this.page); loading(); this.$message({ type: "success", @@ -131,12 +133,21 @@ export default { }); }, rowDel(row) { - remove(row.id).then(() => { - this.$message({ - type: "success", - message: "操作成功!" + this.$confirm("确定将选删除?", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + return remove(row.id); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); }); - }); }, selectionChange(list) { this.selectionList = list; @@ -170,6 +181,7 @@ export default { return remove(this.ids); }) .then(() => { + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" diff --git a/src/views/system/user.vue b/src/views/system/user.vue index db23c9c..4b2c341 100644 --- a/src/views/system/user.vue +++ b/src/views/system/user.vue @@ -129,6 +129,7 @@ export default { rowSave(row, loading) { add(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -138,6 +139,7 @@ export default { rowUpdate(row, index, loading) { update(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -145,12 +147,21 @@ export default { }); }, rowDel(row) { - remove(row.id).then(() => { - this.$message({ - type: "success", - message: "操作成功!" + this.$confirm("确定将选删除?", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + return remove(row.id); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); }); - }); }, selectionChange(list) { this.selectionList = list; @@ -169,6 +180,7 @@ export default { return remove(this.ids); }) .then(() => { + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" diff --git a/src/views/tool/code.vue b/src/views/tool/code.vue index 2c4101d..73de258 100644 --- a/src/views/tool/code.vue +++ b/src/views/tool/code.vue @@ -111,6 +111,7 @@ export default { rowSave(row, loading) { add(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -120,6 +121,7 @@ export default { rowUpdate(row, index, loading) { update(row).then(() => { loading(); + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -127,12 +129,21 @@ export default { }); }, rowDel(row) { - remove(row.id).then(() => { - this.$message({ - type: "success", - message: "操作成功!" + this.$confirm("确定将选删除?", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }) + .then(() => { + return remove(row.id); + }) + .then(() => { + this.onLoad(this.page); + this.$message({ + type: "success", + message: "操作成功!" + }); }); - }); }, selectionChange(list) { this.selectionList = list; @@ -151,6 +162,7 @@ export default { return remove(this.ids); }) .then(() => { + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" @@ -173,6 +185,7 @@ export default { return build(this.ids); }) .then(() => { + this.onLoad(this.page); this.$message({ type: "success", message: "操作成功!" diff --git a/vue.config.js b/vue.config.js index 14242dc..70d7771 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,6 +1,6 @@ // 基础路径 注意发布之前要先修改这里 let baseUrl = './' -let url = 'http://localhost' +let url = 'http://118.24.148.246:8800' module.exports = { baseUrl: baseUrl, // 根据你的实际情况更改这里 lintOnSave: true,