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

1111

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