Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
b0c968e6
提交
b0c968e6
authored
5月 31, 2022
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
展位选择修改
上级
fdc6fe60
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
214 行增加
和
35 行删除
+214
-35
TableSelectNormal.js
one_stop_public/libs/Split/TableSelectNormal.js
+57
-0
TableSelectZhanWei.js
one_stop_public/libs/Split/TableSelectZhanWei.js
+89
-0
styles.less
one_stop_public/libs/Split/styles.less
+47
-0
TableSelect.js
one_stop_public/libs/TableSelect.js
+21
-35
没有找到文件。
one_stop_public/libs/Split/TableSelectNormal.js
0 → 100644
浏览文件 @
b0c968e6
import
React
,
{
Fragment
,
useEffect
,
useRef
,
useState
}
from
'react'
;
import
{
Button
,
Table
}
from
'antd'
;
import
TableSelectZhanWei
from
'@/webPublic/one_stop_public/libs/Split/TableSelectZhanWei'
;
export
default
function
TableSelectNormal
(
props
)
{
const
{
isMultiple
,
isShowQuanXuan
,
selectAll
,
cancelAll
,
valueName
,
dataSource
,
columns3
,
allWidth
,
get
,
otherProps
,
}
=
props
;
const
[
thisOtherProps
,
setThisOtherProps
]
=
useState
(
null
);
useEffect
(()
=>
{
if
(
otherProps
&&
otherProps
.
length
)
{
try
{
let
thisOtherPropsN
=
new
Function
(
otherProps
)();
setThisOtherProps
(
thisOtherPropsN
);
}
catch
(
e
)
{
}
}
},
[
otherProps
]);
if
(
thisOtherProps
&&
thisOtherProps
.
showType
===
'card-select'
){
return
<
TableSelectZhanWei
{...
props
}
otherProps
=
{
thisOtherProps
}
/>
;
}
return
(
<
Fragment
>
{
isMultiple
&&
isShowQuanXuan
!==
false
&&
(
<>
{
' '
}
<
Button
id
=
{
'quanXuanButton'
}
type
=
{
'primary'
}
style
=
{{
margin
:
'0 10px 10px 0'
}}
onClick
=
{
selectAll
}
>
全选
<
/Button
>
<
Button
id
=
{
'quXiaoQuanXuanButton'
}
type
=
{
'primary'
}
style
=
{{
marginBottom
:
'10px'
}}
onClick
=
{
cancelAll
}
>
取消全选
<
/Button
>
<
/
>
)}
<
Table
rowKey
=
{
valueName
}
size
=
'small'
dataSource
=
{
dataSource
.
list
}
columns
=
{
columns3
}
scroll
=
{{
x
:
get
===
'mobile'
?
'max-content'
:
allWidth
}}
/
>
<
/Fragment
>
);
}
one_stop_public/libs/Split/TableSelectZhanWei.js
0 → 100644
浏览文件 @
b0c968e6
/**
* 钟是志
* 2022年5月31日
* 禅道需求定制化
* 27141 [黔南]门户---单位个人中心,,双选会申请可视化展示,,发布到门户后,在邀请函页面也可视化展示
* */
import
React
,
{
Fragment
}
from
'react'
;
import
{
Tag
,
Radio
}
from
'antd'
;
import
styles
from
'./styles.less'
;
export
default
function
TableSelectZhanWei
(
props
)
{
const
{
isMultiple
,
isShowQuanXuan
,
selectAll
,
cancelAll
,
valueName
,
dataSource
,
columns3
,
allWidth
,
get
,
otherProps
,
callback
,
selects
}
=
props
;
const
{
headerInfoFields
,
rowKey
,
prefixName
=
''
,
statusKey
,
canSelectKeys
=
[],
typeList
=
[],
}
=
otherProps
;
// console.log(otherProps, dataSource.list);
if
(
!
dataSource
||
!
dataSource
.
list
||
!
dataSource
.
list
.
length
)
{
return
<
div
>
暂无可选数据
<
/div>
;
}
const
data
=
dataSource
.
list
;
const
selectItem
=
(
selectData
)
=>
{
callback
(
selectData
);
}
// console.log(selects);
return
<
div
className
=
{
styles
.
zhanWei
}
>
{
headerInfoFields
&&
headerInfoFields
.
length
&&
<
div
className
=
{
styles
.
header
}
>
{
headerInfoFields
.
map
((
g
)
=>
{
return
<
span
key
=
{
g
.
key
}
>
{
g
.
label
}
:
{
data
[
0
][
g
.
key
]}
<
/span>
;
})}
<
/div
>
}
<
div
className
=
{
styles
.
list
}
>
{
data
.
map
((
item
,
index
)
=>
{
const
status
=
item
[
statusKey
];
const
defaultChecked
=
canSelectKeys
.
includes
(
status
+
''
);
const
typeConfig
=
typeList
[
status
+
''
]
||
{};
const
nowSelect
=
!!
selects
[
item
[
rowKey
]];
return
<
div
className
=
{
styles
.
item
}
key
=
{
item
[
rowKey
]}
>
<
div
className
=
{
styles
.
itemHead
}
>
<
div
>
<
Radio
disabled
=
{
!
defaultChecked
}
checked
=
{
!
defaultChecked
||
nowSelect
}
onChange
=
{(
e
)
=>
{
selectItem
(
item
);
}}
>
<
/Radio
>
<
/div
>
<
div
className
=
{
styles
.
statusTag
}
>
<
Tag
color
=
{
typeConfig
.
color
}
>
{
typeConfig
.
text
}
<
/Tag
>
<
/div
>
<
/div
>
<
div
className
=
{
styles
.
name
}
>
{
prefixName
+
item
.
booth_no_name
}
<
/div
>
<
/div>
;
})
}
<
/div
>
<
/div>
;
}
one_stop_public/libs/Split/styles.less
0 → 100644
浏览文件 @
b0c968e6
.zhanWei{
//padding: 10px;
.header{
background-color: #EEF5FB;
color: #000;
display: grid;
padding: 10px;
min-height: 32px;
font-size: 16px;
grid-template-columns: repeat(auto-fill, 50%);
}
.list{
display: grid;
grid-template-columns: repeat(auto-fill, 30%);
column-gap: 15px;
row-gap: 15px;
max-height: 50vh;
overflow-y: auto;
margin-top: 20px;
.item{
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 20px 1fr;
height: 70px;
align-items: center;
justify-items: center;
border: 1px solid #e6e6e6;
border-radius: 2px;
padding: 5px;
.itemHead{
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr;
font-size: 12px;
justify-items: start;
width: 100%;
}
.statusTag{
justify-self: end;
}
.name{
font-weight: bold;
font-size: 16px;
}
}
}
}
one_stop_public/libs/TableSelect.js
浏览文件 @
b0c968e6
...
...
@@ -3,6 +3,7 @@ import { Button, message, Table, Tag } from "antd";
import
FormList
from
"./formList/index"
;
import
{
connect
}
from
"dva"
;
import
{
getModal
}
from
'@/webPublic/one_stop_public/utils/utils'
;
import
TableSelectNormal
from
'@/webPublic/one_stop_public/libs/Split/TableSelectNormal'
;
const
Modal
=
getModal
();
@
connect
(({
DataColumn
,
SqlManageEntity
,
loading
})
=>
({
...
...
@@ -164,7 +165,7 @@ export default class TableSelect extends React.Component {
render
()
{
const
{
json
:
{
isMultiple
,
sql
,
optionType
,
showTable
,
isShowQuanXuan
},
json
:
{
isMultiple
,
sql
,
optionType
,
showTable
,
isShowQuanXuan
,
otherProps
},
dataColumn
:
{
referenceObjId
},
sqlModel
,
columns
,
...
...
@@ -238,11 +239,9 @@ export default class TableSelect extends React.Component {
});
}
// console.log(this.props);
// console.log('-0000 TableSelect000');
return
(
<
div
>
{
Object
.
keys
(
selects
).
length
>
0
?
(
{
Object
.
keys
(
selects
).
length
>
0
?
(
// 是否显示表格
showTable
?
(
<
Table
rowKey
=
{
valueName
}
...
...
@@ -273,9 +272,11 @@ export default class TableSelect extends React.Component {
maskClosable
=
{
false
}
title
=
{
`请选择`
}
visible
=
{
visiable
}
onOk
=
{
this
.
closeModal
}
onCancel
=
{
this
.
closeModal
}
>
{
optionType
==
'reference'
?
(
footer
=
{
null
}
// onOk={this.closeModal}
onCancel
=
{
this
.
closeModal
}
>
{
optionType
===
'reference'
?
(
referenceObjId
?
(
<
FormList
rights
=
{
this
.
props
.
rights
||
[]}
...
...
@@ -306,35 +307,20 @@ export default class TableSelect extends React.Component {
sql
=
{
sql
}
/
>
)
:
(
<>
{
isMultiple
&&
isShowQuanXuan
!==
false
&&
(
<>
{
' '
}
<
Button
id
=
{
'quanXuanButton'
}
type
=
{
'primary'
}
style
=
{{
margin
:
'0 10px 10px 0'
}}
onClick
=
{
this
.
selectAll
}
>
全选
<
/Button
>
<
Button
id
=
{
'quXiaoQuanXuanButton'
}
type
=
{
'primary'
}
style
=
{{
marginBottom
:
'10px'
}}
onClick
=
{
this
.
cancelAll
}
>
取消全选
<
/Button
>
<
/
>
)}
<
TableSelectNormal
isMultiple
=
{
isMultiple
}
allWidth
=
{
allWidth
}
cancelAll
=
{
this
.
cancelAll
}
selectAll
=
{
this
.
selectAll
}
isShowQuanXuan
=
{
isShowQuanXuan
}
valueName
=
{
valueName
}
dataSource
=
{
dataSource
}
columns3
=
{
columns3
}
otherProps
=
{
otherProps
}
get
=
{
this
.
props
.
get
}
selects
=
{
this
.
state
.
selects
}
callback
=
{
this
.
select
}
<
Table
rowKey
=
{
valueName
}
size
=
"small"
dataSource
=
{
dataSource
.
list
}
columns
=
{
columns3
}
scroll
=
{{
x
:
this
.
props
.
get
===
'mobile'
?
'max-content'
:
allWidth
}}
/
>
<
/
>
/
>
)}
<
/Modal
>
)}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论