From 669d7cc31eb3728ad09bfb7ce6e615f5c571c14e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 08 一月 2020 15:58:39 +0800 Subject: [PATCH] 2020-01-08 --- src/templates/modalconfig/modalform/index.jsx | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/templates/modalconfig/modalform/index.jsx b/src/templates/modalconfig/modalform/index.jsx index c1e25a5..8c2d523 100644 --- a/src/templates/modalconfig/modalform/index.jsx +++ b/src/templates/modalconfig/modalform/index.jsx @@ -11,8 +11,7 @@ static propTpyes = { dict: PropTypes.object, // 瀛楀吀椤� formlist: PropTypes.any, - card: PropTypes.object, - billCodes: PropTypes.array + card: PropTypes.object } state = { @@ -23,7 +22,7 @@ UNSAFE_componentWillMount () { let formlist = JSON.parse(JSON.stringify(this.props.formlist)) - console.log(formlist) + let type = formlist.filter(cell => cell.key === 'type')[0].initVal let resourceType = formlist.filter(cell => cell.key === 'resourceType')[0].initVal let _options = ['label', 'field', 'initval', 'type', 'readonly', 'required'] // 榛樿鏄剧ず椤� @@ -45,9 +44,9 @@ if (type === 'link') { // 鍏宠仈绫诲瀷銆佸鍔犲叧鑱斿瓧娈� _options = [..._options, 'linkField'] } - console.log(type) - if (type === 'funcvar') { - _options = ['label', 'field', 'linkfield'] + + if (type === 'funcvar') { // 璁剧疆涓哄嚱鏁板彉閲忔椂锛屼笉闇�瑕佸叾浠栦俊鎭� + _options = ['label', 'field', 'type'] } this.setState({ @@ -103,7 +102,7 @@ } if (value === 'funcvar') { - _options = ['label', 'field', 'linkfield'] + _options = ['label', 'field', 'type'] } this.setState({ @@ -341,12 +340,10 @@ } } else if ((values.type === 'multiselect' || values.type === 'select' || values.type === 'link') && values.resourceType === '1') { values.options = [] - } - - if (!values.type) { - values.type = 'funcvar' + } else if (values.type === 'funcvar') { // 鍑芥暟鍙橀噺涓哄彧璇诲厓绱� values.readonly = 'true' } + if (isvalid) { resolve(values) } else { -- Gitblit v1.8.0