提交 30b16231 authored 作者: ch's avatar ch

1111

上级 ec575f9a
......@@ -275,6 +275,9 @@ export default class ZdyTable extends Component {
}
importExcel = (res, callback) => {
if(this.props.importExcel) {
this.props.importExcel(res,callback);
return }
const { datas, trees } = this.configs;
const sheets = res.sheets;
......@@ -340,7 +343,6 @@ export default class ZdyTable extends Component {
items: items,
};
}
console.log(sheets,datas);
this.initExcel(
{
datas,
......@@ -624,7 +626,7 @@ export default class ZdyTable extends Component {
};
getCurrentFormTitle2 = (key) => {
if (this.configs == null) return;
const { trees } = this.configs;
const trees = this.configs&&this.configs.trees?this.configs.trees:this.props.trees;
if (trees == null) return;
return this.getT(trees, key);
};
......@@ -632,15 +634,19 @@ export default class ZdyTable extends Component {
this.setState({ objRealTime: obj });
};
getT = (trees, key) => {
for (var i = 0; i < trees.length; i++) {
if (trees[i].children == null || trees[i].children.length == 0) {
for (var i in trees) {
if (trees[i].key == key) {
return trees[i].title;
}
} else {
return this.getT(trees[i].children, key);
if (trees[i].children != null&& trees[i].children.length> 0) {
const x = this.getT(trees[i].children, key);
if(x!=null) return x
}
}
return null;
};
render() {
......@@ -682,8 +688,10 @@ export default class ZdyTable extends Component {
isWebPrint, // 打印界面
isWebPrintEnd,
isPreview,
trees,
} = this.props;
const trees = this.configs&&this.configs.trees?this.configs.trees:this.props.trees;
let get;
if (viewMode != null && viewMode != '') {
get = viewMode;
......
......@@ -1368,6 +1368,7 @@ export default class tableCom extends Component {
})(<Input type="hidden" />)}{' '}
<ZdyTable
taskId={this.props.taskId}
importExcel={this.props.importExcel}
setRealTimeValues={this.props.setRealTimeValues}
hfInstance={this.props.hfInstance}
currentFormTitle={
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论