| | |
| | | } |
| | | |
| | | state = { |
| | | dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | thawVisible: false, |
| | | thawbtnlist: null, |
| | | pasteVisible: false, |
| | |
| | | // form: text number select multiselect link switch checkbox radio checkcard |
| | | // fileupload date datemonth datetime textarea hint color funcvar |
| | | if (res.copyType === 'form') { |
| | | if (['number', 'switch', 'textarea', 'checkcard', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { |
| | | if (['number', 'switch', 'textarea', 'fileupload', 'hint', 'color', 'funcvar'].includes(res.type)) { |
| | | res.type = 'text' |
| | | } else if (res.type === 'radio') { |
| | | res.type = 'select' |
| | |
| | | } |
| | | res.copyType = 'form' |
| | | |
| | | if (_config.groups.length > 0) { |
| | | _config.groups.forEach(group => { |
| | | group.sublist.forEach(item => { |
| | | fields.push(item.field.toLowerCase()) |
| | | labels.push(item.label) |
| | | }) |
| | | if (group.default) { |
| | | group.sublist.push(res) |
| | | } |
| | | }) |
| | | } else { |
| | | _config.fields.forEach(item => { |
| | | fields.push(item.field.toLowerCase()) |
| | | labels.push(item.label) |
| | | }) |
| | | _config.fields.push(res) |
| | | } |
| | | _config.fields.forEach(item => { |
| | | item.field && fields.push(item.field.toLowerCase()) |
| | | labels.push(item.label) |
| | | }) |
| | | _config.fields.push(res) |
| | | |
| | | if (fields.includes(res.field.toLowerCase())) { |
| | | if (res.field && fields.includes(res.field.toLowerCase())) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段已存在!', |
| | |
| | | onCancel={() => {this.setState({pasteVisible: false})}} |
| | | destroyOnClose |
| | | > |
| | | <PasteForm |
| | | dict={dict} |
| | | wrappedComponentRef={(inst) => this.pasteFormRef = inst} |
| | | /> |
| | | <PasteForm wrappedComponentRef={(inst) => this.pasteFormRef = inst}/> |
| | | </Modal> |
| | | </div> |
| | | ) |