Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
sage-front-framework
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
郁骅焌
sage-front-framework
Commits
6f518341
提交
6f518341
authored
7月 10, 2020
作者:
郁骅焌
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决多表格三元表达式组件不刷新列问题
上级
833597c2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
36 行增加
和
3 行删除
+36
-3
index.jsx
src/components/Common/Table/index.jsx
+7
-1
index.jsx
src/pages/demo/moretable/index.jsx
+29
-2
没有找到文件。
src/components/Common/Table/index.jsx
浏览文件 @
6f518341
...
@@ -302,8 +302,8 @@ const SageTable = React.forwardRef((props, ref) => {
...
@@ -302,8 +302,8 @@ const SageTable = React.forwardRef((props, ref) => {
setColumns
(
columnsTemp
);
setColumns
(
columnsTemp
);
},
[
columnsProps
,
tableState
,
allColumns
]);
},
[
columnsProps
,
tableState
,
allColumns
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
queryTable
();
const
columnsTemp
=
columnsProps
?
columnsProps
.
slice
()
:
[]
const
columnsTemp
=
columnsProps
?
columnsProps
.
slice
()
:
[]
const
hiddenIndex
=
[]
const
hiddenIndex
=
[]
columnsTemp
.
forEach
((
item
,
index
)
=>
{
columnsTemp
.
forEach
((
item
,
index
)
=>
{
...
@@ -313,6 +313,12 @@ const SageTable = React.forwardRef((props, ref) => {
...
@@ -313,6 +313,12 @@ const SageTable = React.forwardRef((props, ref) => {
})
})
setDefaultColumnIndex
(
hiddenIndex
);
setDefaultColumnIndex
(
hiddenIndex
);
setAllColumns
(
columnsTemp
);
setAllColumns
(
columnsTemp
);
},
[
columnsProps
])
useEffect
(()
=>
{
queryTable
();
},
[]);
},
[]);
const
tableSearchFormProps
=
{
const
tableSearchFormProps
=
{
...
...
src/pages/demo/moretable/index.jsx
浏览文件 @
6f518341
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
import
{
Table
}
from
'antd'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
PageHeaderWrapper
}
from
'@ant-design/pro-layout'
import
{
SageTable
,
SageModal
,
SageButton
,
SageMessage
,
ActionSet
,
SageLayoutLR
}
from
'@/components/Common'
import
{
SageTable
,
SageModal
,
SageButton
,
SageMessage
,
ActionSet
,
SageLayoutLR
}
from
'@/components/Common'
import
{
PlusOutlined
,
EditOutlined
,
DeleteOutlined
,
VerticalAlignBottomOutlined
,
VerticalAlignTopOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
,
EditOutlined
,
DeleteOutlined
,
VerticalAlignBottomOutlined
,
VerticalAlignTopOutlined
}
from
'@ant-design/icons'
;
...
@@ -277,10 +278,36 @@ const CrudList = () => {
...
@@ -277,10 +278,36 @@ const CrudList = () => {
// toolOptionConfig: ['reload', 'hiddensearch', 'density', 'fullScreen']
// toolOptionConfig: ['reload', 'hiddensearch', 'density', 'fullScreen']
}
}
const
changeStatus
=
(
value
)
=>
{
setStatus
(
value
)
}
return
(
return
(
<
PageHeaderWrapper
>
<
PageHeaderWrapper
>
<
SageButton
onClick=
{
()
=>
changeStatus
(
'add'
)
}
>
按钮1
</
SageButton
>
<
SageButton
onClick=
{
()
=>
changeStatus
(
'update'
)
}
>
按钮2
</
SageButton
>
{
status
===
''
?
null
:
status
===
'add'
?
<
SageTable
ref=
{
tableRef1
}
rowKey=
'id'
// hasNumber
// hasCheck
columns=
{
columns1
}
//request=
{(
params
)
=
>
queryCrud(params)}
/
>
: status === 'update' ?
<
SageTable
ref=
{
tableRef2
}
rowKey=
'id'
// hasNumber
// hasCheck
columns=
{
columns2
}
// request=
{(
params
)
=
>
queryCrud(params)}
/
>
: null
}
<
div
style=
{
{
display
:
'flex'
}
}
>
{
/*
<div style={{display: 'flex'}}>
<div style={{flex: 1, width: '50%'}}>
<div style={{flex: 1, width: '50%'}}>
<SageTable
<SageTable
ref={tableRef1}
ref={tableRef1}
...
@@ -299,7 +326,7 @@ const CrudList = () => {
...
@@ -299,7 +326,7 @@ const CrudList = () => {
request={(params) => queryCrud(params)}
request={(params) => queryCrud(params)}
/>
/>
</div>
</div>
</
div
>
</div>
*/
}
</
PageHeaderWrapper
>
</
PageHeaderWrapper
>
)
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论