提交 0ba0703b authored 作者: 钟是志's avatar 钟是志

CheckRecord 组件修改

上级 2e86fce1
...@@ -31,7 +31,12 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest } ...@@ -31,7 +31,12 @@ export default function RenderForm({ get = 'web', isCg = 'yes', style, ...rest }
} }
return ( return (
<div className={styles.zyd_onestop_style_class} style={style}> <div className={styles.zyd_onestop_style_class} style={style}>
<ZdyTable ref={tableRoot} get={get} isCg={isCg} {...rest} {...content} /> <ZdyTable ref={tableRoot}
get={get}
{...rest}
isQuery={true}
init={undefined}
/>
</div> </div>
); );
} }
......
...@@ -18,7 +18,6 @@ import { isJSON } from '@/webPublic/one_stop_public/copy'; ...@@ -18,7 +18,6 @@ import { isJSON } from '@/webPublic/one_stop_public/copy';
export default class ZdyTable extends Component { export default class ZdyTable extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
objRealTime: {}, objRealTime: {},
isChange: false, isChange: false,
...@@ -57,9 +56,8 @@ export default class ZdyTable extends Component { ...@@ -57,9 +56,8 @@ export default class ZdyTable extends Component {
} = this.props; } = this.props;
// if(this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e'){ // if(this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e'){
// debugger; // debugger;
// } // }
if (isPreview || isChild ) { if (isPreview || isChild) {
this.initExcel({ datas: this.props.datas, trees: this.props.trees }, () => { this.initExcel({ datas: this.props.datas, trees: this.props.trees }, () => {
this.setState({ this.setState({
...this.state, ...this.state,
...@@ -74,7 +72,7 @@ export default class ZdyTable extends Component { ...@@ -74,7 +72,7 @@ export default class ZdyTable extends Component {
: null, : null,
}); });
}); });
return; return;
} }
...@@ -342,13 +340,20 @@ export default class ZdyTable extends Component { ...@@ -342,13 +340,20 @@ export default class ZdyTable extends Component {
items: items, items: items,
}; };
} }
this.initExcel({ datas, trees }, () => { console.log(sheets,datas);
this.setState({ isChange: !this.state.isChange }, () => { this.initExcel(
if (callback) callback(); {
}); datas,
trees,
},
() => {
this.setState({ isChange: !this.state.isChange }, () => {
if (callback) callback();
});
console.log('公式导入excel成功'); console.log('公式导入excel成功');
}); },
);
}; };
hfInstance; hfInstance;
...@@ -380,14 +385,12 @@ export default class ZdyTable extends Component { ...@@ -380,14 +385,12 @@ export default class ZdyTable extends Component {
configs; configs;
initExcel = (configs, callback) => { initExcel = (configs, callback) => {
this.configs = configs; this.configs = configs;
console.log(configs);
if (configs == null || configs.trees == null) { if (configs == null || configs.trees == null) {
if (callback) callback(); if (callback) callback();
return; return;
} }
const sheetData = {}; const sheetData = {};
for (var key in configs.trees) { for (var key in configs.trees) {
const tr = configs.trees[key]; const tr = configs.trees[key];
...@@ -423,7 +426,6 @@ export default class ZdyTable extends Component { ...@@ -423,7 +426,6 @@ export default class ZdyTable extends Component {
isPreview, // 是否为预览模式 isPreview, // 是否为预览模式
isChild, // 是否为子表单 isChild, // 是否为子表单
} = nextProps; } = nextProps;
if (isPreview || isChild) { if (isPreview || isChild) {
this.setState( this.setState(
{ {
...@@ -581,8 +583,9 @@ export default class ZdyTable extends Component { ...@@ -581,8 +583,9 @@ export default class ZdyTable extends Component {
items: this.props.table ? obj.datas[val.taskFormKey].items : xxx.items, items: this.props.table ? obj.datas[val.taskFormKey].items : xxx.items,
isReady: true, isReady: true,
init: { init: {
...this.state.init, ...this.state.init,
...(val.isSecond ? this.props.obj : {}) }, ...(val.isSecond ? this.props.obj : {}),
},
formConfig: xxx, formConfig: xxx,
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置 // init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
}); });
...@@ -740,9 +743,9 @@ export default class ZdyTable extends Component { ...@@ -740,9 +743,9 @@ export default class ZdyTable extends Component {
updateTime = moment(+this.props.postData?.updateTime).format('llll'); updateTime = moment(+this.props.postData?.updateTime).format('llll');
} }
if(this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e'){ if (this.props.currentFormKey === 'aa20cdbd-2019-45ea-8cdf-715aa46e132e') {
console.log(this); console.log(this);
} }
switch (get) { switch (get) {
case 'web': case 'web':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论