| | |
| | | width: 100%; |
| | | height: 100%; |
| | | > .ant-tabs { |
| | | height: 100%; |
| | | > .ant-tabs-bar { // 去除标签页header与content之间的间隙 |
| | | margin-bottom: 0; |
| | | .ant-tabs-tab { |
| | |
| | | } |
| | | } |
| | | } |
| | | >.ant-tabs-content { |
| | | height: 100%; |
| | | } |
| | | } |
| | | .ant-tabs .ant-tabs-top-content.ant-tabs-content-animated { |
| | | transition: margin-left 0s cubic-bezier(0.645, 0.045, 0.355, 1); |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Modal, notification, Button } from 'antd' |
| | | import moment from 'moment' |
| | |
| | | class ActionComponent extends Component { |
| | | static propTpyes = { |
| | | type: PropTypes.string, // 菜单类型,主表或子表 |
| | | menu: PropTypes.object, // 菜单信息(菜单id,菜单参数,菜单名称) |
| | | config: PropTypes.object, // 菜单配置信息 |
| | | tabs: PropTypes.array, // 所有标签 |
| | | setSubConfig: PropTypes.func, // 设置子配置信息 |
| | |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | return !is(fromJS(this.props.config), fromJS(nextProps.config)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | export default ActionComponent |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | menu: state.customMenu |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(ActionComponent) |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Chart } from '@antv/g2' |
| | | import DataSet from '@antv/data-set' |
| | |
| | | |
| | | class antvBarLineChart extends Component { |
| | | static propTpyes = { |
| | | menu: PropTypes.object, |
| | | card: PropTypes.object, |
| | | updateConfig: PropTypes.func, |
| | | } |
| | |
| | | |
| | | render() { |
| | | const { card } = this.state |
| | | const { menu } = this.props |
| | | |
| | | return ( |
| | | <div className="menu-line-chart-edit-box" style={{height: card.setting.height || 400}}> |
| | | <SettingComponent |
| | | config={card} |
| | | menu={menu} |
| | | updateConfig={this.updateComponent} |
| | | /> |
| | | <div className="chart-header"> |
| | | <span className="chart-title">{card.setting.title || ''}</span> |
| | | <SearchComponent |
| | | menu={menu} |
| | | config={card} |
| | | sysRoles={menu.sysRoles} |
| | | optionLibs={null} |
| | | updatesearch={this.updateComponent} |
| | | /> |
| | | </div> |
| | | <ActionComponent |
| | | type="chart" |
| | | menu={menu} |
| | | config={card} |
| | | tabs={[]} |
| | | // setSubConfig={(_btn) => this.setSubConfig(_btn, 'button')} |
| | |
| | | } |
| | | } |
| | | |
| | | export default antvBarLineChart |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | menu: state.customMenu |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(antvBarLineChart) |
| | |
| | | |
| | | class antvBarLineChart extends Component { |
| | | static propTpyes = { |
| | | menu: PropTypes.object, |
| | | tabs: PropTypes.object, |
| | | updateConfig: PropTypes.func, |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { menu } = this.props |
| | | const { tabs, dict, labelvisible, editab } = this.state |
| | | |
| | | return ( |
| | |
| | | <span>{tab.icon ? <Icon type={tab.icon} /> : null}{tab.label}</span> |
| | | </Popover> |
| | | } key={tab.uuid}> |
| | | <TabComponents menu={menu} config={tab} handleList={this.updateTabComponent} deleteCard={this.deleteCard} /> |
| | | <TabComponents config={tab} handleList={this.updateTabComponent} deleteCard={this.deleteCard} /> |
| | | </TabPane> |
| | | ))} |
| | | <TabPane className="tab-add" disabled tab={<Icon onClick={this.tabAdd} type="plus" />} key="add"></TabPane> |
| | |
| | | const AntvBar = asyncComponent(() => import('@/menu/components/chart/antv-bar')) |
| | | const AntvTabs = asyncComponent(() => import('@/menu/components/tabs/antv-tabs')) |
| | | |
| | | const Card = ({ id, menu, card, moveCard, findCard, delCard, hasDrop, updateConfig }) => { |
| | | const Card = ({ id, card, moveCard, findCard, delCard, hasDrop, updateConfig }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: 'menu', id, originalIndex, floor: card.floor }, |
| | |
| | | |
| | | const getCardComponent = () => { |
| | | if (card.type === 'bar' || card.type === 'line') { |
| | | return (<AntvBar menu={menu} card={card} updateConfig={updateConfig} />) |
| | | return (<AntvBar card={card} updateConfig={updateConfig} />) |
| | | } else if (card.type === 'tabs') { |
| | | return (<AntvTabs menu={menu} tabs={card} updateConfig={updateConfig} />) |
| | | return (<AntvTabs tabs={card} updateConfig={updateConfig} />) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | const { confirm } = Modal |
| | | |
| | | const Container = ({menu, config, handleList }) => { |
| | | const Container = ({ config, handleList }) => { |
| | | let target = null |
| | | |
| | | const [cards, setCards] = useState(config.components) |
| | |
| | | <Card |
| | | id={card.uuid} |
| | | key={card.uuid} |
| | | menu={menu} |
| | | config={config} |
| | | card={card} |
| | | moveCard={moveCard} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Icon, Modal } from 'antd' |
| | | |
| | |
| | | class DataSource extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.any, |
| | | menu: PropTypes.object, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | |
| | | const { config } = this.props |
| | | |
| | | this.setState({setting: fromJS(config.setting).toJS()}) |
| | | this.props.updateConfig(config) // 触发菜单信息更新 |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | editDataSource = () => { |
| | |
| | | } |
| | | } |
| | | |
| | | export default DataSource |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | menu: state.customMenu |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(DataSource) |
| | |
| | | const AntvBar = asyncComponent(() => import('@/menu/components/chart/antv-bar')) |
| | | const AntvTabs = asyncComponent(() => import('@/menu/components/tabs/antv-tabs')) |
| | | |
| | | const Card = ({ id, menu, card, moveCard, findCard, delCard, hasDrop, doubleClickCard, updateConfig }) => { |
| | | const Card = ({ id, card, moveCard, findCard, delCard, hasDrop, doubleClickCard, updateConfig }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: 'menu', id, originalIndex, floor: card.floor }, |
| | |
| | | |
| | | const getCardComponent = () => { |
| | | if (card.type === 'bar' || card.type === 'line') { |
| | | return (<AntvBar menu={menu} card={card} updateConfig={updateConfig} />) |
| | | return (<AntvBar card={card} updateConfig={updateConfig} />) |
| | | } else if (card.type === 'tabs') { |
| | | return (<AntvTabs menu={menu} tabs={card} updateConfig={updateConfig} />) |
| | | return (<AntvTabs tabs={card} updateConfig={updateConfig} />) |
| | | } |
| | | } |
| | | |
| | |
| | | <Card |
| | | id={card.uuid} |
| | | key={card.uuid} |
| | | menu={menu} |
| | | card={card} |
| | | moveCard={moveCard} |
| | | delCard={deleteCard} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import {connect} from 'react-redux' |
| | | import { Modal, notification } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | |
| | | class SearchComponent extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, // 配置信息 |
| | | sysRoles: PropTypes.array, // 角色列表,黑名单 |
| | | // optionLibs: PropTypes.any, // 下拉字典 |
| | | updatesearch: PropTypes.func // 更新 |
| | | } |
| | | |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getSearchForm(card, this.props.sysRoles, linkableFields) |
| | | formlist: getSearchForm(card, this.props.menu.sysRoles, linkableFields) |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | export default SearchComponent |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | menu: state.customMenu |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(SearchComponent) |
| | |
| | | // 修改数据权限 |
| | | export const MODIFY_DATAMANAGER = 'MODIFY_DATAMANAGER' |
| | | |
| | | // 修改自定义菜单 |
| | | export const MODIFY_CUSTOMMENU = 'MODIFY_CUSTOMMENU' |
| | | |
| | | // 退出 |
| | | export const LOGOUT = 'LOGOUT' |
| | |
| | | } |
| | | } |
| | | |
| | | // 修改自定义菜单 |
| | | export const modifyCustomMenu = (customMenu) => { |
| | | return { |
| | | type: user.MODIFY_CUSTOMMENU, |
| | | customMenu: customMenu |
| | | } |
| | | } |
| | | |
| | | // 退出重置 |
| | | export const logout = () => { |
| | | return { |
| | |
| | | permFuncField: [], // 系统模块 |
| | | sysRoles: [], // 系统角色列表 |
| | | dataManager: false, // 数据管理员 |
| | | memberLevel: _level // 会员等级 |
| | | memberLevel: _level, // 会员等级 |
| | | customMenu: null // 编辑中的菜单(自定义页面) |
| | | } |
| | | |
| | | // 用户消息 |
| | |
| | | ...state, |
| | | dataManager: action.dataManager |
| | | } |
| | | case Type.MODIFY_CUSTOMMENU: |
| | | // 修改自定义菜单信息 |
| | | return { |
| | | ...state, |
| | | customMenu: action.customMenu |
| | | } |
| | | case Type.LOGOUT: |
| | | return { |
| | | selectedMainMenu: '', |
| | |
| | | permAction: {}, |
| | | permFuncField: [], |
| | | sysRoles: [], |
| | | permMenus: {} |
| | | permMenus: {}, |
| | | customMenu: null |
| | | } |
| | | default: |
| | | return state |
| | |
| | | if (_data) { |
| | | statFields.forEach(item => { |
| | | if (_data[item.field] || _data[item.field] === 0) { |
| | | values.push({label: item.label, value: _data[item.field]}) |
| | | let val = +_data[item.field] |
| | | if (isNaN(val)) { |
| | | val = 0 |
| | | } |
| | | val = val.toFixed(item.decimal) |
| | | values.push({label: item.label, value: val}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | chartData: [], // 图表数据 |
| | | chartFields: [], // 统计图表生成字段集 |
| | | selectFields: [], // 统计图表选择字段 |
| | | percentFields: [] // 设置为百分比的字段,tooltip时增加% |
| | | percentFields: [], // 设置为百分比的字段,tooltip时增加% |
| | | showHeader: false // 存在标题、搜索、或统计数据时显示 |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | }) |
| | | } |
| | | |
| | | let showHeader = false |
| | | if (config.setting.title || _config.plot.datatype === 'statistics') { |
| | | showHeader = true |
| | | } |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | data: _data, |
| | |
| | | plot: _config.plot, |
| | | sync: _sync, |
| | | title: config.setting.title, |
| | | search: Utils.initMainSearch(config.search) |
| | | search: Utils.initMainSearch(config.search), |
| | | showHeader |
| | | }, () => { |
| | | if (config.setting.sync !== 'true') { |
| | | this.loadData() |
| | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | this.setState({ |
| | | data: result.data.map((item, index) => { |
| | | item.key = index |
| | | return item |
| | | }), |
| | | data: result.data, |
| | | loading: false |
| | | }, () => { |
| | | this.handleData() |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | |
| | | render() { |
| | | const { BID } = this.props |
| | | const { config, loading, title, plot, empty, chartFields, selectFields } = this.state |
| | | const { showHeader, config, loading, title, plot, empty, chartFields, selectFields } = this.state |
| | | |
| | | return ( |
| | | <div className="custom-line-chart-plot-box"> |
| | | {/* <searchLine /> */} |
| | | {title ? <p className="chart-title">{title}</p> : null} |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <div className="ant-spin-blur"></div> |
| | | <Spin /> |
| | | </div> : null |
| | | } |
| | | {plot.datatype === 'statistics' && chartFields.length > 0 ? <Select |
| | | mode="multiple" |
| | | showSearch |
| | | showArrow={true} |
| | | value={selectFields} |
| | | onChange={this.handleChange} |
| | | maxTagCount={0} |
| | | maxTagPlaceholder={(option) => <div className="type-label">{option.join('、')}</div>} |
| | | > |
| | | {chartFields.map((item, i) => <Select.Option key={i} value={item}>{item}</Select.Option>)} |
| | | </Select> : null} |
| | | {showHeader ? <div className="chart-header"> |
| | | <span className="chart-title">{title}</span> |
| | | {/* <searchLine /> */} |
| | | {plot.datatype === 'statistics' && chartFields.length > 0 ? <Select |
| | | mode="multiple" |
| | | showSearch |
| | | showArrow={true} |
| | | value={selectFields} |
| | | onChange={this.handleChange} |
| | | maxTagCount={0} |
| | | maxTagPlaceholder={(option) => <div className="type-label">{option.join('、')}</div>} |
| | | > |
| | | {chartFields.map((item, i) => <Select.Option key={i} value={item}>{item}</Select.Option>)} |
| | | </Select> : null} |
| | | </div> : null} |
| | | <div className="canvas-wrap"> |
| | | <div className={'chart-action ' + (plot.title ? 'with-title' : '')}> |
| | | {config.action.map(item => { |
| | |
| | | .custom-line-chart-plot-box { |
| | | margin-bottom: 30px; |
| | | |
| | | > .chart-header { |
| | | height: 45px; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | overflow: hidden; |
| | | |
| | | .chart-title { |
| | | font-size: 16px; |
| | | float: left; |
| | | line-height: 45px; |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | |
| | | .canvas-wrap { |
| | | margin: 0 0px; |
| | | position: relative; |
| | | border-top: 1px solid transparent; |
| | | .chart-action { |
| | | position: absolute; |
| | | top: 2px; |
| | |
| | | |
| | | .canvas { |
| | | margin: 0; |
| | | border: 1px solid #e8e8e8; |
| | | // border: 1px solid #e8e8e8; |
| | | padding: 25px 15px; |
| | | } |
| | | .canvas.empty { |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | // import { fromJS } from 'immutable' |
| | | import { Row, Col, Empty } from 'antd' |
| | | |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | import './index.scss' |
| | | |
| | | // 通用组件 |
| | | const AntvBarAndLine = asyncSpinComponent(() => import('@/tabviews/custom/components/chart/antv-bar-line')) |
| | | const AntvTabs = asyncSpinComponent(() => import('@/tabviews/custom/components/tabs/antv-tabs')) |
| | | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 全局搜索条件 |
| | | menuType: PropTypes.any, // 菜单类型 |
| | | dataManager: PropTypes.any, // 数据权限 |
| | | } |
| | | |
| | | state = {} |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | |
| | | } |
| | | |
| | | getComponents = () => { |
| | | const { menuType, dataManager, BID, mainSearch, config } = this.props |
| | | |
| | | if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />) |
| | | |
| | | return config.components.map(item => { |
| | | if (item.type === 'bar' || item.type === 'line') { |
| | | return ( |
| | | <Col span={item.setting.span} key={item.uuid}> |
| | | <AntvBarAndLine config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'tabs') { |
| | | return ( |
| | | <Col span={item.setting.span} key={item.uuid}> |
| | | <AntvTabs config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | return ( |
| | | <Row gutter={8}>{this.getComponents()}</Row> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default MainSearch |
New file |
| | |
| | | .ant-advanced-search-form.top-search { |
| | | padding: 0px 24px 10px; |
| | | border-bottom: 1px solid #efefef; |
| | | .ant-form-item { |
| | | display: flex; |
| | | margin-bottom: 0px; |
| | | min-height: 60px; |
| | | .ant-form-explain { |
| | | white-space: nowrap; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | flex: 1; |
| | | width: calc(100% - 100px); |
| | | } |
| | | .ant-form-item-label { |
| | | // width: 100px; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .daterange .ant-calendar-picker-input { |
| | | padding: 4px 20px 4px 5px; |
| | | font-size: 13px; |
| | | } |
| | | .ant-select-dropdown { |
| | | z-index: 10 !important; |
| | | } |
| | | .ant-calendar-picker-container { |
| | | z-index: 10 !important; |
| | | } |
| | | .group-required { |
| | | label::before { |
| | | display: inline-block; |
| | | margin-right: 4px; |
| | | color: #f5222d; |
| | | font-size: 14px; |
| | | font-family: SimSun, sans-serif; |
| | | line-height: 1; |
| | | content: '*'; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Tabs, Icon } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import './index.scss' |
| | | |
| | | const TabTransfer = asyncComponent(() => import('../../share/tabtransfer')) |
| | | |
| | | const { TabPane } = Tabs |
| | | |
| | | class antvBarLineChart extends Component { |
| | | static propTpyes = { |
| | | BID: PropTypes.any, // 父级Id |
| | | config: PropTypes.object, // 组件配置信息 |
| | | mainSearch: PropTypes.any, // 全局搜索条件 |
| | | menuType: PropTypes.any, // 菜单类型 |
| | | dataManager: PropTypes.any, // 数据权限 |
| | | } |
| | | |
| | | state = { |
| | | dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | tabs: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config } = this.props |
| | | this.setState({ |
| | | tabs: config |
| | | }) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | componentDidMount () {} |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新,清除快捷键设置 |
| | | */ |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { BID, mainSearch, menuType, dataManager } = this.props |
| | | const { tabs } = this.state |
| | | |
| | | return ( |
| | | <div className="menu-antv-tabs-wrap"> |
| | | <Tabs defaultActiveKey="1" tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}> |
| | | {tabs.subtabs.map(tab => ( |
| | | <TabPane tab={<span>{tab.icon ? <Icon type={tab.icon} /> : null}{tab.label}</span>} key={tab.uuid}> |
| | | <TabTransfer config={tab} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager}/> |
| | | </TabPane> |
| | | ))} |
| | | </Tabs> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default antvBarLineChart |
New file |
| | |
| | | .menu-antv-tabs-wrap { |
| | | position: relative; |
| | | box-sizing: border-box; |
| | | } |
| | |
| | | |
| | | // 通用组件 |
| | | const AntvBarAndLine = asyncSpinComponent(() => import('./components/chart/antv-bar-line')) |
| | | const AntvTabs = asyncSpinComponent(() => import('./components/tabs/antv-tabs')) |
| | | |
| | | class NormalTable extends Component { |
| | | static propTpyes = { |
| | |
| | | * @description 主表数据加载 |
| | | */ |
| | | loadmaindata = (params) => { |
| | | if (!params || params.length === 0) return |
| | | let LText_field = [] |
| | | let LText = params.map((item, index) => { |
| | | let _sql = item.sql |
| | |
| | | <AntvBarAndLine config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'tabs') { |
| | | return ( |
| | | <Col span={item.setting.span} key={item.uuid}> |
| | | <AntvTabs config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | |
| | | position: relative; |
| | | width: 100%; |
| | | min-height: calc(100vh - 92px); |
| | | // min-height: 100vh; |
| | | height: 100%; |
| | | background: #f0f2f5; |
| | | padding: 24px; |
| | | .ant-row-flex { |
| | |
| | | if (_data) { |
| | | statFields.forEach(item => { |
| | | if (_data[item.field] || _data[item.field] === 0) { |
| | | values.push({label: item.label, value: _data[item.field]}) |
| | | let val = +_data[item.field] |
| | | if (isNaN(val)) { |
| | | val = 0 |
| | | } |
| | | val = val.toFixed(item.decimal) |
| | | values.push({label: item.label, value: val}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | .normal-data-table { |
| | | padding: 0px; |
| | | |
| | | .normal-table-footer.pagination { |
| | | bottom: 10px; |
| | | } |
| | | } |
| | | .box404 { |
| | | padding-top: 30px; |
| | |
| | | if (_data) { |
| | | statFields.forEach(item => { |
| | | if (_data[item.field] || _data[item.field] === 0) { |
| | | values.push({label: item.label, value: _data[item.field]}) |
| | | let val = +_data[item.field] |
| | | if (isNaN(val)) { |
| | | val = 0 |
| | | } |
| | | val = val.toFixed(item.decimal) |
| | | values.push({label: item.label, value: val}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | > .top-search { |
| | | padding: 0 0px 10px; |
| | | } |
| | | .normal-data-table { |
| | | padding: 0 0 30px; |
| | | } |
| | | .box404 { |
| | | padding-top: 30px; |
| | | } |
| | |
| | | } |
| | | |
| | | let _pagination = false |
| | | if (setting.laypage) { |
| | | if (setting.laypage !== 'false' && setting.laypage !== false) { |
| | | _pagination = { |
| | | current: this.state.pageIndex, |
| | | pageSize: this.state.pageSize, |
| | |
| | | /** |
| | | * @description 获取系统存储过程 sPC_Get_TableData 合计值的参数 |
| | | */ |
| | | static getStatQueryDataParams (setting, statFields, search, orderBy, pageIndex, pageSize, menuType, dataManager) { |
| | | static getStatQueryDataParams (setting, statFields, search, orderBy, BID, menuType, dataManager) { |
| | | let param = { |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | |
| | | }) |
| | | } |
| | | |
| | | let LText = ` select ${statFields.map(col => `sum(${col.field}) as ${col.field}`).join(',')} from ${_dataresource} ${_search} ` |
| | | let LText = ` select ${statFields.map(col => `isnull(sum(${col.field}),0) as ${col.field}`).join(',')} from ${_dataresource} ${_search} ` |
| | | |
| | | if (_customScript) { |
| | | LText = `${LText} |
| | |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | } |
| | | |
| | | if (BID) { |
| | | param.BID = BID |
| | | } |
| | | |
| | | // 数据管理权限 |
| | | if (dataManager) { |
| | | param.dataM = 'Y' |
| | |
| | | import antdEnUS from 'antd/es/locale/en_US' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { modifyCustomMenu } from '@/store/action' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | _permFuncField = _permFuncField.sort() |
| | | } |
| | | |
| | | this.setState({ |
| | | config: {...this.state.config, sysRoles: _sysRoles, permFuncField: _permFuncField} |
| | | }) |
| | | let config = {...this.state.config, sysRoles: _sysRoles, permFuncField: _permFuncField} |
| | | |
| | | this.setState({config}) |
| | | this.props.modifyCustomMenu(config) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | initMenuList = (msg) => { |
| | | this.setState({ |
| | | config: {...this.state.config, ...msg} |
| | | }) |
| | | let config = {...this.state.config, ...msg} |
| | | |
| | | this.setState({config}) |
| | | this.props.modifyCustomMenu(config) |
| | | } |
| | | |
| | | editCard = (element) => { |
| | |
| | | this.setState({ |
| | | config: config |
| | | }) |
| | | |
| | | this.props.modifyCustomMenu(config) |
| | | } |
| | | |
| | | /** |
| | |
| | | config.tableFields = fields ? fields : tableFields |
| | | |
| | | this.setState({ |
| | | config: config, |
| | | tableFields: fields ? fields : tableFields |
| | | tableFields: fields ? fields : tableFields, |
| | | config |
| | | }) |
| | | } |
| | | |
| | | |
| | | this.props.modifyCustomMenu(config) |
| | | } |
| | | |
| | | render () { |
| | | const { activeKey, dict, MenuId, config } = this.state |
| | |
| | | return {} |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyCustomMenu: (customMenu) => dispatch(modifyCustomMenu(customMenu)) |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(MenuDesign) |