Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
dc429174
提交
dc429174
authored
4月 27, 2020
作者:
徐立
浏览文件
操作
浏览文件
下载
差异文件
合并
上级
a89aec50
7a1d69de
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
167 行增加
和
53 行删除
+167
-53
index.js
FormInsertDiy/MyApplyList/index.js
+2
-0
index.jsx
one_stop_public/Table/index.jsx
+92
-42
maintain.png
one_stop_public/assets/maintain.png
+0
-0
FormModal.jsx
one_stop_public/tableCompon/FormModal.jsx
+28
-0
index.jsx
one_stop_public/tableCompon/index.jsx
+45
-11
没有找到文件。
FormInsertDiy/MyApplyList/index.js
浏览文件 @
dc429174
...
...
@@ -23,6 +23,7 @@ export default function MyApplyList({
fileSpan
=
defaultFieldSpan
,
tableRowKey
=
'buzinessId'
,
columns
=
[],
scroll
,
})
{
const
pageSearch
=
{
search
:
{
...
...
@@ -39,6 +40,7 @@ export default function MyApplyList({
nameSpan
,
fileSpan
,
},
scroll
,
tableRowKey
,
columns
,
};
...
...
one_stop_public/Table/index.jsx
浏览文件 @
dc429174
...
...
@@ -11,11 +11,14 @@ import { Toast } from 'antd-mobile'
import
router
from
'umi/router'
import
IsNewTable
from
'./isNewMobileTable'
;
import
NewWebTable
from
'./isNewWebTable'
;
import
maintain
from
'../assets/maintain.png'
import
moment
from
'moment'
export
default
class
ZdyTable
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
state
=
{
selects
:
new
Map
(),
left
:
0
,
top
:
0
,
...
...
@@ -34,10 +37,11 @@ export default class ZdyTable extends Component {
isEdit
:
true
,
isReady
:
false
,
formConfig
:
{},
}
}
componentDidMount
(){
componentDidMount
()
{
let
{
postData
,
// 数据源
isCg
,
// 用户点击草稿页面进入
...
...
@@ -356,7 +360,7 @@ export default class ZdyTable extends Component {
})
return
max
}
render
()
{
let
{
width
,
...
...
@@ -367,6 +371,7 @@ export default class ZdyTable extends Component {
defaultValues
,
items
,
init
,
modalTitle
,
currentFormKey
,
isEdit
,
datas
,
...
...
@@ -383,6 +388,8 @@ export default class ZdyTable extends Component {
fatherCode
,
routerState
,
// 场景设计器共享路由参数
messageData
,
// 场景设计器共享变量参数 设计器监听到参数发生变化后会重新渲染组件
postData
,
modalInit
,
}
=
this
.
props
let
style
=
{}
if
(
formConfig
.
style
!=
null
)
{
...
...
@@ -416,33 +423,55 @@ export default class ZdyTable extends Component {
borderLeft
:
"1px solid gray"
,
borderTop
:
"1px solid gray"
}
let
updateTime
const
styleDiv
=
this
.
props
.
height
?
{
overflow
:
"auto"
,
width
:
"100%"
,
height
:
this
.
props
.
height
}
:
{
overflow
:
"auto"
,
width
:
"100%"
}
if
(
!
isReady
)
return
<></>
if
(
this
.
props
.
postData
?.
isUpdate
)
{
updateTime
=
moment
(
+
this
.
props
.
postData
?.
updateTime
).
format
(
'llll'
)
}
switch
(
get
)
{
case
'web'
:
return
(
<
Form
className=
"login-form"
>
{
isEdit
&&
defaultBinds
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
const
r
=
defaultBinds
[
k
]
if
(
r
.
columnIds
==
null
||
r
.
columnIds
.
length
<
2
||
r
.
sqls
==
null
||
r
.
sqls
.
length
<
2
)
{
return
""
}
const
name
=
r
.
columnIds
[
r
.
columnIds
.
length
-
1
]
const
key
=
r
.
sqls
[
r
.
sqls
.
length
-
1
]
const
value
=
defaultValues
[
key
]
if
(
value
==
null
)
{
return
""
}
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
})(<
Input
type=
"hidden"
/>);
})
:
""
}
return
(<>
{
this
.
props
.
postData
?.
isUpdate
?
<
div
style=
{
{
margin
:
'100px 24px 24px'
}
}
>
<
div
style=
{
{
textAlign
:
'center'
}
}
>
<
img
style=
{
{
marginRight
:
30
}
}
src=
{
maintain
}
></
img
>
</
div
>
<
p
style=
{
{
textAlign
:
"center"
,
width
:
'100%'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
,
color
:
'#666666'
,
}
}
>
{
updateTime
!==
'Invalid date'
?
`升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。`
:
'请耐心等待'
}
</
p
>
</
div
>
:<
Form
className=
"login-form"
>
{
isEdit
&&
defaultBinds
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
const
r
=
defaultBinds
[
k
]
if
(
r
.
columnIds
==
null
||
r
.
columnIds
.
length
<
2
||
r
.
sqls
==
null
||
r
.
sqls
.
length
<
2
)
{
return
""
}
const
name
=
r
.
columnIds
[
r
.
columnIds
.
length
-
1
]
const
key
=
r
.
sqls
[
r
.
sqls
.
length
-
1
]
const
value
=
defaultValues
[
key
]
if
(
value
==
null
)
{
return
""
}
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
})(<
Input
type=
"hidden"
/>);
})
:
""
}
<
Row
>
<
Col
span=
{
24
}
>
...
...
@@ -567,22 +596,43 @@ export default class ZdyTable extends Component {
</
Row
>
</
Form
>
)
}
</>)
case
'mobile'
:
return
(
<
Form
{
...
formItemLayout
}
id=
'mobile_table'
className=
"login-form"
>
{
defaultBinds
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
const
r
=
defaultBinds
[
k
]
if
(
r
.
columnIds
==
null
||
r
.
columnIds
.
length
<
2
||
r
.
sqls
==
null
||
r
.
sqls
.
length
<
2
)
{
return
""
}
const
name
=
r
.
columnIds
[
r
.
columnIds
.
length
-
1
]
const
key
=
r
.
sqls
[
r
.
sqls
.
length
-
1
]
const
value
=
defaultValues
[
key
]
if
(
value
==
null
)
{
return
""
}
return
(<>
{
this
.
props
.
postData
?.
isUpdate
?
<
div
style=
{
{
margin
:
'100px 24px 24px'
}
}
>
<
div
style=
{
{
textAlign
:
'center'
}
}
>
<
img
style=
{
{
width
:
'100%'
}
}
src=
{
maintain
}
></
img
>
</
div
>
<
p
style=
{
{
textAlign
:
"center"
,
width
:
'100%'
,
fontSize
:
'16px'
,
fontWeight
:
'bold'
,
color
:
'#666666'
,
}
}
>
{
updateTime
!==
'Invalid date'
?
`升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。`
:
'请耐心等待'
}
</
p
>
</
div
>
:
<
Form
{
...
formItemLayout
}
id=
'mobile_table'
className=
"login-form"
>
{
defaultBinds
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
const
r
=
defaultBinds
[
k
]
if
(
r
.
columnIds
==
null
||
r
.
columnIds
.
length
<
2
||
r
.
sqls
==
null
||
r
.
sqls
.
length
<
2
)
{
return
""
}
const
name
=
r
.
columnIds
[
r
.
columnIds
.
length
-
1
]
const
key
=
r
.
sqls
[
r
.
sqls
.
length
-
1
]
const
value
=
defaultValues
[
key
]
if
(
value
==
null
)
{
return
""
}
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
...
...
@@ -661,7 +711,7 @@ export default class ZdyTable extends Component {
})
} */
}
</
Form
>
)
}
</>
)
}
}
}
one_stop_public/assets/maintain.png
0 → 100644
浏览文件 @
dc429174
58.8 KB
one_stop_public/tableCompon/FormModal.jsx
0 → 100644
浏览文件 @
dc429174
import
React
,
{
Children
}
from
"react"
;
import
{
Button
,
Form
,
Input
,
InputNumber
,
Modal
,
Select
}
from
"antd"
;
export
default
class
FormModal
extends
React
.
Component
{
render
()
{
return
(
<
Modal
destroyOnClose
title=
{
this
.
props
.
title
}
maskClosable=
{
false
}
visible=
{
this
.
props
.
visible
}
footer=
{
null
}
onCancel=
{
this
.
props
.
handleCancel
}
>
{
this
.
props
.
children
}
</
Modal
>
);
}
}
\ No newline at end of file
one_stop_public/tableCompon/index.jsx
浏览文件 @
dc429174
...
...
@@ -5,6 +5,7 @@
*/
import
React
,
{
Component
}
from
'react'
;
import
md5
from
'js-md5'
;
import
FormModal
from
'./FormModal'
import
{
message
,
Icon
,
...
...
@@ -140,14 +141,23 @@ export default class tableCom extends Component {
sqlModel
:
{},
columns
:
[],
sqlContent
:
null
,
isShowModal
:
false
,
modalTitle
:
""
,
modalInit
:{},
modalCode
:
null
,
dataSource
:
{
list
:
[],
pagination
:
false
},
};
excludeKeys
=
[
"defaultValues"
,
""
]
handleCancel
=
()
=>
{
this
.
setState
({
isShowModal
:
false
})
}
showModal
=
(
fk
,
title
,
data
)
=>
{
this
.
setState
({
isShowModal
:
true
,
modalInit
:
data
,
modalTitle
:
title
,
modalCode
:
fk
})
}
equal
=
(
obj1
,
obj2
,
json
,
sqlContent
,
depth
)
=>
{
...
...
@@ -1111,11 +1121,13 @@ export default class tableCom extends Component {
}
getFunctionValue
=
(
fun
,
column
,
json
,
callback
)
=>
{
/* if (!this.props.isEdit) {
return
} */
const
base52
=
column
.
base52
/**
* 中台函数库注入
* 动态生成表单配置函数所使用
...
...
@@ -1127,7 +1139,7 @@ export default class tableCom extends Component {
})
})
try
{
var
fun1
=
new
Function
(
"obj"
,
"init"
,
"defaultValues"
,
"env"
,
"index"
,
"fatherCode"
,
"utils"
,
"$"
,
"routerState"
,
'shareData'
,
fun
);
var
fun1
=
new
Function
(
"obj"
,
"init"
,
"modalInit"
,
"defaultValues"
,
"env"
,
"index"
,
"fatherCode"
,
"utils"
,
"$"
,
"routerState"
,
'shareData'
,
fun
);
let
obj
if
(
!
this
.
props
.
isEdit
&&
this
.
props
.
fatherCode
){
...
...
@@ -1139,21 +1151,21 @@ export default class tableCom extends Component {
const
value
=
fun1
(
obj
,
this
.
props
.
init
,
this
.
props
.
defaultValues
,
{
clientType
:
this
.
props
.
get
,
formCode
:
this
.
props
.
formCode
,
formId
:
this
.
props
.
formId
},
this
.
props
.
index
,
this
.
props
.
fatherCode
,
const
value
=
fun1
(
obj
,
this
.
props
.
init
,
this
.
props
.
modalInit
,
this
.
props
.
defaultValues
,
{
clientType
:
this
.
props
.
get
,
formCode
:
this
.
props
.
formCode
,
formId
:
this
.
props
.
formId
},
this
.
props
.
index
,
this
.
props
.
fatherCode
,
{
moment
:
moment
,
sql
:
this
.
sqlUtil
.
bind
(
this
,
base52
,
json
,
callback
),
message
:
message
,
router
:
router
,
setValues
:
this
.
setValues
.
bind
(
this
,
base52
,
json
),
req
:
this
.
reqUtil
.
bind
(
this
,
base52
,
json
,
callback
),
md5
:
md5
,
md5
:
md5
,
showModal
:
this
.
showModal
,
render
:
this
.
getRender
,
base64
:
getBase64
,
},
functionObj
,
this
.
props
.
routerState
,
this
.
props
.
messageData
,
)
if
(
base52
)
{
if
(
value
!=
null
&&
value
==
"norefeshxxxxxxxxxxxxxxxxxxxx"
)
{
...
...
@@ -1180,7 +1192,9 @@ export default class tableCom extends Component {
this
.
setState
({
option
:
value
})
}
else
{
try
{
this
.
props
.
form
.
setFieldsValue
({
[
base52
]:
value
})
}
catch
{
console
.
log
(
`页面
${
this
.
props
.
formKey
}
第
${
this
.
props
.
i
+
1
}
行,第
${
this
.
props
.
j
+
1
}
列:公式配置有误,函数内部错误,`
,
e
)
//message.error(`页面${this.props.formKey}第${this.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,函数内部错误${e}`, 10)
...
...
@@ -1471,7 +1485,7 @@ export default class tableCom extends Component {
* obj为查看详情用户输入值
*/
let
{
json
,
obj
,
mapData
,
init
,
sqlData
,
defaultValues
,
get
,
formKey
,
isEdit
,
datas
}
=
this
.
props
;
const
{
options
,
labels
,
selectDis
}
=
this
.
state
;
const
{
options
,
labels
,
selectDis
,
modalCode
,
modalTitle
,
isShowModal
,
modalInit
}
=
this
.
state
;
const
{
getFieldDecorator
,
getFieldError
,
getFieldProps
}
=
this
.
props
.
form
;
const
disabled
=
json
!=
null
?
json
.
disabled
:
false
if
(
json
==
null
)
{
...
...
@@ -2289,6 +2303,7 @@ export default class tableCom extends Component {
}
)(
<
Input
type=
"hidden"
/>
);
break;
case 'InputNumber':
/* if (get === 'mobile')
{
cm
=
(<
div
className=
{
styles
.
form
}
><
MobileInputItem
...
...
@@ -2774,6 +2789,10 @@ export default class tableCom extends Component {
* 卡片类型
*/
return
(<
Card
style=
{
{
margin
:
5
,
border
:
'1px solid #ccc'
}
}
>
{
modalCode
?<
FormModal
visible=
{
isShowModal
}
handleCancel=
{
this
.
handleCancel
}
title=
{
modalTitle
}
>
<
ZdyTable
modalInit=
{
modalInit
}
key=
{
modalCode
}
datas=
{
datas
}
get=
{
get
}
isChild=
{
true
}
currentFormKey=
{
modalCode
}
isEdit=
{
isEdit
}
obj=
{
obj
}
init=
{
init
}
form=
{
this
.
props
.
form
}
mapData=
{
mapData
}
sqlData=
{
sqlData
}
{
...
datas
[
modalCode
]}
defaultValues=
{
defaultValues
}
/>
</
FormModal
>:
""
}
<
Card
.
Header
title=
{
<
span
style=
{
{
fontSize
:
14
}
}
>
{
title
}
:
</
span
>
}
/>
<
Card
.
Body
>
{
cm
}
...
...
@@ -2831,30 +2850,45 @@ export default class tableCom extends Component {
>
{
cm
}
</
Col
>
{
modalCode
?<
FormModal
visible=
{
isShowModal
}
handleCancel=
{
this
.
handleCancel
}
title=
{
modalTitle
}
>
<
ZdyTable
modalInit=
{
modalInit
}
key=
{
modalCode
}
datas=
{
datas
}
get=
{
get
}
isChild=
{
true
}
currentFormKey=
{
modalCode
}
isEdit=
{
isEdit
}
obj=
{
obj
}
init=
{
init
}
form=
{
this
.
props
.
form
}
mapData=
{
mapData
}
sqlData=
{
sqlData
}
{
...
datas
[
modalCode
]}
defaultValues=
{
defaultValues
}
/>
</
FormModal
>:
""
}
</
Row
>
)
}
else
{
return
(
<>
{
modalCode
?<
FormModal
visible=
{
isShowModal
}
handleCancel=
{
this
.
handleCancel
}
title=
{
modalTitle
}
>
<
ZdyTable
modalInit=
{
modalInit
}
key=
{
modalCode
}
datas=
{
datas
}
get=
{
get
}
isChild=
{
true
}
currentFormKey=
{
modalCode
}
isEdit=
{
isEdit
}
obj=
{
obj
}
init=
{
init
}
form=
{
this
.
props
.
form
}
mapData=
{
mapData
}
sqlData=
{
sqlData
}
{
...
datas
[
modalCode
]}
defaultValues=
{
defaultValues
}
/>
</
FormModal
>:
""
}
<
Form
.
Item
labelCol=
{
{
span
:
json
.
labelSpan
}
}
wrapperCol=
{
{
span
:
json
.
wrapperSpan
}
}
label=
{
title
}
>
{
cm
}
</
Form
.
Item
>
</
Form
.
Item
>
</>
)
}
}
else
{
return
cm
return
<>
{
modalCode
?<
FormModal
visible=
{
isShowModal
}
handleCancel=
{
this
.
handleCancel
}
title=
{
modalTitle
}
>
<
ZdyTable
modalInit=
{
modalInit
}
key=
{
modalCode
}
datas=
{
datas
}
get=
{
get
}
isChild=
{
true
}
currentFormKey=
{
modalCode
}
isEdit=
{
isEdit
}
obj=
{
obj
}
init=
{
init
}
form=
{
this
.
props
.
form
}
mapData=
{
mapData
}
sqlData=
{
sqlData
}
{
...
datas
[
modalCode
]}
defaultValues=
{
defaultValues
}
/>
</
FormModal
>:
""
}{
cm
}
</>
}
}
else
{
return
(
<>
{
modalCode
?<
FormModal
visible=
{
isShowModal
}
handleCancel=
{
this
.
handleCancel
}
title=
{
modalTitle
}
>
<
ZdyTable
modalInit=
{
modalInit
}
key=
{
modalCode
}
datas=
{
datas
}
get=
{
get
}
isChild=
{
true
}
currentFormKey=
{
modalCode
}
isEdit=
{
isEdit
}
obj=
{
obj
}
init=
{
init
}
form=
{
this
.
props
.
form
}
mapData=
{
mapData
}
sqlData=
{
sqlData
}
{
...
datas
[
modalCode
]}
defaultValues=
{
defaultValues
}
/>
</
FormModal
>:
""
}
<
Form
.
Item
>
{
cm
}
</
Form
.
Item
>
</
Form
.
Item
>
</>
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论