Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
WebPublic
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
前端开发小组
WebPublic
Commits
92b7c78c
提交
92b7c78c
authored
10月 29, 2020
作者:
钟是志
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
一站式bug修改. this.initExcel 方法
可能存在其他问题 要喊欢哥确认
上级
d2568fef
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
100 行增加
和
90 行删除
+100
-90
index.jsx
one_stop_public/Table/index.jsx
+88
-78
index.js
one_stop_public/libs/formList/StandardTable/index.js
+10
-2
FormModal.jsx
one_stop_public/tableCompon/FormModal.jsx
+0
-8
index.jsx
one_stop_public/tableCompon/index.jsx
+2
-2
没有找到文件。
one_stop_public/Table/index.jsx
浏览文件 @
92b7c78c
...
...
@@ -13,12 +13,13 @@ import { HyperFormula } from 'hyperformula';
import
TableCom
from
'../tableCompon'
;
import
IsNewTable
from
'./isNewMobileTable'
;
import
maintain
from
'../assets/maintain.png'
;
export
default
class
ZdyTable
extends
Component
{
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
isChange
:
false
,
isChange
:
false
,
selects
:
new
Map
(),
left
:
0
,
top
:
0
,
...
...
@@ -54,11 +55,14 @@ export default class ZdyTable extends Component {
}
=
this
.
props
;
if
(
isPreview
||
isChild
)
{
this
.
initExcel
({
datas
:
this
.
props
.
datas
,
trees
:
this
.
props
.
trees
},()
=>
this
.
setState
({
...
this
.
state
,
this
.
initExcel
({
datas
:
this
.
props
.
datas
,
trees
:
this
.
props
.
trees
},
()
=>
{
this
.
setState
(
{
...
this
.
state
,
...
this
.
props
,
formConfig
:
{
...
this
.
state
.
formConfig
,
style
:
this
.
props
.
style
},
isReady
:
true
,}));
formConfig
:
{
...
this
.
state
.
formConfig
,
style
:
this
.
props
.
style
},
isReady
:
true
,
});
});
return
;
}
...
...
@@ -203,7 +207,7 @@ export default class ZdyTable extends Component {
?
this
.
props
.
formKey
:
val
.
taskFormKey
?
val
.
taskFormKey
:
obj
.
init
:
obj
.
init
;
this
.
setState
(
{
appId
:
val
.
id
,
...
...
@@ -235,7 +239,7 @@ export default class ZdyTable extends Component {
if
(
isQRCode
)
{
this
.
props
.
form
.
setFieldsValue
(
formDeafault
);
}
this
.
initExcel
(
obj
)
this
.
initExcel
(
obj
)
;
},
);
}
catch
(
e
)
{
...
...
@@ -243,15 +247,16 @@ export default class ZdyTable extends Component {
}
}
importExcel
=
(
res
)
=>
{
const
{
datas
,
trees
}
=
this
.
configs
const
sheets
=
res
.
sheets
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
const
items
=
[]
;
const
cc
=
sheets
[
s
].
cells
;
for
(
var
i
=
0
;
i
<
cc
.
length
;
i
++
)
{
const
rows
=
[];
const
rr
=
cc
[
i
];
...
...
@@ -297,7 +302,7 @@ export default class ZdyTable extends Component {
}
}
if
(
datas
[
uuid
]
==
null
)
{
if
(
datas
[
uuid
]
==
null
)
{
trees
.
push
({
title
:
sheets
[
s
].
name
,
key
:
uuid
});
}
datas
[
uuid
]
=
{
...
...
@@ -308,74 +313,78 @@ export default class ZdyTable extends Component {
};
}
this
.
initExcel
({
datas
,
trees
},
()
=>
this
.
setState
({
isChange
:
!
this
.
state
.
isChange
}))
console
.
log
(
"公式导入excel成功"
)
this
.
initExcel
({
datas
,
trees
},
()
=>
this
.
setState
({
isChange
:
!
this
.
state
.
isChange
}));
console
.
log
(
'公式导入excel成功'
);
}
}
;
hfInstance
;
childExcel
=
(
sheetData
,
datas
,
tr
)
=>
{
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
])
this
.
childExcel
(
sheetData
,
datas
,
tr
.
children
[
c
]);
}
}
const
data
=
datas
[
tr
.
key
]
const
all
=
[]
const
data
=
datas
[
tr
.
key
];
const
all
=
[];
for
(
var
i
=
0
;
i
<
data
.
items
.
length
;
i
++
)
{
const
row
=
data
.
items
[
i
]
const
r
=
[]
const
row
=
data
.
items
[
i
];
const
r
=
[];
for
(
var
j
=
0
;
j
<
row
.
length
;
j
++
)
{
const
col
=
row
[
j
]
if
(
col
.
content
?.
comName
==
"Excel"
)
{
r
.
push
(
col
.
content
.
initialValue
)
const
col
=
row
[
j
];
if
(
col
.
content
?.
comName
==
'Excel'
)
{
r
.
push
(
col
.
content
.
initialValue
);
}
else
{
r
.
push
(
''
)
r
.
push
(
''
);
}
}
all
.
push
(
r
)
all
.
push
(
r
);
}
sheetData
[
tr
.
title
]
=
all
sheetData
[
tr
.
title
]
=
all
;
}
configs
initExcel
=
(
configs
,
callback
)
=>
{
};
configs
;
initExcel
=
(
configs
,
callback
)
=>
{
if
(
configs
==
null
||
configs
.
trees
==
null
)
return
if
(
configs
==
null
||
configs
.
trees
==
null
){
if
(
callback
)
callback
();
return
;
}
if
(
configs
.
trees
!=
null
)
this
.
configs
=
configs
if
(
configs
.
trees
!=
null
)
this
.
configs
=
configs
;
const
sheetData
=
{}
const
sheetData
=
{};
for
(
var
key
in
configs
.
trees
)
{
const
tr
=
configs
.
trees
[
key
]
this
.
childExcel
(
sheetData
,
configs
.
datas
,
tr
)
const
tr
=
configs
.
trees
[
key
];
this
.
childExcel
(
sheetData
,
configs
.
datas
,
tr
);
}
const
hfInstance
=
HyperFormula
.
buildFromSheets
(
sheetData
,
{});
this
.
hfInstance
=
hfInstance
if
(
callback
)
callback
()
}
getCellValue
=
(
i
,
j
,
currentTitle
)
=>
{
let
hfInstance
=
this
.
props
.
hfInstance
?
this
.
props
.
hfInstance
:
this
.
hfInstance
this
.
hfInstance
=
hfInstance
;
if
(
callback
)
callback
();
};
getCellValue
=
(
i
,
j
,
currentTitle
)
=>
{
let
hfInstance
=
this
.
props
.
hfInstance
?
this
.
props
.
hfInstance
:
this
.
hfInstance
;
if
(
hfInstance
&&
currentTitle
)
{
let
x
=
hfInstance
.
getCellValue
({
col
:
j
,
row
:
i
,
sheet
:
hfInstance
.
getSheetId
(
currentTitle
)
})
let
x
=
hfInstance
.
getCellValue
({
col
:
j
,
row
:
i
,
sheet
:
hfInstance
.
getSheetId
(
currentTitle
)
})
;
if
(
x
&&
x
.
value
!=
null
)
{
x
=
x
.
value
x
=
x
.
value
;
}
return
x
;
}
}
componentWillReceiveProps
(
nextProps
)
{
};
componentWillReceiveProps
(
nextProps
)
{
const
{
postData
,
// 数据源
isCg
,
// 用户点击草稿页面进入
...
...
@@ -391,10 +400,7 @@ componentWillReceiveProps(nextProps) {
...
nextProps
,
isReady
:
true
,
formConfig
:
{
...
this
.
state
.
formConfig
,
style
:
nextProps
.
style
},
},()
=>
this
.
initExcel
({
datas
:
nextProps
.
datas
,
trees
:
nextProps
.
trees
}));
},
()
=>
this
.
initExcel
({
datas
:
nextProps
.
datas
,
trees
:
nextProps
.
trees
}));
return
;
}
...
...
@@ -510,7 +516,7 @@ componentWillReceiveProps(nextProps) {
?
this
.
props
.
formKey
:
val
.
taskFormKey
?
val
.
taskFormKey
:
obj
.
init
:
obj
.
init
;
this
.
setState
({
appId
:
val
.
id
,
datas
:
obj
.
datas
,
...
...
@@ -533,9 +539,9 @@ componentWillReceiveProps(nextProps) {
}
catch
(
e
)
{
console
.
log
(
'公式配置有误'
,
e
);
}
}
}
checkAllHidden
=
row
=>
{
checkAllHidden
=
row
=>
{
for
(
var
i
=
0
;
i
<
row
.
length
;
i
++
)
{
if
(
row
[
i
].
hidden
==
null
||
!
row
[
i
].
hidden
)
{
return
false
;
...
...
@@ -545,9 +551,9 @@ checkAllHidden = row => {
delete
row
[
i
].
hidden
;
}
return
true
;
};
};
countMax
=
items
=>
{
countMax
=
items
=>
{
let
max
=
0
;
items
.
forEach
(
r
=>
{
if
(
r
.
length
>
max
)
{
...
...
@@ -555,38 +561,38 @@ countMax = items => {
}
});
return
max
;
};
getCurrentFormTitle
=
(
obj
,
key
)
=>
{
};
getCurrentFormTitle
=
(
obj
,
key
)
=>
{
if
(
obj
==
null
)
return
const
{
trees
}
=
obj
if
(
trees
==
null
)
return
return
this
.
getT
(
trees
,
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
)
};
getCurrentFormTitle2
=
(
key
)
=>
{
if
(
this
.
configs
==
null
)
return
;
const
{
trees
}
=
this
.
configs
;
if
(
trees
==
null
)
return
;
return
this
.
getT
(
trees
,
key
);
}
getT
=
(
trees
,
key
)
=>
{
};
getT
=
(
trees
,
key
)
=>
{
for
(
var
i
=
0
;
i
<
trees
.
length
;
i
++
)
{
if
(
trees
[
i
].
children
==
null
||
trees
[
i
].
children
.
length
==
0
)
{
if
(
trees
[
i
].
children
==
null
||
trees
[
i
].
children
.
length
==
0
)
{
if
(
trees
[
i
].
key
==
key
)
{
return
trees
[
i
].
title
return
trees
[
i
].
title
;
}
}
else
{
}
else
{
return
this
.
getT
(
trees
[
i
].
children
,
key
)
return
this
.
getT
(
trees
[
i
].
children
,
key
);
}
}
}
};
render
()
{
render
()
{
const
{
width
,
...
...
@@ -625,7 +631,7 @@ render() {
isDynamic
,
// 是否为大数据页面
isWebPrint
,
// 打印界面
isWebPrintEnd
,
isPreview
isPreview
,
}
=
this
.
props
;
let
style
=
{};
if
(
formConfig
.
style
!=
null
)
{
...
...
@@ -674,6 +680,10 @@ render() {
width
:
'100%'
,
paddingBottom
:
paddingBottom
!=
null
?
paddingBottom
:
isWebPrint
?
0
:
'10px'
,
};
if
(
currentFormKey
)
{
console
.
log
(
currentFormKey
);
}
if
(
!
isReady
)
return
<></>;
if
(
this
.
props
.
postData
?.
isUpdate
)
{
updateTime
=
moment
(
+
this
.
props
.
postData
?.
updateTime
).
format
(
'llll'
);
...
...
@@ -726,7 +736,7 @@ render() {
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
,
})(<
Input
type=
"hidden"
/>);
})(<
Input
type=
"hidden"
/>);
})
:
''
}
...
...
@@ -906,7 +916,7 @@ render() {
return
this
.
props
.
form
.
getFieldDecorator
(
name
,
{
initialValue
:
value
,
})(<
Input
type=
"hidden"
/>);
})(<
Input
type=
"hidden"
/>);
})
:
''
}
<
IsNewTable
...
...
@@ -952,5 +962,5 @@ render() {
</>
);
}
}
}
}
one_stop_public/libs/formList/StandardTable/index.js
浏览文件 @
92b7c78c
...
...
@@ -81,7 +81,9 @@ class StandardTable extends Component {
showQuickJumper
:
true
,
...
pagination
,
};
if
(
typeof
paginationProps
.
total
===
'string'
){
paginationProps
.
total
=
Number
(
paginationProps
.
total
)
||
0
;
}
const
rowSelection
=
{
selectedRowKeys
,
onChange
:
this
.
handleRowSelectChange
,
...
...
@@ -116,7 +118,13 @@ class StandardTable extends Component {
loading
=
{
loading
}
rowKey
=
{
rowKey
||
'key'
}
rowSelection
=
{
typeof
noSelectRow
!==
'undefined'
&&
noSelectRow
?
null
:
rowSelection
}
dataSource
=
{
list
}
dataSource
=
{
list
.
map
((
x
)
=>
{
return
{
id
:
Math
.
random
()
*
10000
+
''
,
...
x
,
}
})}
bordered
=
{
bordered
}
columns
=
{
columns
}
size
=
"small"
...
...
one_stop_public/tableCompon/FormModal.jsx
浏览文件 @
92b7c78c
...
...
@@ -3,13 +3,7 @@ import {Button, Form, Input, InputNumber, Modal, Select} from "antd";
export
default
class
FormModal
extends
React
.
Component
{
render
()
{
return
(
<
Modal
destroyOnClose
...
...
@@ -26,4 +20,3 @@ export default class FormModal extends React.Component {
);
}
}
\ No newline at end of file
one_stop_public/tableCompon/index.jsx
浏览文件 @
92b7c78c
...
...
@@ -1471,7 +1471,6 @@ export default class tableCom extends Component {
return
<></>;
return
<
QRCode
{
...
this
.
state
.
option
}
key=
{
this
.
props
.
uuid
}
/>;
}
if
(
json
.
comName
==
'Echart'
)
{
return
(
<
ReactEcharts
...
...
@@ -1503,7 +1502,6 @@ export default class tableCom extends Component {
if
(
formKey
==
fk
)
{
return
<>
片段表单key不能和自身相同
</>;
}
return
(
<>
{
this
.
props
.
form
.
getFieldDecorator
(
this
.
props
.
uuid
,
{
...
...
@@ -3124,6 +3122,7 @@ export default class tableCom extends Component {
);
}
if
(
get
===
'web'
)
{
if
(
!
isEdit
)
{
return
(
<
Row
...
...
@@ -3200,6 +3199,7 @@ export default class tableCom extends Component {
</
Row
>
);
}
else
{
return
(
<>
{
modalCode
?
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论