-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: vue3角色模块优化 * fix: 检视意见修改
- Loading branch information
Showing
20 changed files
with
488 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/toolkits/pro/template/tinyvue/src/hooks/useDisclosure.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { ref } from 'vue'; | ||
|
||
export const useDisclosure = () => { | ||
const open = ref(false); | ||
const onClose = () => { | ||
open.value = false; | ||
}; | ||
const onOpen = () => { | ||
open.value = true; | ||
}; | ||
return { | ||
open, | ||
onClose, | ||
onOpen, | ||
}; | ||
}; |
20 changes: 20 additions & 0 deletions
20
packages/toolkits/pro/template/tinyvue/src/hooks/useI18nMenu.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { ITreeNodeData } from '@/router/guard/menu'; | ||
|
||
export const useI18nMenu = ( | ||
data: ITreeNodeData[], | ||
t: (key: string) => string, | ||
) => { | ||
const menus: ITreeNodeData[] = [...data]; | ||
const dfs = (menu: ITreeNodeData) => { | ||
menu.label = t(menu.locale).toString(); | ||
for (let i = 0; i < menu.children.length; i += 1) { | ||
const item = menu.children[i]; | ||
dfs(item); | ||
} | ||
}; | ||
for (let i = 0; i < data.length; i += 1) { | ||
const menu = data[i]; | ||
dfs(menu); | ||
} | ||
return menus; | ||
}; |
17 changes: 17 additions & 0 deletions
17
packages/toolkits/pro/template/tinyvue/src/hooks/useMenuId.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { ITreeNodeData } from '@/router/guard/menu'; | ||
|
||
export const useMenuId = (datas: ITreeNodeData[]) => { | ||
const ids: any[] = []; | ||
const dfs = (menu: ITreeNodeData) => { | ||
ids.push(menu.id); | ||
for (let i = 0; i < menu.children.length; i += 1) { | ||
const child = menu.children[i]; | ||
dfs(child); | ||
} | ||
}; | ||
for (let i = 0; i < datas.length; i += 1) { | ||
const data = datas[i]; | ||
dfs(data); | ||
} | ||
return ids; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.