Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
9035fd19
提交
9035fd19
authored
8月 13, 2021
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(types): fix some type errors
上级
bb89c505
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
24 行增加
和
25 行删除
+24
-25
FlowChart.vue
src/components/FlowChart/src/FlowChart.vue
+4
-3
useLoading.ts
src/components/Loading/src/useLoading.ts
+1
-1
Functional.vue
src/components/Preview/src/Functional.vue
+6
-6
BasicTable.vue
src/components/Table/src/BasicTable.vue
+2
-2
ColumnSetting.vue
...omponents/Table/src/components/settings/ColumnSetting.vue
+1
-1
useTableScroll.ts
src/components/Table/src/hooks/useTableScroll.ts
+1
-0
useRefs.ts
src/hooks/core/useRefs.ts
+3
-2
useEventListener.ts
src/hooks/event/useEventListener.ts
+1
-3
useECharts.ts
src/hooks/web/useECharts.ts
+4
-6
is.ts
src/utils/is.ts
+1
-1
没有找到文件。
src/components/FlowChart/src/FlowChart.vue
浏览文件 @
9035fd19
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
type
{
Ref
}
from
'vue'
;
import
type
{
Definition
}
from
'@logicflow/core'
;
import
type
{
Definition
}
from
'@logicflow/core'
;
import
{
defineComponent
,
ref
,
onMounted
,
unref
,
nextTick
,
computed
,
watch
}
from
'vue'
;
import
{
defineComponent
,
ref
,
onMounted
,
unref
,
nextTick
,
computed
,
watch
}
from
'vue'
;
import
FlowChartToolbar
from
'./FlowChartToolbar.vue'
;
import
FlowChartToolbar
from
'./FlowChartToolbar.vue'
;
...
@@ -46,10 +47,10 @@
...
@@ -46,10 +47,10 @@
},
},
},
},
setup
(
props
)
{
setup
(
props
)
{
const
lfElRef
=
ref
<
ElRef
>
(
null
);
const
lfElRef
=
ref
(
null
);
const
graphData
=
ref
<
Recordable
>
({});
const
graphData
=
ref
({});
const
lfInstance
=
ref
<
Nullable
<
LogicFlow
>>
(
null
)
;
const
lfInstance
=
ref
(
null
)
as
Ref
<
LogicFlow
|
null
>
;
const
{
prefixCls
}
=
useDesign
(
'flow-chart'
);
const
{
prefixCls
}
=
useDesign
(
'flow-chart'
);
const
appStore
=
useAppStore
();
const
appStore
=
useAppStore
();
...
...
src/components/Loading/src/useLoading.ts
浏览文件 @
9035fd19
...
@@ -32,7 +32,7 @@ export function useLoading(
...
@@ -32,7 +32,7 @@ export function useLoading(
const
instance
=
createLoading
(
props
,
undefined
,
true
);
const
instance
=
createLoading
(
props
,
undefined
,
true
);
const
open
=
():
void
=>
{
const
open
=
():
void
=>
{
const
t
=
unref
(
target
);
const
t
=
unref
(
target
as
Ref
<
ElRef
>
);
if
(
!
t
)
return
;
if
(
!
t
)
return
;
instance
.
open
(
t
);
instance
.
open
(
t
);
};
};
...
...
src/components/Preview/src/Functional.vue
浏览文件 @
9035fd19
<
script
lang=
"tsx"
>
<
script
lang=
"tsx"
>
import
{
defineComponent
,
ref
,
unref
,
computed
,
reactive
,
watchEffect
}
from
'vue'
;
import
{
defineComponent
,
ref
,
unref
,
computed
,
reactive
,
watchEffect
}
from
'vue'
;
import
{
Props
}
from
'./typing'
;
import
{
CloseOutlined
,
LeftOutlined
,
RightOutlined
}
from
'@ant-design/icons-vue'
;
import
{
CloseOutlined
,
LeftOutlined
,
RightOutlined
}
from
'@ant-design/icons-vue'
;
import
resumeSvg
from
'/@/assets/svg/preview/resume.svg'
;
import
resumeSvg
from
'/@/assets/svg/preview/resume.svg'
;
import
rotateSvg
from
'/@/assets/svg/preview/p-rotate.svg'
;
import
rotateSvg
from
'/@/assets/svg/preview/p-rotate.svg'
;
...
@@ -57,7 +56,7 @@
...
@@ -57,7 +56,7 @@
name
:
'ImagePreview'
,
name
:
'ImagePreview'
,
props
,
props
,
emits
:
[
'img-load'
,
'img-error'
],
emits
:
[
'img-load'
,
'img-error'
],
setup
(
props
:
Props
,
{
expose
,
emit
})
{
setup
(
props
,
{
expose
,
emit
})
{
interface
stateInfo
{
interface
stateInfo
{
scale
:
number
;
scale
:
number
;
rotate
:
number
;
rotate
:
number
;
...
@@ -117,8 +116,9 @@
...
@@ -117,8 +116,9 @@
}
}
const
getScaleStep
=
computed
(()
=>
{
const
getScaleStep
=
computed
(()
=>
{
if
(
props
.
scaleStep
>
0
&&
props
.
scaleStep
<
100
)
{
const
scaleStep
=
props
?.
scaleStep
??
0
;
return
props
.
scaleStep
/
100
;
if
(
scaleStep
??
(
0
>
0
&&
scaleStep
<
100
))
{
return
scaleStep
/
100
;
}
else
{
}
else
{
return
imgState
.
imgScale
/
10
;
return
imgState
.
imgScale
/
10
;
}
}
...
@@ -164,7 +164,7 @@
...
@@ -164,7 +164,7 @@
img
.
src
=
url
;
img
.
src
=
url
;
img
.
onload
=
(
e
:
Event
)
=>
{
img
.
onload
=
(
e
:
Event
)
=>
{
if
(
imgState
.
currentUrl
!==
url
)
{
if
(
imgState
.
currentUrl
!==
url
)
{
const
ele
:
HTMLElement
[]
=
e
.
composedPath
();
const
ele
:
any
[]
=
e
.
composedPath
();
if
(
props
.
rememberState
)
{
if
(
props
.
rememberState
)
{
// 保存当前图片的缩放信息
// 保存当前图片的缩放信息
stateMap
.
set
(
imgState
.
currentUrl
,
{
stateMap
.
set
(
imgState
.
currentUrl
,
{
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
setRotate
:
(
rotate
:
number
)
=>
{
setRotate
:
(
rotate
:
number
)
=>
{
imgState
.
imgRotate
=
rotate
;
imgState
.
imgRotate
=
rotate
;
},
},
}
as
PreviewActions
);
});
// 上一页下一页
// 上一页下一页
function
handleChange
(
direction
:
'left'
|
'right'
)
{
function
handleChange
(
direction
:
'left'
|
'right'
)
{
...
...
src/components/Table/src/BasicTable.vue
浏览文件 @
9035fd19
...
@@ -91,10 +91,10 @@
...
@@ -91,10 +91,10 @@
'columns-change'
,
'columns-change'
,
],
],
setup
(
props
,
{
attrs
,
emit
,
slots
,
expose
})
{
setup
(
props
,
{
attrs
,
emit
,
slots
,
expose
})
{
const
tableElRef
=
ref
<
ComponentRef
>
(
null
);
const
tableElRef
=
ref
(
null
);
const
tableData
=
ref
<
Recordable
[]
>
([]);
const
tableData
=
ref
<
Recordable
[]
>
([]);
const
wrapRef
=
ref
<
Nullable
<
HTMLDivElement
>>
(
null
);
const
wrapRef
=
ref
(
null
);
const
innerPropsRef
=
ref
<
Partial
<
BasicTableProps
>>
();
const
innerPropsRef
=
ref
<
Partial
<
BasicTableProps
>>
();
const
{
prefixCls
}
=
useDesign
(
'basic-table'
);
const
{
prefixCls
}
=
useDesign
(
'basic-table'
);
...
...
src/components/Table/src/components/settings/ColumnSetting.vue
浏览文件 @
9035fd19
...
@@ -282,7 +282,7 @@
...
@@ -282,7 +282,7 @@
nextTick
(()
=>
{
nextTick
(()
=>
{
const
columnListEl
=
unref
(
columnListRef
);
const
columnListEl
=
unref
(
columnListRef
);
if
(
!
columnListEl
)
return
;
if
(
!
columnListEl
)
return
;
const
el
=
columnListEl
.
$el
;
const
el
=
columnListEl
.
$el
as
any
;
if
(
!
el
)
return
;
if
(
!
el
)
return
;
// Drag and drop sort
// Drag and drop sort
const
{
initSortable
}
=
useSortable
(
el
,
{
const
{
initSortable
}
=
useSortable
(
el
,
{
...
...
src/components/Table/src/hooks/useTableScroll.ts
浏览文件 @
9035fd19
...
@@ -66,6 +66,7 @@ export function useTableScroll(
...
@@ -66,6 +66,7 @@ export function useTableScroll(
if
(
!
bodyEl
)
{
if
(
!
bodyEl
)
{
bodyEl
=
tableEl
.
querySelector
(
'.ant-table-body'
);
bodyEl
=
tableEl
.
querySelector
(
'.ant-table-body'
);
if
(
!
bodyEl
)
return
;
}
}
const
hasScrollBarY
=
bodyEl
.
scrollHeight
>
bodyEl
.
clientHeight
;
const
hasScrollBarY
=
bodyEl
.
scrollHeight
>
bodyEl
.
clientHeight
;
...
...
src/hooks/core/useRefs.ts
浏览文件 @
9035fd19
import
{
ref
,
onBeforeUpdate
,
Ref
}
from
'vue'
;
import
type
{
Ref
}
from
'vue'
;
import
{
ref
,
onBeforeUpdate
}
from
'vue'
;
export
function
useRefs
():
[
Ref
<
HTMLElement
[]
>
,
(
index
:
number
)
=>
(
el
:
HTMLElement
)
=>
void
]
{
export
function
useRefs
():
[
Ref
<
HTMLElement
[]
>
,
(
index
:
number
)
=>
(
el
:
HTMLElement
)
=>
void
]
{
const
refs
=
ref
<
HTMLElement
[]
>
([])
;
const
refs
=
ref
([])
as
Ref
<
HTMLElement
[]
>
;
onBeforeUpdate
(()
=>
{
onBeforeUpdate
(()
=>
{
refs
.
value
=
[];
refs
.
value
=
[];
...
...
src/hooks/event/useEventListener.ts
浏览文件 @
9035fd19
import
type
{
Ref
}
from
'vue'
;
import
type
{
Ref
}
from
'vue'
;
import
{
ref
,
watch
,
unref
}
from
'vue'
;
import
{
ref
,
watch
,
unref
}
from
'vue'
;
import
{
useThrottleFn
,
useDebounceFn
}
from
'@vueuse/core'
;
import
{
useThrottleFn
,
useDebounceFn
}
from
'@vueuse/core'
;
export
type
RemoveEventFn
=
()
=>
void
;
export
type
RemoveEventFn
=
()
=>
void
;
export
interface
UseEventParams
{
export
interface
UseEventParams
{
el
?:
Element
|
Ref
<
Element
|
undefined
>
|
Window
|
any
;
el
?:
Element
|
Ref
<
Element
|
undefined
>
|
Window
|
any
;
name
:
string
;
name
:
string
;
...
@@ -28,7 +26,7 @@ export function useEventListener({
...
@@ -28,7 +26,7 @@ export function useEventListener({
const
isAddRef
=
ref
(
false
);
const
isAddRef
=
ref
(
false
);
if
(
el
)
{
if
(
el
)
{
const
element
:
Ref
<
Element
>
=
ref
(
el
as
Element
)
;
const
element
=
ref
(
el
as
Element
)
as
Ref
<
Element
>
;
const
handler
=
isDebounce
?
useDebounceFn
(
listener
,
wait
)
:
useThrottleFn
(
listener
,
wait
);
const
handler
=
isDebounce
?
useDebounceFn
(
listener
,
wait
)
:
useThrottleFn
(
listener
,
wait
);
const
realHandler
=
wait
?
handler
:
listener
;
const
realHandler
=
wait
?
handler
:
listener
;
...
...
src/hooks/web/useECharts.ts
浏览文件 @
9035fd19
import
type
{
EChartsOption
}
from
'echarts'
;
import
type
{
EChartsOption
}
from
'echarts'
;
import
type
{
Ref
}
from
'vue'
;
import
type
{
Ref
}
from
'vue'
;
import
{
useTimeoutFn
}
from
'/@/hooks/core/useTimeout'
;
import
{
useTimeoutFn
}
from
'/@/hooks/core/useTimeout'
;
import
{
tryOnUnmounted
}
from
'@vueuse/core'
;
import
{
tryOnUnmounted
}
from
'@vueuse/core'
;
import
{
unref
,
nextTick
,
watch
,
computed
,
ref
}
from
'vue'
;
import
{
unref
,
nextTick
,
watch
,
computed
,
ref
}
from
'vue'
;
import
{
useDebounceFn
}
from
'@vueuse/core'
;
import
{
useDebounceFn
}
from
'@vueuse/core'
;
import
{
useEventListener
}
from
'/@/hooks/event/useEventListener'
;
import
{
useEventListener
}
from
'/@/hooks/event/useEventListener'
;
import
{
useBreakpoint
}
from
'/@/hooks/event/useBreakpoint'
;
import
{
useBreakpoint
}
from
'/@/hooks/event/useBreakpoint'
;
import
echarts
from
'/@/utils/lib/echarts'
;
import
echarts
from
'/@/utils/lib/echarts'
;
import
{
useRootSetting
}
from
'/@/hooks/setting/useRootSetting'
;
import
{
useRootSetting
}
from
'/@/hooks/setting/useRootSetting'
;
...
@@ -18,19 +16,19 @@ export function useECharts(
...
@@ -18,19 +16,19 @@ export function useECharts(
const
{
getDarkMode
}
=
useRootSetting
();
const
{
getDarkMode
}
=
useRootSetting
();
let
chartInstance
:
echarts
.
ECharts
|
null
=
null
;
let
chartInstance
:
echarts
.
ECharts
|
null
=
null
;
let
resizeFn
:
Fn
=
resize
;
let
resizeFn
:
Fn
=
resize
;
const
cacheOptions
=
ref
<
EChartsOption
>
({})
;
const
cacheOptions
=
ref
({})
as
Ref
<
EChartsOption
>
;
let
removeResizeFn
:
Fn
=
()
=>
{};
let
removeResizeFn
:
Fn
=
()
=>
{};
resizeFn
=
useDebounceFn
(
resize
,
200
);
resizeFn
=
useDebounceFn
(
resize
,
200
);
const
getOptions
=
computed
(()
:
EChartsOption
=>
{
const
getOptions
=
computed
(()
=>
{
if
(
getDarkMode
.
value
!==
'dark'
)
{
if
(
getDarkMode
.
value
!==
'dark'
)
{
return
cacheOptions
.
value
;
return
cacheOptions
.
value
as
EChartsOption
;
}
}
return
{
return
{
backgroundColor
:
'transparent'
,
backgroundColor
:
'transparent'
,
...
cacheOptions
.
value
,
...
cacheOptions
.
value
,
};
}
as
EChartsOption
;
});
});
function
initCharts
(
t
=
theme
)
{
function
initCharts
(
t
=
theme
)
{
...
...
src/utils/is.ts
浏览文件 @
9035fd19
...
@@ -84,7 +84,7 @@ export function isElement(val: unknown): val is Element {
...
@@ -84,7 +84,7 @@ export function isElement(val: unknown): val is Element {
return
isObject
(
val
)
&&
!!
val
.
tagName
;
return
isObject
(
val
)
&&
!!
val
.
tagName
;
}
}
export
function
isMap
(
val
:
unknown
):
val
is
Map
{
export
function
isMap
(
val
:
unknown
):
val
is
Map
<
any
,
any
>
{
return
is
(
val
,
'Map'
);
return
is
(
val
,
'Map'
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论