diff --git a/src/api/index.js b/src/api/index.js
index e5b11052c9eb1333765eb767a7c5677d226f313e..752a13345ff0482410c3a1c8d967e2f1b29f6727 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -1,4 +1,5 @@
import { request, METHOD } from '@/utils';
+export * from './menu';
export function getUserDetailInfoApi() {
return request('/api/v1/detail', METHOD.GET);
diff --git a/src/api/menu.js b/src/api/menu.js
new file mode 100644
index 0000000000000000000000000000000000000000..9b64f2d3318aea037ee1c8f0ac8fa4e8abef9056
--- /dev/null
+++ b/src/api/menu.js
@@ -0,0 +1,17 @@
+import { delReq, getReq, postReq } from '@/utils';
+
+export function delMenuApi(id) {
+ return delReq(`/api/v1/menus/${id}`);
+}
+
+export function getMenuDataApi() {
+ return getReq('/api/v1/menus');
+}
+
+export function addMenuApi(data) {
+ return postReq('/api/v1/menus', data);
+}
+
+export function addRoleApi(data) {
+ return postReq('/api/v1/roles', data);
+}
diff --git a/src/components/menu_tree/index.vue b/src/components/menu_tree/index.vue
new file mode 100644
index 0000000000000000000000000000000000000000..269625f776a5e369914ff0f0e3433e23645744e7
--- /dev/null
+++ b/src/components/menu_tree/index.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
diff --git a/src/components/popconfirm_delete/index.vue b/src/components/popconfirm_delete/index.vue
new file mode 100644
index 0000000000000000000000000000000000000000..13da48a4021ae258c5f5686f9c1ba3cdbfd29354
--- /dev/null
+++ b/src/components/popconfirm_delete/index.vue
@@ -0,0 +1,26 @@
+
+
+ 删除
+
+
+
+
diff --git a/src/components/table/index.vue b/src/components/table/index.vue
index c2fca438e877f2b9aa3406f1a34b559fe91cbcc7..f1dcb3b080df26e4e86faec22dbd30ae02924ef2 100644
--- a/src/components/table/index.vue
+++ b/src/components/table/index.vue
@@ -23,7 +23,7 @@
-
+
@@ -35,9 +35,23 @@
:visible="addVisible"
@close="addDrawerClose"
v-if="addBtn"
- :maskClosable="addBtn.maskClosable"
+ :maskClosable="!!addBtn.maskClosable"
+ :closable="false"
+ :drawerStyle="drawerStyle"
+ :bodyStyle="bodyStyle"
+ :width="addBtn.width"
+ destroyOnClose
>
-
+
+
+
+ 取消
+ 确认
+
@@ -45,71 +59,6 @@
diff --git a/src/main.js b/src/main.js
index 1f68627dd7264abed6b6c044af4411f20ac19ef7..66f11940e77084417f0a9fbbaf602c4959e0d135 100644
--- a/src/main.js
+++ b/src/main.js
@@ -34,7 +34,7 @@ const store = new Vuex.Store({
Vue.use(Router);
const isAsynRount = store.state.settingModule.asyncRoutes;
const options = initRouter(isAsynRount);
-const router = new Router(options);
+const router = new Router({ mode: 'history', ...options });
//装载vue-i18n控件 如果语言优先级 请直接修改这里localeLang和fallbackLang
Vue.use(VueI18n);
diff --git a/src/pages/system/view/menu/MenuManagement.vue b/src/pages/system/view/menu/MenuManagement.vue
index abef894cb16d424cd43da9c9154a55f107e8a767..e123280f8464e1d55907065b7975a30e90ade3e5 100644
--- a/src/pages/system/view/menu/MenuManagement.vue
+++ b/src/pages/system/view/menu/MenuManagement.vue
@@ -1,25 +1,26 @@
-
-
-
-
-
-
+
-
+
+
-
-
- 编辑
-
- 删除
-
+
+ edit(row)">编辑
+
+
@@ -27,19 +28,44 @@
diff --git a/src/pages/system/view/menu/form.vue b/src/pages/system/view/menu/form.vue
new file mode 100644
index 0000000000000000000000000000000000000000..414341eaf0fad95cf7fd454e56abb5ae7158d9d8
--- /dev/null
+++ b/src/pages/system/view/menu/form.vue
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+ 目录
+ 菜单
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pages/system/view/role/RoleManagement.vue b/src/pages/system/view/role/RoleManagement.vue
index 1384fc248d34e1b2ba0fdaa1ba2e11175bd30743..3c011c7b21b132b14e3b4b1ade232382889b2a72 100644
--- a/src/pages/system/view/role/RoleManagement.vue
+++ b/src/pages/system/view/role/RoleManagement.vue
@@ -1,4 +1,44 @@
- Menu Management
+
+
+
+
+
+
+
+
+
+ view(row, 2)">查看
+
+ view(row, 1)">编辑
+
+
+
+
+
-
\ No newline at end of file
+
+
diff --git a/src/pages/system/view/role/form.vue b/src/pages/system/view/role/form.vue
new file mode 100644
index 0000000000000000000000000000000000000000..41b3a61f1d2433d586d26f4deec9e9fedc866862
--- /dev/null
+++ b/src/pages/system/view/role/form.vue
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/utils/i18nUtil.js b/src/utils/i18nUtil.js
index 88b6d0b662fd240820ee5a32b1c824c828b0d974..a8b78529be55efd1d48437b39f2b2def6eed9b6e 100644
--- a/src/utils/i18nUtil.js
+++ b/src/utils/i18nUtil.js
@@ -11,7 +11,6 @@ import { getI18nKey } from '@/utils/routerUtil';
function generateI18n(lang, routes, valueKey) {
routes.forEach(route => {
let keys = getI18nKey(route.fullPath).split('.');
- console.log(keys);
let value =
valueKey === 'path'
? route[valueKey]
diff --git a/src/utils/index.js b/src/utils/index.js
index 5693c873600ff504f51773d9777662c5e16d79c4..9419b3d2ed71a389161fa0ab471f42275cacc8b4 100644
--- a/src/utils/index.js
+++ b/src/utils/index.js
@@ -13,9 +13,13 @@ export function setUserId(val) {
/**
* 转变菜单列表为tree结构
* @param {Array} menuList 菜单列表
+ * @param {Boolean} filterMenu 是否过滤掉菜单,只保留目录
*/
-export function convertListToTree(menuList) {
- const tempMenu = [...menuList];
+export function convertListToTree(menuList, filterMenu = false) {
+ let tempMenu = [...menuList];
+ if (filterMenu) {
+ tempMenu = tempMenu.filter(m => m.menuType !== 'MENU');
+ }
for (const menu of menuList) {
if (menu.parentMenuId === 0) continue;
const parent = menuList.find(m => m.menuId === menu.parentMenuId);
@@ -23,3 +27,5 @@ export function convertListToTree(menuList) {
}
return tempMenu.filter(m => m.parentMenuId === 0);
}
+
+export function EMPTY_FUN() {}
diff --git a/src/utils/requestUtil.js b/src/utils/requestUtil.js
index 7157b6027b9d0e4c4efa485f01e8566f0b336c68..bb0ad299545981d48af1864093e7bda6ba2d307f 100644
--- a/src/utils/requestUtil.js
+++ b/src/utils/requestUtil.js
@@ -133,4 +133,27 @@ function checkAuthorization() {
return !!getToken();
}
-export { METHOD, request, parseUrlParams, loadResponseInterceptor, setToken, checkAuthorization, clearToken };
+function delReq(url, config) {
+ return request(url, METHOD.DELETE, config);
+}
+
+function getReq(url, params, config) {
+ return request(url, METHOD.GET, params, config);
+}
+
+function postReq(url, data, config) {
+ return request(url, METHOD.POST, data, config);
+}
+
+export {
+ METHOD,
+ request,
+ parseUrlParams,
+ loadResponseInterceptor,
+ setToken,
+ checkAuthorization,
+ clearToken,
+ delReq,
+ getReq,
+ postReq,
+};