Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zuiqiangwanggong
vue-vben-admin
提交
9035fd19
V
vue-vben-admin
项目概览
zuiqiangwanggong
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
9035fd19
编写于
8月 13, 2021
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(types): fix some type errors
上级
bb89c505
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
24 addition
and
25 deletion
+24
-25
src/components/FlowChart/src/FlowChart.vue
src/components/FlowChart/src/FlowChart.vue
+4
-3
src/components/Loading/src/useLoading.ts
src/components/Loading/src/useLoading.ts
+1
-1
src/components/Preview/src/Functional.vue
src/components/Preview/src/Functional.vue
+6
-6
src/components/Table/src/BasicTable.vue
src/components/Table/src/BasicTable.vue
+2
-2
src/components/Table/src/components/settings/ColumnSetting.vue
...omponents/Table/src/components/settings/ColumnSetting.vue
+1
-1
src/components/Table/src/hooks/useTableScroll.ts
src/components/Table/src/hooks/useTableScroll.ts
+1
-0
src/hooks/core/useRefs.ts
src/hooks/core/useRefs.ts
+3
-2
src/hooks/event/useEventListener.ts
src/hooks/event/useEventListener.ts
+1
-3
src/hooks/web/useECharts.ts
src/hooks/web/useECharts.ts
+4
-6
src/utils/is.ts
src/utils/is.ts
+1
-1
未找到文件。
src/components/FlowChart/src/FlowChart.vue
浏览文件 @
9035fd19
...
...
@@ -8,6 +8,7 @@
</div>
</
template
>
<
script
lang=
"ts"
>
import
type
{
Ref
}
from
'
vue
'
;
import
type
{
Definition
}
from
'
@logicflow/core
'
;
import
{
defineComponent
,
ref
,
onMounted
,
unref
,
nextTick
,
computed
,
watch
}
from
'
vue
'
;
import
FlowChartToolbar
from
'
./FlowChartToolbar.vue
'
;
...
...
@@ -46,10 +47,10 @@
},
},
setup
(
props
)
{
const
lfElRef
=
ref
<
ElRef
>
(
null
);
const
graphData
=
ref
<
Recordable
>
({});
const
lfElRef
=
ref
(
null
);
const
graphData
=
ref
({});
const
lfInstance
=
ref
<
Nullable
<
LogicFlow
>>
(
null
)
;
const
lfInstance
=
ref
(
null
)
as
Ref
<
LogicFlow
|
null
>
;
const
{
prefixCls
}
=
useDesign
(
'
flow-chart
'
);
const
appStore
=
useAppStore
();
...
...
src/components/Loading/src/useLoading.ts
浏览文件 @
9035fd19
...
...
@@ -32,7 +32,7 @@ export function useLoading(
const
instance
=
createLoading
(
props
,
undefined
,
true
);
const
open
=
():
void
=>
{
const
t
=
unref
(
target
);
const
t
=
unref
(
target
as
Ref
<
ElRef
>
);
if
(
!
t
)
return
;
instance
.
open
(
t
);
};
...
...
src/components/Preview/src/Functional.vue
浏览文件 @
9035fd19
<
script
lang=
"tsx"
>
import
{
defineComponent
,
ref
,
unref
,
computed
,
reactive
,
watchEffect
}
from
'
vue
'
;
import
{
Props
}
from
'
./typing
'
;
import
{
CloseOutlined
,
LeftOutlined
,
RightOutlined
}
from
'
@ant-design/icons-vue
'
;
import
resumeSvg
from
'
/@/assets/svg/preview/resume.svg
'
;
import
rotateSvg
from
'
/@/assets/svg/preview/p-rotate.svg
'
;
...
...
@@ -57,7 +56,7 @@
name
:
'
ImagePreview
'
,
props
,
emits
:
[
'
img-load
'
,
'
img-error
'
],
setup
(
props
:
Props
,
{
expose
,
emit
})
{
setup
(
props
,
{
expose
,
emit
})
{
interface
stateInfo
{
scale
:
number
;
rotate
:
number
;
...
...
@@ -117,8 +116,9 @@
}
const
getScaleStep
=
computed
(()
=>
{
if
(
props
.
scaleStep
>
0
&&
props
.
scaleStep
<
100
)
{
return
props
.
scaleStep
/
100
;
const
scaleStep
=
props
?.
scaleStep
??
0
;
if
(
scaleStep
??
(
0
>
0
&&
scaleStep
<
100
))
{
return
scaleStep
/
100
;
}
else
{
return
imgState
.
imgScale
/
10
;
}
...
...
@@ -164,7 +164,7 @@
img
.
src
=
url
;
img
.
onload
=
(
e
:
Event
)
=>
{
if
(
imgState
.
currentUrl
!==
url
)
{
const
ele
:
HTMLElement
[]
=
e
.
composedPath
();
const
ele
:
any
[]
=
e
.
composedPath
();
if
(
props
.
rememberState
)
{
// 保存当前图片的缩放信息
stateMap
.
set
(
imgState
.
currentUrl
,
{
...
...
@@ -244,7 +244,7 @@
setRotate
:
(
rotate
:
number
)
=>
{
imgState
.
imgRotate
=
rotate
;
},
}
as
PreviewActions
);
});
// 上一页下一页
function
handleChange
(
direction
:
'
left
'
|
'
right
'
)
{
...
...
src/components/Table/src/BasicTable.vue
浏览文件 @
9035fd19
...
...
@@ -91,10 +91,10 @@
'
columns-change
'
,
],
setup
(
props
,
{
attrs
,
emit
,
slots
,
expose
})
{
const
tableElRef
=
ref
<
ComponentRef
>
(
null
);
const
tableElRef
=
ref
(
null
);
const
tableData
=
ref
<
Recordable
[]
>
([]);
const
wrapRef
=
ref
<
Nullable
<
HTMLDivElement
>>
(
null
);
const
wrapRef
=
ref
(
null
);
const
innerPropsRef
=
ref
<
Partial
<
BasicTableProps
>>
();
const
{
prefixCls
}
=
useDesign
(
'
basic-table
'
);
...
...
src/components/Table/src/components/settings/ColumnSetting.vue
浏览文件 @
9035fd19
...
...
@@ -282,7 +282,7 @@
nextTick
(()
=>
{
const
columnListEl
=
unref
(
columnListRef
);
if
(
!
columnListEl
)
return
;
const
el
=
columnListEl
.
$el
;
const
el
=
columnListEl
.
$el
as
any
;
if
(
!
el
)
return
;
// Drag and drop sort
const
{
initSortable
}
=
useSortable
(
el
,
{
...
...
src/components/Table/src/hooks/useTableScroll.ts
浏览文件 @
9035fd19
...
...
@@ -66,6 +66,7 @@ export function useTableScroll(
if
(
!
bodyEl
)
{
bodyEl
=
tableEl
.
querySelector
(
'
.ant-table-body
'
);
if
(
!
bodyEl
)
return
;
}
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
]
{
const
refs
=
ref
<
HTMLElement
[]
>
([])
;
const
refs
=
ref
([])
as
Ref
<
HTMLElement
[]
>
;
onBeforeUpdate
(()
=>
{
refs
.
value
=
[];
...
...
src/hooks/event/useEventListener.ts
浏览文件 @
9035fd19
import
type
{
Ref
}
from
'
vue
'
;
import
{
ref
,
watch
,
unref
}
from
'
vue
'
;
import
{
useThrottleFn
,
useDebounceFn
}
from
'
@vueuse/core
'
;
export
type
RemoveEventFn
=
()
=>
void
;
export
interface
UseEventParams
{
el
?:
Element
|
Ref
<
Element
|
undefined
>
|
Window
|
any
;
name
:
string
;
...
...
@@ -28,7 +26,7 @@ export function useEventListener({
const
isAddRef
=
ref
(
false
);
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
realHandler
=
wait
?
handler
:
listener
;
...
...
src/hooks/web/useECharts.ts
浏览文件 @
9035fd19
import
type
{
EChartsOption
}
from
'
echarts
'
;
import
type
{
Ref
}
from
'
vue
'
;
import
{
useTimeoutFn
}
from
'
/@/hooks/core/useTimeout
'
;
import
{
tryOnUnmounted
}
from
'
@vueuse/core
'
;
import
{
unref
,
nextTick
,
watch
,
computed
,
ref
}
from
'
vue
'
;
import
{
useDebounceFn
}
from
'
@vueuse/core
'
;
import
{
useEventListener
}
from
'
/@/hooks/event/useEventListener
'
;
import
{
useBreakpoint
}
from
'
/@/hooks/event/useBreakpoint
'
;
import
echarts
from
'
/@/utils/lib/echarts
'
;
import
{
useRootSetting
}
from
'
/@/hooks/setting/useRootSetting
'
;
...
...
@@ -18,19 +16,19 @@ export function useECharts(
const
{
getDarkMode
}
=
useRootSetting
();
let
chartInstance
:
echarts
.
ECharts
|
null
=
null
;
let
resizeFn
:
Fn
=
resize
;
const
cacheOptions
=
ref
<
EChartsOption
>
({})
;
const
cacheOptions
=
ref
({})
as
Ref
<
EChartsOption
>
;
let
removeResizeFn
:
Fn
=
()
=>
{};
resizeFn
=
useDebounceFn
(
resize
,
200
);
const
getOptions
=
computed
(()
:
EChartsOption
=>
{
const
getOptions
=
computed
(()
=>
{
if
(
getDarkMode
.
value
!==
'
dark
'
)
{
return
cacheOptions
.
value
;
return
cacheOptions
.
value
as
EChartsOption
;
}
return
{
backgroundColor
:
'
transparent
'
,
...
cacheOptions
.
value
,
};
}
as
EChartsOption
;
});
function
initCharts
(
t
=
theme
)
{
...
...
src/utils/is.ts
浏览文件 @
9035fd19
...
...
@@ -84,7 +84,7 @@ export function isElement(val: unknown): val is Element {
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
'
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录