提交 76d6c137 authored 作者: chscls@163.com's avatar chscls@163.com

修改bug

上级 fc86474c
...@@ -663,22 +663,69 @@ export default class tableCom extends Component { ...@@ -663,22 +663,69 @@ export default class tableCom extends Component {
if (json.funcs != null && json.funcs != "") { if (json.funcs != null && json.funcs != "") {
let enu; let enu;
try { try {
this.getFunctionValue(json.funcs, { base52: this.props.uuid }, json) ; this.getFunctionValue(json.funcs, { base52: this.props.uuid }, json,()=>{
if (init != null && Object.keys(init).length > 0) {
} catch (e) { let base52 = dataColumn.base52
message.error("公式选项配置存在问题") let vlu=this.props.form.getFieldValue(base52)
if(vlu instanceof Array){
for(var i=0;i<this.state.options.length;i++){
if(vlu.includes(this.state.options[i].value)){
labs.push(this.state.options[i].label)
} }
if (init != null && Object.keys(init).length > 0) { }
}else{
for(var i=0;i<this.state.options.length;i++){
if(vlu==this.state.options[i].value){
labs.push(this.state.options[i].label)
break;
}
}
}
this.setState({labels:labs})
}else if (!this.props.isEdit && Object.keys(obj).length > 0) { }else if (!this.props.isEdit && Object.keys(obj).length > 0) {
let base52 = dataColumn.base52
if (this.props.fatherCode) {
const x = base52.split(".")
base52 = x[x.length - 1]
}
const vlu=obj[base52]
const labs=[]
if(vlu instanceof Array){
for(var i=0;i<this.state.options.length;i++){
if(vlu.includes(this.state.options[i].value)){
labs.push(this.state.options[i].label)
}
}
}else{
for(var i=0;i<this.state.options.length;i++){
if(vlu==this.state.options[i].value){
labs.push(this.state.options[i].label)
break;
}
}
}
this.setState({labels:labs})
}
}) ;
} catch (e) {
message.error("公式选项配置存在问题")
} }
} }
break; break;
} }
...@@ -695,7 +742,7 @@ export default class tableCom extends Component { ...@@ -695,7 +742,7 @@ export default class tableCom extends Component {
} }
} }
reqUtil = (base52, json, url, method, params, callback, options = {}) => { reqUtil = (base52, json,orgCallback, url, method, params, callback, options = {}) => {
//查缓存 //查缓存
var isChange = false; var isChange = false;
if(url.indexOf("http")===-1){ if(url.indexOf("http")===-1){
...@@ -738,7 +785,9 @@ export default class tableCom extends Component { ...@@ -738,7 +785,9 @@ export default class tableCom extends Component {
const res=callback(data) const res=callback(data)
if(res!=null&&!(typeof res === "function")){ if(res!=null&&!(typeof res === "function")){
this.setState({ options: res , selectDis: false }); this.setState({ options: res , selectDis: false },()=>{
if(orgCallback) orgCallback()
});
} }
}else if (json.comName == "Button") { }else if (json.comName == "Button") {
...@@ -815,7 +864,9 @@ export default class tableCom extends Component { ...@@ -815,7 +864,9 @@ export default class tableCom extends Component {
const res=callback(data) const res=callback(data)
if(res!=null&&!(typeof res === "function")){ if(res!=null&&!(typeof res === "function")){
this.setState({ options: res , selectDis: false }); this.setState({ options: res , selectDis: false },()=>{
if(orgCallback) orgCallback()
});
} }
}else if (json.comName == "Button") { }else if (json.comName == "Button") {
...@@ -871,7 +922,7 @@ export default class tableCom extends Component { ...@@ -871,7 +922,7 @@ export default class tableCom extends Component {
} }
sqlUtil = (base52, json, sqlKey, params, callback, options = {}) => { sqlUtil = (base52, json,orgCallback, sqlKey, params, callback, options = {}) => {
//查缓存 //查缓存
var isChange = false; var isChange = false;
...@@ -902,7 +953,9 @@ export default class tableCom extends Component { ...@@ -902,7 +953,9 @@ export default class tableCom extends Component {
if(json.optionType&&json.optionType=="func"){ if(json.optionType&&json.optionType=="func"){
const res=callback(data) const res=callback(data)
if(res!=null&&!(typeof res === "function")){ if(res!=null&&!(typeof res === "function")){
this.setState({ options: res , selectDis: false }); this.setState({ options: res , selectDis: false },()=>{
if(orgCallback)orgCallback()
});
} }
}else if (json.comName == "Button") { }else if (json.comName == "Button") {
try { try {
...@@ -981,7 +1034,9 @@ export default class tableCom extends Component { ...@@ -981,7 +1034,9 @@ export default class tableCom extends Component {
const res=callback(data) const res=callback(data)
if(res!=null&&!(typeof res === "function")){ if(res!=null&&!(typeof res === "function")){
this.setState({ options: res , selectDis: false }); this.setState({ options: res , selectDis: false },()=>{
if(orgCallback) orgCallback()
});
} }
}else if (json.comName == "Button") { }else if (json.comName == "Button") {
...@@ -1037,7 +1092,7 @@ export default class tableCom extends Component { ...@@ -1037,7 +1092,7 @@ export default class tableCom extends Component {
return "norefeshxxxxxxxxxxxxxxxxxxxx" return "norefeshxxxxxxxxxxxxxxxxxxxx"
} }
getFunctionValue = (fun, column, json) => { getFunctionValue = (fun, column, json,callback) => {
/* if (!this.props.isEdit) { /* if (!this.props.isEdit) {
return return
...@@ -1052,10 +1107,10 @@ export default class tableCom extends Component { ...@@ -1052,10 +1107,10 @@ export default class tableCom extends Component {
const value = fun1(obj,this.props.init, this.props.defaultValues, { clientType: this.props.get }, this.props.index, this.props.fatherCode, const value = fun1(obj,this.props.init, this.props.defaultValues, { clientType: this.props.get }, this.props.index, this.props.fatherCode,
{ {
moment: moment, moment: moment,
sql: this.sqlUtil.bind(this, base52, json), sql: this.sqlUtil.bind(this, base52, json,callback),
message: message,router:router, message: message,router:router,
setValues: this.setValues.bind(this, base52, json), setValues: this.setValues.bind(this, base52, json),
req: this.reqUtil.bind(this, base52, json), req: this.reqUtil.bind(this, base52, json,callback),
md5: md5, md5: md5,
render:this.getRender,base64:getBase64 render:this.getRender,base64:getBase64
}, },
...@@ -1079,7 +1134,9 @@ export default class tableCom extends Component { ...@@ -1079,7 +1134,9 @@ export default class tableCom extends Component {
if(value!=null&&!(typeof value === "function")){ if(value!=null&&!(typeof value === "function")){
this.setState({ options: value , selectDis: false }); this.setState({ options: value , selectDis: false },()=>{
if(callback) callback()
});
} }
} else if (json.comName == "Echart" || json.comName == "QRCode") { } else if (json.comName == "Echart" || json.comName == "QRCode") {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论