| | |
| | | type: 'ManageTable', |
| | | MenuID: '1578900109100np8aqd0a77q3na46oas', |
| | | MenuNo: 'sPrintTemplateM', |
| | | MenuName: '打印模板', |
| | | text: '打印模板' |
| | | MenuName: '标签打印模板', |
| | | text: '标签打印模板' |
| | | }, { |
| | | src: '', |
| | | systems: ['SSO', 'cloud'], |
| | |
| | | MenuNo: 'LdropdownmenuNewM', |
| | | MenuName: '通用下拉菜单', |
| | | text: '通用下拉菜单' |
| | | }, { |
| | | src: '', |
| | | PageParam: {OpenType: 'newtab', Template: 'ManageTable'}, |
| | | type: 'ManageTable', |
| | | MenuID: '1602315375262ikd33ii0nii34pt861o', |
| | | MenuNo: 's_worksflow_roleM', |
| | | MenuName: '关键角色管理', |
| | | text: '关键角色管理' |
| | | }] |
| | | }, { |
| | | MenuID: 'systemManageViewInterface', |
| | |
| | | import demo4 from '@/assets/img/demo4.jpg' |
| | | import demo5 from '@/assets/img/demo5.jpg' |
| | | |
| | | const Card = ({ id, cardIds, card, moveCard, findCard, editCard, delCard, changeStyle }) => { |
| | | const Card = ({ id, cardIds, card, moveCard, findCard, editCard, delCard, copyCard, changeStyle }) => { |
| | | const originalIndex = findCard(id).index |
| | | const [{ isDragging }, drag] = useDrag({ |
| | | item: { type: 'action', id, originalIndex }, |
| | |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="edit" title="编辑" type="edit" onClick={() => editCard(id)} /> |
| | | <Icon className="copy" title="复制" type="copy" onClick={() => copyCard(id)} /> |
| | | <Icon className="close" title="删除" type="close" onClick={() => delCard(id)} /> |
| | | <Icon className="style" title="调整样式" onClick={() => changeStyle(id)} type="font-colors" /> |
| | | </div> |
| | |
| | | import update from 'immutability-helper' |
| | | |
| | | import Card from './card' |
| | | import Utils from '@/utils/utils.js' |
| | | import Action from './action' |
| | | import './index.scss' |
| | | |
| | |
| | | const editCard = id => { |
| | | const { card } = findCard(id) |
| | | handleMenu(card) |
| | | } |
| | | |
| | | const copyCard = id => { |
| | | const { card, index: overIndex } = findCard(id) |
| | | let copycard = fromJS(card).toJS() |
| | | |
| | | copycard.uuid = Utils.getuuid() |
| | | copycard.copyType = 'customCardElement' |
| | | copycard.focus = true |
| | | |
| | | let _val = '' |
| | | |
| | | try { |
| | | _val = window.btoa(window.encodeURIComponent(JSON.stringify(copycard))) |
| | | } catch { |
| | | console.warn('Stringify Failure') |
| | | _val = '' |
| | | } |
| | | |
| | | if (_val) { |
| | | let oInput = document.createElement('input') |
| | | oInput.value = _val |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | } |
| | | |
| | | const _cards = update(cards, { $splice: [[overIndex + 1, 0, copycard]] }) |
| | | |
| | | handleList(_cards) |
| | | handleMenu(copycard) |
| | | } |
| | | |
| | | const changeStyle = id => { |
| | |
| | | cardIds={cardIds} |
| | | card={card} |
| | | moveCard={moveCard} |
| | | copyCard={copyCard} |
| | | editCard={editCard} |
| | | changeStyle={changeStyle} |
| | | delCard={delCard} |
| | |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | return !is(fromJS(this.props.cards), fromJS(nextProps.cards)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card, menu } = this.props |
| | | const { card } = this.props |
| | | |
| | | if (card.isNew) { |
| | | let dataName = '' |
| | | |
| | | if (card.floor === 1) { |
| | | while (!dataName) { |
| | | let _dataName = Utils.getdataName() |
| | | if (menu.components.filter(com => com.dataName === _dataName).length === 0) { |
| | | dataName = _dataName |
| | | } |
| | | } |
| | | } |
| | | |
| | | let subcards = null |
| | | |
| | | if (card.config) { |
| | |
| | | format: 'array', // 组件属性 - 数据格式 |
| | | pageable: true, // 组件属性 - 是否可分页 |
| | | switchable: true, // 组件属性 - 数据是否可切换 |
| | | dataName: dataName, |
| | | dataName: card.dataName || '', |
| | | width: 24, |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 50px; |
| | | min-height: 20px; |
| | | |
| | | .card-control { |
| | | position: absolute; |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 50px; |
| | | min-height: 20px; |
| | | } |
| | | |
| | | .card-item:hover { |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card, menu } = this.props |
| | | const { card } = this.props |
| | | |
| | | if (card.isNew) { |
| | | let dataName = '' |
| | | if (card.floor === 1) { |
| | | while (!dataName) { |
| | | let _dataName = Utils.getdataName() |
| | | if (menu.components.filter(com => com.dataName === _dataName).length === 0) { |
| | | dataName = _dataName |
| | | } |
| | | } |
| | | } |
| | | |
| | | let subcards = null |
| | | |
| | | if (card.config) { |
| | |
| | | format: 'object', // 组件属性 - 数据格式 |
| | | pageable: false, // 组件属性 - 是否可分页 |
| | | switchable: true, // 组件属性 - 数据是否可切换 |
| | | dataName: dataName, |
| | | dataName: card.dataName || '', |
| | | width: 24, |
| | | name: card.name, |
| | | subtype: card.subtype, |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 50px; |
| | | min-height: 20px; |
| | | |
| | | .card-control { |
| | | position: absolute; |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 50px; |
| | | min-height: 20px; |
| | | } |
| | | |
| | | .card-item:hover { |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card, menu } = this.props |
| | | const { card } = this.props |
| | | |
| | | if (card.isNew) { |
| | | let _plot = { |
| | |
| | | _plot.shape = 'hv' |
| | | } |
| | | |
| | | let dataName = '' |
| | | |
| | | if (card.floor === 1) { |
| | | while (!dataName) { |
| | | let _dataName = Utils.getdataName() |
| | | if (menu.components.filter(com => com.dataName === _dataName).length === 0) { |
| | | dataName = _dataName |
| | | } |
| | | } |
| | | } |
| | | |
| | | let _card = { |
| | | uuid: card.uuid, |
| | | type: card.type, |
| | |
| | | format: 'array', // 组件属性 - 数据格式 |
| | | pageable: false, // 组件属性 - 是否可分页 |
| | | switchable: false, // 组件属性 - 数据是否可切换 |
| | | dataName: dataName, |
| | | dataName: card.dataName || '', |
| | | width: _plot.width, |
| | | name: _plot.name, |
| | | subtype: card.subtype, |
| | | setting: { interType: 'system' }, |
| | | style: { |
| | | fontSize: '16px', |
| | | borderWidth: '1px', borderColor: 'rgb(217, 217, 217)', |
| | | marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' |
| | | }, |
| | | headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: 'rgb(217, 217, 217)' }, |
| | | columns: [], |
| | | scripts: [], |
| | | search: [], |
| | |
| | | MKEmitter.emit('addButton', card.uuid, newcard) |
| | | } |
| | | |
| | | changeTitleStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', [card.uuid, 'header'], ['font', 'border'], card.headerStyle) |
| | | } |
| | | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', [card.uuid], ['font', 'background', 'border', 'padding', 'margin'], card.style) |
| | | MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style) |
| | | } |
| | | |
| | | getStyle = (comIds, style) => { |
| | | const { card } = this.state |
| | | |
| | | if (comIds.length !== 1 || comIds[0] !== card.uuid) return |
| | | if (comIds[0] !== card.uuid) return |
| | | |
| | | let _card = {...card, style} |
| | | let _card = {} |
| | | if (comIds.length === 1) { |
| | | _card = {...card, style} |
| | | } else if (comIds.length === 2 && comIds[1] === 'header') { |
| | | _card = {...card, headerStyle: style} |
| | | } else { |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | card: _card |
| | |
| | | |
| | | return ( |
| | | <div className="menu-line-chart-edit-box" style={{...card.style, height: card.plot.height || 400}}> |
| | | <div className="chart-header"> |
| | | <span className="chart-title">{card.plot.title || ''}</span> |
| | | <div className="chart-header" style={card.headerStyle}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="style" title="调整样式" onClick={this.changeTitleStyle} type="font-colors" /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <span className="chart-title">{card.plot.title || ''}</span> |
| | | </Popover> |
| | | <SearchComponent |
| | | config={card} |
| | | updatesearch={this.updateComponent} |
| | |
| | | border-bottom: 1px solid #e8e8e8; |
| | | overflow: hidden; |
| | | padding-right: 35px; |
| | | text-decoration: inherit; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | |
| | | >.anticon-tool { |
| | | position: absolute; |
| | |
| | | float: left; |
| | | line-height: 45px; |
| | | margin-left: 10px; |
| | | position: relative; |
| | | z-index: 1; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card, menu } = this.props |
| | | const { card } = this.props |
| | | |
| | | if (card.isNew) { |
| | | let _plot = { |
| | |
| | | _plot.innerRadius = 50 |
| | | } |
| | | |
| | | let dataName = '' |
| | | |
| | | if (card.floor === 1) { |
| | | while (!dataName) { |
| | | let _dataName = Utils.getdataName() |
| | | if (menu.components.filter(com => com.dataName === _dataName).length === 0) { |
| | | dataName = _dataName |
| | | } |
| | | } |
| | | } |
| | | |
| | | let _card = { |
| | | uuid: card.uuid, |
| | | type: card.type, |
| | |
| | | format: 'array', // 组件属性 - 数据格式 |
| | | pageable: false, // 组件属性 - 是否可分页 |
| | | switchable: false, // 组件属性 - 数据是否可切换 |
| | | dataName: dataName, |
| | | dataName: card.dataName || '', |
| | | width: _plot.width, |
| | | name: _plot.name, |
| | | subtype: card.subtype, |
| | | setting: { interType: 'system' }, |
| | | style: { |
| | | fontSize: '16px', |
| | | borderWidth: '1px', borderColor: 'rgb(217, 217, 217)', |
| | | marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' |
| | | }, |
| | | headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: 'rgb(217, 217, 217)' }, |
| | | columns: [], |
| | | scripts: [], |
| | | search: [], |
| | |
| | | MKEmitter.emit('addSearch', card.uuid, newcard) |
| | | } |
| | | |
| | | changeTitleStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', [card.uuid, 'header'], ['font', 'border'], card.headerStyle) |
| | | } |
| | | |
| | | changeStyle = () => { |
| | | const { card } = this.state |
| | | |
| | | MKEmitter.emit('changeStyle', [card.uuid], ['font', 'background', 'border', 'padding', 'margin'], card.style) |
| | | MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style) |
| | | } |
| | | |
| | | getStyle = (comIds, style) => { |
| | | const { card } = this.state |
| | | |
| | | if (comIds.length !== 1 || comIds[0] !== card.uuid) return |
| | | if (comIds[0] !== card.uuid) return |
| | | |
| | | let _card = {...card, style} |
| | | let _card = {} |
| | | if (comIds.length === 1) { |
| | | _card = {...card, style} |
| | | } else if (comIds.length === 2 && comIds[1] === 'header') { |
| | | _card = {...card, headerStyle: style} |
| | | } else { |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | card: _card |
| | |
| | | |
| | | return ( |
| | | <div className="menu-pie-chart-edit-box" style={{...card.style, height: card.plot.height || 400}}> |
| | | <div className="chart-header"> |
| | | <span className="chart-title">{card.plot.title || ''}</span> |
| | | <div className="chart-header" style={card.headerStyle}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <Icon className="style" title="调整样式" onClick={this.changeTitleStyle} type="font-colors" /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <span className="chart-title">{card.plot.title || ''}</span> |
| | | </Popover> |
| | | <SearchComponent |
| | | config={card} |
| | | updatesearch={this.updateComponent} |
| | |
| | | border-bottom: 1px solid #e8e8e8; |
| | | overflow: hidden; |
| | | padding-right: 35px; |
| | | text-decoration: inherit; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | |
| | | >.anticon-tool { |
| | | position: absolute; |
| | |
| | | float: left; |
| | | line-height: 45px; |
| | | margin-left: 10px; |
| | | position: relative; |
| | | z-index: 1; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | i++ |
| | | } |
| | | |
| | | let dataName = '' |
| | | while (!dataName) { |
| | | let _dataName = Utils.getdataName() |
| | | if (config.components.filter(com => com.dataName === _dataName).length === 0) { |
| | | dataName = _dataName |
| | | } |
| | | } |
| | | |
| | | let newcard = { |
| | | uuid: Utils.getuuid(), |
| | |
| | | subtype: item.subtype, |
| | | config: item.config, |
| | | width: item.width || 24, |
| | | dataName: dataName, |
| | | name: name, |
| | | floor: config.floor ? (config.floor + 1) : 2, // 组件的层级 |
| | | isNew: true // 新添加标志,用于初始化 |
| | |
| | | this.setState({loading: true}) |
| | | this.verifyRef.submitDataSource().then(res => { |
| | | |
| | | if (res.columns) { |
| | | res.columns = res.columns.map(item => { |
| | | |
| | | if (/int/ig.test(item.datatype)) { |
| | | item.type = 'number' |
| | | item.decimal = 0 |
| | | } else if (/Decimal/ig.test(item.datatype)) { |
| | | item.type = 'number' |
| | | item.decimal = +item.datatype.replace(/^Decimal\(18,/ig, '').replace(/\)/ig, '') |
| | | } else { |
| | | item.type = 'text' |
| | | item.fieldlength = +item.datatype.replace(/^Nvarchar\(/ig, '').replace(/\)/ig, '') |
| | | } |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | this.setState({loading: false, visible: false}) |
| | | this.props.updateConfig({...config, ...res}) |
| | | }, () => { |
| | |
| | | i++ |
| | | } |
| | | |
| | | let dataName = '' |
| | | while (!dataName) { |
| | | let _dataName = Utils.getdataName() |
| | | if (menu.components.filter(com => com.dataName === _dataName).length === 0) { |
| | | dataName = _dataName |
| | | } |
| | | } |
| | | |
| | | let newcard = { |
| | | uuid: Utils.getuuid(), |
| | | type: item.component, |
| | | subtype: item.subtype, |
| | | config: item.config, |
| | | width: item.width || 24, |
| | | dataName: dataName, |
| | | name: name, |
| | | floor: 1, // 组件的层级 |
| | | isNew: true // 新添加标志,用于初始化 |
| | |
| | | * 3、设置编辑参数项-formlist |
| | | */ |
| | | handleForm = (_card) => { |
| | | const { componentConfig } = this.props |
| | | const { componentConfig, menu } = this.props |
| | | let card = fromJS(_card).toJS() |
| | | |
| | | const { config } = this.state |
| | |
| | | } |
| | | |
| | | let roleList = [] |
| | | if (this.props.sysRoles && this.props.sysRoles.length > 0) { |
| | | roleList = this.props.sysRoles.map(role => { |
| | | if (menu.sysRoles && menu.sysRoles.length > 0) { |
| | | roleList = menu.sysRoles.map(role => { |
| | | return { |
| | | uuid: role.uuid, |
| | | field: role.value, |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | sysRoles: state.sysRoles, |
| | | menu: state.customMenu |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Collapse, Form, Input, Col, Icon, InputNumber, Select, Radio, Drawer } from 'antd' |
| | | import { Collapse, Form, Input, Col, Icon, InputNumber, Select, Radio, Drawer, Button } from 'antd' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/mob.js' |
| | |
| | | width="300" |
| | | className="menu-style-drawer" |
| | | closable={true} |
| | | maskClosable={false} |
| | | onClose={this.onCloseDrawer} |
| | | maskStyle={{opacity: 0.1}} |
| | | visible={this.state.visible} |
| | |
| | | label={<Icon title="圆角" type="radius-setting" />} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={card.borderRadius || ''} options={['px', '%']} onChange={(val) => this.changeNormalStyle(val, 'borderRadius')}/> |
| | | <StyleInput defaultValue={card.borderRadius || '0px'} options={['px', '%']} onChange={(val) => this.changeNormalStyle(val, 'borderRadius')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | {options.includes('margin') ? <Panel header="外边距" key="margin"> |
| | | <Col span={12}> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<Icon title="上边距" type="arrow-up"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={card.marginTop || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'marginTop')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<Icon title="下边距" type="arrow-down"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={card.marginBottom || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'marginBottom')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<Icon title="左边距" type="arrow-left"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={card.marginLeft || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'marginLeft')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<Icon title="右边距" type="arrow-right"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={card.marginRight || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'marginRight')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | {options.includes('padding') ? <Panel header="内边距" key="padding"> |
| | | <Col span={12}> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<Icon title="上边距" type="arrow-up"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={card.paddingTop || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingTop')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<Icon title="下边距" type="arrow-down"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={card.paddingBottom || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingBottom')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<Icon title="左边距" type="arrow-left"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={card.paddingLeft || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingLeft')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<Icon title="右边距" type="arrow-right"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={card.paddingRight || '0px'} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingRight')}/> |
| | | </Form.Item> |
| | |
| | | </Panel> : null} |
| | | </Collapse> : null} |
| | | </Form> |
| | | <div style={{textAlign: 'right'}}> |
| | | <Button type="link" style={{color: '#ffffff', marginTop: '20px'}} onClick={this.onCloseDrawer}>关闭</Button> |
| | | </div> |
| | | </div> |
| | | </Drawer> |
| | | ) |
| | |
| | | color: rgba(255, 255, 255, 0.85); |
| | | background-color: #202735; |
| | | border-top: 1px solid #202735; |
| | | .ant-collapse-content-box { |
| | | padding: 5px 10px; |
| | | } |
| | | .ant-collapse-content-box::after { |
| | | content: ' '; |
| | | display: block; |
| | | clear: both; |
| | | } |
| | | .ant-input-number { |
| | | width: 100%; |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Menu, Popover, Input } from 'antd' |
| | | import { Select, Input } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | | const { Option } = Select |
| | | |
| | | class StyleInput extends Component { |
| | | static propTpyes = { |
| | |
| | | |
| | | state = { |
| | | value: '', |
| | | parseVal: '', |
| | | width: '', |
| | | unit: '', |
| | | options: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { defaultValue, value, options } = this.props |
| | | let val = '' |
| | | let unit = '' |
| | | let _options = ['px'] |
| | | |
| | | if (value !== undefined) { |
| | |
| | | _options = options |
| | | } |
| | | |
| | | if (val === 'auto') { |
| | | val = '' |
| | | unit = _options[0] |
| | | |
| | | if (val) { |
| | | if (val.indexOf('px') > -1) { |
| | | unit = 'px' |
| | | } else if (val.indexOf('%') > -1) { |
| | | unit = '%' |
| | | } else if (val.indexOf('vw') > -1) { |
| | | unit = 'vw' |
| | | } else if (val.indexOf('vh') > -1) { |
| | | unit = 'vh' |
| | | } |
| | | } |
| | | |
| | | let _val = parseInt(val) |
| | |
| | | _val = '' |
| | | } |
| | | |
| | | this.setState({value: val, options: _options, parseVal: _val}) |
| | | this.setState({value: _val, options: _options, unit}) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (nextProps.value !== undefined && nextProps.value !== this.state.value) { |
| | | this.setState({ value: nextProps.value }) |
| | | let val = nextProps.value |
| | | let unit = this.state.unit |
| | | |
| | | if (val) { |
| | | if (val.indexOf('px') > -1) { |
| | | unit = 'px' |
| | | } else if (val.indexOf('%') > -1) { |
| | | unit = '%' |
| | | } else if (val.indexOf('vw') > -1) { |
| | | unit = 'vw' |
| | | } else if (val.indexOf('vh') > -1) { |
| | | unit = 'vh' |
| | | } |
| | | } |
| | | |
| | | let _val = parseInt(val) |
| | | |
| | | if (isNaN(_val)) { |
| | | _val = '' |
| | | } |
| | | |
| | | this.setState({value: _val, unit}) |
| | | } |
| | | } |
| | | |
| | | componentDidMount () { |
| | | this.setState({width: (this.input.offsetWidth - 10) + 'px'}) |
| | | } |
| | | componentDidMount () {} |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新,清除快捷键设置 |
| | |
| | | } |
| | | |
| | | changeValue = (e) => { |
| | | const { unit } = this.state |
| | | let val = e.target.value |
| | | let _val = parseInt(val) |
| | | |
| | | |
| | | if (isNaN(_val)) { |
| | | _val = '' |
| | | } |
| | | |
| | | this.setState({ |
| | | value: val, |
| | | parseVal: _val |
| | | }) |
| | | |
| | | if (!val && this.props.onChange) { |
| | | this.props.onChange('0px') |
| | | } |
| | | } |
| | | |
| | | submitValue = (val) => { |
| | | this.setState({ |
| | | value: val |
| | | value: _val, |
| | | }) |
| | | |
| | | if (this.props.onChange) { |
| | | this.props.onChange(val) |
| | | if (!_val) { |
| | | this.props.onChange('0px') |
| | | } else { |
| | | this.props.onChange(`${_val}${unit}`) |
| | | } |
| | | } |
| | | } |
| | | |
| | | changeUnit = (val) => { |
| | | const { value } = this.state |
| | | |
| | | this.setState({unit: val}) |
| | | if (value && this.props.onChange) { |
| | | this.props.onChange(`${value}${val}`) |
| | | } |
| | | } |
| | | |
| | | render () { |
| | | const { value, options, parseVal, width } = this.state |
| | | const { value, options, unit } = this.state |
| | | |
| | | return ( |
| | | <Popover placement="bottom" overlayClassName="style-input-popover" content={ |
| | | parseVal !== '' ? |
| | | <Menu> |
| | | {options.map(option => ( |
| | | <Menu.Item key={option} style={{width: width}} onClick={() => this.submitValue(`${parseVal}${option}`)}>{parseVal} {option}</Menu.Item> |
| | | ))} |
| | | </Menu> : null |
| | | } trigger="hover"> |
| | | <div ref={dom => { this.input = dom }} style={{lineHeight: '32px'}}> |
| | | <Input value={value} onChange={this.changeValue}/> |
| | | </div> |
| | | </Popover> |
| | | <div className="style-input-box"> |
| | | <Input value={value} addonAfter={ |
| | | <Select value={unit} onChange={this.changeUnit}> |
| | | {options.map(item => <Option key={item} value={item}>{item}</Option>)} |
| | | </Select> |
| | | } onChange={this.changeValue}/> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | |
| | | .style-input-popover { |
| | | padding-top: 0px; |
| | | z-index: 1090!important; |
| | | .ant-popover-inner-content { |
| | | padding: 0px 5px; |
| | | .ant-menu-root.ant-menu-vertical { |
| | | border: 0; |
| | | .ant-menu-item { |
| | | height: 30px; |
| | | cursor: pointer; |
| | | line-height: 30px; |
| | | } |
| | | .ant-menu-item:not(:last-child) { |
| | | margin-bottom: 0px; |
| | | } |
| | | .ant-menu-item:first-child { |
| | | margin-top: 10px; |
| | | } |
| | | .ant-menu-item:last-child { |
| | | margin-bottom: 10px; |
| | | } |
| | | .style-input-box { |
| | | line-height: 32px; |
| | | .ant-select { |
| | | width: 60px!important; |
| | | .ant-select-selection { |
| | | color: rgba(0, 0, 0, 0.75)!important; |
| | | } |
| | | } |
| | | .ant-popover-arrow { |
| | | display: none; |
| | | } |
| | | .ant-popover-content::before { |
| | | content: ' '; |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 5px; |
| | | top: -5px; |
| | | } |
| | | .ant-popover-content::after { |
| | | content: ' '; |
| | | position: absolute; |
| | | width: 100%; |
| | | height: 5px; |
| | | bottom: -5px; |
| | | } |
| | | } |
| | | .style-input-popover.ant-popover-placement-top { |
| | | padding-bottom: 0px; |
| | | } |
| | |
| | | <Popover content={ |
| | | <SketchPicker color={ color } presetColors={presetColors} onChange={ this.handleChange } /> |
| | | } overlayClassName="color-sketch-popover" placement="bottomRight" title="" trigger="click"> |
| | | <div className="color-sketch-block-inner" style={ {background: color} }></div> |
| | | <div className="color-sketch-block-box"> |
| | | <div className="color-sketch-block-inner" style={ {background: color} }></div> |
| | | </div> |
| | | </Popover> |
| | | <div className="color-sketch-value">{color}</div> |
| | | </div> |
| | |
| | | height: 25px; |
| | | width: 100%; |
| | | |
| | | .color-sketch-block-box { |
| | | display: inline-block; |
| | | width: calc(100% - 160px); |
| | | height: 100%; |
| | | border-radius: 2px; |
| | | background: #ffffff url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==') left center; |
| | | } |
| | | .color-sketch-block-inner { |
| | | display: inline-block; |
| | | cursor: pointer; |
| | | border-radius: 2px; |
| | | box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); |
| | | width: calc(100% - 160px); |
| | | width: 100%; |
| | | height: 100%; |
| | | border-radius: 2px; |
| | | } |
| | | .color-sketch-value { |
| | | display: inline-block; |
| | |
| | | getContent = (card) => { |
| | | const { data, BID, cards } = this.props |
| | | |
| | | if (card.eleType === 'text' || card.eleType === 'number') { |
| | | if (card.eleType === 'text') { |
| | | let val = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | |
| | | val = data[card.field] |
| | | } |
| | | |
| | | if (val !== '' && card.format) { |
| | | if (card.format === 'YYYY-MM-DD' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1])/.test(val)) { |
| | | val = `${val.substr(0, 4)}-${val.substr(5, 2)}-${val.substr(8, 2)}` |
| | | } |
| | | } |
| | | |
| | | if (val !== '') { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | } |
| | | |
| | | return ( |
| | | <Col key={card.uuid} span={card.width}> |
| | | <div style={card.style}> |
| | | <div className={'ant-mk-text line' + card.height} style={{height: card.innerHeight || 21}}>{val}</div> |
| | | </div> |
| | | </Col> |
| | | ) |
| | | } else if (card.eleType === 'number') { |
| | | let val = '' |
| | | |
| | | if (card.datatype === 'static') { |
| | | val = card.value |
| | | } else if (data.hasOwnProperty(card.field)) { |
| | | val = data[card.field] |
| | | } |
| | | |
| | | if (val !== '' && typeof(val) === 'number') { |
| | | if (card.format === 'percent') { |
| | | val = val * 100 |
| | | } |
| | | |
| | | if (card.col && card.col.type === 'number') { |
| | | val = val.toFixed(card.col.decimal || 0) |
| | | } else { |
| | | val = '' + val |
| | | } |
| | | |
| | | if (card.format === 'thdSeparator') { |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | } |
| | | |
| | | if (val !== '') { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | } |
| | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _card = _config.subcards[0] |
| | | let _cols = new Map() |
| | | |
| | | _config.columns.forEach(item => { |
| | | _cols.set(item.field, item) |
| | | }) |
| | | |
| | | _card.elements = _card.elements.map(item => { |
| | | if (item.field && _cols.has(item.field)) { |
| | | item.col = _cols.get(item.field) |
| | | } |
| | | return item |
| | | }) |
| | | _card.backElements = _card.backElements.map(item => { |
| | | if (item.field && _cols.has(item.field)) { |
| | | item.col = _cols.get(item.field) |
| | | } |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | card: _config.subcards[0], |
| | | card: _card, |
| | | arr_field: _config.columns.map(col => col.field).join(','), |
| | | }, () => { |
| | | this.loadData() |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 50px; |
| | | min-height: 20px; |
| | | display: flex; |
| | | position: relative; |
| | | |
| | |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let _config = fromJS(this.props.config).toJS() |
| | | let _cols = new Map() |
| | | |
| | | _config.columns.forEach(item => { |
| | | _cols.set(item.field, item) |
| | | }) |
| | | |
| | | _config.subcards.forEach(card => { |
| | | card.elements = card.elements.map(item => { |
| | | if (item.field && _cols.has(item.field)) { |
| | | item.col = _cols.get(item.field) |
| | | } |
| | | return item |
| | | }) |
| | | card.backElements = card.backElements.map(item => { |
| | | if (item.field && _cols.has(item.field)) { |
| | | item.col = _cols.get(item.field) |
| | | } |
| | | return item |
| | | }) |
| | | }) |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | min-height: 50px; |
| | | min-height: 20px; |
| | | position: relative; |
| | | |
| | | .card-row-list::after { |
| | |
| | | <Spin /> |
| | | </div> : null |
| | | } |
| | | {showHeader ? <div className="chart-header"> |
| | | {showHeader ? <div className="chart-header" style={config.headerStyle}> |
| | | <span className="chart-title">{title}</span> |
| | | {/* <searchLine /> */} |
| | | {plot.datatype === 'statistics' && chartFields.length > 0 ? <Select |
| | |
| | | |
| | | > .chart-header { |
| | | height: 45px; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | // border-bottom: 1px solid #e8e8e8; |
| | | overflow: hidden; |
| | | text-decoration: inherit; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | |
| | | .chart-title { |
| | | // font-size: 16px; |
| | |
| | | <Spin /> |
| | | </div> : null |
| | | } |
| | | {showHeader ? <div className="chart-header"> |
| | | {showHeader ? <div className="chart-header" style={config.headerStyle}> |
| | | <span className="chart-title">{title}</span> |
| | | {/* <searchLine /> */} |
| | | </div> : null} |
| | |
| | | |
| | | > .chart-header { |
| | | height: 45px; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | // border-bottom: 1px solid #e8e8e8; |
| | | overflow: hidden; |
| | | text-decoration: inherit; |
| | | font-weight: inherit; |
| | | font-style: inherit; |
| | | |
| | | .chart-title { |
| | | // font-size: 16px; |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { connect } from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Row, Col, Empty } from 'antd' |
| | | import { Row, Col, Empty, notification } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | import Api from '@/api' |
| | | import options from '@/store/options.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import Utils from '@/utils/utils.js' |
| | | import './index.scss' |
| | | |
| | | // 通用组件 |
| | | const AntvBarAndLine = asyncSpinComponent(() => import('@/tabviews/custom/components/chart/antv-bar-line')) |
| | | const MainSearch = asyncSpinComponent(() => import('@/tabviews/custom/components/search/main-search')) |
| | | const AntvPie = asyncSpinComponent(() => import('@/tabviews/custom/components/chart/antv-pie')) |
| | | const AntvTabs = asyncSpinComponent(() => import('@/tabviews/custom/components/tabs/antv-tabs')) |
| | | const AntvBarAndLine = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-bar-line')) |
| | | const MainSearch = asyncComponent(() => import('@/tabviews/custom/components/search/main-search')) |
| | | const AntvPie = asyncComponent(() => import('@/tabviews/custom/components/chart/antv-pie')) |
| | | const AntvTabs = asyncComponent(() => import('@/tabviews/custom/components/tabs/antv-tabs')) |
| | | const DataCard = asyncComponent(() => import('@/tabviews/custom/components/card/data-card')) |
| | | const PropCard = asyncComponent(() => import('@/tabviews/custom/components/card/prop-card')) |
| | | |
| | | class TabTransfer extends Component { |
| | | static propTpyes = { |
| | |
| | | |
| | | state = { |
| | | mainSearch: [], |
| | | self: false |
| | | self: false, |
| | | data: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, mainSearch } = this.props |
| | | |
| | | // 获取主搜索条件 |
| | | let _mainSearch = [] |
| | | let self = false |
| | |
| | | } |
| | | }) |
| | | |
| | | this.setState({mainSearch: self ? _mainSearch : fromJS(mainSearch).toJS(), self}) |
| | | if (!self) { |
| | | _mainSearch = fromJS(mainSearch).toJS() |
| | | } |
| | | |
| | | let params = [] |
| | | config.components.forEach(component => { |
| | | if (component.type === 'tabs') return |
| | | |
| | | if (!component.format || (component.subtype === 'propcard' && component.wrap.datatype === 'static')) return |
| | | |
| | | if (component.dataName && !component.pageable && component.setting.interType === 'system' && component.setting.onload === 'true' && component.setting.sync === 'true') { |
| | | let param = this.getDefaultParam(component, _mainSearch) |
| | | params.push(param) |
| | | } else { |
| | | component.setting.sync = 'false' |
| | | } |
| | | }) |
| | | |
| | | this.setState({mainSearch: _mainSearch, self}) |
| | | this.loadmaindata(params) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 获取系统存储过程 sPC_Get_TableData 的参数 |
| | | */ |
| | | getDefaultParam = (component, mainSearch) => { |
| | | const { columns, search, setting, dataName, format } = component |
| | | |
| | | let searchlist = [] |
| | | if (search && search.length > 0) { |
| | | searchlist = Utils.initMainSearch(search) |
| | | } |
| | | if (setting.useMSearch === 'true') { |
| | | searchlist = [...mainSearch, ...searchlist] |
| | | } |
| | | |
| | | let arr_field = columns.map(col => col.field) |
| | | let _dataresource = setting.dataresource |
| | | let _customScript = setting.customScript |
| | | |
| | | if (setting.queryType === 'statistics' || _customScript) { |
| | | let allSearch = Utils.getAllSearchOptions(searchlist) |
| | | let regoptions = allSearch.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | } |
| | | }) |
| | | |
| | | regoptions.forEach(item => { |
| | | if (_dataresource && setting.queryType === 'statistics') { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | } |
| | | if (_customScript) { |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | let _search = '' |
| | | if (setting.queryType !== 'statistics' && _dataresource) { |
| | | _search = Utils.joinMainSearchkey(searchlist) |
| | | _search = _search ? 'where ' + _search : '' |
| | | } |
| | | |
| | | if (setting.order && _dataresource) { |
| | | _dataresource = `select top 1000 ${arr_field.join(',')} from (select ${arr_field.join(',')} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` |
| | | } else if (_dataresource) { |
| | | _dataresource = `select top 1000 ${arr_field.join(',')} from ${_dataresource} ${_search} ` |
| | | } |
| | | |
| | | // 测试系统打印查询语句 |
| | | if ((options.sysType === 'local' && !window.GLOB.systemType) || window.debugger === true) { |
| | | _customScript && console.log(`${_dataresource ? '' : '/*不执行默认sql*/\n'}${_customScript}`) |
| | | _dataresource && console.log(_dataresource) |
| | | } |
| | | |
| | | return { |
| | | name: dataName, |
| | | columns: columns, |
| | | par_tablename: '', |
| | | type: format === 'array' ? format : '', |
| | | primaryKey: setting.primaryKey || '', |
| | | foreign_key: '', |
| | | sql: _dataresource, |
| | | script: _customScript |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 主表数据加载 |
| | | */ |
| | | loadmaindata = (params) => { |
| | | if (!params || params.length === 0) return |
| | | let LText_field = [] |
| | | let LText = params.map((item, index) => { |
| | | let _sql = item.sql |
| | | let _script = item.script |
| | | |
| | | if (index === 0) { |
| | | _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg ='' |
| | | ${_script} |
| | | ` |
| | | } |
| | | |
| | | item.columns.forEach(cell => { |
| | | LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`) |
| | | }) |
| | | return `Select '${item.name}' as tablename,'${window.btoa(window.encodeURIComponent(_sql))}' as LText,'${window.btoa(window.encodeURIComponent(_script))}' as Lcustomize,'${item.type}' as table_type,'${item.primaryKey}' as primary_key,'${item.par_tablename}' as par_tablename,'${item.foreign_key}' as foreign_key,'${index}' as Sort` |
| | | }) |
| | | |
| | | let param = { |
| | | func: 'sPC_Get_structured_data', |
| | | LText: LText.join(' union all '), |
| | | LText_field: LText_field.join(' union all ') |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText_field = Utils.formatOptions(param.LText_field) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.getLocalConfig(param).then(result => { |
| | | if (result.status) { |
| | | delete result.status |
| | | delete result.message |
| | | delete result.ErrMesg |
| | | delete result.ErrCode |
| | | |
| | | this.setState({ |
| | | data: result |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | data: '' |
| | | }) |
| | | notification.error({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | resetSearch = (search) => { |
| | | this.setState({mainSearch: search}) |
| | | } |
| | | |
| | | getComponents = () => { |
| | | const { menuType, dataManager, BID, config } = this.props |
| | | const { mainSearch } = this.state |
| | | const { mainSearch, data } = this.state |
| | | |
| | | if (!config || !config.components || config.components.length === 0) return (<Empty description={false} />) |
| | | |
| | |
| | | if (item.type === 'bar' || item.type === 'line') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvBarAndLine config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | <AntvBarAndLine data={data} config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'pie') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <AntvPie config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | <AntvPie data={data} config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'search') { |
| | |
| | | <AntvTabs config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'card') { |
| | | if (item.subtype === 'datacard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <DataCard config={item} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | </Col> |
| | | ) |
| | | } else if (item.subtype === 'propcard') { |
| | | return ( |
| | | <Col span={item.width} key={item.uuid}> |
| | | <PropCard config={item} data={data} BID={BID} mainSearch={mainSearch} menuType={menuType} dataManager={dataManager} /> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | return null |
| | | } |
| | | } else { |
| | | return null |
| | | } |
| | |
| | | import './index.scss' |
| | | |
| | | const TabTransfer = asyncComponent(() => import('../../share/tabtransfer')) |
| | | |
| | | const { TabPane } = Tabs |
| | | |
| | | class antvBarLineChart extends Component { |
| | |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { refreshTabView } from '@/store/action' |
| | | |
| | | import NotFount from '@/components/404' |
| | | import './index.scss' |
| | | |
| | | // 通用组件 |
| | | const AntvBarAndLine = asyncSpinComponent(() => import('./components/chart/antv-bar-line')) |
| | | const AntvPie = asyncSpinComponent(() => import('./components/chart/antv-pie')) |
| | | const AntvTabs = asyncSpinComponent(() => import('./components/tabs/antv-tabs')) |
| | | const DataCard = asyncSpinComponent(() => import('./components/card/data-card')) |
| | | const PropCard = asyncSpinComponent(() => import('./components/card/prop-card')) |
| | | const MainSearch = asyncSpinComponent(() => import('./components/search/main-search')) |
| | | const AntvBarAndLine = asyncComponent(() => import('./components/chart/antv-bar-line')) |
| | | const AntvPie = asyncComponent(() => import('./components/chart/antv-pie')) |
| | | const AntvTabs = asyncComponent(() => import('./components/tabs/antv-tabs')) |
| | | const DataCard = asyncComponent(() => import('./components/card/data-card')) |
| | | const PropCard = asyncComponent(() => import('./components/card/prop-card')) |
| | | const MainSearch = asyncComponent(() => import('./components/search/main-search')) |
| | | |
| | | class CustomPage extends Component { |
| | | static propTpyes = { |
| | |
| | | let config = '' |
| | | let userConfig = null |
| | | |
| | | setTimeout(() => { // 延时加载状态 |
| | | this.setState({ |
| | | loadingview: false |
| | | }) |
| | | }, 1500) |
| | | |
| | | try { // 配置信息解析 |
| | | config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) |
| | | } catch (e) { |
| | |
| | | // 页面配置解析错误时提示 |
| | | if (!config) { |
| | | this.setState({ |
| | | loadingview: false, |
| | | viewlost: true |
| | | }) |
| | | return |
| | |
| | | // 页面未启用时,显示未启用页面 |
| | | if (!config.enabled) { |
| | | this.setState({ |
| | | loadingview: false, |
| | | viewlost: true, |
| | | lostmsg: this.state.dict['main.view.unenabled'] |
| | | }) |
| | |
| | | |
| | | this.setState({ |
| | | BID: param && param.BID ? param.BID : '', |
| | | loadingview: false, |
| | | userConfig: userConfig, |
| | | setting: config.setting, |
| | | config, |
| | |
| | | if (component.floor === 1 && component.dataName && !component.pageable && component.setting.interType === 'system' && component.setting.onload === 'true' && component.setting.sync === 'true') { |
| | | let param = this.getDefaultParam(component, mainSearch) |
| | | params.push(param) |
| | | } else { |
| | | } else if (component.floor === 1) { |
| | | component.setting.sync = 'false' |
| | | } |
| | | |
| | |
| | | let _sql = item.sql |
| | | let _script = item.script |
| | | |
| | | // if (index === 0) { |
| | | // _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg ='' |
| | | // ${_script} |
| | | // ` |
| | | // } |
| | | |
| | | // if (params.length === index + 1) { |
| | | // _sql = `${_sql} |
| | | // aaa: |
| | | // if @ErrorCode!='' |
| | | // begin |
| | | // insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ |
| | | // goto bbb |
| | | // end |
| | | // ` |
| | | // } |
| | | if (index === 0) { |
| | | _script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) select @ErrorCode='',@retmsg ='' |
| | | ${_script} |
| | | ` |
| | | } |
| | | |
| | | item.columns.forEach(cell => { |
| | | LText_field.push(`Select '${item.name}' as tablename,'${cell.field}' as fieldname,'${cell.datatype}' as field_type`) |
| | |
| | | LText: LText.join(' union all '), |
| | | LText_field: LText_field.join(' union all ') |
| | | } |
| | | |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText_field = Utils.formatOptions(param.LText_field) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | copycard.uuid = Utils.getuuid() |
| | | copycard.origin = false |
| | | copycard.copyType = 'action' |
| | | copycard.label = copycard.label + '(copy)' |
| | | copycard.focus = true |
| | | |
| | | copycard.originCard = card |
| | |
| | | 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 { modifyCustomMenu, initPermission } from '@/store/action' |
| | | |
| | | import './index.scss' |
| | | |
| | |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyCustomMenu: (customMenu) => dispatch(modifyCustomMenu(customMenu)) |
| | | modifyCustomMenu: (customMenu) => dispatch(modifyCustomMenu(customMenu)), |
| | | initPermission: (sysRoles, permFuncField) => dispatch(initPermission(sysRoles, permFuncField)) |
| | | } |
| | | } |
| | | |