Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
sage-front-framework
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
郁骅焌
sage-front-framework
Commits
ca6810f8
提交
ca6810f8
authored
7月 02, 2020
作者:
郁骅焌
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交
上级
06ce14bc
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
35 行增加
和
15 行删除
+35
-15
proxy.js
config/proxy.js
+2
-2
index.jsx
src/components/Common/Table/index.jsx
+32
-12
global.js
src/models/global.js
+1
-1
regions.js
src/utils/regions.js
+0
-0
没有找到文件。
config/proxy.js
浏览文件 @
ca6810f8
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
export
default
{
export
default
{
dev
:
{
dev
:
{
'/ebd/'
:
{
'/ebd/'
:
{
//
target: 'http://47.103.50.109:9051',
target
:
'http://47.103.50.109:9051'
,
// target: 'http://47.103.50.109:9050',
// target: 'http://47.103.50.109:9050',
target
:
'http://192.168.1.247:8040'
,
//
target: 'http://192.168.1.247:8040',
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
'^/ebd'
:
''
,
'^/ebd'
:
''
,
...
...
src/components/Common/Table/index.jsx
浏览文件 @
ca6810f8
import
React
,
{
useEffect
,
useState
,
useImperativeHandle
,
useRef
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useImperativeHandle
,
useRef
,
useMemo
}
from
'react'
;
import
{
ConfigProvider
,
Table
,
Card
}
from
'antd'
;
import
{
ConfigProvider
,
Table
,
Card
}
from
'antd'
;
import
{
useFullscreen
}
from
'@umijs/hooks'
;
import
{
useFullscreen
}
from
'@umijs/hooks'
;
import
TableSearchForm
from
'@/components/Common/TableSearchForm'
;
import
TableSearchForm
from
'@/components/Common/TableSearchForm'
;
...
@@ -30,6 +30,7 @@ const initState = {
...
@@ -30,6 +30,7 @@ const initState = {
* 8、onMouseLeaveRow
* 8、onMouseLeaveRow
* 9、onContextMenuRow
* 9、onContextMenuRow
* 10、toolOptionConfig
* 10、toolOptionConfig
* 11、hiddeTool 隐藏工具栏
* 表格工具['reload', 'hiddensearch', 'density', 'fullScreen']
* 表格工具['reload', 'hiddensearch', 'density', 'fullScreen']
*/
*/
const
SageTable
=
React
.
forwardRef
((
props
,
ref
)
=>
{
const
SageTable
=
React
.
forwardRef
((
props
,
ref
)
=>
{
...
@@ -69,6 +70,7 @@ const SageTable = React.forwardRef((props, ref) => {
...
@@ -69,6 +70,7 @@ const SageTable = React.forwardRef((props, ref) => {
// 工具相关
// 工具相关
toolBarRender
:
toolBarRenderProps
,
toolBarRender
:
toolBarRenderProps
,
toolOptionConfig
:
toolOptionConfigProps
,
toolOptionConfig
:
toolOptionConfigProps
,
hiddeTool
=
false
,
// 其余表格属性
// 其余表格属性
...
tableProps
...
tableProps
}
=
props
;
}
=
props
;
...
@@ -239,16 +241,32 @@ const SageTable = React.forwardRef((props, ref) => {
...
@@ -239,16 +241,32 @@ const SageTable = React.forwardRef((props, ref) => {
const
paginationState
=
paginationProps
!==
undefined
?
paginationProps
:
tableState
.
pagination
;
const
paginationState
=
paginationProps
!==
undefined
?
paginationProps
:
tableState
.
pagination
;
const
loadingState
=
loadingProps
!==
undefined
?
loadingProps
:
loading
;
const
loadingState
=
loadingProps
!==
undefined
?
loadingProps
:
loading
;
// 是否有序号
// 是否有序号
const
columnsState
=
columnsProps
!==
undefined
?
columnsProps
.
slice
()
:
[];
// const columnsState = columnsProps !== undefined ? columnsProps.slice() : [];
if
(
hasNumber
)
{
columnsState
.
unshift
({
const
getLatestColumnsState
=
()
=>
{
title
:
'序号'
,
let
columnsState
=
columnsProps
!==
undefined
?
columnsProps
.
slice
()
:
[];
render
:
(
text
,
record
,
index
)
=>
// 处理列配置
`
${(
paginationState
.
current
-
1
)
*
paginationState
.
pageSize
+
index
+
1
}
`
,
if
(
hasNumber
)
{
align
:
'center'
,
columnsState
.
unshift
({
width
:
60
,
title
:
'序号'
,
});
render
:
(
text
,
record
,
index
)
=>
{
let
serialNumber
=
0
if
(
paginationState
)
{
serialNumber
=
`
${(
paginationState
.
current
-
1
)
*
paginationState
.
pageSize
+
index
+
1
}
`
}
else
{
serialNumber
=
index
+
1
}
return
serialNumber
},
align
:
'center'
,
width
:
60
,
});
}
// 隐藏hidden属性列
columnsState
=
columnsState
.
filter
(
item
=>
!
item
.
hidden
)
return
columnsState
}
}
const
latestColumnsState
=
useMemo
(()
=>
getLatestColumnsState
(),
[
props
.
columns
,
tableState
])
const
tableSearchFormProps
=
{
const
tableSearchFormProps
=
{
searchFields
:
searchFieldsProps
,
searchFields
:
searchFieldsProps
,
...
@@ -363,11 +381,13 @@ const SageTable = React.forwardRef((props, ref) => {
...
@@ -363,11 +381,13 @@ const SageTable = React.forwardRef((props, ref) => {
<
TableSearchForm
ref=
{
tableSearchFormRef
}
{
...
tableSearchFormProps
}
/>
<
TableSearchForm
ref=
{
tableSearchFormRef
}
{
...
tableSearchFormProps
}
/>
)
}
)
}
<
TableTool
tableSize=
{
tableSizeState
}
isFullscreen=
{
isFullscreen
}
{
...
tableToolProps
}
/>
{
!
hiddeTool
?
<
TableTool
tableSize=
{
tableSizeState
}
isFullscreen=
{
isFullscreen
}
{
...
tableToolProps
}
/>
:
null
}
<
Table
<
Table
size=
{
tableSizeState
}
size=
{
tableSizeState
}
columns=
{
c
olumnsState
}
columns=
{
latestC
olumnsState
}
dataSource=
{
dataSourceState
}
dataSource=
{
dataSourceState
}
pagination=
{
paginationState
}
pagination=
{
paginationState
}
loading=
{
loadingState
}
loading=
{
loadingState
}
...
...
src/models/global.js
浏览文件 @
ca6810f8
...
@@ -120,7 +120,7 @@ const GlobalModel = {
...
@@ -120,7 +120,7 @@ const GlobalModel = {
*
returnTab
({
payload
},
{
put
,
select
})
{
*
returnTab
({
payload
},
{
put
,
select
})
{
const
globalState
=
yield
select
(
state
=>
state
.
global
)
const
globalState
=
yield
select
(
state
=>
state
.
global
)
dropByCacheKey
(
payload
.
closePath
)
//
dropByCacheKey(payload.closePath)
const
tabPanes
=
globalState
.
tabPanes
.
slice
()
const
tabPanes
=
globalState
.
tabPanes
.
slice
()
let
removeIndex
;
let
removeIndex
;
...
...
src/utils/regions.js
0 → 100755
浏览文件 @
ca6810f8
This source diff could not be displayed because it is too large. You can
view the blob
instead.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论