| | |
| | | param[setting.primaryKey] = primaryId |
| | | } |
| | | } else if (btn.sql) { |
| | | if (index !== 0) { |
| | | formdata = formdata.map(_data => { |
| | | if (_data.readin && cell.hasOwnProperty(_data.key)) { |
| | | _data.value = cell[_data.key] |
| | | } |
| | | return _data |
| | | }) |
| | | } |
| | | |
| | | param.ID = primaryId |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, cell, logcolumns)) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | |
| | | } |
| | | } else if (btn.intertype === 'outer') { |
| | | /** *********************调用外部接口************************* */ |
| | | if (2 > 1) return |
| | | if (!btn.interface) { // 接口地址不存在时报错 |
| | | this.actionSettingError() |
| | | _resolve() |
| | |
| | | |
| | | if (this.props.searchlist.length >= 4) { // 添加搜索、重置按钮 |
| | | fields.push( |
| | | <Col span={this.props.searchlist.length % 4 ? 6 : 24} style={{paddingLeft: '112px'}} key="actions"> |
| | | <Col span={this.props.searchlist.length % 4 ? 6 : 24} style={{paddingLeft: '112px', whiteSpace: 'nowrap'}} key="actions"> |
| | | <Button type="primary" htmlType="submit"> |
| | | {this.props.dict['main.search']} |
| | | </Button> |
| | |
| | | ) |
| | | } else { |
| | | fields.push( |
| | | <Col span={6} style={{ paddingTop: '4px' }} key="actions"> |
| | | <Col span={6} style={{ paddingTop: '4px', whiteSpace: 'nowrap' }} key="actions"> |
| | | <Button type="primary" htmlType="submit"> |
| | | {this.props.dict['main.search']} |
| | | </Button> |
| | |
| | | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card } = this.props |
| | | let _intertype = '' |
| | | let _options = null |
| | | |
| | | console.log(this.props.card.btnType) |
| | | if (card.btnType === 'cancel') { |
| | | _options = ['label', 'OpenType', 'icon', 'class', 'execSuccess'] |
| | | } else { |
| | | this.props.formlist.forEach(form => { |
| | | if (form.key === 'intertype') { |
| | | _intertype = form.initVal |
| | |
| | | }) |
| | | |
| | | if (_intertype === 'outer') { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError', 'method'] |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'sysInterface', 'icon', 'class', 'execSuccess', 'execError'] |
| | | } else { |
| | | _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | text: this.props.dict['header.form.exec'] |
| | | } |
| | | ] |
| | | if (card.btnType === 'cancel') { |
| | | item.readonly = 'true' |
| | | } |
| | | } else if (item.key === 'execSuccess' && card.btnType === 'cancel') { |
| | | item.label = '返回后' |
| | | } |
| | | item.hidden = !_options.includes(item.key) |
| | | return item |
| | |
| | | } |
| | | </div> |
| | | <Icon className="edit" title="编辑" type="edit" onClick={edit} /> |
| | | <Icon className="edit close" title="删除" type="close" onClick={del} /> |
| | | {type === 'action' && ['pop', 'prompt', 'exec'].includes(card.OpenType) && card.intertype === 'inner' && !card.innerFunc ? |
| | | {type === 'action' && ['prompt', 'exec'].includes(card.OpenType) && card.intertype === 'inner' && !card.innerFunc ? |
| | | <Icon className="edit profile" title="校验规则" type="profile" onClick={profile} /> : null |
| | | } |
| | | {card.btnType !== 'confirm' && card.btnType !== 'cancel' && <Icon className="edit close" title="删除" type="close" onClick={del} />} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | _config.isAdd = true |
| | | } else { |
| | | _config = config |
| | | _config.action = Source.baseConfig.action |
| | | // _config.action = Source.baseConfig.action |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | display: none; |
| | | } |
| | | .edit.close { |
| | | left: 20px; |
| | | left: 40px; |
| | | color: #ff4d4f; |
| | | } |
| | | .edit.profile { |
| | | left: 40px; |
| | | left: 20px; |
| | | color: purple; |
| | | } |
| | | button { |
| | |
| | | intertype: 'inner', |
| | | innerFunc: '', |
| | | interface: '', |
| | | method: 'POST', |
| | | outerFunc: '', |
| | | sql: '', |
| | | sqlType: '', |
| | |
| | | execSuccess: 'grid', |
| | | execError: 'never', |
| | | errorTime: 15, |
| | | OpenType: 'pop', |
| | | OpenType: 'exec', |
| | | icon: 'plus', |
| | | class: 'green', |
| | | verify: null |
| | |
| | | execSuccess: 'grid', |
| | | execError: 'never', |
| | | errorTime: 15, |
| | | OpenType: 'pop', |
| | | OpenType: 'exec', |
| | | pageTemplate: '', |
| | | url: '', |
| | | icon: 'rollback', |
| | |
| | | import React, { useState } from 'react' |
| | | import { useDrop } from 'react-dnd' |
| | | import { is, fromJS } from 'immutable' |
| | | import update from 'immutability-helper' |
| | | import { Col } from 'antd' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | } else { |
| | | handleList(_cards, group) |
| | | } |
| | | } |
| | | |
| | | if (!is(fromJS(cards), fromJS(list))) { |
| | | setCards(list) |
| | | } |
| | | |
| | | const findCard = id => { |
| | |
| | | let newcard = {} |
| | | newcard.uuid = Utils.getuuid() |
| | | newcard.label = 'label' |
| | | newcard.field = '' |
| | | newcard.initval = '' |
| | | newcard.type = item.subType |
| | | newcard.resourceType = '0' |
| | | newcard.options = [] |
| | | newcard.dataSource = '' |
| | | newcard.setAll = 'false' |
| | | newcard.linkField = '' |
| | | newcard.valueField = '' |
| | | newcard.valueText = '' |
| | | newcard.orderBy = '' |
| | | newcard.orderType = 'asc' |
| | | newcard.decimal = 0 |
| | | newcard.min = '' |
| | | newcard.max = '' |
| | | newcard.readonly = 'false' |
| | | newcard.required = 'true' |
| | | newcard.focus = true |
| | |
| | | modalformlist: null, // 基本信息表单字段 |
| | | formlist: null, // 表单编辑模态框,可编辑字段 |
| | | card: null, // 编辑元素 |
| | | loading: false, // 表单刷新时使用 |
| | | menuloading: false, // 菜单保存中 |
| | | closeloading: false, // 菜单保存中 |
| | | settingVisible: false, // 全局配置模态框 |
| | |
| | | _config.fields = list.filter(item => !item.origin) |
| | | |
| | | this.setState({ |
| | | loading: true, |
| | | config: _config |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | this.handleForm(newcard) |
| | | }) |
| | | } else { |
| | |
| | | }) |
| | | |
| | | this.setState({ |
| | | loading: true, |
| | | config: _config |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | this.handleForm(newcard) |
| | | }) |
| | | } else { |
| | |
| | | }) |
| | | |
| | | this.setState({ |
| | | loading: true, |
| | | config: _config |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | loading: true, |
| | | visible: false |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | |
| | | |
| | | _this.setState({ |
| | | config: _config, |
| | | loading: true |
| | | }, () => { |
| | | _this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | tableVisible: false, |
| | | loading: true, |
| | | config: _config |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | notification.success({ |
| | | top: 92, |
| | | message: '添加成功', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | _this.setState({ |
| | | config: _config, |
| | | loading: true |
| | | }, () => { |
| | | _this.setState({ |
| | | loading: false |
| | | }) |
| | | config: _config |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | this.setState({ |
| | | groupVisible: false, |
| | | curgroup: '', |
| | | loading: true, |
| | | config: config |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | |
| | | </div> |
| | | <div className="ant-modal-body"> |
| | | <div className="modal-form"> |
| | | {!this.state.loading && config.groups.length > 0 && |
| | | {config.groups.length > 0 && |
| | | config.groups.map(group => { |
| | | return ( |
| | | <div key={group.uuid}> |
| | |
| | | ) |
| | | }) |
| | | } |
| | | {!this.state.loading && config.groups.length === 0 ? |
| | | {config.groups.length === 0 ? |
| | | <DragElement |
| | | list={config.fields} |
| | | setting={config.setting} |
| | |
| | | type: 'text', |
| | | key: 'field', |
| | | label: Formdict['header.form.field'], |
| | | initVal: card.field, |
| | | initVal: card.field || '', |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | |
| | | type: 'text', |
| | | key: 'initval', |
| | | label: Formdict['header.form.initval'], |
| | | initVal: card.initval, |
| | | initVal: card.initval || '', |
| | | required: false |
| | | }, |
| | | { |
| | |
| | | this.form = form |
| | | const { children, dataIndex, record } = this.props |
| | | const { editing } = this.state |
| | | |
| | | return editing ? ( |
| | | <Form.Item style={{ margin: 0 }}> |
| | | {form.getFieldDecorator(dataIndex, { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | required: dataIndex === 'Value' || dataIndex === 'Text', |
| | | message: 'NOT NULL.', |
| | | }, |
| | | ], |
| | |
| | | columns: columns, |
| | | dataSource: props.data, |
| | | count: props.data.length, |
| | | type: props.type |
| | | type: props.type, |
| | | linkSubFields: props.linkSubFields |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | resetColumn = (type, linkSubFields) => { |
| | | let dataSource = JSON.parse(JSON.stringify(this.state.dataSource)) |
| | | let _width = '40%' |
| | | let fields = [] |
| | | |
| | | if (type === 'select' && linkSubFields.length > this.state.linkSubFields) { |
| | | let addcol = linkSubFields[linkSubFields.length - 1] |
| | | dataSource = dataSource.map(data => { |
| | | data[addcol.field] = data.Text |
| | | return data |
| | | }) |
| | | } |
| | | |
| | | if (type === 'link') { |
| | | _width = '27%' |
| | |
| | | |
| | | this.setState({ |
| | | columns: columns, |
| | | dataSource: dataSource, |
| | | type: type |
| | | }) |
| | | } |
| | |
| | | let _labels = item.fieldlabel.split(',') // 表单提示文字 |
| | | |
| | | item.field.split(',').forEach((_field, index) => { |
| | | _fieldValue.push(`${_field}='${_formFieldValue[_field]}'`) |
| | | let _fval = `'${_formFieldValue[_field]}'` |
| | | if (['id', 'bid', 'loginuid', 'sessionuid', 'userid', 'appkey'].includes(_field.toLowerCase())) { |
| | | _fval = '@' + _field + '@' |
| | | } |
| | | _fieldValue.push(`${_field}=${_fval}`) |
| | | _value.push(`${_labels[index] || ''}:${_formFieldValue[_field] || ''}`) |
| | | }) |
| | | |