| | |
| | | </span> |
| | | } |
| | | > |
| | | {editShow && <li className={'ant-menu-item ' + (item.children.length > 0 ? 'sub-menu' : '')}> |
| | | {editShow ? <li className={'ant-menu-item ' + (item.children.length > 0 ? 'sub-menu' : '')}> |
| | | <Icon onClick={(e) => {this.enterThrEdit(e, item)}} className="edit-check" type="edit" /> |
| | | </li>} |
| | | </li> : null} |
| | | {item.children.map(cell => { |
| | | return ( |
| | | <Menu.Item key={cell.MenuID}> |
| | |
| | | ) |
| | | })} |
| | | </Menu>} |
| | | {this.props.editLevel === 'level2' && |
| | | {this.props.editLevel === 'level2' ? |
| | | <EditSecMenu |
| | | menulist={this.state.subMenulist} |
| | | supMenuList={this.state.mainMenuList} |
| | | supMenu={this.props.mainMenu} |
| | | reload={this.reload} |
| | | exitEdit={this.exitEdit} |
| | | /> |
| | | /> : null |
| | | } |
| | | {this.props.editLevel === 'level3' && this.state.subMenulist && this.state.editMenu ? |
| | | <EditThdMenu |
| | |
| | | fieldlen: null, |
| | | groups: null, |
| | | formlist: [], |
| | | encrypts: [], // 加密字段 |
| | | intercepts: [], // 截取字段 |
| | | record: {} |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { datatype } = this.state |
| | | const { datatype, encrypts } = this.state |
| | | if (nextProps.data && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | |
| | | let _fieldsvalue = {} |
| | |
| | | } |
| | | |
| | | _fieldsvalue[key] = _val |
| | | } else if (datatype[key] === 'text' || datatype[key] === 'textarea') { |
| | | let _value = nextProps.data[key] |
| | | if (encrypts.includes(key)) { // 加密字段 |
| | | try { |
| | | _value = window.btoa(window.encodeURIComponent(_value)) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | } |
| | | |
| | | _fieldsvalue[key] = _value |
| | | } else { |
| | | _fieldsvalue[key] = nextProps.data[key] |
| | | } |
| | | } else { |
| | | _record[key] = nextProps.data[key] |
| | | let _value = nextProps.data[key] |
| | | if (encrypts.includes(key)) { // 加密字段 |
| | | try { |
| | | _value = window.btoa(window.encodeURIComponent(_value)) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | } |
| | | |
| | | _record[key] = _value |
| | | } |
| | | }) |
| | | |
| | |
| | | let readin = {} |
| | | let fieldlen = {} |
| | | let _formlist = [] |
| | | let encrypts = [] |
| | | let intercepts = [] |
| | | |
| | | let _groups = groups.map(group => { |
| | | group.sublist = group.sublist.map(item => { |
| | |
| | | if (item.type === 'funcvar') { |
| | | _readin = false |
| | | item.initval = '' // 初始化为空 |
| | | } |
| | | |
| | | if (item.type === 'textarea' && item.encryption === 'true') { |
| | | encrypts.push(item.field) |
| | | } |
| | | if (item.interception === 'true') { |
| | | intercepts.push(item.field) |
| | | } |
| | | |
| | | item.initVal = item.initval ? JSON.parse(JSON.stringify(item.initval)) : '' |
| | |
| | | fieldlen[item.field] = _fieldlen |
| | | |
| | | if (_readin && !/^date/.test(item.type) && data && data.hasOwnProperty(item.field)) { |
| | | item.initval = data[item.field] |
| | | let newval = data[item.field] |
| | | |
| | | if (encrypts.includes(item.field) && newval) { |
| | | try { |
| | | newval = window.decodeURIComponent(window.atob(newval)) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | } |
| | | |
| | | item.initval = newval |
| | | } |
| | | |
| | | if (item.supvalue) { |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { record } = this.state |
| | | const { record, encrypts, intercepts } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | } |
| | | |
| | | _value = vals.join(',') |
| | | } else if (this.state.datatype[key] === 'text') { |
| | | _value = values[key].replace(/(^\s*|\s*$) | \t* | \v*/ig, '') |
| | | } else if (this.state.datatype[key] === 'text' || this.state.datatype[key] === 'textarea') { |
| | | _value = values[key].replace(/\t*|\v*/g, '') // 去除制表符 |
| | | |
| | | if (intercepts.includes(key)) { // 去除首尾空格 |
| | | _value = _value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | | } else { |
| | | _value = values[key] |
| | | |
| | |
| | | value: _value |
| | | }) |
| | | }) |
| | | |
| | | if (encrypts && encrypts.length > 0) { |
| | | search = search.map(item => { |
| | | let _value = item.value |
| | | if (encrypts.includes(item.key)) { |
| | | try { |
| | | _value = window.btoa(window.encodeURIComponent(_value)) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | } |
| | | item.value = _value |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | resolve(search) |
| | | } else { |
| | | reject(err) |
| | |
| | | if (!val || /^\s*$/.test(val)) return val |
| | | let _val = `${val}` |
| | | if (_val.length <= 10) return val |
| | | return _val.substring(0, 5) + '...' |
| | | return _val.substring(0, 7) + '...' |
| | | } |
| | | } |
| | | }) |
| | |
| | | if (!val || /^\s*$/.test(val)) return val |
| | | let _val = `${val}` |
| | | if (_val.length <= 10) return val |
| | | return _val.substring(0, 5) + '...' |
| | | return _val.substring(0, 7) + '...' |
| | | } |
| | | } |
| | | }) |
| | |
| | | if (!val || /^\s*$/.test(val)) return val |
| | | let _val = `${val}` |
| | | if (_val.length <= 10) return val |
| | | return _val.substring(0, 5) + '...' |
| | | return _val.substring(0, 7) + '...' |
| | | } |
| | | } |
| | | }) |
| | |
| | | if (plot.label === 'true') { |
| | | let setting = { |
| | | content: (data) => { |
| | | return `${data[plot.Xaxis]}: ${(data.percent * 100).toFixed(2)}%` |
| | | let val = data[plot.Xaxis] |
| | | if (val) { |
| | | val = `${val}` |
| | | if (val.length > 10) { |
| | | val = val.substring(0, 7) + '...' |
| | | } |
| | | } |
| | | return `${val}: ${(data.percent * 100).toFixed(2)}%` |
| | | } |
| | | } |
| | | |
| | |
| | | if (plot.label === 'true') { |
| | | let setting = { |
| | | content: (data) => { |
| | | return `${data[plot.Xaxis]}: ${data[plot.Yaxis]}` |
| | | let val = data[plot.Xaxis] |
| | | if (val) { |
| | | val = `${val}` |
| | | if (val.length > 10) { |
| | | val = val.substring(0, 7) + '...' |
| | | } |
| | | } |
| | | return `${val}: ${data[plot.Yaxis]}` |
| | | } |
| | | } |
| | | |
| | |
| | | readin: null, |
| | | fieldlen: null, |
| | | formlist: [], |
| | | encrypts: [], // 加密字段 |
| | | intercepts: [], // 截取字段 |
| | | record: {} |
| | | } |
| | | |
| | |
| | | let readin = {} |
| | | let fieldlen = {} |
| | | let formlist = [] |
| | | let encrypts = [] |
| | | let intercepts = [] |
| | | |
| | | if (action.groups.length > 0) { |
| | | action.groups.forEach(group => { |
| | |
| | | let _inputfields = formlist.filter(item => item.type === 'text' || item.type === 'number') // 用于过滤下拉菜单关联表单 |
| | | |
| | | formlist = formlist.map(item => { |
| | | if (item.type === 'title') return item |
| | | |
| | | if (item.type === 'textarea' && item.encryption === 'true') { |
| | | encrypts.push(item.field) |
| | | } |
| | | if (item.interception === 'true') { |
| | | intercepts.push(item.field) |
| | | } |
| | | |
| | | let _readin = item.readin !== 'false' |
| | | if (item.type === 'linkMain' || item.type === 'funcvar') { |
| | | _readin = false |
| | |
| | | } |
| | | } |
| | | |
| | | let newval = '$$initval$$' |
| | | if (item.type === 'linkMain' && BData && BData.hasOwnProperty(item.field)) { |
| | | item.initval = BData[item.field] |
| | | newval = BData[item.field] |
| | | } else if (item.type !== 'linkMain' && _readin && !/^date/.test(item.type) && this.props.data && this.props.data.hasOwnProperty(item.field)) { |
| | | item.initval = this.props.data[item.field] |
| | | newval = this.props.data[item.field] |
| | | } |
| | | |
| | | if (encrypts.includes(item.field) && newval !== '$$initval$$') { |
| | | try { |
| | | newval = window.decodeURIComponent(window.atob(newval)) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | } |
| | | |
| | | if (newval !== '$$initval$$') { |
| | | item.initval = newval |
| | | } |
| | | |
| | | if (item.supvalue) { |
| | |
| | | datatype: datatype, |
| | | readin: readin, |
| | | fieldlen: fieldlen, |
| | | encrypts: encrypts, |
| | | intercepts: intercepts, |
| | | formlist: formlist |
| | | }, () => { |
| | | if (action.setting && action.setting.focus) { |
| | |
| | | |
| | | formlist.forEach((item, index) => { |
| | | // if ((!item.field && item.type !== 'title') || item.hidden === 'true') return |
| | | |
| | | // if (item.supField && !item.supvalue.includes(this.props.form.getFieldValue(item.supField))) return |
| | | |
| | | if (item.type === 'title') { |
| | |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'funcvar') { |
| | | // fields.push( |
| | | // <Col span={24 / cols} key={index}> |
| | | // <Form.Item label={item.label}> |
| | | // {getFieldDecorator(item.field, { |
| | | // initialValue: item.linkfield, |
| | | // })(<Input placeholder="" autoComplete="off" disabled={item.readonly === 'true'} />)} |
| | | // </Form.Item> |
| | | // </Col> |
| | | // ) |
| | | // 函数变量字段,默认不显示 |
| | | } else if (item.type === 'textarea') { |
| | | let _max = item.fieldlength || 512 |
| | | let _labelcol = cols !== 3 ? 8 / cols : 3 |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { record } = this.state |
| | | const { record, encrypts, intercepts } = this.state |
| | | |
| | | let _encrypts = JSON.parse(JSON.stringify(encrypts)) |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | let _val = item.initval |
| | | if (record.hasOwnProperty(item.field)) { |
| | | _val = record[item.field] |
| | | _encrypts = _encrypts.filter(_field => _field !== item.field) |
| | | } |
| | | |
| | | search.push({ |
| | | type: this.state.datatype[item.field], |
| | | readonly: this.state.readtype[item.field], |
| | |
| | | readin: this.state.readin[item.field], |
| | | fieldlen: this.state.fieldlen[item.field], |
| | | key: item.field, |
| | | value: item.initVal |
| | | value: item.initval |
| | | }) |
| | | } |
| | | }) |
| | |
| | | } |
| | | |
| | | _value = vals.join(',') |
| | | } else if (this.state.datatype[key] === 'text') { |
| | | _value = values[key].replace(/(^\s*|\s*$) | \t* | \v*/ig, '') |
| | | } else if (this.state.datatype[key] === 'text' || this.state.datatype[key] === 'textarea') { |
| | | _value = values[key].replace(/\t*|\v*/g, '') // 去除制表符 |
| | | |
| | | if (intercepts.includes(key)) { // 去除首尾空格 |
| | | _value = _value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | | } else { |
| | | _value = values[key] |
| | | |
| | |
| | | }) |
| | | }) |
| | | |
| | | if (_encrypts && _encrypts.length > 0) { |
| | | search = search.map(item => { |
| | | let _value = item.value |
| | | if (_encrypts.includes(item.key)) { |
| | | try { |
| | | _value = window.btoa(window.encodeURIComponent(_value)) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | } |
| | | item.value = _value |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | resolve(search) |
| | | } else { |
| | | reject(err) |
| | |
| | | import React, {Component} from 'react' |
| | | import { Table, Input, Button, Popconfirm, Form, Icon } from 'antd' |
| | | import { Table, Input, Popconfirm, Form, Icon } from 'antd' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | |
| | | }) |
| | | return ( |
| | | <div className="print-verify-edit-table"> |
| | | <Button onClick={this.handleAdd} className="add-row mk-green"> |
| | | 添加 |
| | | </Button> |
| | | <Icon className="add-row" type="plus" onClick={this.handleAdd} /> |
| | | <Table |
| | | components={components} |
| | | rowClassName={() => 'editable-row'} |
| | |
| | | .add-row { |
| | | position: absolute; |
| | | z-index: 1; |
| | | right: 32px; |
| | | top: -40px; |
| | | right: 35px; |
| | | top: -30px; |
| | | padding: 10px; |
| | | font-size: 20px; |
| | | color: #26C281; |
| | | } |
| | | .ant-table-thead > tr > th { |
| | | padding: 10px 16px; |
| | |
| | | import React, {Component} from 'react' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Input, Button, Popconfirm, Form, Icon } from 'antd' |
| | | import { Table, Input, Popconfirm, Form, Icon } from 'antd' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | |
| | | }) |
| | | return ( |
| | | <div className="model-search-edit-table"> |
| | | <Button onClick={this.handleAdd} type="primary" className="add-row"> |
| | | Add |
| | | </Button> |
| | | <Icon className="add-row" type="plus" onClick={this.handleAdd} /> |
| | | <Table |
| | | components={components} |
| | | rowClassName={() => 'editable-row'} |
| | |
| | | .add-row { |
| | | position: absolute; |
| | | z-index: 1; |
| | | right: 12px; |
| | | top: -40px; |
| | | right: 20px; |
| | | top: -30px; |
| | | padding: 5px; |
| | | font-size: 18px; |
| | | color: #26C281; |
| | | } |
| | | .ant-table-thead > tr > th { |
| | | padding: 10px 16px; |
| | |
| | | |
| | | let _setting = {...setting, customScript: _customScript} |
| | | |
| | | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | LText: SettingUtils.getDebugSql(_setting, arr_field, regoptions, swhere) |
| | |
| | | }) |
| | | arr_field = arr_field.join(',') |
| | | |
| | | // 正则替换 |
| | | let regoptions = allSearch.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | } |
| | | }) |
| | | |
| | | let _search = this.formatSearch(config.search) |
| | | _search = Utils.joinMainSearchkey(_search) |
| | | |
| | |
| | | setting: _setting, |
| | | search: _search, |
| | | arr_field: arr_field, |
| | | regoptions: regoptions, |
| | | regoptions: allSearch, |
| | | formlist: _formlist.map(item => { |
| | | if (interType === 'inner' && ['sysInterface', 'interface', 'outerFunc'].includes(item.key)) { |
| | | item.hidden = true |
| | |
| | | } |
| | | |
| | | if (setting.queryType === 'statistics') { // 统计数据源,内容替换 |
| | | regoptions.forEach(item => { |
| | | // 正则替换 |
| | | let _regoptions = regoptions.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | } |
| | | }) |
| | | _regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | // 正则替换 |
| | | let _regoptions = JSON.parse(JSON.stringify(regoptions)) |
| | | let _regoptions = regoptions.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | } |
| | | }) |
| | | let _search = search |
| | | |
| | | if (setting.queryType === 'statistics' && _dataresource) { |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'readonly', |
| | | label: Formdict['header.form.readonly'], |
| | | initVal: card.readonly || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['header.form.field.required'], |
| | | initVal: card.required || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'hidden', |
| | | label: Formdict['header.form.field.ishidden'], |
| | | initVal: card.hidden || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'database', |
| | | label: Formdict['header.form.database'], |
| | | initVal: card.database || 'local', |
| | | options: [{ |
| | | value: 'local', |
| | | text: Formdict['header.form.database.local'] |
| | | }, { |
| | | value: 'sso', |
| | | text: Formdict['header.form.database.sso'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'readin', |
| | | label: Formdict['header.form.readin'], |
| | | tooltip: Formdict['header.form.readin.tooltip'], |
| | | initVal: card.readin || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'fieldlength', |
| | | label: Formdict['header.form.field.length'], |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'readonly', |
| | | label: Formdict['header.form.readonly'], |
| | | initVal: card.readonly || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'required', |
| | | label: Formdict['header.form.field.required'], |
| | | initVal: card.required || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'hidden', |
| | | label: Formdict['header.form.field.ishidden'], |
| | | initVal: card.hidden || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'database', |
| | | label: Formdict['header.form.database'], |
| | | initVal: card.database || 'local', |
| | | options: [{ |
| | | value: 'local', |
| | | text: Formdict['header.form.database.local'] |
| | | }, { |
| | | value: 'sso', |
| | | text: Formdict['header.form.database.sso'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'readin', |
| | | label: Formdict['header.form.readin'], |
| | | tooltip: Formdict['header.form.readin.tooltip'], |
| | | initVal: card.readin || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | |
| | | { |
| | | type: 'radio', |
| | | key: 'encryption', |
| | | label: '加密传输', |
| | | initVal: card.encryption || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'interception', |
| | | label: '截取', |
| | | initVal: card.interception || 'false', |
| | | tooltip: '提交时,是否截取首尾的空白字符。', |
| | | options: [{ |
| | | value: 'true', |
| | | text: Formdict['header.form.true'] |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['header.form.false'] |
| | | }] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: Formdict['header.form.blacklist'], |
| | |
| | | const { TextArea } = Input |
| | | |
| | | const modalTypeOptions = { |
| | | text: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'regular'], |
| | | text: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'regular', 'interception'], |
| | | number: ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'blacklist'], |
| | | select: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'setAll', 'linkSubField'], |
| | | multiselect: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'fieldlength'], |
| | |
| | | date: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'], |
| | | datemonth: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'], |
| | | datetime: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'], |
| | | textarea: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'maxRows'], |
| | | textarea: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'maxRows', 'encryption', 'interception'], |
| | | funcvar: ['label', 'field', 'type', 'blacklist', 'hidden'], |
| | | linkMain: ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength', 'blacklist'] |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Table, Input, Button, Popconfirm, Form, Icon, Radio } from 'antd' |
| | | import { Table, Input, Popconfirm, Form, Icon, Radio } from 'antd' |
| | | import { formRule } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | |
| | | }) |
| | | return ( |
| | | <div className="common-modal-edit-table"> |
| | | <Button onClick={this.handleAdd} type="primary" className="add-row"> |
| | | 添加 |
| | | </Button> |
| | | <Icon className="add-row" type="plus" onClick={this.handleAdd} /> |
| | | <Table |
| | | components={components} |
| | | rowClassName={() => 'editable-row'} |
| | |
| | | .add-row { |
| | | position: absolute; |
| | | z-index: 1; |
| | | right: 12px; |
| | | top: -40px; |
| | | right: 20px; |
| | | top: -30px; |
| | | padding: 5px; |
| | | font-size: 18px; |
| | | color: #26C281; |
| | | } |
| | | .ant-table-thead > tr > th { |
| | | padding: 10px 16px; |