| | |
| | | |
| | | // 视图权限 |
| | | config.charts = config.charts.filter(item => { |
| | | if (item.Hide === 'true') return false |
| | | if (!item.blacklist || item.blacklist.length === 0) return true |
| | | |
| | | let _black = item.blacklist.filter(v => { |
| | |
| | | |
| | | .chart-card-box { |
| | | padding: 0 10px; |
| | | .anticon { |
| | | margin-right: 0px; |
| | | } |
| | | } |
| | | .chart-card-box:not(.ant-col) { |
| | | display: inline-block; |
| | |
| | | .ant-tabs-tab { |
| | | margin: 0; |
| | | padding: 12px 5px; |
| | | cursor: default; |
| | | |
| | | .chart-card-box:not(.ant-col) { |
| | | margin-bottom: 0px; |
| | |
| | | margin: 0px; |
| | | padding: 20px; |
| | | position: relative; |
| | | white-space: normal; |
| | | |
| | | .ant-card-meta-avatar { |
| | | position: absolute; |
| | | top: 0px; |
| | | left: 0px; |
| | | padding-top: 15px; |
| | | padding-left: 15px; |
| | | padding-top: 0px; |
| | | padding-left: 0px; |
| | | } |
| | | |
| | | .ant-avatar-image { |
| | |
| | | } |
| | | .ant-card-meta-detail > div { |
| | | height: 23px; |
| | | vertical-align: top; |
| | | } |
| | | .ant-card-meta-detail > div:not(:last-child) { |
| | | margin-bottom: 2px; |
| | | } |
| | | .helf { |
| | | display: inline-block; |
| | | width: 50%; |
| | | } |
| | | .third { |
| | | display: inline-block; |
| | | width: 33.3%; |
| | | } |
| | | .align-center { |
| | | text-align: center; |
| | | } |
| | | .align-right { |
| | | text-align: right; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | .canvas { |
| | | margin: 0 20px; |
| | | border: 1px solid #e8e8e8; |
| | | padding: 15px; |
| | | padding: 25px 15px; |
| | | } |
| | | } |
| | |
| | | })( |
| | | <Select |
| | | showSearch |
| | | // allowClear={true} |
| | | onChange={(value) => {this.selectChange(item, value)}} |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | getPopupContainer={() => document.getElementById(this.state.formId)} |
| | |
| | | } |
| | | }) |
| | | |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) { |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc && config.setting.default !== 'false' && !config.setting.dataresource) { |
| | | return '菜单尚未设置数据源,不可启用!' |
| | | } else if (!config.setting.primaryKey) { |
| | | return '菜单尚未设置主键,不可启用!' |
| | |
| | | color: #26C281; |
| | | position: absolute; |
| | | right: -15px; |
| | | top: -5px; |
| | | top: -15px; |
| | | padding: 5px; |
| | | } |
| | | |
| | |
| | | return item |
| | | }) |
| | | }) |
| | | if (val === 'absolute') { |
| | | this.props.form.setFieldsValue({cardWidth: 250}) |
| | | } else { |
| | | this.props.form.setFieldsValue({cardWidth: 6}) |
| | | } |
| | | } else if (key === 'over' && val === 'roll') { |
| | | this.setState({ |
| | | formlist: formlist.map(item => { |
| | |
| | | }) |
| | | }) |
| | | if (this.props.form.getFieldValue('widthType') !== undefined) { |
| | | this.props.form.setFieldsValue({widthType: 'absolute'}) |
| | | this.props.form.setFieldsValue({widthType: 'absolute', cardWidth: 250}) |
| | | } |
| | | } else if (key === 'over' && val === 'whole') { |
| | | this.setState({ |
| | |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | {legends ? <Row gutter={24} className="chart-model-image"> |
| | | {legends.map(item => <Col span={6} key={item.uuid}> |
| | | <img onClick={() => this.changeSelectLegend(item)} src={item.url} className={selectlegend.uuid === item.uuid ? 'active' : ''} alt=""/> |
| | | <img onClick={() => this.changeSelectLegend(item)} src={item.url} className={selectlegend && selectlegend.uuid === item.uuid ? 'active' : ''} alt=""/> |
| | | </Col>)} |
| | | </Row> : null} |
| | | </Form> |
| | |
| | | * @description 监听到显示列复制时,触发显示列编辑 |
| | | */ |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { config } = this.props |
| | | const { columnlist } = this.state |
| | | |
| | | if ( |
| | | nextProps.pasteContent && |
| | | columnlist.length === 0 && |
| | | nextProps.pasteContent.columns && |
| | | nextProps.pasteContent.copyType === 'columns' && |
| | | nextProps.pasteContent.columns.length > 0 |
| | | ) { |
| | | this.setState({columnlist: nextProps.pasteContent.columns}) |
| | | } else if (!is(fromJS(nextProps.config.columns), fromJS(this.props.config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | if (columnlist.filter(col => !col.origin).length === 0) { |
| | | this.setState({columnlist: nextProps.pasteContent.columns}, () => { |
| | | this.props.updatecolumn({...config, columns: nextProps.pasteContent.columns}) |
| | | }) |
| | | } |
| | | } else if (!is(fromJS(nextProps.config.columns), fromJS(config.columns)) && !is(fromJS(nextProps.config.columns), fromJS(columnlist))) { |
| | | this.setState({columnlist: fromJS(nextProps.config.columns).toJS()}) |
| | | } |
| | | } |
| | |
| | | */ |
| | | changeSetting = () => { |
| | | const { menuformRef, MenuID, config, type, permFuncField, mainsearch } = this.props |
| | | |
| | | console.log(config) |
| | | let menu = {MenuID: MenuID} |
| | | |
| | | if (menuformRef) { |
| | |
| | | } |
| | | }) |
| | | |
| | | _columns.unshift({value: '', text: '未设置'}) |
| | | // _columns.unshift({value: '', text: '未设置'}) |
| | | |
| | | let _config = fromJS(config).toJS() |
| | | |
| | |
| | | let _config = {...config, tabName: res.MenuName, tabNo: res.MenuNo, Remark: res.Remark} |
| | | |
| | | // 未设置数据源或主键时,启用状态为false |
| | | if (_config.setting.interType === 'inner' && !_config.setting.innerFunc && !_config.setting.dataresource) { |
| | | _config.enabled = false |
| | | } else if (!_config.setting.primaryKey) { |
| | | let result = this.verifyconfig(_config) |
| | | |
| | | if (result !== true) { |
| | | _config.enabled = false |
| | | } |
| | | |
| | |
| | | onEnabledChange = () => { |
| | | const { config } = this.state |
| | | |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc && !config.setting.dataresource) { |
| | | let _enabled = !config.enabled |
| | | let result = this.verifyconfig(config) |
| | | |
| | | if (_enabled && result !== true) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未设置数据源,不可启用!', |
| | | message: result, |
| | | duration: 5 |
| | | }) |
| | | } else if (!config.setting.primaryKey) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未设置主键,不可启用!', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | config: {...config, enabled: !config.enabled} |
| | | config: {...config, enabled: _enabled} |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 校验配置信息的合法性 |
| | | */ |
| | | verifyconfig = (config) => { |
| | | let charterr = '' |
| | | config.charts.forEach(chart => { |
| | | if (!charterr && ['line', 'bar', 'pie'].includes(chart.chartType) && !chart.Xaxis) { |
| | | charterr = '图表' + (chart.title ? '《' + chart.title + '》' : '') + '坐标轴未设置,不可启用!' |
| | | } |
| | | }) |
| | | |
| | | if (config.setting.interType === 'inner' && !config.setting.innerFunc && config.setting.default !== 'false' && !config.setting.dataresource) { |
| | | return '菜单尚未设置数据源,不可启用!' |
| | | } else if (!config.setting.primaryKey) { |
| | | return '菜单尚未设置主键,不可启用!' |
| | | } else if (charterr) { |
| | | return charterr |
| | | } else { |
| | | return true |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | }) |
| | | }) |
| | | } else if (res.copyType === 'columns') { |
| | | if (config.columns && config.columns.length > 0) { |
| | | let _columns = config.columns.filter(col => !col.origin) |
| | | if (_columns.length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '显示列已存在!', |
| | |
| | | type: 'number', |
| | | key: 'size', |
| | | label: '字体大小', |
| | | initVal: card.size || 14, |
| | | initVal: card.size || 28, |
| | | min: 12, |
| | | max: 500, |
| | | required: false, |