| | |
| | | selectedTables: [], // 已选表名 |
| | | originConfig: null, // 原始菜单 |
| | | groupVisible: false, // 全局配置模态框 |
| | | curgroup: null // 当前组,新建或编辑 |
| | | curgroup: null, // 当前组,新建或编辑 |
| | | formItems: [], // 表单可选类型 |
| | | billCodes: null // 按钮中定义的单号生成函数字段集 |
| | | } |
| | | |
| | | /** |
| | |
| | | // 主菜单已有选择的表名,模态框没有表名时,复制主菜单表名 |
| | | _config.tables = _config.tables.length === 0 ? _menu.tables : _config.tables |
| | | |
| | | let _formItems = JSON.parse(JSON.stringify((Source.searchItems))) |
| | | if (editAction && editAction.intertype === 'inner' && !editAction.innerFunc) { |
| | | _formItems.push({ |
| | | type: 'form', |
| | | label: '函数变量', |
| | | subType: 'funcvar', |
| | | url: '' |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | menu: _menu, |
| | | config: _config, |
| | | formItems: _formItems, |
| | | billCodes: editAction && editAction.verify && editAction.verify.billcodes ? editAction.verify.billcodes : [], |
| | | selectedTables: _config.tables || [], |
| | | originConfig: JSON.parse(JSON.stringify(_config)), |
| | | modalformlist: [ |
| | |
| | | * 3、设置编辑参数项-formlist |
| | | */ |
| | | handleForm = (card) => { |
| | | const { billCodes } = this.state |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | |
| | | }, { |
| | | value: 'datetime', |
| | | text: this.state.dict['header.form.datetime'] |
| | | }, { |
| | | value: 'funcvar', |
| | | text: '函数变量' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | value: 'false', |
| | | text: this.state.dict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'linkfield', |
| | | label: '关联变量', |
| | | initVal: card.linkfield || '', |
| | | required: true, |
| | | options: billCodes.map(code => { |
| | | code.value = code.field |
| | | code.text = code.field |
| | | return code |
| | | }) |
| | | } |
| | | ] |
| | | }) |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { menu, config } = this.state |
| | | const { menu, config, formItems } = this.state |
| | | |
| | | return ( |
| | | <div className="modal-form-board"> |
| | |
| | | </Panel> |
| | | <Panel header={this.state.dict['header.menu.form']} key="1"> |
| | | <div className="search-element"> |
| | | {Source.searchItems.map((item, index) => { |
| | | {formItems.map((item, index) => { |
| | | return (<SourceElement key={index} content={item}/>) |
| | | })} |
| | | </div> |
| | |
| | | > |
| | | {<ModalForm |
| | | dict={this.state.dict} |
| | | formlist={this.state.formlist} |
| | | card={this.state.card} |
| | | billCodes={this.state.billCodes} |
| | | formlist={this.state.formlist} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | />} |
| | | </Modal> |