| | |
| | | return ( |
| | | <div className="commontable" id={this.state.ContainerId}> |
| | | {loadingview ? <Spin size="large" /> : null} |
| | | {config.search && config.search.length ? |
| | | {config && config.search && config.search.length ? |
| | | <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null |
| | | } |
| | | {setting && config.charts ? <Row className="chart-view" gutter={16}> |
| | |
| | | return ( |
| | | <div className="subtable" id={'subtable' + this.props.MenuID}> |
| | | {loadingview && <Spin />} |
| | | {config.search && config.search.length ? |
| | | {config && config.search && config.search.length ? |
| | | <SubSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null |
| | | } |
| | | {config && config.charts ? <Row className="chart-view" gutter={16}> |
| | |
| | | return ( |
| | | <div className="subtabtable" id={'subtabtable' + this.props.MenuID}> |
| | | {loadingview && <Spin />} |
| | | {config.search && config.search.length ? |
| | | {config && config.search && config.search.length ? |
| | | <SubSearch BID={this.props.BID} config={config} refreshdata={this.refreshbysearch}/> : null |
| | | } |
| | | {config ? <div style={{minHeight: '25px'}}> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Col, Row } from 'antd' |
| | | import { Col, Row, Switch } from 'antd' |
| | | import { CheckOutlined } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | } |
| | | } |
| | | |
| | | onChange = (val) => { |
| | | if (val) { |
| | | let keys = [] |
| | | this.state.options.forEach(item => { |
| | | if (item.$disabled) return |
| | | |
| | | keys.push(item.$value) |
| | | }) |
| | | |
| | | this.setState({ |
| | | selectKeys: keys |
| | | }, () => { |
| | | this.props.onChange(keys.join(',')) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | selectKeys: [] |
| | | }, () => { |
| | | this.props.onChange('') |
| | | }) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { config, options } = this.state |
| | | |
| | |
| | | |
| | | return ( |
| | | <div className={'check-card-form-box ' + extend}> |
| | | {config.checkAll === 'show' && options.length > 3 ? <Switch size="small" onChange={this.onChange}/> : null} |
| | | <Row gutter={12}>{this.getCards()}</Row> |
| | | </div> |
| | | ) |
| | |
| | | .check-card-form-box { |
| | | margin-top: 5px; |
| | | position: relative; |
| | | .card-cell { |
| | | position: relative; |
| | | border: 1px solid #bcbcbc; |
| | |
| | | } |
| | | } |
| | | |
| | | .ant-switch { |
| | | position: absolute; |
| | | top: -22px; |
| | | right: 0px; |
| | | opacity: 0.7; |
| | | } |
| | | |
| | | .card-cell.disabled { |
| | | cursor: not-allowed; |
| | | } |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'checkAll', |
| | | label: '全选', |
| | | initVal: card.checkAll || 'hide', |
| | | tooltip: '可多选的选项卡是否显示全选开关,注:当选项大于3个时有效。', |
| | | required: false, |
| | | forbid: appType !== '', |
| | | options: [{ |
| | | value: 'hide', |
| | | text: '隐藏' |
| | | }, { |
| | | value: 'show', |
| | | text: '显示' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'selectStyle', |
| | | label: '选中效果', |
| | | tooltip: '背景及文字变化时会使用系统色。', |
| | |
| | | shows.push('decimal') |
| | | } |
| | | } else { |
| | | shows.push('fieldlength') |
| | | shows.push('fieldlength', 'checkAll') |
| | | reTooltip.initval = '添加多个初始值请使用逗号分隔。' |
| | | } |
| | | |