| | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | this.setSystemFuncs() |
| | | |
| | | this.props.modifyMainMenu(null) |
| | | this.props.history.replace('/design') |
| | | } else { |
| | | if (res.message.indexOf('密码错误') > -1) { |
| | |
| | | 'model.status.forbidden': '禁用', |
| | | 'model.status.open': '启用', |
| | | 'header.form.readin': '自动填充', |
| | | 'header.form.readin.tooltip': '是否将表格选中的数据自动填充到表单(字段相同)', |
| | | 'header.form.afterExecSuccess': '成功后', |
| | | 'header.form.afterExecError': '失败后', |
| | | 'header.form.pagination': '分页', |
| | |
| | | 'model.tooltip.action.guide': '在左侧工具栏《按钮》中,选择对应类型的按钮拖至此处添加,如选择按钮类型为表单、新标签页等含有配置页面的按钮,可在左侧工具栏-按钮-可配置按钮处,点击按钮完成相关配置。注:当设置按钮显示位置为表格时,显示列会增加操作列。', |
| | | 'model.tooltip.column.guide': '在左侧工具栏《显示列》中,选择对应类型的显示列拖至此处添加;或点击《添加显示列》按钮批量添加,选择批量添加时,需提前选择使用表。注:添加合并列时,需设置可选列。', |
| | | 'model.tooltip.tabs.guide': '在左侧工具栏《标签页》中,选择对应类型的标签页拖至此处添加。', |
| | | 'model.tooltip.func.innerface': '内部函数名称需以@ableField等字符开始;', |
| | | 'model.tooltip.func.innerface': '函数名称需以@ableField等字符开始;', |
| | | } |
| | |
| | | 'model.status.forbidden': '禁用', |
| | | 'model.status.open': '启用', |
| | | 'header.form.readin': '自动填充', |
| | | 'header.form.readin.tooltip': '是否将表格选中的数据自动填充到表单(字段相同)', |
| | | 'header.form.afterExecSuccess': '成功后', |
| | | 'header.form.afterExecError': '失败后', |
| | | 'header.form.pagination': '分页', |
| | |
| | | 'model.tooltip.action.guide': '在左侧工具栏《按钮》中,选择对应类型的按钮拖至此处添加,如选择按钮类型为表单、新标签页等含有配置页面的按钮,可在左侧工具栏-按钮-可配置按钮处,点击按钮完成相关配置。注:当设置按钮显示位置为表格时,显示列会增加操作列。', |
| | | 'model.tooltip.column.guide': '在左侧工具栏《显示列》中,选择对应类型的显示列拖至此处添加;或点击《添加显示列》按钮批量添加,选择批量添加时,需提前选择使用表。注:添加合并列时,需设置可选列。', |
| | | 'model.tooltip.tabs.guide': '在左侧工具栏《标签页》中,选择对应类型的标签页拖至此处添加。', |
| | | 'model.tooltip.func.innerface': '内部函数名称需以@ableField等字符开始;', |
| | | 'model.tooltip.func.innerface': '函数名称需以@ableField等字符开始;', |
| | | } |
| | |
| | | }] |
| | | let standardform = null |
| | | |
| | | _inputfields = group.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color') |
| | | _inputfields = group.fields.filter(item => ['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) |
| | | if (appType === 'mob') { |
| | | _tabfields = group.fields.filter(item => _form.field !== item.field && item.hidden !== 'true' && ['text', 'number'].includes(item.type)) |
| | | } else { |
| | |
| | | }] |
| | | let standardform = null |
| | | |
| | | _inputfields = group.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color') |
| | | _inputfields = group.fields.filter(item => ['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) |
| | | if (appType === 'mob') { |
| | | _tabfields = group.fields.filter(item => _form.field !== item.field && item.hidden !== 'true' && ['text', 'number'].includes(item.type)) |
| | | } else { |
| | |
| | | } |
| | | values.type = 'number' |
| | | values.decimal = decimal |
| | | } else if (/nvarchar/ig.test(option.props.datatype)) { |
| | | } else { |
| | | values.type = 'text' |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | clear = () => { |
| | | const _this = this |
| | | |
| | | confirm({ |
| | | content: '确定清空显示列吗?', |
| | | onOk() { |
| | | _this.setState({columns: []}, () => { |
| | | _this.props.updatecolumn({..._this.props.config, cols: []}) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | } |
| | |
| | | <Icon title="复制显示列" type="copy" onClick={this.copycolumn} /> |
| | | <MarkColumn columns={fields} type="line" marks={lineMarks} onSubmit={this.updateLineMarks} /> |
| | | <Icon title="同步字段集" type="file-sync" onClick={this.syncfield} /> |
| | | <Icon title="清空显示列" type="delete" onClick={this.clear}/> |
| | | </div> |
| | | <DndProvider> |
| | | <Table |
| | |
| | | >.anticon-copy { |
| | | color: #26C281; |
| | | } |
| | | >.anticon-delete { |
| | | color: #ff4d4f; |
| | | } |
| | | >.anticon-file-sync { |
| | | color: #1890ff; |
| | | } |
| | |
| | | }] |
| | | let standardform = null |
| | | |
| | | _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color') |
| | | _inputfields = config.fields.filter(item => ['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) |
| | | _tabfields = config.fields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) |
| | | _tabfields.unshift({field: '', text: '原表单'}) |
| | | |
| | |
| | | }] |
| | | let standardform = null |
| | | |
| | | _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color') |
| | | _inputfields = config.fields.filter(item => ['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) |
| | | _tabfields = config.fields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) |
| | | _tabfields.unshift({field: '', text: '原表单'}) |
| | | |
| | |
| | | wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd'], shortcut: 'remember' }, |
| | | style: { background: '#ffffff', width: '330px', borderRadius: '4px', marginLeft: '55vw'}, |
| | | loginWays: [ |
| | | {type: 'uname_pwd', label: '账号密码登录', shortcut: 'remember'}, |
| | | {type: 'sms_vcode', label: '短信验证码'}, |
| | | {type: 'uname_pwd', label: '账号登录', shortcut: 'remember'}, |
| | | {type: 'sms_vcode', label: '短信登录'}, |
| | | {type: 'app_scan', label: '扫码登录'}, |
| | | ] |
| | | } |
| | |
| | | height: 40px; |
| | | line-height: 1; |
| | | font-size: 18px; |
| | | margin-bottom: 25px; |
| | | margin-bottom: 15px; |
| | | } |
| | | .ant-form-item:last-child { |
| | | margin-bottom: 0; |
| | | } |
| | | } |
| | | .login-way-wrap { |
| | | height: 50px; |
| | | line-height: 50px; |
| | | margin-bottom: 10px; |
| | | .login-way-title { |
| | | font-size: 18px; |
| | | line-height: 45px; |
| | | display: flex; |
| | | border-radius: inherit; |
| | | .login-way { |
| | | flex: 1; |
| | | width: 50%; |
| | | font-size: 17px; |
| | | text-align: center; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | overflow: hidden; |
| | | padding: 0 16px; |
| | | transition: all 0.3s; |
| | | border: 1px solid transparent; |
| | | border-top: 0!important; |
| | | padding-top: 10px; |
| | | padding-left: 15px; |
| | | padding-right: 15px; |
| | | padding-bottom: 10px; |
| | | } |
| | | .login-way-title::before, .login-way-title::after { |
| | | display: inline-block; |
| | | content: ' '; |
| | | height: 0.5px; |
| | | flex: 1; |
| | | background-color: rgba(0, 0, 0, 0.15); |
| | | position: relative; |
| | | top: 22px; |
| | | } |
| | | .login-way-title::before { |
| | | margin: 0 10px 0 0; |
| | | } |
| | | .login-way-title::after { |
| | | margin: 0 0 0 10px; |
| | | } |
| | | .scan-icon { |
| | | position: absolute; |
| | | right: 0px; |
| | | top: 0px; |
| | | font-size: 46px; |
| | | color: #000000; |
| | | line-height: 1; |
| | | transform: rotate(-45deg); |
| | | transform-origin: 0 0; |
| | | overflow: hidden; |
| | | padding-bottom: 10px; |
| | | cursor: pointer; |
| | | i { |
| | | transform-origin: 0 0; |
| | | transform: rotate(45deg); |
| | | } |
| | | .login-way.active, .login-way:hover { |
| | | } |
| | | .login-ways { |
| | | padding: 0 20px 25px; |
| | | span { |
| | | color: #1890ff; |
| | | } |
| | | .login-way:not(.active) { |
| | | cursor: pointer; |
| | | background: #fafafa; |
| | | border: 1px solid #e8e8e8; |
| | | } |
| | | .login-way:first-child { |
| | | border-left: 0; |
| | | border-top-left-radius: inherit; |
| | | } |
| | | .login-way:last-child { |
| | | border-right: 0; |
| | | border-top-right-radius: inherit; |
| | | span + span { |
| | | margin-left: 15px; |
| | | } |
| | | } |
| | | .login-way-wrap.simple { |
| | | .login-way { |
| | | font-size: 18px; |
| | | text-align: left; |
| | | padding: 0 15px; |
| | | line-height: 60px; |
| | | } |
| | | .login-ways.center { |
| | | text-align: center; |
| | | } |
| | | |
| | | .form-scan-wrap { |
| | | padding: 30px; |
| | | padding: 10px 30px 0; |
| | | text-align: center; |
| | | font-size: 12px; |
| | | line-height: 35px; |
| | |
| | | state = { |
| | | activeWay: null, |
| | | loginWays: [], |
| | | scanWay: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { loginWays, wrap } = this.props |
| | | |
| | | let _loginWays = [] |
| | | let scanWay = null |
| | | loginWays.forEach(item => { |
| | | if (!wrap.loginWays || wrap.loginWays.includes(item.type)) { |
| | | if (item.type === 'sms_vcode') { |
| | | item.label = '短信登录' |
| | | } else if (item.type === 'uname_pwd') { |
| | | item.label = '账号登录' |
| | | } else if (item.type === 'app_scan') { |
| | | scanWay = item |
| | | } |
| | | _loginWays.push(item) |
| | | } |
| | | }) |
| | |
| | | this.setState({ |
| | | loginWays: _loginWays, |
| | | activeWay: _loginWays[0], |
| | | scanWay |
| | | }) |
| | | } |
| | | |
| | |
| | | |
| | | if (!is(fromJS(wrap), fromJS(nextProps.wrap))) { |
| | | let _loginWays = [] |
| | | let scanWay = null |
| | | nextProps.loginWays.forEach(item => { |
| | | if (!nextProps.wrap.loginWays || nextProps.wrap.loginWays.includes(item.type)) { |
| | | if (item.type === 'sms_vcode') { |
| | | item.label = '短信登录' |
| | | } else if (item.type === 'uname_pwd') { |
| | | item.label = '账号登录' |
| | | } else if (item.type === 'app_scan') { |
| | | scanWay = item |
| | | } |
| | | _loginWays.push(item) |
| | | } |
| | | }) |
| | |
| | | this.setState({ |
| | | loginWays: _loginWays, |
| | | activeWay: _loginWays[0], |
| | | scanWay |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { activeWay, loginWays } = this.state |
| | | const { activeWay, loginWays, scanWay } = this.state |
| | | |
| | | return ( |
| | | <Form className="login-edit-form"> |
| | | <div className={'login-way-wrap ' + (loginWays.length === 1 ? 'simple' : '')}> |
| | | {loginWays.map(item => ( |
| | | <div className={'login-way' + (activeWay.type === item.type ? ' active' : '')} onClick={() => this.onChangeTab(item)} key={item.type}>{item.label}</div> |
| | | ))} |
| | | </div> |
| | | <div className="login-way-title">{activeWay.label}</div> |
| | | {scanWay && activeWay.type !== 'app_scan' ? <div className="scan-icon" onClick={() => this.onChangeTab(scanWay)}><Icon type="qrcode" /></div> : null} |
| | | {activeWay.type === 'uname_pwd' ? <div className={'form-item-wrap ' + (activeWay.shortcut === 'none' ? 'no-short' : '')}> |
| | | <Form.Item> |
| | | <Input |
| | |
| | | </div> |
| | | 请使用客户端扫一扫登录 |
| | | </div> : null} |
| | | <div className={'login-ways ' + (activeWay.type === 'app_scan' ? 'center' : '')}> |
| | | {loginWays.map(item => { |
| | | if (item.type === 'app_scan' || activeWay.type === item.type) return null |
| | | return (<span key={item.type} onClick={() => this.onChangeTab(item)}>{item.label}</span>) |
| | | })} |
| | | </div> |
| | | </Form> |
| | | ) |
| | | } |
| | |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, '', param, data[0], columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 数据源 |
| | | if (btn.output) { |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 数据源 |
| | | if (btn.OpenType === 'formSubmit' && btn.output) { |
| | | if (btn.output) { |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 数据源 |
| | | if (btn.output) { |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, '', param, cell, columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions, Utils.getAllSearchOptions) // 数据源 |
| | | if (btn.output) { |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 数据源 |
| | | if (btn.output) { |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab, false, this.moduleParams, Utils.getAllSearchOptions) // 数据源 |
| | | if (btn.output) { |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | |
| | | } |
| | | |
| | | if (params.length <= 20) { |
| | | let deffers = params.map(param => { |
| | | let deffers = params.map((param, i) => { |
| | | return new Promise(resolve => { |
| | | Api.genericInterface(param).then(res => { |
| | | resolve(res) |
| | | }, () => { |
| | | this.updateStatus('over') |
| | | _resolve() |
| | | }) |
| | | setTimeout(() => { |
| | | let _param = null |
| | | if (btn.preFunc) { |
| | | _param = fromJS(param).toJS() |
| | | param.func = btn.preFunc |
| | | } |
| | | Api.genericInterface(param).then(res => { |
| | | if (btn.preFunc && res.status && res.ErrCode !== '-1') { |
| | | _param = {..._param, ...res} |
| | | |
| | | delete _param.status |
| | | delete _param.ErrCode |
| | | delete _param.ErrMesg |
| | | delete _param.message |
| | | |
| | | Api.genericInterface(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | resolve(res) |
| | | }, () => { |
| | | this.updateStatus('over') |
| | | _resolve() |
| | | }) |
| | | }, 20 * i) |
| | | }) |
| | | }) |
| | | Promise.all(deffers).then(result => { |
| | |
| | | loadingNumber: params.length || '' |
| | | }) |
| | | |
| | | let _param = null |
| | | |
| | | if (btn.preFunc) { |
| | | _param = fromJS(param).toJS() |
| | | param.func = btn.preFunc |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | if (btn.preFunc && res.ErrCode !== '-1') { |
| | | _param = {..._param, ...res} |
| | | |
| | | delete _param.status |
| | | delete _param.ErrCode |
| | | delete _param.ErrMesg |
| | | delete _param.message |
| | | |
| | | Api.genericInterface(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | |
| | | result.push({ |
| | | key: item.field, |
| | | readonly: item.readonly === 'true', |
| | | readin: _readin, |
| | | readin: item.readin !== 'false' && item.readin !== 'top', |
| | | fieldlen: _fieldlen, |
| | | writein: item.writein !== 'false', |
| | | type: _type, |
| | |
| | | result.push({ |
| | | key: item.field, |
| | | readonly: item.readonly === 'true', |
| | | readin: _readin, |
| | | readin: item.readin !== 'false' && item.readin !== 'top', |
| | | fieldlen: _fieldlen, |
| | | type: item.type, |
| | | value: _initval |
| | |
| | | if (!item.field || !['text', 'number', 'switch', 'select', 'link', 'linkMain', 'funcvar', 'date', 'datemonth', 'datetime', 'radio', 'checkbox', 'checkcard', 'fileupload', 'textarea', 'multiselect', 'brafteditor', 'color'].includes(item.type)) return false |
| | | |
| | | // 数据自动填充 |
| | | item.readin = item.readin !== 'false' |
| | | let readin = item.readin !== 'false' |
| | | item.readin = item.readin !== 'false' && item.readin !== 'top' |
| | | item.readonly = check || item.readonly === 'true' |
| | | item.writein = item.writein !== 'false' |
| | | item.hidden = item.hidden === 'true' |
| | | item.fieldlength = item.fieldlength || 50 |
| | | |
| | | if (item.type === 'funcvar') { |
| | | readin = false |
| | | item.readin = false |
| | | item.hidden = true |
| | | } else if (item.type === 'number') { |
| | |
| | | |
| | | let newval = '$empty' |
| | | |
| | | if (item.readin && data && data.hasOwnProperty(item.field)) { |
| | | if (readin && data && data.hasOwnProperty(item.field)) { |
| | | newval = data[item.field] |
| | | } |
| | | if (item.type === 'linkMain') { |
| | |
| | | const TabButton = asyncComponent(() => import('@/tabviews/zshare/actionList/tabbutton')) |
| | | const NewPageButton = asyncComponent(() => import('@/tabviews/zshare/actionList/newpagebutton')) |
| | | |
| | | class BodyRow extends React.Component { |
| | | shouldComponentUpdate (nextProps) { |
| | | return this.props.className !== nextProps.className |
| | | } |
| | | |
| | | render() { |
| | | return <tr {...this.props}/> |
| | | } |
| | | } |
| | | |
| | | class NormalTable extends Component { |
| | | static propTpyes = { |
| | | tableId: PropTypes.string, // 列表Id |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { menuType, memberLevel, pageSize } = this.props |
| | | const { menuType, memberLevel, pageSize, setting } = this.props |
| | | let columns = fromJS(this.props.columns).toJS() |
| | | let lineMarks = [] |
| | | let _columns = [] |
| | |
| | | let _format = false // 是否虚化处理 |
| | | let rowspans = [] |
| | | |
| | | if (window.GLOB.dataFormat && menuType !== 'HS' && memberLevel) { |
| | | _format = true |
| | | |
| | | if (memberLevel >= 30) { |
| | | radio = 20 |
| | | } else if (memberLevel >= 20) { |
| | | radio = 10 |
| | | } |
| | | } |
| | | |
| | | columns.forEach((item, index) => { |
| | | if (item.hidden === true || item.Hide === 'true') return |
| | | let cell = null |
| | | |
| | | if (item.type === 'colspan') { |
| | | cell = {title: item.label, children: []} |
| | | |
| | | item.subcols.forEach(col => { |
| | | if (col.rowspan === 'true') { |
| | | rowspans.push(col.field) |
| | | } |
| | | if (_format && !Math.floor(Math.random() * radio)) { |
| | | col.blur = true |
| | | } |
| | | |
| | | if (col.marks) { // 过滤行和卡片标记 |
| | | col.marks = col.marks.filter(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } |
| | | return mark.signType !== 'line' && mark.signType !== 'card' |
| | | if (setting.tableMode === 'fast') { |
| | | rowspans = null |
| | | columns.forEach(item => { |
| | | if (item.hidden === true || item.Hide === 'true') return |
| | | let cell = null |
| | | |
| | | if (item.type === 'colspan' || item.type === 'old_colspan') { |
| | | cell = {title: item.label, children: []} |
| | | |
| | | item.subcols.forEach(col => { |
| | | cell.children.push({ |
| | | align: col.Align, |
| | | title: col.label, |
| | | dataIndex: col.field || col.uuid, |
| | | key: col.uuid, |
| | | width: col.Width || 120 |
| | | }) |
| | | |
| | | if (col.marks.length === 0) { |
| | | col.marks = '' |
| | | } |
| | | } |
| | | |
| | | cell.children.push({ |
| | | align: col.Align, |
| | | title: col.label, |
| | | dataIndex: col.field || col.uuid, |
| | | key: col.uuid, |
| | | width: col.Width || 120, |
| | | render: (text, record) => { |
| | | return this.getContent(col, record) |
| | | } |
| | | }) |
| | | }) |
| | | } else if (item.type === 'old_colspan') { |
| | | item.subcols.forEach(col => { |
| | | if (col.marks) { // 过滤行和卡片标记 |
| | | col.marks = col.marks.filter(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } else { |
| | | if (item.type === 'index') { |
| | | item.field = '$Index' |
| | | item.type = 'text' |
| | | } |
| | | |
| | | cell = { |
| | | align: item.Align, |
| | | dataIndex: item.field || item.uuid, |
| | | title: item.label, |
| | | sorter: item.field && item.IsSort === 'true', |
| | | width: item.Width || 120 |
| | | } |
| | | } |
| | | |
| | | _columns.push(cell) |
| | | }) |
| | | } else { |
| | | if (window.GLOB.dataFormat && menuType !== 'HS' && memberLevel) { |
| | | _format = true |
| | | |
| | | if (memberLevel >= 30) { |
| | | radio = 20 |
| | | } else if (memberLevel >= 20) { |
| | | radio = 10 |
| | | } |
| | | } |
| | | |
| | | columns.forEach((item, index) => { |
| | | if (item.hidden === true || item.Hide === 'true') return |
| | | let cell = null |
| | | |
| | | if (item.type === 'colspan') { |
| | | cell = {title: item.label, children: []} |
| | | |
| | | item.subcols.forEach(col => { |
| | | if (col.rowspan === 'true') { |
| | | rowspans.push(col.field) |
| | | } |
| | | if (_format && !Math.floor(Math.random() * radio)) { |
| | | col.blur = true |
| | | } |
| | | |
| | | if (col.marks) { // 过滤行和卡片标记 |
| | | col.marks = col.marks.filter(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } |
| | | return mark.signType !== 'line' && mark.signType !== 'card' |
| | | }) |
| | | |
| | | if (col.marks.length === 0) { |
| | | col.marks = '' |
| | | } |
| | | return mark.signType !== 'line' && mark.signType !== 'card' |
| | | } |
| | | |
| | | cell.children.push({ |
| | | align: col.Align, |
| | | title: col.label, |
| | | dataIndex: col.field || col.uuid, |
| | | key: col.uuid, |
| | | width: col.Width || 120, |
| | | render: (text, record) => { |
| | | return this.getContent(col, record) |
| | | } |
| | | }) |
| | | |
| | | if (col.marks.length === 0) { |
| | | col.marks = '' |
| | | }) |
| | | } else if (item.type === 'old_colspan') { |
| | | item.subcols.forEach(col => { |
| | | if (col.marks) { // 过滤行和卡片标记 |
| | | col.marks = col.marks.filter(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } |
| | | return mark.signType !== 'line' && mark.signType !== 'card' |
| | | }) |
| | | |
| | | if (col.marks.length === 0) { |
| | | col.marks = '' |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | cell = { |
| | | align: item.Align, |
| | | dataIndex: item.field || item.uuid, |
| | | title: item.label, |
| | | sorter: item.field && item.IsSort === 'true', |
| | | width: item.Width || 120, |
| | | render: (text, record) => { |
| | | return this.getContent(item, record) |
| | | } |
| | | } |
| | | } else { |
| | | if (item.rowspan === 'true') { |
| | | rowspans.push(item.field) |
| | | } |
| | | if (item.type === 'index') { |
| | | item.field = '$Index' |
| | | item.type = 'text' |
| | | } else if (_format && !Math.floor(Math.random() * radio)) { |
| | | item.blur = true |
| | | } |
| | | |
| | | if (item.marks) { // 过滤行和卡片标记 |
| | | item.marks = item.marks.filter(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } |
| | | return mark.signType !== 'line' && mark.signType !== 'card' |
| | | }) |
| | | |
| | | if (item.marks.length === 0) { |
| | | item.marks = '' |
| | | cell = { |
| | | align: item.Align, |
| | | dataIndex: item.field || item.uuid, |
| | | title: item.label, |
| | | sorter: item.field && item.IsSort === 'true', |
| | | width: item.Width || 120, |
| | | render: (text, record) => { |
| | | return this.getContent(item, record) |
| | | } |
| | | } |
| | | } else { |
| | | if (item.rowspan === 'true') { |
| | | rowspans.push(item.field) |
| | | } |
| | | if (item.type === 'index') { |
| | | item.field = '$Index' |
| | | item.type = 'text' |
| | | } else if (_format && !Math.floor(Math.random() * radio)) { |
| | | item.blur = true |
| | | } |
| | | |
| | | if (item.marks) { // 过滤行和卡片标记 |
| | | item.marks = item.marks.filter(mark => { |
| | | if (mark.signType === 'line') { |
| | | lineMarks.push(mark) |
| | | } |
| | | return mark.signType !== 'line' && mark.signType !== 'card' |
| | | }) |
| | | |
| | | if (item.marks.length === 0) { |
| | | item.marks = '' |
| | | } |
| | | } |
| | | |
| | | cell = { |
| | | align: item.Align, |
| | | dataIndex: item.field || item.uuid, |
| | | title: item.label, |
| | | sorter: item.field && item.IsSort === 'true', |
| | | width: item.Width || 120, |
| | | render: (text, record) => { |
| | | return this.getContent(item, record) |
| | | } |
| | | } |
| | | } |
| | | |
| | | cell = { |
| | | align: item.Align, |
| | | dataIndex: item.field || item.uuid, |
| | | title: item.label, |
| | | sorter: item.field && item.IsSort === 'true', |
| | | width: item.Width || 120, |
| | | render: (text, record) => { |
| | | return this.getContent(item, record) |
| | | } |
| | | } |
| | | |
| | | _columns.push(cell) |
| | | }) |
| | | |
| | | if (rowspans.length === 0) { |
| | | rowspans = null |
| | | } |
| | | |
| | | _columns.push(cell) |
| | | }) |
| | | |
| | | if (rowspans.length === 0) { |
| | | rowspans = null |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | const { setting, pickup, statFValue } = this.props |
| | | const { selectedRowKeys, lineMarks, activeIndex } = this.state |
| | | |
| | | let components = { |
| | | body: {} |
| | | } |
| | | |
| | | if (setting.tableMode === 'fast') { |
| | | components.body.row = BodyRow |
| | | } |
| | | |
| | | // 设置表格选择属性:单选、多选、不可选 |
| | | let rowSelection = null |
| | | if (setting.tableType) { |
| | |
| | | /> |
| | | </Affix>} |
| | | <Table |
| | | components={components} |
| | | size={setting.size || 'middle'} |
| | | style={style} |
| | | bordered={setting.bordered !== 'false'} |
| | |
| | | const { getFieldDecorator } = this.props.form |
| | | const { dict, showButton, showAdvanced, float, visible } = this.state |
| | | const fields = [] |
| | | let lastRadio = 6 |
| | | |
| | | this.state.searchlist.forEach((item, index) => { |
| | | if (item.hidden || item.advanced) return |
| | |
| | | |
| | | let content = null |
| | | let field = item.field |
| | | lastRadio = item.ratio || 6 |
| | | |
| | | if (item.type === 'text') { |
| | | if (item.inputType === 'search') { |
| | |
| | | |
| | | if (showButton) { |
| | | let action = ( |
| | | <Col span={6} style={{ whiteSpace: 'nowrap' }} className="search-button" key="actions"> |
| | | <Col span={lastRadio < 6 ? 6 : lastRadio} style={{ whiteSpace: 'nowrap' }} className="search-button" key="actions"> |
| | | <Form.Item label={' '} colon={false} style={{ minHeight: '40px' }}> |
| | | <Button type="primary" onClick={this.handleSubmit}> |
| | | {dict['main.search']} |
| | |
| | | _formfields = [..._formfields, ...group.sublist] |
| | | }) |
| | | |
| | | _inputfields = _formfields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color') |
| | | _inputfields = _formfields.filter(item => ['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) |
| | | _tabfields = _formfields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) |
| | | _tabfields.unshift({field: '', text: '原表单'}) |
| | | |
| | |
| | | usefulFields = [] |
| | | } |
| | | |
| | | let ableField = usefulFields.join(', ') |
| | | let functip = <div> |
| | | <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> |
| | | </div> |
| | | |
| | | this.setState({ |
| | | modaltype: 'actionEdit', |
| | | card: card, |
| | | formlist: getActionForm(card, functip, this.state.config, usefulFields) |
| | | formlist: getActionForm(card, this.state.config, usefulFields) |
| | | }) |
| | | } |
| | | |
| | |
| | | }] |
| | | let standardform = null |
| | | |
| | | _inputfields = config.fields.filter(item => item.type === 'text' || item.type === 'number' || item.type === 'textarea' || item.type === 'color') |
| | | _inputfields = config.fields.filter(item => ['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) |
| | | _tabfields = config.fields.filter(item => card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) |
| | | _tabfields.unshift({field: '', text: '原表单'}) |
| | | |
| | |
| | | } else if (_intertype === 'outer') { |
| | | _options.push('innerFunc', 'sysInterface', 'interface', 'proInterface', 'outerFunc', 'callbackFunc') |
| | | } else if (_intertype === 'inner') { |
| | | _options.push('innerFunc') |
| | | _options.push('innerFunc', 'preFunc') |
| | | } else { |
| | | _options.push('sql', 'sqlType') |
| | | } |
| | |
| | | |
| | | if (item.type === 'text') { // 文本搜索 |
| | | let _rules = [] |
| | | if (item.key === 'innerFunc') { |
| | | if (item.key === 'innerFunc' || item.key === 'preFunc') { |
| | | let str = '^(' + item.fields.join('|') + ')' |
| | | let _patten = new RegExp(str + formRule.func.innerPattern + '$', 'g') |
| | | _rules = [{ |
| | |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={0} max={10000} precision={0} />)} |
| | | })(<InputNumber min={0} max={10000} precision={0} onPressEnter={this.handleSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | usefulFields = [] |
| | | } |
| | | |
| | | let ableField = usefulFields.join(', ') |
| | | let functip = <div> |
| | | <p style={{marginBottom: '5px'}}>{this.state.dict['model.tooltip.func.innerface'].replace('@ableField', ableField)}</p> |
| | | </div> |
| | | |
| | | let menulist = [] |
| | | |
| | | if (menu.fstMenuList) { |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, this.props.config, usefulFields, this.props.type, menulist, this.state.printTemps) |
| | | formlist: getActionForm(card, this.props.config, usefulFields, this.props.type, menulist, this.state.printTemps) |
| | | }) |
| | | } |
| | | |
| | |
| | | changeColumns = (columns) => { |
| | | const { verify } = this.state |
| | | |
| | | if (columns[0] && (columns[0].type === 'image' || columns[0].type === 'text')) { |
| | | columns = columns.map(col => { |
| | | let _cell = { |
| | | uuid: Utils.getuuid(), |
| | | Column: col.Column, |
| | | Text: col.Text, |
| | | type: 'Nvarchar(50)', |
| | | limit: '50', |
| | | import: 'true', |
| | | required: 'true' |
| | | } |
| | | |
| | | return _cell |
| | | }) |
| | | } |
| | | |
| | | columns = columns.map(col => { |
| | | if (/^Nvarchar/ig.test(col.type)) { |
| | | col.limit = col.type.match(/\d+/) ? col.type.match(/\d+/)[0] : '20000' |
| | |
| | | 清空Excel列 |
| | | </Button> |
| | | <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:数值类型(int 或 decimal),内容为必填;最大值和最小值在类型为数值时有效。</Col> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelincolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | </TabPane> |
| | | {card.intertype === 'system' ? <TabPane tab={ |
| | | <span> |
| | |
| | | min: 5, |
| | | max: 200, |
| | | editable: true, |
| | | width: '20%' |
| | | width: '20%', |
| | | render: (text) => text || 20 |
| | | }, |
| | | { |
| | | title: '类型', |
| | |
| | | }) |
| | | } |
| | | |
| | | changeColumns = (columns) => { |
| | | const { verify } = this.state |
| | | |
| | | if (columns[0] && (columns[0].type !== 'image' && columns[0].type !== 'text')) { |
| | | columns = columns.map(col => { |
| | | let _cell = { |
| | | uuid: Utils.getuuid(), |
| | | Column: col.Column, |
| | | Text: col.Text, |
| | | Width: 20, |
| | | abs: 'false', |
| | | type: 'text', |
| | | } |
| | | |
| | | return _cell |
| | | }) |
| | | } |
| | | |
| | | this.setState({verify: {...verify, columns}}) |
| | | } |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { verify, excelColumns, defaultscript } = this.state |
| | |
| | | 清空Excel列 |
| | | </Button> |
| | | <div style={{color: '#959595', fontSize: '13px', paddingLeft: '10px'}}>如需导出序号,请使用字段 $Index。</div> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="exceloutcolumn" data={verify.columns} columns={excelColumns} onChange={(columns) => this.setState({verify: {...verify, columns}})}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del']} type="excelcolumn" data={verify.columns} columns={excelColumns} onChange={this.changeColumns}/> |
| | | </TabPane> |
| | | {card.intertype === 'system' ? <TabPane tab={ |
| | | <span> |
| | |
| | | message: this.props.dict['form.required.input'] + this.props.dict['model.form.columnWidth'] + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={1} max={1000} precision={0} />)} |
| | | })(<InputNumber min={1} max={1000} precision={0} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(item.unlimit ? <InputNumber /> : |
| | | <InputNumber min={item.min} max={item.max} precision={item.decimal} />)} |
| | | })(item.unlimit ? <InputNumber onPressEnter={this.handleSubmit}/> : |
| | | <InputNumber min={item.min} max={item.max} precision={item.decimal} onPressEnter={this.handleSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | } |
| | | }) |
| | | |
| | | let radio = 6 |
| | | if (cards.length > 0) { |
| | | radio = cards[cards.length - 1].ratio || 6 |
| | | } |
| | | |
| | | return ( |
| | | <div ref={drop} className="ant-row"> |
| | | {cards.map(card => ( |
| | |
| | | /> |
| | | </Col> |
| | | ))} |
| | | {cards.length > 0 ? <Col key="action" className="action" span={6}> |
| | | {cards.length > 0 ? <Col key="action" className="action" span={radio < 6 ? 6 : radio}> |
| | | <div className="ant-row ant-form-item" style={{whiteSpace: 'nowrap', lineHeight: '40px', height: '55px', marginBottom: 0}}> |
| | | <div className="ant-col ant-form-item-label ant-col-xs-24 ant-col-sm-8"> |
| | | </div> |
| | |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="使用急速模式时,表格中的标记、双击事件、格式化、行合并、前缀、后缀、字段透视等效果将无效,且数据都会以文本格式显示。"> |
| | | <Icon type="question-circle" /> |
| | | 模式 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('tableMode', { |
| | | initialValue: setting.tableMode || 'compatible' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="compatible">兼容</Radio> |
| | | <Radio value="fast">急速</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="高级搜索弹窗的宽度,注:当宽度值小于100时表示占窗口的百分比,大于100时表示宽度的绝对值。"> |
| | | <Icon type="question-circle" /> |
| | | 高级搜索 |
| | |
| | | /** |
| | | * @description 获取按钮表单配置信息 |
| | | * @param {*} card 编辑按钮 |
| | | * @param {*} functip 生成存储过程提示 |
| | | * @param {*} config 页面配置 |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | export function getActionForm (card, functip, config, usefulFields, type, menulist = [], printTemps = []) { |
| | | export function getActionForm (card, config, usefulFields, type, menulist = [], printTemps = []) { |
| | | let columns = (config.columns || []).filter(col => col.field) |
| | | |
| | | let opentypes = [ |
| | |
| | | key: 'innerFunc', |
| | | label: Formdict['header.form.innerFunc'], |
| | | initVal: card.innerFunc || '', |
| | | tooltip: functip, |
| | | tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始。`, |
| | | fields: usefulFields, |
| | | tooltipClass: 'middle', |
| | | required: card.intertype === 'inner', |
| | |
| | | value: 'bottom', |
| | | text: '下侧' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'preFunc', |
| | | label: '前置函数', |
| | | initVal: card.preFunc || '', |
| | | tooltip: `函数名称需以${usefulFields.join(', ')}等字符开始;前置函数执行完成后,结果会传入内部函数中,此时内部函数会异步执行。`, |
| | | fields: usefulFields, |
| | | tooltipClass: 'middle', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | ] |
| | | } |
| | |
| | | type: 'radio', |
| | | key: 'readin', |
| | | label: Formdict['header.form.readin'], |
| | | tooltip: Formdict['header.form.readin.tooltip'], |
| | | tooltip: '是否将表格选中的数据自动填充到表单(字段相同)', |
| | | initVal: card.readin || 'true', |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | }, { |
| | | value: 'false', |
| | | text: Formdict['model.false'] |
| | | }, { |
| | | value: 'top', |
| | | text: '首行' |
| | | }] |
| | | }, |
| | | { |
| | |
| | | line-height: 48px; |
| | | padding-left: 10px; |
| | | margin: 0 10px; |
| | | transition: padding-left 0.15s; |
| | | i { |
| | | cursor: pointer; |
| | | position: relative; |
| | | top: 3px; |
| | | font-size: 20px; |
| | |
| | | login_types.push(item.way_no) |
| | | |
| | | login_ways.push({ |
| | | label: item.way_name, |
| | | type: item.way_no, |
| | | smsId: item.sms_id |
| | | }) |
| | | }) |
| | | } else { |
| | | login_ways.push({ |
| | | label: '账号密码登录', |
| | | type: 'uname_pwd', |
| | | smsId: '' |
| | | }) |
| | |
| | | border-bottom: 2px solid #1890ff; |
| | | |
| | | .login-form { |
| | | position: relative; |
| | | float: right; |
| | | margin-top: 5%; |
| | | margin-right: 20%; |
| | |
| | | font-size: 18px; |
| | | line-height: 45px; |
| | | display: flex; |
| | | padding-top: 10px; |
| | | } |
| | | .login-way-title::before, .login-way-title::after { |
| | | display: inline-block; |
| | | content: ' '; |
| | | height: 0.5px; |
| | | flex: 1; |
| | | background-color: red; |
| | | background-color: rgba(0, 0, 0, 0.15); |
| | | position: relative; |
| | | top: 22px; |
| | | } |
| | | .scan-icon { |
| | | position: absolute; |
| | | right: 0px; |
| | | top: 0px; |
| | | font-size: 46px; |
| | | color: #000000; |
| | | line-height: 1; |
| | | transform: rotate(-45deg); |
| | | transform-origin: 0 0; |
| | | overflow: hidden; |
| | | padding-bottom: 10px; |
| | | cursor: pointer; |
| | | i { |
| | | transform-origin: 0 0; |
| | | transform: rotate(45deg); |
| | | } |
| | | } |
| | | .login-ways { |
| | | padding: 0 1.6vw 1.5vw; |
| | | span { |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | } |
| | | span + span { |
| | | margin-left: 15px; |
| | | } |
| | | } |
| | | .login-ways.center { |
| | | text-align: center; |
| | | } |
| | | .login-way-title::before { |
| | | margin: 0 10px 0 1.6vw; |
| | |
| | | .login-way-title::after { |
| | | margin: 0 1.6vw 0 10px; |
| | | } |
| | | .login-way-wrap { |
| | | height: 50px; |
| | | line-height: 50px; |
| | | margin-bottom: 10px; |
| | | display: flex; |
| | | .login-way { |
| | | flex: 1; |
| | | width: 50%; |
| | | font-size: 17px; |
| | | text-align: center; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | overflow: hidden; |
| | | padding: 0 16px; |
| | | transition: all 0.3s; |
| | | border: 1px solid transparent; |
| | | border-top: 0!important; |
| | | } |
| | | .login-way.active, .login-way:hover { |
| | | color: #1890ff; |
| | | } |
| | | .login-way:not(.active) { |
| | | cursor: pointer; |
| | | background: #fafafa; |
| | | border: 1px solid #e8e8e8; |
| | | } |
| | | .login-way:first-child { |
| | | border-left: 0; |
| | | } |
| | | .login-way:last-child { |
| | | border-right: 0; |
| | | } |
| | | } |
| | | .login-way-wrap.simple { |
| | | .login-way { |
| | | font-size: 18px; |
| | | text-align: left!important; |
| | | padding-left: 1.6vw!important; |
| | | line-height: 60px!important; |
| | | } |
| | | } |
| | | .form-item-wrap { |
| | | padding: 0.6vw 1.6vw 1.6vw; |
| | | // padding: 0.6vw 1.6vw 1.6vw; |
| | | padding: 0.6vw 1.6vw 0vw; |
| | | } |
| | | |
| | | h4 { |
| | |
| | | font-size: 14px; |
| | | margin-bottom: 10px; |
| | | height: 25px; |
| | | float: right; |
| | | .ant-form-item-control { |
| | | line-height: 25px; |
| | | } |
| | | .register { |
| | | color: #1890ff; |
| | | margin-right: 10px; |
| | | } |
| | | .forgot { |
| | | font-size: 14px; |
| | | color: #1890ff; |
| | | float: right; |
| | | } |
| | | } |
| | | .minline { |
| | |
| | | loginWays: [], |
| | | smsId: '', |
| | | verdisabled: false, |
| | | hasScan: false, |
| | | timeout: false |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let smsId = '' |
| | | let hasScan = false |
| | | let _loginWays = [] |
| | | loginWays.forEach(item => { |
| | | if (item.type === 'sms_vcode') { |
| | | item.label = '短信登录' |
| | | smsId = item.smsId |
| | | _loginWays.push(item) |
| | | } else if (item.type === 'uname_pwd') { |
| | | item.label = '账号登录' |
| | | _loginWays.push(item) |
| | | } else if (item.type === 'app_scan') { |
| | | _loginWays.push(item) |
| | | hasScan = true |
| | | } |
| | | }) |
| | | |
| | |
| | | activeKey, |
| | | scanId: activeKey === 'app_scan' ? Utils.getuuid() : '', |
| | | timeout: false, |
| | | remember |
| | | remember, |
| | | hasScan |
| | | }) |
| | | |
| | | if (activeKey === 'app_scan') { |
| | |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { activeKey, verdisabled, delay, loginWays, remember, scanId, timeout } = this.state |
| | | const { activeKey, verdisabled, delay, loginWays, remember, scanId, timeout, hasScan } = this.state |
| | | const wayLabels = {app_scan: '扫码登录', uname_pwd: '账号登录', sms_vcode: '短信登录'} |
| | | |
| | | return ( |
| | | <Form className="login-form" id="login-form" onSubmit={this.handleSubmit}> |
| | | <div className={'login-way-wrap ' + (loginWays.length === 1 ? 'simple' : '')}> |
| | | {loginWays.map(item => ( |
| | | <div className={'login-way' + (activeKey === item.type ? ' active' : '')} onClick={() => this.onChangeTab(item.type)} key={item.type}>{item.label}</div> |
| | | ))} |
| | | </div> |
| | | {/* <div className="login-way-title">用户登录</div> */} |
| | | <div className="login-way-title">{wayLabels[activeKey]}</div> |
| | | {hasScan && activeKey !== 'app_scan' ? <div className="scan-icon" onClick={() => this.onChangeTab('app_scan')}><Icon type="qrcode" /></div> : null} |
| | | {activeKey === 'uname_pwd' ? <div className="form-item-wrap"> |
| | | <Form.Item> |
| | | {getFieldDecorator('username', { |
| | |
| | | 请使用客户端扫一扫登录 |
| | | </div> |
| | | </div> : null} |
| | | <div className={'login-ways ' + (activeKey === 'app_scan' ? 'center' : '')}> |
| | | {loginWays.map(item => { |
| | | if (item.type === 'app_scan' || activeKey === item.type) return null |
| | | return (<span key={item.type} onClick={() => this.onChangeTab(item.type)}>{item.label}</span>) |
| | | })} |
| | | </div> |
| | | </Form> |
| | | ) |
| | | } |