提交 50fdc05c authored 作者: tb53863844's avatar tb53863844

开发

上级 49950574
...@@ -55,13 +55,10 @@ export default class ZdyTable extends Component { ...@@ -55,13 +55,10 @@ export default class ZdyTable extends Component {
} = this.props; } = this.props;
if (isPreview || isChild) { if (isPreview || isChild) {
this.setState({ this.initExcel({ datas: this.props.datas, trees: this.props.trees },()=>this.setState({ ...this.state,
...this.state,
...this.props, ...this.props,
isReady: true,
formConfig: { ...this.state.formConfig, style: this.props.style }, formConfig: { ...this.state.formConfig, style: this.props.style }, isReady: true,}));
},()=> this.initExcel({ datas: this.props.datas, trees: this.props.trees }));
return; return;
} }
...@@ -358,18 +355,21 @@ initExcel = (configs, callback) => { ...@@ -358,18 +355,21 @@ initExcel = (configs, callback) => {
const tr = configs.trees[key] const tr = configs.trees[key]
this.childExcel(sheetData, configs.datas, tr) this.childExcel(sheetData, configs.datas, tr)
} }
const hfInstance = HyperFormula.buildFromSheets(sheetData, {}); const hfInstance = HyperFormula.buildFromSheets(sheetData, {});
this.hfInstance = hfInstance this.hfInstance = hfInstance
console.log( this.hfInstance,"yyyyyyyyyyyyyy")
if (callback) callback() if (callback) callback()
} }
getCellValue = (i, j, currentTitle) => { getCellValue = (i, j, currentTitle) => {
let hfInstance = this.props.hfInstance||this.hfInstance console.log( this.props.hfInstance,this.hfInstance,"xxxxxxxxxxxxxxx")
let hfInstance = this.props.hfInstance?this.props.hfInstance:this.hfInstance
if (hfInstance && currentTitle) { 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) { if (x && x.value != null) {
x = x.value x = x.value
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论