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..2fbd36ca11a954d6eed626faf1aa5f40f270ded2
--- /dev/null
+++ b/src/api/menu.js
@@ -0,0 +1,13 @@
+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);
+}
diff --git a/src/components/popconfirm_delete/index.vue b/src/components/popconfirm_delete/index.vue
new file mode 100644
index 0000000000000000000000000000000000000000..0704f53f0c1bf0f862be693ce0a241324ced4153
--- /dev/null
+++ b/src/components/popconfirm_delete/index.vue
@@ -0,0 +1,19 @@
+
+
+ 删除
+
+
+
+
diff --git a/src/components/table/index.vue b/src/components/table/index.vue
index c2fca438e877f2b9aa3406f1a34b559fe91cbcc7..13d0db7b14be1950a807ef922a2992c5d19e0686 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..ee18afc648b45d6ad5927a8045bc22b6a4aa4176 100644
--- a/src/pages/system/view/menu/MenuManagement.vue
+++ b/src/pages/system/view/menu/MenuManagement.vue
@@ -1,25 +1,32 @@
-
+
+
-
+
+
-
-
- 编辑
-
- 删除
-
+
+ edit(row)">编辑
+
+
@@ -27,19 +34,45 @@
diff --git a/src/pages/system/view/menu/form.vue b/src/pages/system/view/menu/form.vue
new file mode 100644
index 0000000000000000000000000000000000000000..bd41841db831e143bc28ac01a1e553081a42afbd
--- /dev/null
+++ b/src/pages/system/view/menu/form.vue
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+ 目录
+ 菜单
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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,
+};