Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
66b8e6f4
提交
66b8e6f4
authored
12月 28, 2021
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
23792 【元数据】导入时第一列数据在验证模版上没有显示
上级
d06980af
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
34 行增加
和
21 行删除
+34
-21
ImportUtil.js
one_stop_public/App/ImportUtil.js
+34
-21
没有找到文件。
one_stop_public/App/ImportUtil.js
浏览文件 @
66b8e6f4
...
...
@@ -11,7 +11,8 @@ const Step = Steps.Step;
const
TabPane
=
Tabs
.
TabPane
;
const
exportExcel
=
CLIENT_TYPE
==
'mobile'
?
null
:
require
(
'xlsx-oc'
).
exportExcel
;
let
tempCallback
=
()
=>
{};
let
tempCallback
=
()
=>
{
};
@
connect
(({
DataObj
,
loading
})
=>
({
...
...
@@ -81,7 +82,7 @@ export default class ImportUtil extends React.PureComponent {
this
.
setState
({
current
:
current
,
isShow
:
true
,
},()
=>
{
},
()
=>
{
if
(
tempCallback
&&
typeof
tempCallback
===
'function'
)
{
tempCallback
();
tempCallback
=
null
;
...
...
@@ -247,6 +248,7 @@ export default class ImportUtil extends React.PureComponent {
this
.
setState
({
confirmLoading
:
false
});
});
};
render
()
{
const
props
=
{
name
:
'file'
,
...
...
@@ -286,7 +288,7 @@ export default class ImportUtil extends React.PureComponent {
];
const
{
current
}
=
this
.
state
;
const
{
name
,
loading
}
=
this
.
props
;
const
{
name
}
=
this
.
props
;
const
column1
=
this
.
state
.
column
?
[
{
...
...
@@ -299,12 +301,23 @@ export default class ImportUtil extends React.PureComponent {
...
this
.
state
.
column
,
]
:
[];
var
column2
=
this
.
state
.
column
?
[...
this
.
state
.
column
]
:
[];
if
(
column1
.
length
>
1
)
let
column2
=
this
.
state
.
column
?
[...
this
.
state
.
column
]
:
[];
if
(
column1
.
length
>
1
)
{
column1
[
1
].
render
=
(
val
)
=>
<
span
style
=
{{
color
:
'red'
}}
>
{
val
}
<
/span>
;
}
column2
.
splice
(
0
,
1
);
column2
=
[{
title
:
'序号'
,
fixed
:
'left'
,
width
:
50
,
render
:
(
v
,
r
,
i
)
=>
i
+
1
},
...
column2
];
if
(
column2
)
{
let
xuhao
=
column2
.
find
((
g
)
=>
g
.
dataIndex
===
'序号'
);
if
(
!
xuhao
)
{
column2
.
unshift
({
title
:
'序号'
,
fixed
:
'left'
,
width
:
50
,
render
:
(
v
,
r
,
i
)
=>
i
+
1
,
dataIndex
:
'序号'
,
});
}
}
const
btn
=
{
name
:
name
||
'批量导入'
,
...
...
@@ -333,13 +346,13 @@ export default class ImportUtil extends React.PureComponent {
<
Step
key
=
{
item
.
title
}
title
=
{
item
.
title
}
/
>
))}
<
/Steps
>
<
div
className
=
"steps-content"
>
{
steps
[
this
.
state
.
current
].
content
}
<
/div
>
<
div
className
=
'steps-content'
>
{
steps
[
this
.
state
.
current
].
content
}
<
/div
>
<
div
className
=
{
styles
.
button
}
>
{
this
.
state
.
current
<
steps
.
length
-
1
&&
this
.
state
.
current
!==
0
&&
(
<
ButtonDiy
name
=
{
this
.
state
.
current
==
3
?
'确认导入'
:
'下一步'
}
type
=
"primary"
type
=
'primary'
disabled
=
{
this
.
state
.
current
!=
3
&&
this
.
state
.
isNextDisabled
}
// className='primaryBlue'
handleClick
=
{()
=>
this
.
next
()}
...
...
@@ -349,8 +362,8 @@ export default class ImportUtil extends React.PureComponent {
{
this
.
state
.
current
>
0
&&
(
<
ButtonDiy
style
=
{{
marginLeft
:
8
}}
name
=
"上一步"
className
=
"defaultBlue"
name
=
'上一步'
className
=
'defaultBlue'
handleClick
=
{()
=>
this
.
prev
()}
/
>
)}
...
...
@@ -369,13 +382,13 @@ export default class ImportUtil extends React.PureComponent {
<
div
className
=
{
styles
.
buttonDown
}
>
<
Upload
{...
props
}
>
<
Button
>
<
Icon
type
=
"upload"
/>
<
Icon
type
=
'upload'
/>
点击上传
<
/Button
>
<
/Upload
>
<
ButtonDiy
name
=
{
'下载模板'
}
type
=
"primary"
type
=
'primary'
// className='primaryBlue'
handleClick
=
{()
=>
this
.
downloadFile
()}
loading
=
{
this
.
state
.
confirmLoading
}
...
...
@@ -384,7 +397,7 @@ export default class ImportUtil extends React.PureComponent {
)
:
(
<
Upload
{...
props
}
>
<
Button
>
<
Icon
type
=
"upload"
/>
<
Icon
type
=
'upload'
/>
重新上传
<
/Button
>
<
/Upload
>
...
...
@@ -404,21 +417,21 @@ export default class ImportUtil extends React.PureComponent {
activeKey
=
{
this
.
state
.
currentKey
}
key
=
{
this
.
state
.
ch
}
onChange
=
{
this
.
changePane
}
type
=
"card"
>
type
=
'card'
>
{
this
.
state
.
errData
&&
this
.
state
.
errData
.
length
==
0
?
(
''
)
:
(
<
TabPane
tab
=
{
<
span
style
=
{{
color
:
'red'
}}
>
验证错误列表
<
/span>} key="1"
>
<
TabPane
tab
=
{
<
span
style
=
{{
color
:
'red'
}}
>
验证错误列表
<
/span>} key='1'
>
<
Button
style
=
{{
marginTop
:
5
,
marginBottom
:
5
}}
type
=
"danger"
type
=
'danger'
onClick
=
{
this
.
exportError
.
bind
(
this
,
column1
,
this
.
state
.
errData
)}
>
导出错误信息
<
/Button
>
<
Table
columns
=
{
column1
}
size
=
"small"
size
=
'small'
style
=
{{
overflow
:
'auto'
}}
dataSource
=
{
this
.
state
.
errData
}
bordered
=
{
true
}
...
...
@@ -426,17 +439,17 @@ export default class ImportUtil extends React.PureComponent {
/
>
<
/TabPane
>
)}
<
TabPane
tab
=
{
<
span
style
=
{{
color
:
'green'
}}
>
验证成功列表
<
/span>} key="2"
>
<
TabPane
tab
=
{
<
span
style
=
{{
color
:
'green'
}}
>
验证成功列表
<
/span>} key='2'
>
<
Button
style
=
{{
marginTop
:
5
,
marginBottom
:
5
}}
type
=
"primary"
type
=
'primary'
onClick
=
{
this
.
exportError
.
bind
(
this
,
column2
,
this
.
state
.
sucData
)}
>
导出正确信息
<
/Button
>
<
Table
columns
=
{
column2
}
size
=
"small"
size
=
'small'
style
=
{{
overflow
:
'auto'
}}
dataSource
=
{
this
.
state
.
sucData
}
bordered
=
{
true
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论