Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
25fe3e6d
提交
25fe3e6d
authored
5月 09, 2023
作者:
方治民
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of
https://gitlab.yiring.com/basic/basic-vue-admin
into dev
上级
b8000de2
04e3c264
隐藏空白字符变更
内嵌
并排
正在显示
55 个修改的文件
包含
144 行增加
和
113 行删除
+144
-113
_util.ts
mock/_util.ts
+3
-1
select-demo.ts
mock/demo/select-demo.ts
+1
-1
tree-demo.ts
mock/demo/tree-demo.ts
+1
-1
user.ts
mock/sys/user.ts
+1
-1
package.json
package.json
+5
-6
pnpm-lock.yaml
pnpm-lock.yaml
+0
-0
error.ts
src/api/demo/error.ts
+3
-1
menu.ts
src/api/sys/menu.ts
+1
-1
AppSearchModal.vue
src/components/Application/src/search/AppSearchModal.vue
+3
-3
data.ts
src/components/CardList/src/data.ts
+1
-1
CropperAvatar.vue
src/components/Cropper/src/CropperAvatar.vue
+2
-2
useDrawer.ts
src/components/Drawer/src/useDrawer.ts
+1
-1
Dropdown.vue
src/components/Dropdown/src/Dropdown.vue
+3
-1
SvgIcon.vue
src/components/Icon/src/SvgIcon.vue
+1
-1
getTheme.ts
src/components/Markdown/src/getTheme.ts
+2
-2
useModal.ts
src/components/Modal/src/hooks/useModal.ts
+1
-1
index.less
src/components/Modal/src/index.less
+7
-7
Functional.vue
src/components/Preview/src/Functional.vue
+1
-4
drawCanvas.ts
src/components/Qrcode/src/drawCanvas.ts
+1
-1
drawLogo.ts
src/components/Qrcode/src/drawLogo.ts
+1
-1
toCanvas.ts
src/components/Qrcode/src/toCanvas.ts
+1
-1
Scrollbar.vue
src/components/Scrollbar/src/Scrollbar.vue
+3
-3
helper.ts
src/components/Tinymce/src/helper.ts
+4
-2
permission.ts
src/directives/permission.ts
+1
-1
useScrollTo.ts
src/hooks/event/useScrollTo.ts
+3
-3
index.ts
src/hooks/setting/index.ts
+1
-1
useFullContent.ts
src/hooks/web/useFullContent.ts
+1
-1
useI18n.ts
src/hooks/web/useI18n.ts
+3
-1
useMessage.tsx
src/hooks/web/useMessage.tsx
+1
-1
usePage.ts
src/hooks/web/usePage.ts
+1
-1
index.vue
src/layouts/default/menu/index.vue
+1
-1
enum.ts
src/layouts/default/setting/enum.ts
+1
-1
MixSider.vue
src/layouts/default/sider/MixSider.vue
+2
-2
constant.ts
src/router/constant.ts
+7
-3
paramMenuGuard.ts
src/router/guard/paramMenuGuard.ts
+3
-3
routeHelper.ts
src/router/helper/routeHelper.ts
+3
-1
index.ts
src/router/index.ts
+3
-2
index.ts
src/router/menus/index.ts
+5
-5
multipleTab.ts
src/store/modules/multipleTab.ts
+1
-1
index.ts
src/utils/cache/index.ts
+4
-4
storageCache.ts
src/utils/cache/storageCache.ts
+2
-2
treeHelper.ts
src/utils/helper/treeHelper.ts
+3
-1
axiosCancel.ts
src/utils/http/axios/axiosCancel.ts
+3
-1
index.ts
src/utils/index.ts
+2
-2
props.ts
src/utils/props.ts
+13
-8
proxy.ts
src/utils/proxy.ts
+3
-3
DatabaseSchemaTable.vue
...demo/tools/online/form/components/DatabaseSchemaTable.vue
+4
-2
edit.vue
src/views/demo/tools/online/form/edit.vue
+3
-5
index.vue
src/views/demo/tools/online/form/index.vue
+1
-1
index.vue
src/views/sys/about/index.vue
+6
-2
LockPage.vue
src/views/sys/lock/LockPage.vue
+2
-0
Login.vue
src/views/sys/login/Login.vue
+8
-2
SessionTimeoutLogin.vue
src/views/sys/login/SessionTimeoutLogin.vue
+1
-1
stylelint.config.js
stylelint.config.js
+4
-7
global.d.ts
types/global.d.ts
+1
-1
没有找到文件。
mock/_util.ts
浏览文件 @
25fe3e6d
...
@@ -6,7 +6,9 @@ import type { MockMethod } from 'vite-plugin-mock'
...
@@ -6,7 +6,9 @@ import type { MockMethod } from 'vite-plugin-mock'
* @param path 请求地址
* @param path 请求地址
* @returns 拼接 BASE_URL 后的请求地址
* @returns 拼接 BASE_URL 后的请求地址
*/
*/
export
const
URL
=
(
path
:
string
):
string
=>
`/basic-api
${
path
}
`
export
function
URL
(
path
:
string
):
string
{
return
`/basic-api
${
path
}
`
}
/**
/**
* 通用响应工具类
* 通用响应工具类
...
...
mock/demo/select-demo.ts
浏览文件 @
25fe3e6d
import
type
{
MockMethod
}
from
'vite-plugin-mock'
import
type
{
MockMethod
}
from
'vite-plugin-mock'
import
{
Response
}
from
'../_util'
import
{
Response
}
from
'../_util'
const
demoList
=
(
keyword
,
count
=
20
)
=>
{
function
demoList
(
keyword
,
count
=
20
)
{
const
result
=
{
const
result
=
{
list
:
[]
as
any
[],
list
:
[]
as
any
[],
}
}
...
...
mock/demo/tree-demo.ts
浏览文件 @
25fe3e6d
import
type
{
MockMethod
}
from
'vite-plugin-mock'
import
type
{
MockMethod
}
from
'vite-plugin-mock'
import
{
Response
}
from
'../_util'
import
{
Response
}
from
'../_util'
const
demoTreeList
=
(
keyword
)
=>
{
function
demoTreeList
(
keyword
)
{
const
result
=
{
const
result
=
{
list
:
[]
as
Recordable
[],
list
:
[]
as
Recordable
[],
}
}
...
...
mock/sys/user.ts
浏览文件 @
25fe3e6d
...
@@ -4,7 +4,7 @@ import qs from 'qs'
...
@@ -4,7 +4,7 @@ import qs from 'qs'
import
type
{
MockMethod
}
from
'vite-plugin-mock'
import
type
{
MockMethod
}
from
'vite-plugin-mock'
import
{
Request
,
Response
}
from
'../_util'
import
{
Request
,
Response
}
from
'../_util'
const
parseFormParams
=
(
req
:
IncomingMessage
):
Promise
<
Recordable
>
=
>
{
function
parseFormParams
(
req
:
IncomingMessage
):
Promise
<
Recordable
>
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
let
body
=
''
let
body
=
''
req
.
on
(
'data'
,
function
(
chunk
)
{
req
.
on
(
'data'
,
function
(
chunk
)
{
...
...
package.json
浏览文件 @
25fe3e6d
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
"
@antfu/eslint-config
"
:
"^0.38.2"
,
"
@antfu/eslint-config
"
:
"^0.38.2"
,
"
@commitlint/cli
"
:
"^17.5.1"
,
"
@commitlint/cli
"
:
"^17.5.1"
,
"
@commitlint/config-conventional
"
:
"^17.4.4"
,
"
@commitlint/config-conventional
"
:
"^17.4.4"
,
"
@iconify/json
"
:
"^2.2.4
2
"
,
"
@iconify/json
"
:
"^2.2.4
3
"
,
"
@purge-icons/generated
"
:
"^0.9.0"
,
"
@purge-icons/generated
"
:
"^0.9.0"
,
"
@types/codemirror
"
:
"^5.60.7"
,
"
@types/codemirror
"
:
"^5.60.7"
,
"
@types/crypto-js
"
:
"^4.1.1"
,
"
@types/crypto-js
"
:
"^4.1.1"
,
...
@@ -163,12 +163,11 @@
...
@@ -163,12 +163,11 @@
"
rollup-plugin-visualizer
"
:
"^5.9.0"
,
"
rollup-plugin-visualizer
"
:
"^5.9.0"
,
"
sass
"
:
"^1.60.0"
,
"
sass
"
:
"^1.60.0"
,
"
sort-package-json
"
:
"^2.4.1"
,
"
sort-package-json
"
:
"^2.4.1"
,
"
stylelint
"
:
"^14.16.1"
,
"
stylelint
"
:
"^15.4.0"
,
"
stylelint-config-prettier
"
:
"^9.0.5"
,
"
stylelint-config-recommended
"
:
"^11.0.0"
,
"
stylelint-config-recommended
"
:
"^9.0.0"
,
"
stylelint-config-recommended-vue
"
:
"^1.4.0"
,
"
stylelint-config-recommended-vue
"
:
"^1.4.0"
,
"
stylelint-config-standard
"
:
"^
29
.0.0"
,
"
stylelint-config-standard
"
:
"^
32
.0.0"
,
"
stylelint-order
"
:
"^
5.0.0
"
,
"
stylelint-order
"
:
"^
6.0.3
"
,
"
terser
"
:
"^5.16.8"
,
"
terser
"
:
"^5.16.8"
,
"
ts-node
"
:
"^10.9.1"
,
"
ts-node
"
:
"^10.9.1"
,
"
typescript
"
:
"^5.0.3"
,
"
typescript
"
:
"^5.0.3"
,
...
...
pnpm-lock.yaml
浏览文件 @
25fe3e6d
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/api/demo/error.ts
浏览文件 @
25fe3e6d
...
@@ -9,4 +9,6 @@ enum Api {
...
@@ -9,4 +9,6 @@ enum Api {
* @description: Trigger ajax error
* @description: Trigger ajax error
*/
*/
export
const
fireErrorApi
=
()
=>
defHttp
.
get
({
url
:
Api
.
Error
})
export
function
fireErrorApi
()
{
return
defHttp
.
get
({
url
:
Api
.
Error
})
}
src/api/sys/menu.ts
浏览文件 @
25fe3e6d
...
@@ -9,6 +9,6 @@ enum Api {
...
@@ -9,6 +9,6 @@ enum Api {
* @description: Get user menu based on id
* @description: Get user menu based on id
*/
*/
export
const
getMenuList
=
()
=>
{
export
function
getMenuList
()
{
return
defHttp
.
get
<
getMenuListResultModel
>
({
url
:
Api
.
GetMenuList
})
return
defHttp
.
get
<
getMenuListResultModel
>
({
url
:
Api
.
GetMenuList
})
}
}
src/components/Application/src/search/AppSearchModal.vue
浏览文件 @
25fe3e6d
...
@@ -163,7 +163,7 @@
...
@@ -163,7 +163,7 @@
&__item
{
&__item
{
&-enter
{
&-enter
{
opacity
:
0
%
!important
;
opacity
:
0
!important
;
}
}
}
}
}
}
...
@@ -249,7 +249,7 @@
...
@@ -249,7 +249,7 @@
background-color
:
@
primary-color
;
background-color
:
@
primary-color
;
.@{prefix-cls
}
-list__item-enter
{
.@{prefix-cls
}
-list__item-enter
{
opacity
:
1
00%
;
opacity
:
1
;
}
}
}
}
...
@@ -263,7 +263,7 @@
...
@@ -263,7 +263,7 @@
&
-enter
{
&
-enter
{
width
:
30px
;
width
:
30px
;
opacity
:
0
%
;
opacity
:
0
;
}
}
}
}
}
}
...
...
src/components/CardList/src/data.ts
浏览文件 @
25fe3e6d
...
@@ -2,7 +2,7 @@ import { ref } from 'vue'
...
@@ -2,7 +2,7 @@ import { ref } from 'vue'
// 每行个数
// 每行个数
export
const
grid
=
ref
(
12
)
export
const
grid
=
ref
(
12
)
// slider属性
// slider属性
export
const
useSlider
=
(
min
=
6
,
max
=
12
)
=>
{
export
function
useSlider
(
min
=
6
,
max
=
12
)
{
// 每行显示个数滑动条
// 每行显示个数滑动条
const
getMarks
=
()
=>
{
const
getMarks
=
()
=>
{
const
l
=
{}
const
l
=
{}
...
...
src/components/Cropper/src/CropperAvatar.vue
浏览文件 @
25fe3e6d
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
}
}
&
-image-mask
{
&
-image-mask
{
opacity
:
0
%
;
opacity
:
0
;
position
:
absolute
;
position
:
absolute
;
width
:
inherit
;
width
:
inherit
;
height
:
inherit
;
height
:
inherit
;
...
@@ -126,7 +126,7 @@
...
@@ -126,7 +126,7 @@
}
}
&
-image-mask
:hover
{
&
-image-mask
:hover
{
opacity
:
40
00%
;
opacity
:
40
;
}
}
&
-upload-btn
{
&
-upload-btn
{
...
...
src/components/Drawer/src/useDrawer.ts
浏览文件 @
25fe3e6d
...
@@ -88,7 +88,7 @@ export function useDrawer(): UseDrawerReturnType {
...
@@ -88,7 +88,7 @@ export function useDrawer(): UseDrawerReturnType {
return
[
register
,
methods
]
return
[
register
,
methods
]
}
}
export
const
useDrawerInner
=
(
callbackFn
?:
Fn
):
UseDrawerInnerReturnType
=>
{
export
function
useDrawerInner
(
callbackFn
?:
Fn
):
UseDrawerInnerReturnType
{
const
drawerInstanceRef
=
ref
<
Nullable
<
DrawerInstance
>>
(
null
)
const
drawerInstanceRef
=
ref
<
Nullable
<
DrawerInstance
>>
(
null
)
const
currentInstance
=
getCurrentInstance
()
const
currentInstance
=
getCurrentInstance
()
const
uidRef
=
ref
<
string
>
(
''
)
const
uidRef
=
ref
<
string
>
(
''
)
...
...
src/components/Dropdown/src/Dropdown.vue
浏览文件 @
25fe3e6d
...
@@ -65,7 +65,9 @@
...
@@ -65,7 +65,9 @@
}
}
})
})
const
getAttr
=
(
key
:
string
|
number
)
=>
({
key
})
function
getAttr
(
key
:
string
|
number
)
{
return
{
key
}
}
</
script
>
</
script
>
<
template
>
<
template
>
...
...
src/components/Icon/src/SvgIcon.vue
浏览文件 @
25fe3e6d
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
display
:
inline-block
;
display
:
inline-block
;
overflow
:
hidden
;
overflow
:
hidden
;
vertical-align
:
-0.15em
;
vertical-align
:
-0.15em
;
fill
:
current
C
olor
;
fill
:
current
c
olor
;
}
}
.svg-icon-spin
{
.svg-icon-spin
{
...
...
src/components/Markdown/src/getTheme.ts
浏览文件 @
25fe3e6d
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
* @param darkModeVal 深色模式值
* @param darkModeVal 深色模式值
* @param themeMode 主题类型——外观(默认), 内容, 代码块
* @param themeMode 主题类型——外观(默认), 内容, 代码块
*/
*/
export
const
getTheme
=
(
export
function
getTheme
(
darkModeVal
:
'light'
|
'dark'
|
string
,
darkModeVal
:
'light'
|
'dark'
|
string
,
themeMode
:
'default'
|
'content'
|
'code'
=
'default'
,
themeMode
:
'default'
|
'content'
|
'code'
=
'default'
,
)
=>
{
)
{
const
isDark
=
darkModeVal
===
'dark'
const
isDark
=
darkModeVal
===
'dark'
switch
(
themeMode
)
{
switch
(
themeMode
)
{
case
'default'
:
case
'default'
:
...
...
src/components/Modal/src/hooks/useModal.ts
浏览文件 @
25fe3e6d
...
@@ -84,7 +84,7 @@ export function useModal(): UseModalReturnType {
...
@@ -84,7 +84,7 @@ export function useModal(): UseModalReturnType {
return
[
register
,
methods
]
return
[
register
,
methods
]
}
}
export
const
useModalInner
=
(
callbackFn
?:
Fn
):
UseModalInnerReturnType
=>
{
export
function
useModalInner
(
callbackFn
?:
Fn
):
UseModalInnerReturnType
{
const
modalInstanceRef
=
ref
<
Nullable
<
ModalMethods
>>
(
null
)
const
modalInstanceRef
=
ref
<
Nullable
<
ModalMethods
>>
(
null
)
const
currentInstance
=
getCurrentInstance
()
const
currentInstance
=
getCurrentInstance
()
const
uidRef
=
ref
<
string
>
(
''
)
const
uidRef
=
ref
<
string
>
(
''
)
...
...
src/components/Modal/src/index.less
浏览文件 @
25fe3e6d
...
@@ -2,10 +2,7 @@
...
@@ -2,10 +2,7 @@
overflow: hidden;
overflow: hidden;
.ant-modal {
.ant-modal {
top: 0 !important;
inset: 0 !important;
right: 0 !important;
bottom: 0 !important;
left: 0 !important;
width: 100% !important;
width: 100% !important;
height: 100%;
height: 100%;
max-width: 100vw !important;
max-width: 100vw !important;
...
@@ -111,17 +108,20 @@
...
@@ -111,17 +108,20 @@
.ant-modal-confirm .ant-modal-body {
.ant-modal-confirm .ant-modal-body {
padding: 24px !important;
padding: 24px !important;
}
}
@media screen and (max-height: 600px) {
@media screen and (min-height: 600px) {
.ant-modal {
.ant-modal {
top: 60px;
top: 60px;
}
}
}
}
@media screen and (max-height: 540px) {
@media screen and (min-height: 540px) {
.ant-modal {
.ant-modal {
top: 30px;
top: 30px;
}
}
}
}
@media screen and (max-height: 480px) {
@media screen and (min-height: 480px) {
.ant-modal {
.ant-modal {
top: 10px;
top: 10px;
}
}
...
...
src/components/Preview/src/Functional.vue
浏览文件 @
25fe3e6d
...
@@ -414,10 +414,7 @@
...
@@ -414,10 +414,7 @@
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.img-preview
{
.img-preview
{
position
:
fixed
;
position
:
fixed
;
top
:
0
;
inset
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
z-index
:
@
preview-comp-z-index
;
z-index
:
@
preview-comp-z-index
;
background
:
rgb
(
0
0
0
/
50%
);
background
:
rgb
(
0
0
0
/
50%
);
user-select
:
none
;
user-select
:
none
;
...
...
src/components/Qrcode/src/drawCanvas.ts
浏览文件 @
25fe3e6d
...
@@ -3,7 +3,7 @@ import type { QRCodeRenderersOptions } from 'qrcode'
...
@@ -3,7 +3,7 @@ import type { QRCodeRenderersOptions } from 'qrcode'
import
{
cloneDeep
}
from
'lodash-es'
import
{
cloneDeep
}
from
'lodash-es'
import
type
{
ContentType
,
RenderQrCodeParams
}
from
'./typing'
import
type
{
ContentType
,
RenderQrCodeParams
}
from
'./typing'
export
const
renderQrCode
=
({
canvas
,
content
,
width
=
0
,
options
:
params
=
{}
}:
RenderQrCodeParams
)
=>
{
export
function
renderQrCode
({
canvas
,
content
,
width
=
0
,
options
:
params
=
{}
}:
RenderQrCodeParams
)
{
const
options
=
cloneDeep
(
params
)
const
options
=
cloneDeep
(
params
)
// 容错率,默认对内容少的二维码采用高容错率,内容多的二维码采用低容错率
// 容错率,默认对内容少的二维码采用高容错率,内容多的二维码采用低容错率
options
.
errorCorrectionLevel
=
options
.
errorCorrectionLevel
||
getErrorCorrectionLevel
(
content
)
options
.
errorCorrectionLevel
=
options
.
errorCorrectionLevel
||
getErrorCorrectionLevel
(
content
)
...
...
src/components/Qrcode/src/drawLogo.ts
浏览文件 @
25fe3e6d
import
{
isString
}
from
'/@/utils/is'
import
{
isString
}
from
'/@/utils/is'
import
type
{
LogoType
,
RenderQrCodeParams
}
from
'./typing'
import
type
{
LogoType
,
RenderQrCodeParams
}
from
'./typing'
export
const
drawLogo
=
({
canvas
,
logo
}:
RenderQrCodeParams
)
=>
{
export
function
drawLogo
({
canvas
,
logo
}:
RenderQrCodeParams
)
{
if
(
!
logo
)
{
if
(
!
logo
)
{
return
new
Promise
((
resolve
)
=>
{
return
new
Promise
((
resolve
)
=>
{
resolve
((
canvas
as
HTMLCanvasElement
).
toDataURL
())
resolve
((
canvas
as
HTMLCanvasElement
).
toDataURL
())
...
...
src/components/Qrcode/src/toCanvas.ts
浏览文件 @
25fe3e6d
import
{
renderQrCode
}
from
'./drawCanvas'
import
{
renderQrCode
}
from
'./drawCanvas'
import
{
drawLogo
}
from
'./drawLogo'
import
{
drawLogo
}
from
'./drawLogo'
import
type
{
RenderQrCodeParams
}
from
'./typing'
import
type
{
RenderQrCodeParams
}
from
'./typing'
export
const
toCanvas
=
(
options
:
RenderQrCodeParams
)
=>
{
export
function
toCanvas
(
options
:
RenderQrCodeParams
)
{
return
renderQrCode
(
options
)
return
renderQrCode
(
options
)
.
then
(()
=>
{
.
then
(()
=>
{
return
options
return
options
...
...
src/components/Scrollbar/src/Scrollbar.vue
浏览文件 @
25fe3e6d
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
display
:
none
;
display
:
none
;
width
:
0
;
width
:
0
;
height
:
0
;
height
:
0
;
opacity
:
0
%
;
opacity
:
0
;
}
}
}
}
}
}
...
@@ -168,7 +168,7 @@
...
@@ -168,7 +168,7 @@
bottom
:
2px
;
bottom
:
2px
;
z-index
:
1
;
z-index
:
1
;
border-radius
:
4px
;
border-radius
:
4px
;
opacity
:
0
%
;
opacity
:
0
;
transition
:
opacity
80ms
ease
;
transition
:
opacity
80ms
ease
;
&.is-vertical
{
&.is-vertical
{
...
@@ -194,7 +194,7 @@
...
@@ -194,7 +194,7 @@
.scrollbar
:active
>
.scrollbar__bar
,
.scrollbar
:active
>
.scrollbar__bar
,
.scrollbar
:focus
>
.scrollbar__bar
,
.scrollbar
:focus
>
.scrollbar__bar
,
.scrollbar
:hover
>
.scrollbar__bar
{
.scrollbar
:hover
>
.scrollbar__bar
{
opacity
:
1
00%
;
opacity
:
1
;
transition
:
opacity
340ms
ease-out
;
transition
:
opacity
340ms
ease-out
;
}
}
</
style
>
</
style
>
src/components/Tinymce/src/helper.ts
浏览文件 @
25fe3e6d
...
@@ -63,9 +63,11 @@ const validEvents = [
...
@@ -63,9 +63,11 @@ const validEvents = [
'onVisualAid'
,
'onVisualAid'
,
]
]
const
isValidKey
=
(
key
:
string
)
=>
validEvents
.
includes
(
key
)
function
isValidKey
(
key
:
string
)
{
return
validEvents
.
includes
(
key
)
}
export
const
bindHandlers
=
(
initEvent
:
Event
,
listeners
:
any
,
editor
:
any
):
void
=>
{
export
function
bindHandlers
(
initEvent
:
Event
,
listeners
:
any
,
editor
:
any
):
void
{
Object
.
keys
(
listeners
)
Object
.
keys
(
listeners
)
.
filter
(
isValidKey
)
.
filter
(
isValidKey
)
.
forEach
((
key
:
string
)
=>
{
.
forEach
((
key
:
string
)
=>
{
...
...
src/directives/permission.ts
浏览文件 @
25fe3e6d
...
@@ -17,7 +17,7 @@ function isAuth(el: Element, binding: any) {
...
@@ -17,7 +17,7 @@ function isAuth(el: Element, binding: any) {
}
}
}
}
const
mounted
=
(
el
:
Element
,
binding
:
DirectiveBinding
<
any
>
)
=>
{
function
mounted
(
el
:
Element
,
binding
:
DirectiveBinding
<
any
>
)
{
isAuth
(
el
,
binding
)
isAuth
(
el
,
binding
)
}
}
...
...
src/hooks/event/useScrollTo.ts
浏览文件 @
25fe3e6d
...
@@ -8,7 +8,7 @@ export interface ScrollToParams {
...
@@ -8,7 +8,7 @@ export interface ScrollToParams {
callback
?:
()
=>
any
callback
?:
()
=>
any
}
}
const
easeInOutQuad
=
(
t
:
number
,
b
:
number
,
c
:
number
,
d
:
number
)
=>
{
function
easeInOutQuad
(
t
:
number
,
b
:
number
,
c
:
number
,
d
:
number
)
{
t
/=
d
/
2
t
/=
d
/
2
if
(
t
<
1
)
{
if
(
t
<
1
)
{
return
(
c
/
2
)
*
t
*
t
+
b
return
(
c
/
2
)
*
t
*
t
+
b
...
@@ -16,11 +16,11 @@ const easeInOutQuad = (t: number, b: number, c: number, d: number) => {
...
@@ -16,11 +16,11 @@ const easeInOutQuad = (t: number, b: number, c: number, d: number) => {
t
--
t
--
return
(
-
c
/
2
)
*
(
t
*
(
t
-
2
)
-
1
)
+
b
return
(
-
c
/
2
)
*
(
t
*
(
t
-
2
)
-
1
)
+
b
}
}
const
move
=
(
el
:
HTMLElement
,
amount
:
number
)
=>
{
function
move
(
el
:
HTMLElement
,
amount
:
number
)
{
el
.
scrollTop
=
amount
el
.
scrollTop
=
amount
}
}
const
position
=
(
el
:
HTMLElement
)
=>
{
function
position
(
el
:
HTMLElement
)
{
return
el
.
scrollTop
return
el
.
scrollTop
}
}
export
function
useScrollTo
({
el
,
to
,
duration
=
500
,
callback
}:
ScrollToParams
)
{
export
function
useScrollTo
({
el
,
to
,
duration
=
500
,
callback
}:
ScrollToParams
)
{
...
...
src/hooks/setting/index.ts
浏览文件 @
25fe3e6d
...
@@ -3,7 +3,7 @@ import type { GlobConfig } from '/#/config'
...
@@ -3,7 +3,7 @@ import type { GlobConfig } from '/#/config'
import
{
warn
}
from
'/@/utils/log'
import
{
warn
}
from
'/@/utils/log'
import
{
getAppEnvConfig
}
from
'/@/utils/env'
import
{
getAppEnvConfig
}
from
'/@/utils/env'
export
const
useGlobSetting
=
():
Readonly
<
GlobConfig
>
=
>
{
export
function
useGlobSetting
():
Readonly
<
GlobConfig
>
{
const
{
const
{
VITE_GLOB_APP_TITLE
,
VITE_GLOB_APP_TITLE
,
VITE_GLOB_API_URL
,
VITE_GLOB_API_URL
,
...
...
src/hooks/web/useFullContent.ts
浏览文件 @
25fe3e6d
...
@@ -7,7 +7,7 @@ import { useRouter } from 'vue-router'
...
@@ -7,7 +7,7 @@ import { useRouter } from 'vue-router'
/**
/**
* @description: Full screen display content
* @description: Full screen display content
*/
*/
export
const
useFullContent
=
()
=>
{
export
function
useFullContent
()
{
const
appStore
=
useAppStore
()
const
appStore
=
useAppStore
()
const
router
=
useRouter
()
const
router
=
useRouter
()
const
{
currentRoute
}
=
router
const
{
currentRoute
}
=
router
...
...
src/hooks/web/useI18n.ts
浏览文件 @
25fe3e6d
...
@@ -52,4 +52,6 @@ export function useI18n(namespace?: string): {
...
@@ -52,4 +52,6 @@ export function useI18n(namespace?: string): {
// 为什么要编写此函数?
// 为什么要编写此函数?
// 主要用于配合vscode i18nn ally插件。此功能仅用于路由和菜单。请在其他地方使用useI18n
// 主要用于配合vscode i18nn ally插件。此功能仅用于路由和菜单。请在其他地方使用useI18n
export
const
t
=
(
key
:
string
)
=>
key
export
function
t
(
key
:
string
)
{
return
key
}
src/hooks/web/useMessage.tsx
浏览文件 @
25fe3e6d
...
@@ -69,7 +69,7 @@ function createConfirm(options: ModalOptionsEx): ConfirmOptions {
...
@@ -69,7 +69,7 @@ function createConfirm(options: ModalOptionsEx): ConfirmOptions {
return
Modal
.
confirm
(
opt
)
as
unknown
as
ConfirmOptions
return
Modal
.
confirm
(
opt
)
as
unknown
as
ConfirmOptions
}
}
const
getBaseOptions
=
()
=>
{
function
getBaseOptions
()
{
const
{
t
}
=
useI18n
()
const
{
t
}
=
useI18n
()
return
{
return
{
okText
:
t
(
'common.okText'
),
okText
:
t
(
'common.okText'
),
...
...
src/hooks/web/usePage.ts
浏览文件 @
25fe3e6d
...
@@ -30,7 +30,7 @@ export function useGo(_router?: Router) {
...
@@ -30,7 +30,7 @@ export function useGo(_router?: Router) {
/**
/**
* @description: redo current page
* @description: redo current page
*/
*/
export
const
useRedo
=
(
_router
?:
Router
)
=>
{
export
function
useRedo
(
_router
?:
Router
)
{
const
{
replace
,
currentRoute
}
=
_router
||
useRouter
()
const
{
replace
,
currentRoute
}
=
_router
||
useRouter
()
const
{
query
,
params
=
{},
name
,
fullPath
}
=
unref
(
currentRoute
.
value
)
const
{
query
,
params
=
{},
name
,
fullPath
}
=
unref
(
currentRoute
.
value
)
function
redo
():
Promise
<
boolean
>
{
function
redo
():
Promise
<
boolean
>
{
...
...
src/layouts/default/menu/index.vue
浏览文件 @
25fe3e6d
...
@@ -190,7 +190,7 @@
...
@@ -190,7 +190,7 @@
&
--mobile
{
&
--mobile
{
.@{logo-prefix-cls
}
{
.@{logo-prefix-cls
}
{
&__title
{
&__title
{
opacity
:
1
00%
;
opacity
:
1
;
}
}
}
}
}
}
...
...
src/layouts/default/setting/enum.ts
浏览文件 @
25fe3e6d
...
@@ -79,7 +79,7 @@ export const topMenuAlignOptions = [
...
@@ -79,7 +79,7 @@ export const topMenuAlignOptions = [
},
},
]
]
export
const
getMenuTriggerOptions
=
(
hideTop
:
boolean
)
=>
{
export
function
getMenuTriggerOptions
(
hideTop
:
boolean
)
{
return
[
return
[
{
{
value
:
TriggerEnum
.
NONE
,
value
:
TriggerEnum
.
NONE
,
...
...
src/layouts/default/sider/MixSider.vue
浏览文件 @
25fe3e6d
...
@@ -522,14 +522,14 @@
...
@@ -522,14 +522,14 @@
font-size
:
18px
;
font-size
:
18px
;
color
:
@
primary-color
;
color
:
@
primary-color
;
border-bottom
:
1px
solid
rgb
(
238
238
238
);
border-bottom
:
1px
solid
rgb
(
238
238
238
);
opacity
:
0
%
;
opacity
:
0
;
transition
:
unset
;
transition
:
unset
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
space-between
;
&.show
{
&.show
{
min-width
:
130px
;
min-width
:
130px
;
opacity
:
1
00%
;
opacity
:
1
;
transition
:
all
0.5s
ease
;
transition
:
all
0.5s
ease
;
}
}
...
...
src/router/constant.ts
浏览文件 @
25fe3e6d
...
@@ -4,17 +4,21 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout'
...
@@ -4,17 +4,21 @@ export const PARENT_LAYOUT_NAME = 'ParentLayout'
export
const
PAGE_NOT_FOUND_NAME
=
'PageNotFound'
export
const
PAGE_NOT_FOUND_NAME
=
'PageNotFound'
export
const
EXCEPTION_COMPONENT
=
()
=>
import
(
'/@/views/sys/exception/Exception.vue'
)
export
function
EXCEPTION_COMPONENT
()
{
return
import
(
'/@/views/sys/exception/Exception.vue'
)
}
/**
/**
* @description: default layout
* @description: default layout
*/
*/
export
const
LAYOUT
=
()
=>
import
(
'/@/layouts/default/index.vue'
)
export
function
LAYOUT
()
{
return
import
(
'/@/layouts/default/index.vue'
)
}
/**
/**
* @description: parent-layout
* @description: parent-layout
*/
*/
export
const
getParentLayout
=
(
_name
?:
string
)
=>
{
export
function
getParentLayout
(
_name
?:
string
)
{
return
()
=>
return
()
=>
new
Promise
((
resolve
)
=>
{
new
Promise
((
resolve
)
=>
{
resolve
({
resolve
({
...
...
src/router/guard/paramMenuGuard.ts
浏览文件 @
25fe3e6d
...
@@ -33,15 +33,15 @@ export function createParamMenuGuard(router: Router) {
...
@@ -33,15 +33,15 @@ export function createParamMenuGuard(router: Router) {
})
})
}
}
const
getPermissionMode
=
()
=>
{
function
getPermissionMode
()
{
const
appStore
=
useAppStoreWithOut
()
const
appStore
=
useAppStoreWithOut
()
return
appStore
.
getProjectConfig
.
permissionMode
return
appStore
.
getProjectConfig
.
permissionMode
}
}
const
isBackMode
=
()
=>
{
function
isBackMode
()
{
return
getPermissionMode
()
===
PermissionModeEnum
.
BACK
return
getPermissionMode
()
===
PermissionModeEnum
.
BACK
}
}
const
isRouteMappingMode
=
()
=>
{
function
isRouteMappingMode
()
{
return
getPermissionMode
()
===
PermissionModeEnum
.
ROUTE_MAPPING
return
getPermissionMode
()
===
PermissionModeEnum
.
ROUTE_MAPPING
}
}
src/router/helper/routeHelper.ts
浏览文件 @
25fe3e6d
...
@@ -7,7 +7,9 @@ import { warn } from '/@/utils/log'
...
@@ -7,7 +7,9 @@ import { warn } from '/@/utils/log'
import
{
createRouter
,
createWebHashHistory
}
from
'vue-router'
import
{
createRouter
,
createWebHashHistory
}
from
'vue-router'
export
type
LayoutMapKey
=
'LAYOUT'
export
type
LayoutMapKey
=
'LAYOUT'
const
IFRAME
=
()
=>
import
(
'/@/views/sys/iframe/FrameBlank.vue'
)
function
IFRAME
()
{
return
import
(
'/@/views/sys/iframe/FrameBlank.vue'
)
}
const
LayoutMap
=
new
Map
<
string
,
()
=>
Promise
<
typeof
import
(
'*.vue'
)
>>
()
const
LayoutMap
=
new
Map
<
string
,
()
=>
Promise
<
typeof
import
(
'*.vue'
)
>>
()
...
...
src/router/index.ts
浏览文件 @
25fe3e6d
...
@@ -6,11 +6,12 @@ import { basicRoutes } from './routes'
...
@@ -6,11 +6,12 @@ import { basicRoutes } from './routes'
// 白名单应该包含基本静态路由
// 白名单应该包含基本静态路由
const
WHITE_NAME_LIST
:
string
[]
=
[]
const
WHITE_NAME_LIST
:
string
[]
=
[]
const
getRouteNames
=
(
array
:
any
[])
=>
function
getRouteNames
(
array
:
any
[])
{
array
.
forEach
((
item
)
=>
{
return
array
.
forEach
((
item
)
=>
{
WHITE_NAME_LIST
.
push
(
item
.
name
)
WHITE_NAME_LIST
.
push
(
item
.
name
)
getRouteNames
(
item
.
children
||
[])
getRouteNames
(
item
.
children
||
[])
})
})
}
getRouteNames
(
basicRoutes
)
getRouteNames
(
basicRoutes
)
// app router
// app router
...
...
src/router/menus/index.ts
浏览文件 @
25fe3e6d
...
@@ -24,19 +24,19 @@ Object.keys(modules).forEach((key) => {
...
@@ -24,19 +24,19 @@ Object.keys(modules).forEach((key) => {
// ==========Helper===========
// ==========Helper===========
// ===========================
// ===========================
const
getPermissionMode
=
()
=>
{
function
getPermissionMode
()
{
const
appStore
=
useAppStoreWithOut
()
const
appStore
=
useAppStoreWithOut
()
return
appStore
.
getProjectConfig
.
permissionMode
return
appStore
.
getProjectConfig
.
permissionMode
}
}
const
isBackMode
=
()
=>
{
function
isBackMode
()
{
return
getPermissionMode
()
===
PermissionModeEnum
.
BACK
return
getPermissionMode
()
===
PermissionModeEnum
.
BACK
}
}
const
isRouteMappingMode
=
()
=>
{
function
isRouteMappingMode
()
{
return
getPermissionMode
()
===
PermissionModeEnum
.
ROUTE_MAPPING
return
getPermissionMode
()
===
PermissionModeEnum
.
ROUTE_MAPPING
}
}
const
isRoleMode
=
()
=>
{
function
isRoleMode
()
{
return
getPermissionMode
()
===
PermissionModeEnum
.
ROLE
return
getPermissionMode
()
===
PermissionModeEnum
.
ROLE
}
}
...
@@ -62,7 +62,7 @@ async function getAsyncMenus() {
...
@@ -62,7 +62,7 @@ async function getAsyncMenus() {
return
staticMenus
return
staticMenus
}
}
export
const
getMenus
=
async
():
Promise
<
Menu
[]
>
=
>
{
export
async
function
getMenus
():
Promise
<
Menu
[]
>
{
const
menus
=
await
getAsyncMenus
()
const
menus
=
await
getAsyncMenus
()
if
(
isRoleMode
())
{
if
(
isRoleMode
())
{
const
routes
=
router
.
getRoutes
()
const
routes
=
router
.
getRoutes
()
...
...
src/store/modules/multipleTab.ts
浏览文件 @
25fe3e6d
...
@@ -26,7 +26,7 @@ function handleGotoPage(router: Router) {
...
@@ -26,7 +26,7 @@ function handleGotoPage(router: Router) {
go
(
unref
(
router
.
currentRoute
).
path
,
true
)
go
(
unref
(
router
.
currentRoute
).
path
,
true
)
}
}
const
getToTarget
=
(
tabItem
:
RouteLocationNormalized
)
=>
{
function
getToTarget
(
tabItem
:
RouteLocationNormalized
)
{
const
{
params
,
path
,
query
}
=
tabItem
const
{
params
,
path
,
query
}
=
tabItem
return
{
return
{
params
:
params
||
{},
params
:
params
||
{},
...
...
src/utils/cache/index.ts
浏览文件 @
25fe3e6d
...
@@ -5,7 +5,7 @@ import { DEFAULT_CACHE_TIME, enableStorageEncryption } from '/@/settings/encrypt
...
@@ -5,7 +5,7 @@ import { DEFAULT_CACHE_TIME, enableStorageEncryption } from '/@/settings/encrypt
export
type
Options
=
Partial
<
CreateStorageParams
>
export
type
Options
=
Partial
<
CreateStorageParams
>
const
createOptions
=
(
storage
:
Storage
,
options
:
Options
=
{}):
Options
=>
{
function
createOptions
(
storage
:
Storage
,
options
:
Options
=
{}):
Options
{
return
{
return
{
// No encryption in debug mode
// No encryption in debug mode
hasEncrypt
:
enableStorageEncryption
,
hasEncrypt
:
enableStorageEncryption
,
...
@@ -17,15 +17,15 @@ const createOptions = (storage: Storage, options: Options = {}): Options => {
...
@@ -17,15 +17,15 @@ const createOptions = (storage: Storage, options: Options = {}): Options => {
export
const
WebStorage
=
create
(
createOptions
(
sessionStorage
))
export
const
WebStorage
=
create
(
createOptions
(
sessionStorage
))
export
const
createStorage
=
(
storage
:
Storage
=
sessionStorage
,
options
:
Options
=
{})
=>
{
export
function
createStorage
(
storage
:
Storage
=
sessionStorage
,
options
:
Options
=
{})
{
return
create
(
createOptions
(
storage
,
options
))
return
create
(
createOptions
(
storage
,
options
))
}
}
export
const
createSessionStorage
=
(
options
:
Options
=
{})
=>
{
export
function
createSessionStorage
(
options
:
Options
=
{})
{
return
createStorage
(
sessionStorage
,
{
...
options
,
timeout
:
DEFAULT_CACHE_TIME
})
return
createStorage
(
sessionStorage
,
{
...
options
,
timeout
:
DEFAULT_CACHE_TIME
})
}
}
export
const
createLocalStorage
=
(
options
:
Options
=
{})
=>
{
export
function
createLocalStorage
(
options
:
Options
=
{})
{
return
createStorage
(
localStorage
,
{
...
options
,
timeout
:
DEFAULT_CACHE_TIME
})
return
createStorage
(
localStorage
,
{
...
options
,
timeout
:
DEFAULT_CACHE_TIME
})
}
}
...
...
src/utils/cache/storageCache.ts
浏览文件 @
25fe3e6d
...
@@ -9,14 +9,14 @@ export interface CreateStorageParams extends EncryptionParams {
...
@@ -9,14 +9,14 @@ export interface CreateStorageParams extends EncryptionParams {
hasEncrypt
:
boolean
hasEncrypt
:
boolean
timeout
?:
Nullable
<
number
>
timeout
?:
Nullable
<
number
>
}
}
export
const
createStorage
=
({
export
function
createStorage
({
prefixKey
=
''
,
prefixKey
=
''
,
storage
=
sessionStorage
,
storage
=
sessionStorage
,
key
=
cacheCipher
.
key
,
key
=
cacheCipher
.
key
,
iv
=
cacheCipher
.
iv
,
iv
=
cacheCipher
.
iv
,
timeout
=
null
,
timeout
=
null
,
hasEncrypt
=
true
,
hasEncrypt
=
true
,
}:
Partial
<
CreateStorageParams
>
=
{})
=>
{
}:
Partial
<
CreateStorageParams
>
=
{})
{
if
(
hasEncrypt
&&
[
key
.
length
,
iv
.
length
].
some
((
item
)
=>
item
!==
16
))
{
if
(
hasEncrypt
&&
[
key
.
length
,
iv
.
length
].
some
((
item
)
=>
item
!==
16
))
{
throw
new
Error
(
'When hasEncrypt is true, the key or iv must be 16 bits!'
)
throw
new
Error
(
'When hasEncrypt is true, the key or iv must be 16 bits!'
)
}
}
...
...
src/utils/helper/treeHelper.ts
浏览文件 @
25fe3e6d
...
@@ -12,7 +12,9 @@ const DEFAULT_CONFIG: TreeHelperConfig = {
...
@@ -12,7 +12,9 @@ const DEFAULT_CONFIG: TreeHelperConfig = {
}
}
// 获取配置。 Object.assign 从一个或多个源对象复制到目标对象
// 获取配置。 Object.assign 从一个或多个源对象复制到目标对象
const
getConfig
=
(
config
:
Partial
<
TreeHelperConfig
>
)
=>
Object
.
assign
({},
DEFAULT_CONFIG
,
config
)
function
getConfig
(
config
:
Partial
<
TreeHelperConfig
>
)
{
return
Object
.
assign
({},
DEFAULT_CONFIG
,
config
)
}
// tree from list
// tree from list
// 列表中的树
// 列表中的树
...
...
src/utils/http/axios/axiosCancel.ts
浏览文件 @
25fe3e6d
...
@@ -5,7 +5,9 @@ import { isFunction } from '/@/utils/is'
...
@@ -5,7 +5,9 @@ import { isFunction } from '/@/utils/is'
// Used to store the identification and cancellation function of each request
// Used to store the identification and cancellation function of each request
let
pendingMap
=
new
Map
<
string
,
Canceler
>
()
let
pendingMap
=
new
Map
<
string
,
Canceler
>
()
export
const
getPendingUrl
=
(
config
:
AxiosRequestConfig
)
=>
[
config
.
method
,
config
.
url
].
join
(
'&'
)
export
function
getPendingUrl
(
config
:
AxiosRequestConfig
)
{
return
[
config
.
method
,
config
.
url
].
join
(
'&'
)
}
export
class
AxiosCanceler
{
export
class
AxiosCanceler
{
/**
/**
...
...
src/utils/index.ts
浏览文件 @
25fe3e6d
...
@@ -5,7 +5,7 @@ import { unref } from 'vue'
...
@@ -5,7 +5,7 @@ import { unref } from 'vue'
import
{
isObject
}
from
'/@/utils/is'
import
{
isObject
}
from
'/@/utils/is'
import
{
cloneDeep
}
from
'lodash-es'
import
{
cloneDeep
}
from
'lodash-es'
export
const
noop
=
()
=>
{}
export
function
noop
()
{}
/**
/**
* @description: Set ui mount node
* @description: Set ui mount node
...
@@ -82,7 +82,7 @@ export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormal
...
@@ -82,7 +82,7 @@ export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormal
}
}
}
}
export
const
withInstall
=
<
T
>
(
component
:
T
,
alias
?:
string
)
=>
{
export
function
withInstall
<
T
>
(
component
:
T
,
alias
?:
string
)
{
const
comp
=
component
as
any
const
comp
=
component
as
any
comp
.
install
=
(
app
:
App
)
=>
{
comp
.
install
=
(
app
:
App
)
=>
{
app
.
component
(
comp
.
name
||
comp
.
displayName
,
component
)
app
.
component
(
comp
.
name
||
comp
.
displayName
,
component
)
...
...
src/utils/props.ts
浏览文件 @
25fe3e6d
...
@@ -133,7 +133,7 @@ export function buildProp<
...
@@ -133,7 +133,7 @@ export function buildProp<
type
NativePropType
=
[((...
args
:
any
)
=>
any
)
|
{
new
(...
args
:
any
):
any
}
|
undefined
|
null
]
type
NativePropType
=
[((...
args
:
any
)
=>
any
)
|
{
new
(...
args
:
any
):
any
}
|
undefined
|
null
]
export
const
buildProps
=
<
export
function
buildProps
<
O
extends
{
O
extends
{
[
K
in
keyof
O
]:
O
[
K
]
extends
BuildPropReturn
<
any
,
any
,
any
,
any
,
any
>
[
K
in
keyof
O
]:
O
[
K
]
extends
BuildPropReturn
<
any
,
any
,
any
,
any
,
any
>
?
O
[
K
]
?
O
[
K
]
...
@@ -145,10 +145,8 @@ export const buildProps = <
...
@@ -145,10 +145,8 @@ export const buildProps = <
:
never
:
never
:
never
:
never
},
},
>
(
>
(
props
:
O
)
{
props
:
O
,
return
fromPairs
(
Object
.
entries
(
props
).
map
(([
key
,
option
])
=>
[
key
,
buildProp
(
option
as
any
,
key
)]))
as
unknown
as
{
)
=>
fromPairs
(
Object
.
entries
(
props
).
map
(([
key
,
option
])
=>
[
key
,
buildProp
(
option
as
any
,
key
)]))
as
unknown
as
{
[
K
in
keyof
O
]:
O
[
K
]
extends
{
[
propKey
]:
boolean
}
[
K
in
keyof
O
]:
O
[
K
]
extends
{
[
propKey
]:
boolean
}
?
O
[
K
]
?
O
[
K
]
:
[
O
[
K
]]
extends
NativePropType
:
[
O
[
K
]]
extends
NativePropType
...
@@ -157,10 +155,17 @@ export const buildProps = <
...
@@ -157,10 +155,17 @@ export const buildProps = <
?
BuildPropReturn
<
T
,
O
[
K
][
'default'
],
R
,
V
,
C
>
?
BuildPropReturn
<
T
,
O
[
K
][
'default'
],
R
,
V
,
C
>
:
never
:
never
}
}
}
export
const
definePropType
=
<
T
>
(
val
:
any
)
=>
({
[
wrapperKey
]:
val
}
as
PropWrapper
<
T
>
)
export
function
definePropType
<
T
>
(
val
:
any
)
{
return
{
[
wrapperKey
]:
val
}
as
PropWrapper
<
T
>
}
export
const
keyOf
=
<
T
>
(
arr
:
T
)
=>
Object
.
keys
(
arr
)
as
Array
<
keyof
T
>
export
function
keyOf
<
T
>
(
arr
:
T
)
{
export
const
mutable
=
<
T
extends
readonly
any
[]
|
Record
<
string
,
unknown
>>
(
val
:
T
)
=>
val
as
Mutable
<
typeof
val
>
return
Object
.
keys
(
arr
)
as
Array
<
keyof
T
>
}
export
function
mutable
<
T
extends
readonly
any
[]
|
Record
<
string
,
unknown
>>
(
val
:
T
)
{
return
val
as
Mutable
<
typeof
val
>
}
export
const
componentSize
=
[
'large'
,
'medium'
,
'small'
,
'mini'
]
as
const
export
const
componentSize
=
[
'large'
,
'medium'
,
'small'
,
'mini'
]
as
const
src/utils/proxy.ts
浏览文件 @
25fe3e6d
...
@@ -15,7 +15,7 @@ const PROXY_LIST = [
...
@@ -15,7 +15,7 @@ const PROXY_LIST = [
* 将内部地址(内网)转换成代理/预览地址(公网)
* 将内部地址(内网)转换成代理/预览地址(公网)
* @param url 内网地址
* @param url 内网地址
*/
*/
export
const
getExtranetUrl
=
(
url
:
string
):
string
=>
{
export
function
getExtranetUrl
(
url
:
string
):
string
{
let
uri
=
url
let
uri
=
url
PROXY_LIST
.
forEach
((
proxy
)
=>
{
PROXY_LIST
.
forEach
((
proxy
)
=>
{
...
@@ -30,7 +30,7 @@ export const getExtranetUrl = (url: string): string => {
...
@@ -30,7 +30,7 @@ export const getExtranetUrl = (url: string): string => {
* eg: 主要用于解决内网文件上传后预览,但是实际上传存储时还是内网地址的问题
* eg: 主要用于解决内网文件上传后预览,但是实际上传存储时还是内网地址的问题
* @param url 代理/公网地址
* @param url 代理/公网地址
*/
*/
export
const
getIntranetUrl
=
(
url
:
string
):
string
=>
{
export
function
getIntranetUrl
(
url
:
string
):
string
{
let
uri
=
url
let
uri
=
url
PROXY_LIST
.
forEach
((
proxy
)
=>
{
PROXY_LIST
.
forEach
((
proxy
)
=>
{
...
@@ -45,7 +45,7 @@ export const getIntranetUrl = (url: string): string => {
...
@@ -45,7 +45,7 @@ export const getIntranetUrl = (url: string): string => {
* @param body 接口返回的内容
* @param body 接口返回的内容
* @returns 替换本地链接后的数据结果
* @returns 替换本地链接后的数据结果
*/
*/
export
const
handleResponseResource
=
<
T
>
(
body
:
T
,
options
:
Recordable
)
=>
{
export
function
handleResponseResource
<
T
>
(
body
:
T
,
options
:
Recordable
)
{
if
(
options
.
apiUrl
.
includes
(
'proxy.yiring.com'
)
&&
typeof
body
===
'object'
)
{
if
(
options
.
apiUrl
.
includes
(
'proxy.yiring.com'
)
&&
typeof
body
===
'object'
)
{
let
text
=
JSON
.
stringify
(
body
)
let
text
=
JSON
.
stringify
(
body
)
...
...
src/views/demo/tools/online/form/components/DatabaseSchemaTable.vue
浏览文件 @
25fe3e6d
...
@@ -48,8 +48,10 @@
...
@@ -48,8 +48,10 @@
const
databaseSchemaTableOptions
=
reactive
<
BasicTableProps
>
({
const
databaseSchemaTableOptions
=
reactive
<
BasicTableProps
>
({
id
:
id
.
value
,
id
:
id
.
value
,
// FIXME: 修复表格高度自适应问题
// FIXME: 修复表格高度自适应问题
// height: 'auto',
height
:
'auto'
,
maxHeight
:
430
,
autoResize
:
true
,
autoResize
:
true
,
scrollY
:
{
enabled
:
true
,
gt
:
30
},
stripe
:
false
,
stripe
:
false
,
keepSource
:
true
,
keepSource
:
true
,
showOverflow
:
true
,
showOverflow
:
true
,
...
@@ -57,7 +59,7 @@
...
@@ -57,7 +59,7 @@
checkboxConfig
:
{
checkMethod
:
({
row
})
=>
!
row
.
disabled
},
checkboxConfig
:
{
checkMethod
:
({
row
})
=>
!
row
.
disabled
},
columns
:
getDatabaseSchemaColumns
(
change
),
columns
:
getDatabaseSchemaColumns
(
change
),
data
:
props
.
data
,
data
:
props
.
data
,
editConfig
:
{
trigger
:
'click'
,
mode
:
'cell'
,
showStatus
:
false
,
beforeEdit
Method
:
({
row
})
=>
!
row
.
disabled
},
editConfig
:
{
trigger
:
'click'
,
mode
:
'cell'
,
showStatus
:
false
,
active
Method
:
({
row
})
=>
!
row
.
disabled
},
editRules
:
{
editRules
:
{
field
:
[{
required
:
true
,
message
:
'请输入字段名称'
}],
field
:
[{
required
:
true
,
message
:
'请输入字段名称'
}],
comment
:
[{
required
:
true
,
message
:
'请输入字段备注'
}],
comment
:
[{
required
:
true
,
message
:
'请输入字段备注'
}],
...
...
src/views/demo/tools/online/form/edit.vue
浏览文件 @
25fe3e6d
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
TabPane
,
Tabs
}
from
'ant-design-vue'
import
{
Spin
,
TabPane
,
Tabs
}
from
'ant-design-vue'
import
type
{
DatabaseSchema
,
TableType
}
from
'./data'
import
type
{
DatabaseSchema
,
TableType
}
from
'./data'
import
{
databaseTypeOptions
,
getDefaultSchemaFieldDataSourcesByType
}
from
'./data'
import
{
databaseTypeOptions
,
getDefaultSchemaFieldDataSourcesByType
}
from
'./data'
import
DatabaseSchemaTable
from
'./components/DatabaseSchemaTable.vue'
import
DatabaseSchemaTable
from
'./components/DatabaseSchemaTable.vue'
...
@@ -96,10 +96,8 @@
...
@@ -96,10 +96,8 @@
<
template
>
<
template
>
<BasicModal
v-bind=
"$attrs"
@
register=
"registerModal"
destroyOnClose
defaultFullscreen
:canFullscreen=
"false"
>
<BasicModal
v-bind=
"$attrs"
@
register=
"registerModal"
destroyOnClose
defaultFullscreen
:canFullscreen=
"false"
>
<
div
class=
"pr-20px
"
>
<
Spin
wrapper-class-name=
"p-6"
:spinning=
"false
"
>
<BasicForm
@
register=
"registerEditForm"
/>
<BasicForm
@
register=
"registerEditForm"
/>
</div>
<div
class=
"p-20px"
>
<Tabs>
<Tabs>
<TabPane
key=
"db-schema"
>
<TabPane
key=
"db-schema"
>
<template
#
tab
>
<template
#
tab
>
...
@@ -154,7 +152,7 @@
...
@@ -154,7 +152,7 @@
规则校验
规则校验
</TabPane>
</TabPane>
</Tabs>
</Tabs>
</
div
>
</
Spin
>
</BasicModal>
</BasicModal>
</template>
</template>
...
...
src/views/demo/tools/online/form/index.vue
浏览文件 @
25fe3e6d
...
@@ -173,7 +173,7 @@
...
@@ -173,7 +173,7 @@
// 新增/编辑打开窗口
// 新增/编辑打开窗口
function editHandler(data?: Recordable) {
function editHandler(data?: Recordable) {
setModalProps({ title: data ? '编辑' : '新增' })
setModalProps({ title: data ? '编辑' : '新增' })
openModal(true, data
||
{})
openModal(true, data
??
{})
}
}
</
script
>
</
script
>
...
...
src/views/sys/about/index.vue
浏览文件 @
25fe3e6d
...
@@ -13,8 +13,12 @@
...
@@ -13,8 +13,12 @@
const
schema
:
DescItem
[]
=
[]
const
schema
:
DescItem
[]
=
[]
const
devSchema
:
DescItem
[]
=
[]
const
devSchema
:
DescItem
[]
=
[]
const
commonTagRender
=
(
color
:
string
)
=>
(
curVal
)
=>
h
(
Tag
,
{
color
},
()
=>
curVal
)
function
commonTagRender
(
color
:
string
)
{
const
commonLinkRender
=
(
text
:
string
)
=>
(
href
)
=>
h
(
'a'
,
{
href
,
target
:
'_blank'
},
text
)
return
(
curVal
)
=>
h
(
Tag
,
{
color
},
()
=>
curVal
)
}
function
commonLinkRender
(
text
:
string
)
{
return
(
href
)
=>
h
(
'a'
,
{
href
,
target
:
'_blank'
},
text
)
}
const
infoSchema
:
DescItem
[]
=
[
const
infoSchema
:
DescItem
[]
=
[
{
{
...
...
src/views/sys/lock/LockPage.vue
浏览文件 @
25fe3e6d
...
@@ -164,6 +164,7 @@
...
@@ -164,6 +164,7 @@
font-size
:
90px
;
font-size
:
90px
;
}
}
}
}
@media
screen
and
(
min-width
:
@
screen-lg
)
{
@media
screen
and
(
min-width
:
@
screen-lg
)
{
span
:
not
(.
meridiem
)
{
span
:
not
(.
meridiem
)
{
font-size
:
220px
;
font-size
:
220px
;
...
@@ -175,6 +176,7 @@
...
@@ -175,6 +176,7 @@
font-size
:
260px
;
font-size
:
260px
;
}
}
}
}
@media
screen
and
(
min-width
:
@
screen-2xl
)
{
@media
screen
and
(
min-width
:
@
screen-2xl
)
{
span
:
not
(.
meridiem
)
{
span
:
not
(.
meridiem
)
{
font-size
:
320px
;
font-size
:
320px
;
...
...
src/views/sys/login/Login.vue
浏览文件 @
25fe3e6d
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
background-color
:
@
dark-bg
;
background-color
:
@
dark-bg
;
&::before
{
&::before
{
background-image
:
url(
/@/assets/svg/login-bg-dark.svg
)
;
background-image
:
url(
'/@/assets/svg/login-bg-dark.svg'
)
;
}
}
.ant-input
,
.ant-input
,
...
@@ -110,6 +110,7 @@
...
@@ -110,6 +110,7 @@
.@
{
prefix-cls
}
{
.@
{
prefix-cls
}
{
min-height
:
100%
;
min-height
:
100%
;
overflow
:
hidden
;
overflow
:
hidden
;
@media
(
max-width
:
@
screen-xl
)
{
@media
(
max-width
:
@
screen-xl
)
{
background-color
:
#293146
;
background-color
:
#293146
;
.@{prefix-cls
}
-form
{
.@{prefix-cls
}
-form
{
...
@@ -124,11 +125,12 @@
...
@@ -124,11 +125,12 @@
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
margin-left
:
-48%
;
margin-left
:
-48%
;
background-image
:
url(
/@/assets/svg/login-bg.svg
)
;
background-image
:
url(
'/@/assets/svg/login-bg.svg'
)
;
background-position
:
100%
;
background-position
:
100%
;
background-repeat
:
no-repeat
;
background-repeat
:
no-repeat
;
background-size
:
auto
100%
;
background-size
:
auto
100%
;
content
:
''
;
content
:
''
;
@media
(
max-width
:
@
screen-xl
)
{
@media
(
max-width
:
@
screen-xl
)
{
display
:
none
;
display
:
none
;
}
}
...
@@ -179,15 +181,19 @@
...
@@ -179,15 +181,19 @@
input
:not
([
type
=
'checkbox'
])
{
input
:not
([
type
=
'checkbox'
])
{
min-width
:
360px
;
min-width
:
360px
;
@media
(
max-width
:
@
screen-xl
)
{
@media
(
max-width
:
@
screen-xl
)
{
min-width
:
320px
;
min-width
:
320px
;
}
}
@media
(
max-width
:
@
screen-lg
)
{
@media
(
max-width
:
@
screen-lg
)
{
min-width
:
260px
;
min-width
:
260px
;
}
}
@media
(
max-width
:
@
screen-md
)
{
@media
(
max-width
:
@
screen-md
)
{
min-width
:
240px
;
min-width
:
240px
;
}
}
@media
(
max-width
:
@
screen-sm
)
{
@media
(
max-width
:
@
screen-sm
)
{
min-width
:
160px
;
min-width
:
160px
;
}
}
...
...
src/views/sys/login/SessionTimeoutLogin.vue
浏览文件 @
25fe3e6d
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
const
appStore
=
useAppStore
()
const
appStore
=
useAppStore
()
const
userId
=
ref
<
Nullable
<
number
|
string
>>
(
0
)
const
userId
=
ref
<
Nullable
<
number
|
string
>>
(
0
)
const
isBackMode
=
()
=>
{
function
isBackMode
()
{
return
appStore
.
getProjectConfig
.
permissionMode
===
PermissionModeEnum
.
BACK
return
appStore
.
getProjectConfig
.
permissionMode
===
PermissionModeEnum
.
BACK
}
}
...
...
stylelint.config.js
浏览文件 @
25fe3e6d
module
.
exports
=
{
module
.
exports
=
{
root
:
true
,
root
:
true
,
plugins
:
[
'stylelint-order'
],
plugins
:
[
'stylelint-order'
],
extends
:
[
'stylelint-config-standard'
,
'stylelint-config-prettier'
],
extends
:
[
'stylelint-config-standard'
],
customSyntax
:
'postcss-html'
,
customSyntax
:
'postcss-html'
,
rules
:
{
rules
:
{
'function-no-unknown'
:
null
,
'function-no-unknown'
:
null
,
...
@@ -38,12 +38,9 @@ module.exports = {
...
@@ -38,12 +38,9 @@ module.exports = {
'no-empty-source'
:
null
,
'no-empty-source'
:
null
,
'string-quotes'
:
null
,
'string-quotes'
:
null
,
'named-grid-areas-no-invalid'
:
null
,
'named-grid-areas-no-invalid'
:
null
,
'unicode-bom'
:
'never'
,
'no-descending-specificity'
:
null
,
'no-descending-specificity'
:
null
,
'media-feature-range-notation'
:
null
,
'font-family-no-missing-generic-family-keyword'
:
null
,
'font-family-no-missing-generic-family-keyword'
:
null
,
'declaration-colon-space-after'
:
'always-single-line'
,
'declaration-colon-space-before'
:
'never'
,
// 'declaration-block-trailing-semicolon': 'always',
'rule-empty-line-before'
:
[
'rule-empty-line-before'
:
[
'always'
,
'always'
,
{
{
...
@@ -76,7 +73,7 @@ module.exports = {
...
@@ -76,7 +73,7 @@ module.exports = {
overrides
:
[
overrides
:
[
{
{
files
:
[
'*.vue'
,
'**/*.vue'
,
'*.html'
,
'**/*.html'
],
files
:
[
'*.vue'
,
'**/*.vue'
,
'*.html'
,
'**/*.html'
],
extends
:
[
'stylelint-config-recommended'
,
'stylelint-config-
prettier'
,
'stylelint-config-
recommended-vue'
],
extends
:
[
'stylelint-config-recommended'
,
'stylelint-config-recommended-vue'
],
rules
:
{
rules
:
{
'keyframes-name-pattern'
:
null
,
'keyframes-name-pattern'
:
null
,
'selector-pseudo-class-no-unknown'
:
[
'selector-pseudo-class-no-unknown'
:
[
...
@@ -96,7 +93,7 @@ module.exports = {
...
@@ -96,7 +93,7 @@ module.exports = {
{
{
files
:
[
'*.less'
,
'**/*.less'
],
files
:
[
'*.less'
,
'**/*.less'
],
customSyntax
:
'postcss-less'
,
customSyntax
:
'postcss-less'
,
extends
:
[
'stylelint-config-standard'
,
'stylelint-config-
prettier'
,
'stylelint-config-
recommended-vue'
],
extends
:
[
'stylelint-config-standard'
,
'stylelint-config-recommended-vue'
],
},
},
],
],
}
}
types/global.d.ts
浏览文件 @
25fe3e6d
...
@@ -25,7 +25,7 @@ declare global {
...
@@ -25,7 +25,7 @@ declare global {
// }
// }
// vue
// vue
declare
type
PropType
<
T
>
=
VuePropType
<
T
>
//
declare type PropType<T> = VuePropType<T>
declare
type
VueNode
=
VNodeChild
|
JSX
.
Element
declare
type
VueNode
=
VNodeChild
|
JSX
.
Element
export
type
Writable
<
T
>
=
{
export
type
Writable
<
T
>
=
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论