提交 9c58e2b8 authored 作者: tb53863844's avatar tb53863844

修改bug

上级 7cf71dcb
...@@ -95,22 +95,25 @@ export default class ZdyTable extends Component { ...@@ -95,22 +95,25 @@ export default class ZdyTable extends Component {
const obj = JSON.parse(val.form.content); const obj = JSON.parse(val.form.content);
const xxx = obj.datas[obj.init]; const xxx = obj.datas[obj.init];
const fk = this.props.table ? val.formKey : obj.init; const fk = this.props.table ? val.formKey : obj.init;
this.setState({ this.initExcel(obj,()=>{
datas: obj.datas, this.setState({
width: this.props.table ? obj.datas[val.formKey].width : xxx.width, datas: obj.datas,
isBorder: this.props.table ? obj.datas[val.formKey].isBorder : xxx.isBorder, width: this.props.table ? obj.datas[val.formKey].width : xxx.width,
isRowCol: this.props.table ? obj.datas[val.formKey].isRowCol : xxx.isRowCol, isBorder: this.props.table ? obj.datas[val.formKey].isBorder : xxx.isBorder,
mapData, isRowCol: this.props.table ? obj.datas[val.formKey].isRowCol : xxx.isRowCol,
currentFormKey: fk, mapData,
currentFormTitle: this.getCurrentFormTitle(obj, fk), currentFormKey: fk,
sqlData, currentFormTitle: this.getCurrentFormTitle(obj, fk),
isEdit: !this.props.formKey, sqlData,
items: this.props.table ? obj.datas[val.formKey].items : xxx.items, isEdit: !this.props.formKey,
defaultValues: val.form.defaultValues, items: this.props.table ? obj.datas[val.formKey].items : xxx.items,
appId: val.appId, defaultValues: val.form.defaultValues,
isReady: true, appId: val.appId,
formConfig: xxx, isReady: true,
}, () => this.initExcel(obj)); formConfig: xxx,
})
})
return; return;
} }
if (isCg === 'yes') { if (isCg === 'yes') {
...@@ -148,26 +151,29 @@ export default class ZdyTable extends Component { ...@@ -148,26 +151,29 @@ export default class ZdyTable extends Component {
} }
const obj = JSON.parse(val.unifiedServicePatternModel.content); const obj = JSON.parse(val.unifiedServicePatternModel.content);
const xxx = obj.datas[obj.init]; const xxx = obj.datas[obj.init];
this.setState({ this.initExcel(obj,()=>{
items: xxx.items, this.setState({
init: { ...this.state.init, ...JSON.parse(val.content) }, items: xxx.items,
datas: obj.datas, init: { ...this.state.init, ...JSON.parse(val.content) },
isEdit: !this.props.formKey, datas: obj.datas,
currentFormKey: obj.init, isEdit: !this.props.formKey,
currentFormTitle: this.getCurrentFormTitle(obj, obj.init), currentFormKey: obj.init,
width: xxx.width, currentFormTitle: this.getCurrentFormTitle(obj, obj.init),
isBorder: xxx.isBorder, width: xxx.width,
isRowCol: xxx.isRowCol, isBorder: xxx.isBorder,
mapData, isRowCol: xxx.isRowCol,
sqlData, mapData,
defaultValues: val.unifiedServicePatternModel.defaultValues, sqlData,
appId: val.appId, defaultValues: val.unifiedServicePatternModel.defaultValues,
isReady: true, appId: val.appId,
formConfig: xxx, isReady: true,
defaultBinds: this.props.table formConfig: xxx,
? obj.datas[val.taskFormKey].defaultBinds defaultBinds: this.props.table
: xxx.defaultBinds, ? obj.datas[val.taskFormKey].defaultBinds
}, () => this.initExcel(obj)); : xxx.defaultBinds,
})
})
return; return;
} }
if ( if (
...@@ -208,6 +214,7 @@ export default class ZdyTable extends Component { ...@@ -208,6 +214,7 @@ export default class ZdyTable extends Component {
: val.taskFormKey : val.taskFormKey
? val.taskFormKey ? val.taskFormKey
: obj.init; : obj.init;
this.initExcel(obj,()=>
this.setState( this.setState(
{ {
appId: val.id, appId: val.id,
...@@ -231,8 +238,7 @@ export default class ZdyTable extends Component { ...@@ -231,8 +238,7 @@ export default class ZdyTable extends Component {
init: { ...this.state.init, ...(val.isSecond ? this.props.obj : {}) }, init: { ...this.state.init, ...(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):'':{},// 移动端默认值设置
}, },() => {
() => {
/** /**
* 为二维码快捷发起时自动设置新默认值 * 为二维码快捷发起时自动设置新默认值
*/ */
...@@ -240,8 +246,7 @@ export default class ZdyTable extends Component { ...@@ -240,8 +246,7 @@ export default class ZdyTable extends Component {
this.props.form.setFieldsValue(formDeafault); this.props.form.setFieldsValue(formDeafault);
} }
this.initExcel(obj); this.initExcel(obj);
}, } ));
);
} catch (e) { } catch (e) {
console.log('公式配置有误', e); console.log('公式配置有误', e);
} }
...@@ -350,7 +355,7 @@ export default class ZdyTable extends Component { ...@@ -350,7 +355,7 @@ export default class ZdyTable extends Component {
configs; configs;
initExcel = (configs, callback) => { initExcel = (configs, callback) => {
if (configs == null || configs.trees == null){ if (configs == null || configs.trees == null){
// if (callback) callback(); if (callback) callback();
return ; return ;
} }
...@@ -429,22 +434,25 @@ export default class ZdyTable extends Component { ...@@ -429,22 +434,25 @@ export default class ZdyTable extends Component {
} }
const obj = JSON.parse(val.form.content); const obj = JSON.parse(val.form.content);
const xxx = obj.datas[obj.init]; const xxx = obj.datas[obj.init];
this.setState({ this.initExcel(obj,()=>{
datas: obj.datas, this.setState({
width: this.props.table ? obj.datas[val.formKey].width : xxx.width, datas: obj.datas,
isRowCol: this.props.table ? obj.datas[val.formKey].isRowCol : xxx.isRowCol, width: this.props.table ? obj.datas[val.formKey].width : xxx.width,
isBorder: this.props.table ? obj.datas[val.formKey].isBorder : xxx.isBorder, isRowCol: this.props.table ? obj.datas[val.formKey].isRowCol : xxx.isRowCol,
mapData, isBorder: this.props.table ? obj.datas[val.formKey].isBorder : xxx.isBorder,
currentFormKey: this.props.table ? val.formKey : obj.init, mapData,
currentFormTitle: this.getCurrentFormTitle(obj, fk), currentFormKey: this.props.table ? val.formKey : obj.init,
sqlData, currentFormTitle: this.getCurrentFormTitle(obj, fk),
isEdit: !this.props.formKey, sqlData,
items: this.props.table ? obj.datas[val.formKey].items : xxx.items, isEdit: !this.props.formKey,
defaultValues: val.form.defaultValues, items: this.props.table ? obj.datas[val.formKey].items : xxx.items,
appId: val.appId, defaultValues: val.form.defaultValues,
isReady: true, appId: val.appId,
formConfig: xxx, isReady: true,
}, () => this.initExcel(obj)); formConfig: xxx,
})
})
return; return;
} }
if (isCg === 'yes') { if (isCg === 'yes') {
...@@ -469,26 +477,29 @@ export default class ZdyTable extends Component { ...@@ -469,26 +477,29 @@ export default class ZdyTable extends Component {
} }
const obj = JSON.parse(val.unifiedServicePatternModel.content); const obj = JSON.parse(val.unifiedServicePatternModel.content);
const xxx = obj.datas[obj.init]; const xxx = obj.datas[obj.init];
this.setState({ this.initExcel(obj,()=>{
items: xxx.items, this.setState({
init: { ...this.state.init, ...JSON.parse(val.content) }, items: xxx.items,
datas: obj.datas, init: { ...this.state.init, ...JSON.parse(val.content) },
isEdit: !this.props.formKey, datas: obj.datas,
currentFormKey: obj.init, isEdit: !this.props.formKey,
currentFormTitle: this.getCurrentFormTitle(obj, obj.init), currentFormKey: obj.init,
width: xxx.width, currentFormTitle: this.getCurrentFormTitle(obj, obj.init),
isBorder: xxx.isBorder, width: xxx.width,
isRowCol: xxx.isRowCol, isBorder: xxx.isBorder,
mapData, isRowCol: xxx.isRowCol,
sqlData, mapData,
defaultValues: val.unifiedServicePatternModel.defaultValues, sqlData,
appId: val.appId, defaultValues: val.unifiedServicePatternModel.defaultValues,
isReady: true, appId: val.appId,
formConfig: xxx, isReady: true,
defaultBinds: this.props.table formConfig: xxx,
? obj.datas[val.taskFormKey].defaultBinds defaultBinds: this.props.table
: xxx.defaultBinds, ? obj.datas[val.taskFormKey].defaultBinds
}, () => this.initExcel(obj)); : xxx.defaultBinds,
})
})
return; return;
} }
const mapData = {}; const mapData = {};
...@@ -516,25 +527,28 @@ export default class ZdyTable extends Component { ...@@ -516,25 +527,28 @@ export default class ZdyTable extends Component {
: val.taskFormKey : val.taskFormKey
? val.taskFormKey ? val.taskFormKey
: obj.init; : obj.init;
this.setState({ this.initExcel(obj,()=>{
appId: val.id, this.setState({
datas: obj.datas, appId: val.id,
mapData, datas: obj.datas,
sqlData, mapData,
defaultValues: val.unifiedServicePatternModel.defaultValues, sqlData,
isEdit: !this.props.formKey, defaultValues: val.unifiedServicePatternModel.defaultValues,
currentFormKey: fk, isEdit: !this.props.formKey,
currentFormTitle: this.getCurrentFormTitle(obj, fk), currentFormKey: fk,
defaultBinds: this.props.table ? obj.datas[val.taskFormKey].defaultBinds : xxx.defaultBinds, currentFormTitle: this.getCurrentFormTitle(obj, fk),
width: this.props.table ? obj.datas[val.taskFormKey].width : xxx.width, defaultBinds: this.props.table ? obj.datas[val.taskFormKey].defaultBinds : xxx.defaultBinds,
isBorder: this.props.table ? obj.datas[val.taskFormKey].isBorder : xxx.isBorder, width: this.props.table ? obj.datas[val.taskFormKey].width : xxx.width,
isRowCol: this.props.table ? obj.datas[val.taskFormKey].isRowCol : xxx.isRowCol, isBorder: this.props.table ? obj.datas[val.taskFormKey].isBorder : xxx.isBorder,
items: this.props.table ? obj.datas[val.taskFormKey].items : xxx.items, isRowCol: this.props.table ? obj.datas[val.taskFormKey].isRowCol : xxx.isRowCol,
isReady: true, items: this.props.table ? obj.datas[val.taskFormKey].items : xxx.items,
init: { ...this.state.init, ...(val.isSecond ? this.props.obj : {}) }, isReady: true,
formConfig: xxx, init: { ...this.state.init, ...(val.isSecond ? this.props.obj : {}) },
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置 formConfig: xxx,
}, () => this.initExcel(obj)); // init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
})
})
} catch (e) { } catch (e) {
console.log('公式配置有误', e); console.log('公式配置有误', e);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论