From a70940450c021a47e69abdf8fa8f7f98594601cc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 13 十二月 2019 17:36:54 +0800 Subject: [PATCH] 2019-12-13 --- src/templates/modalconfig/modalform/index.jsx | 16 ++++++---------- 1 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/templates/modalconfig/modalform/index.jsx b/src/templates/modalconfig/modalform/index.jsx index aa96845..5ce3d76 100644 --- a/src/templates/modalconfig/modalform/index.jsx +++ b/src/templates/modalconfig/modalform/index.jsx @@ -1,6 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { Form, Row, Col, Input, Select, Icon, Radio, notification, InputNumber } from 'antd' +import { dateOptions } from '@/utils/option.js' import EditTable from '../editable' import './index.scss' @@ -16,12 +17,7 @@ state = { openType: null, resourceType: null, - formlist: null, - dateoptions: { - date: [{value: '', text: '绌�'}, {value: '0', text: '褰撳ぉ'}, {value: 1, text: '鍓嶄竴澶�'}, {value: 3, text: '鍓嶄笁澶�'}, {value: 7, text: '鍓嶄竷澶�'}, {value: 30, text: '鍓�30澶�'}], - datemonth: [{value: '', text: '绌�'}, {value: '0', text: '鏈湀'}, {value: 1, text: '涓婃湀'}, {value: 3, text: '鍓嶄笁鏈�'}, {value: 6, text: '鍓嶅叚鏈�'}], - datetime: [{value: '', text: '绌�'}, {value: '0', text: '鐜板湪'}, {value: 1, text: '鏄ㄥぉ'}, {value: 3, text: '鍓嶄笁澶�'}, {value: 7, text: '鍓嶄竷澶�'}, {value: 30, text: '鍓�30澶�'}], - } + formlist: null } UNSAFE_componentWillMount () { @@ -47,8 +43,8 @@ openType: type, resourceType: resourceType, formlist: formlist.map(form => { - if (this.state.dateoptions.hasOwnProperty(type) && form.key === 'initval') { - form.options = this.state.dateoptions[type] + if (dateOptions.hasOwnProperty(type) && form.key === 'initval') { + form.options = dateOptions[type] form.type = 'select' } else if (type === 'number' && form.key === 'initval') { form.type = 'number' @@ -81,8 +77,8 @@ formlist: this.state.formlist.map(form => { form.hidden = !_options.includes(form.key) if (form.key === 'initval') { - if (this.state.dateoptions.hasOwnProperty(value)) { - form.options = this.state.dateoptions[value] + if (dateOptions.hasOwnProperty(value)) { + form.options = dateOptions[value] form.type = 'select' form.initVal = '' } else if (value === 'number') { -- Gitblit v1.8.0