Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
3fb4ff93
提交
3fb4ff93
authored
12月 09, 2022
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
格式化代码
上级
a9f585ed
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
32 行增加
和
42 行删除
+32
-42
ZdyTable.jsx
one_stop_public/Table/ZdyTable.jsx
+32
-42
没有找到文件。
one_stop_public/Table/ZdyTable.jsx
浏览文件 @
3fb4ff93
...
@@ -59,16 +59,18 @@ export default class ZdyTable extends Component {
...
@@ -59,16 +59,18 @@ export default class ZdyTable extends Component {
// if(this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e'){
// if(this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e'){
// }
// }
if
(
isPreview
||
isChild
)
{
if
(
isPreview
||
isChild
)
{
this
.
initExcel
({
this
.
initExcel
(
{
datas
:
this
.
props
.
datas
,
datas
:
this
.
props
.
datas
,
trees
:
this
.
props
.
trees
trees
:
this
.
props
.
trees
,
},
()
=>
{
},
()
=>
{
this
.
setState
({
this
.
setState
({
...
this
.
state
,
...
this
.
state
,
...
this
.
props
,
...
this
.
props
,
formConfig
:
{
formConfig
:
{
...
this
.
state
.
formConfig
,
...
this
.
state
.
formConfig
,
style
:
this
.
props
.
style
style
:
this
.
props
.
style
,
},
},
isReady
:
true
,
isReady
:
true
,
viewMode
:
viewMode
:
...
@@ -78,7 +80,8 @@ export default class ZdyTable extends Component {
...
@@ -78,7 +80,8 @@ export default class ZdyTable extends Component {
?
this
.
props
.
datas
[
this
.
props
.
currentFormKey
].
viewMode
?
this
.
props
.
datas
[
this
.
props
.
currentFormKey
].
viewMode
:
null
,
:
null
,
});
});
});
},
);
return
;
return
;
}
}
...
@@ -286,10 +289,7 @@ export default class ZdyTable extends Component {
...
@@ -286,10 +289,7 @@ export default class ZdyTable extends Component {
this
.
props
.
importExcel
(
res
,
callback
);
this
.
props
.
importExcel
(
res
,
callback
);
return
;
return
;
}
}
const
{
const
{
datas
,
trees
}
=
this
.
configs
;
datas
,
trees
}
=
this
.
configs
;
const
sheets
=
res
.
sheets
;
const
sheets
=
res
.
sheets
;
for
(
var
s
=
0
;
s
<
sheets
.
length
;
s
++
)
{
for
(
var
s
=
0
;
s
<
sheets
.
length
;
s
++
)
{
...
@@ -303,20 +303,18 @@ export default class ZdyTable extends Component {
...
@@ -303,20 +303,18 @@ export default class ZdyTable extends Component {
const
c
=
rr
[
j
];
const
c
=
rr
[
j
];
if
(
c
.
value
==
null
||
c
.
value
==
''
)
{
if
(
c
.
value
==
null
||
c
.
value
==
''
)
{
rows
.
push
({
rows
.
push
({
uuid
:
'id_'
+
UUID
.
v4
()
uuid
:
'id_'
+
UUID
.
v4
().
replace
(
/-/g
,
'2'
),
.
replace
(
/-/g
,
'2'
),
row
:
c
.
rowSpan
,
row
:
c
.
rowSpan
,
col
:
c
.
colSpan
,
col
:
c
.
colSpan
,
content
:
{
content
:
{
comName
:
'Excel'
,
comName
:
'Excel'
,
cwidth
:
c
.
width
,
cwidth
:
c
.
width
,
cheight
:
c
.
height
cheight
:
c
.
height
,
},
},
});
});
}
else
{
}
else
{
rows
.
push
({
rows
.
push
({
uuid
:
'id_'
+
UUID
.
v4
()
uuid
:
'id_'
+
UUID
.
v4
().
replace
(
/-/g
,
'2'
),
.
replace
(
/-/g
,
'2'
),
row
:
c
.
rowSpan
,
row
:
c
.
rowSpan
,
col
:
c
.
colSpan
,
col
:
c
.
colSpan
,
content
:
{
content
:
{
...
@@ -337,8 +335,7 @@ export default class ZdyTable extends Component {
...
@@ -337,8 +335,7 @@ export default class ZdyTable extends Component {
for
(
var
j
=
0
;
j
<
charts
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
charts
.
length
;
j
++
)
{
const
chartModel
=
charts
[
j
];
const
chartModel
=
charts
[
j
];
rows
.
push
({
rows
.
push
({
uuid
:
'id_'
+
UUID
.
v4
()
uuid
:
'id_'
+
UUID
.
v4
().
replace
(
/-/g
,
'2'
),
.
replace
(
/-/g
,
'2'
),
content
:
{
content
:
{
comName
:
'Echart'
,
comName
:
'Echart'
,
columnIds
:
{
c1
:
[]
},
columnIds
:
{
c1
:
[]
},
...
@@ -354,7 +351,7 @@ export default class ZdyTable extends Component {
...
@@ -354,7 +351,7 @@ export default class ZdyTable extends Component {
if
(
datas
[
uuid
]
==
null
)
{
if
(
datas
[
uuid
]
==
null
)
{
trees
.
push
({
trees
.
push
({
title
:
sheets
[
s
].
name
,
title
:
sheets
[
s
].
name
,
key
:
uuid
key
:
uuid
,
});
});
}
}
datas
[
uuid
]
=
{
datas
[
uuid
]
=
{
...
@@ -389,7 +386,7 @@ export default class ZdyTable extends Component {
...
@@ -389,7 +386,7 @@ export default class ZdyTable extends Component {
}
}
const
data
=
datas
[
tr
.
key
];
const
data
=
datas
[
tr
.
key
];
const
all
=
[];
const
all
=
[];
if
(
data
&&
data
.
item
)
{
if
(
data
&&
data
.
item
)
{
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
=
[];
...
@@ -405,7 +402,6 @@ export default class ZdyTable extends Component {
...
@@ -405,7 +402,6 @@ export default class ZdyTable extends Component {
}
}
}
}
sheetData
[
tr
.
title
]
=
all
;
sheetData
[
tr
.
title
]
=
all
;
};
};
configs
;
configs
;
...
@@ -464,12 +460,13 @@ export default class ZdyTable extends Component {
...
@@ -464,12 +460,13 @@ export default class ZdyTable extends Component {
:
null
,
:
null
,
formConfig
:
{
formConfig
:
{
...
this
.
state
.
formConfig
,
...
this
.
state
.
formConfig
,
style
:
nextProps
.
style
style
:
nextProps
.
style
,
},
},
},
},
()
=>
this
.
initExcel
({
()
=>
this
.
initExcel
({
datas
:
nextProps
.
datas
,
datas
:
nextProps
.
datas
,
trees
:
nextProps
.
trees
trees
:
nextProps
.
trees
,
}),
}),
);
);
return
;
return
;
...
@@ -664,7 +661,6 @@ export default class ZdyTable extends Component {
...
@@ -664,7 +661,6 @@ export default class ZdyTable extends Component {
this
.
setState
({
objRealTime
:
obj
});
this
.
setState
({
objRealTime
:
obj
});
};
};
getT
=
(
trees
,
key
)
=>
{
getT
=
(
trees
,
key
)
=>
{
for
(
var
i
in
trees
)
{
for
(
var
i
in
trees
)
{
if
(
trees
[
i
].
key
==
key
)
{
if
(
trees
[
i
].
key
==
key
)
{
return
trees
[
i
].
title
;
return
trees
[
i
].
title
;
...
@@ -675,8 +671,6 @@ export default class ZdyTable extends Component {
...
@@ -675,8 +671,6 @@ export default class ZdyTable extends Component {
}
}
}
}
return
null
;
return
null
;
};
};
render
()
{
render
()
{
...
@@ -717,7 +711,6 @@ export default class ZdyTable extends Component {
...
@@ -717,7 +711,6 @@ export default class ZdyTable extends Component {
isWebPrint
,
// 打印界面
isWebPrint
,
// 打印界面
isWebPrintEnd
,
isWebPrintEnd
,
isPreview
,
isPreview
,
}
=
this
.
props
;
}
=
this
.
props
;
const
trees
=
this
.
configs
&&
this
.
configs
.
trees
?
this
.
configs
.
trees
:
this
.
props
.
trees
;
const
trees
=
this
.
configs
&&
this
.
configs
.
trees
?
this
.
configs
.
trees
:
this
.
props
.
trees
;
...
@@ -772,8 +765,7 @@ export default class ZdyTable extends Component {
...
@@ -772,8 +765,7 @@ export default class ZdyTable extends Component {
if
(
!
isReady
)
return
<></>;
if
(
!
isReady
)
return
<></>;
if
(
this
.
props
.
postData
?.
isUpdate
)
{
if
(
this
.
props
.
postData
?.
isUpdate
)
{
updateTime
=
moment
(
+
this
.
props
.
postData
?.
updateTime
)
updateTime
=
moment
(
+
this
.
props
.
postData
?.
updateTime
).
format
(
'llll'
);
.
format
(
'llll'
);
}
}
switch
(
get
)
{
switch
(
get
)
{
case
'web'
:
case
'web'
:
...
@@ -786,7 +778,7 @@ export default class ZdyTable extends Component {
...
@@ -786,7 +778,7 @@ export default class ZdyTable extends Component {
{
this
.
props
.
postData
?.
isUpdate
?
(
{
this
.
props
.
postData
?.
isUpdate
?
(
<
div
style=
{
{
margin
:
'100px 24px 24px'
}
}
>
<
div
style=
{
{
margin
:
'100px 24px 24px'
}
}
>
<
div
style=
{
{
textAlign
:
'center'
}
}
>
<
div
style=
{
{
textAlign
:
'center'
}
}
>
<
img
style=
{
{
marginRight
:
30
}
}
src=
{
maintain
}
/>
<
img
style=
{
{
marginRight
:
30
}
}
src=
{
maintain
}
/>
</
div
>
</
div
>
<
p
<
p
style=
{
{
style=
{
{
...
@@ -805,8 +797,7 @@ export default class ZdyTable extends Component {
...
@@ -805,8 +797,7 @@ export default class ZdyTable extends Component {
<
div
id=
"web_table"
>
<
div
id=
"web_table"
>
<
Form
className=
"login-form"
>
<
Form
className=
"login-form"
>
{
isEdit
&&
defaultBinds
{
isEdit
&&
defaultBinds
?
Object
.
keys
(
defaultBinds
)
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
.
map
((
k
)
=>
{
const
r
=
defaultBinds
[
k
];
const
r
=
defaultBinds
[
k
];
if
(
if
(
r
.
columnIds
==
null
||
r
.
columnIds
==
null
||
...
@@ -826,7 +817,7 @@ export default class ZdyTable extends Component {
...
@@ -826,7 +817,7 @@ export default class ZdyTable extends Component {
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
,
initialValue
:
value
,
})(<
Input
type=
"hidden"
/>);
})(<
Input
type=
"hidden"
/>);
})
})
:
''
}
:
''
}
<
Row
>
<
Row
>
...
@@ -858,13 +849,12 @@ export default class ZdyTable extends Component {
...
@@ -858,13 +849,12 @@ export default class ZdyTable extends Component {
return
;
return
;
}
}
if
(
cell
.
uuid
)
{
if
(
cell
.
uuid
)
{
if
(
cell
.
content
)
{
if
(
cell
.
content
)
{
cell
.
content
=
{
cell
.
content
=
{
...
cell
.
content
,
...
cell
.
content
,
...
getActiveJson
(
currentFormKey
,
cell
.
uuid
),
...
getActiveJson
(
currentFormKey
,
cell
.
uuid
),
};
};
if
(
window
.
zdyTableTemplateWillMountProps
?.
allDisabled
)
{
if
(
window
.
zdyTableTemplateWillMountProps
?.
allDisabled
)
{
cell
.
content
.
disabled
=
true
;
cell
.
content
.
disabled
=
true
;
}
}
}
}
...
@@ -894,8 +884,9 @@ export default class ZdyTable extends Component {
...
@@ -894,8 +884,9 @@ export default class ZdyTable extends Component {
rowSpan=
{
cell
.
row
}
rowSpan=
{
cell
.
row
}
colSpan=
{
cell
.
col
}
colSpan=
{
cell
.
col
}
key=
{
j
}
key=
{
j
}
data
-
cell
-
id=
{
cell
.
uuid
||
'no_uuid_'
+
Math
.
random
()
data
-
cell
-
id=
{
.
slice
(
0
,
6
)
}
cell
.
uuid
||
'no_uuid_'
+
Math
.
random
().
slice
(
0
,
6
)
}
data
-
com
-
name=
{
cell
.
content
?.
comName
||
'empty'
}
data
-
com
-
name=
{
cell
.
content
?.
comName
||
'empty'
}
style=
{
{
style=
{
{
overflow
:
'auto'
,
overflow
:
'auto'
,
...
@@ -967,7 +958,7 @@ export default class ZdyTable extends Component {
...
@@ -967,7 +958,7 @@ export default class ZdyTable extends Component {
</
table
>
</
table
>
{
style
.
pageBreakAfter
!=
null
?
(
{
style
.
pageBreakAfter
!=
null
?
(
<
div
style=
{
{
pageBreakAfter
:
style
.
pageBreakAfter
}
}
/>
<
div
style=
{
{
pageBreakAfter
:
style
.
pageBreakAfter
}
}
/>
)
:
(
)
:
(
''
''
)
}
)
}
...
@@ -985,7 +976,7 @@ export default class ZdyTable extends Component {
...
@@ -985,7 +976,7 @@ export default class ZdyTable extends Component {
{
this
.
props
.
postData
?.
isUpdate
?
(
{
this
.
props
.
postData
?.
isUpdate
?
(
<
div
style=
{
{
margin
:
'100px 24px 24px'
}
}
>
<
div
style=
{
{
margin
:
'100px 24px 24px'
}
}
>
<
div
style=
{
{
textAlign
:
'center'
}
}
>
<
div
style=
{
{
textAlign
:
'center'
}
}
>
<
img
style=
{
{
width
:
'100%'
}
}
src=
{
maintain
}
/>
<
img
style=
{
{
width
:
'100%'
}
}
src=
{
maintain
}
/>
</
div
>
</
div
>
<
p
<
p
style=
{
{
style=
{
{
...
@@ -1003,8 +994,7 @@ export default class ZdyTable extends Component {
...
@@ -1003,8 +994,7 @@ export default class ZdyTable extends Component {
)
:
(
)
:
(
<
Form
{
...
formItemLayout
}
id=
"mobile_table"
className=
"login-form"
>
<
Form
{
...
formItemLayout
}
id=
"mobile_table"
className=
"login-form"
>
{
defaultBinds
{
defaultBinds
?
Object
.
keys
(
defaultBinds
)
?
Object
.
keys
(
defaultBinds
).
map
((
k
)
=>
{
.
map
((
k
)
=>
{
const
r
=
defaultBinds
[
k
];
const
r
=
defaultBinds
[
k
];
if
(
if
(
r
.
columnIds
==
null
||
r
.
columnIds
==
null
||
...
@@ -1024,7 +1014,7 @@ export default class ZdyTable extends Component {
...
@@ -1024,7 +1014,7 @@ export default class ZdyTable extends Component {
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
,
initialValue
:
value
,
})(<
Input
type=
"hidden"
/>);
})(<
Input
type=
"hidden"
/>);
})
})
:
''
}
:
''
}
<
IsNewTable
<
IsNewTable
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论