Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
f333d3b9
提交
f333d3b9
authored
8月 17, 2020
作者:
tb53863844
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
93a0e870
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
188 行增加
和
109 行删除
+188
-109
index.jsx
one_stop_public/Table/index.jsx
+171
-107
isNewMobileTable.jsx
one_stop_public/Table/isNewMobileTable.jsx
+12
-1
index.jsx
one_stop_public/tableCompon/index.jsx
+5
-1
没有找到文件。
one_stop_public/Table/index.jsx
浏览文件 @
f333d3b9
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
*/
*/
import
React
,
{
Component
}
from
'react'
;
import
React
,
{
Component
}
from
'react'
;
import
{
Form
,
Row
,
Col
,
Input
,
message
}
from
'antd'
;
import
{
Form
,
Row
,
Col
,
Input
,
message
}
from
'antd'
;
import
UUID
from
'react-native-uuid'
;
import
{
Toast
}
from
'antd-mobile'
;
import
{
Toast
}
from
'antd-mobile'
;
import
router
from
'umi/router'
;
import
router
from
'umi/router'
;
import
moment
from
'moment'
;
import
moment
from
'moment'
;
...
@@ -30,7 +30,7 @@ export default class ZdyTable extends Component {
...
@@ -30,7 +30,7 @@ export default class ZdyTable extends Component {
sqlData
:
{},
sqlData
:
{},
defaultValues
:
{},
defaultValues
:
{},
currentFormKey
:
null
,
currentFormKey
:
null
,
currentFormTitle
:
null
,
currentFormTitle
:
null
,
items
:
[],
items
:
[],
init
:
this
.
props
.
init
||
{},
init
:
this
.
props
.
init
||
{},
datas
:
{},
datas
:
{},
...
@@ -50,6 +50,7 @@ export default class ZdyTable extends Component {
...
@@ -50,6 +50,7 @@ export default class ZdyTable extends Component {
isChild
,
// 是否为子表单
isChild
,
// 是否为子表单
isQRCode
=
false
,
// 是否为二维码快捷发起
isQRCode
=
false
,
// 是否为二维码快捷发起
formDeafault
=
''
,
// 为二维码快捷发起默认值
formDeafault
=
''
,
// 为二维码快捷发起默认值
}
=
this
.
props
;
}
=
this
.
props
;
if
(
isPreview
||
isChild
)
{
if
(
isPreview
||
isChild
)
{
...
@@ -58,8 +59,9 @@ export default class ZdyTable extends Component {
...
@@ -58,8 +59,9 @@ export default class ZdyTable extends Component {
...
this
.
props
,
...
this
.
props
,
isReady
:
true
,
isReady
:
true
,
formConfig
:
{
...
this
.
state
.
formConfig
,
style
:
this
.
props
.
style
},
formConfig
:
{
...
this
.
state
.
formConfig
,
style
:
this
.
props
.
style
},
});
this
.
initExcel
({
datas
:
this
.
props
.
datas
,
trees
:
this
.
props
.
trees
})
},()
=>
this
.
initExcel
({
datas
:
this
.
props
.
datas
,
trees
:
this
.
props
.
trees
}));
return
;
return
;
}
}
...
@@ -90,7 +92,7 @@ export default class ZdyTable extends Component {
...
@@ -90,7 +92,7 @@ export default class ZdyTable extends Component {
}
}
const
obj
=
JSON
.
parse
(
val
.
form
.
content
);
const
obj
=
JSON
.
parse
(
val
.
form
.
content
);
const
xxx
=
obj
.
datas
[
obj
.
init
];
const
xxx
=
obj
.
datas
[
obj
.
init
];
const
fk
=
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
;
const
fk
=
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
;
this
.
setState
({
this
.
setState
({
datas
:
obj
.
datas
,
datas
:
obj
.
datas
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
width
:
xxx
.
width
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
width
:
xxx
.
width
,
...
@@ -98,7 +100,7 @@ export default class ZdyTable extends Component {
...
@@ -98,7 +100,7 @@ export default class ZdyTable extends Component {
isRowCol
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isRowCol
:
xxx
.
isRowCol
,
isRowCol
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isRowCol
:
xxx
.
isRowCol
,
mapData
,
mapData
,
currentFormKey
:
fk
,
currentFormKey
:
fk
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
sqlData
,
sqlData
,
isEdit
:
!
this
.
props
.
formKey
,
isEdit
:
!
this
.
props
.
formKey
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
...
@@ -106,7 +108,7 @@ export default class ZdyTable extends Component {
...
@@ -106,7 +108,7 @@ export default class ZdyTable extends Component {
appId
:
val
.
appId
,
appId
:
val
.
appId
,
isReady
:
true
,
isReady
:
true
,
formConfig
:
xxx
,
formConfig
:
xxx
,
},
()
=>
this
.
initExcel
(
obj
));
},
()
=>
this
.
initExcel
(
obj
));
return
;
return
;
}
}
if
(
isCg
===
'yes'
)
{
if
(
isCg
===
'yes'
)
{
...
@@ -150,7 +152,7 @@ export default class ZdyTable extends Component {
...
@@ -150,7 +152,7 @@ export default class ZdyTable extends Component {
datas
:
obj
.
datas
,
datas
:
obj
.
datas
,
isEdit
:
!
this
.
props
.
formKey
,
isEdit
:
!
this
.
props
.
formKey
,
currentFormKey
:
obj
.
init
,
currentFormKey
:
obj
.
init
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
obj
.
init
),
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
obj
.
init
),
width
:
xxx
.
width
,
width
:
xxx
.
width
,
isBorder
:
xxx
.
isBorder
,
isBorder
:
xxx
.
isBorder
,
isRowCol
:
xxx
.
isRowCol
,
isRowCol
:
xxx
.
isRowCol
,
...
@@ -163,7 +165,7 @@ export default class ZdyTable extends Component {
...
@@ -163,7 +165,7 @@ export default class ZdyTable extends Component {
defaultBinds
:
this
.
props
.
table
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
:
xxx
.
defaultBinds
,
},
()
=>
this
.
initExcel
(
obj
));
},
()
=>
this
.
initExcel
(
obj
));
return
;
return
;
}
}
if
(
if
(
...
@@ -199,7 +201,7 @@ export default class ZdyTable extends Component {
...
@@ -199,7 +201,7 @@ export default class ZdyTable extends Component {
}
}
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
const
fk
=
this
.
props
.
formKey
const
fk
=
this
.
props
.
formKey
?
this
.
props
.
formKey
?
this
.
props
.
formKey
:
val
.
taskFormKey
:
val
.
taskFormKey
?
val
.
taskFormKey
?
val
.
taskFormKey
...
@@ -215,7 +217,7 @@ export default class ZdyTable extends Component {
...
@@ -215,7 +217,7 @@ export default class ZdyTable extends Component {
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
isEdit
:
!
this
.
props
.
formKey
,
isEdit
:
!
this
.
props
.
formKey
,
currentFormKey
:
fk
,
currentFormKey
:
fk
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
defaultBinds
:
this
.
props
.
table
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
:
xxx
.
defaultBinds
,
...
@@ -243,25 +245,95 @@ export default class ZdyTable extends Component {
...
@@ -243,25 +245,95 @@ export default class ZdyTable extends Component {
}
}
}
}
hfInstance
;
importExcel
=
(
res
)
=>
{
childExcel
=
(
sheetData
,
datas
,
tr
)
=>
{
if
(
tr
.
children
==
null
||
tr
.
children
.
length
==
0
){
const
{
datas
,
trees
}
=
this
.
configs
const
sheets
=
res
.
sheets
for
(
var
s
=
0
;
s
<
sheets
.
length
;
s
++
)
{
const
uuid
=
sheets
[
s
].
key
;
const
items
=
[]
const
cc
=
sheets
[
s
].
cells
for
(
var
i
=
0
;
i
<
cc
.
length
;
i
++
)
{
const
rows
=
[];
const
rr
=
cc
[
i
];
for
(
var
j
=
0
;
j
<
rr
.
length
;
j
++
)
{
const
c
=
rr
[
j
];
if
(
c
.
value
==
null
||
c
.
value
==
''
)
{
rows
.
push
({
uuid
:
'id_'
+
UUID
.
v4
().
replace
(
/-/g
,
'2'
),
row
:
c
.
rowSpan
,
col
:
c
.
colSpan
,
content
:
{
comName
:
'Excel'
,
cwidth
:
c
.
width
,
cheight
:
c
.
height
},
});
}
else
{
rows
.
push
({
uuid
:
'id_'
+
UUID
.
v4
().
replace
(
/-/g
,
'2'
),
row
:
c
.
rowSpan
,
col
:
c
.
colSpan
,
content
:
{
comName
:
'Excel'
,
initialValue
:
c
.
value
,
cwidth
:
c
.
width
,
cheight
:
c
.
height
},
});
}
}
items
.
push
(
rows
);
}
const
charts
=
sheets
[
s
].
charts
;
if
(
charts
&&
charts
.
length
>
0
)
{
const
rows
=
[];
for
(
var
j
=
0
;
j
<
charts
.
length
;
j
++
)
{
const
chartModel
=
charts
[
j
];
rows
.
push
({
uuid
:
'id_'
+
UUID
.
v4
().
replace
(
/-/g
,
'2'
),
content
:
{
comName
:
'Echart'
,
columnIds
:
{
c1
:
[]
},
labelSpan
:
24
,
wrapperSpan
:
24
,
isLabel
:
false
,
formula
:
'return '
+
JSON
.
stringify
(
chartModel
.
option
),
},
});
items
.
push
(
rows
);
}
}
if
(
datas
[
uuid
]
==
null
){
trees
.
push
({
title
:
sheets
[
s
].
name
,
key
:
uuid
});
}
datas
[
uuid
]
=
{
width
:
400
,
max
:
1
,
isBorder
:
true
,
items
:
items
,
};
}
else
{
for
(
var
c
=
0
;
c
<
tr
.
children
.
length
;
c
++
){
this
.
childExcel
(
sheetData
,
datas
,
tr
.
children
[
c
])
}
}
this
.
initExcel
({
datas
,
trees
})
console
.
log
(
"公式导入excel成功"
)
}
}
const
data
=
datas
[
tr
.
key
]
hfInstance
;
childExcel
=
(
sheetData
,
datas
,
tr
)
=>
{
if
(
tr
.
children
==
null
||
tr
.
children
.
length
==
0
)
{
}
else
{
for
(
var
c
=
0
;
c
<
tr
.
children
.
length
;
c
++
)
{
this
.
childExcel
(
sheetData
,
datas
,
tr
.
children
[
c
])
}
}
const
data
=
datas
[
tr
.
key
]
const
all
=
[]
const
all
=
[]
for
(
var
i
=
0
;
i
<
data
.
items
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
data
.
items
.
length
;
i
++
)
{
const
row
=
data
.
items
[
i
]
const
row
=
data
.
items
[
i
]
const
r
=
[]
const
r
=
[]
for
(
var
j
=
0
;
j
<
row
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
row
.
length
;
j
++
)
{
const
col
=
row
[
j
]
const
col
=
row
[
j
]
if
(
col
.
content
?.
comName
==
"Excel"
)
{
if
(
col
.
content
?.
comName
==
"Excel"
)
{
r
.
push
(
col
.
content
.
initialValue
)
r
.
push
(
col
.
content
.
initialValue
)
}
else
{
}
else
{
r
.
push
(
''
)
r
.
push
(
''
)
}
}
...
@@ -269,43 +341,49 @@ export default class ZdyTable extends Component {
...
@@ -269,43 +341,49 @@ export default class ZdyTable extends Component {
all
.
push
(
r
)
all
.
push
(
r
)
}
}
sheetData
[
tr
.
title
]
=
all
sheetData
[
tr
.
title
]
=
all
}
}
initExcel
=
(
configs
,
callback
)
=>
{
configs
if
(
configs
==
null
||
configs
.
trees
==
null
)
return
initExcel
=
(
configs
,
callback
)
=>
{
if
(
configs
==
null
||
configs
.
trees
==
null
)
return
if
(
configs
.
trees
!=
null
)
this
.
configs
=
configs
const
sheetData
=
{}
const
sheetData
=
{}
for
(
var
key
in
configs
.
trees
)
{
for
(
var
key
in
configs
.
trees
)
{
const
tr
=
configs
.
trees
[
key
]
const
tr
=
configs
.
trees
[
key
]
this
.
childExcel
(
sheetData
,
configs
.
datas
,
tr
)
this
.
childExcel
(
sheetData
,
configs
.
datas
,
tr
)
}
}
const
hfInstance
=
HyperFormula
.
buildFromSheets
(
sheetData
,
{});
const
hfInstance
=
HyperFormula
.
buildFromSheets
(
sheetData
,
{});
this
.
hfInstance
=
hfInstance
this
.
hfInstance
=
hfInstance
if
(
callback
)
callback
()
if
(
callback
)
callback
()
}
}
getCellValue
=
(
i
,
j
,
currentTitle
)
=>
{
getCellValue
=
(
i
,
j
,
currentTitle
)
=>
{
let
hfInstance
=
this
.
props
.
hfInstance
||
this
.
hfInstance
if
(
this
.
hfInstance
&&
currentTitle
){
let
x
=
this
.
hfInstance
.
getCellValue
({
col
:
j
,
row
:
i
,
sheet
:
this
.
hfInstance
.
getSheetId
(
currentTitle
)
})
if
(
x
&&
x
.
value
!=
null
){
x
=
x
.
value
}
if
(
hfInstance
&&
currentTitle
)
{
let
x
=
hfInstance
.
getCellValue
({
col
:
j
,
row
:
i
,
sheet
:
hfInstance
.
getSheetId
(
currentTitle
)
})
if
(
x
&&
x
.
value
!=
null
)
{
x
=
x
.
value
}
return
x
;
return
x
;
}
}
}
}
componentWillReceiveProps
(
nextProps
)
{
componentWillReceiveProps
(
nextProps
)
{
const
{
const
{
postData
,
// 数据源
postData
,
// 数据源
isCg
,
// 用户点击草稿页面进入
isCg
,
// 用户点击草稿页面进入
isForm
,
isForm
,
isPreview
,
// 是否为预览模式
isPreview
,
// 是否为预览模式
isChild
,
// 是否为子表单
isChild
,
// 是否为子表单
}
=
nextProps
;
}
=
nextProps
;
if
(
isPreview
||
isChild
)
{
if
(
isPreview
||
isChild
)
{
...
@@ -314,8 +392,10 @@ export default class ZdyTable extends Component {
...
@@ -314,8 +392,10 @@ export default class ZdyTable extends Component {
...
nextProps
,
...
nextProps
,
isReady
:
true
,
isReady
:
true
,
formConfig
:
{
...
this
.
state
.
formConfig
,
style
:
nextProps
.
style
},
formConfig
:
{
...
this
.
state
.
formConfig
,
style
:
nextProps
.
style
},
});
},()
=>
this
.
initExcel
({
datas
:
nextProps
.
datas
,
trees
:
nextProps
.
trees
}));
this
.
initExcel
({
datas
:
nextProps
.
datas
,
trees
:
nextProps
.
trees
})
return
;
return
;
}
}
...
@@ -352,7 +432,7 @@ export default class ZdyTable extends Component {
...
@@ -352,7 +432,7 @@ export default class ZdyTable extends Component {
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isBorder
:
xxx
.
isBorder
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
isBorder
:
xxx
.
isBorder
,
mapData
,
mapData
,
currentFormKey
:
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
,
currentFormKey
:
this
.
props
.
table
?
val
.
formKey
:
obj
.
init
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
sqlData
,
sqlData
,
isEdit
:
!
this
.
props
.
formKey
,
isEdit
:
!
this
.
props
.
formKey
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
items
:
this
.
props
.
table
?
obj
.
datas
[
val
.
formKey
].
items
:
xxx
.
items
,
...
@@ -360,7 +440,7 @@ export default class ZdyTable extends Component {
...
@@ -360,7 +440,7 @@ export default class ZdyTable extends Component {
appId
:
val
.
appId
,
appId
:
val
.
appId
,
isReady
:
true
,
isReady
:
true
,
formConfig
:
xxx
,
formConfig
:
xxx
,
},()
=>
this
.
initExcel
(
obj
));
},
()
=>
this
.
initExcel
(
obj
));
return
;
return
;
}
}
if
(
isCg
===
'yes'
)
{
if
(
isCg
===
'yes'
)
{
...
@@ -391,7 +471,7 @@ export default class ZdyTable extends Component {
...
@@ -391,7 +471,7 @@ export default class ZdyTable extends Component {
datas
:
obj
.
datas
,
datas
:
obj
.
datas
,
isEdit
:
!
this
.
props
.
formKey
,
isEdit
:
!
this
.
props
.
formKey
,
currentFormKey
:
obj
.
init
,
currentFormKey
:
obj
.
init
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
obj
.
init
),
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
obj
.
init
),
width
:
xxx
.
width
,
width
:
xxx
.
width
,
isBorder
:
xxx
.
isBorder
,
isBorder
:
xxx
.
isBorder
,
isRowCol
:
xxx
.
isRowCol
,
isRowCol
:
xxx
.
isRowCol
,
...
@@ -404,7 +484,7 @@ export default class ZdyTable extends Component {
...
@@ -404,7 +484,7 @@ export default class ZdyTable extends Component {
defaultBinds
:
this
.
props
.
table
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
:
xxx
.
defaultBinds
,
},()
=>
this
.
initExcel
(
obj
));
},
()
=>
this
.
initExcel
(
obj
));
return
;
return
;
}
}
const
mapData
=
{};
const
mapData
=
{};
...
@@ -427,7 +507,7 @@ export default class ZdyTable extends Component {
...
@@ -427,7 +507,7 @@ export default class ZdyTable extends Component {
}
}
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
obj
=
JSON
.
parse
(
val
.
unifiedServicePatternModel
.
content
);
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
const
xxx
=
obj
.
datas
[
this
.
props
.
formKey
?
this
.
props
.
formKey
:
obj
.
init
];
// 是否是存在历史表单传入值
const
fk
=
this
.
props
.
formKey
const
fk
=
this
.
props
.
formKey
?
this
.
props
.
formKey
?
this
.
props
.
formKey
:
val
.
taskFormKey
:
val
.
taskFormKey
?
val
.
taskFormKey
?
val
.
taskFormKey
...
@@ -440,7 +520,7 @@ export default class ZdyTable extends Component {
...
@@ -440,7 +520,7 @@ export default class ZdyTable extends Component {
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
defaultValues
:
val
.
unifiedServicePatternModel
.
defaultValues
,
isEdit
:
!
this
.
props
.
formKey
,
isEdit
:
!
this
.
props
.
formKey
,
currentFormKey
:
fk
,
currentFormKey
:
fk
,
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
currentFormTitle
:
this
.
getCurrentFormTitle
(
obj
,
fk
),
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
defaultBinds
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
defaultBinds
:
xxx
.
defaultBinds
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
width
:
xxx
.
width
,
width
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
width
:
xxx
.
width
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isBorder
:
xxx
.
isBorder
,
isBorder
:
this
.
props
.
table
?
obj
.
datas
[
val
.
taskFormKey
].
isBorder
:
xxx
.
isBorder
,
...
@@ -450,13 +530,13 @@ export default class ZdyTable extends Component {
...
@@ -450,13 +530,13 @@ export default class ZdyTable extends Component {
init
:
{
...
this
.
state
.
init
,
...(
val
.
isSecond
?
this
.
props
.
obj
:
{})
},
init
:
{
...
this
.
state
.
init
,
...(
val
.
isSecond
?
this
.
props
.
obj
:
{})
},
formConfig
:
xxx
,
formConfig
:
xxx
,
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
},()
=>
this
.
initExcel
(
obj
));
},
()
=>
this
.
initExcel
(
obj
));
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
'公式配置有误'
,
e
);
console
.
log
(
'公式配置有误'
,
e
);
}
}
}
}
checkAllHidden
=
row
=>
{
checkAllHidden
=
row
=>
{
for
(
var
i
=
0
;
i
<
row
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
row
.
length
;
i
++
)
{
if
(
row
[
i
].
hidden
==
null
||
!
row
[
i
].
hidden
)
{
if
(
row
[
i
].
hidden
==
null
||
!
row
[
i
].
hidden
)
{
return
false
;
return
false
;
...
@@ -466,9 +546,9 @@ export default class ZdyTable extends Component {
...
@@ -466,9 +546,9 @@ export default class ZdyTable extends Component {
delete
row
[
i
].
hidden
;
delete
row
[
i
].
hidden
;
}
}
return
true
;
return
true
;
};
};
countMax
=
items
=>
{
countMax
=
items
=>
{
let
max
=
0
;
let
max
=
0
;
items
.
forEach
(
r
=>
{
items
.
forEach
(
r
=>
{
if
(
r
.
length
>
max
)
{
if
(
r
.
length
>
max
)
{
...
@@ -476,17 +556,38 @@ export default class ZdyTable extends Component {
...
@@ -476,17 +556,38 @@ export default class ZdyTable extends Component {
}
}
});
});
return
max
;
return
max
;
};
};
getCurrentFormTitle
=
(
obj
,
key
)
=>
{
getCurrentFormTitle
=
(
obj
,
key
)
=>
{
if
(
obj
==
null
)
return
const
{
trees
}
=
obj
if
(
trees
==
null
)
return
return
this
.
getT
(
trees
,
key
)
}
getCurrentFormTitle2
=
(
key
)
=>
{
if
(
this
.
configs
==
null
)
return
const
{
trees
}
=
this
.
configs
if
(
trees
==
null
)
return
return
this
.
getT
(
trees
,
key
)
}
getT
=
(
trees
,
key
)
=>
{
for
(
var
i
=
0
;
i
<
trees
.
length
;
i
++
)
{
const
{
trees
}
=
obj
if
(
trees
[
i
].
children
==
null
||
trees
[
i
].
children
.
length
==
0
){
for
(
var
i
=
0
;
i
<
trees
.
length
;
i
++
){
if
(
trees
[
i
].
key
==
key
)
{
if
(
trees
[
i
].
key
==
key
)
{
return
trees
[
i
].
title
return
trees
[
i
].
title
}
}
}
else
{
return
this
.
getT
(
trees
[
i
].
children
,
key
)
}
}
}
}
render
()
{
}
render
()
{
const
{
const
{
width
,
width
,
...
@@ -655,6 +756,7 @@ export default class ZdyTable extends Component {
...
@@ -655,6 +756,7 @@ export default class ZdyTable extends Component {
return
(
return
(
<
tr
key=
{
i
}
>
<
tr
key=
{
i
}
>
{
row
.
map
((
cell
,
j
)
=>
{
{
row
.
map
((
cell
,
j
)
=>
{
if
(
!
cell
.
content
)
{
if
(
!
cell
.
content
)
{
return
;
return
;
}
}
...
@@ -702,7 +804,10 @@ export default class ZdyTable extends Component {
...
@@ -702,7 +804,10 @@ export default class ZdyTable extends Component {
}
}
}
}
>
>
<
TableCom
<
TableCom
importExcel=
{
this
.
importExcel
}
getCellValue=
{
this
.
getCellValue
}
getCellValue=
{
this
.
getCellValue
}
getCurrentFormTitle=
{
this
.
getCurrentFormTitle2
}
hfInstance=
{
this
.
hfInstance
}
isWebPrintEnd=
{
isWebPrintEnd
}
isWebPrintEnd=
{
isWebPrintEnd
}
isWebPrint=
{
isWebPrint
}
isWebPrint=
{
isWebPrint
}
isPrint=
{
this
.
props
.
isPrint
}
isPrint=
{
this
.
props
.
isPrint
}
...
@@ -807,8 +912,11 @@ export default class ZdyTable extends Component {
...
@@ -807,8 +912,11 @@ export default class ZdyTable extends Component {
:
''
}
:
''
}
<
IsNewTable
<
IsNewTable
getCellValue=
{
this
.
getCellValue
}
getCellValue=
{
this
.
getCellValue
}
hfInstance=
{
this
.
hfInstance
}
getCurrentFormTitle=
{
this
.
getCurrentFormTitle2
}
taskAssignee=
{
taskAssignee
}
// 提交人
taskAssignee=
{
taskAssignee
}
// 提交人
userId=
{
userId
}
userId=
{
userId
}
importExcel=
{
this
.
importExcel
}
isPreview=
{
isPreview
}
isPreview=
{
isPreview
}
isRowCol=
{
isRowCol
}
isRowCol=
{
isRowCol
}
modalInit=
{
modalInit
}
modalInit=
{
modalInit
}
...
@@ -839,55 +947,11 @@ export default class ZdyTable extends Component {
...
@@ -839,55 +947,11 @@ export default class ZdyTable extends Component {
concealModel=
{
concealModel
||
{}
}
// 场景设计器内置路由跳转函数
concealModel=
{
concealModel
||
{}
}
// 场景设计器内置路由跳转函数
isDynamic=
{
isDynamic
}
// 是否为场景配置器调用
isDynamic=
{
isDynamic
}
// 是否为场景配置器调用
/>
/>
{
/* {
items.map((item, i) => {
const allhidden = this.checkAllHidden(items)
return (<div
key={i}
style={{
marginTop: 0,
background: '#ffffff',
paddingLeft: 12,
width: '100%',
flexWrap: 'wrap',
...style
}}>
{
item.map((ary, j) => {
return !allhidden && ary.hidden ? ""
: <><TableCom
formCode={formCode}
formId={formId}
i={i}
j={j}
index={index}
fatherCode={fatherCode}
datas={datas}
isEdit={isEdit}
fatherObj={this.props.fatherObj}
formKey={currentFormKey}
init={init}
get={get}
key={j}
sqlData={sqlData}
obj={obj || {}}
form={this.props.form}
mapData={mapData}
json={ary.content}
uuid={ary.uuid}
routerState={routerState} // 兼容表单设计器路由传参
defaultValues={defaultValues || {}}
messageData={messageData} // 场景设计器共享变量参数
/></>
})
}
</div>)
})
} */
}
</
Form
>
</
Form
>
)
}
)
}
</>
</>
);
);
}
}
}
}
}
}
one_stop_public/Table/isNewMobileTable.jsx
浏览文件 @
f333d3b9
...
@@ -39,7 +39,9 @@ export default class isNewTable extends Component {
...
@@ -39,7 +39,9 @@ export default class isNewTable extends Component {
concealModel
,
concealModel
,
taskAssignee
,
taskAssignee
,
currentFormTitle
,
currentFormTitle
,
getCellValue
getCellValue
,
hfInstance
,
getCurrentFormTitle
}
=
this
.
props
;
}
=
this
.
props
;
if
(
!
isEdit
)
{
if
(
!
isEdit
)
{
// 展示栏 暂不做处理
// 展示栏 暂不做处理
...
@@ -91,6 +93,7 @@ export default class isNewTable extends Component {
...
@@ -91,6 +93,7 @@ export default class isNewTable extends Component {
i=
{
i
}
i=
{
i
}
j=
{
j
}
j=
{
j
}
index=
{
index
}
index=
{
index
}
getCurrentFormTitle
fatherCode=
{
fatherCode
}
fatherCode=
{
fatherCode
}
datas=
{
datas
}
datas=
{
datas
}
isEdit=
{
isEdit
}
isEdit=
{
isEdit
}
...
@@ -98,6 +101,8 @@ export default class isNewTable extends Component {
...
@@ -98,6 +101,8 @@ export default class isNewTable extends Component {
formKey=
{
currentFormKey
}
formKey=
{
currentFormKey
}
currentFormTitle
currentFormTitle
getCellValue
getCellValue
hfInstance
initExcel=
{
this
.
props
.
initExcel
}
init=
{
init
}
init=
{
init
}
get=
{
get
}
get=
{
get
}
key=
{
j
}
key=
{
j
}
...
@@ -168,9 +173,12 @@ export default class isNewTable extends Component {
...
@@ -168,9 +173,12 @@ export default class isNewTable extends Component {
fatherCode=
{
fatherCode
}
fatherCode=
{
fatherCode
}
datas=
{
datas
}
datas=
{
datas
}
isEdit=
{
isEdit
}
isEdit=
{
isEdit
}
getCurrentFormTitle
importExcel=
{
this
.
props
.
importExcel
}
fatherObj=
{
this
.
props
.
fatherObj
}
fatherObj=
{
this
.
props
.
fatherObj
}
formKey=
{
currentFormKey
}
formKey=
{
currentFormKey
}
currentFormTitle
currentFormTitle
hfInstance
getCellValue
getCellValue
init=
{
init
}
init=
{
init
}
get=
{
get
}
get=
{
get
}
...
@@ -214,9 +222,12 @@ export default class isNewTable extends Component {
...
@@ -214,9 +222,12 @@ export default class isNewTable extends Component {
datas=
{
datas
}
datas=
{
datas
}
modalInit=
{
modalInit
}
modalInit=
{
modalInit
}
isEdit=
{
isEdit
}
isEdit=
{
isEdit
}
getCurrentFormTitle
fatherObj=
{
this
.
props
.
fatherObj
}
fatherObj=
{
this
.
props
.
fatherObj
}
formKey=
{
currentFormKey
}
formKey=
{
currentFormKey
}
importExcel=
{
this
.
props
.
importExcel
}
currentFormTitle
currentFormTitle
hfInstance
getCellValue
getCellValue
init=
{
init
}
init=
{
init
}
get=
{
get
}
get=
{
get
}
...
...
one_stop_public/tableCompon/index.jsx
浏览文件 @
f333d3b9
...
@@ -1144,6 +1144,7 @@ export default class tableCom extends Component {
...
@@ -1144,6 +1144,7 @@ export default class tableCom extends Component {
moment
:
moment
,
moment
:
moment
,
sql
:
this
.
sqlUtil
.
bind
(
this
,
base52
,
json
,
callback
),
sql
:
this
.
sqlUtil
.
bind
(
this
,
base52
,
json
,
callback
),
message
:
message
,
message
:
message
,
importExcel
:
this
.
props
.
importExcel
,
router
:
router
,
router
:
router
,
uuid
:
UUID
,
uuid
:
UUID
,
setValues
:
this
.
setValues
.
bind
(
this
,
base52
,
json
),
setValues
:
this
.
setValues
.
bind
(
this
,
base52
,
json
),
...
@@ -1483,12 +1484,16 @@ export default class tableCom extends Component {
...
@@ -1483,12 +1484,16 @@ export default class tableCom extends Component {
if
(
formKey
==
fk
)
{
if
(
formKey
==
fk
)
{
return
<>
片段表单key不能和自身相同
</>;
return
<>
片段表单key不能和自身相同
</>;
}
}
return
(
return
(
<>
<>
{
this
.
props
.
form
.
getFieldDecorator
(
this
.
props
.
uuid
,
{
{
this
.
props
.
form
.
getFieldDecorator
(
this
.
props
.
uuid
,
{
initialValue
:
fk
,
initialValue
:
fk
,
})(<
Input
type=
"hidden"
/>)
}{
' '
}
})(<
Input
type=
"hidden"
/>)
}{
' '
}
<
ZdyTable
<
ZdyTable
hfInstance=
{
this
.
props
.
hfInstance
}
currentFormTitle=
{
this
.
props
.
getCurrentFormTitle
(
fk
)
}
getCellValue=
{
getCellValue
}
taskAssignee=
{
taskAssignee
}
taskAssignee=
{
taskAssignee
}
isWebPrint=
{
this
.
props
.
isWebPrint
||
false
}
isWebPrint=
{
this
.
props
.
isWebPrint
||
false
}
userId=
{
userId
}
userId=
{
userId
}
...
@@ -2571,7 +2576,6 @@ export default class tableCom extends Component {
...
@@ -2571,7 +2576,6 @@ export default class tableCom extends Component {
break
;
break
;
case
'Select'
:
case
'Select'
:
console
.
log
();
cm
=
getFieldDecorator
(
dataColumn
.
base52
,
{
cm
=
getFieldDecorator
(
dataColumn
.
base52
,
{
initialValue
:
initValue
,
initialValue
:
initValue
,
rules
:
rules
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论