Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Dr.Disrespect
vue-vben-admin
提交
74e62cbc
V
vue-vben-admin
项目概览
Dr.Disrespect
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
74e62cbc
编写于
12月 07, 2020
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add useDesign
上级
bd6b203f
变更
52
隐藏空白更改
内联
并排
Showing
52 changed file
with
260 addition
and
385 deletion
+260
-385
.ls-lint.yml
.ls-lint.yml
+1
-0
src/App.vue
src/App.vue
+6
-2
src/components/Application/index.ts
src/components/Application/index.ts
+8
-4
src/components/Application/src/AppLocalePicker.vue
src/components/Application/src/AppLocalePicker.vue
+2
-2
src/components/Application/src/AppLogo.vue
src/components/Application/src/AppLogo.vue
+13
-5
src/components/Application/src/AppProvider.vue
src/components/Application/src/AppProvider.vue
+24
-0
src/components/Application/src/useAppContext.ts
src/components/Application/src/useAppContext.ts
+16
-0
src/components/Authority/index.ts
src/components/Authority/index.ts
+4
-2
src/components/Basic/index.ts
src/components/Basic/index.ts
+6
-6
src/components/Button/index.ts
src/components/Button/index.ts
+4
-2
src/components/ClickOutSide/index.ts
src/components/ClickOutSide/index.ts
+4
-2
src/components/Container/index.ts
src/components/Container/index.ts
+6
-6
src/components/CountTo/index.ts
src/components/CountTo/index.ts
+3
-2
src/components/Description/index.ts
src/components/Description/index.ts
+4
-3
src/components/Drawer/index.ts
src/components/Drawer/index.ts
+3
-2
src/components/Dropdown/index.ts
src/components/Dropdown/index.ts
+3
-2
src/components/Excel/index.ts
src/components/Excel/index.ts
+5
-4
src/components/Form/index.ts
src/components/Form/index.ts
+4
-2
src/components/Loading/index.ts
src/components/Loading/index.ts
+3
-2
src/components/Markdown/index.ts
src/components/Markdown/index.ts
+4
-2
src/components/Menu/index.ts
src/components/Menu/index.ts
+3
-2
src/components/Menu/src/BasicMenu.tsx
src/components/Menu/src/BasicMenu.tsx
+11
-38
src/components/Menu/src/BasicMenu.vue
src/components/Menu/src/BasicMenu.vue
+11
-0
src/components/Menu/src/MenuContent.tsx
src/components/Menu/src/MenuContent.tsx
+3
-22
src/components/Menu/src/SearchInput.vue
src/components/Menu/src/SearchInput.vue
+0
-116
src/components/Menu/src/hooks/useSearchInput.ts
src/components/Menu/src/hooks/useSearchInput.ts
+0
-58
src/components/Menu/src/props.ts
src/components/Menu/src/props.ts
+2
-9
src/components/Menu/src/types.ts
src/components/Menu/src/types.ts
+0
-3
src/components/Menu/src/useOpenKeys.ts
src/components/Menu/src/useOpenKeys.ts
+3
-6
src/components/Modal/index.ts
src/components/Modal/index.ts
+4
-2
src/components/Page/index.ts
src/components/Page/index.ts
+3
-2
src/components/StrengthMeter/index.tsx
src/components/StrengthMeter/index.tsx
+3
-2
src/components/Tinymce/index.ts
src/components/Tinymce/index.ts
+3
-2
src/components/Upload/index.ts
src/components/Upload/index.ts
+2
-5
src/components/Verify/index.ts
src/components/Verify/index.ts
+5
-4
src/components/VirtualScroll/index.ts
src/components/VirtualScroll/index.ts
+3
-2
src/components/util.ts
src/components/util.ts
+7
-7
src/design/var/index.less
src/design/var/index.less
+2
-0
src/hooks/core/useContext.ts
src/hooks/core/useContext.ts
+47
-14
src/hooks/setting/useMenuSetting.ts
src/hooks/setting/useMenuSetting.ts
+0
-11
src/hooks/web/useDesign.ts
src/hooks/web/useDesign.ts
+19
-0
src/hooks/web/useLocale.ts
src/hooks/web/useLocale.ts
+0
-1
src/layouts/default/header/LayoutHeader.tsx
src/layouts/default/header/LayoutHeader.tsx
+0
-1
src/layouts/default/menu/index.tsx
src/layouts/default/menu/index.tsx
+0
-14
src/layouts/default/setting/enum.ts
src/layouts/default/setting/enum.ts
+0
-1
src/layouts/default/setting/handler.ts
src/layouts/default/setting/handler.ts
+0
-3
src/layouts/default/sider/index.less
src/layouts/default/sider/index.less
+0
-1
src/router/constant.ts
src/router/constant.ts
+1
-2
src/router/menus/index.ts
src/router/menus/index.ts
+3
-4
src/settings/colorSetting.ts
src/settings/colorSetting.ts
+2
-0
src/settings/projectSetting.ts
src/settings/projectSetting.ts
+0
-2
src/types/config.d.ts
src/types/config.d.ts
+0
-1
未找到文件。
.ls-lint.yml
浏览文件 @
74e62cbc
...
@@ -3,6 +3,7 @@ ls:
...
@@ -3,6 +3,7 @@ ls:
.js
:
kebab-case | PascalCase
.js
:
kebab-case | PascalCase
.vue
:
PascalCase | regex:^index
.vue
:
PascalCase | regex:^index
.ts
:
camelCase | PascalCase
.ts
:
camelCase | PascalCase
.tsx
:
camelCase | PascalCase
.d.ts
:
kebab-case
.d.ts
:
kebab-case
.mock.ts
:
kebab-case
.mock.ts
:
kebab-case
.data.ts
:
camelCase | kebab-case
.data.ts
:
camelCase | kebab-case
...
...
src/App.vue
浏览文件 @
74e62cbc
...
@@ -4,7 +4,9 @@
...
@@ -4,7 +4,9 @@
:locale=
"antConfigLocale"
:locale=
"antConfigLocale"
:transform-cell-text=
"transformCellText"
:transform-cell-text=
"transformCellText"
>
>
<router-view
/>
<AppProvider>
<router-view
/>
</AppProvider>
</ConfigProvider>
</ConfigProvider>
</
template
>
</
template
>
...
@@ -17,9 +19,11 @@
...
@@ -17,9 +19,11 @@
import
{
useLockPage
}
from
'
/@/hooks/web/useLockPage
'
;
import
{
useLockPage
}
from
'
/@/hooks/web/useLockPage
'
;
import
{
useLocale
}
from
'
/@/hooks/web/useLocale
'
;
import
{
useLocale
}
from
'
/@/hooks/web/useLocale
'
;
import
{
AppProvider
}
from
'
/@/components/Application
'
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'
App
'
,
name
:
'
App
'
,
components
:
{
ConfigProvider
},
components
:
{
ConfigProvider
,
AppProvider
},
setup
()
{
setup
()
{
// Initialize vuex internal system configuration
// Initialize vuex internal system configuration
initAppConfigStore
();
initAppConfigStore
();
...
...
src/components/Application/index.ts
浏览文件 @
74e62cbc
import
AppLocalePickerLib
from
'
./src/AppLocalePicker.vue
'
;
import
AppLocalePicker
from
'
./src/AppLocalePicker.vue
'
;
import
AppLogoLib
from
'
./src/AppLogo.vue
'
;
import
AppLogo
from
'
./src/AppLogo.vue
'
;
import
AppProvider
from
'
./src/AppProvider.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
AppLocalePicker
=
withInstall
(
AppLocalePickerLib
);
withInstall
(
AppLocalePicker
,
AppLogo
,
AppProvider
);
export
const
AppLogo
=
withInstall
(
AppLogoLib
);
export
{
useAppProviderContext
}
from
'
./src/useAppContext
'
;
export
{
AppLocalePicker
,
AppLogo
,
AppProvider
};
src/components/Application/src/AppLocalePicker.vue
浏览文件 @
74e62cbc
...
@@ -69,8 +69,8 @@
...
@@ -69,8 +69,8 @@
});
});
</
script
>
</
script
>
<
style
lang=
"less"
>
<
style
lang=
"less"
scoped
>
.app-locale-picker-overlay
{
:global(.app-locale-picker-overlay)
{
.ant-dropdown-menu-item {
.ant-dropdown-menu-item {
min-width: 160px;
min-width: 160px;
}
}
...
...
src/components/Application/src/AppLogo.vue
浏览文件 @
74e62cbc
...
@@ -4,12 +4,14 @@
...
@@ -4,12 +4,14 @@
-->
-->
<
template
>
<
template
>
<div
<div
class=
"a
pp-logo a
nticon"
class=
"anticon"
:class=
"
{ theme, 'collapsed-show-title': getCollapsedShowTitle }
"
:class=
"
[prefixCls, theme,
{ 'collapsed-show-title': getCollapsedShowTitle }]
"
@click="handleGoHome"
@click="handleGoHome"
>
>
<img
src=
"/@/assets/images/logo.png"
/>
<img
src=
"/@/assets/images/logo.png"
/>
<div
class=
"app-logo__title ml-2 ellipsis"
v-show=
"showTitle"
>
{{
globSetting
.
title
}}
</div>
<div
class=
"ml-2 ellipsis"
:class=
"[`$
{prefixCls}__title`]" v-show="showTitle">
{{
globSetting
.
title
}}
</div>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
...
@@ -23,6 +25,8 @@
...
@@ -23,6 +25,8 @@
import
{
propTypes
}
from
'
/@/utils/propTypes
'
;
import
{
propTypes
}
from
'
/@/utils/propTypes
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'
AppLogo
'
,
name
:
'
AppLogo
'
,
props
:
{
props
:
{
...
@@ -34,6 +38,8 @@
...
@@ -34,6 +38,8 @@
showTitle
:
propTypes
.
bool
.
def
(
true
),
showTitle
:
propTypes
.
bool
.
def
(
true
),
},
},
setup
()
{
setup
()
{
const
{
prefixCls
}
=
useDesign
(
'
app-logo
'
);
const
{
getCollapsedShowTitle
}
=
useMenuSetting
();
const
{
getCollapsedShowTitle
}
=
useMenuSetting
();
const
globSetting
=
useGlobSetting
();
const
globSetting
=
useGlobSetting
();
...
@@ -48,17 +54,19 @@
...
@@ -48,17 +54,19 @@
handleGoHome
,
handleGoHome
,
globSetting
,
globSetting
,
getCollapsedShowTitle
,
getCollapsedShowTitle
,
prefixCls
,
};
};
},
},
});
});
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
@import (reference) '../../../design/index.less';
@import (reference) '../../../design/index.less';
@prefix-cls: ~'@{namespace}-app-logo';
.
app-logo
{
.
@{prefix-cls}
{
display: flex;
display: flex;
align-items: center;
align-items: center;
padding-left: 1
0
px;
padding-left: 1
2
px;
cursor: pointer;
cursor: pointer;
&.collapsed-show-title {
&.collapsed-show-title {
...
...
src/components/Application/src/AppProvider.vue
0 → 100644
浏览文件 @
74e62cbc
<
template
>
<slot
/>
</
template
>
<
script
lang=
"ts"
>
import
type
{
PropType
}
from
'
vue
'
;
import
{
defineComponent
,
toRefs
}
from
'
vue
'
;
import
{
createAppProviderContext
}
from
'
./useAppContext
'
;
export
default
defineComponent
({
name
:
'
AppProvider
'
,
inheritAttrs
:
false
,
props
:
{
prefixCls
:
{
type
:
String
as
PropType
<
string
>
,
default
:
'
vben
'
,
},
},
setup
(
props
)
{
const
{
prefixCls
}
=
toRefs
(
props
);
createAppProviderContext
({
prefixCls
});
return
{};
},
});
</
script
>
src/components/Application/src/useAppContext.ts
0 → 100644
浏览文件 @
74e62cbc
import
{
InjectionKey
,
Ref
}
from
'
vue
'
;
import
{
createContext
,
useContext
}
from
'
/@/hooks/core/useContext
'
;
export
interface
AppProviderContextProps
{
prefixCls
:
Ref
<
string
>
;
}
const
key
:
InjectionKey
<
AppProviderContextProps
>
=
Symbol
();
export
function
createAppProviderContext
(
context
:
AppProviderContextProps
)
{
return
createContext
<
AppProviderContextProps
>
(
context
,
key
);
}
export
function
useAppProviderContext
()
{
return
useContext
<
AppProviderContextProps
>
(
key
);
}
src/components/Authority/index.ts
浏览文件 @
74e62cbc
import
Authority
Lib
from
'
./src/index.vue
'
;
import
Authority
from
'
./src/index.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
Authority
=
withInstall
(
AuthorityLib
);
withInstall
(
Authority
);
export
{
Authority
};
src/components/Basic/index.ts
浏览文件 @
74e62cbc
import
BasicArrow
Lib
from
'
./src/BasicArrow.vue
'
;
import
BasicArrow
from
'
./src/BasicArrow.vue
'
;
import
BasicHelp
Lib
from
'
./src/BasicHelp.vue
'
;
import
BasicHelp
from
'
./src/BasicHelp.vue
'
;
import
BasicTitle
Lib
from
'
./src/BasicTitle.vue
'
;
import
BasicTitle
from
'
./src/BasicTitle.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
BasicArrow
=
withInstall
(
BasicArrowLib
);
withInstall
(
BasicArrow
,
BasicHelp
,
BasicTitle
);
export
const
BasicHelp
=
withInstall
(
BasicHelpLib
);
export
const
BasicTitle
=
withInstall
(
BasicTitleLib
)
;
export
{
BasicArrow
,
BasicHelp
,
BasicTitle
}
;
src/components/Button/index.ts
浏览文件 @
74e62cbc
import
Button
Lib
from
'
./src/BasicButton.vue
'
;
import
Button
from
'
./src/BasicButton.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
Button
=
withInstall
(
ButtonLib
);
withInstall
(
Button
);
export
{
Button
};
src/components/ClickOutSide/index.ts
浏览文件 @
74e62cbc
import
ClickOutSide
Lib
from
'
./src/index.vue
'
;
import
ClickOutSide
from
'
./src/index.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
ClickOutSide
=
withInstall
(
ClickOutSideLib
);
withInstall
(
ClickOutSide
);
export
{
ClickOutSide
};
src/components/Container/index.ts
浏览文件 @
74e62cbc
import
ScrollContainer
Lib
from
'
./src/ScrollContainer.vue
'
;
import
ScrollContainer
from
'
./src/ScrollContainer.vue
'
;
import
CollapseContainer
Lib
from
'
./src/collapse/CollapseContainer.vue
'
;
import
CollapseContainer
from
'
./src/collapse/CollapseContainer.vue
'
;
import
LazyContainer
Lib
from
'
./src/LazyContainer.vue
'
;
import
LazyContainer
from
'
./src/LazyContainer.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
ScrollContainer
,
CollapseContainer
,
LazyContainer
);
export
*
from
'
./src/types
'
;
export
*
from
'
./src/types
'
;
export
const
ScrollContainer
=
withInstall
(
ScrollContainerLib
);
export
{
ScrollContainer
,
CollapseContainer
,
LazyContainer
};
export
const
CollapseContainer
=
withInstall
(
CollapseContainerLib
);
export
const
LazyContainer
=
withInstall
(
LazyContainerLib
);
src/components/CountTo/index.ts
浏览文件 @
74e62cbc
// Transform vue-count-to to support vue3 version
// Transform vue-count-to to support vue3 version
import
CountTo
Lib
from
'
./src/index.vue
'
;
import
CountTo
from
'
./src/index.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
CountTo
=
withInstall
(
CountToLib
);
withInstall
(
CountTo
);
export
{
CountTo
};
src/components/Description/index.ts
浏览文件 @
74e62cbc
import
Description
Lib
from
'
./src/index
'
;
import
Description
from
'
./src/index
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
Description
);
export
*
from
'
./src/types
'
;
export
*
from
'
./src/types
'
;
export
{
useDescription
}
from
'
./src/useDescription
'
;
export
{
useDescription
}
from
'
./src/useDescription
'
;
export
{
Description
};
export
const
Description
=
withInstall
(
DescriptionLib
);
src/components/Drawer/index.ts
浏览文件 @
74e62cbc
import
BasicDrawer
Lib
from
'
./src/BasicDrawer
'
;
import
BasicDrawer
from
'
./src/BasicDrawer
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
BasicDrawer
);
export
*
from
'
./src/types
'
;
export
*
from
'
./src/types
'
;
export
{
useDrawer
,
useDrawerInner
}
from
'
./src/useDrawer
'
;
export
{
useDrawer
,
useDrawerInner
}
from
'
./src/useDrawer
'
;
export
const
BasicDrawer
=
withInstall
(
BasicDrawerLib
)
;
export
{
BasicDrawer
}
;
src/components/Dropdown/index.ts
浏览文件 @
74e62cbc
import
Dropdown
Lib
from
'
./src/Dropdown
'
;
import
Dropdown
from
'
./src/Dropdown
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
Dropdown
);
export
*
from
'
./src/types
'
;
export
*
from
'
./src/types
'
;
export
const
Dropdown
=
withInstall
(
DropdownLib
)
;
export
{
Dropdown
}
;
src/components/Excel/index.ts
浏览文件 @
74e62cbc
import
ImportExcel
Lib
from
'
./src/ImportExcel.vue
'
;
import
ImportExcel
from
'
./src/ImportExcel.vue
'
;
import
ExportExcelModel
Lib
from
'
./src/ExportExcelModel.vue
'
;
import
ExportExcelModel
from
'
./src/ExportExcelModel.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
ImportExcel
,
ExportExcelModel
);
export
*
from
'
./src/types
'
;
export
*
from
'
./src/types
'
;
export
{
jsonToSheetXlsx
,
aoaToSheetXlsx
}
from
'
./src/Export2Excel
'
;
export
{
jsonToSheetXlsx
,
aoaToSheetXlsx
}
from
'
./src/Export2Excel
'
;
export
const
ImportExcel
=
withInstall
(
ImportExcelLib
);
export
{
ImportExcel
,
ExportExcelModel
};
export
const
ExportExcelModel
=
withInstall
(
ExportExcelModelLib
);
src/components/Form/index.ts
浏览文件 @
74e62cbc
import
BasicForm
Lib
from
'
./src/BasicForm.vue
'
;
import
BasicForm
from
'
./src/BasicForm.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
BasicForm
);
export
*
from
'
./src/types/form
'
;
export
*
from
'
./src/types/form
'
;
export
*
from
'
./src/types/formItem
'
;
export
*
from
'
./src/types/formItem
'
;
export
{
useComponentRegister
}
from
'
./src/hooks/useComponentRegister
'
;
export
{
useComponentRegister
}
from
'
./src/hooks/useComponentRegister
'
;
export
{
useForm
}
from
'
./src/hooks/useForm
'
;
export
{
useForm
}
from
'
./src/hooks/useForm
'
;
export
const
BasicForm
=
withInstall
(
BasicFormLib
)
;
export
{
BasicForm
}
;
src/components/Loading/index.ts
浏览文件 @
74e62cbc
import
'
./src/indicator
'
;
import
'
./src/indicator
'
;
import
Loading
Lib
from
'
./src/index.vue
'
;
import
Loading
from
'
./src/index.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
Loading
);
export
{
useLoading
}
from
'
./src/useLoading
'
;
export
{
useLoading
}
from
'
./src/useLoading
'
;
export
{
createLoading
}
from
'
./src/createLoading
'
;
export
{
createLoading
}
from
'
./src/createLoading
'
;
export
const
Loading
=
withInstall
(
LoadingLib
)
;
export
{
Loading
}
;
src/components/Markdown/index.ts
浏览文件 @
74e62cbc
import
MarkDown
Lib
from
'
./src/index.vue
'
;
import
MarkDown
from
'
./src/index.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
MarkDown
);
export
*
from
'
./src/types
'
;
export
*
from
'
./src/types
'
;
export
const
MarkDown
=
withInstall
(
MarkDownLib
)
;
export
{
MarkDown
}
;
src/components/Menu/index.ts
浏览文件 @
74e62cbc
import
BasicMenu
Lib
from
'
./src/BasicMenu
'
;
import
BasicMenu
from
'
./src/BasicMenu
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
BasicMenu
=
withInstall
(
BasicMenuLib
);
withInstall
(
BasicMenu
);
export
{
BasicMenu
};
src/components/Menu/src/BasicMenu.tsx
浏览文件 @
74e62cbc
...
@@ -15,7 +15,6 @@ import {
...
@@ -15,7 +15,6 @@ import {
ComputedRef
,
ComputedRef
,
}
from
'
vue
'
;
}
from
'
vue
'
;
import
{
Menu
}
from
'
ant-design-vue
'
;
import
{
Menu
}
from
'
ant-design-vue
'
;
import
SearchInput
from
'
./SearchInput.vue
'
;
import
MenuContent
from
'
./MenuContent
'
;
import
MenuContent
from
'
./MenuContent
'
;
// import { ScrollContainer } from '/@/components/Container';
// import { ScrollContainer } from '/@/components/Container';
...
@@ -24,8 +23,7 @@ import { ThemeEnum } from '/@/enums/appEnum';
...
@@ -24,8 +23,7 @@ import { ThemeEnum } from '/@/enums/appEnum';
import
{
appStore
}
from
'
/@/store/modules/app
'
;
import
{
appStore
}
from
'
/@/store/modules/app
'
;
import
{
useSearchInput
}
from
'
./hooks/useSearchInput
'
;
import
{
useOpenKeys
}
from
'
./useOpenKeys
'
;
import
{
useOpenKeys
}
from
'
./hooks/useOpenKeys
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
{
useRouter
}
from
'
vue-router
'
;
import
{
isFunction
}
from
'
/@/utils/is
'
;
import
{
isFunction
}
from
'
/@/utils/is
'
;
...
@@ -43,51 +41,39 @@ export default defineComponent({
...
@@ -43,51 +41,39 @@ export default defineComponent({
emits
:
[
'
menuClick
'
],
emits
:
[
'
menuClick
'
],
setup
(
props
,
{
slots
,
emit
})
{
setup
(
props
,
{
slots
,
emit
})
{
const
currentParentPath
=
ref
(
''
);
const
currentParentPath
=
ref
(
''
);
const
menuState
=
reactive
<
MenuState
>
({
const
menuState
=
reactive
<
MenuState
>
({
defaultSelectedKeys
:
[],
defaultSelectedKeys
:
[],
mode
:
props
.
mode
,
mode
:
props
.
mode
,
theme
:
computed
(()
=>
props
.
theme
)
as
ComputedRef
<
ThemeEnum
>
,
theme
:
computed
(()
=>
props
.
theme
)
as
ComputedRef
<
ThemeEnum
>
,
openKeys
:
[],
openKeys
:
[],
searchValue
:
''
,
selectedKeys
:
[],
selectedKeys
:
[],
collapsedOpenKeys
:
[],
collapsedOpenKeys
:
[],
});
});
const
{
getCollapsed
}
=
useMenuSetting
();
const
{
getCollapsed
}
=
useMenuSetting
();
const
{
currentRoute
}
=
useRouter
();
const
{
items
,
flatItems
,
isAppMenu
,
mode
,
accordion
}
=
toRefs
(
props
);
const
{
currentRoute
}
=
useRouter
(
);
const
{
handleInputChange
,
handleInputClick
}
=
useSearchInput
({
const
{
items
,
flatItems
,
mode
,
accordion
}
=
toRefs
(
props
);
flatMenusRef
:
flatItems
,
emit
:
emit
,
menuState
,
handleMenuChange
,
});
const
{
handleOpenChange
,
resetKeys
,
setOpenKeys
}
=
useOpenKeys
(
const
{
handleOpenChange
,
resetKeys
,
setOpenKeys
}
=
useOpenKeys
(
menuState
,
menuState
,
items
,
items
,
flatItems
,
flatItems
,
isAppMenu
,
mode
,
mode
,
accordion
accordion
);
);
const
getOpenKeys
=
computed
(()
=>
{
const
getOpenKeys
=
computed
(()
=>
{
if
(
props
.
isAppMenu
)
{
return
unref
(
getCollapsed
)
?
menuState
.
collapsedOpenKeys
:
menuState
.
openKeys
;
return
unref
(
getCollapsed
)
?
menuState
.
collapsedOpenKeys
:
menuState
.
openKeys
;
}
return
menuState
.
openKeys
;
});
});
// menu外层样式
// menu外层样式
const
getMenuWrapStyle
=
computed
(():
any
=>
{
const
getMenuWrapStyle
=
computed
(():
any
=>
{
const
{
showLogo
,
search
}
=
props
;
const
{
showLogo
}
=
props
;
let
offset
=
0
;
let
offset
=
0
;
if
(
search
)
{
offset
+=
54
;
}
if
(
showLogo
)
{
if
(
showLogo
)
{
offset
+=
46
;
offset
+=
46
;
}
}
...
@@ -110,7 +96,7 @@ export default defineComponent({
...
@@ -110,7 +96,7 @@ export default defineComponent({
cls
.
push
(
'
basic-menu__sidebar-hor
'
);
cls
.
push
(
'
basic-menu__sidebar-hor
'
);
}
}
if
(
!
props
.
isHorizontal
&&
props
.
isAppMenu
&&
appStore
.
getProjectConfig
.
menuSetting
.
split
)
{
if
(
!
props
.
isHorizontal
&&
appStore
.
getProjectConfig
.
menuSetting
.
split
)
{
cls
.
push
(
'
basic-menu__second
'
);
cls
.
push
(
'
basic-menu__second
'
);
}
}
return
cls
;
return
cls
;
...
@@ -197,7 +183,6 @@ export default defineComponent({
...
@@ -197,7 +183,6 @@ export default defineComponent({
level
=
{
index
}
level
=
{
index
}
isHorizontal
=
{
props
.
isHorizontal
}
isHorizontal
=
{
props
.
isHorizontal
}
showTitle
=
{
unref
(
showTitle
)
}
showTitle
=
{
unref
(
showTitle
)
}
searchValue
=
{
menuState
.
searchValue
}
/>,
/>,
]
}
]
}
</
Menu
.
Item
>
</
Menu
.
Item
>
...
@@ -212,7 +197,6 @@ export default defineComponent({
...
@@ -212,7 +197,6 @@ export default defineComponent({
item
=
{
menu
}
item
=
{
menu
}
level
=
{
index
}
level
=
{
index
}
isHorizontal
=
{
props
.
isHorizontal
}
isHorizontal
=
{
props
.
isHorizontal
}
searchValue
=
{
menuState
.
searchValue
}
/>,
/>,
],
],
default
:
()
=>
renderMenuItem
(
menu
.
children
,
index
+
1
),
default
:
()
=>
renderMenuItem
(
menu
.
children
,
index
+
1
),
...
@@ -227,11 +211,9 @@ export default defineComponent({
...
@@ -227,11 +211,9 @@ export default defineComponent({
const
{
selectedKeys
,
defaultSelectedKeys
,
mode
,
theme
}
=
menuState
;
const
{
selectedKeys
,
defaultSelectedKeys
,
mode
,
theme
}
=
menuState
;
const
inlineCollapsedObj
=
isInline
const
inlineCollapsedObj
=
isInline
?
props
.
isAppMenu
?
{
?
{
inlineCollapsed
:
unref
(
getCollapsed
),
inlineCollapsed
:
unref
(
getCollapsed
),
}
}
:
{
inlineCollapsed
:
props
.
inlineCollapsed
}
:
{};
:
{};
return
(
return
(
<
Menu
<
Menu
...
@@ -267,17 +249,8 @@ export default defineComponent({
...
@@ -267,17 +249,8 @@ export default defineComponent({
)
:
(
)
:
(
<
section
class
=
{
[
`basic-menu-wrap`
,
!
unref
(
showTitle
)
&&
'
hide-title
'
]
}
>
<
section
class
=
{
[
`basic-menu-wrap`
,
!
unref
(
showTitle
)
&&
'
hide-title
'
]
}
>
{
getSlot
(
slots
,
'
header
'
)
}
{
getSlot
(
slots
,
'
header
'
)
}
<
SearchInput
class
=
{
!
props
.
search
?
'
hidden
'
:
''
}
theme
=
{
props
.
theme
as
ThemeEnum
}
onChange
=
{
handleInputChange
}
onClick
=
{
handleInputClick
}
collapsed
=
{
unref
(
getCollapsed
)
}
/>
{
/* <section style={unref(getMenuWrapStyle)}> */
}
<
section
style
=
{
unref
(
getMenuWrapStyle
)
}
class
=
"basic-menu__content"
>
<
section
style
=
{
unref
(
getMenuWrapStyle
)
}
class
=
"basic-menu__content"
>
{
/* <ScrollContainer>{() => renderMenu()}</ScrollContainer> */
}
{
renderMenu
()
}
{
renderMenu
()
}
</
section
>
</
section
>
</
section
>
</
section
>
...
...
src/components/Menu/src/BasicMenu.vue
0 → 100644
浏览文件 @
74e62cbc
<
template
>
<div>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
export
default
defineComponent
({
setup
()
{
return
{};
},
});
</
script
>
src/components/Menu/src/MenuContent.tsx
浏览文件 @
74e62cbc
...
@@ -8,11 +8,6 @@ import { useI18n } from '/@/hooks/web/useI18n';
...
@@ -8,11 +8,6 @@ import { useI18n } from '/@/hooks/web/useI18n';
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'
MenuContent
'
,
name
:
'
MenuContent
'
,
props
:
{
props
:
{
searchValue
:
{
type
:
String
as
PropType
<
string
>
,
default
:
''
,
},
item
:
{
item
:
{
type
:
Object
as
PropType
<
MenuType
>
,
type
:
Object
as
PropType
<
MenuType
>
,
default
:
null
,
default
:
null
,
...
@@ -35,11 +30,7 @@ export default defineComponent({
...
@@ -35,11 +30,7 @@ export default defineComponent({
setup
(
props
)
{
setup
(
props
)
{
const
{
t
}
=
useI18n
();
const
{
t
}
=
useI18n
();
const
getI18nName
=
computed
(()
=>
{
const
getI18nName
=
computed
(()
=>
t
(
props
.
item
?.
name
));
const
{
name
}
=
props
.
item
;
return
t
(
name
);
});
/**
/**
* @description: 渲染图标
* @description: 渲染图标
*/
*/
...
@@ -71,28 +62,18 @@ export default defineComponent({
...
@@ -71,28 +62,18 @@ export default defineComponent({
const
{
showTitle
}
=
props
;
const
{
showTitle
}
=
props
;
const
{
icon
}
=
props
.
item
;
const
{
icon
}
=
props
.
item
;
const
name
=
unref
(
getI18nName
);
const
name
=
unref
(
getI18nName
);
const
searchValue
=
props
.
searchValue
||
''
;
const
index
=
name
.
indexOf
(
searchValue
);
const
beforeStr
=
name
.
substr
(
0
,
index
);
const
afterStr
=
name
.
substr
(
index
+
searchValue
.
length
);
const
cls
=
showTitle
?
[
'
show-title
'
]
:
[
'
basic-menu__name
'
];
const
cls
=
showTitle
?
[
'
show-title
'
]
:
[
'
basic-menu__name
'
];
return
(
return
(
<>
<>
{
renderIcon
(
icon
!
)
}
{
renderIcon
(
icon
!
)
}
{
index
>
-
1
&&
searchValue
?
(
{
<
span
class
=
{
cls
}
>
{
beforeStr
}
<
span
class
=
{
`basic-menu__keyword`
}
>
{
searchValue
}
</
span
>
{
afterStr
}
</
span
>
)
:
(
<
span
class
=
{
[
cls
]
}
>
<
span
class
=
{
[
cls
]
}
>
{
name
}
{
name
}
{
renderTag
()
}
{
renderTag
()
}
</
span
>
</
span
>
)
}
}
</>
</>
);
);
};
};
...
...
src/components/Menu/src/SearchInput.vue
已删除
100644 → 0
浏览文件 @
bd6b203f
<
template
>
<section
class=
"menu-search-input"
@
Click=
"handleClick"
:class=
"searchClass"
>
<a-input-search
:placeholder=
"t('component.menu.search')"
class=
"menu-search-input__search"
allowClear
@
change=
"handleChange"
/>
</section>
</
template
>
<
script
lang=
"ts"
>
import
type
{
PropType
}
from
'
vue
'
;
import
{
defineComponent
,
computed
}
from
'
vue
'
;
import
{
ThemeEnum
}
from
'
/@/enums/appEnum
'
;
// hook
import
{
useDebounce
}
from
'
/@/hooks/core/useDebounce
'
;
import
{
useI18n
}
from
'
/@/hooks/web/useI18n
'
;
//
export
default
defineComponent
({
name
:
'
BasicMenuSearchInput
'
,
props
:
{
// Whether to expand, used in the left menu
collapsed
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
theme
:
{
type
:
String
as
PropType
<
ThemeEnum
>
,
},
},
setup
(
props
,
{
emit
})
{
const
{
t
}
=
useI18n
();
const
[
debounceEmitChange
]
=
useDebounce
(
emitChange
,
200
);
function
emitChange
(
value
?:
string
):
void
{
emit
(
'
change
'
,
value
);
}
function
handleChange
(
e
:
ChangeEvent
):
void
{
const
{
collapsed
}
=
props
;
if
(
collapsed
)
return
;
debounceEmitChange
(
e
.
target
.
value
);
}
function
handleClick
():
void
{
emit
(
'
click
'
);
}
const
searchClass
=
computed
(()
=>
{
const
cls
:
string
[]
=
[];
cls
.
push
(
props
.
theme
?
`menu-search-input__search--
${
props
.
theme
}
`
:
''
);
cls
.
push
(
props
.
collapsed
?
'
hide-search-icon
'
:
''
);
return
cls
;
});
return
{
handleClick
,
searchClass
,
handleChange
,
t
};
},
});
</
script
>
<
style
lang=
"less"
>
@import (reference) '../../../design/index.less';
// 输入框背景颜色 深
@input-dark-bg-color: #516085;
@icon-color: #c0c4cc;
.menu-search-input {
margin: 12px 8px;
&.hide-search-icon {
.ant-input,
.ant-input-suffix {
opacity: 0;
transition: all 0.5s;
}
}
&__search--dark {
.ant-input-affix-wrapper,
.ant-input {
.set-bg();
}
.ant-input-search-icon,
.ant-input-clear-icon {
color: rgba(255, 255, 255, 0.4) !important;
}
}
&__search--light {
.ant-input-affix-wrapper,
.ant-input {
color: @text-color-base;
background: #fff;
outline: none;
}
.ant-input-search-icon {
color: @icon-color;
}
}
}
.set-bg() {
color: #fff;
background: @sider-dark-lighten-1-bg-color;
border: 0;
outline: none;
}
.hide-outline() {
border: none;
outline: none;
box-shadow: none;
}
</
style
>
src/components/Menu/src/hooks/useSearchInput.ts
已删除
100644 → 0
浏览文件 @
bd6b203f
import
type
{
Menu
as
MenuType
}
from
'
/@/router/types
'
;
import
type
{
MenuState
}
from
'
../types
'
;
import
type
{
Ref
}
from
'
vue
'
;
import
{
isString
}
from
'
/@/utils/is
'
;
import
{
unref
}
from
'
vue
'
;
import
{
es6Unique
}
from
'
/@/utils
'
;
import
{
getAllParentPath
}
from
'
/@/router/helper/menuHelper
'
;
interface
UseSearchInputOptions
{
menuState
:
MenuState
;
flatMenusRef
:
Ref
<
MenuType
[]
>
;
emit
:
EmitType
;
handleMenuChange
:
Fn
;
}
export
function
useSearchInput
({
menuState
,
flatMenusRef
,
handleMenuChange
,
emit
,
}:
UseSearchInputOptions
)
{
/**
* @description: 输入框搜索
*/
function
handleInputChange
(
value
?:
string
):
void
{
if
(
!
isString
(
value
))
{
value
=
(
value
as
any
).
target
.
value
;
}
if
(
!
value
)
{
handleMenuChange
&&
handleMenuChange
();
}
menuState
.
searchValue
=
value
||
''
;
if
(
!
value
)
{
menuState
.
openKeys
=
[];
return
;
}
const
flatMenus
=
unref
(
flatMenusRef
);
let
openKeys
:
string
[]
=
[];
for
(
const
menu
of
flatMenus
)
{
const
{
name
,
path
}
=
menu
;
if
(
!
name
.
includes
(
value
))
{
continue
;
}
openKeys
=
openKeys
.
concat
(
getAllParentPath
(
flatMenus
,
path
));
}
openKeys
=
es6Unique
(
openKeys
);
menuState
.
openKeys
=
openKeys
;
}
// 搜索框点击
function
handleInputClick
(
e
:
any
):
void
{
emit
(
'
clickSearchInput
'
,
e
);
}
return
{
handleInputChange
,
handleInputClick
};
}
src/components/Menu/src/props.ts
浏览文件 @
74e62cbc
...
@@ -20,11 +20,7 @@ export const basicProps = {
...
@@ -20,11 +20,7 @@ export const basicProps = {
type
:
Boolean
as
PropType
<
boolean
>
,
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
default
:
false
,
},
},
// 是否显示搜索框
search
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
// 最好是4 倍数
// 最好是4 倍数
inlineIndent
:
{
inlineIndent
:
{
type
:
Number
as
PropType
<
number
>
,
type
:
Number
as
PropType
<
number
>
,
...
@@ -51,10 +47,7 @@ export const basicProps = {
...
@@ -51,10 +47,7 @@ export const basicProps = {
type
:
Boolean
as
PropType
<
boolean
>
,
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
default
:
false
,
},
},
isAppMenu
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
true
,
},
isHorizontal
:
{
isHorizontal
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
false
,
default
:
false
,
...
...
src/components/Menu/src/types.ts
浏览文件 @
74e62cbc
...
@@ -17,9 +17,6 @@ export interface MenuState {
...
@@ -17,9 +17,6 @@ export interface MenuState {
// 展开数组
// 展开数组
openKeys
:
string
[];
openKeys
:
string
[];
// 搜索值
searchValue
:
string
;
// 当前选中的菜单项 key 数组
// 当前选中的菜单项 key 数组
selectedKeys
:
string
[];
selectedKeys
:
string
[];
...
...
src/components/Menu/src/
hooks/
useOpenKeys.ts
→
src/components/Menu/src/useOpenKeys.ts
浏览文件 @
74e62cbc
import
{
MenuModeEnum
}
from
'
/@/enums/menuEnum
'
;
import
{
MenuModeEnum
}
from
'
/@/enums/menuEnum
'
;
import
type
{
Menu
as
MenuType
}
from
'
/@/router/types
'
;
import
type
{
Menu
as
MenuType
}
from
'
/@/router/types
'
;
import
type
{
MenuState
}
from
'
.
.
/types
'
;
import
type
{
MenuState
}
from
'
./types
'
;
import
type
{
Ref
}
from
'
vue
'
;
import
type
{
Ref
}
from
'
vue
'
;
import
{
unref
}
from
'
vue
'
;
import
{
unref
}
from
'
vue
'
;
...
@@ -12,14 +12,11 @@ export function useOpenKeys(
...
@@ -12,14 +12,11 @@ export function useOpenKeys(
menuState
:
MenuState
,
menuState
:
MenuState
,
menus
:
Ref
<
MenuType
[]
>
,
menus
:
Ref
<
MenuType
[]
>
,
flatMenusRef
:
Ref
<
MenuType
[]
>
,
flatMenusRef
:
Ref
<
MenuType
[]
>
,
isAppMenu
:
Ref
<
boolean
>
,
mode
:
Ref
<
MenuModeEnum
>
,
mode
:
Ref
<
MenuModeEnum
>
,
accordion
:
Ref
<
boolean
>
accordion
:
Ref
<
boolean
>
)
{
)
{
const
{
getCollapsed
}
=
useMenuSetting
();
const
{
getCollapsed
}
=
useMenuSetting
();
/**
* @description:设置展开
*/
function
setOpenKeys
(
menu
:
MenuType
)
{
function
setOpenKeys
(
menu
:
MenuType
)
{
const
flatMenus
=
unref
(
flatMenusRef
);
const
flatMenus
=
unref
(
flatMenusRef
);
if
(
!
unref
(
accordion
))
{
if
(
!
unref
(
accordion
))
{
...
@@ -50,7 +47,7 @@ export function useOpenKeys(
...
@@ -50,7 +47,7 @@ export function useOpenKeys(
rootSubMenuKeys
.
push
(
path
);
rootSubMenuKeys
.
push
(
path
);
}
}
}
}
if
(
!
unref
(
getCollapsed
)
||
!
unref
(
isAppMenu
)
)
{
if
(
!
unref
(
getCollapsed
))
{
const
latestOpenKey
=
openKeys
.
find
((
key
)
=>
menuState
.
openKeys
.
indexOf
(
key
)
===
-
1
);
const
latestOpenKey
=
openKeys
.
find
((
key
)
=>
menuState
.
openKeys
.
indexOf
(
key
)
===
-
1
);
if
(
rootSubMenuKeys
.
indexOf
(
latestOpenKey
as
string
)
===
-
1
)
{
if
(
rootSubMenuKeys
.
indexOf
(
latestOpenKey
as
string
)
===
-
1
)
{
menuState
.
openKeys
=
openKeys
;
menuState
.
openKeys
=
openKeys
;
...
...
src/components/Modal/index.ts
浏览文件 @
74e62cbc
import
'
./src/index.less
'
;
import
'
./src/index.less
'
;
import
BasicModal
Lib
from
'
./src/BasicModal
'
;
import
BasicModal
from
'
./src/BasicModal
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
BasicModal
);
export
{
useModalContext
}
from
'
./src/useModalContext
'
;
export
{
useModalContext
}
from
'
./src/useModalContext
'
;
export
{
useModal
,
useModalInner
}
from
'
./src/useModal
'
;
export
{
useModal
,
useModalInner
}
from
'
./src/useModal
'
;
export
*
from
'
./src/types
'
;
export
*
from
'
./src/types
'
;
export
const
BasicModal
=
withInstall
(
BasicModalLib
)
;
export
{
BasicModal
}
;
src/components/Page/index.ts
浏览文件 @
74e62cbc
import
PageFooter
Lib
from
'
./src/PageFooter.vue
'
;
import
PageFooter
from
'
./src/PageFooter.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
PageFooter
=
withInstall
(
PageFooterLib
);
withInstall
(
PageFooter
);
export
{
PageFooter
};
src/components/StrengthMeter/index.tsx
浏览文件 @
74e62cbc
import
StrengthMeter
Lib
from
'
./src/index
'
;
import
StrengthMeter
from
'
./src/index
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
StrengthMeter
=
withInstall
(
StrengthMeterLib
);
withInstall
(
StrengthMeter
);
export
{
StrengthMeter
};
src/components/Tinymce/index.ts
浏览文件 @
74e62cbc
import
Tinymce
Lib
from
'
./src/Editor.vue
'
;
import
Tinymce
from
'
./src/Editor.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
Tinymce
=
withInstall
(
TinymceLib
);
withInstall
(
Tinymce
);
export
{
Tinymce
};
src/components/Upload/index.ts
浏览文件 @
74e62cbc
import
type
{
App
}
from
'
vue
'
;
import
BasicUpload
from
'
./src/BasicUpload.vue
'
;
import
BasicUpload
from
'
./src/BasicUpload.vue
'
;
import
{
withInstall
}
from
'
../util
'
;
export
default
(
app
:
App
):
void
=>
{
withInstall
(
BasicUpload
);
app
.
component
(
BasicUpload
.
name
,
BasicUpload
);
};
export
{
BasicUpload
};
export
{
BasicUpload
};
src/components/Verify/index.ts
浏览文件 @
74e62cbc
import
BasicDragVerify
Lib
from
'
./src/DragVerify
'
;
import
BasicDragVerify
from
'
./src/DragVerify
'
;
import
RotateDragVerify
Lib
from
'
./src/ImgRotate
'
;
import
RotateDragVerify
from
'
./src/ImgRotate
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
withInstall
(
BasicDragVerify
,
RotateDragVerify
);
export
*
from
'
./src/types
'
;
export
*
from
'
./src/types
'
;
export
const
RotateDragVerify
=
withInstall
(
RotateDragVerifyLib
);
export
{
BasicDragVerify
,
RotateDragVerify
};
export
const
BasicDragVerify
=
withInstall
(
BasicDragVerifyLib
);
src/components/VirtualScroll/index.ts
浏览文件 @
74e62cbc
import
VirtualScroll
Lib
from
'
./src/index
'
;
import
VirtualScroll
from
'
./src/index
'
;
import
{
withInstall
}
from
'
../util
'
;
import
{
withInstall
}
from
'
../util
'
;
export
const
VirtualScroll
=
withInstall
(
VirtualScrollLib
);
withInstall
(
VirtualScroll
);
export
{
VirtualScroll
};
src/components/util.ts
浏览文件 @
74e62cbc
import
type
{
VNodeChild
,
Plugin
}
from
'
vue
'
;
import
type
{
VNodeChild
}
from
'
vue
'
;
import
type
{
App
}
from
'
vue
'
;
import
type
{
App
}
from
'
vue
'
;
export
function
withInstall
<
T
>
(
component
:
T
)
{
export
function
withInstall
(...
components
:
any
[]
)
{
co
nst
comp
=
component
as
any
;
co
mponents
.
forEach
((
comp
)
=>
{
comp
.
install
=
(
app
:
App
)
=>
{
comp
.
install
=
(
app
:
App
)
=>
{
app
.
component
(
comp
.
displayName
||
comp
.
name
,
comp
);
app
.
component
(
comp
.
displayName
||
comp
.
name
,
comp
);
};
};
return
comp
as
T
&
Plugin
;
})
;
}
}
export
function
convertToUnit
(
export
function
convertToUnit
(
...
...
src/design/var/index.less
浏览文件 @
74e62cbc
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
@import 'easing';
@import 'easing';
@import 'breakpoint';
@import 'breakpoint';
@namespace: vben;
// tabs
// tabs
@multiple-height: 30px;
@multiple-height: 30px;
...
...
src/hooks/core/useContext.ts
浏览文件 @
74e62cbc
import
{
InjectionKey
,
provide
,
inject
,
reactive
,
readonly
}
from
'
vue
'
;
import
{
InjectionKey
,
provide
,
inject
,
reactive
,
readonly
as
defineReadonly
,
defineComponent
,
UnwrapRef
,
}
from
'
vue
'
;
export
const
createContext
=
<
T
>
(
export
interface
CreateContextOptions
{
context
:
any
,
readonly
?:
boolean
;
contextInjectKey
:
InjectionKey
<
T
>
=
Symbol
(),
createProvider
?:
boolean
;
_readonly
=
true
}
)
=>
{
const
state
=
reactive
({
...
context
});
const
provideData
=
_readonly
?
readonly
(
state
)
:
state
;
type
ShallowUnwrap
<
T
>
=
{
provide
(
contextInjectKey
,
provideData
)
;
[
P
in
keyof
T
]:
UnwrapRef
<
T
[
P
]
>
;
};
};
export
function
createContext
<
T
>
(
context
:
any
,
key
:
InjectionKey
<
T
>
=
Symbol
(),
options
:
CreateContextOptions
=
{}
)
{
const
{
readonly
=
true
,
createProvider
=
false
}
=
options
;
const
state
=
reactive
(
context
);
const
provideData
=
readonly
?
defineReadonly
(
state
)
:
state
;
!
createProvider
&&
provide
(
key
,
provideData
);
const
Provider
=
createProvider
?
defineComponent
({
name
:
'
Provider
'
,
inheritAttrs
:
false
,
setup
(
_
,
{
slots
})
{
provide
(
key
,
provideData
);
return
()
=>
slots
.
default
?.();
},
})
:
null
;
return
{
Provider
,
state
};
}
export
const
useContext
=
<
T
>
(
export
const
useContext
=
<
T
>
(
contextInjectK
ey
:
InjectionKey
<
T
>
=
Symbol
(),
k
ey
:
InjectionKey
<
T
>
=
Symbol
(),
defaultValue
?:
any
,
defaultValue
?:
any
,
_readonly
=
true
readonly
=
false
):
T
=>
{
):
ShallowUnwrap
<
T
>
=>
{
const
state
=
inject
(
contextInjectKey
,
defaultValue
||
{});
const
state
=
inject
(
key
,
defaultValue
||
{});
return
_readonly
?
readonly
(
state
)
:
state
;
return
readonly
?
defineReadonly
(
state
)
:
state
;
};
};
src/hooks/setting/useMenuSetting.ts
浏览文件 @
74e62cbc
...
@@ -39,8 +39,6 @@ export function useMenuSetting() {
...
@@ -39,8 +39,6 @@ export function useMenuSetting() {
const
getCollapsedShowTitle
=
computed
(()
=>
unref
(
getMenuSetting
).
collapsedShowTitle
);
const
getCollapsedShowTitle
=
computed
(()
=>
unref
(
getMenuSetting
).
collapsedShowTitle
);
const
getCollapsedShowSearch
=
computed
(()
=>
unref
(
getMenuSetting
).
collapsedShowSearch
);
const
getTopMenuAlign
=
computed
(()
=>
unref
(
getMenuSetting
).
topMenuAlign
);
const
getTopMenuAlign
=
computed
(()
=>
unref
(
getMenuSetting
).
topMenuAlign
);
const
getIsSidebarType
=
computed
(()
=>
unref
(
getMenuType
)
===
MenuTypeEnum
.
SIDEBAR
);
const
getIsSidebarType
=
computed
(()
=>
unref
(
getMenuType
)
===
MenuTypeEnum
.
SIDEBAR
);
...
@@ -63,13 +61,6 @@ export function useMenuSetting() {
...
@@ -63,13 +61,6 @@ export function useMenuSetting() {
return
unref
(
getTrigger
)
===
TriggerEnum
.
HEADER
;
return
unref
(
getTrigger
)
===
TriggerEnum
.
HEADER
;
});
});
const
getShowSearch
=
computed
(()
=>
{
return
(
unref
(
getMenuSetting
).
showSearch
&&
!
(
unref
(
getMenuType
)
===
MenuTypeEnum
.
MIX
&&
unref
(
getMenuMode
)
===
MenuModeEnum
.
HORIZONTAL
)
);
});
const
getIsHorizontal
=
computed
(()
=>
{
const
getIsHorizontal
=
computed
(()
=>
{
return
unref
(
getMenuMode
)
===
MenuModeEnum
.
HORIZONTAL
;
return
unref
(
getMenuMode
)
===
MenuModeEnum
.
HORIZONTAL
;
});
});
...
@@ -119,9 +110,7 @@ export function useMenuSetting() {
...
@@ -119,9 +110,7 @@ export function useMenuSetting() {
getMenuTheme
,
getMenuTheme
,
getCanDrag
,
getCanDrag
,
getIsHorizontal
,
getIsHorizontal
,
getShowSearch
,
getCollapsedShowTitle
,
getCollapsedShowTitle
,
getCollapsedShowSearch
,
getIsSidebarType
,
getIsSidebarType
,
getAccordion
,
getAccordion
,
getShowTopMenu
,
getShowTopMenu
,
...
...
src/hooks/web/useDesign.ts
0 → 100644
浏览文件 @
74e62cbc
import
{
useAppProviderContext
}
from
'
/@/components/Application
'
;
import
{
computed
}
from
'
vue
'
;
// import { useCssModule, reactive } from 'vue';
export
function
useDesign
(
scope
:
string
)
{
const
values
=
useAppProviderContext
();
// const style = cssModule ? useCssModule() : {};
// if (cssModule) {
// Object.keys(style).forEach((key) => {
// const moduleCls = style[key];
// style[key] = `${cls}-${moduleCls}`;
// });
// }
return
{
prefixCls
:
computed
(()
=>
`
${
values
.
prefixCls
}
-
${
scope
}
`
),
prefixVar
:
values
.
prefixCls
,
// style,
};
}
src/hooks/web/useLocale.ts
浏览文件 @
74e62cbc
...
@@ -27,7 +27,6 @@ export function useLocale() {
...
@@ -27,7 +27,6 @@ export function useLocale() {
setLocalSetting
({
lang
});
setLocalSetting
({
lang
});
// i18n.global.setLocaleMessage(locale, messages);
// i18n.global.setLocaleMessage(locale, messages);
antConfigLocaleRef
.
value
=
{
a
:
1
};
switch
(
lang
)
{
switch
(
lang
)
{
// Simplified Chinese
// Simplified Chinese
case
'
zh_CN
'
:
case
'
zh_CN
'
:
...
...
src/layouts/default/header/LayoutHeader.tsx
浏览文件 @
74e62cbc
...
@@ -188,7 +188,6 @@ export default defineComponent({
...
@@ -188,7 +188,6 @@ export default defineComponent({
theme
=
{
unref
(
getHeaderTheme
)
}
theme
=
{
unref
(
getHeaderTheme
)
}
splitType
=
{
unref
(
getSplitType
)
}
splitType
=
{
unref
(
getSplitType
)
}
menuMode
=
{
unref
(
getMenuMode
)
}
menuMode
=
{
unref
(
getMenuMode
)
}
showSearch
=
{
false
}
/>
/>
</
div
>
</
div
>
)
}
)
}
...
...
src/layouts/default/menu/index.tsx
浏览文件 @
74e62cbc
...
@@ -27,9 +27,6 @@ export default defineComponent({
...
@@ -27,9 +27,6 @@ export default defineComponent({
default
:
MenuSplitTyeEnum
.
NONE
,
default
:
MenuSplitTyeEnum
.
NONE
,
},
},
// Whether to show search box
showSearch
:
propTypes
.
bool
.
def
(
true
),
isHorizontal
:
propTypes
.
bool
,
isHorizontal
:
propTypes
.
bool
,
// menu Mode
// menu Mode
menuMode
:
{
menuMode
:
{
...
@@ -42,11 +39,9 @@ export default defineComponent({
...
@@ -42,11 +39,9 @@ export default defineComponent({
const
{
const
{
setMenuSetting
,
setMenuSetting
,
getShowSearch
,
getMenuMode
,
getMenuMode
,
getMenuType
,
getMenuType
,
getCollapsedShowTitle
,
getCollapsedShowTitle
,
getCollapsedShowSearch
,
getIsSidebarType
,
getIsSidebarType
,
getMenuTheme
,
getMenuTheme
,
getCollapsed
,
getCollapsed
,
...
@@ -65,14 +60,6 @@ export default defineComponent({
...
@@ -65,14 +60,6 @@ export default defineComponent({
const
appendClass
=
computed
(()
=>
props
.
splitType
===
MenuSplitTyeEnum
.
TOP
);
const
appendClass
=
computed
(()
=>
props
.
splitType
===
MenuSplitTyeEnum
.
TOP
);
const
showSearch
=
computed
(()
=>
{
return
(
unref
(
getShowSearch
)
&&
props
.
showSearch
&&
(
unref
(
getCollapsedShowSearch
)
?
true
:
!
unref
(
getCollapsed
))
);
});
/**
/**
* click menu
* click menu
* @param menu
* @param menu
...
@@ -122,7 +109,6 @@ export default defineComponent({
...
@@ -122,7 +109,6 @@ export default defineComponent({
collapsedShowTitle
=
{
unref
(
getCollapsedShowTitle
)
}
collapsedShowTitle
=
{
unref
(
getCollapsedShowTitle
)
}
theme
=
{
unref
(
getComputedMenuTheme
)
}
theme
=
{
unref
(
getComputedMenuTheme
)
}
showLogo
=
{
unref
(
showLogo
)
}
showLogo
=
{
unref
(
showLogo
)
}
search
=
{
unref
(
showSearch
)
}
items
=
{
unref
(
menusRef
)
}
items
=
{
unref
(
menusRef
)
}
flatItems
=
{
unref
(
flatMenusRef
)
}
flatItems
=
{
unref
(
flatMenusRef
)
}
accordion
=
{
unref
(
getAccordion
)
}
accordion
=
{
unref
(
getAccordion
)
}
...
...
src/layouts/default/setting/enum.ts
浏览文件 @
74e62cbc
...
@@ -21,7 +21,6 @@ export enum HandlerEnum {
...
@@ -21,7 +21,6 @@ export enum HandlerEnum {
MENU_SHOW_SIDEBAR
,
MENU_SHOW_SIDEBAR
,
MENU_THEME
,
MENU_THEME
,
MENU_SPLIT
,
MENU_SPLIT
,
MENU_SHOW_SEARCH
,
MENU_FIXED
,
MENU_FIXED
,
// header
// header
...
...
src/layouts/default/setting/handler.ts
浏览文件 @
74e62cbc
...
@@ -63,9 +63,6 @@ export function handler(event: HandlerEnum, value: any): DeepPartial<ProjectConf
...
@@ -63,9 +63,6 @@ export function handler(event: HandlerEnum, value: any): DeepPartial<ProjectConf
case
HandlerEnum
.
MENU_FIXED
:
case
HandlerEnum
.
MENU_FIXED
:
return
{
menuSetting
:
{
fixed
:
value
}
};
return
{
menuSetting
:
{
fixed
:
value
}
};
case
HandlerEnum
.
MENU_SHOW_SEARCH
:
return
{
menuSetting
:
{
showSearch
:
value
}
};
// ============transition==================
// ============transition==================
case
HandlerEnum
.
OPEN_PAGE_LOADING
:
case
HandlerEnum
.
OPEN_PAGE_LOADING
:
appStore
.
commitPageLoadingState
(
false
);
appStore
.
commitPageLoadingState
(
false
);
...
...
src/layouts/default/sider/index.less
浏览文件 @
74e62cbc
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
}
}
&:not(.ant-layout-sider-dark) {
&:not(.ant-layout-sider-dark) {
// border-right: 1px solid @border-color-light;
box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
}
}
...
...
src/router/constant.ts
浏览文件 @
74e62cbc
...
@@ -25,7 +25,6 @@ export const getParentLayout = (name: string) => {
...
@@ -25,7 +25,6 @@ export const getParentLayout = (name: string) => {
export
const
PAGE_NOT_FOUND_ROUTE
:
AppRouteRecordRaw
=
{
export
const
PAGE_NOT_FOUND_ROUTE
:
AppRouteRecordRaw
=
{
path
:
'
/:path(.*)*
'
,
path
:
'
/:path(.*)*
'
,
name
:
'
ErrorPage
'
,
name
:
'
ErrorPage
'
,
redirect
:
'
/error/404
'
,
component
:
LAYOUT
,
component
:
LAYOUT
,
meta
:
{
meta
:
{
title
:
'
ErrorPage
'
,
title
:
'
ErrorPage
'
,
...
@@ -33,7 +32,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
...
@@ -33,7 +32,7 @@ export const PAGE_NOT_FOUND_ROUTE: AppRouteRecordRaw = {
},
},
children
:
[
children
:
[
{
{
path
:
'
/
error/404
'
,
path
:
'
/
:path(.*)*
'
,
name
:
'
ErrorPage
'
,
name
:
'
ErrorPage
'
,
component
:
EXCEPTION_COMPONENT
,
component
:
EXCEPTION_COMPONENT
,
meta
:
{
meta
:
{
...
...
src/router/menus/index.ts
浏览文件 @
74e62cbc
...
@@ -21,6 +21,9 @@ Object.keys(modules).forEach((key) => {
...
@@ -21,6 +21,9 @@ Object.keys(modules).forEach((key) => {
// ===========================
// ===========================
// ==========Helper===========
// ==========Helper===========
// ===========================
// ===========================
const
isBackMode
=
()
=>
{
return
appStore
.
getProjectConfig
.
permissionMode
===
PermissionModeEnum
.
BACK
;
};
const
staticMenus
:
Menu
[]
=
[];
const
staticMenus
:
Menu
[]
=
[];
(()
=>
{
(()
=>
{
...
@@ -33,10 +36,6 @@ const staticMenus: Menu[] = [];
...
@@ -33,10 +36,6 @@ const staticMenus: Menu[] = [];
}
}
})();
})();
const
isBackMode
=
()
=>
{
return
appStore
.
getProjectConfig
.
permissionMode
===
PermissionModeEnum
.
BACK
;
};
async
function
getAsyncMenus
()
{
async
function
getAsyncMenus
()
{
// 前端角色控制菜单 直接取菜单文件
// 前端角色控制菜单 直接取菜单文件
if
(
!
isBackMode
())
{
if
(
!
isBackMode
())
{
...
...
src/settings/colorSetting.ts
浏览文件 @
74e62cbc
...
@@ -17,9 +17,11 @@ export const HEADER_PRESET_BG_COLOR_LIST: string[] = [
...
@@ -17,9 +17,11 @@ export const HEADER_PRESET_BG_COLOR_LIST: string[] = [
export
const
SIDE_BAR_BG_COLOR_LIST
:
string
[]
=
[
export
const
SIDE_BAR_BG_COLOR_LIST
:
string
[]
=
[
'
#273352
'
,
'
#273352
'
,
'
#ffffff
'
,
'
#ffffff
'
,
'
#191b24
'
,
'
#191a23
'
,
'
#191a23
'
,
'
#001529
'
,
'
#001529
'
,
'
#304156
'
,
'
#304156
'
,
'
#001628
'
,
'
#28333E
'
,
'
#28333E
'
,
'
#344058
'
,
'
#344058
'
,
];
];
src/settings/projectSetting.ts
浏览文件 @
74e62cbc
...
@@ -89,8 +89,6 @@ const setting: ProjectConfig = {
...
@@ -89,8 +89,6 @@ const setting: ProjectConfig = {
show
:
true
,
show
:
true
,
// Whether to show dom
// Whether to show dom
hidden
:
true
,
hidden
:
true
,
// Whether to show search box
showSearch
:
true
,
// Menu width
// Menu width
menuWidth
:
210
,
menuWidth
:
210
,
// Menu mode
// Menu mode
...
...
src/types/config.d.ts
浏览文件 @
74e62cbc
...
@@ -9,7 +9,6 @@ export interface MenuSetting {
...
@@ -9,7 +9,6 @@ export interface MenuSetting {
collapsed
:
boolean
;
collapsed
:
boolean
;
collapsedShowTitle
:
boolean
;
collapsedShowTitle
:
boolean
;
canDrag
:
boolean
;
canDrag
:
boolean
;
showSearch
:
boolean
;
show
:
boolean
;
show
:
boolean
;
hidden
:
boolean
;
hidden
:
boolean
;
split
:
boolean
;
split
:
boolean
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录