Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
球球不吃虾
vue-vben-admin
提交
2f268ca8
V
vue-vben-admin
项目概览
球球不吃虾
/
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,发现更多精彩内容 >>
提交
2f268ca8
编写于
10月 01, 2020
作者:
陈
陈文彬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix form,transition,build bug
上级
351f60a8
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
7315 addition
and
227 deletion
+7315
-227
src/App.vue
src/App.vue
+0
-1
src/components/Form/src/BasicForm.vue
src/components/Form/src/BasicForm.vue
+3
-3
src/components/Form/src/FormItem.tsx
src/components/Form/src/FormItem.tsx
+4
-5
src/components/Tree/src/BasicTree.tsx
src/components/Tree/src/BasicTree.tsx
+1
-0
src/enums/eventBusEnum.ts
src/enums/eventBusEnum.ts
+1
-0
src/hooks/event/useEventHub.ts
src/hooks/event/useEventHub.ts
+11
-0
src/layouts/default/LayoutBreadcrumb.tsx
src/layouts/default/LayoutBreadcrumb.tsx
+1
-1
src/layouts/default/LayoutHeader.tsx
src/layouts/default/LayoutHeader.tsx
+1
-1
src/router/guard/pageLoadingGuard.ts
src/router/guard/pageLoadingGuard.ts
+6
-3
src/router/routes/modules/demo/exception.ts
src/router/routes/modules/demo/exception.ts
+5
-0
src/router/types.d.ts
src/router/types.d.ts
+3
-0
src/store/modules/permission.ts
src/store/modules/permission.ts
+3
-3
src/utils/eventHub.ts
src/utils/eventHub.ts
+36
-0
src/views/demo/form/RefForm.vue
src/views/demo/form/RefForm.vue
+1
-0
src/views/sys/error-log/DetailModal.vue
src/views/sys/error-log/DetailModal.vue
+0
-30
src/views/sys/error-log/data.tsx
src/views/sys/error-log/data.tsx
+0
-66
src/views/sys/error-log/index.vue
src/views/sys/error-log/index.vue
+0
-108
src/views/sys/iframe/index.vue
src/views/sys/iframe/index.vue
+1
-3
vite.config.ts
vite.config.ts
+3
-3
yarn.lock
yarn.lock
+7235
-0
未找到文件。
src/App.vue
浏览文件 @
2f268ca8
...
...
@@ -30,7 +30,6 @@
createBreakpointListen
();
const
{
renderEmpty
,
transformCellText
}
=
useConfigProvider
();
const
{
on
:
lockOn
}
=
useLockPage
();
return
{
renderEmpty
,
transformCellText
,
...
...
src/components/Form/src/BasicForm.vue
浏览文件 @
2f268ca8
...
...
@@ -48,7 +48,7 @@
import
{
isArray
,
isBoolean
,
isFunction
,
isNumber
,
isObject
,
isString
}
from
'
/@/utils/is
'
;
import
{
cloneDeep
}
from
'
lodash-es
'
;
import
{
useBreakpoint
}
from
'
/@/hooks/event/useBreakpoint
'
;
import
{
useThrottle
}
from
'
/@/hooks/core/useThrottle
'
;
//
import { useThrottle } from '/@/hooks/core/useThrottle';
import
{
useFormValues
}
from
'
./hooks/useFormValues
'
;
import
type
{
ColEx
}
from
'
./types
'
;
import
{
NamePath
}
from
'
ant-design-vue/types/form/form-item
'
;
...
...
@@ -163,13 +163,13 @@
});
const
{
realWidthRef
,
screenEnum
,
screenRef
}
=
useBreakpoint
();
const
[
throttleUpdateAdvanced
]
=
useThrottle
(
updateAdvanced
,
30
,
{
immediate
:
true
});
//
const [throttleUpdateAdvanced] = useThrottle(updateAdvanced, 30, { immediate: true });
watch
(
[()
=>
unref
(
getSchema
),
()
=>
advanceState
.
isAdvanced
,
()
=>
unref
(
realWidthRef
)],
()
=>
{
const
{
showAdvancedButton
}
=
unref
(
getProps
);
if
(
showAdvancedButton
)
{
throttleU
pdateAdvanced
();
u
pdateAdvanced
();
}
},
{
immediate
:
true
}
...
...
src/components/Form/src/FormItem.tsx
浏览文件 @
2f268ca8
...
...
@@ -189,14 +189,13 @@ export default defineComponent({
const
bindValue
=
{
[
isCheck
?
'
checked
'
:
'
value
'
]:
(
props
.
formModel
as
any
)[
field
],
};
if
(
!
renderComponentContent
)
{
return
<
Comp
{
...
propsData
}
{
...
on
}
{
...
bindValue
}
/>;
}
return
(
<
Comp
{
...
propsData
}
{
...
on
}
{
...
bindValue
}
>
{
{
...(
renderComponentContent
?
renderComponentContent
(
unref
(
getValuesRef
))
:
{
default
:
()
=>
''
,
}),
...
renderComponentContent
(
unref
(
getValuesRef
)),
}
}
</
Comp
>
);
...
...
src/components/Tree/src/BasicTree.tsx
浏览文件 @
2f268ca8
...
...
@@ -161,6 +161,7 @@ export default defineComponent({
const
treeData
:
any
=
cloneDeep
(
unref
(
treeDataRef
));
if
(
!
parentKey
)
{
treeData
[
push
](
node
);
treeDataRef
.
value
=
treeData
;
return
;
}
const
{
key
:
keyField
,
children
:
childrenField
}
=
unref
(
getReplaceFields
);
...
...
src/enums/eventBusEnum.ts
0 → 100644
浏览文件 @
2f268ca8
export
const
MENU_DRAG_STATE
=
'
MENU_DRAG_STATE
'
;
src/hooks/event/useEventHub.ts
0 → 100644
浏览文件 @
2f268ca8
import
{
tryOnUnmounted
}
from
'
/@/utils/helper/vueHelper
'
;
import
{}
from
'
vue
'
;
import
EventHub
from
'
/@/utils/eventHub
'
;
const
eventHub
=
new
EventHub
();
export
function
useEventHub
():
EventHub
{
tryOnUnmounted
(()
=>
{
eventHub
.
clear
();
});
return
eventHub
;
}
src/layouts/default/LayoutBreadcrumb.tsx
浏览文件 @
2f268ca8
...
...
@@ -65,7 +65,7 @@ export default defineComponent({
return
()
=>
(
<>
<
Breadcrumb
class
=
"layout-breadcrumb"
>
<
Breadcrumb
class
=
"layout-breadcrumb
flex-grow
"
>
{
()
=>
(
<>
<
TransitionGroup
name
=
"breadcrumb"
>
...
...
src/layouts/default/LayoutHeader.tsx
浏览文件 @
2f268ca8
...
...
@@ -68,7 +68,7 @@ export default defineComponent({
{
showLogo
&&
!
isSidebarType
&&
<
Logo
class
=
{
`layout-header__logo`
}
/>
}
{
mode
!==
MenuModeEnum
.
HORIZONTAL
&&
showBreadCrumb
&&
!
splitMenu
&&
(
<
LayoutBreadcrumb
class
=
"flex-grow "
/>
<
LayoutBreadcrumb
/>
)
}
{
(
mode
===
MenuModeEnum
.
HORIZONTAL
||
splitMenu
)
&&
(
<
div
class
=
{
[
`layout-header__menu flex-grow `
,
`justify-
${
topMenuAlign
}
`
]
}
>
...
...
src/router/guard/pageLoadingGuard.ts
浏览文件 @
2f268ca8
...
...
@@ -28,12 +28,15 @@ export function createPageLoadingGuard(router: Router) {
}
return
true
;
});
router
.
afterEach
(
async
()
=>
{
router
.
afterEach
(
async
(
to
)
=>
{
const
{
openRouterTransition
,
openPageLoading
}
=
appStore
.
getProjectConfig
;
if
((
!
openRouterTransition
&&
openPageLoading
)
||
isFirstLoad
)
{
if
((
!
openRouterTransition
&&
openPageLoading
)
||
isFirstLoad
||
to
.
meta
.
afterCloseLoading
)
{
setTimeout
(()
=>
{
appStore
.
commitPageLoadingState
(
false
);
},
110
);
isFirstLoad
=
false
;
}
return
true
;
});
}
src/router/routes/modules/demo/exception.ts
浏览文件 @
2f268ca8
...
...
@@ -27,6 +27,7 @@ export default {
},
meta
:
{
title
:
'
404
'
,
afterCloseLoading
:
true
,
},
},
{
...
...
@@ -38,6 +39,7 @@ export default {
},
meta
:
{
title
:
'
500
'
,
afterCloseLoading
:
true
,
},
},
{
...
...
@@ -49,6 +51,7 @@ export default {
},
meta
:
{
title
:
'
网络错误
'
,
afterCloseLoading
:
true
,
},
},
{
...
...
@@ -60,6 +63,7 @@ export default {
},
meta
:
{
title
:
'
页面超时
'
,
afterCloseLoading
:
true
,
},
},
{
...
...
@@ -71,6 +75,7 @@ export default {
},
meta
:
{
title
:
'
无数据
'
,
afterCloseLoading
:
true
,
},
},
],
...
...
src/router/types.d.ts
浏览文件 @
2f268ca8
...
...
@@ -26,6 +26,9 @@ export interface RouteMeta {
// disabled redirect
disabledRedirect
?:
boolean
;
// close loading
afterCloseLoading
?:
boolean
;
}
export
interface
AppRouteRecordRaw
extends
Omit
<
RouteRecordRaw
,
'
meta
'
>
{
...
...
src/store/modules/permission.ts
浏览文件 @
2f268ca8
import
{
REDIRECT_ROUTE
}
from
'
./../..
/router/constant
'
;
import
{
REDIRECT_ROUTE
}
from
'
/@
/router/constant
'
;
import
type
{
AppRouteRecordRaw
,
Menu
}
from
'
/@/router/types
'
;
import
store
from
'
/@/store/index
'
;
import
{
hotModuleUnregisterModule
}
from
'
/@/utils/helper/vuexHelper
'
;
...
...
@@ -19,7 +19,7 @@ import { genRouteModule, transformObjToRoute } from '/@/utils/helper/routeHelper
import
{
transformRouteToMenu
}
from
'
/@/utils/helper/menuHelper
'
;
import
{
useMessage
}
from
'
/@/hooks/web/useMessage
'
;
import
{
warn
}
from
'
vue
'
;
const
{
createMessage
}
=
useMessage
();
const
NAME
=
'
permission
'
;
hotModuleUnregisterModule
(
NAME
);
...
...
@@ -107,7 +107,7 @@ class Permission extends VuexModule {
});
// this.commitRoutesState(routes);
// Background permissions
console
.
warn
(
warn
(
`当前权限模式为:
${
PermissionModeEnum
.
ROLE
}
,请将src/store/modules/permission.ts内的后台菜单获取函数注释,如果已注释可以忽略此信息!`
);
// 如果确定不需要做后台动态权限,请将下面整个判断注释
...
...
src/utils/eventHub.ts
0 → 100644
浏览文件 @
2f268ca8
class
EventHub
{
private
cache
:
{
[
key
:
string
]:
Array
<
(
data
:
any
)
=>
void
>
}
=
{};
on
(
eventName
:
string
,
fn
:
(
data
:
any
)
=>
void
)
{
this
.
cache
[
eventName
]
=
this
.
cache
[
eventName
]
||
[];
this
.
cache
[
eventName
].
push
(
fn
);
}
once
(
eventName
:
string
,
fn
:
(
data
:
any
)
=>
void
)
{
const
decor
=
(...
args
:
any
[])
=>
{
fn
&&
fn
.
apply
(
this
,
args
);
this
.
off
(
eventName
,
decor
);
};
this
.
on
(
eventName
,
decor
);
return
this
;
}
emit
(
eventName
:
string
,
data
?:
any
)
{
if
(
this
.
cache
[
eventName
]
===
undefined
)
return
;
console
.
log
(
'
======================
'
);
console
.
log
(
this
.
cache
,
eventName
);
console
.
log
(
'
======================
'
);
this
.
cache
[
eventName
].
forEach
((
fn
)
=>
fn
(
data
));
}
off
(
eventName
:
string
,
fn
:
(
data
:
any
)
=>
void
)
{
if
(
this
.
cache
[
eventName
]
===
undefined
||
this
.
cache
[
eventName
].
length
===
0
)
return
;
const
i
=
this
.
cache
[
eventName
].
indexOf
(
fn
);
if
(
i
===
-
1
)
return
;
this
.
cache
[
eventName
].
splice
(
i
,
1
);
}
clear
()
{
this
.
cache
=
{};
}
}
export
default
EventHub
;
src/views/demo/form/RefForm.vue
浏览文件 @
2f268ca8
...
...
@@ -58,6 +58,7 @@
<BasicForm
:schemas=
"schemas"
ref=
"formElRef"
:labelWidth=
"100"
@
submit=
"handleSubmit"
:actionColOptions=
"
{ span: 24 }"
/>
...
...
src/views/sys/error-log/DetailModal.vue
已删除
100644 → 0
浏览文件 @
351f60a8
<
script
lang=
"tsx"
>
import
{
defineComponent
,
PropOptions
}
from
'
compatible-vue
'
;
import
{
BasicModal
}
from
'
@/components/modal/index
'
;
import
{
ErrorInfo
}
from
'
@/store/modules/error
'
;
import
{
Description
,
useDescription
}
from
'
@/components/description/index
'
;
import
{
getDescSchema
}
from
'
./data
'
;
export
default
defineComponent
({
name
:
'
ErrorLogDetailModal
'
,
props
:
{
info
:
{
type
:
Object
,
default
:
null
,
}
as
PropOptions
<
ErrorInfo
>
,
},
setup
(
props
,
{
listeners
})
{
const
[
register
]
=
useDescription
({
column
:
2
,
schema
:
getDescSchema
(),
});
return
()
=>
{
return
(
<
BasicModal
width
=
{
800
}
title
=
"
错误详情
"
on
=
{
listeners
}
>
<
Description
data
=
{
props
.
info
}
onRegister
=
{
register
}
/
>
<
/BasicModal
>
);
};
},
});
</
script
>
src/views/sys/error-log/data.tsx
已删除
100644 → 0
浏览文件 @
351f60a8
import
{
Tag
}
from
'
ant-design-vue
'
;
import
{
BasicColumn
}
from
'
@/components/table/index
'
;
import
{
ErrorTypeEnum
}
from
'
@/store/modules/error
'
;
import
{
DescItem
}
from
'
@/components/description/index
'
;
export
function
getColumns
():
BasicColumn
[]
{
return
[
{
dataIndex
:
'
type
'
,
title
:
'
类型
'
,
width
:
80
,
customRender
:
(
text
:
string
)
=>
{
const
color
=
text
===
ErrorTypeEnum
.
VUE
?
'
green
'
:
text
===
ErrorTypeEnum
.
RESOURCE
?
'
cyan
'
:
text
===
ErrorTypeEnum
.
PROMISE
?
'
blue
'
:
ErrorTypeEnum
.
AJAX
?
'
red
'
:
'
purple
'
;
return
<
Tag
color
=
{
color
}
>
{
text
}
</
Tag
>;
},
},
{
dataIndex
:
'
url
'
,
title
:
'
地址
'
,
width
:
200
,
},
{
dataIndex
:
'
time
'
,
title
:
'
时间
'
,
width
:
160
,
},
{
dataIndex
:
'
file
'
,
title
:
'
文件
'
,
width
:
200
,
},
{
dataIndex
:
'
name
'
,
title
:
'
Name
'
,
width
:
200
,
},
{
dataIndex
:
'
message
'
,
title
:
'
错误信息
'
,
width
:
300
,
},
{
dataIndex
:
'
stack
'
,
title
:
'
stack信息
'
,
width
:
300
,
},
];
}
export
function
getDescSchema
():
DescItem
[]
{
return
getColumns
().
map
((
column
)
=>
{
return
{
field
:
column
.
dataIndex
!
,
label
:
column
.
title
,
};
});
}
src/views/sys/error-log/index.vue
已删除
100644 → 0
浏览文件 @
351f60a8
<
script
lang=
"tsx"
>
import
{
defineComponent
,
watch
,
ref
,
unref
}
from
'
compatible-vue
'
;
import
DetailModal
from
'
./DetailModal.vue
'
;
import
{
useModal
}
from
'
@/components/modal/index
'
;
import
{
useDesign
}
from
'
@/hooks/core/useDesign
'
;
import
{
BasicTable
,
useTable
}
from
'
@/components/table/index
'
;
import
{
errorStore
,
ErrorInfo
}
from
'
@/store/modules/error
'
;
import
{
fireErrorApi
}
from
'
@/api/demo/error
'
;
import
{
getColumns
}
from
'
./data
'
;
const
{
prefixCls
}
=
useDesign
(
'
error-handle
'
);
export
default
defineComponent
({
name
:
'
ErrorHandler
'
,
setup
()
{
const
rowInfoRef
=
ref
<
ErrorInfo
>
();
const
imgListRef
=
ref
<
string
[]
>
([]);
const
[
register
,
{
setTableData
}]
=
useTable
({
titleHelpMessage
:
'
只在`/src/settings/projectSetting.ts` 内的useErrorHandle=true时生效!
'
,
title
:
'
错误日志列表
'
,
columns
:
getColumns
(),
actionColumn
:
{
width
:
80
,
title
:
'
操作
'
,
dataIndex
:
'
action
'
,
customRender
:
(
text
:
string
,
recoed
:
ErrorInfo
)
=>
{
return
(
<
a
-
button
type
=
"
link
"
size
=
"
small
"
onClick
=
{
handleDetail
.
bind
(
null
,
recoed
)}
>
详情
<
/a-button
>
);
},
},
});
const
[
registerModal
,
{
openModal
}]
=
useModal
();
watch
(
()
=>
errorStore
.
getErrorInfoState
,
(
list
:
any
[])
=>
{
setTableData
(
list
);
},
{
immediate
:
true
,
}
);
// 查看详情
function
handleDetail
(
row
:
ErrorInfo
)
{
rowInfoRef
.
value
=
row
;
openModal
({
visible
:
true
,
});
}
function
fireVueError
()
{
throw
new
Error
(
'
fire vue error!
'
);
}
function
fireResourceError
()
{
imgListRef
.
value
.
push
(
`
${
new
Date
().
getTime
()}
.png`
);
}
async
function
fireAjaxError
()
{
await
fireErrorApi
();
}
return
()
=>
(
<
div
class
=
{[
prefixCls
,
'
p-4
'
]}
>
{
unref
(
imgListRef
).
map
((
src
)
=>
{
return
<
img
src
=
{
src
}
key
=
{
src
}
class
=
"
hidden
"
/>
;
})}
<
DetailModal
info
=
{
unref
(
rowInfoRef
)}
onRegister
=
{
registerModal
}
/
>
<
BasicTable
onRegister
=
{
register
}
class
=
{
`
${
prefixCls
}
-table`
}
>
<
template
slot
=
"
toolbar
"
>
<
a
-
button
onClick
=
{
fireVueError
}
type
=
"
primary
"
>
点击触发vue错误
<
/a-button
>
<
a
-
button
onClick
=
{
fireResourceError
}
type
=
"
primary
"
>
点击触发resource错误
<
/a-button
>
<
a
-
button
onClick
=
{
fireAjaxError
}
type
=
"
primary
"
>
点击触发ajax错误
<
/a-button
>
<
/template
>
<
/BasicTable
>
<
/div
>
);
},
});
</
script
>
<
style
scoped
lang=
"less"
>
@import (reference) '~@design';
@prefix-cls: ~'@{namespace}-error-handle';
.@{prefix-cls} {
&-table {
background: #fff;
}
}
</
style
>
src/views/sys/iframe/index.vue
浏览文件 @
2f268ca8
<
template
>
<div
class=
"iframe-page"
:style=
"getWrapStyle"
>
<Spin
:spinning=
"loading"
size=
"large"
:style=
"getWrapStyle"
>
<div
class=
"iframe-page__mask"
v-show=
"menuStore.getDragStartState"
/>
<iframe
:src=
"frameSrc"
class=
"iframe-page__main"
ref=
"frameRef"
/>
</Spin>
</div>
...
...
@@ -12,7 +11,7 @@
import
{
getViewportOffset
}
from
'
/@/utils/domUtils
'
;
import
{
useWindowSizeFn
}
from
'
/@/hooks/event/useWindowSize
'
;
import
{
menuStore
}
from
'
/@/store/modules/menu
'
;
export
default
defineComponent
({
name
:
'
IFrame
'
,
components
:
{
Spin
},
...
...
@@ -76,7 +75,6 @@
}),
loading
:
loadingRef
,
frameRef
,
menuStore
,
};
},
});
...
...
vite.config.ts
浏览文件 @
2f268ca8
...
...
@@ -51,7 +51,7 @@ const viteConfig: UserConfig = {
*/
port
:
3100
,
/**
* 运行自动打开浏览器
* 运行自动打开浏览器
·
* @default 'false'
*/
open
:
false
,
...
...
@@ -88,9 +88,9 @@ const viteConfig: UserConfig = {
assetsInlineLimit
:
4096
,
/**
* esbuild转换目标。
* @default 'es20
20
'
* @default 'es20
19
'
*/
esbuildTarget
:
'
es20
20
'
,
esbuildTarget
:
'
es20
19
'
,
// 别名
alias
:
{
...
...
yarn.lock
0 → 100644
浏览文件 @
2f268ca8
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录