Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jekip committed Aug 9, 2021
1 parent 8f05b20 commit d388ae5
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 37 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# 1.5.3 (2021-08-09)
### 🐛 Bug Fixes
- 修复顶部菜单,选中联动
- 修复混合菜单模式,切换其他模式菜单未重置
- 实例基础列表,和表格组件实例,开启横向滚动特性
- `naiveui` 升级成最新版

- ### ✨ Features
- table组件,默认开启 `ellipsis` 特性



# 1.5.2 (2021-08-06)
### 🐛 Bug Fixes
- 修复已知bug
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "naive-ui-admin",
"version": "1.5.2",
"version": "1.5.3",
"author": {
"name": "Ahjung",
"email": "[email protected]",
Expand Down Expand Up @@ -38,7 +38,7 @@
"makeit-captcha": "^1.2.5",
"mitt": "^2.1.0",
"mockjs": "^1.1.0",
"naive-ui": "^2.16.1",
"naive-ui": "^2.16.2",
"pinia": "^2.0.0-beta.3",
"qs": "^6.10.1",
"vfonts": "^0.1.0",
Expand Down
6 changes: 1 addition & 5 deletions src/layout/components/Header/ProjectSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,7 @@
function togNavMode(mode) {
settingStore.navMode = mode;
// if (mode === 'header-dark') {
// settingStore.setNavTheme('dark');
// } else {
// settingStore.setNavTheme('light');
// }
settingStore.menuSetting.mixMenu = false;
}
return {
Expand Down
11 changes: 10 additions & 1 deletion src/layout/components/Menu/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import { useAsyncRouteStore } from '@/store/modules/asyncRoute';
import { generatorMenu, generatorMenuMix } from '@/utils';
import { useProjectSettingStore } from '@/store/modules/projectSetting';
import { useProjectSetting } from '@/hooks/setting/useProjectSetting';
export default defineComponent({
name: 'Menu',
Expand Down Expand Up @@ -51,6 +52,10 @@
const selectedKeys = ref<string>(currentRoute.name as string);
const headerMenuSelectKey = ref<string>('');
const { getNavMode } = useProjectSetting();
const navMode = getNavMode;
// 获取当前打开的子菜单
const matched = currentRoute.matched;
Expand All @@ -65,7 +70,10 @@
});
const getSelectedKeys = computed(() => {
return props.location === 'left' ? unref(selectedKeys) : unref(headerMenuSelectKey);
let location = props.location;
return location === 'left' || (location === 'header' && unref(navMode) === 'horizontal')
? unref(selectedKeys)
: unref(headerMenuSelectKey);
});
// 监听分割菜单
Expand Down Expand Up @@ -96,6 +104,7 @@
const matched = currentRoute.matched;
state.openKeys = matched.map((item) => item.name);
const activeMenu: string = (currentRoute.meta?.activeMenu as string) || '';
console.log(currentRoute);
selectedKeys.value = activeMenu ? (activeMenu as string) : (currentRoute.name as string);
}
);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function generatorMenuMix(routerMap: Array<any>, routerName: string, loca
* 递归组装子菜单
* */
export function getChildrenRouter(routerMap: Array<any>) {
return routerMap.map((item) => {
return filterRouter(routerMap).map((item) => {
const isRoot = isRootRouter(item);
const info = isRoot ? item.children[0] : item;
const currentMenu = {
Expand Down
2 changes: 1 addition & 1 deletion src/views/comp/table/CellColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ export const columns = [
{
title: '停留时间',
key: 'time',
width: 160,
width: 80,
},
];
2 changes: 1 addition & 1 deletion src/views/comp/table/basicColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ export const columns = [
{
title: '停留时间',
key: 'time',
width: 160,
width: 80,
},
];
2 changes: 1 addition & 1 deletion src/views/comp/table/editCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@edit-end="editEnd"
@edit-change="onEditChange"
@update:checked-row-keys="onCheckedRow"
:scroll-x="1300"
:scroll-x="1360"
>
<template #toolbar>
<n-button type="primary" @click="reloadTable">刷新数据</n-button>
Expand Down
2 changes: 1 addition & 1 deletion src/views/comp/table/editRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@edit-end="editEnd"
@edit-change="onEditChange"
@update:checked-row-keys="onCheckedRow"
:scroll-x="1530"
:scroll-x="1510"
>
<template #toolbar>
<n-button type="primary" @click="reloadTable">刷新数据</n-button>
Expand Down
2 changes: 1 addition & 1 deletion src/views/comp/table/rowColumns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ export const columns = [
{
title: '停留时间',
key: 'time',
width: 160,
width: 80,
},
];
27 changes: 10 additions & 17 deletions src/views/dashboard/workplace/workplace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@
</n-grid>
</n-card>
</div>
<n-grid
class="mt-4"
cols="2 s:1 m:1 l:2 xl:2 2xl:2"
responsive="screen"
:x-gap="12"
:y-gap="9"
:cols="2"
>
<n-grid class="mt-4" cols="2 s:1 m:1 l:2 xl:2 2xl:2" responsive="screen" :x-gap="12" :y-gap="9">
<n-gi>
<n-card
:segmented="{ content: 'hard' }"
Expand Down Expand Up @@ -75,7 +68,7 @@
>
<div class="flex">
<span>
<n-icon size="30" style="color: #42b983">
<n-icon size="30" color="#42b983">
<LogoVue />
</n-icon>
</span>
Expand All @@ -91,7 +84,7 @@
>
<div class="flex">
<span>
<n-icon size="30" style="color: #e44c27">
<n-icon size="30" color="#e44c27">
<Html5Outlined />
</n-icon>
</span>
Expand All @@ -107,7 +100,7 @@
>
<div class="flex">
<span>
<n-icon size="30" style="color: #dd0031">
<n-icon size="30" color="#dd0031">
<LogoAngular />
</n-icon>
</span>
Expand All @@ -123,7 +116,7 @@
>
<div class="flex">
<span>
<n-icon size="30" style="color: #61dafb">
<n-icon size="30" color="#61dafb">
<LogoReact />
</n-icon>
</span>
Expand Down Expand Up @@ -238,7 +231,7 @@
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
<div class="flex flex-col justify-center text-gray-500">
<span class="text-center">
<n-icon size="30" style="color: #68c755">
<n-icon size="30" color="#68c755">
<DashboardOutlined />
</n-icon>
</span>
Expand All @@ -248,7 +241,7 @@
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
<div class="flex flex-col justify-center text-gray-500">
<span class="text-center">
<n-icon size="30" style="color: #fab251">
<n-icon size="30" color="#fab251">
<ProfileOutlined />
</n-icon>
</span>
Expand All @@ -258,7 +251,7 @@
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
<div class="flex flex-col justify-center text-gray-500">
<span class="text-center">
<n-icon size="30" style="color: #1890ff">
<n-icon size="30" color="#1890ff">
<FileProtectOutlined />
</n-icon>
</span>
Expand All @@ -268,7 +261,7 @@
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
<div class="flex flex-col justify-center text-gray-500">
<span class="text-center">
<n-icon size="30" style="color: #f06b96">
<n-icon size="30" color="#f06b96">
<ApartmentOutlined />
</n-icon>
</span>
Expand All @@ -278,7 +271,7 @@
<n-card size="small" class="cursor-pointer project-card-item" hoverable>
<div class="flex flex-col justify-center text-gray-500">
<span class="text-center">
<n-icon size="30" style="color: #7238d1">
<n-icon size="30" color="#7238d1">
<SettingOutlined />
</n-icon>
</span>
Expand Down
4 changes: 2 additions & 2 deletions src/views/list/basicList/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ref="actionRef"
:actionColumn="actionColumn"
@update:checked-row-keys="onCheckedRow"
:scroll-x="1090"
:scroll-x="1010"
>
<template #tableTitle>
<n-button type="primary" @click="addTable">
Expand Down Expand Up @@ -231,7 +231,7 @@
name: 'xiaoMa',
},
actionColumn: {
width: 220,
width: 140,
title: '操作',
key: 'action',
fixed: 'right',
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4999,10 +4999,10 @@ [email protected]:
resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=

naive-ui@^2.16.1:
version "2.16.1"
resolved "https://registry.yarnpkg.com/naive-ui/-/naive-ui-2.16.1.tgz#0599e6748f498ad8f4f2f4c6c0637c1f1d860827"
integrity sha512-ku7ZxxBMp2fHD2eKV1gUDO6LmvMPUKYx0JzgtiCHRC8B88t4Ch5Momf+CfuYIM5NeVexzcmlahadslB74Bgbfw==
naive-ui@^2.16.2:
version "2.16.2"
resolved "https://registry.nlark.com/naive-ui/download/naive-ui-2.16.2.tgz#f7d4b84f15529bc8f367644edcdb2c14c7912372"
integrity sha1-99S4TxVSm8jzZ2RO3NssFMeRI3I=
dependencies:
"@css-render/plugin-bem" "^0.15.4"
"@css-render/vue3-ssr" "^0.15.4"
Expand Down

1 comment on commit d388ae5

@vercel
Copy link

@vercel vercel bot commented on d388ae5 Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.