Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
a1ffb618
提交
a1ffb618
authored
11月 01, 2020
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf(table): optimize effect performance
上级
84b8302c
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
132 行增加
和
142 行删除
+132
-142
CollapseContainer.vue
src/components/Container/src/collapse/CollapseContainer.vue
+4
-4
index.less
src/components/Menu/src/index.less
+2
-1
BasicTable.vue
src/components/Table/src/BasicTable.vue
+12
-12
useColumns.ts
src/components/Table/src/hooks/useColumns.ts
+1
-1
useDataSource.ts
src/components/Table/src/hooks/useDataSource.ts
+8
-4
usePagination.tsx
src/components/Table/src/hooks/usePagination.tsx
+5
-3
useProps.ts
src/components/Table/src/hooks/useProps.ts
+2
-1
useProvinceTable.ts
src/components/Table/src/hooks/useProvinceTable.ts
+2
-1
useRowSelection.ts
src/components/Table/src/hooks/useRowSelection.ts
+3
-1
useTable.ts
src/components/Table/src/hooks/useTable.ts
+1
-0
useTableScroll.ts
src/components/Table/src/hooks/useTableScroll.ts
+46
-41
BasicTree.tsx
src/components/Tree/src/BasicTree.tsx
+12
-9
index.tsx
src/components/VirtualScroll/src/index.tsx
+4
-0
pagination.less
src/design/ant/pagination.less
+23
-53
Logo.vue
src/layouts/Logo.vue
+1
-0
index.less
src/layouts/default/index.less
+1
-1
TabContent.tsx
src/layouts/default/multitabs/TabContent.tsx
+2
-2
index.less
src/layouts/default/multitabs/index.less
+3
-8
没有找到文件。
src/components/Container/src/collapse/CollapseContainer.vue
浏览文件 @
a1ffb618
<
template
>
<
template
>
<div
class=
"collapse-container p-2"
>
<div
class=
"collapse-container p-2"
>
<CollapseHeader
v-bind=
"$props"
:show=
"show"
@
expand=
"handleExpand"
>
<CollapseHeader
v-bind=
"$props"
:show=
"show"
@
expand=
"handleExpand"
>
<template
#
title
>
<template
#
title
>
<slot
name=
"title"
/>
<slot
name=
"title"
/>
</
template
>
</
template
>
</CollapseHeader>
</CollapseHeader>
<CollapseTransition
:enable=
"canExpan"
>
<CollapseTransition
:enable=
"canExpan"
>
<Skeleton
v-if=
"loading"
/>
<Skeleton
v-if=
"loading"
/>
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
<
style
lang=
"less"
>
<
style
lang=
"less"
>
.collapse-container
{
.collapse-container
{
background
:
#fff
;
background
:
#fff
;
border-radius
:
8
px
;
border-radius
:
2
px
;
transition
:
all
0.3s
ease-in-out
;
transition
:
all
0.3s
ease-in-out
;
&.no-shadow
{
&.no-shadow
{
...
...
src/components/Menu/src/index.less
浏览文件 @
a1ffb618
...
@@ -2,12 +2,13 @@
...
@@ -2,12 +2,13 @@
.active-style() {
.active-style() {
color: @white;
color: @white;
// background: @primary-color !important;
background: linear-gradient(
background: linear-gradient(
118deg,
118deg,
rgba(@primary-color, 0.8),
rgba(@primary-color, 0.8),
rgba(@primary-color, 1)
rgba(@primary-color, 1)
) !important;
) !important;
border-radius: 2px;
//
border-radius: 2px;
box-shadow: 0 0 4px 1px rgba(@primary-color, 0.7);
box-shadow: 0 0 4px 1px rgba(@primary-color, 0.7);
}
}
...
...
src/components/Table/src/BasicTable.vue
浏览文件 @
a1ffb618
...
@@ -21,8 +21,8 @@
...
@@ -21,8 +21,8 @@
</BasicForm>
</BasicForm>
<Table
<Table
ref=
"tableElRef"
ref=
"tableElRef"
:rowClassName=
"getRowClassName"
v-bind=
"getBindValues"
v-bind=
"getBindValues"
:rowClassName=
"getRowClassName"
v-show=
"getEmptyDataIsShowTable"
v-show=
"getEmptyDataIsShowTable"
@
change=
"handleTableChange"
@
change=
"handleTableChange"
>
>
...
@@ -33,9 +33,6 @@
...
@@ -33,9 +33,6 @@
</div>
</div>
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
,
computed
,
unref
,
watch
,
nextTick
,
toRaw
}
from
'vue'
;
import
{
Table
}
from
'ant-design-vue'
;
import
{
basicProps
}
from
'./props'
;
import
type
{
import
type
{
BasicTableProps
,
BasicTableProps
,
FetchParams
,
FetchParams
,
...
@@ -45,12 +42,18 @@
...
@@ -45,12 +42,18 @@
SorterResult
,
SorterResult
,
TableCustomRecord
,
TableCustomRecord
,
}
from
'./types/table'
;
}
from
'./types/table'
;
import
{
PaginationProps
}
from
'./types/pagination'
;
import
{
isFunction
,
isString
}
from
'/@/utils/is
'
;
import
{
defineComponent
,
ref
,
computed
,
unref
,
watch
,
nextTick
,
toRaw
}
from
'vue
'
;
import
{
Table
}
from
'ant-design-vue'
;
import
renderTitle
from
'./components/renderTitle'
;
import
renderTitle
from
'./components/renderTitle'
;
import
renderFooter
from
'./components/renderFooter'
;
import
renderFooter
from
'./components/renderFooter'
;
import
renderExpandIcon
from
'./components/renderExpandIcon'
;
import
renderExpandIcon
from
'./components/renderExpandIcon'
;
import
{
BasicForm
,
FormProps
,
useForm
}
from
'/@/components/Form/index'
;
import
{
isFunction
,
isString
}
from
'/@/utils/is'
;
import
{
deepMerge
}
from
'/@/utils'
;
import
{
omit
}
from
'lodash-es'
;
import
{
usePagination
}
from
'./hooks/usePagination'
;
import
{
usePagination
}
from
'./hooks/usePagination'
;
import
{
useColumns
}
from
'./hooks/useColumns'
;
import
{
useColumns
}
from
'./hooks/useColumns'
;
...
@@ -59,13 +62,10 @@
...
@@ -59,13 +62,10 @@
import
{
useRowSelection
}
from
'./hooks/useRowSelection'
;
import
{
useRowSelection
}
from
'./hooks/useRowSelection'
;
import
{
useTableScroll
}
from
'./hooks/useTableScroll'
;
import
{
useTableScroll
}
from
'./hooks/useTableScroll'
;
import
{
provideTable
}
from
'./hooks/useProvinceTable'
;
import
{
provideTable
}
from
'./hooks/useProvinceTable'
;
import
{
BasicForm
,
FormProps
,
useForm
}
from
'/@/components/Form/index'
;
import
{
omit
}
from
'lodash-es'
;
import
{
ROW_KEY
}
from
'./const'
;
import
{
PaginationProps
}
from
'./types/pagination'
;
import
{
deepMerge
}
from
'/@/utils'
;
import
{
useEvent
}
from
'/@/hooks/event/useEvent'
;
import
{
useEvent
}
from
'/@/hooks/event/useEvent'
;
import
{
basicProps
}
from
'./props'
;
import
{
ROW_KEY
}
from
'./const'
;
import
'./style/index.less'
;
import
'./style/index.less'
;
export
default
defineComponent
({
export
default
defineComponent
({
props
:
basicProps
,
props
:
basicProps
,
...
...
src/components/Table/src/hooks/useColumns.ts
浏览文件 @
a1ffb618
...
@@ -101,7 +101,7 @@ export function useColumns(
...
@@ -101,7 +101,7 @@ export function useColumns(
columnsRef
.
value
=
columns
as
any
;
columnsRef
.
value
=
columns
as
any
;
}
else
{
}
else
{
const
newColumns
=
unref
(
cacheColumnsRef
).
filter
((
item
)
=>
const
newColumns
=
unref
(
cacheColumnsRef
).
filter
((
item
)
=>
(
columns
as
string
[]).
includes
(
item
.
key
!
||
item
.
dataIndex
!
)
(
columns
as
string
[]).
includes
(
`
${
item
.
key
}
`
!
||
item
.
dataIndex
!
)
);
);
columnsRef
.
value
=
newColumns
;
columnsRef
.
value
=
newColumns
;
}
}
...
...
src/components/Table/src/hooks/useDataSource.ts
浏览文件 @
a1ffb618
import
{
useTimeout
}
from
'/@/hooks/core/useTimeout
'
;
import
type
{
BasicTableProps
,
FetchParams
}
from
'../types/table
'
;
import
{
BasicTableProps
,
FetchParams
}
from
'../types/table
'
;
import
type
{
PaginationProps
}
from
'../types/pagination
'
;
import
{
PaginationProps
}
from
'../types/pagination'
;
import
{
watch
,
ref
,
unref
,
ComputedRef
,
computed
,
onMounted
,
Ref
}
from
'vue'
;
import
{
watch
,
ref
,
unref
,
ComputedRef
,
computed
,
onMounted
,
Ref
}
from
'vue'
;
import
{
useTimeout
}
from
'/@/hooks/core/useTimeout'
;
import
{
buildUUID
}
from
'/@/utils/uuid'
;
import
{
buildUUID
}
from
'/@/utils/uuid'
;
import
{
isFunction
,
isBoolean
}
from
'/@/utils/is'
;
import
{
isFunction
,
isBoolean
}
from
'/@/utils/is'
;
import
{
FETCH_SETTING
,
ROW_KEY
}
from
'../const'
;
import
{
get
}
from
'lodash-es'
;
import
{
get
}
from
'lodash-es'
;
import
{
useProps
}
from
'./useProps'
;
import
{
useProps
}
from
'./useProps'
;
import
{
FETCH_SETTING
,
ROW_KEY
}
from
'../const'
;
interface
ActionType
{
interface
ActionType
{
getPaginationRef
:
ComputedRef
<
false
|
PaginationProps
>
;
getPaginationRef
:
ComputedRef
<
false
|
PaginationProps
>
;
setPagination
:
(
info
:
Partial
<
PaginationProps
>
)
=>
void
;
setPagination
:
(
info
:
Partial
<
PaginationProps
>
)
=>
void
;
...
...
src/components/Table/src/hooks/usePagination.tsx
浏览文件 @
a1ffb618
import
type
{
PaginationProps
}
from
'../types/pagination'
;
import
type
{
BasicTableProps
}
from
'../types/table'
;
import
{
computed
,
unref
,
ref
,
ComputedRef
}
from
'vue'
;
import
{
computed
,
unref
,
ref
,
ComputedRef
}
from
'vue'
;
import
{
PaginationProps
}
from
'../types/pagination'
;
import
{
isBoolean
}
from
'/@/utils/is'
;
import
{
LeftOutlined
,
RightOutlined
}
from
'@ant-design/icons-vue'
;
import
{
LeftOutlined
,
RightOutlined
}
from
'@ant-design/icons-vue'
;
import
{
isBoolean
}
from
'/@/utils/is'
;
import
{
PAGE_SIZE
,
PAGE_SIZE_OPTIONS
}
from
'../const'
;
import
{
PAGE_SIZE
,
PAGE_SIZE_OPTIONS
}
from
'../const'
;
import
{
useProps
}
from
'./useProps'
;
import
{
useProps
}
from
'./useProps'
;
import
{
BasicTableProps
}
from
'../..'
;
export
function
usePagination
(
refProps
:
ComputedRef
<
BasicTableProps
>
)
{
export
function
usePagination
(
refProps
:
ComputedRef
<
BasicTableProps
>
)
{
const
configRef
=
ref
<
PaginationProps
>
({});
const
configRef
=
ref
<
PaginationProps
>
({});
const
{
propsRef
}
=
useProps
(
refProps
);
const
{
propsRef
}
=
useProps
(
refProps
);
...
...
src/components/Table/src/hooks/useProps.ts
浏览文件 @
a1ffb618
import
{
Ref
,
ref
,
watch
,
unref
}
from
'vue'
;
import
{
Ref
,
ref
,
watch
,
unref
}
from
'vue'
;
import
{
BasicTableProps
}
from
'../types/table'
;
import
type
{
BasicTableProps
}
from
'../types/table'
;
/**
/**
* @description:
* @description:
...
...
src/components/Table/src/hooks/useProvinceTable.ts
浏览文件 @
a1ffb618
import
type
{
Ref
}
from
'vue'
;
import
type
{
Ref
}
from
'vue'
;
import
type
{
TableActionType
}
from
'../types/table'
;
import
{
provide
,
inject
}
from
'vue'
;
import
{
provide
,
inject
}
from
'vue'
;
import
{
TableActionType
}
from
'../types/table'
;
const
key
=
Symbol
(
'table'
);
const
key
=
Symbol
(
'table'
);
...
...
src/components/Table/src/hooks/useRowSelection.ts
浏览文件 @
a1ffb618
import
{
computed
,
ref
,
unref
,
ComputedRef
}
from
'vue'
;
import
type
{
BasicTableProps
,
TableRowSelection
}
from
'../types/table'
;
import
type
{
BasicTableProps
,
TableRowSelection
}
from
'../types/table'
;
import
{
computed
,
ref
,
unref
,
ComputedRef
}
from
'vue'
;
import
{
useProps
}
from
'./useProps'
;
import
{
useProps
}
from
'./useProps'
;
/* eslint-disable */
/* eslint-disable */
...
@@ -28,6 +29,7 @@ export function useRowSelection(refProps: ComputedRef<BasicTableProps>, emit: Em
...
@@ -28,6 +29,7 @@ export function useRowSelection(refProps: ComputedRef<BasicTableProps>, emit: Em
...
rowSelection
,
...
rowSelection
,
};
};
});
});
function
setSelectedRowKeys
(
rowKeys
:
string
[])
{
function
setSelectedRowKeys
(
rowKeys
:
string
[])
{
selectedRowKeysRef
.
value
=
rowKeys
;
selectedRowKeysRef
.
value
=
rowKeys
;
}
}
...
...
src/components/Table/src/hooks/useTable.ts
浏览文件 @
a1ffb618
import
type
{
BasicTableProps
,
TableActionType
,
FetchParams
,
BasicColumn
}
from
'../types/table'
;
import
type
{
BasicTableProps
,
TableActionType
,
FetchParams
,
BasicColumn
}
from
'../types/table'
;
import
type
{
PaginationProps
}
from
'../types/pagination'
;
import
type
{
PaginationProps
}
from
'../types/pagination'
;
import
{
ref
,
getCurrentInstance
,
onUnmounted
,
unref
}
from
'vue'
;
import
{
ref
,
getCurrentInstance
,
onUnmounted
,
unref
}
from
'vue'
;
import
{
isProdMode
}
from
'/@/utils/env'
;
import
{
isProdMode
}
from
'/@/utils/env'
;
...
...
src/components/Table/src/hooks/useTableScroll.ts
浏览文件 @
a1ffb618
import
{
BasicTableProps
}
from
'../types/table'
;
import
type
{
BasicTableProps
}
from
'../types/table'
;
import
{
computed
,
Ref
,
onMounted
,
unref
,
ref
,
nextTick
,
ComputedRef
,
watch
}
from
'vue'
;
import
{
computed
,
Ref
,
onMounted
,
unref
,
ref
,
nextTick
,
ComputedRef
,
watch
}
from
'vue'
;
import
{
injectModal
}
from
'/@/components/Modal/src/provideModal'
;
import
{
getViewportOffset
}
from
'/@/utils/domUtils'
;
import
{
getViewportOffset
}
from
'/@/utils/domUtils'
;
import
{
triggerWindowResize
}
from
'/@/utils/event/triggerWindowResizeEvent'
;
import
{
isBoolean
}
from
'/@/utils/is'
;
import
{
isBoolean
}
from
'/@/utils/is'
;
import
{
useTimeout
}
from
'/@/hooks/core/useTimeout'
;
import
{
useWindowSizeFn
}
from
'/@/hooks/event/useWindowSize'
;
import
{
useWindowSizeFn
}
from
'/@/hooks/event/useWindowSize'
;
import
{
useProps
}
from
'./useProps'
;
import
{
useProps
}
from
'./useProps'
;
import
{
injectModal
}
from
'/@/components/Modal/src/provideModal'
;
export
function
useTableScroll
(
refProps
:
ComputedRef
<
BasicTableProps
>
,
tableElRef
:
Ref
<
any
>
)
{
export
function
useTableScroll
(
refProps
:
ComputedRef
<
BasicTableProps
>
,
tableElRef
:
Ref
<
any
>
)
{
const
{
propsRef
}
=
useProps
(
refProps
);
const
{
propsRef
}
=
useProps
(
refProps
);
...
@@ -29,7 +30,9 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
...
@@ -29,7 +30,9 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
calcTableHeight
();
calcTableHeight
();
}
}
async
function
calcTableHeight
(
cb
?:
()
=>
void
)
{
let
paginationEl
:
HTMLElement
|
null
;
let
footerEl
:
HTMLElement
|
null
;
async
function
calcTableHeight
()
{
const
{
canResize
,
resizeHeightOffset
,
pagination
,
maxHeight
}
=
unref
(
propsRef
);
const
{
canResize
,
resizeHeightOffset
,
pagination
,
maxHeight
}
=
unref
(
propsRef
);
if
(
!
canResize
)
return
;
if
(
!
canResize
)
return
;
...
@@ -39,40 +42,44 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
...
@@ -39,40 +42,44 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
const
tableEl
:
Element
=
table
.
$el
;
const
tableEl
:
Element
=
table
.
$el
;
if
(
!
tableEl
)
return
;
if
(
!
tableEl
)
return
;
const
headEl
=
tableEl
.
querySelector
(
'.ant-table-thead '
);
const
el
:
HTMLElement
|
null
=
tableEl
.
querySelector
(
'.ant-table-thead '
);
// const layoutMain: Element | null = document.querySelector('.default-layout__main ');
// const layoutMain: Element | null = document.querySelector('.default-layout__main ');
if
(
!
e
l
)
return
;
if
(
!
headE
l
)
return
;
// 表格距离底部高度
// 表格距离底部高度
const
{
bottomIncludeBody
}
=
getViewportOffset
(
e
l
);
const
{
bottomIncludeBody
}
=
getViewportOffset
(
headE
l
);
// 表格高度+距离底部高度-自定义偏移量
// 表格高度+距离底部高度-自定义偏移量
const
paddingHeight
=
32
;
const
paddingHeight
=
32
;
const
borderHeight
=
2
*
2
;
const
borderHeight
=
2
*
2
;
// 分页器高度
// 分页器高度
// TODO 先固定20
let
paginationHeight
=
2
;
const
paginationHeight
=
20
;
if
(
!
isBoolean
(
pagination
))
{
// if (!isBoolean(pagination)) {
if
(
!
paginationEl
)
{
// const paginationDom = tableEl.querySelector('.ant-pagination') as HTMLElement;
paginationEl
=
tableEl
.
querySelector
(
'.ant-pagination'
)
as
HTMLElement
;
// if (paginationDom) {
}
// const offsetHeight = paginationDom.offsetHeight;
if
(
paginationEl
)
{
// paginationHeight += offsetHeight || 0;
const
offsetHeight
=
paginationEl
.
offsetHeight
;
// }
paginationHeight
+=
offsetHeight
||
0
;
// }
}
else
{
// TODO 先固定24
paginationHeight
+=
24
;
}
}
let
footerHeight
=
0
;
let
footerHeight
=
0
;
if
(
!
isBoolean
(
pagination
))
{
if
(
!
isBoolean
(
pagination
))
{
const
footerEl
=
tableEl
.
querySelector
(
'.ant-table-footer'
)
as
HTMLElement
;
if
(
!
footerEl
)
{
if
(
footerEl
)
{
footerEl
=
tableEl
.
querySelector
(
'.ant-table-footer'
)
as
HTMLElement
;
}
else
{
const
offsetHeight
=
footerEl
.
offsetHeight
;
const
offsetHeight
=
footerEl
.
offsetHeight
;
footerHeight
+=
offsetHeight
||
0
;
footerHeight
+=
offsetHeight
||
0
;
}
}
}
}
let
headerHeight
=
0
;
let
headerHeight
=
0
;
if
(
e
l
)
{
if
(
headE
l
)
{
headerHeight
=
(
e
l
as
HTMLElement
).
offsetHeight
;
headerHeight
=
(
headE
l
as
HTMLElement
).
offsetHeight
;
}
}
tableHeightRef
.
value
=
tableHeightRef
.
value
=
bottomIncludeBody
-
bottomIncludeBody
-
...
@@ -82,13 +89,13 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
...
@@ -82,13 +89,13 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
paginationHeight
-
paginationHeight
-
footerHeight
-
footerHeight
-
headerHeight
;
headerHeight
;
useTimeout
(()
=>
{
setTimeout
(()
=>
{
tableHeightRef
.
value
=
tableHeightRef
.
value
=
tableHeightRef
.
value
!
>
maxHeight
!
?
(
maxHeight
as
number
)
:
tableHeightRef
.
value
;
tableHeightRef
.
value
!
>
maxHeight
!
?
(
maxHeight
as
number
)
:
tableHeightRef
.
value
;
cb
&&
cb
();
// 解决表格放modal内的时候,modal自适应高度计算问题
// 解决表格放modal内的时候,modal自适应高度计算问题
redoModalHeight
&&
redoModalHeight
();
redoModalHeight
&&
redoModalHeight
();
},
0
);
},
16
);
}
}
const
getCanResize
=
computed
(()
=>
{
const
getCanResize
=
computed
(()
=>
{
...
@@ -98,24 +105,22 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
...
@@ -98,24 +105,22 @@ export function useTableScroll(refProps: ComputedRef<BasicTableProps>, tableElRe
useWindowSizeFn
(
calcTableHeight
,
100
);
useWindowSizeFn
(
calcTableHeight
,
100
);
// function clear() {
// window.clearInterval(timer);
// }
onMounted
(()
=>
{
onMounted
(()
=>
{
if
(
unref
(
getCanResize
))
{
if
(
unref
(
getCanResize
))
{
calcTableHeight
();
nextTick
(()
=>
{
const
hasFixedLeft
=
(
unref
(
propsRef
).
columns
||
[]).
some
((
item
)
=>
item
.
fixed
===
'left'
);
calcTableHeight
();
// TODO antv table问题情况太多,只能先用下面方式定时器hack
});
useTimeout
(()
=>
{
// const hasFixedLeft = (unref(propsRef).columns || []).some((item) => item.fixed === 'left');
calcTableHeight
(()
=>
{
// // TODO antv table问题情况太多,只能先用下面方式定时器hack
// 有左侧固定列的时候才有问题
// useTimeout(() => {
hasFixedLeft
&&
// calcTableHeight(() => {
useTimeout
(()
=>
{
// // 有左侧固定列的时候才有问题
triggerWindowResize
();
// hasFixedLeft &&
},
300
);
// useTimeout(() => {
});
// triggerWindowResize();
},
200
);
// }, 300);
// });
// }, 200);
}
}
});
});
const
getScrollRef
=
computed
(()
=>
{
const
getScrollRef
=
computed
(()
=>
{
...
...
src/components/Tree/src/BasicTree.tsx
浏览文件 @
a1ffb618
import
type
{
ReplaceFields
,
TreeItem
,
Keys
,
CheckKeys
,
InsertNodeParams
}
from
'./types'
;
import
{
defineComponent
,
reactive
,
computed
,
unref
,
ref
,
watchEffect
}
from
'vue'
;
import
{
defineComponent
,
reactive
,
computed
,
unref
,
ref
,
watchEffect
}
from
'vue'
;
import
{
Tree
}
from
'ant-design-vue'
;
import
{
Tree
}
from
'ant-design-vue'
;
import
{
extendSlots
}
from
'/@/utils/helper/tsxHelper'
;
import
{
useContextMenu
,
ContextMenuItem
}
from
'/@/hooks/web/useContextMenu'
;
import
{
basicProps
}
from
'./props'
;
import
{
isFunction
}
from
'/@/utils/is'
;
import
{
omit
}
from
'lodash-es'
;
import
{
DownOutlined
}
from
'@ant-design/icons-vue'
;
import
{
DownOutlined
}
from
'@ant-design/icons-vue'
;
import
type
{
ReplaceFields
,
TreeItem
,
Keys
,
CheckKeys
,
InsertNodeParams
}
from
'./types'
;
import
{
useContextMenu
,
ContextMenuItem
}
from
'/@/hooks/web/useContextMenu'
;
import
{
isFunction
}
from
'/@/utils/is'
;
import
{
omit
,
cloneDeep
}
from
'lodash-es'
;
import
{
forEach
}
from
'/@/utils/helper/treeHelper'
;
import
{
extendSlots
}
from
'/@/utils/helper/tsxHelper'
;
import
{
tryTsxEmit
}
from
'/@/utils/helper/vueHelper'
;
import
{
tryTsxEmit
}
from
'/@/utils/helper/vueHelper'
;
import
{
basicProps
}
from
'./props'
;
import
'./index.less'
;
import
'./index.less'
;
import
{
forEach
}
from
'/@/utils/helper/treeHelper'
;
import
{
cloneDeep
}
from
'lodash-es'
;
interface
State
{
interface
State
{
expandedKeys
:
Keys
;
expandedKeys
:
Keys
;
...
@@ -72,7 +74,6 @@ export default defineComponent({
...
@@ -72,7 +74,6 @@ export default defineComponent({
if
(
!
data
)
{
if
(
!
data
)
{
return
null
;
return
null
;
}
}
return
data
.
map
((
item
)
=>
{
return
data
.
map
((
item
)
=>
{
const
{
title
:
titleField
,
key
:
keyField
,
children
:
childrenField
}
=
unref
(
const
{
title
:
titleField
,
key
:
keyField
,
children
:
childrenField
}
=
unref
(
getReplaceFields
getReplaceFields
...
@@ -94,6 +95,7 @@ export default defineComponent({
...
@@ -94,6 +95,7 @@ export default defineComponent({
);
);
});
});
}
}
// 处理右键事件
// 处理右键事件
async
function
handleRightClick
({
event
,
node
}:
any
)
{
async
function
handleRightClick
({
event
,
node
}:
any
)
{
const
{
rightMenuList
:
menuList
=
[],
beforeRightClick
}
=
props
;
const
{
rightMenuList
:
menuList
=
[],
beforeRightClick
}
=
props
;
...
@@ -154,6 +156,7 @@ export default defineComponent({
...
@@ -154,6 +156,7 @@ export default defineComponent({
}
}
return
res
as
string
[]
|
number
[];
return
res
as
string
[]
|
number
[];
}
}
/**
/**
* 添加节点
* 添加节点
*/
*/
...
...
src/components/VirtualScroll/src/index.tsx
浏览文件 @
a1ffb618
...
@@ -75,6 +75,7 @@ export default defineComponent({
...
@@ -75,6 +75,7 @@ export default defineComponent({
function
getFirst
():
number
{
function
getFirst
():
number
{
return
Math
.
floor
(
state
.
scrollTop
/
unref
(
getItemHeightRef
));
return
Math
.
floor
(
state
.
scrollTop
/
unref
(
getItemHeightRef
));
}
}
function
onScroll
()
{
function
onScroll
()
{
const
wrapEl
=
unref
(
wrapElRef
);
const
wrapEl
=
unref
(
wrapElRef
);
if
(
!
wrapEl
)
{
if
(
!
wrapEl
)
{
...
@@ -84,10 +85,12 @@ export default defineComponent({
...
@@ -84,10 +85,12 @@ export default defineComponent({
state
.
first
=
getFirst
();
state
.
first
=
getFirst
();
state
.
last
=
getLast
(
state
.
first
);
state
.
last
=
getLast
(
state
.
first
);
}
}
function
renderChildren
()
{
function
renderChildren
()
{
const
{
items
=
[]
}
=
props
;
const
{
items
=
[]
}
=
props
;
return
items
.
slice
(
unref
(
getFirstToRenderRef
),
unref
(
getLastToRenderRef
)).
map
(
genChild
);
return
items
.
slice
(
unref
(
getFirstToRenderRef
),
unref
(
getLastToRenderRef
)).
map
(
genChild
);
}
}
function
genChild
(
item
:
any
,
index
:
number
)
{
function
genChild
(
item
:
any
,
index
:
number
)
{
index
+=
unref
(
getFirstToRenderRef
);
index
+=
unref
(
getFirstToRenderRef
);
...
@@ -98,6 +101,7 @@ export default defineComponent({
...
@@ -98,6 +101,7 @@ export default defineComponent({
</
div
>
</
div
>
);
);
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
state
.
last
=
getLast
(
0
);
state
.
last
=
getLast
(
0
);
nextTick
(()
=>
{
nextTick
(()
=>
{
...
...
src/design/ant/pagination.less
浏览文件 @
a1ffb618
.ant-pagination {
.ant-pagination {
&.mini {
&.mini {
height: 20px;
font-size: 13px;
.ant-pagination-prev,
.ant-pagination-prev,
.ant-pagination-next {
.ant-pagination-next {
width: 20px;
font-size: 12px;
height: 20px;
color: @text-color-base;
min-width: 20px;
line-height: 20px;
color: @border-color-shallow-dark;
border: 1px solid;
border: 1px solid;
}
}
...
@@ -17,15 +11,23 @@
...
@@ -17,15 +11,23 @@
.ant-pagination-next:hover,
.ant-pagination-next:hover,
.ant-pagination-item:focus,
.ant-pagination-item:focus,
.ant-pagination-item:hover {
.ant-pagination-item:hover {
color: @primary-color;
a {
border: 1px solid @primary-color;
color: @primary-color;
}
}
}
.ant-pagination-prev,
.ant-pagination-next,
.ant-pagination-item {
.ant-pagination-item {
height: 20px;
margin: 0 4px;
min-width: 20px;
background: #f4f4f5 !important;
margin: 0 3px;
border: none;
line-height: 20px;
border-radius: none !important;
a {
margin-top: 1px;
color: #606266;
}
&:last-child {
&:last-child {
margin-right: 0 !important;
margin-right: 0 !important;
...
@@ -33,58 +35,26 @@
...
@@ -33,58 +35,26 @@
}
}
.ant-pagination-item-active {
.ant-pagination-item-active {
background: @primary-color;
background: @primary-color !important;
border: none;
border-radius: none !important;
a {
a {
color: @white;
color: @white
!important
;
}
}
}
}
.ant-pagination-options {
.ant-pagination-options {
margin-left: 20px;
margin-left: 12px;
}
.ant-select-sm .ant-select-selection--single {
height: 20px;
}
.ant-pagination-options,
.ant-pagination-total-text,
.ant-pagination-options-quick-jumper {
height: 20px;
line-height: 20px;
}
.ant-select-selection__rendered {
height: 18px;
line-height: 18px;
}
.ant-pagination-total-text,
.ant-select-selection__rendered,
.ant-select-dropdown-menu-item,
.ant-pagination-options-quick-jumper {
font-size: 13px;
}
}
.ant-pagination-options-quick-jumper input {
.ant-pagination-options-quick-jumper input {
width: 40px;
height: 22px;
height: 20px;
margin: 0 6px;
margin: 0 6px;
line-height: 2
0
px;
line-height: 2
2
px;
text-align: center;
text-align: center;
}
}
.ant-pagination-jump-prev,
.ant-pagination-jump-next {
height: 20px;
line-height: 20px;
}
.ant-pagination-options-size-changer.ant-select {
margin-right: 20px;
}
.ant-select-arrow {
.ant-select-arrow {
color: @border-color-shallow-dark;
color: @border-color-shallow-dark;
}
}
...
...
src/layouts/Logo.vue
浏览文件 @
a1ffb618
...
@@ -79,6 +79,7 @@
...
@@ -79,6 +79,7 @@
align-items
:
center
;
align-items
:
center
;
padding-left
:
16px
;
padding-left
:
16px
;
cursor
:
pointer
;
cursor
:
pointer
;
justify-content
:
center
;
.logo-title
{
.logo-title
{
display
:
none
;
display
:
none
;
...
...
src/layouts/default/index.less
浏览文件 @
a1ffb618
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
padding: 0;
padding: 0;
line-height: @multiple-height;
line-height: @multiple-height;
background: @border-color-shallow-light;
background: @border-color-shallow-light;
box-shadow: 0
3px 8px 0 rgba(0, 0, 0, 0.12
);
box-shadow: 0
1px 2px 0 rgba(0, 0, 0, 0.1
);
}
}
}
}
...
...
src/layouts/default/multitabs/TabContent.tsx
浏览文件 @
a1ffb618
...
@@ -5,7 +5,7 @@ import { getScaleAction, TabContentProps } from './tab.data';
...
@@ -5,7 +5,7 @@ import { getScaleAction, TabContentProps } from './tab.data';
import
{
defineComponent
,
unref
,
computed
}
from
'vue'
;
import
{
defineComponent
,
unref
,
computed
}
from
'vue'
;
import
{
Dropdown
}
from
'/@/components/Dropdown/index'
;
import
{
Dropdown
}
from
'/@/components/Dropdown/index'
;
import
Icon
from
'/@/components/Icon/index'
;
import
Icon
from
'/@/components/Icon/index'
;
import
{
Double
RightOutlined
}
from
'@ant-design/icons-vue'
;
import
{
RightOutlined
}
from
'@ant-design/icons-vue'
;
import
{
appStore
}
from
'/@/store/modules/app'
;
import
{
appStore
}
from
'/@/store/modules/app'
;
import
{
TabContentEnum
}
from
'./tab.data'
;
import
{
TabContentEnum
}
from
'./tab.data'
;
...
@@ -74,7 +74,7 @@ export default defineComponent({
...
@@ -74,7 +74,7 @@ export default defineComponent({
function
renderExtraContent
()
{
function
renderExtraContent
()
{
return
(
return
(
<
span
class=
{
`multiple-tabs-content__extra `
}
>
<
span
class=
{
`multiple-tabs-content__extra `
}
>
<
Double
RightOutlined
/>
<
RightOutlined
/>
</
span
>
</
span
>
);
);
}
}
...
...
src/layouts/default/multitabs/index.less
浏览文件 @
a1ffb618
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
.ant-tabs-tab {
.ant-tabs-tab {
height: calc(@multiple-height - 2px);
height: calc(@multiple-height - 2px);
padding-right: 12px;
line-height: calc(@multiple-height - 2px);
line-height: calc(@multiple-height - 2px);
color: @text-color-call-out;
color: @text-color-call-out;
background: @white;
background: @white;
...
@@ -37,17 +38,10 @@
...
@@ -37,17 +38,10 @@
&:hover {
&:hover {
svg {
svg {
width: 0.8em;
width: 0.8em;
transition: all 0.1s;
}
}
}
}
}
}
&:hover {
.ant-tabs-close-x {
display: block;
}
}
> div {
> div {
display: flex;
display: flex;
justify-content: center;
justify-content: center;
...
@@ -106,9 +100,10 @@
...
@@ -106,9 +100,10 @@
width: @multiple-height;
width: @multiple-height;
height: @multiple-height;
height: @multiple-height;
line-height: @multiple-height;
line-height: @multiple-height;
color:
@primary-color
;
color:
#999
;
text-align: center;
text-align: center;
cursor: pointer;
cursor: pointer;
border-left: 1px solid #eee;
// box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
// box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
span[role='img'] {
span[role='img'] {
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论